(function(Mp,ra){typeof exports=="object"&&typeof module=="object"?module.exports=ra():typeof define=="function"&&define.amd?define("agCharts",[],ra):typeof exports=="object"?exports.agCharts=ra():Mp.agCharts=ra()})(this,()=>{var Mp={},ra={exports:Mp};if(typeof gbt>"u")var gbt=function(e){throw new Error("Unknown module: "+e)};var Fy=Object.defineProperty,zN=Object.getOwnPropertyDescriptor,FN=Object.getOwnPropertyNames,h3=Object.prototype.hasOwnProperty,I=(t,e)=>function(){return t&&(e=(0,t[FN(t)[0]])(t=0)),e},sn=(t,e)=>{for(var i in e)Fy(t,i,{get:e[i],enumerable:!0})},u3=(t,e,i,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of FN(e))!h3.call(t,n)&&n!==i&&Fy(t,n,{get:()=>e[n],enumerable:!(s=zN(e,n))||s.enumerable});return t},E=t=>u3(Fy({},"__esModule",{value:!0}),t),M=(t,e,i,s)=>{for(var n=s>1?void 0:s?zN(e,i):e,a=t.length-1,o;a>=0;a--)(o=t[a])&&(n=(s?o(e,i,n):o(n))||n);return s&&n&&Fy(e,i,n),n},et={};sn(et,{error:()=>VN,errorOnce:()=>f3,log:()=>d3,logGroup:()=>m3,reset:()=>y3,table:()=>p3,warn:()=>jN,warnOnce:()=>g3});function d3(...t){console.log(...t)}function jN(t,...e){console.warn(`AG Charts - ${t}`,...e)}function VN(t,...e){typeof t=="object"?console.error("AG Charts error",t,...e):console.error(`AG Charts - ${t}`,...e)}function p3(...t){console.table(...t)}function g3(t,...e){const i=`Logger.warn: ${t}`;cu.has(i)||(jN(t,...e),cu.add(i))}function f3(t,...e){const i=`Logger.error: ${t}`;cu.has(i)||(VN(t,...e),cu.add(i))}function y3(){cu.clear()}function m3(t,e){console.groupCollapsed(t);try{return e()}finally{console.groupEnd()}}var cu,x3=I({"packages/ag-charts-core/src/globals/logger.ts"(){"use strict";cu=new Set}}),b3=I({"packages/ag-charts-core/src/interfaces/moduleDefinition.ts"(){"use strict"}}),Kr,S3=I({"packages/ag-charts-core/src/globals/moduleRegistry.ts"(){"use strict";Kr=class{static[Symbol.iterator](){return this.registeredModules.values()}static register(t){const e=this.registeredModules.get(t.name);if(e&&(e.enterprise||!t.enterprise))throw new Error(`AG Charts - Module '${t.name}' already registered`);this.registeredModules.set(t.name,t)}static registerMany(t){for(const e of t)this.register(e)}static reset(){this.registeredModules.clear()}static detectChartDefinition(t){return this.detectDefinition("chart",t)}static detectSeriesDefinition(t){return this.detectDefinition("series",t)}static detectDefinition(t,e){for(const i of this.registeredModules.values())if(i.type===t&&i.detect(e))return i;throw new Error(`AG Charts - Unknown ${t} type; Check options are correctly structured and series types are specified`)}},Kr.registeredModules=new Map}}),v3=I({"packages/ag-charts-core/src/globals/index.ts"(){"use strict";x3(),S3()}}),M3=I({"packages/ag-charts-core/src/interfaces/globalTypes.ts"(){"use strict"}}),jy,I3=I({"packages/ag-charts-core/src/classes/eventEmitter.ts"(){"use strict";jy=class{constructor(){this.events=new Map}on(t,e){return this.events.has(t)||this.events.set(t,new Set),this.events.get(t)?.add(e),()=>this.off(t,e)}off(t,e){const i=this.events.get(t);i&&(i.delete(e),i.size===0&&this.events.delete(t))}emit(t,e){this.events.get(t)?.forEach(i=>i(e))}clear(t){t?this.events.delete(t):this.events.clear()}}}});function Vy(t){return typeof t>"u"?[]:Array.isArray(t)?t:[t]}function A3(t){return Array.from(new Set(t))}function kM(t,e){return t.reduce((i,s)=>{const n=e(s);return i[n]??(i[n]=[]),i[n].push(s),i},{})}function $a(t,e){if(t==null||e==null||t.length!==e.length)return!1;for(let i=0;i{i.set(s,n)}),t.sort((s,n)=>{const a=i.get(s)??1/0,o=i.get(n)??1/0;return a-o})}var k3=I({"packages/ag-charts-core/src/utils/arrays.ts"(){"use strict"}});function WN(t,e,i){if(t>e)return;let s;for(;e>=t;){const n=Math.floor((e+t)/2);i(n)?(s=n,t=n+1):e=n-1}return s}function UN(t,e,i){if(t>e)return;let s;for(;e>=t;){const n=Math.floor((e+t)/2);i(n)?(s=n,e=n-1):t=n+1}return s}function L3(t,e,i){if(t>e)return;let s;for(;e>=t;){const n=Math.floor((e+t)/2),a=i(n);a==null?t=n+1:(s=a,e=n-1)}return s}var T3=I({"packages/ag-charts-core/src/utils/binarySearch.ts"(){"use strict"}});function C3(t,e){const i=Math.max(t.length,e.length),s=new Set,n=new Set;for(let a=0;a0||n.size>0,added:s,removed:n}}var N3=I({"packages/ag-charts-core/src/utils/diff.ts"(){"use strict"}});function HN(t,e,i){const{leading:s=!0,trailing:n=!0}=i??{};let a,o,r=!1;function l(){n&&o?(a=setTimeout(l,e),t(...o)):r=!1,o=null}function c(...h){r?o=h:(r=!0,a=setTimeout(l,e),s?t(...h):o=h)}return Object.assign(c,{cancel(){clearTimeout(a),r=!1,o=null}})}var O3=I({"packages/ag-charts-core/src/utils/functions.ts"(){"use strict"}});function*lc(...t){for(const e of t)yield*e}function w3(t){return t!=null&&typeof t=="object"&&Symbol.iterator in t?t:[t]}function Ip(t){for(const e of t)return e;throw new Error("AG Charts - no first() value found")}var E3=I({"packages/ag-charts-core/src/utils/iterators.ts"(){"use strict"}});function R3(t,e="and",i=String,s=1/0){if(t.length===1)return i(t[0]);t=t.map(i);const n=t.pop();if(t.length>=s){const a=t.length-(s-1);return`${t.slice(0,s-1).join(", ")}, and ${a} more ${e} ${n}`}return`${t.join(", ")} ${e} ${n}`}function Ap(t,e=1/0){switch(typeof t){case"undefined":return"undefined";case"number":if(isNaN(t))return"NaN";if(t===1/0)return"Infinity";if(t===-1/0)return"-Infinity";default:return t=JSON.stringify(t),t.length>e?`${t.slice(0,e)}... (+${t.length-e} characters)`:t}}function _3(t){let e=1;for(let i=0;i"u"))if(cc(l))l(c,t)?a[r]=c:n.push({key:r,path:i,value:c,message:XN(o(r),c,l)});else{const h=Wy(c,l,o(r));a[r]=h.valid,n.push(...h.errors)}}for(const r of s)n.push({key:r,path:i,unknown:!0,message:`Unknown option \`${o(r)}\`, ignoring.`});return{valid:a,errors:n}}function XN(t,e,i){const s=Es(i)?i:i[uu],n=s?`; expecting ${s}`:"";return`${t?`Option \`${t}\``:"Value"} cannot be set to \`${Ap(e)}\`${n}, ignoring.`}function Zi(t,e){return Object.assign((i,s)=>t(i,s),{[uu]:e})}function j3(...t){bi(t[0])&&(t=Object.values(t[0]));const e=R3(t,"or",i=>`'${i}'`,6);return Zi(i=>t.includes(i),`a keyword such as ${e}`)}var uu,ZN,kp,$r,V3,G3,W3,Xa,Uy,Rs,Lp,QN,qN,U3,Tp,LM,TM,Hy,H3=I({"packages/ag-charts-core/src/utils/validation.ts"(){"use strict";YN(),$N(),uu=Symbol("description"),ZN=Symbol("required"),kp=(...t)=>Zi((e,i)=>t.every(s=>s(e,i)),t.map(e=>e[uu]).filter(Boolean).join(" and ")),$r=(...t)=>Zi((e,i)=>t.some(s=>s(e,i)),t.map(e=>e[uu]).filter(Boolean).join(" or ")),V3=Zi(ne,"an array"),G3=Zi(KN,"a boolean"),W3=Zi(cc,"a function"),Xa=Zi(zt,"a number"),Uy=Zi(bi,"an object"),Rs=Zi(Es,"a string"),Lp=Zi(t=>hu(t)||(zt(t)||Es(t))&&Dp(new Date(t)),"a date"),QN=(t,e=!0)=>Zi(i=>zt(i)&&(i>t||e&&i===t),`a number greater than ${e?"or equal to ":""}${t}`),qN=(t,e)=>Zi(i=>zt(i)&&i>=t&&i<=e,`a number between ${t} and ${e} inclusive`),U3=QN(0),Tp=qN(0,1),LM=t=>zt(t)||Dp(t),TM=t=>Zi((e,i)=>!LM(e)||!LM(i[t])||eZi((i,s)=>ne(i)&&i.every(n=>t(n,s)),e??`${t[uu]} array`)}}),ot=I({"packages/ag-charts-core/src/main.ts"(){"use strict";v3(),M3(),b3(),I3(),k3(),T3(),N3(),O3(),E3(),YN(),$N(),H3()}});function Go(t){return t?la.document?.[t]:la.document}function ae(t){return t?la.window?.[t]:la.window}function JN(t){la.document=t}function t2(t){la.window=t}var la,CM=I({"packages/ag-charts-community/src/core/globalsProxy.ts"(){"use strict";la={},typeof window<"u"?la.window=window:typeof global<"u"&&(la.window=global.window),typeof document<"u"?la.document=document:typeof global<"u"&&(la.document=global.document)}});function Ot(t,e,i){const s=Go().createElement(t);if(typeof e=="object"&&(i=e,e=void 0),e)for(const n of e.split(" "))s.classList.add(n);return i&&Object.assign(s.style,i),s}function wn(t){return Go().createElementNS("http://www.w3.org/2000/svg",t)}var e2=I({"packages/ag-charts-community/src/core/domElements.ts"(){"use strict";CM()}});function i2(t,e){const i=Go("body"),s=Ot("a",{display:"none"});s.href=t,s.download=e,i.appendChild(s),s.click(),setTimeout(()=>i.removeChild(s))}var Y3=I({"packages/ag-charts-community/src/core/domDownload.ts"(){"use strict";e2(),CM()}}),Lt=I({"packages/ag-charts-community/src/core/index.ts"(){"use strict";Y3(),e2(),CM()}});function K3(){Yy.clear()}function En(t){const e=t.constructor,i=Object.hasOwn(e,"className")?e.className:e.name;if(!i)throw new Error(`The ${e} is missing the 'className' property.`);const s=(Yy.get(i)??0)+1;return Yy.set(i,s),`${i}-${s}`}function $3(){return crypto.randomUUID?.()??X3()}function X3(){const t=new Uint8Array(16);crypto.getRandomValues(t),t[6]=t[6]&15|64,t[8]=t[8]&63|128;let e="";for(let i=0;i=t.x&&e<=t.x+t.width&&i>=t.y&&i<=t.y+t.height}function Q3(t){return t==null||t.height===0||t.width===0||isNaN(t.height)||isNaN(t.width)}function q3(t){let{x:e,y:i,width:s,height:n}=t;return(s==null||s>0)&&(n==null||n>0)?t:(e!=null&&s!=null&&s<0&&(s=-s,e=e-s),i!=null&&n!=null&&n<0&&(n=-n,i=i-n),{x:e,y:i,width:s,height:n})}var Cp,Ky=I({"packages/ag-charts-community/src/util/bboxinterface.ts"(){"use strict";Cp={containsPoint:Z3,isEmpty:Q3,normalize:q3}}}),Np,Op,NM=I({"packages/ag-charts-community/src/util/interpolating.ts"(){"use strict";Np=Symbol("interpolate"),Op=t=>t[Np]!=null}});function $y(t,e,i,s=1/0){const n={nearest:void 0,distanceSquared:s};for(const a of i){const o=a.distanceSquared(t,e);if(o===0)return{nearest:a,distanceSquared:0};oe[1]&&(e[1]=i);return e}function du(t){const[e,i]=Si(t);return i-e}function s2(t,e,i=1e-10){return t>=e[0]-i&&t<=e[1]+i}function ca(t,e,i=1e-10){return t===e||Math.abs(t-e)=1e21){let n;[e,n]=e.split("e"),n!=null&&(i=Number(n))}const s=e.split(".")[1]?.length??0;return Math.max(s-i,0)}var At=I({"packages/ag-charts-community/src/util/number.ts"(){"use strict"}}),pu,ht,Rt=I({"packages/ag-charts-community/src/scene/bbox.ts"(){"use strict";Ky(),NM(),Xy(),At(),pu=class vp{constructor(e,i,s,n){this.x=e,this.y=i,this.width=s,this.height=n}static fromDOMRect({x:e,y:i,width:s,height:n}){return new vp(e,i,s,n)}static merge(e){let i=1/0,s=1/0,n=-1/0,a=-1/0;for(const o of e)o.xn&&(n=o.x+o.width),o.y+o.height>a&&(a=o.y+o.height);return new vp(i,s,n-i,a-s)}static nearestBox(e,i,s){return $y(e,i,s)}toDOMRect(){return{x:this.x,y:this.y,width:this.width,height:this.height,top:this.y,left:this.x,right:this.x+this.width,bottom:this.y+this.height,toJSON(){return{}}}}clone(){const{x:e,y:i,width:s,height:n}=this;return new vp(e,i,s,n)}equals(e){return this.x===e.x&&this.y===e.y&&this.width===e.width&&this.height===e.height}containsPoint(e,i){return Cp.containsPoint(this,e,i)}intersection(e){if(!this.collidesBBox(e))return;const i=It(e.x,this.x,e.x+e.width),s=It(e.y,this.y,e.y+e.height),n=It(e.x,this.x+this.width,e.x+e.width),a=It(e.y,this.y+this.height,e.y+e.height);return new vp(i,s,n-i,a-s)}collidesBBox(e){return this.xe.x&&this.ye.y}computeCenter(){return{x:this.x+this.width/2,y:this.y+this.height/2}}isFinite(){return Number.isFinite(this.x)&&Number.isFinite(this.y)&&Number.isFinite(this.width)&&Number.isFinite(this.height)}distanceSquared(e,i){if(this.containsPoint(e,i))return 0;const s=e-It(this.x,e,this.x+this.width),n=i-It(this.y,i,this.y+this.height);return s*s+n*n}shrink(e,i){if(typeof e=="number")this.applyMargin(e,i);else for(const[s,n]of Object.entries(e))this.applyMargin(n,s);return this.width<0&&(this.width=0),this.height<0&&(this.height=0),this}grow(e,i){if(typeof e=="number")this.applyMargin(-e,i);else for(const[s,n]of Object.entries(e))this.applyMargin(-n,s);return this}applyMargin(e,i){switch(i){case"top":this.y+=e;case"bottom":this.height-=e;break;case"left":this.x+=e;case"right":this.width-=e;break;case"vertical":this.y+=e,this.height-=e*2;break;case"horizontal":this.x+=e,this.width-=e*2;break;case void 0:this.x+=e,this.y+=e,this.width-=e*2,this.height-=e*2;break}}translate(e,i){return this.x+=e,this.y+=i,this}[Np](e,i){return new vp(this.x*(1-i)+e.x*i,this.y*(1-i)+e.y*i,this.width*(1-i)+e.width*i,this.height*(1-i)+e.height*i)}},pu.zero=Object.freeze(new pu(0,0,0,0)),pu.NaN=Object.freeze(new pu(NaN,NaN,NaN,NaN)),ht=pu}});function ct(t){return function(e,i){const s=`__${i}`;e[i]||eH(e,i,s,t)}}function eH(t,e,i,s){const{type:n="normal",changeCb:a,convertor:o,checkDirtyOnAssignment:r=!1}=s??{},l={type:n,changeCb:a,checkDirtyOnAssignment:r,convertor:o};let c;switch(n){case"normal":c=aH(i,l);break;case"transform":c=oH(i);break;case"path":c=rH(i);break}c=nH(sH(iH(c,l),l),l),Object.defineProperty(t,e,{set:c,get:function(){return this[i]},enumerable:!0,configurable:!0})}function iH(t,e){const{convertor:i}=e;return i?function(s){t.call(this,i(s))}:t}function sH(t,e){const{changeCb:i}=e;return i?function(s){const n=t.call(this,s);return n!==wp&&i.call(this,this),n}:t}function nH(t,e){const{checkDirtyOnAssignment:i}=e;return i?function(s){const n=t.call(this,s);return s?._dirty===!0&&this.markDirty(),n}:t}function aH(t,e){const{changeCb:i}=e;return function(s){const n=this[t];return s!==n?(this[t]=s,this.markDirty(),i?.(this),s):wp}}function oH(t){return function(e){const i=this[t];return e!==i?(this[t]=e,this.markDirtyTransform(),e):wp}}function rH(t){return function(e){const i=this[t];return e!==i?(this[t]=e,this._dirtyPath||(this._dirtyPath=!0,this.markDirty()),e):wp}}var wp,qy=I({"packages/ag-charts-community/src/scene/changeDetectable.ts"(){"use strict";wp=Symbol("no-change")}}),EM,Ep,Wo,nn=I({"packages/ag-charts-community/src/scene/node.ts"(){"use strict";ot(),Lt(),Rn(),qy(),EM=(t=>(t[t.All=0]="All",t[t.None=1]="None",t))(EM||{}),Ep=class HU{constructor(e){this.serialNumber=HU._nextSerialNumber++,this.childNodeCounts={groups:0,nonGroups:0,thisComplexity:0,complexity:0},this.id=En(this),this.pointerEvents=0,this._dirty=!0,this.dirtyZIndex=!1,this.isContainerNode=!1,this.visible=!0,this.zIndex=0,this.name=e?.name,this.tag=e?.tag??NaN,this.zIndex=e?.zIndex??0}static toSVG(e,i,s){const n=e?.toSVG();if(n==null||!n.elements.length&&!n.defs?.length)return;const a=wn("svg");if(a.setAttribute("width",String(i)),a.setAttribute("height",String(s)),a.setAttribute("viewBox",`0 0 ${i} ${s}`),n.defs?.length){const o=wn("defs");o.append(...n.defs),a.append(o)}return a.append(...n.elements),a.outerHTML}static*extractBBoxes(e,i){for(const s of e)if(!i||s.visible&&!s.transitionOut){const n=s.getBBox();n&&(yield n)}}get datum(){return this._datum??this.parentNode?.datum}set datum(e){this._datum!==e&&(this._previousDatum=this._datum,this._datum=e)}get previousDatum(){return this._previousDatum}get layerManager(){return this._layerManager}get dirty(){return this._dirty}preRender(e,i=1){this.childNodeCounts.groups=0,this.childNodeCounts.nonGroups=1,this.childNodeCounts.complexity=i,this.childNodeCounts.thisComplexity=i;for(const s of this.children()){const n=s.preRender(e);this.childNodeCounts.groups+=n.groups,this.childNodeCounts.nonGroups+=n.nonGroups,this.childNodeCounts.complexity+=n.complexity}return this.childNodeCounts}render(e){const{stats:i}=e;if(this._dirty=!1,e.debugNodeSearch){const s=this.name??this.id;e.debugNodeSearch.some(n=>typeof n=="string"?n===s:n.test(s))&&(e.debugNodes[this.name??this.id]=this)}i&&(i.nodesRendered++,i.opsPerformed+=this.childNodeCounts.thisComplexity)}_setLayerManager(e){this._layerManager=e,this._debug=e?.debug;for(const i of this.children())i._setLayerManager(e)}sortChildren(e){if(this.dirtyZIndex=!1,!this.childNodes)return;const i=[...this.childNodes].sort(e);this.childNodes.clear();for(const s of i)this.childNodes.add(s)}*traverseUp(e){let i=this;for(e&&(yield i);i=i.parentNode;)yield i}*children(){if(this.childNodes)for(const e of this.childNodes)yield e}*descendants(){for(const e of this.children())yield e,yield*e.descendants()}isLeaf(){return!this.childNodes?.size}isRoot(){return!this.parentNode}append(e){this.childNodes??(this.childNodes=new Set);for(const i of w3(e))i.parentNode?.removeChild(i),this.childNodes.add(i),i.parentNode=this,i._setLayerManager(this.layerManager);this.invalidateCachedBBox(),this.dirtyZIndex=!0,this.markDirty()}appendChild(e){return this.append(e),e}removeChild(e){return this.childNodes?.delete(e)?(delete e.parentNode,e._setLayerManager(),this.invalidateCachedBBox(),this.dirtyZIndex=!0,this.markDirty(),!0):!1}remove(){return this.parentNode?.removeChild(this)??!1}clear(){for(const e of this.children())delete e.parentNode,e._setLayerManager();this.childNodes?.clear(),this.invalidateCachedBBox()}destroy(){this.parentNode?.removeChild(this)}setProperties(e,i){if(i)for(const s of i)this[s]=e[s];else Object.assign(this,e);return this}containsPoint(e,i){return!1}pickNode(e,i,s=!1){if(!this.visible||this.pointerEvents===1||!this.containsPoint(e,i))return;const n=[...this.children()];if(n.length>1e3)for(let a=n.length-1;a>=0;a--){const o=n[a],l=o.containsPoint(e,i)?o.pickNode(e,i):void 0;if(l)return l}else if(n.length)for(let a=n.length-1;a>=0;a--){const o=n[a].pickNode(e,i);if(o)return o}else if(!this.isContainerNode)return this}invalidateCachedBBox(){this.cachedBBox!=null&&(this.cachedBBox=void 0,this.parentNode?.invalidateCachedBBox())}getBBox(){return this.cachedBBox==null&&(this.cachedBBox=Object.freeze(this.computeBBox())),this.cachedBBox}computeBBox(){}markDirty(){const{_dirty:e}=this;this.cachedBBox==null&&e||(this.invalidateCachedBBox(),this._dirty=!0,this.parentNode&&this.parentNode.markDirty())}markClean(){if(this._dirty){this._dirty=!1;for(const e of this.children())e.markClean()}}onZIndexChange(){const{parentNode:e}=this;e&&(e.dirtyZIndex=!0)}toSVG(){}},Ep._nextSerialNumber=0,M([ct()],Ep.prototype,"visible",2),M([ct({changeCb:t=>t.onZIndexChange()})],Ep.prototype,"zIndex",2),Wo=Ep}}),Rp,Jy,tm,RM,xe,hc=I({"packages/ag-charts-community/src/util/color.ts"(){"use strict";At(),Rp=(t,e,i)=>t*(1-i)+e*i,Jy=t=>{const e=t<0?-1:1,i=Math.abs(t);return i<=.04045?t/12.92:e*((i+.055)/1.055)**2.4},tm=t=>{const e=t<0?-1:1,i=Math.abs(t);return i>.0031308?e*(1.055*i**(1/2.4)-.055):12.92*t},RM=class he{constructor(e,i,s,n=1){this.r=It(0,e||0,1),this.g=It(0,i||0,1),this.b=It(0,s||0,1),this.a=It(0,n||0,1)}static validColorString(e){return e.indexOf("#")>=0?!!he.parseHex(e):e.indexOf("rgb")>=0?!!he.stringToRgba(e):he.nameToHex.has(e.toLowerCase())}static fromString(e){if(e.indexOf("#")>=0)return he.fromHexString(e);const i=he.nameToHex.get(e.toLowerCase());if(i)return he.fromHexString(i);if(e.indexOf("rgb")>=0)return he.fromRgbaString(e);throw new Error(`Invalid color string: '${e}'`)}static parseHex(e){e=e.replace(/ /g,"").slice(1);let i;switch(e.length){case 6:case 8:i=[];for(let s=0;sparseInt(s,16)).map(s=>s+s*16);break}if(i?.length>=3&&i.every(s=>s>=0))return i.length===3&&i.push(255),i}static fromHexString(e){const i=he.parseHex(e);if(i){const[s,n,a,o]=i;return new he(s/255,n/255,a/255,o/255)}throw new Error(`Malformed hexadecimal color string: '${e}'`)}static stringToRgba(e){let i=-1,s=-1;for(let r=0;r=0?(c=It(0,c,100),c/=100):r===3?c=It(0,c,1):(c=It(0,c,255),c/=255),o.push(c)}return o}static fromRgbaString(e){const i=he.stringToRgba(e);if(i){if(i.length===3)return new he(i[0],i[1],i[2]);if(i.length===4)return new he(i[0],i[1],i[2],i[3])}throw new Error(`Malformed rgb/rgba color string: '${e}'`)}static fromArray(e){if(e.length===4)return new he(e[0],e[1],e[2],e[3]);if(e.length===3)return new he(e[0],e[1],e[2]);throw new Error("The given array should contain 3 or 4 color components (numbers).")}static fromHSB(e,i,s,n=1){const a=he.HSBtoRGB(e,i,s);return new he(a[0],a[1],a[2],n)}static fromHSL(e,i,s,n=1){const a=he.HSLtoRGB(e,i,s);return new he(a[0],a[1],a[2],n)}static fromOKLCH(e,i,s,n=1){const a=he.OKLCHtoRGB(e,i,s);return new he(a[0],a[1],a[2],n)}static padHex(e){return e.length===1?"0"+e:e}toHexString(){let e="#"+he.padHex(Math.round(this.r*255).toString(16))+he.padHex(Math.round(this.g*255).toString(16))+he.padHex(Math.round(this.b*255).toString(16));return this.a<1&&(e+=he.padHex(Math.round(this.a*255).toString(16))),e}toRgbaString(e=3){const i=[Math.round(this.r*255),Math.round(this.g*255),Math.round(this.b*255)],s=Math.pow(10,e);return this.a!==1?(i.push(Math.round(this.a*s)/s),`rgba(${i.join(", ")})`):`rgb(${i.join(", ")})`}toString(){return this.a===1?this.toHexString():this.toRgbaString()}toHSB(){return he.RGBtoHSB(this.r,this.g,this.b)}static RGBtoOKLCH(e,i,s){const n=Jy(e),a=Jy(i),o=Jy(s),r=Math.cbrt(.4122214708*n+.5363325363*a+.0514459929*o),l=Math.cbrt(.2119034982*n+.6806995451*a+.1073969566*o),c=Math.cbrt(.0883024619*n+.2817188376*a+.6299787005*o),h=.2104542553*r+.793617785*l-.0040720468*c,u=1.9779984951*r-2.428592205*l+.4505937099*c,d=.0259040371*r+.7827717662*l-.808675766*c,p=Math.atan2(d,u)*180/Math.PI,g=h,f=Math.hypot(u,d),x=p>=0?p:p+360;return[g,f,x]}static OKLCHtoRGB(e,i,s){const n=e,a=i*Math.cos(s*Math.PI/180),o=i*Math.sin(s*Math.PI/180),r=(n+.3963377774*a+.2158037573*o)**3,l=(n-.1055613458*a-.0638541728*o)**3,c=(n-.0894841775*a-1.291485548*o)**3,h=4.0767416621*r-3.3077115913*l+.2309699292*c,u=-1.2684380046*r+2.6097574011*l-.3413193965*c,d=-.0041960863*r-.7034186147*l+1.707614701*c,p=tm(h),g=tm(u),f=tm(d);return[p,g,f]}static RGBtoHSL(e,i,s){const n=Math.min(e,i,s),a=Math.max(e,i,s),o=(a+n)/2;let r,l;if(a===n)r=0,l=0;else{const c=a-n;l=o>.5?c/(2-a-n):c/(a+n),a===e?r=(i-s)/c+(i1&&(h-=1),h<1/6?a+(n-a)*6*h:h<1/2?n:h<2/3?a+(n-a)*(2/3-h)*6:a}const r=o(e/360+1/3),l=o(e/360),c=o(e/360-1/3);return[r,l,c]}static RGBtoHSB(e,i,s){const n=Math.min(e,i,s),a=Math.max(e,i,s),o=a===0?0:(a-n)/a;let r=0;if(n!==a){const l=a-n,c=(a-e)/l,h=(a-i)/l,u=(a-s)/l;e===a?r=u-h:i===a?r=2+c-u:r=4+h-c,r/=6,r<0&&(r=r+1)}return[r*360,o,a]}static HSBtoRGB(e,i,s){e=(e%360+360)%360/360;let n=0,a=0,o=0;if(i===0)n=a=o=s;else{const r=(e-Math.floor(e))*6,l=r-Math.floor(r),c=s*(1-i),h=s*(1-i*l),u=s*(1-i*(1-l));switch(r>>0){case 0:n=s,a=u,o=c;break;case 1:n=h,a=s,o=c;break;case 2:n=c,a=s,o=u;break;case 3:n=c,a=h,o=s;break;case 4:n=u,a=c,o=s;break;case 5:n=s,a=c,o=h;break}}return[n,a,o]}static mix(e,i,s){return new he(Rp(e.r,i.r,s),Rp(e.g,i.g,s),Rp(e.b,i.b,s),Rp(e.a,i.a,s))}},RM.nameToHex=new Map([["aliceblue","#F0F8FF"],["antiquewhite","#FAEBD7"],["aqua","#00FFFF"],["aquamarine","#7FFFD4"],["azure","#F0FFFF"],["beige","#F5F5DC"],["bisque","#FFE4C4"],["black","#000000"],["blanchedalmond","#FFEBCD"],["blue","#0000FF"],["blueviolet","#8A2BE2"],["brown","#A52A2A"],["burlywood","#DEB887"],["cadetblue","#5F9EA0"],["chartreuse","#7FFF00"],["chocolate","#D2691E"],["coral","#FF7F50"],["cornflowerblue","#6495ED"],["cornsilk","#FFF8DC"],["crimson","#DC143C"],["cyan","#00FFFF"],["darkblue","#00008B"],["darkcyan","#008B8B"],["darkgoldenrod","#B8860B"],["darkgray","#A9A9A9"],["darkgreen","#006400"],["darkgrey","#A9A9A9"],["darkkhaki","#BDB76B"],["darkmagenta","#8B008B"],["darkolivegreen","#556B2F"],["darkorange","#FF8C00"],["darkorchid","#9932CC"],["darkred","#8B0000"],["darksalmon","#E9967A"],["darkseagreen","#8FBC8F"],["darkslateblue","#483D8B"],["darkslategray","#2F4F4F"],["darkslategrey","#2F4F4F"],["darkturquoise","#00CED1"],["darkviolet","#9400D3"],["deeppink","#FF1493"],["deepskyblue","#00BFFF"],["dimgray","#696969"],["dimgrey","#696969"],["dodgerblue","#1E90FF"],["firebrick","#B22222"],["floralwhite","#FFFAF0"],["forestgreen","#228B22"],["fuchsia","#FF00FF"],["gainsboro","#DCDCDC"],["ghostwhite","#F8F8FF"],["gold","#FFD700"],["goldenrod","#DAA520"],["gray","#808080"],["green","#008000"],["greenyellow","#ADFF2F"],["grey","#808080"],["honeydew","#F0FFF0"],["hotpink","#FF69B4"],["indianred","#CD5C5C"],["indigo","#4B0082"],["ivory","#FFFFF0"],["khaki","#F0E68C"],["lavender","#E6E6FA"],["lavenderblush","#FFF0F5"],["lawngreen","#7CFC00"],["lemonchiffon","#FFFACD"],["lightblue","#ADD8E6"],["lightcoral","#F08080"],["lightcyan","#E0FFFF"],["lightgoldenrodyellow","#FAFAD2"],["lightgray","#D3D3D3"],["lightgreen","#90EE90"],["lightgrey","#D3D3D3"],["lightpink","#FFB6C1"],["lightsalmon","#FFA07A"],["lightseagreen","#20B2AA"],["lightskyblue","#87CEFA"],["lightslategray","#778899"],["lightslategrey","#778899"],["lightsteelblue","#B0C4DE"],["lightyellow","#FFFFE0"],["lime","#00FF00"],["limegreen","#32CD32"],["linen","#FAF0E6"],["magenta","#FF00FF"],["maroon","#800000"],["mediumaquamarine","#66CDAA"],["mediumblue","#0000CD"],["mediumorchid","#BA55D3"],["mediumpurple","#9370DB"],["mediumseagreen","#3CB371"],["mediumslateblue","#7B68EE"],["mediumspringgreen","#00FA9A"],["mediumturquoise","#48D1CC"],["mediumvioletred","#C71585"],["midnightblue","#191970"],["mintcream","#F5FFFA"],["mistyrose","#FFE4E1"],["moccasin","#FFE4B5"],["navajowhite","#FFDEAD"],["navy","#000080"],["oldlace","#FDF5E6"],["olive","#808000"],["olivedrab","#6B8E23"],["orange","#FFA500"],["orangered","#FF4500"],["orchid","#DA70D6"],["palegoldenrod","#EEE8AA"],["palegreen","#98FB98"],["paleturquoise","#AFEEEE"],["palevioletred","#DB7093"],["papayawhip","#FFEFD5"],["peachpuff","#FFDAB9"],["peru","#CD853F"],["pink","#FFC0CB"],["plum","#DDA0DD"],["powderblue","#B0E0E6"],["purple","#800080"],["rebeccapurple","#663399"],["red","#FF0000"],["rosybrown","#BC8F8F"],["royalblue","#4169E1"],["saddlebrown","#8B4513"],["salmon","#FA8072"],["sandybrown","#F4A460"],["seagreen","#2E8B57"],["seashell","#FFF5EE"],["sienna","#A0522D"],["silver","#C0C0C0"],["skyblue","#87CEEB"],["slateblue","#6A5ACD"],["slategray","#708090"],["slategrey","#708090"],["snow","#FFFAFA"],["springgreen","#00FF7F"],["steelblue","#4682B4"],["tan","#D2B48C"],["teal","#008080"],["thistle","#D8BFD8"],["tomato","#FF6347"],["transparent","#00000000"],["turquoise","#40E0D0"],["violet","#EE82EE"],["wheat","#F5DEB3"],["white","#FFFFFF"],["whitesmoke","#F5F5F5"],["yellow","#FFFF00"],["yellowgreen","#9ACD32"]]),xe=RM}});function lH(t,e){return i=>Number(t)*(1-i)+Number(e)*i}function a2(t,e){if(typeof t=="string")try{t=xe.fromString(t)}catch{t=xe.fromArray([0,0,0])}if(typeof e=="string")try{e=xe.fromString(e)}catch{e=xe.fromArray([0,0,0])}return i=>xe.mix(t,e,i).toRgbaString()}var o2=I({"packages/ag-charts-community/src/util/interpolate.ts"(){"use strict";hc()}});function r2(t,e){Object.getOwnPropertyDescriptor(t,dc)==null&&Object.defineProperty(t,dc,{value:{}});const i=t[dc],s=e.toString();if(typeof i[s]<"u")return i[s];const n=new WeakMap;i[s]={setters:[],getters:[],observers:[],valuesMap:n};const a=Object.getOwnPropertyDescriptor(t,e),o=a?.set,r=a?.get;return Object.defineProperty(t,e,{set:function(h){const{setters:u,observers:d}=i[s];let p;u.some(g=>g.length>2)&&(p=r?r.call(this):n.get(this));for(const g of u)if(h=g(this,e,h,p),h===_p)return;o?o.call(this,h):n.set(this,h);for(const g of d)g(this,h,p)},get:function(){let h=r?r.call(this):n.get(this);for(const u of i[s].getters)if(h=u(this,e,h),h===_p)return;return h},enumerable:!0,configurable:!1}),i[s]}function Uo(t,e,i){return(s,n)=>{const a=r2(s,n);a.setters.push(t),e&&a.getters.unshift(e),i&&Object.assign(a,i)}}function l2(t){return(e,i)=>{r2(e,i).observers.push(t)}}function em(t){return typeof t<"u"&&dc in t}function uc(t){const e=new Set;for(;em(t);)e.add(t?.[dc]),t=Object.getPrototypeOf(t);return Array.from(e).flatMap(i=>Object.keys(i))}function c2(t){return uc(t).reduce((e,i)=>(e[i]=t[i]??null,e),{})}function cH(t,e){const i=e.toString();for(;em(t);){const s=t[dc];if(Object.hasOwn(s,i))return s[i];t=Object.getPrototypeOf(t)}}var _p,dc,Xr=I({"packages/ag-charts-community/src/util/decorator.ts"(){"use strict";_p=Symbol("BREAK"),dc="__decorator_config"}});function pc(t,e){return Array.isArray(t)?!Array.isArray(e)||t.length!==e.length?!1:t.every((i,s)=>pc(i,e[s])):Xi(t)?Xi(e)?_M(t,e,pc):!1:t===e}function _M(t,e,i){for(const s of Object.keys(e))if(!(s in t))return!1;for(const s of Object.keys(t))if(!(s in e)||!i(t[s],e[s]))return!1;return!0}function Tt(...t){const e={};for(const i of t){if(!bi(i))continue;const s=em(i)?uc(i):Object.keys(i);for(const n of s)Xi(e[n])&&Xi(i[n])?e[n]=Tt(e[n],i[n]):e[n]??(e[n]=i[n])}return e}function im(t,...e){return e&&ne(t)?t.map(i=>Tt(i,...e)):t}function hH(t,e){return Object.entries(t).reduce((i,[s,n])=>(i[s]=e(n,s,t),i),{})}function PM(t,e){const i={...t};for(const s of e)delete i[s];return i}function BM(t,e){return(ne(e)?e:e.split(".")).reduce((s,n)=>s[n],t)}function zM(t,e,i){const s=ne(e)?e.slice():e.split("."),n=s.pop();if(s.some(o=>sm.has(o)))return;const a=s.reduce((o,r)=>o[r],t);return a[n]=i,a[n]}function FM(t,e,i){if(i===void 0)return e;for(const s of t){const n=i[s];n!==void 0&&(e[s]=n)}return e}function Pp(t){return Object.freeze(t),Object.getOwnPropertyNames(t).forEach(e=>{const i=t[e];i!==null&&(typeof i=="object"||typeof i=="function")&&!Object.isFrozen(i)&&Pp(i)}),t}var sm,oe=I({"packages/ag-charts-community/src/util/object.ts"(){"use strict";ot(),Xr(),sm=new Set(["__proto__","constructor","prototype"])}}),jM={};sn(jM,{easeIn:()=>h2,easeInOut:()=>u2,easeInOutQuad:()=>g2,easeInQuad:()=>d2,easeOut:()=>gu,easeOutQuad:()=>p2,inverseEaseOut:()=>GM,linear:()=>VM});var VM,h2,gu,u2,d2,p2,g2,GM,fu=I({"packages/ag-charts-community/src/motion/easing.ts"(){"use strict";VM=t=>t,h2=t=>1-Math.cos(t*Math.PI/2),gu=t=>Math.sin(t*Math.PI/2),u2=t=>-(Math.cos(t*Math.PI)-1)/2,d2=t=>t*t,p2=t=>1-(1-t)**2,g2=t=>t<.5?2*t*t:1-(-2*t+2)**2/2,GM=t=>2*Math.asin(t)/Math.PI}});function uH(t){return t.every(e=>e instanceof Wo)}function nm(t){return uH(t)?{nodes:t,selections:[]}:{nodes:[],selections:t}}function WM(t,e){return t===e?!0:Array.isArray(t)&&Array.isArray(e)?t.length===e.length&&t.every((i,s)=>WM(i,e[s])):Op(t)&&Op(e)?t.equals(e):Xi(t)&&Xi(e)?_M(t,e,WM):!1}var Bp,gc,yu,UM,HM,fc=I({"packages/ag-charts-community/src/motion/animation.ts"(){"use strict";ot(),nn(),o2(),NM(),At(),oe(),fu(),Bp=.2,gc=["initial","remove","update","add","trailing","end","none"],yu={initial:{animationDuration:1,animationDelay:0},add:{animationDuration:.25,animationDelay:.75},remove:{animationDuration:.25,animationDelay:0},update:{animationDuration:.5,animationDelay:.25},trailing:{animationDuration:Bp,animationDelay:1,skipIfNoEarlierAnimations:!0},end:{animationDelay:1+Bp,animationDuration:0,skipIfNoEarlierAnimations:!0},none:{animationDuration:0,animationDelay:0}},UM=(t=>(t.Loop="loop",t.Reverse="reverse",t))(UM||{}),HM=class{constructor(t){this.isComplete=!1,this.elapsed=0,this.iteration=0,this.isPlaying=!1,this.isReverse=!1,this.id=t.id,this.groupId=t.groupId,this.autoplay=t.autoplay??!0,this.ease=t.ease??VM,this.phase=t.phase;const e=t.duration??yu[this.phase].animationDuration;this.duration=e*t.defaultDuration,this.delay=(t.delay??0)*t.defaultDuration,this.onComplete=t.onComplete,this.onPlay=t.onPlay,this.onStop=t.onStop,this.onUpdate=t.onUpdate,this.interpolate=this.createInterpolator(t.from,t.to),this.from=t.from,t.skip===!0&&(this.onUpdate?.(t.to,!1,this),this.onStop?.(this),this.onComplete?.(this),this.isComplete=!0),t.collapsable!==!1&&(this.duration=this.checkCollapse(t,this.duration))}checkCollapse(t,e){return WM(t.from,t.to)?0:e}play(t=!1){this.isPlaying||this.isComplete||(this.isPlaying=!0,this.onPlay?.(this),this.autoplay&&(this.autoplay=!1,t&&this.onUpdate?.(this.from,!0,this)))}stop(){this.isPlaying=!1,this.isComplete||(this.isComplete=!0,this.onStop?.(this))}update(t){if(this.isComplete)return t;!this.isPlaying&&this.autoplay&&this.play(!0);const e=this.elapsed;if(this.elapsed+=t,this.delay>this.elapsed)return 0;const i=this.interpolate(this.isReverse?1-this.delta:this.delta);this.onUpdate?.(i,!1,this);const s=this.delay+this.duration;return this.elapsed>=s?(this.stop(),this.isComplete=!0,this.onComplete?.(this),t-(s-e)):0}get delta(){return this.ease(It(0,(this.elapsed-this.delay)/this.duration,1))}createInterpolator(t,e){if(typeof e!="object"||Op(e))return this.interpolateValue(t,e);const i=[];for(const s of Object.keys(e)){const n=this.interpolateValue(t[s],e[s]);n!=null&&i.push([s,n])}return s=>{const n={};for(const[a,o]of i)n[a]=o(s);return n}}interpolateValue(t,e){if(!(t==null||e==null)){if(Op(t))return i=>t[Np](e,i);try{switch(typeof t){case"number":return lH(t,e);case"string":return a2(t,e);case"boolean":if(t===e)return()=>t;break}}catch{}throw new Error(`Unable to interpolate values: ${t}, ${e}`)}}}}}),f2={};sn(f2,{NODE_UPDATE_STATE_TO_PHASE_MAPPING:()=>_n,fromToMotion:()=>De,staticFromToMotion:()=>Ho});function De(t,e,i,s,n,a,o){const{fromFn:r,toFn:l,applyFn:c=(g,f)=>g.setProperties(f)}=n,{nodes:h,selections:u}=nm(s),d=(g,f)=>{let x,m=0,b=0;for(const v of f){const S=g[m]===v,A={last:b>=f.length-1,lastLive:m>=g.length-1,prev:f[b-1],prevFromProps:x,prevLive:g[m-1],next:f[b+1],nextLive:g[m+(S?1:0)]},T=`${t}_${e}_${v.id}`;i.stopByAnimationId(T);let D="unknown";S?a&&o&&(D=dH(v,v.datum,a,o)):D="removed",v.transitionOut=D==="removed";const{phase:L,start:C,finish:O,delay:_,duration:N,...P}=r(v,v.datum,D,A),{phase:j,start:F,finish:V,delay:W,duration:H,...G}=l(v,v.datum,D,A),B=O==null;i.animate({id:T,groupId:t,phase:L??j??"update",duration:N??H,delay:_??W,from:P,to:G,ease:gu,collapsable:B,onPlay:()=>{const z={...C,...F,...P};c(v,z,"start")},onUpdate(z){c(v,z,"update")},onStop:()=>{const z={...C,...F,...P,...G,...O,...V};c(v,z,"end")}}),S&&m++,b++,x=P}};let p=0;for(const g of u){const f=g.nodes(),x=f.filter(m=>!g.isGarbage(m));d(x,f),i.animate({id:`${t}_${e}_selection_${p}`,groupId:t,phase:"end",from:0,to:1,ease:gu,onStop(){g.cleanup()}}),p++}d(h,h)}function Ho(t,e,i,s,n,a,o){const{nodes:r,selections:l}=nm(s),{start:c,finish:h,phase:u}=o;i.animate({id:`${t}_${e}`,groupId:t,phase:u??"update",from:n,to:a,ease:gu,onPlay:()=>{if(c){for(const d of r)d.setProperties(c);for(const d of l)for(const p of d.nodes())p.setProperties(c)}},onUpdate(d){for(const p of r)p.setProperties(d);for(const p of l)for(const g of p.nodes())g.setProperties(d)},onStop:()=>{for(const d of r)d.setProperties({...a,...h});for(const d of l){for(const p of d.nodes())p.setProperties({...a,...h});d.cleanup()}}})}function dH(t,e,i,s){const n=i(t,e);return s.added.has(n)?"added":s.removed.has(n)?"removed":"updated"}var _n,wi=I({"packages/ag-charts-community/src/motion/fromToMotion.ts"(){"use strict";fc(),fu(),_n={added:"add",updated:"update",removed:"remove",unknown:"initial","no-op":"none"}}}),zp,am=I({"packages/ag-charts-community/src/scale/abstractScale.ts"(){"use strict";zp=class{ticks(t,e,i){}niceDomain(t,e=this.domain){return e}tickFormatter(t){}datumFormatter(t){}get bandwidth(){}get step(){}get inset(){}}}}),YM,Wt,Qi=I({"packages/ag-charts-community/src/scale/continuousScale.ts"(){"use strict";At(),am(),YM=class YU extends zp{constructor(e=[],i=[]){super(),this.domain=e,this.range=i,this.defaultClamp=!1}static is(e){return e instanceof YU}normalizeDomains(...e){let i,s=1/0,n,a=-1/0;for(const o of e)for(const r of o){const l=r.valueOf();la&&(a=l,n=r)}return i!=null&&n!=null?{domain:[i,n],animatable:!0}:{domain:[],animatable:!1}}transform(e){return e}transformInvert(e){return e}calcBandwidth(e=1){const{domain:i}=this,s=this.getPixelRange();if(i.length===0)return s;const n=Math.abs(i[1].valueOf()-i[0].valueOf())/e+1,a=Math.floor(s),o=Math.min(n,a);return s/Math.max(1,o)}convert(e,i=this.defaultClamp){const{domain:s}=this;if(!s||s.length<2)return NaN;const n=Number(this.transform(s[0])),a=Number(this.transform(s[1])),o=Number(this.transform(e)),{range:r}=this,[l,c]=r;if(i){const[h,u]=Si([n,a]);if(ou)return c}return n===a?(l+c)/2:o===n?l:o===a?c:l+(o-n)/(a-n)*(c-l)}invert(e,i){const s=this.domain.map(h=>this.transform(h)),[n,a]=s,{range:o}=this,[r,l]=o;let c;return r===l?c=this.toDomain((Number(n)+Number(a))/2):c=this.toDomain(Number(n)+(e-r)/(l-r)*(Number(a)-Number(n))),this.transformInvert(c)}getPixelRange(){const[e,i]=this.range;return Math.abs(i-e)}},YM.defaultTickCount=5,Wt=YM}}),yc,_s,Ps=I({"packages/ag-charts-community/src/util/time/interval.ts"(){"use strict";ot(),yc=class{constructor(t,e,i){this._encode=t,this._decode=e,this._rangeCallback=i}floor(t){const e=new Date(t),i=this._encode(e);return this._decode(i)}ceil(t){const e=new Date(Number(t)-1),i=this._encode(e);return this._decode(i+1)}range(t,e,{extend:i=!1,visibleRange:s=[0,1]}={}){let n=!1;t.getTime()>e.getTime()&&([t,e]=[e,t],n=!0);const a=this._rangeCallback?.(t,e),o=this._encode(i?this.floor(t):this.ceil(t)),r=this._encode(i?this.ceil(e):this.floor(e));if(r{const u=a==="start"?c:h;return i=this.getOffset(u,t),()=>i=l}}else typeof a=="number"?i=this.getOffset(new Date(a),t):a instanceof Date&&(i=this.getOffset(a,t));const o=l=>Math.floor((this._encode(l)-i)/t),r=l=>this._decode(l*t+i);return new yc(o,r,s)}}}});function pH(t){return t.getTime()}function gH(t){return new Date(t)}var KM,fH=I({"packages/ag-charts-community/src/util/time/millisecond.ts"(){"use strict";Ps(),KM=new _s(pH,gH)}}),Yo,vi,qi,an,Za,mu,mc,Qa=I({"packages/ag-charts-community/src/util/time/duration.ts"(){"use strict";Yo=1e3,vi=Yo*60,qi=vi*60,an=qi*24,Za=an*7,mu=an*30,mc=an*365}});function yH(t){return Math.floor((t.getTime()-$M)/Yo)}function mH(t){return new Date($M+t*Yo)}var $M,xc,xH=I({"packages/ag-charts-community/src/util/time/second.ts"(){"use strict";Qa(),Ps(),$M=new Date().getTimezoneOffset()*vi,xc=new _s(yH,mH)}});function bH(t){return Math.floor((t.getTime()-XM)/vi)}function SH(t){return new Date(XM+t*vi)}var XM,bc,vH=I({"packages/ag-charts-community/src/util/time/minute.ts"(){"use strict";Qa(),Ps(),XM=new Date().getTimezoneOffset()*vi,bc=new _s(bH,SH)}});function MH(t){return Math.floor((t.getTime()-ZM)/qi)}function IH(t){return new Date(ZM+t*qi)}var ZM,Sc,AH=I({"packages/ag-charts-community/src/util/time/hour.ts"(){"use strict";Qa(),Ps(),ZM=new Date().getTimezoneOffset()*vi,Sc=new _s(MH,IH)}});function DH(t){const e=t.getTimezoneOffset()*vi;return Math.floor((t.getTime()-e)/an)}function kH(t){const e=new Date(1970,0,1);return e.setDate(e.getDate()+t),e}var Fp,LH=I({"packages/ag-charts-community/src/util/time/day.ts"(){"use strict";Qa(),Ps(),Fp=new _s(DH,kH)}});function vc(t){const i=(7+t-4)%7;function s(a){const o=a.getTimezoneOffset()*vi;return Math.floor((a.getTime()-o)/Za-i/7)}function n(a){const o=new Date(1970,0,1);return o.setDate(o.getDate()+a*7+i),o}return new _s(s,n)}var xu,y2,m2,x2,b2,S2,v2,TH=I({"packages/ag-charts-community/src/util/time/week.ts"(){"use strict";Qa(),Ps(),xu=vc(0),y2=vc(1),m2=vc(2),x2=vc(3),b2=vc(4),S2=vc(5),v2=vc(6)}});function CH(t){return t.getFullYear()*12+t.getMonth()}function NH(t){const e=Math.floor(t/12),i=t-e*12;return new Date(e,i,1)}var Zr,OH=I({"packages/ag-charts-community/src/util/time/month.ts"(){"use strict";Ps(),Zr=new _s(CH,NH)}});function wH(t){return t.getFullYear()}function EH(t){const e=new Date;return e.setFullYear(t),e.setMonth(0,1),e.setHours(0,0,0,0),e}var jp,RH=I({"packages/ag-charts-community/src/util/time/year.ts"(){"use strict";Ps(),jp=new _s(wH,EH)}});function _H(t){return Math.floor(t.getTime()/vi)}function PH(t){return new Date(t*vi)}var M2,BH=I({"packages/ag-charts-community/src/util/time/utcMinute.ts"(){"use strict";Qa(),Ps(),M2=new _s(_H,PH)}});function zH(t){return Math.floor(t.getTime()/qi)}function FH(t){return new Date(t*qi)}var I2,jH=I({"packages/ag-charts-community/src/util/time/utcHour.ts"(){"use strict";Qa(),Ps(),I2=new _s(zH,FH)}});function VH(t){return Math.floor(t.getTime()/an)}function GH(t){const e=new Date(0);return e.setUTCDate(e.getUTCDate()+t),e.setUTCHours(0,0,0,0),e}var A2,WH=I({"packages/ag-charts-community/src/util/time/utcDay.ts"(){"use strict";Qa(),Ps(),A2=new _s(VH,GH)}});function UH(t){return t.getUTCFullYear()*12+t.getUTCMonth()}function HH(t){const e=Math.floor(t/12),i=t-e*12;return new Date(Date.UTC(e,i,1))}var D2,YH=I({"packages/ag-charts-community/src/util/time/utcMonth.ts"(){"use strict";Ps(),D2=new _s(UH,HH)}});function KH(t){return t.getUTCFullYear()}function $H(t){const e=new Date;return e.setUTCFullYear(t),e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0),e}var k2,XH=I({"packages/ag-charts-community/src/util/time/utcYear.ts"(){"use strict";Ps(),k2=new _s(KH,$H)}}),L2={};sn(L2,{TimeInterval:()=>yc,day:()=>Fp,friday:()=>S2,hour:()=>Sc,millisecond:()=>KM,minute:()=>bc,monday:()=>y2,month:()=>Zr,saturday:()=>v2,second:()=>xc,sunday:()=>xu,thursday:()=>b2,tuesday:()=>m2,utcDay:()=>A2,utcHour:()=>I2,utcMinute:()=>M2,utcMonth:()=>D2,utcYear:()=>k2,wednesday:()=>x2,year:()=>jp});var Vp=I({"packages/ag-charts-community/src/util/time/index.ts"(){"use strict";fH(),xH(),vH(),AH(),LH(),TH(),OH(),RH(),BH(),jH(),WH(),YH(),XH(),Ps()}});function QM(t,e=new Date(t.getFullYear(),0,1)){const i=t.getTimezoneOffset()-e.getTimezoneOffset(),s=t.getTime()-e.getTime()+i*6e4,n=36e5*24;return Math.floor(s/n)}function T2(t,e){const s=new Date(t.getFullYear(),0,1).getDay(),n=(e-s+7)%7,a=new Date(t.getFullYear(),0,n+1);return a<=t?Math.floor(QM(t,a)/7)+1:0}function C2(t,e=t.getFullYear()){const s=new Date(e,0,1).getDay(),n=(JM-s+7)%7,a=new Date(e,0,n-(JM-qM)+1);return a<=t?Math.floor(QM(t,a)/7)+1:C2(t,e-1)}function ZH(t){const e=t.getTimezoneOffset(),i=Math.abs(e);return`${e>0?"-":"+"}${Ei(Math.floor(i/60),2,"0")}${Ei(Math.floor(i%60),2,"0")}`}function Ei(t,e,i){const s=String(Math.floor(t));return s.length>=e?s:`${i.repeat(e-s.length)}${s}`}function Gp(t){const e=[];for(;t.length>0;){let i=t.indexOf("%");if(i!==0){const r=i>0?t.substring(0,i):t;e.push(r)}if(i<0)break;const s=t[i+1],n=w2[s];n!=null&&i++;const a=t[i+1],o=O2[a];if(typeof o=="function")e.push([o,n]);else if(typeof o=="string"){const r=Gp(o);e.push([r,n])}else e.push(`${n??""}${a}`);t=t.substring(i+2)}return i=>{const s=typeof i=="number"?new Date(i):i;return e.map(n=>typeof n=="string"?n:n[0](s,n[1])).join("")}}var Wp,N2,qM,JM,O2,w2,om=I({"packages/ag-charts-community/src/util/timeFormat.ts"(){"use strict";Wp={periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]},N2=0,qM=1,JM=4,O2={a:t=>Wp.shortDays[t.getDay()],A:t=>Wp.days[t.getDay()],b:t=>Wp.shortMonths[t.getMonth()],B:t=>Wp.months[t.getMonth()],c:"%x, %X",d:(t,e)=>Ei(t.getDate(),2,e??"0"),e:"%_d",f:(t,e)=>Ei(t.getMilliseconds()*1e3,6,e??"0"),H:(t,e)=>Ei(t.getHours(),2,e??"0"),I:(t,e)=>{const i=t.getHours()%12;return i===0?"12":Ei(i,2,e??"0")},j:(t,e)=>Ei(QM(t)+1,3,e??"0"),m:(t,e)=>Ei(t.getMonth()+1,2,e??"0"),M:(t,e)=>Ei(t.getMinutes(),2,e??"0"),L:(t,e)=>Ei(t.getMilliseconds(),3,e??"0"),p:t=>t.getHours()<12?"AM":"PM",Q:t=>String(t.getTime()),s:t=>String(Math.floor(t.getTime()/1e3)),S:(t,e)=>Ei(t.getSeconds(),2,e??"0"),u:t=>{let e=t.getDay();return e<1&&(e+=7),String(e%7)},U:(t,e)=>Ei(T2(t,N2),2,e??"0"),V:(t,e)=>Ei(C2(t),2,e??"0"),w:(t,e)=>Ei(t.getDay(),2,e??"0"),W:(t,e)=>Ei(T2(t,qM),2,e??"0"),x:"%-m/%-d/%Y",X:"%-I:%M:%S %p",y:(t,e)=>Ei(t.getFullYear()%100,2,e??"0"),Y:(t,e)=>Ei(t.getFullYear(),4,e??"0"),Z:t=>ZH(t),"%":()=>"%"},w2={_:" ",0:"0","-":""}}});function Ji(t){return t instanceof Date?t.getTime():t}function t0(t,e,i){const s=E2(t,e,i),n=Gp(s);return a=>n(a)}function E2(t,e,i=0){let s=1/0;for(let h=1;h0,c=isFinite(s)?QH(s,t):qH(t[0]);return tY(Math.max(c-i,0),l,t)}function QH(t,e){return t{if(typeof d=="string")return!0;const[p,g,f,x]=d;return x>=t&&g<=a&&a(typeof p=="string"?d.result.push(p):d.used.has(p[0])||(d.result.push(p),d.used.add(p[0])),d),{result:[],used:new Set}).result,h=c.findIndex(d=>typeof d!="string"),u=c.findLastIndex(d=>typeof d!="string");return c.slice(h,u+1).map(d=>typeof d=="string"?d:d[4]).join("").replaceAll(/\s+/g," ").trim()}var rm=I({"packages/ag-charts-community/src/util/timeFormatDefaults.ts"(){"use strict";At(),Vp(),Qa(),om()}}),Mc,e0=I({"packages/ag-charts-community/src/scale/invalidating.ts"(){"use strict";Mc=(t,e)=>{const i=Symbol(String(e));t[i]=void 0,Object.defineProperty(t,e,{get(){return this[i]},set(s){this[i]!==s&&(this[i]=s,this.invalid=!0)},enumerable:!0,configurable:!1})}}});function R2(t,e,i){if(i==null||i[0]===0&&i[1]===1)return t;const s=It(0,Math.floor(i[0]*t.length),t.length),n=It(0,Math.ceil(i[1]*t.length),t.length),a=e?t.length-n:s,o=e?t.length-s:n;return t.slice(a,o)}var _2=I({"packages/ag-charts-community/src/scale/scaleUtil.ts"(){"use strict";At()}}),Up,bu,Hp=I({"packages/ag-charts-community/src/scale/bandScale.ts"(){"use strict";ot(),At(),am(),e0(),_2(),Up=class KU extends zp{constructor(){super(...arguments),this.invalid=!0,this.range=[0,1],this.round=!1,this.interval=void 0,this._bandwidth=1,this._step=1,this._inset=1,this._rawBandwidth=1,this._paddingInner=0,this._paddingOuter=0}static is(e){return e instanceof KU}get bandwidth(){return this.refresh(),this._bandwidth}get step(){return this.refresh(),this._step}get inset(){return this.refresh(),this._inset}get rawBandwidth(){return this.refresh(),this._rawBandwidth}set padding(e){e=It(0,e,1),this._paddingInner=e,this._paddingOuter=e}get padding(){return this._paddingInner}set paddingInner(e){this.invalid=!0,this._paddingInner=It(0,e,1)}get paddingInner(){return this._paddingInner}set paddingOuter(e){this.invalid=!0,this._paddingOuter=It(0,e,1)}get paddingOuter(){return this._paddingOuter}refresh(){this.invalid&&(this.invalid=!1,this.update(),this.invalid&&et.warnOnce("Expected update to not invalidate scale"))}ticks(e,i=this.domain,s){return R2(i,!1,s)}convert(e,i){this.refresh();const s=this.getIndex(e);return s==null||s<0||s>=this.domain.length?NaN:this.ordinalRange(s)}invertNearestIndex(e){this.refresh();const{domain:i}=this;if(i.length===0)return-1;let s=0,n=i.length-1,a=1/0,o=0;for(;s<=n;){const r=(n+s)/2|0,l=this.ordinalRange(r),c=Math.abs(l-e);if(c===0)return r;c{const{optional:i}=cH(this,e),s=i===!0||typeof this[e]<"u";return s||et.warnOnce(`${t??""}[${e}] is required.`),s})}toJson(){return uc(this).reduce((t,e)=>{const i=this[e];return t[e]=qa(i)?i.toJson():i,t},{})}},vu=class $U extends Array{constructor(e,...i){super(i.length);const n=(a=>!!a?.prototype?.constructor?.name)(e)?a=>new e().set(a):e;Object.defineProperty(this,"itemFactory",{value:n,enumerable:!1,configurable:!1}),this.set(i)}set(e){if(ne(e)){this.length=e.length;for(let i=0;ie?.toJson?.()??e)}}}});function k(t,e={}){const{optional:i=!1,property:s}=e;return Uo((n,a,o)=>{const r={...e,target:n,property:a};if(i&&typeof o>"u"||t(o,r))return qa(n[a])&&!qa(o)?(n[a].set(o),n[a]):o;const l=s??String(a).replace(/^_*/,""),c=n.constructor.className??n.constructor.name.replace(/Properties$/,""),h=Ap(o,50);return et.warn(`Property [${l}] of [${c}] cannot be set to [${h}]${t.message?`; expecting ${Kp(t,r)}`:""}, ignoring.`),_p},void 0,{optional:i})}function ie(t,e="a"){return qt((i,s)=>{const n=t.find(a=>{const o=typeof a=="string"?a:a.value;return i===o});if(n==null)return!1;if(typeof n!="string"&&(n.deprecated===!0||n.deprecatedTo!=null)){const a=[`Property [%s] with value '${n.value}' is deprecated.`];n.deprecatedTo&&a.push(`Use ${n.deprecatedTo} instead.`),et.warnOnce(a.join(" "),s.property)}return!0},`${e} keyword such as ${iY(t)}`)}function qt(t,e){return t.message=e,t}function iY(t){const e=t.filter(s=>typeof s=="string"||s.undocumented!==!0).map(s=>`'${typeof s=="string"?s:s.value}'`);if(e.length===1)return e[0];const i=e.pop();return`${e.join(", ")} or ${i}`}function Kp(t,e){return cc(t.message)?t.message(e):t.message}function sY(t){return e=>Kp(e,t)}function nY(t){return Object.assign(t,{restrict({length:e,minLength:i}={}){let s="an array";return On(i)&&i>0?s="a non-empty array":On(e)&&(s=`an array of length ${e}`),qt(n=>ne(n)&&(On(e)?n.length===e:!0)&&(On(i)?n.length>=i:!0),s)}})}function aY(t){return Object.assign(t,{restrict({min:e,max:i}={}){const s=["a number"],n=On(e),a=On(i);return n&&a?s.push(`between ${e} and ${i} inclusive`):n?s.push(`greater than or equal to ${e}`):a&&s.push(`less than or equal to ${i}`),qt(o=>zt(o)&&(n?o>=e:!0)&&(a?o<=i:!0),s.join(" "))}})}function i0(t){return Object.assign(t,{restrict(e){return qt(i=>i instanceof e,i=>Kp(t,i)??`an instance of ${e.name}`)}})}var ha,Ko,lt,s0,pt,ts,tt,_t,n0,$p,st,Ut,Ic,Mu,Ja,Xp,Iu,Au,lm,cm,a0,jt,o0,Bs,B2,Zp,r0,z2,hm,F2,j2,V2,ua,um,to,eo,Qp,l0,G2,W2,c0,U2,qp,dm,h0,u0,mt=I({"packages/ag-charts-community/src/util/validation.ts"(){"use strict";ot(),hc(),Xr(),Qt(),ha=(...t)=>{const e=[];return qt((i,s)=>(e.length=0,t.every(n=>{const a=n(i,s);return a||e.push(Kp(n,s)),a})),()=>e.filter(Boolean).join(" AND "))},Ko=(...t)=>qt((e,i)=>t.some(s=>s(e,i)),e=>t.map(sY(e)).filter(Boolean).join(" OR ")),lt=i0(qt((t,e)=>qa(t)||bi(t)&&qa(e.target[e.property]),"a properties object")),s0=i0(qt(t=>bi(t),"an object")),pt=qt(KN,"a boolean"),ts=qt(cc,"a function"),tt=qt(Es,"a string"),_t=aY(qt(zt,"a number")),n0=qt(t=>On(t)&&!isNaN(t),"a real number"),$p=qt(t=>On(t)&&isNaN(t),"NaN"),st=_t.restrict({min:0}),Ut=_t.restrict({min:0,max:1}),Ic=Ko(_t,$p),Mu=nY(qt(ne,"an array")),Ja=(t,e)=>qt((i,s)=>ne(i)&&i.every(n=>t(n,s)),i=>{const s=Kp(Mu,i)??"";return typeof e=="function"?`${s} of ${e(i)}`:e?`${s} of ${e}`:s}),Xp=t=>zt(t)||Dp(t),Iu=t=>qt((e,i)=>!Xp(e)||!Xp(i.target[t])||eqt((e,i)=>!Xp(e)||!Xp(i.target[t])||e>i.target[t],`to be greater than ${t}`),lm=qt(Dp,"Date object"),cm=Ko(lm,st),a0="A color string can be in one of the following formats to be valid: #rgb, #rrggbb, rgb(r, g, b), rgba(r, g, b, a) or a CSS color name such as 'white', 'orange', 'cyan', etc",jt=qt(t=>Es(t)&&xe.validColorString(t),`color String. ${a0}`),o0=i0(qt(t=>bi(t)&&t.type==="gradient","a color gradient object")),Bs=qt(Ja(jt),`color strings. ${a0}`),B2=Ja(pt,"boolean values"),Zp=Ja(_t,"numbers"),r0=Ja(tt,"strings"),z2=qt(Ja(lm),"Date objects"),hm=qt(Ja(lt),"objects"),F2=ie(["butt","round","square"],"a line cap"),j2=ie(["round","bevel","miter"],"a line join"),V2=ie(["solid","dashed","dotted"],"a line style"),ua=qt(Ja(st),"numbers specifying the length in pixels of alternating dashes and gaps, for example, [6, 3] means dashes with a length of 6 pixels with gaps between of 3 pixels."),um=ie(["top","right","bottom","left"],"a position"),to=ie(["normal","italic","oblique"],"a font style"),eo=Ko(ie(["normal","bold","bolder","lighter"],"a font weight"),_t.restrict({min:1,max:1e3})),Qp=ie(["never","always","hyphenate","on-space"],"a text wrap strategy"),l0=ie(["left","center","right"],"a text align"),G2=ie(["top","middle","bottom"],"a vertical align"),W2=ie(["ellipsis","hide"],"an overflow strategy"),c0=ie(["horizontal","vertical"],"a direction"),U2=ie(["inside","outside"],"a placement"),qp=Ko(ie(["exact","nearest"],"interaction range"),_t),dm=ie(["top","bottom","left","right"]),h0=Ko(ha(_t.restrict({min:1}),Iu("maxSpacing")),$p),u0=Ko(ha(_t.restrict({min:1}),Au("minSpacing")),$p)}}),H2={};sn(H2,{resetMotion:()=>Mi});function Mi(t,e){const{nodes:i,selections:s}=nm(t);for(const n of s){for(const a of n.nodes()){const o=e(a,a.datum);a.setProperties(o)}n.cleanup()}for(const n of i){const a=e(n,n.datum);n.setProperties(a)}}var Ac=I({"packages/ag-charts-community/src/motion/resetMotion.ts"(){"use strict";fc()}}),Y2,d0,K2,Jt,di=I({"packages/ag-charts-community/src/util/debug.ts"(){"use strict";ot(),Lt(),Y2=2e3,d0=Date.now(),K2=()=>{const t=Date.now()-d0;if(t>Y2){const e=(Math.floor(t/100)/10).toFixed(1);et.log(`**** ${e}s since last log message ****`)}d0=Date.now()},Jt={create(...t){return Object.assign((...i)=>{Jt.check(...t)&&(typeof i[0]=="function"&&(i=Vy(i[0]())),K2(),et.log(...i))},{check:()=>Jt.check(...t),group:(i,s)=>Jt.check(...t)?et.logGroup(i,s):s()})},check(...t){return t.length===0&&t.push(!0),Vy(ae("agChartsDebug")).some(i=>t.includes(i))}}}});function $2({context:t,pixelRatio:e,width:i,height:s}){t.save(),t.resetTransform(),t.clearRect(0,0,Math.ceil(i*e),Math.ceil(s*e)),t.restore()}function X2(t){if(Jt.check("canvas")){const e=t.save.bind(t),i=t.restore.bind(t);let s=0;Object.assign(t,{save(){e(),s++},restore(){if(s===0)throw new Error("AG Charts - Unable to restore() past depth 0");i(),s--},verifyDepthZero(){if(s!==0)throw new Error(`AG Charts - Save/restore depth is non-zero: ${s}`)}})}}var Z2=I({"packages/ag-charts-community/src/scene/canvas/canvasUtil.ts"(){"use strict";di()}});function Q2(t,e,i){return[Math.round(t*i),Math.round(e*i)]}var p0,q2=I({"packages/ag-charts-community/src/scene/canvas/hdpiOffscreenCanvas.ts"(){"use strict";Z2(),p0=class{constructor(t){const{width:e,height:i,pixelRatio:s,willReadFrequently:n=!1}=t;this.width=e,this.height=i,this.pixelRatio=s;const[a,o]=Q2(e,i,s);this.canvas=new OffscreenCanvas(a,o),this.context=this.canvas.getContext("2d",{willReadFrequently:n}),this.context.setTransform(s,0,0,s,0,0),X2(this.context)}drawImage(t,e=0,i=0){return t.drawImage(this.canvas,e,i)}transferToImageBitmap(){return this.canvas.transferToImageBitmap()}resize(t,e,i){if(!(t>0&&e>0))return;const{canvas:s,context:n}=this;if(t!==this.width||e!==this.height||i!==this.pixelRatio){const[a,o]=Q2(t,e,i);s.width=a,s.height=o}n.setTransform(i,0,0,i,0,0),this.width=t,this.height=e,this.pixelRatio=i}clear(){$2(this)}destroy(){this.canvas.width=0,this.canvas.height=0,this.context.clearRect(0,0,0,0),this.canvas=null,this.context=null,Object.freeze(this)}}}}),g0,pm,f0,J2,$o,Du=I({"packages/ag-charts-community/src/scale/colorScale.ts"(){"use strict";ot(),hc(),At(),am(),e0(),g0=t=>{const e=xe.fromString(t),[i,s,n]=xe.RGBtoOKLCH(e.r,e.g,e.b);return{l:i,c:s,h:n,a:e.a}},pm=1e-6,f0=t=>t.c1-pm,J2=(t,e,i)=>{i=It(0,i,1);let s;if(f0(t))s=e.h;else if(f0(e))s=t.h;else{const r=t.h;let l=e.h;const c=e.h-t.h;c>180?l-=360:c<-180&&(l+=360),s=r*(1-i)+l*i}const n=t.c*(1-i)+e.c*i,a=t.l*(1-i)+e.l*i,o=t.a*(1-i)+e.a*i;return xe.fromOKLCH(a,n,s,o)},$o=class extends zp{constructor(){super(...arguments),this.type="color",this.invalid=!0,this.domain=[0,1],this.range=["red","blue"],this.parsedRange=this.range.map(g0)}update(){const{domain:t,range:e}=this;t.length<2&&(et.warnOnce("`colorDomain` should have at least 2 values."),t.length===0?t.push(0,1):t.length===1&&t.push(t[0]+1));for(let i=1;i=n){et.warnOnce("`colorDomain` values should be supplied in ascending order."),t.sort((a,o)=>a-o);break}}if(e.length0?e[0]:"black");this.parsedRange=this.range.map(g0)}normalizeDomains(...t){return{domain:t.flat(),animatable:!0}}toDomain(){}convert(t){this.refresh();const{domain:e,range:i,parsedRange:s}=this,n=e[0],a=e.at(-1),o=i[0],r=i[i.length-1];if(t<=n)return o;if(t>=a)return r;let l,c;if(e.length===2){const d=(t-n)/(a-n),p=1/(i.length-1);l=i.length<=2?0:Math.min(Math.floor(d*(i.length-1)),i.length-2),c=(d-l*p)/p}else{for(l=0;l=Math.PI&&(t-=on),t}function Qr(t,e,i){const s=re(t),n=re(e),a=re(i);return na?n<=s||s<=a:!0}function ti(t){return t/180*Math.PI}function rY(t){return t/Math.PI*180}function fm(t,e){return t=re(t),e=re(e),e-t+(t>e?on:0)}function tO(t){const e=re(t);return e<=ku?e/ku:e<=Math.PI?(Math.PI-e)/ku:e<=1.5*Math.PI?(e-Math.PI)/ku:(on-e)/ku}var on,ku,Ii=I({"packages/ag-charts-community/src/util/angle.ts"(){"use strict";on=Math.PI*2,ku=Math.PI/2}}),ym,eO=I({"packages/ag-charts-community/src/scene/gradient/linearGradient.ts"(){"use strict";Ii(),gm(),ym=class extends Jp{constructor(t,e,i=0,s){super(t,e,s),this.angle=i}createCanvasGradient(t,e){const{angle:s}=this,n=re(ti(s+90)),a=Math.cos(n),o=Math.sin(n),r=e.width,l=e.height,c=e.x+r*.5,h=e.y+l*.5,u=Math.sqrt(l*l+r*r)/2,d=Math.atan2(l,r);let p;n{const{offset:s}=e,n=t.at(i+1)?.color;return n!=null?[e,{offset:s,color:n}]:[e]})}function cY(t,e){const i=e==="discrete"?1:0,s=t.map((n,a,{length:o})=>({offset:(a+i)/(o-1+i),color:n}));return e==="discrete"?iO(s):s}function sO(t,e,i,s="continuous"){if(t.length===0)return cY(e,s);if(!lY(t))return et.warnOnce("[fills] must have the stops defined in ascending order"),[];const n=Math.min(...i),a=Math.max(...i),o=s==="discrete",r=new Float64Array(t.length);let l=0,c=-1;for(let p=0;p=c){c=t.length-1;for(let x=p+1;xp.color!=null)?.color,u;const d=t.map(({color:p},g)=>{const f=r[g];return p!=null?h=p:h!=null?p=h:(u==null&&(u=new $o,u.domain=[0,1],u.range=e),p=u.convert(f)),{offset:f,color:p}});return s==="discrete"?iO(d):d}var mm,nO=I({"packages/ag-charts-community/src/scene/gradient/stops.ts"(){"use strict";ot(),Du(),Qt(),mt(),mm=class extends bt{constructor(){super(...arguments),this.color="black"}},M([k(_t,{optional:!0})],mm.prototype,"stop",2),M([k(jt,{optional:!0})],mm.prototype,"color",2)}});function aO(t){return t!==null&&bi(t)&&t.type=="gradient"}var oO=I({"packages/ag-charts-community/src/scene/util/fill.ts"(){"use strict";ot()}});function Xo(t,e,i){const s=Math.round(e*t)/t;return i==null?s:i===0?0:i<1?Math.ceil(i*t)/t:Math.round((i+e)*t)/t-s}function rO(t,e){return Math.floor(e*t)/t}var y0=I({"packages/ag-charts-community/src/scene/util/pixel.ts"(){"use strict"}}),lO,es,rn,qr=I({"packages/ag-charts-community/src/scene/shape/shape.ts"(){"use strict";At(),gm(),eO(),nO(),nn(),oO(),y0(),lO=/^linear-gradient\((-?[\d.]+)deg,(.*?)\)$/i,es=class Ka extends Wo{constructor(){super(...arguments),this.fillOpacity=1,this.strokeOpacity=1,this.fill=Ka.defaultStyles.fill,this.stroke=Ka.defaultStyles.stroke,this.strokeWidth=Ka.defaultStyles.strokeWidth,this.lineDash=Ka.defaultStyles.lineDash,this.lineDashOffset=Ka.defaultStyles.lineDashOffset,this.lineCap=Ka.defaultStyles.lineCap,this.lineJoin=Ka.defaultStyles.lineJoin,this.miterLimit=void 0,this.opacity=Ka.defaultStyles.opacity,this.fillShadow=Ka.defaultStyles.fillShadow,this.gradientFillOptions={domain:[0,1],defaultColorRange:Ka.defaultStyles.defaultColorRange}}restoreOwnStyles(){const{defaultStyles:e}=this.constructor;Object.assign(this,e)}getGradient(e){let i;if(e instanceof Jp)return e;if(typeof e=="string"&&e?.startsWith("linear-gradient")&&(i=lO.exec(e))){const s=parseFloat(i[1]),n=[],a=i[2],o=/(#[0-9a-f]+)|(rgba?\(.+?\))|([a-z]+)/gi;let r;for(;r=o.exec(a);)n.push(r[0]);return new ym("rgb",n.map((l,c)=>({color:l,offset:c/(n.length-1)})),s)}else if(aO(e))return this.createLinearGradient(e)}createLinearGradient(e){const{colorStops:i=[],direction:s}=e,n=s==="horizontal",{domain:a,defaultColorRange:o=[]}=this.gradientFillOptions,r=sO(i,o,a);return new ym("oklch",r,n?0:90)}onFillChange(){this.fillGradient=this.getGradient(this.fill)}onStrokeChange(){this.strokeGradient=this.getGradient(this.stroke)}align(e,i){return Xo(this.layerManager?.canvas?.pixelRatio??1,e,i)}fillStroke(e,i){this.renderFill(e,i),this.renderStroke(e,i)}renderFill(e,i){if(this.fill){const{globalAlpha:s}=e;this.applyFill(e),this.applyFillAlpha(e),this.applyShadow(e),this.executeFill(e,i),e.globalAlpha=s}e.shadowColor="rgba(0, 0, 0, 0)"}executeFill(e,i){i?e.fill(i):e.fill()}applyFill(e){const i=this.gradientFillOptions.bbox??this.getBBox();e.fillStyle=this.fillGradient?.createGradient(e,i)??(typeof this.fill=="string"?this.fill:void 0)??"black"}applyStroke(e){e.strokeStyle=this.strokeGradient?.createGradient(e,this.getBBox())??(typeof this.stroke=="string"?this.stroke:void 0)??"black"}applyFillAlpha(e){e.globalAlpha*=this.opacity*this.fillOpacity}applyShadow(e){const i=this.layerManager?.canvas.pixelRatio??1,s=this.fillShadow;s?.enabled&&(e.shadowColor=s.color,e.shadowOffsetX=s.xOffset*i,e.shadowOffsetY=s.yOffset*i,e.shadowBlur=s.blur*i)}renderStroke(e,i){if(this.stroke&&this.strokeWidth){const{globalAlpha:s}=e;this.applyStroke(e),e.globalAlpha*=this.opacity*this.strokeOpacity,e.lineWidth=this.strokeWidth,this.lineDash&&e.setLineDash(this.lineDash),this.lineDashOffset&&(e.lineDashOffset=this.lineDashOffset),this.lineCap&&(e.lineCap=this.lineCap),this.lineJoin&&(e.lineJoin=this.lineJoin),this.miterLimit!=null&&(e.miterLimit=this.miterLimit),this.executeStroke(e,i),e.globalAlpha=s}}executeStroke(e,i){i?e.stroke(i):e.stroke()}containsPoint(e,i){return this.isPointInPath(e,i)}applySvgFillAttributes(e){const{fill:i,fillOpacity:s}=this;e.setAttribute("fill",typeof i=="string"?i:"none"),e.setAttribute("fill-opacity",String(s))}applySvgStrokeAttributes(e){const{stroke:i,strokeOpacity:s,strokeWidth:n,lineDash:a,lineDashOffset:o}=this;if(i!=null&&(e.setAttribute("stroke",typeof i=="string"?i:"none"),e.setAttribute("stroke-opacity",String(s)),e.setAttribute("stroke-width",String(n))),a?.some(r=>r!==0)===!0){const r=a.length%2===1?[...a,...a]:a;e.setAttribute("stroke-dasharray",r.join(" ")),e.setAttribute("stroke-dashoffset",String(o))}}},es.defaultStyles={fill:"black",stroke:void 0,strokeWidth:0,lineDash:void 0,lineDashOffset:0,lineCap:void 0,lineJoin:void 0,opacity:1,fillShadow:void 0,defaultColorRange:["#5090dc","#ef5452"]},M([ct()],es.prototype,"fillOpacity",2),M([ct()],es.prototype,"strokeOpacity",2),M([ct({changeCb:t=>t.onFillChange()})],es.prototype,"fill",2),M([ct({changeCb:t=>t.onStrokeChange()})],es.prototype,"stroke",2),M([ct()],es.prototype,"strokeWidth",2),M([ct()],es.prototype,"lineDash",2),M([ct()],es.prototype,"lineDashOffset",2),M([ct()],es.prototype,"lineCap",2),M([ct()],es.prototype,"lineJoin",2),M([ct()],es.prototype,"miterLimit",2),M([ct({convertor:t=>It(0,t,1)})],es.prototype,"opacity",2),M([ct({checkDirtyOnAssignment:!0})],es.prototype,"fillShadow",2),M([ct({changeCb:t=>t.onFillChange()})],es.prototype,"gradientFillOptions",2),rn=es}}),m0,Pn,x0=I({"packages/ag-charts-community/src/scene/matrix.ts"(){"use strict";At(),Rt(),m0=[1,0,0,1,0,0],Pn=class MM{get e(){return[...this.elements]}constructor(e=m0){this.elements=[...e]}setElements(e){const i=this.elements;return i[0]=e[0],i[1]=e[1],i[2]=e[2],i[3]=e[3],i[4]=e[4],i[5]=e[5],this}get identity(){const e=this.elements;return ca(e[0],1)&&ca(e[1],0)&&ca(e[2],0)&&ca(e[3],1)&&ca(e[4],0)&&ca(e[5],0)}AxB(e,i,s){const n=e[0]*i[0]+e[2]*i[1],a=e[1]*i[0]+e[3]*i[1],o=e[0]*i[2]+e[2]*i[3],r=e[1]*i[2]+e[3]*i[3],l=e[0]*i[4]+e[2]*i[5]+e[4],c=e[1]*i[4]+e[3]*i[5]+e[5];s=s??e,s[0]=n,s[1]=a,s[2]=o,s[3]=r,s[4]=l,s[5]=c}multiplySelf(e){return this.AxB(this.elements,e.elements),this}multiply(e){const i=new Array(6);return e instanceof MM?this.AxB(this.elements,e.elements,i):this.AxB(this.elements,[e.a,e.b,e.c,e.d,e.e,e.f],i),new MM(i)}preMultiplySelf(e){return this.AxB(e.elements,this.elements,this.elements),this}inverse(){const e=this.elements;let i=e[0],s=e[1],n=e[2],a=e[3];const o=e[4],r=e[5],l=1/(i*a-s*n);return i*=l,s*=l,n*=l,a*=l,new MM([a,-s,-n,i,n*r-a*o,s*o-i*r])}invertSelf(){const e=this.elements;let i=e[0],s=e[1],n=e[2],a=e[3];const o=e[4],r=e[5],l=1/(i*a-s*n);return i*=l,s*=l,n*=l,a*=l,e[0]=a,e[1]=-s,e[2]=-n,e[3]=i,e[4]=n*r-a*o,e[5]=s*o-i*r,this}transformPoint(e,i){const s=this.elements;return{x:e*s[0]+i*s[2]+s[4],y:e*s[1]+i*s[3]+s[5]}}transformBBox(e,i){const s=this.elements,n=s[0],a=s[1],o=s[2],r=s[3],l=e.width*.5,c=e.height*.5,h=e.x+l,u=e.y+c,d=Math.abs(l*n)+Math.abs(c*o),p=Math.abs(l*a)+Math.abs(c*r);return i??(i=new ht(0,0,0,0)),i.x=h*n+u*o+s[4]-d,i.y=h*a+u*r+s[5]-p,i.width=d+d,i.height=p+p,i}toContext(e){if(this.identity)return;const i=this.elements;e.transform(i[0],i[1],i[2],i[3],i[4],i[5])}static updateTransformMatrix(e,i,s,n,a,o,r){const l=i,c=s;let h,u;l===1&&c===1?(h=0,u=0):(h=r?.scalingCenterX??0,u=r?.scalingCenterY??0);const d=n,p=Math.cos(d),g=Math.sin(d);let f,x;d===0?(f=0,x=0):(f=r?.rotationCenterX??0,x=r?.rotationCenterY??0);const m=a,b=o,v=h*(1-l)-f,S=u*(1-c)-x;return e.setElements([p*l,g*l,-g*c,p*c,p*v-g*S+f+m,g*v+p*S+x+b]),e}}}});function Jr(t){return cO(t.constructor)}function cO(t){return t[v0]===!0}function b0(t){var e,i;const s=t;if(cO(t))return t;const n=Symbol("matrix_combined_transform");class a extends s{constructor(){super(...arguments),this[i]=new Pn,this._dirtyTransform=!0}markDirtyTransform(){this._dirtyTransform=!0,super.markDirty()}updateMatrix(r){}computeTransformMatrix(){this._dirtyTransform&&(this[n].setElements(m0),this.updateMatrix(this[n]),this._dirtyTransform=!1)}toParent(r){return this.computeTransformMatrix(),this[n].identity?r.clone():this[n].transformBBox(r)}toParentPoint(r,l){return this.computeTransformMatrix(),this[n].identity?{x:r,y:l}:this[n].transformPoint(r,l)}fromParent(r){return this.computeTransformMatrix(),this[n].identity?r.clone():this[n].inverse().transformBBox(r)}fromParentPoint(r,l){return this.computeTransformMatrix(),this[n].identity?{x:r,y:l}:this[n].inverse().transformPoint(r,l)}computeBBox(){const r=super.computeBBox();return r&&this.toParent(r)}computeBBoxWithoutTransforms(){return super.computeBBox()}pickNode(r,l,c=!1){return c||({x:r,y:l}=this.fromParentPoint(r,l)),super.pickNode(r,l)}render(r){this.computeTransformMatrix();const{ctx:l}=r,c=this[n];let h=!1;c.identity||(l.save(),h=!0,c.toContext(l)),super.render(r),h&&l.restore()}toSVG(){this.computeTransformMatrix();const r=super.toSVG(),l=this[n];if(l.identity||r==null)return r;const c=wn("g");c.append(...r.elements);const[h,u,d,p,g,f]=l.e;return c.setAttribute("transform",`matrix(${h} ${u} ${d} ${p} ${g} ${f})`),{elements:[c],defs:r.defs}}}return e=v0,i=n,a[e]=!0,a}function Lu(t){var e;const i=t,s=Symbol("matrix_rotation");class n extends b0(i){constructor(){super(...arguments),this[e]=new Pn,this.rotationCenterX=null,this.rotationCenterY=null,this.rotation=0}updateMatrix(o){super.updateMatrix(o);const{rotation:r,rotationCenterX:l,rotationCenterY:c}=this;r!==0&&(Pn.updateTransformMatrix(this[s],1,1,r,0,0,{rotationCenterX:l,rotationCenterY:c}),o.multiplySelf(this[s]))}}return e=s,M([ct({type:"transform"})],n.prototype,"rotationCenterX",2),M([ct({type:"transform"})],n.prototype,"rotationCenterY",2),M([ct({type:"transform"})],n.prototype,"rotation",2),n}function S0(t){var e;const i=t,s=Symbol("matrix_scale");class n extends b0(i){constructor(){super(...arguments),this[e]=new Pn,this.scalingX=1,this.scalingY=1,this.scalingCenterX=null,this.scalingCenterY=null}updateMatrix(o){super.updateMatrix(o);const{scalingX:r,scalingY:l,scalingCenterX:c,scalingCenterY:h}=this;r===1&&l===1||(Pn.updateTransformMatrix(this[s],r,l,0,0,0,{scalingCenterX:c,scalingCenterY:h}),o.multiplySelf(this[s]))}}return e=s,M([ct({type:"transform"})],n.prototype,"scalingX",2),M([ct({type:"transform"})],n.prototype,"scalingY",2),M([ct({type:"transform"})],n.prototype,"scalingCenterX",2),M([ct({type:"transform"})],n.prototype,"scalingCenterY",2),n}function Dc(t){var e;const i=t,s=Symbol("matrix_translation");class n extends b0(i){constructor(){super(...arguments),this[e]=new Pn,this.translationX=0,this.translationY=0}updateMatrix(o){super.updateMatrix(o);const{translationX:r,translationY:l}=this;r===0&&l===0||(Pn.updateTransformMatrix(this[s],1,1,0,r,l),o.multiplySelf(this[s]))}}return e=s,M([ct({type:"transform"})],n.prototype,"translationX",2),M([ct({type:"transform"})],n.prototype,"translationY",2),n}var v0,be,Ai=I({"packages/ag-charts-community/src/scene/transformable.ts"(){"use strict";Lt(),x0(),nn(),v0=Symbol("isMatrixTransform"),be=class{static fromCanvas(t,e){const i=[];for(const s of t.traverseUp())Jr(s)&&i.unshift(s);for(const s of i)e=s.fromParent(e);return Jr(t)&&(e=t.fromParent(e)),e}static toCanvas(t,e){e==null?e=t.getBBox():Jr(t)&&(e=t.toParent(e));for(const i of t.traverseUp())Jr(i)&&(e=i.toParent(e));return e}static fromCanvasPoint(t,e,i){const s=[];for(const n of t.traverseUp())Jr(n)&&s.unshift(n);for(const n of s)({x:e,y:i}=n.fromParentPoint(e,i));return Jr(t)&&({x:e,y:i}=t.fromParentPoint(e,i)),{x:e,y:i}}static toCanvasPoint(t,e,i){Jr(t)&&({x:e,y:i}=t.toParentPoint(e,i));for(const s of t.traverseUp())Jr(s)&&({x:e,y:i}=s.toParentPoint(e,i));return{x:e,y:i}}}}});function hO(t,e){if(typeof t=="number"&&typeof e=="number")return xm(t,e);const i=typeof t=="number"?[t]:t,s=typeof e=="number"?[e]:e,n=Math.min(i.length,s.length);for(let a=0;aMath.sign(t-e)}}),eg,bm,yt,dO,pO,is,Tu,pe=I({"packages/ag-charts-community/src/scene/group.ts"(){"use strict";At(),Rt(),q2(),nn(),qr(),Ai(),y0(),uO(),bm=class Ry extends Wo{constructor(e){super(e),this.opacity=1,this.renderToOffscreenCanvas=!1,this.optimizeForInfrequentRedraws=!1,this.layer=void 0,this.image=void 0,this._lastWidth=NaN,this._lastHeight=NaN,this._lastDevicePixelRatio=NaN,this.isContainerNode=!0,this.renderToOffscreenCanvas=e?.renderToOffscreenCanvas===!0}static is(e){return e instanceof Ry}static computeChildrenBBox(e,i=!0){return ht.merge(Wo.extractBBoxes(e,i))}static compareChildren(e,i){return hO(e.zIndex,i.zIndex)||e.serialNumber-i.serialNumber}containsPoint(e,i){return!0}computeBBox(){return Ry.computeChildrenBBox(this.children())}computeSafeClippingBBox(e){const i=this.computeBBox();if(!i.isFinite())return;let s=0;const n=4;for(const d of this.descendants())d instanceof rn&&(s=Math.max(s,d.strokeWidth));const a=Math.max(1,s/2*n),{x:o,y:r}=be.toCanvasPoint(this,0,0),l=rO(e,o+i.x-a)-o,c=rO(e,r+i.y-a)-r,h=Math.ceil(i.x+i.width-l+a),u=Math.ceil(i.y+i.height-c+a);return new ht(l,c,h,u)}prepareSharedCanvas(e,i,s){return eg==null||eg.pixelRatio!==s?eg=new p0({width:e,height:i,pixelRatio:s}):eg.resize(e,i,s),eg}isDirty(e){const{width:i,height:s,devicePixelRatio:n}=e,{dirty:a,dirtyZIndex:o,layer:r}=this,l=r!=null&&(this._lastWidth!==i||this._lastHeight!==s),c=this._lastDevicePixelRatio!==n;if(this._lastWidth=i,this._lastHeight=s,this._lastDevicePixelRatio=n,a||o||l||c)return!0;for(const h of this.children())if(h.dirty)return!0;return!1}preRender(e){const i=super.preRender(e,0);return i.groups+=1,i.nonGroups-=1,this.renderToOffscreenCanvas&&!this.optimizeForInfrequentRedraws&&i.nonGroups>0&&this.getVisibility()?this.layer??(this.layer=this._layerManager?.addLayer({name:this.name})):this.layer!=null&&(this._layerManager?.removeLayer(this.layer),this.layer=void 0),i}render(e){const{layer:i,renderToOffscreenCanvas:s}=this,n={...e};if(!s){this.renderInContext(n),super.render(n);return}const{ctx:a,stats:o,devicePixelRatio:r}=e;let{image:l}=this;if(this.isDirty(e)){l?.bitmap.close(),l=void 0;const h=i?void 0:this.computeSafeClippingBBox(r),u=(d,...p)=>{const g=d.context;n.ctx=g,d.clear(),g.save(),g.setTransform(...p),g.globalAlpha=1,this.renderInContext(n),g.restore(),g.verifyDepthZero?.()};if(i)u(i,a.getTransform());else if(h){const{x:d,y:p,width:g,height:f}=h,x=this.prepareSharedCanvas(g,f,r);u(x,r,0,0,r,-d*r,-p*r),l={bitmap:x.transferToImageBitmap(),x:d,y:p,width:g,height:f}}else this.dirtyZIndex&&this.sortChildren(Ry.compareChildren);this.image=l,o&&o.layersRendered++}else this.skipRender(n),o&&o.layersSkipped++;const{globalAlpha:c}=a;if(a.globalAlpha=c*this.opacity,i)a.save(),a.resetTransform(),i.drawImage(a),a.restore();else if(l){const{bitmap:h,x:u,y:d,width:p,height:g}=l;a.drawImage(h,0,0,p*r,g*r,u,d,p,g)}a.globalAlpha=c,super.render(n)}skipRender(e){const{stats:i}=e;for(const s of this.children())s.markClean(),i&&(i.nodesSkipped+=this.childNodeCounts.groups+this.childNodeCounts.nonGroups,i.opsSkipped+=this.childNodeCounts.complexity)}applyClip(e,i){const{x:s,y:n,width:a,height:o}=i;e.beginPath(),e.rect(s,n,a,o),e.clip()}renderInContext(e){const{ctx:i,stats:s}=e;this.dirtyZIndex&&this.sortChildren(Ry.compareChildren),i.save(),i.globalAlpha*=this.opacity,this.clipRect!=null&&(this.applyClip(i,this.clipRect),e.clipBBox=be.toCanvas(this,this.clipRect));for(const n of this.children()){if(!n.visible){n.markClean(),s&&(s.nodesSkipped+=n.childNodeCounts.nonGroups+n.childNodeCounts.groups,s.opsSkipped+=n.childNodeCounts.complexity);continue}i.save(),n.render(e),i.restore()}i.restore()}setClipRect(e){this.clipRect=e?be.fromCanvas(this,e):void 0}setClipRectCanvasSpace(e){this.clipRect=e}_setLayerManager(e){this.layer&&(this._layerManager?.removeLayer(this.layer),this.layer=void 0),super._setLayerManager(e)}getVisibility(){for(const e of this.traverseUp(!0))if(!e.visible)return!1;return!0}toSVG(){if(!this.visible)return;const e=[],i=[];for(const s of this.children()){const n=s.toSVG();n!=null&&(i.push(...n.elements),n.defs!=null&&e.push(...n.defs))}return{elements:i,defs:e}}},bm.className="Group",M([ct({convertor:t=>It(0,t,1)})],bm.prototype,"opacity",2),yt=bm,dO=class extends S0(yt){},pO=class extends Lu(yt){},is=class extends Dc(yt){},Tu=class extends Lu(Dc(yt)){}}});function hY(t=0,e=0){return new OffscreenCanvas(t,e).getContext("2d")}var uY=I({"packages/ag-charts-community/src/util/canvas.util.ts"(){"use strict"}}),Sm,gO=I({"packages/ag-charts-community/src/util/lruCache.ts"(){"use strict";Sm=class{constructor(t=5){this.maxCacheSize=t,this.store=new Map}get(t){if(!this.store.has(t))return;const e=this.store.get(t);return this.store.delete(t),this.store.set(t,e),e}has(t){return this.store.has(t)}set(t,e){if(this.store.set(t,e),this.store.size>this.maxCacheSize){const i=this.store.keys();let s=this.store.size-this.maxCacheSize;for(;s>0;){const n=i.next();n.done||this.store.delete(n.value),s--}}return e}clear(){this.store.clear()}}}}),io,M0,ge,vm,ln=I({"packages/ag-charts-community/src/util/textMeasurer.ts"(){"use strict";uY(),gO(),io=class{static measureText(t,e){return this.getMeasurer(e).measureText(t)}static measureLines(t,e){return this.getMeasurer(e).measureLines(t)}static getMeasurer(t){const e=typeof t.font=="string"?t.font:ge.toFontString(t.font),i=`${e}-${t.textAlign??"start"}-${t.textBaseline??"alphabetic"}`;return this.instanceMap.get(i)??this.createFontMeasurer(e,t,i)}static createFontMeasurer(t,e,i){const s=hY();s.font=t,s.textAlign=e.textAlign??"start",s.textBaseline=e.textBaseline??"alphabetic";const n=new M0(s,e);return this.instanceMap.set(i,n),n}},io.instanceMap=new Sm(10),M0=class{constructor(t,e){this.ctx=t,this.measureMap=new Sm(100),e.textAlign&&(t.textAlign=e.textAlign),e.textBaseline&&(t.textBaseline=e.textBaseline),t.font=typeof e.font=="string"?e.font:ge.toFontString(e.font),this.textMeasurer=new vm(i=>this.cachedCtxMeasureText(i),e.textBaseline??"alphabetic")}textWidth(t,e){return this.textMeasurer.textWidth(t,e)}measureText(t){return this.textMeasurer.measureText(t)}measureLines(t){return this.textMeasurer.measureLines(t)}cachedCtxMeasureText(t){if(!this.measureMap.has(t)){const e=this.ctx.measureText(t);this.measureMap.set(t,{actualBoundingBoxAscent:e.actualBoundingBoxAscent,emHeightAscent:e.emHeightAscent,emHeightDescent:e.emHeightDescent,actualBoundingBoxDescent:e.actualBoundingBoxDescent,actualBoundingBoxLeft:e.actualBoundingBoxLeft,actualBoundingBoxRight:e.actualBoundingBoxRight,alphabeticBaseline:e.alphabeticBaseline,fontBoundingBoxAscent:e.fontBoundingBoxAscent,fontBoundingBoxDescent:e.fontBoundingBoxDescent,hangingBaseline:e.hangingBaseline,ideographicBaseline:e.ideographicBaseline,width:e.width})}return this.measureMap.get(t)}},ge=class{static toFontString({fontSize:t=10,fontStyle:e,fontWeight:i,fontFamily:s,lineHeight:n}){let a="";return e&&(a+=`${e} `),i&&(a+=`${i} `),a+=`${t}px`,n&&(a+=`/${n}px`),a+=` ${s}`,a.trim()}static getLineHeight(t){return Math.ceil(t*this.defaultLineHeight)}static getVerticalModifier(t){switch(t){case"hanging":case"top":return 0;case"middle":return .5;case"alphabetic":case"bottom":case"ideographic":default:return 1}}},ge.EllipsisChar="\u2026",ge.defaultLineHeight=1.15,ge.lineSplitter=/\r?\n/g,vm=class{constructor(t,e="alphabetic"){this.measureTextFn=t,this.textBaseline=e,this.charMap=new Map}getMetrics(t){const e=this.measureTextFn(t);return e.fontBoundingBoxAscent??(e.fontBoundingBoxAscent=e.emHeightAscent),e.fontBoundingBoxDescent??(e.fontBoundingBoxDescent=e.emHeightDescent),{width:e.width,height:e.actualBoundingBoxAscent+e.actualBoundingBoxDescent,lineHeight:e.fontBoundingBoxAscent+e.fontBoundingBoxDescent,offsetTop:e.actualBoundingBoxAscent,offsetLeft:e.actualBoundingBoxLeft}}getMultilineMetrics(t){let e=0,i=0,s=0,n=0,a=0;const o=ge.getVerticalModifier(this.textBaseline),r=[];let l=0;const c=t.length;for(const h of t){const u=this.measureTextFn(h);u.fontBoundingBoxAscent??(u.fontBoundingBoxAscent=u.emHeightAscent),u.fontBoundingBoxDescent??(u.fontBoundingBoxDescent=u.emHeightDescent),e1?this.measureTextFn(t).width:this.charMap.get(t)??this.charWidth(t)}measureText(t){return this.getMetrics(t)}measureLines(t){const e=typeof t=="string"?t.split(ge.lineSplitter):t;return this.getMultilineMetrics(e)}charWidth(t){const{width:e}=this.measureTextFn(t);return this.charMap.set(t,e),e}}}}),zs,ei,I0,kc,Fs=I({"packages/ag-charts-community/src/scene/shape/text.ts"(){"use strict";Lt(),ln(),Rt(),nn(),Ai(),qr(),zs=class IM extends rn{constructor(){super(...arguments),this.x=0,this.y=0,this.lines=[],this.text=void 0,this.fontSize=10,this.fontFamily="sans-serif",this.textAlign=IM.defaultStyles.textAlign,this.textBaseline=IM.defaultStyles.textBaseline}onTextChange(){this.lines=this.text?.split(` `).map(e=>e.trim())??[]}static computeBBox(e,i,s,n){const{offsetTop:a,offsetLeft:o,width:r,height:l}=io.measureLines(e,n);return new ht(i-o,s-a,r,l)}computeBBox(){const{x:e,y:i,lines:s,textBaseline:n,textAlign:a}=this;return IM.computeBBox(s,e,i,{font:this,textBaseline:n,textAlign:a})}isPointInPath(e,i){const s=this.getBBox();return s?s.containsPoint(e,i):!1}render(e){const{ctx:i,stats:s}=e;if(!this.lines.length||!this.layerManager)return s&&(s.nodesSkipped+=1),super.render(e);const{fill:n,stroke:a,strokeWidth:o}=this,{pixelRatio:r}=this.layerManager.canvas;if(i.font=ge.toFontString(this),i.textAlign=this.textAlign,i.textBaseline=this.textBaseline,n){this.applyFill(i),i.globalAlpha*=this.opacity*this.fillOpacity;const{fillShadow:l}=this;l?.enabled&&(i.shadowColor=l.color,i.shadowOffsetX=l.xOffset*r,i.shadowOffsetY=l.yOffset*r,i.shadowBlur=l.blur*r),this.renderLines((c,h,u)=>i.fillText(c,h,u))}if(a&&o){this.applyStroke(i),i.lineWidth=o,i.globalAlpha*=this.opacity*this.strokeOpacity;const{lineDash:l,lineDashOffset:c,lineCap:h,lineJoin:u}=this;l&&i.setLineDash(l),c&&(i.lineDashOffset=c),h&&(i.lineCap=h),u&&(i.lineJoin=u),this.renderLines((d,p,g)=>i.strokeText(d,p,g))}super.render(e)}renderLines(e){const{lines:i,x:s,y:n}=this,a=this.lineHeight??ge.getLineHeight(this.fontSize);let o=(a-a*i.length)*ge.getVerticalModifier(this.textBaseline);for(const r of i)e(r,s,n+o),o+=a}setFont(e){this.fontFamily=e.fontFamily,this.fontSize=e.fontSize,this.fontStyle=e.fontStyle,this.fontWeight=e.fontWeight}setAlign(e){this.textAlign=e.textAlign,this.textBaseline=e.textBaseline}toSVG(){if(!this.visible||!this.text)return;const e=wn("text");return this.applySvgFillAttributes(e),e.setAttribute("font-family",this.fontFamily?.split(",")[0]??""),e.setAttribute("font-size",String(this.fontSize)),e.setAttribute("font-style",this.fontStyle??""),e.setAttribute("font-weight",String(this.fontWeight??"")),e.setAttribute("text-anchor",{center:"middle",left:"start",right:"end",start:"start",end:"end"}[this.textAlign??"start"]),e.setAttribute("alignment-baseline",{alphabetic:"alphabetic",top:"top",bottom:"bottom",hanging:"hanging",middle:"middle",ideographic:"ideographic"}[this.textBaseline??"alphabetic"]),e.setAttribute("x",String(this.x)),e.setAttribute("y",String(this.y)),e.textContent=this.text??"",{elements:[e]}}},zs.className="Text",zs.defaultStyles={...rn.defaultStyles,textAlign:"start",fontStyle:void 0,fontWeight:void 0,fontSize:10,fontFamily:"sans-serif",textBaseline:"alphabetic"},M([ct()],zs.prototype,"x",2),M([ct()],zs.prototype,"y",2),M([ct({changeCb:t=>t.onTextChange()})],zs.prototype,"text",2),M([ct()],zs.prototype,"fontStyle",2),M([ct()],zs.prototype,"fontWeight",2),M([ct()],zs.prototype,"fontSize",2),M([ct()],zs.prototype,"fontFamily",2),M([ct()],zs.prototype,"textAlign",2),M([ct()],zs.prototype,"textBaseline",2),M([ct()],zs.prototype,"lineHeight",2),ei=zs,I0=class extends Lu(ei){},kc=class extends Lu(Dc(ei)){}}});function dY(){return l2(()=>{})}function A0(t,e){const i=uc(e);if(i.length===0)return;const s=c2(t);for(const n of i)n in s&&(e[n]=s[n])}var Mm,Im,D0,Am,Cu,fO,ig=I({"packages/ag-charts-community/src/util/stateMachine.ts"(){"use strict";di(),Xr(),Mm="color: green",Im="color: grey",D0=class{transitionRoot(t,e){this.parent?this.parent.transitionRoot(t,e):this.transition(t,e)}},Am=class tn extends D0{constructor(e,i,s){super(),this.defaultState=e,this.states=i,this.enterEach=s,this.debug=Jt.create(!0,"animation"),this.state=e,this.debug(`%c${this.constructor.name} | init -> ${e}`,Mm)}transition(e,i){if(!this.transitionChild(e,i)||this.state===tn.child||this.state===tn.parent)return;const n=this.state,a=this.states[this.state];let o=a[e];const r=`%c${this.constructor.name} | ${this.state} -> ${e} ->`;if(Array.isArray(o))o=o.find(h=>{if(!h.guard)return!0;const u=h.guard(i);return u||this.debug(`${r} (guarded)`,h.target,Im),u});else if(typeof o=="object"&&!(o instanceof tn)&&o.guard&&!o.guard(i)){this.debug(`${r} (guarded)`,o.target,Im);return}if(!o){this.debug(`${r} ${this.state}`,Im);return}const l=this.getDestinationState(o),c=l===this.state?void 0:a.onExit;this.debug(`${r} ${l}`,Mm),this.state=l,typeof o=="function"?o(i):typeof o=="object"&&!(o instanceof tn)&&o.action?.(i),c?.(),this.enterEach?.(n,l),l!==n&&l!==tn.child&&l!==tn.parent&&this.states[l].onEnter?.(n,i)}transitionAsync(e,i){setTimeout(()=>{this.transition(e,i)},0)}is(e){return this.state===tn.child&&this.childState?this.childState.is(e):this.state===e}resetHierarchy(){this.debug(`%c${this.constructor.name} | ${this.state} -> [resetHierarchy] -> ${this.defaultState}`,"color: green"),this.state=this.defaultState}transitionChild(e,i){return this.state!==tn.child||!this.childState||(A0(this,this.childState),this.childState.transition(e,i),!this.childState.is(tn.parent))?!0:(this.debug(`%c${this.constructor.name} | ${this.state} -> ${e} -> ${this.defaultState}`,Mm),this.state=this.defaultState,this.states[this.state].onEnter?.(),this.childState.resetHierarchy(),!1)}getDestinationState(e){let i=this.state;return typeof e=="string"?i=e:e instanceof tn?(this.childState=e,this.childState.parent=this,i=tn.child):typeof e=="object"&&(e.target instanceof tn?(this.childState=e.target,this.childState.parent=this,i=tn.child):e.target!=null&&(i=e.target)),i}},Am.child="__child",Am.parent="__parent",Cu=Am,fO=class extends D0{constructor(...t){super(),this.stateMachines=t;for(const e of t)e.parent=this}transition(t,e){for(const i of this.stateMachines)A0(this,i),i.transition(t,e)}transitionAsync(t,e){for(const i of this.stateMachines)A0(this,i),i.transitionAsync(t,e)}}}});function ue(t,e){const i=ne(t)?t:t.split(".");if(i.length===1){const[s]=i;return Uo((n,a,o)=>n[s]=o,n=>n[s],e)}return Uo((s,n,a)=>zM(s,i,a),s=>BM(s,i),e)}function pY(t){return Uo((e,i,s)=>e[t]=s)}function Di(t,e){return Uo((i,s,n)=>i[t][e??s]=n)}function js(t){const{newValue:e,oldValue:i,changeValue:s}=t;return Uo((n,a,o,r)=>(o!==r&&(r!==void 0&&i?.call(n,r),o!==void 0&&e?.call(n,o),s?.call(n,o,r)),o))}function tl(t){return l2(t)}var Is=I({"packages/ag-charts-community/src/util/proxy.ts"(){"use strict";ot(),Xr(),oe()}}),Dm,k0=I({"packages/ag-charts-community/src/util/textWrapper.ts"(){"use strict";ln(),Dm=class{static wrapText(t,e){return this.wrapLines(t,e).join(` `)}static wrapLines(t,e){const i=this.textWrap(t,e);return e.overflow==="hide"&&i.some(s=>s.endsWith(ge.EllipsisChar))?[]:i}static appendEllipsis(t){return t.replace(/[.,]{1,5}$/,"")+ge.EllipsisChar}static truncateLine(t,e,i,s){const n=e.textWidth(ge.EllipsisChar);let a=0,o=0;for(;oi)break;a+=r}if(t.length===o&&(!s||a+n<=i))return s?t+ge.EllipsisChar:t;for(t=t.slice(0,o).trimEnd();t.length&&e.textWidth(t)+n>i;)t=t.slice(0,-1).trimEnd();return t+ge.EllipsisChar}static textWrap(t,e){const i=t.split(ge.lineSplitter),s=io.getMeasurer(e);if(e.textWrap==="never")return i.map(r=>this.truncateLine(r.trimEnd(),s,e.maxWidth));const n=[],a=e.textWrap==="hyphenate",o=e.textWrap==null||e.textWrap==="on-space";for(const r of i){let l=r.trimEnd();if(l===""){n.push(l);continue}let c=0,h=0,u=0;for(;ce.maxWidth){if(c===0)break;const p=s.textWidth(l.slice(0,c+1));if(p<=e.maxWidth){h=p,c++;continue}if(u){const x=this.getWordAt(l,u+1),m=s.textWidth(x);if(m<=e.maxWidth){n.push(l.slice(0,u).trimEnd()),l=l.slice(u).trimStart(),c=0,h=0,u=0;continue}else o&&m>e.maxWidth&&n.push(l.slice(0,u).trimEnd(),this.truncateLine(l.slice(u).trimStart(),s,e.maxWidth,!0))}else o&&n.push(this.truncateLine(l,s,e.maxWidth,!0));if(o){l="";break}const g=a?"-":"";let f=l.slice(0,c).trim();for(;f.length&&s.textWidth(f+g)>e.maxWidth;)f=f.slice(0,-1).trimEnd();if(n.push(f+g),!f.length){l="";break}l=l.slice(f.length).trimStart(),c=-1,h=0,u=0}c++}l&&n.push(l)}return this.avoidOrphans(n,s,e),this.clipLines(n,s,e)}static getWordAt(t,e){const i=t.indexOf(" ",e);return i===-1?t.slice(e):t.slice(e,i)}static clipLines(t,e,i){if(!i.maxHeight)return t;const{height:s,lineMetrics:n}=e.measureLines(t);if(s<=i.maxHeight)return t;for(let a=0,o=0;ai.maxHeight){if(i.overflow==="hide")return[];const l=t.slice(0,a||1),c=l.pop();return l.concat(this.truncateLine(c,e,i.maxWidth,!0))}}return t}static avoidOrphans(t,e,i){if(i.avoidOrphans===!1||t.length<2)return;const{length:s}=t,n=t[s-1],a=t[s-2];if(a.lengththis.updateA11yText(t,e))}computeTextWrap(t,e){const{text:i,padding:s,wrapping:n}=this,a=Math.min(this.maxWidth??1/0,t)-s*2,o=this.maxHeight??e-s*2;if(!isFinite(a)&&!isFinite(o)){this.node.text=i;return}const r=Dm.wrapText(i??"",{maxWidth:a,maxHeight:o,font:this,textWrap:n});this.node.text=r,this.truncated=r.includes(ge.EllipsisChar)}updateA11yText(t,e){const{proxyInteractionService:i}=t;if(this.enabled&&this.text){const s=be.toCanvas(this.node);if(s){const{id:n}=this;this.proxyText??(this.proxyText=i.createProxyElement({type:"text",domManagerId:n,where:e})),this.proxyText.textContent=this.text,this.proxyText.setBounds(s),this.proxyText.addListener("mousemove",a=>this.handleMouseMove(t,a)),this.proxyText.addListener("mouseleave",a=>this.handleMouseLeave(t,a))}}else this.proxyText?.destroy(),this.proxyText=void 0}handleMouseMove(t,e){if(e!=null&&this.enabled&&this.node.visible&&this.truncated){const{x:i,y:s}=be.toCanvas(this.node),n=e.sourceEvent.offsetX+i,a=e.sourceEvent.offsetY+s,o={type:"pointermove",canvasX:n,canvasY:a};t.tooltipManager.updateTooltip(this.id,{canvasX:n,canvasY:a,lastPointerEvent:o,showArrow:!1},{type:"structured",title:this.text})}}handleMouseLeave(t,e){t.tooltipManager.removeTooltip(this.id)}},te.SMALL_PADDING=10,te.LARGE_PADDING=20,M([k(pt),Di("node","visible")],te.prototype,"enabled",2),M([k(tt,{optional:!0}),Di("node")],te.prototype,"text",2),M([k(l0,{optional:!0}),Di("node")],te.prototype,"textAlign",2),M([k(to,{optional:!0}),Di("node")],te.prototype,"fontStyle",2),M([k(eo,{optional:!0}),Di("node")],te.prototype,"fontWeight",2),M([k(st),Di("node")],te.prototype,"fontSize",2),M([k(tt),Di("node")],te.prototype,"fontFamily",2),M([k(jt,{optional:!0}),Di("node","fill")],te.prototype,"color",2),M([k(st,{optional:!0})],te.prototype,"spacing",2),M([k(st,{optional:!0})],te.prototype,"maxWidth",2),M([k(st,{optional:!0})],te.prototype,"maxHeight",2),M([k(Qp)],te.prototype,"wrapping",2),M([k(st)],te.prototype,"padding",2),M([k(tt)],te.prototype,"layoutStyle",2)}}),km,yO=I({"packages/ag-charts-community/src/chart/chartAxisDirection.ts"(){"use strict";km=(t=>(t.X="x",t.Y="y",t))(km||{})}}),Lm,L0=I({"packages/ag-charts-community/src/module/moduleMap.ts"(){"use strict";ot(),Lm=class{constructor(){this.moduleMap=new Map}*modules(){for(const t of this.moduleMap.values())yield t.moduleInstance}addModule(t,e){if(this.moduleMap.has(t.optionsKey))throw new Error(`AG Charts - module already initialised: ${t.optionsKey}`);this.moduleMap.set(t.optionsKey,{module:t,moduleInstance:e(t)})}removeModule(t){const e=Es(t)?t:t.optionsKey;this.moduleMap.get(e)?.moduleInstance.destroy(),this.moduleMap.delete(e)}getModule(t){return this.moduleMap.get(Es(t)?t:t.optionsKey)?.moduleInstance}isEnabled(t){return this.moduleMap.has(Es(t)?t:t.optionsKey)}mapModules(t){return Array.from(this.moduleMap.values(),(e,i)=>t(e.moduleInstance,i))}destroy(){for(const t of this.moduleMap.keys())this.moduleMap.get(t)?.moduleInstance.destroy();this.moduleMap.clear()}}}});function mO(t,e){return t.valueOf()-e.valueOf()}function gY(t){let e=NaN;const i=[];for(const s of t){const n=s.valueOf();e!==n&&i.push(s),e=n}return i}function T0(t){const e=t.slice().sort(mO);return C0(e)==null?gY(e):e}function C0(t){if(t.length===0)return 1;const e=Number(t[t.length-1])>Number(t[0])?1:-1;let i=-1/0*e;for(const s of t){const n=s.valueOf();if(Math.sign(n-i)!==e)return;i=n}return e}var xO=I({"packages/ag-charts-community/src/util/date.ts"(){"use strict"}});function bO(t){let e,i;const s=IO.exec(t);s&&([,e,t,i]=s);const n=MO.exec(t);if(!n)throw new Error(`The number formatter is invalid: ${t}`);const[,a,o,r,l,c,h,u,d,p,g]=n;return{fill:a,align:o,sign:r,symbol:l,zero:c,width:parseInt(h),comma:u,precision:parseInt(d),trim:!!p,type:g,prefix:e,suffix:i}}function SO(t){const e=typeof t=="string"?bO(t):t,{fill:i,align:s,sign:n="-",symbol:a,zero:o,width:r,comma:l,type:c,prefix:h="",suffix:u="",precision:d}=e;let{trim:p}=e;const g=d==null||isNaN(d);let f;if(!c)f=cn.g,p=!0;else if(c in cn&&c in Tc)f=g?Tc[c]:cn[c];else if(c in cn)f=cn[c];else if(c in Tc)f=Tc[c];else throw new Error(`The number formatter type is invalid: ${c}`);let x;return d==null||g?x=c?6:12:x=d,m=>{let b=f(m,x);return p&&(b=fY(b)),l&&(b=yY(b,l)),b=xY(m,b,n),a&&a!=="#"&&(b=`${a}${b}`),a==="#"&&c==="x"&&(b=`0x${b}`),c==="s"&&(b=`${b}${mY(m)}`),(c==="%"||c==="p")&&(b=`${b}%`),r!=null&&!isNaN(r)&&(b=bY(b,r,i??o,s)),b=`${h}${b}${u}`,b}}function Tm(t){return Math.floor(Math.abs(t))}function fY(t){return t.replace(/\.0+$/,"").replace(/(\.[1-9])0+$/,"$1")}function yY(t,e){let i=t.indexOf(".");i<0&&(i=t.length);const s=t.substring(0,i).split(""),n=t.substring(i);for(let a=s.length-3;a>0;a-=3)s.splice(a,0,e);return`${s.join("")}${n}`}function mY(t){return AO[vO(t)]}function vO(t){return It(N0,t?Math.floor(Math.log10(Math.abs(t))/3)*3:0,O0)}function xY(t,e,i=""){if(i==="(")return t>=0?e:`(${e})`;const s=i==="+"?"+":"";return`${t>=0?s:DO}${e}`}function bY(t,e,i=" ",s=">"){let n=t;if(s===">"||!s)n=n.padStart(e,i);else if(s==="<")n=n.padEnd(e,i);else if(s==="^"){const a=Math.max(0,e-n.length),o=Math.ceil(a/2),r=Math.floor(a/2);n=n.padStart(o+n.length,i),n=n.padEnd(r+n.length,i)}return n}var MO,IO,Tc,cn,N0,O0,AO,DO,kO=I({"packages/ag-charts-community/src/util/numberFormat.ts"(){"use strict";At(),MO=/^(?:(.)?([<>=^]))?([+\-( ])?([$€£¥₣₹#])?(0)?(\d+)?(,)?(?:\.(\d+))?(~)?([%a-z])?$/i,IO=/^((?:[^#]|#[^{])*)#{([^}]+)}(.*)$/,Tc={b:t=>Tm(t).toString(2),c:t=>String.fromCharCode(t),d:t=>Math.round(Math.abs(t)).toFixed(0),o:t=>Tm(t).toString(8),x:t=>Tm(t).toString(16),X:t=>Tc.x(t).toUpperCase(),n:t=>Tc.d(t),"%":t=>`${Tm(t*100).toFixed(0)}`},cn={e:(t,e)=>Math.abs(t).toExponential(e),E:(t,e)=>cn.e(t,e).toUpperCase(),f:(t,e)=>Math.abs(t).toFixed(e),F:(t,e)=>cn.f(t,e).toUpperCase(),g:(t,e)=>{if(t===0)return"0";const i=Math.abs(t),s=Math.floor(Math.log10(i));return s>=-4&&scn.g(t,e).toUpperCase(),n:(t,e)=>cn.g(t,e),p:(t,e)=>cn.r(t*100,e),r:(t,e)=>{if(t===0)return"0";const i=Math.abs(t),n=Math.floor(Math.log10(i))-(e-1);if(n<=0)return i.toFixed(-n);const a=10**n;return(Math.round(i/a)*a).toFixed()},s:(t,e)=>{const i=vO(t);return cn.r(t/10**i,e)},"%":(t,e)=>cn.f(t*100,e)},N0=-24,O0=24,AO={[N0]:"y",[-21]:"z",[-18]:"a",[-15]:"f",[-12]:"p",[-9]:"n",[-6]:"\xB5",[-3]:"m",0:"",3:"k",6:"M",9:"G",12:"T",15:"P",18:"E",21:"Z",[O0]:"Y"},DO="\u2212"}});function LO(t,e){return Math.abs(Math.round(t)-t)=s&&u<=n;if(c&&!d)continue;const p=Math.abs(u-i);(l>p||c!==d)&&(c||(c=d),l=p,r=h)}return r*o}function CO(t){for(let e=t.length-1;e>=0;e-=1)if(t[e]!=="0")return e+1;return 0}function NO(t,e){const i=bO(e??",f");(i.precision==null||isNaN(i.precision))&&(!i.type||"eEFgGnprs".includes(i.type)?i.precision=Math.max(...t.map(n=>{if(!Number.isFinite(n))return 0;const[a,o]=n.toExponential((i.type?6:12)-1).split(/[.e]/g);return(a!=="1"&&a!=="-1"?1:0)+CO(o)+1})):"f%".includes(i.type)&&(i.precision=Math.max(...t.map(n=>{if(!Number.isFinite(n)||n===0)return 0;const a=Math.floor(Math.log10(Math.abs(n))),o=i.type?6:12,r=n.toExponential(o-1).split(/[.e]/g)[1],l=CO(r);return Math.max(0,l-a)}))));const s=SO(i);return n=>s(Number(n))}function ng(t,e,i){if(!Number.isFinite(i)||i<=0)return[];const s=10**Qy(i),n=Math.min(t,e),a=Math.max(t,e),o=[];for(let r=0;;r+=1){const l=Math.round((n+i*r)*s)/s;if(l>a)break;o.push(l)}return o}function ag(t,e){return t>=e?(et.warnOnce("the configured interval results in more than 1 item per pixel, ignoring. Supply a larger interval or omit this configuration"),!0):!1}function SY(t,e){const i=Math.abs(e-t),s=10**Math.floor(Math.log10(i));let n=1/0,a=[t,e];for(const o of E0){const r=o*s,l=Math.floor(t/r)*r,c=Math.ceil(e/r)*r,h=1-i/Math.abs(c-l);n>h&&(n=h,a=[l,c])}return a}function OO(t,e,i,s,n,a){a=Math.max(a,t/(n+1)),isNaN(i)&&(i=a),isNaN(s)&&(s=t),i>s&&(i===a?i=s:s=i);const o=Math.max(1,Math.floor(t/(e*i))),r=Math.min(o,Math.ceil(t/(e*s))),l=It(r,Math.floor(n/e),o);return{minTickCount:r,maxTickCount:o,tickCount:l}}var Se,Nu,E0,Cc=I({"packages/ag-charts-community/src/util/ticks.ts"(){"use strict";ot(),At(),kO(),Vp(),Qa(),Se=(t,e,i)=>({duration:e*i,timeInterval:t,step:i}),Nu=[Se(xc,Yo,1),Se(xc,Yo,5),Se(xc,Yo,15),Se(xc,Yo,30),Se(bc,vi,1),Se(bc,vi,5),Se(bc,vi,15),Se(bc,vi,30),Se(Sc,qi,1),Se(Sc,qi,3),Se(Sc,qi,6),Se(Sc,qi,12),Se(Fp,an,1),Se(Fp,an,2),Se(xu,Za,1),Se(xu,Za,2),Se(xu,Za,3),Se(Zr,mu,1),Se(Zr,mu,2),Se(Zr,mu,3),Se(Zr,mu,4),Se(Zr,mu,6),Se(jp,mc,1)],E0=[1,2,5,10]}});function wO({start:t,stop:e,tickCount:i,minTickCount:s,maxTickCount:n,visibleRange:a}){const o=TO(t,e,i,s,n);return o?o.range(new Date(t),new Date(e),{visibleRange:a}):[]}function R0({start:t,stop:e,interval:i,availableRange:s,visibleRange:n}){if(!i)return[];if(i instanceof yc){const h=i.range(new Date(t),new Date(e),{visibleRange:n});return ag(h.length,s)?void 0:h}const a=Math.abs(i);if(ag(Math.abs(e-t)/a,s))return;const o=Nu.findLast(h=>a%h.duration===0);if(o)return o.timeInterval.every(a/(o.duration/o.step)).range(new Date(t),new Date(e),{visibleRange:n});let r=new Date(Math.min(t,e));const l=new Date(Math.max(t,e)),c=[];for(;r<=l;)c.push(r),r=new Date(r),r.setMilliseconds(r.getMilliseconds()+a);return c}function vY(t,e,i){const{interval:s}=i,n=Math.min(Ji(t),Ji(e)),a=Math.max(Ji(t),Ji(e)),o=t>e;let r;if(s instanceof yc)r=s;else{const l=typeof s=="number"?(a-n)/Math.max(s,1):i.tickCount??Wt.defaultTickCount;r=TO(n,a,l,i.minTickCount,i.maxTickCount)}if(r){const l=r.range(new Date(n),new Date(a),{extend:!0}),c=o?[...l].reverse():l,h=c[0],u=c.at(-1);return[h,u]}else return[t,e]}var _0,P0=I({"packages/ag-charts-community/src/scale/timeScale.ts"(){"use strict";Cc(),Vp(),om(),rm(),Qi(),_0=class extends Wt{constructor(){super([],[0,1]),this.type="time"}toDomain(t){return new Date(t)}convert(t,e){return t instanceof Date||(t=new Date(t)),super.convert(t,e)}invert(t){return new Date(super.invert(t))}niceDomain(t,e=this.domain){if(e.length<2)return[];const i=4;let[s,n]=e;for(let a=0;a0&&e[0]>e[e.length-1],this.sortedTimestamps=void 0,this.precomputedSteps=void 0)}get domain(){return this._domain}toDomain(e){return new Date(e)}normalizeDomains(...e){const i=e.filter(n=>n.length>0).map(n=>{let a=C0(n);return a==null&&(n=T0(n.slice()),a=1),{domain:n,sortOrder:a}});if(i.length===0)return{domain:[],animatable:!1};if(i.length===1)return{domain:i[0].domain,animatable:!0};let s=i.flatMap(n=>n.domain);return s=T0(s),i.every(n=>n.sortOrder===-1)&&s.reverse(),{domain:s,animatable:!0}}ticks({interval:e,maxTickCount:i},s=this.domain,n=[0,1]){if(!s.length)return[];this.refresh();const{isReversed:a}=this;if(e==null)return MY(s,i,a,n);const[o,r]=[s[0].valueOf(),s.at(-1).valueOf()],l=Math.min(o,r),c=Math.max(o,r),[h,u]=this.range,d=Math.abs(u-h),p=R0({start:l,stop:c,interval:e,availableRange:d,visibleRange:n})??[];let g=-1;return p.filter(f=>{const x=this.findInterval(f.valueOf()),m=x===g;return g=x,!m})}getSortedTimestamps(){let{sortedTimestamps:e}=this;return e==null&&(e=this.domain.map(Ji),this.isReversed&&e.reverse(),this.sortedTimestamps=e),e}getPrecomputedSteps(){const{domain:e}=this;let{precomputedSteps:i}=this;const s=e.length<1e4?e.length:Math.ceil(e.length/16);if(i!=null||s<=1)return i;const n=this.getSortedTimestamps();i=new Int32Array(s);const a=n[0],r=n[n.length-1]-a,l=0,c=n.length-1;for(let h=0;hthis.ordinalRange(a)>=e?s[a]:void 0)??s[0]}getIndex(e){const i=this.getSortedTimestamps(),s=Number(e);if(snew i:i}static select(e,i,s=!0){return new ou(e,i,s)}static selectAll(e,i){const s=[],n=a=>{i(a)&&s.push(a);for(const o of a.children())n(o)};return n(e),s}static selectByClass(e,...i){return ou.selectAll(e,s=>i.some(n=>s instanceof n))}static selectByTag(e,i){return ou.selectAll(e,s=>s.tag===i)}createNode(e,i,s){const n=this.nodeFactory(e);return n.datum=e,i?.(n),s==null?this._nodes.push(n):this._nodes.splice(s,0,n),this.parentNode.appendChild(n),n}update(e,i,s){if(this.garbageBin.size>0&&this.debug("Selection - update() called with pending garbage",e),s){const n=new Map(e.map((a,o)=>[s(a),[a,o]]));for(const[a,o]of this._nodesMap.entries())if(n.has(o)){const[r]=n.get(o);a.datum=r,this.garbageBin.delete(a),n.delete(o)}else this.garbageBin.add(a);for(const[a,[o,r]]of n.entries())this._nodesMap.set(this.createNode(o,i,r),a)}else{const n=Math.max(e.length,this.data.length);for(let a=0;a=e.length?this.garbageBin.add(this._nodes[a]):a>=this._nodes.length?this.createNode(e[a],i):(this._nodes[a].datum=e[a],this.garbageBin.delete(this._nodes[a]))}return this.data=e.slice(),this.autoCleanup&&this.cleanup(),this}cleanup(){return this.garbageBin.size===0?this:(this._nodes=this._nodes.filter(e=>this.garbageBin.has(e)?(this._nodesMap.delete(e),this.garbageBin.delete(e),e.destroy(),!1):!0),this)}clear(){return this.update([]),this}isGarbage(e){return this.garbageBin.has(e)}each(e){for(const i of this._nodes.entries())e(i[1],i[1].datum,i[0]);return this}*[Symbol.iterator](){for(let e=0;e=0&&e<=Math.PI?-1:1,a=!s&&i>=0&&i<=Math.PI?-1:1;let o=0;return t.parallel?o=n*Math.PI/2:a===-1&&(o=Math.PI),{configuredRotation:s,defaultRotation:o,parallelFlipFlag:n,regularFlipFlag:a}}function AY(t,e){return isNaN(t)?e?0:10:t}function DY(t,e,i,s){return t&&!e?i*s===-1?"hanging":"bottom":"middle"}function zO(t,e,i,s,n){const a=e>0&&e<=Math.PI,o=i>0&&i<=Math.PI,r=a||o?-1:1;if(t)if(e||i){if(s*r===-1)return"end"}else return"center";else if(s*n===-1)return"end";return"start"}function kY(t,e,i,s){const n=[];for(const{tickLabel:a,translationY:o}of t){if(!a)continue;const{width:r,height:l}=s.measureLines(a),c=new ht(e,o,r,l),h=new ht(e,o,0,0);i.transformBBox(h,c);const{x:u,y:d}=c;n.push({point:{x:u,y:d},label:{text:a,width:r,height:l}})}return n}var ii,zn=I({"packages/ag-charts-community/src/chart/label.ts"(){"use strict";Rt(),Ii(),Qt(),ln(),mt(),ii=class extends bt{constructor(){super(...arguments),this.enabled=!0,this.fontSize=12,this.fontFamily="Verdana, sans-serif"}getFont(){return ge.toFontString(this)}},M([k(pt)],ii.prototype,"enabled",2),M([k(jt,{optional:!0})],ii.prototype,"color",2),M([k(to,{optional:!0})],ii.prototype,"fontStyle",2),M([k(eo,{optional:!0})],ii.prototype,"fontWeight",2),M([k(st)],ii.prototype,"fontSize",2),M([k(tt)],ii.prototype,"fontFamily",2),M([k(ts,{optional:!0})],ii.prototype,"formatter",2)}});function LY(t){return t!=null&&Object.hasOwn(t,"toString")&&Es(t.toString())}function TY(t){return t!=null&&Object.hasOwn(t,"valueOf")&&zt(t.valueOf())}function Nm(t){return zt(t)||Dp(t)||TY(t)}function FO(t,e){return t!=null&&(!e||Nm(t))}function z0(t){return LY(t)&&Object.hasOwn(t,"id")?t.id:t}var lg=I({"packages/ag-charts-community/src/util/value.ts"(){"use strict";ot()}}),Om,F0,jO=I({"packages/ag-charts-community/src/chart/crossline/crossLine.ts"(){"use strict";ot(),Qi(),Nc(),mt(),lg(),Om=t=>t==="value"?qt((e,i)=>i.target.type==="line",e=>e.target.type==="range"?"crossLine type 'range' to have a 'range' property instead of 'value'":"crossLine property 'type' to be 'line'"):qt((e,i)=>i.target.type==="range",e=>e.target.type==="line"?"crossLine type 'line' to have a 'value' property instead of 'range'":"crossLine property 'type' to be 'range'"),F0=(t,e,i,s,n)=>{const a=t==="line"&&e!==void 0,o=t==="range"&&i!==void 0;if(!a&&!o)return!0;const[r,l]=i??[e,void 0],c=Wt.is(s)||da.is(s),h=FO(r,c)&&!isNaN(s.convert(r)),u=FO(l,c)&&!isNaN(s.convert(l));if(a&&h||o&&h&&u)return n?.()??!0;const d=["Expecting crossLine"];return o?(h||d.push(`range start ${Ap(r)}`),u||d.push(`${h?"":"and "}range end ${Ap(l)}`)):d.push(`value ${Ap(r)}`),d.push("to match the axis scale domain."),et.warnOnce(d.join(" ")),!1}}});function j0({yDirection:t,padding:e=0,position:i="top",bbox:s}){const n=t?GO:WO,{xTranslationDirection:a,yTranslationDirection:o}=n[i],r=a*(e+s.width/2),l=o*(e+s.height/2);return{xTranslation:r,yTranslation:l}}function VO({yDirection:t,bbox:e,padding:i=0,position:s="top"}){const n={};return s.startsWith("inside")||(s==="top"&&!t?n.top=i+e.height:s==="bottom"&&!t?n.bottom=i+e.height:s==="left"&&t?n.left=i+e.width:s==="right"&&t&&(n.right=i+e.width)),n}var GO,WO,cg,V0,G0,W0,UO,U0,H0,Y0,K0,$0,HO=I({"packages/ag-charts-community/src/chart/crossline/crossLineLabelPosition.ts"(){"use strict";GO={top:{xTranslationDirection:0,yTranslationDirection:-1},bottom:{xTranslationDirection:0,yTranslationDirection:1},left:{xTranslationDirection:-1,yTranslationDirection:0},right:{xTranslationDirection:1,yTranslationDirection:0},"top-left":{xTranslationDirection:1,yTranslationDirection:-1},"top-right":{xTranslationDirection:-1,yTranslationDirection:-1},"bottom-left":{xTranslationDirection:1,yTranslationDirection:1},"bottom-right":{xTranslationDirection:-1,yTranslationDirection:1},inside:{xTranslationDirection:0,yTranslationDirection:0},"inside-left":{xTranslationDirection:1,yTranslationDirection:0},"inside-right":{xTranslationDirection:-1,yTranslationDirection:0},"inside-top":{xTranslationDirection:0,yTranslationDirection:1},"inside-bottom":{xTranslationDirection:0,yTranslationDirection:-1},"inside-top-left":{xTranslationDirection:1,yTranslationDirection:1},"inside-bottom-left":{xTranslationDirection:1,yTranslationDirection:-1},"inside-top-right":{xTranslationDirection:-1,yTranslationDirection:1},"inside-bottom-right":{xTranslationDirection:-1,yTranslationDirection:-1}},WO={top:{xTranslationDirection:1,yTranslationDirection:0},bottom:{xTranslationDirection:-1,yTranslationDirection:0},left:{xTranslationDirection:0,yTranslationDirection:-1},right:{xTranslationDirection:0,yTranslationDirection:1},"top-left":{xTranslationDirection:-1,yTranslationDirection:-1},"top-right":{xTranslationDirection:-1,yTranslationDirection:1},"bottom-left":{xTranslationDirection:1,yTranslationDirection:-1},"bottom-right":{xTranslationDirection:1,yTranslationDirection:1},inside:{xTranslationDirection:0,yTranslationDirection:0},"inside-left":{xTranslationDirection:0,yTranslationDirection:1},"inside-right":{xTranslationDirection:0,yTranslationDirection:-1},"inside-top":{xTranslationDirection:-1,yTranslationDirection:0},"inside-bottom":{xTranslationDirection:1,yTranslationDirection:0},"inside-top-left":{xTranslationDirection:-1,yTranslationDirection:1},"inside-bottom-left":{xTranslationDirection:1,yTranslationDirection:1},"inside-top-right":{xTranslationDirection:-1,yTranslationDirection:-1},"inside-bottom-right":{xTranslationDirection:1,yTranslationDirection:-1}},cg=({direction:t,xEnd:e,yStart:i,yEnd:s})=>t==="y"?{x:e/2,y:i}:{x:e,y:isNaN(s)?i:(i+s)/2},V0=({direction:t,xStart:e,xEnd:i,yStart:s,yEnd:n})=>t==="y"?{x:e,y:isNaN(n)?s:(s+n)/2}:{x:i/2,y:s},G0=({direction:t,xEnd:e,yStart:i,yEnd:s})=>t==="y"?{x:e,y:isNaN(s)?i:(i+s)/2}:{x:e/2,y:isNaN(s)?i:s},W0=({direction:t,xStart:e,xEnd:i,yStart:s,yEnd:n})=>t==="y"?{x:i/2,y:isNaN(n)?s:n}:{x:e,y:isNaN(n)?s:(s+n)/2},UO=({xEnd:t,yStart:e,yEnd:i})=>({x:t/2,y:isNaN(i)?e:(e+i)/2}),U0=({direction:t,xStart:e,xEnd:i,yStart:s})=>t==="y"?{x:e/2,y:s}:{x:i,y:s},H0=({direction:t,xStart:e,yStart:i,yEnd:s})=>t==="y"?{x:e,y:isNaN(s)?i:s}:{x:e,y:i},Y0=({direction:t,xEnd:e,yStart:i,yEnd:s})=>t==="y"?{x:e,y:i}:{x:e,y:isNaN(s)?i:s},K0=({direction:t,xStart:e,xEnd:i,yStart:s,yEnd:n})=>t==="y"?{x:i,y:isNaN(n)?s:n}:{x:e,y:isNaN(n)?s:n},$0={top:{c:cg},bottom:{c:W0},left:{c:V0},right:{c:G0},"top-left":{c:U0},"top-right":{c:Y0},"bottom-left":{c:H0},"bottom-right":{c:K0},inside:{c:UO},"inside-left":{c:V0},"inside-right":{c:G0},"inside-top":{c:cg},"inside-bottom":{c:W0},"inside-top-left":{c:U0},"inside-bottom-left":{c:H0},"inside-top-right":{c:Y0},"inside-bottom-right":{c:K0}}}}),YO,hn,As,CY=I({"packages/ag-charts-community/src/chart/crossline/cartesianCrossLine.ts"(){"use strict";Hp(),Qi(),Nc(),pe(),BO(),Fs(),Rn(),At(),Qt(),mt(),zn(),jO(),HO(),YO=ie(["top","left","right","bottom","top-left","top-right","bottom-left","bottom-right","inside","inside-left","inside-right","inside-top","inside-bottom","inside-top-left","inside-bottom-left","inside-top-right","inside-bottom-right"],"crossLine label position"),hn=class extends bt{constructor(){super(...arguments),this.fontSize=14,this.fontFamily="Verdana, sans-serif",this.padding=5,this.color="rgba(87, 87, 87, 1)"}},M([k(pt,{optional:!0})],hn.prototype,"enabled",2),M([k(tt,{optional:!0})],hn.prototype,"text",2),M([k(to,{optional:!0})],hn.prototype,"fontStyle",2),M([k(eo,{optional:!0})],hn.prototype,"fontWeight",2),M([k(st)],hn.prototype,"fontSize",2),M([k(tt)],hn.prototype,"fontFamily",2),M([k(_t)],hn.prototype,"padding",2),M([k(jt,{optional:!0})],hn.prototype,"color",2),M([k(YO,{optional:!0})],hn.prototype,"position",2),M([k(_t,{optional:!0})],hn.prototype,"rotation",2),M([k(pt,{optional:!0})],hn.prototype,"parallel",2),As=class extends bt{constructor(){super(),this.id=En(this),this.label=new hn,this.scale=void 0,this.clippedRange=[-1/0,1/0],this.gridLength=0,this.sideFlag=-1,this.parallelFlipRotation=0,this.regularFlipRotation=0,this.direction="x",this.rangeGroup=new yt({name:this.id}),this.lineGroup=new yt({name:this.id}),this.labelGroup=new yt({name:this.id}),this.crossLineRange=new Bn,this.crossLineLabel=new kc,this.labelPoint=void 0,this.data=[],this.startLine=!1,this.endLine=!1,this.isRange=!1,this._isRange=void 0,this.lineGroup.append(this.crossLineRange),this.labelGroup.append(this.crossLineLabel),this.crossLineRange.pointerEvents=1}update(t){const{enabled:e,data:i,type:s,value:n,range:a,scale:o}=this;if(!s||!o||!e||!t||!F0(s,n,a,o)||i.length===0){this.rangeGroup.visible=!1,this.lineGroup.visible=!1,this.labelGroup.visible=!1;return}this.rangeGroup.visible=t,this.lineGroup.visible=t,this.labelGroup.visible=t,this.updateNodes();const{isRange:r}=this;r!==this._isRange&&(r?this.rangeGroup.appendChild(this.crossLineRange):this.lineGroup.appendChild(this.crossLineRange)),this._isRange=r}calculateLayout(t,e){if(!t)return;const{scale:i,gridLength:s,sideFlag:n,direction:a,label:{position:o="top"},clippedRange:r,strokeWidth:l=0}=this;if(this.data=[],!i)return;const c=i.bandwidth??0,h=i.step??0,u=(e?-1:1)*(i instanceof bu?(h-c)/2:0),[d,p]=[0,n*s];let[g,f]=this.getRange();const x=f===void 0&&da.is(i)?c/2+u:0;let[m,b]=[Number(i.convert(g,!0))-u+x,i.convert(f,!0)+c+u];m=OM(m,r),b=OM(b,r),[g,f]=[Number(i.convert(g))+x,i.convert(f)+c];const v=(g===m||f===b||m!==b)&&Math.abs(b-m)>0;if(v&&m>b&&([m,b]=[b,m],[g,f]=[f,g]),g-u>=m&&(g-=u),f+u<=b&&(f+=u),this.isRange=v,this.startLine=l>0&&g>=m&&g<=m+u,this.endLine=l>0&&f>=b-c-u&&f<=b,!v&&!this.startLine&&!this.endLine||(this.data=[m,b],!this.label.enabled))return;const{c:S=cg}=$0[o]??{},{x:A,y:T}=S({direction:a,xStart:d,xEnd:p,yStart:m,yEnd:b});this.labelPoint={x:A,y:T}}updateNodes(){this.updateRangeNode(),this.label.enabled&&(this.updateLabel(),this.positionLabel())}updateRangeNode(){const{crossLineRange:t,sideFlag:e,gridLength:i,data:s,startLine:n,endLine:a,isRange:o,fill:r,fillOpacity:l,stroke:c,strokeWidth:h,lineDash:u}=this;t.x1=0,t.x2=e*i,t.y1=s[0],t.y2=s[1],t.startLine=n,t.endLine=a,t.isRange=o,t.fill=r,t.fillOpacity=l??1,t.stroke=c,t.strokeWidth=h??1,t.strokeOpacity=this.strokeOpacity??1,t.lineDash=u}updateLabel(){const{crossLineLabel:t,label:e}=this;e.text&&(t.fontStyle=e.fontStyle,t.fontWeight=e.fontWeight,t.fontSize=e.fontSize,t.fontFamily=e.fontFamily,t.fill=e.color,t.text=e.text)}positionLabel(){const{crossLineLabel:t,labelPoint:{x:e=void 0,y:i=void 0}={},label:{parallel:s,rotation:n,position:a="top",padding:o=0},direction:r,parallelFlipRotation:l,regularFlipRotation:c}=this;if(e===void 0||i===void 0)return;const{defaultRotation:h,configuredRotation:u}=Cm({rotation:n,parallel:s,regularFlipRotation:c,parallelFlipRotation:l});t.rotation=h+u,t.textBaseline="middle",t.textAlign="center";const d=t.getBBox();if(!d)return;const p=r==="y",{xTranslation:g,yTranslation:f}=j0({yDirection:p,padding:o,position:a,bbox:d});t.translationX=e+g,t.translationY=i+f}getRange(){const{value:t,range:e,scale:i}=this,s=Wt.is(i)||da.is(i),n=e?.[0]??t;let a=e?.[1];return!s&&a===void 0&&(a=n),s&&n===a&&(a=void 0),[n,a]}computeLabelBBox(){const{label:t}=this;if(!t.enabled)return;const e=new kc;e.fontFamily=t.fontFamily,e.fontSize=t.fontSize,e.fontStyle=t.fontStyle,e.fontWeight=t.fontWeight,e.text=t.text;const{labelPoint:{x:i=void 0,y:s=void 0}={},label:{parallel:n,rotation:a,position:o="top",padding:r=0},direction:l,parallelFlipRotation:c,regularFlipRotation:h}=this;if(i===void 0||s===void 0)return;const{configuredRotation:u}=Cm({rotation:a,parallel:n,regularFlipRotation:h,parallelFlipRotation:c});e.rotation=u,e.textBaseline="middle",e.textAlign="center";const d=e.getBBox();if(!d)return;const p=l==="y",{xTranslation:g,yTranslation:f}=j0({yDirection:p,padding:r,position:o,bbox:d});return e.x=i+g,e.y=s+f,e.getBBox()}calculatePadding(t){const{isRange:e,startLine:i,endLine:s,direction:n,label:{padding:a=0,position:o="top"}}=this;if(!e&&!i&&!s)return;const r=this.computeLabelBBox();if(r?.x==null||r?.y==null)return;const l=VO({yDirection:n==="y",padding:a,position:o,bbox:r});t.left=Math.max(t.left??0,l.left??0),t.right=Math.max(t.right??0,l.right??0),t.top=Math.max(t.top??0,l.top??0),t.bottom=Math.max(t.bottom??0,l.bottom??0)}},As.className="CrossLine",M([k(pt,{optional:!0})],As.prototype,"enabled",2),M([k(ie(["range","line"],"a crossLine type"),{optional:!0})],As.prototype,"type",2),M([k(ha(Om("range"),Mu.restrict({length:2})),{optional:!0})],As.prototype,"range",2),M([k(Om("value"),{optional:!0})],As.prototype,"value",2),M([k(jt,{optional:!0})],As.prototype,"fill",2),M([k(Ut,{optional:!0})],As.prototype,"fillOpacity",2),M([k(jt,{optional:!0})],As.prototype,"stroke",2),M([k(_t,{optional:!0})],As.prototype,"strokeWidth",2),M([k(Ut,{optional:!0})],As.prototype,"strokeOpacity",2),M([k(ua,{optional:!0})],As.prototype,"lineDash",2),M([k(lt)],As.prototype,"label",2)}}),X0,NY=I({"packages/ag-charts-community/src/chart/zIndexMap.ts"(){"use strict";X0=(t=>(t[t.CHART_BACKGROUND=0]="CHART_BACKGROUND",t[t.AXIS_GRID=1]="AXIS_GRID",t[t.AXIS=2]="AXIS",t[t.ZOOM_SELECTION=3]="ZOOM_SELECTION",t[t.SERIES_CROSSLINE_RANGE=4]="SERIES_CROSSLINE_RANGE",t[t.SERIES_LAYER=5]="SERIES_LAYER",t[t.AXIS_FOREGROUND=6]="AXIS_FOREGROUND",t[t.SERIES_CROSSHAIR=7]="SERIES_CROSSHAIR",t[t.SERIES_CROSSLINE_LINE=8]="SERIES_CROSSLINE_LINE",t[t.SERIES_ANNOTATION=9]="SERIES_ANNOTATION",t[t.CHART_ANNOTATION=10]="CHART_ANNOTATION",t[t.CHART_ANNOTATION_FOCUSED=11]="CHART_ANNOTATION_FOCUSED",t[t.STATUS_BAR=12]="STATUS_BAR",t[t.SERIES_LABEL=13]="SERIES_LABEL",t[t.LEGEND=14]="LEGEND",t[t.NAVIGATOR=15]="NAVIGATOR",t[t.FOREGROUND=16]="FOREGROUND",t))(X0||{})}}),KO,$O,hg,OY=I({"packages/ag-charts-community/src/chart/axis/axisGridLine.ts"(){"use strict";ot(),mt(),KO=["stroke","lineDash"],$O=Ja(t=>bi(t)&&Object.keys(t).every(e=>KO.includes(e)),"objects with gridline style properties such as 'stroke' or 'lineDash'"),hg=class{constructor(){this.enabled=!0,this.width=1,this.style=[{stroke:void 0,lineDash:[]}]}},M([k(pt)],hg.prototype,"enabled",2),M([k(st)],hg.prototype,"width",2),M([k($O)],hg.prototype,"style",2)}});function sl(t,e=[void 0]){return Uo((i,s,n)=>e.includes(n)?cc(t)?t(n):t:n)}var ug=I({"packages/ag-charts-community/src/util/default.ts"(){"use strict";ot(),Xr()}}),Z0,nl,Q0=I({"packages/ag-charts-community/src/chart/axis/axisInterval.ts"(){"use strict";ot(),ug(),Qt(),Vp(),mt(),Z0=qt(t=>zt(t)&&t>0||t instanceof yc,"a non-zero positive Number value or, for a time axis, a Time Interval such as 'agCharts.time.month'"),nl=class extends bt{constructor(){super(...arguments),this.minSpacing=NaN,this.maxSpacing=NaN}},M([k(Z0,{optional:!0})],nl.prototype,"step",2),M([k(Mu,{optional:!0})],nl.prototype,"values",2),M([k(h0),sl(NaN)],nl.prototype,"minSpacing",2),M([k(u0),sl(NaN)],nl.prototype,"maxSpacing",2)}}),si,wm=I({"packages/ag-charts-community/src/chart/axis/axisLabel.ts"(){"use strict";ug(),Qt(),mt(),si=class extends bt{constructor(){super(...arguments),this.enabled=!0,this.fontSize=12,this.fontFamily="Verdana, sans-serif",this.spacing=5,this.minSpacing=NaN,this.color="#575757",this.avoidCollisions=!0,this.mirrored=!1,this.parallel=!1}getSideFlag(){return this.mirrored?1:-1}},M([k(pt)],si.prototype,"enabled",2),M([k(to,{optional:!0})],si.prototype,"fontStyle",2),M([k(eo,{optional:!0})],si.prototype,"fontWeight",2),M([k(_t.restrict({min:1}))],si.prototype,"fontSize",2),M([k(tt)],si.prototype,"fontFamily",2),M([k(st)],si.prototype,"spacing",2),M([k(Ic),sl(NaN)],si.prototype,"minSpacing",2),M([k(jt,{optional:!0})],si.prototype,"color",2),M([k(_t,{optional:!0})],si.prototype,"rotation",2),M([k(pt)],si.prototype,"avoidCollisions",2),M([k(pt)],si.prototype,"mirrored",2),M([k(pt)],si.prototype,"parallel",2),M([k(ts,{optional:!0})],si.prototype,"itemStyler",2),M([k(ts,{optional:!0})],si.prototype,"formatter",2),M([k(tt,{optional:!0})],si.prototype,"format",2)}}),dg,wY=I({"packages/ag-charts-community/src/chart/axis/axisLine.ts"(){"use strict";mt(),dg=class{constructor(){this.enabled=!0,this.width=1,this.stroke=void 0}},M([k(pt)],dg.prototype,"enabled",2),M([k(st)],dg.prototype,"width",2),M([k(jt,{optional:!0})],dg.prototype,"stroke",2)}}),wc,XO=I({"packages/ag-charts-community/src/chart/axis/axisTick.ts"(){"use strict";Qt(),mt(),wc=class extends bt{constructor(){super(...arguments),this.enabled=!0,this.width=1,this.size=6}},M([k(pt)],wc.prototype,"enabled",2),M([k(st)],wc.prototype,"width",2),M([k(st)],wc.prototype,"size",2),M([k(jt,{optional:!0})],wc.prototype,"stroke",2)}}),Fn,EY=I({"packages/ag-charts-community/src/chart/axis/axisTitle.ts"(){"use strict";Qt(),mt(),Lc(),Fn=class extends bt{constructor(){super(...arguments),this.caption=new te,this.enabled=!1,this.spacing=te.SMALL_PADDING,this.fontSize=10,this.fontFamily="sans-serif",this.wrapping="always"}},M([k(pt)],Fn.prototype,"enabled",2),M([k(tt,{optional:!0})],Fn.prototype,"text",2),M([k(st,{optional:!0})],Fn.prototype,"spacing",2),M([k(to,{optional:!0})],Fn.prototype,"fontStyle",2),M([k(eo,{optional:!0})],Fn.prototype,"fontWeight",2),M([k(st)],Fn.prototype,"fontSize",2),M([k(tt)],Fn.prototype,"fontFamily",2),M([k(jt,{optional:!0})],Fn.prototype,"color",2),M([k(Qp)],Fn.prototype,"wrapping",2),M([k(ts,{optional:!0})],Fn.prototype,"formatter",2)}});function Em(t){const[e,i]=Si(t.range),s=Math.floor(e),n=Math.ceil(i);return{min:s,max:n,visible:s!==n}}function RY(t,e){return Math.abs(e-t)e?e+Rm:e-Rm}function ZO(t){const e=(o,r)=>{const[l=t.min,c=t.max]=Si(r??[]);return oc};return{tick:{fromFn(o,r,l){let c=o.y1+o.translationY,h=o.opacity;return(l==="added"||e(o.datum.translationY,o.datum.range))&&(c=r.translationY,h=0),{y:0,translationY:c,opacity:h,phase:_n[l]}},toFn(o,r,l){const c=r.translationY;let h=1;return l==="removed"&&(h=0),{y:0,translationY:c,opacity:h,finish:{y:c,translationY:0}}},applyFn(o,r){o.setProperties(r),o.visible=!e(o.y)}},line:{fromFn(o,r){return{...o.previousDatum??r,phase:_n.updated}},toFn(o,r){return{...r}}},label:{fromFn(o,r,l){const c=o.previousDatum??r,h=c.x,u=c.y,d=c.rotationCenterX;let p=Math.round(o.translationY),g=c.rotation,f=o.opacity;return l==="removed"||e(c.y,c.range)?g=r.rotation:(l==="added"||e(o.datum.y,o.datum.range))&&(p=Math.round(c.translationY),f=0,g=r.rotation),{x:h,y:u,rotationCenterX:d,translationY:p,rotation:g,opacity:f,phase:_n[l]}},toFn(o,r,l){const c=r.x,h=r.y,u=r.rotationCenterX,d=Math.round(r.translationY);let p=0,g=1;return l==="added"?p=r.rotation:l==="removed"?(g=0,p=r.rotation):p=RY(o.previousDatum?.rotation??r.rotation,r.rotation),{x:c,y:h,rotationCenterX:u,translationY:d,rotation:p,opacity:g,finish:{rotation:r.rotation}}}},group:{fromFn(o,r){const{rotation:l,translationX:c,translationY:h}=o;return{rotation:l,translationX:c,translationY:h,phase:_n.updated}},toFn(o,r){const{rotation:l,translationX:c,translationY:h}=r;return{rotation:l,translationX:c,translationY:h}}}}}function QO(){return(t,e)=>({rotation:e.rotation,rotationCenterX:e.rotationCenterX,rotationCenterY:e.rotationCenterY,translationX:e.translationX,translationY:e.translationY})}function q0(t){const{visible:e,min:i,max:s}=t;return(n,a)=>{const o=a.translationY,r=e&&o>=i&&o<=s;return{y:o,translationY:0,opacity:1,visible:r}}}function J0(){return(t,e)=>({x:e.x,y:e.y,translationY:e.translationY,rotation:e.rotation,rotationCenterX:e.rotationCenterX})}function qO(){return(t,e)=>({...e})}var tI,Rm,JO,eI=I({"packages/ag-charts-community/src/chart/axis/axisUtil.ts"(){"use strict";wi(),At(),tI=(t=>(t[t.TickAndDomain=0]="TickAndDomain",t[t.TicksOnly=1]="TicksOnly",t[t.Off=2]="Off",t))(tI||{}),Rm=Math.PI*2,JO=Rm/2}}),pg,iI,so,_m,sI=I({"packages/ag-charts-community/src/chart/axis/axis.ts"(){"use strict";ot(),L0(),Qi(),Nc(),Rt(),pe(),x0(),el(),Oc(),Fs(),Ai(),Ii(),il(),Rn(),At(),oe(),Is(),mt(),CY(),OY(),Q0(),wm(),wY(),XO(),EY(),pg=class extends Dc(Vs){},iI=(t=>(t[t.TickLines=0]="TickLines",t[t.AxisLine=1]="AxisLine",t[t.TickLabels=2]="TickLabels",t))(iI||{}),so=class ZU{constructor(e,i){this.moduleCtx=e,this.scale=i,this.id=En(this),this.nice=!0,this.reverse=!1,this.keys=[],this.interval=new nl,this.dataDomain={domain:[],clipped:!1},this.layoutConstraints={stacked:!0,align:"start",width:100,unit:"percent"},this.boundSeries=[],this.includeInvisibleDomains=!1,this.interactionEnabled=!0,this.axisGroup=new Tu({name:`${this.id}-axis`}),this.tickLineGroup=this.axisGroup.appendChild(new yt({name:`${this.id}-Axis-tick-lines`,zIndex:0})),this.tickLabelGroup=this.axisGroup.appendChild(new yt({name:`${this.id}-Axis-tick-labels`,zIndex:2})),this.labelGroup=new yt({name:`${this.id}-Labels`,zIndex:9}),this.gridGroup=new Tu({name:`${this.id}-Axis-grid`,zIndex:1}),this.gridLineGroup=this.gridGroup.appendChild(new yt({name:`${this.id}-gridLines`})),this.crossLineRangeGroup=new Tu({name:`${this.id}-CrossLines-Range`,zIndex:4}),this.crossLineLineGroup=new Tu({name:`${this.id}-CrossLines-Line`,zIndex:8}),this.crossLineLabelGroup=new Tu({name:`${this.id}-CrossLines-Label`,zIndex:13}),this.tickLineGroupSelection=Oe.select(this.tickLineGroup,pg,!1),this.tickLabelGroupSelection=Oe.select(this.tickLabelGroup,kc,!1),this.gridLineGroupSelection=Oe.select(this.gridLineGroup,pg,!1),this._crossLines=[],this.line=new dg,this.tick=new wc,this.gridLine=new hg,this.label=this.createLabel(),this.defaultTickMinSpacing=ZU.defaultTickMinSpacing,this.translation={x:0,y:0},this.rotation=0,this.layout={label:{fractionDigits:0,spacing:this.label.spacing,format:this.label.format}},this.axisContext=void 0,this.labelFormatter=void 0,this.datumFormatter=void 0,this.scaleFormatterParams=void 0,this.destroyFns=[],this.range=[0,1],this.visibleRange=[0,1],this.title=new Fn,this.gridLength=0,this.gridPadding=0,this.seriesAreaPadding=0,this.animatable=!0,this._scaleNiceDomainInputDomain=void 0,this._scaleNiceDomainRangeExtent=NaN,this.moduleMap=new Lm,this.range=this.scale.range.slice(),this.crossLines.forEach(s=>this.initCrossLine(s))}get type(){return this.constructor.type??""}get labelNodes(){return this.tickLabelGroupSelection.nodes()}set crossLines(e){const{CrossLineConstructor:i}=this.constructor;this._crossLines.forEach(s=>this.detachCrossLine(s)),this._crossLines=e.map(s=>{const n=new i;return n.set(s),n}),this._crossLines.forEach(s=>{this.attachCrossLine(s),this.initCrossLine(s)})}get crossLines(){return this._crossLines}resetAnimation(e){}attachCrossLine(e){this.crossLineRangeGroup.appendChild(e.rangeGroup),this.crossLineLineGroup.appendChild(e.lineGroup),this.crossLineLabelGroup.appendChild(e.labelGroup)}detachCrossLine(e){this.crossLineRangeGroup.removeChild(e.rangeGroup),this.crossLineLineGroup.removeChild(e.lineGroup),this.crossLineLabelGroup.removeChild(e.labelGroup)}destroy(){this.moduleMap.destroy(),this.destroyFns.forEach(e=>e())}updateScale(){const{range:e,visibleRange:i,scale:s}=this,n=(e[1]-e[0])/(i[1]-i[0]),a=n*i[0],o=e[0]-a;s.range=[o,o+n],this.crossLines.forEach(r=>{r.clippedRange=[e[0],e[1]]})}setCrossLinesVisible(e){this.crossLineRangeGroup.visible=e,this.crossLineLineGroup.visible=e,this.crossLineLabelGroup.visible=e}attachAxis(e){e.gridNode.appendChild(this.gridGroup),e.axisNode.appendChild(this.axisGroup),e.labelNode.appendChild(this.labelGroup),e.crossLineRangeNode.appendChild(this.crossLineRangeGroup),e.crossLineLineNode.appendChild(this.crossLineLineGroup),e.crossLineLabelNode.appendChild(this.crossLineLabelGroup)}detachAxis(e){e.gridNode.removeChild(this.gridGroup),e.axisNode.removeChild(this.axisGroup),e.labelNode.removeChild(this.labelGroup),e.crossLineRangeNode.removeChild(this.crossLineRangeGroup),e.crossLineLineNode.removeChild(this.crossLineLineGroup),e.crossLineLabelNode.removeChild(this.crossLineLabelGroup)}attachLabel(e){this.labelGroup.append(e)}inRange(e,i=0){const[s,n]=Si(this.range);return e>=s-i&&e<=n+i}defaultDatumFormatter(e,i){return Zo(e,i+1)}defaultLabelFormatter(e,i){return Zo(e,i)}onGridLengthChange(e,i){i^e&&this.onGridVisibilityChange(),this.crossLines.forEach(s=>this.initCrossLine(s))}onGridVisibilityChange(){this.gridLineGroupSelection.clear()}createLabel(){return new si}update(){this.updatePosition(),this.updateSelections(),this.tickLineGroup.visible=this.tick.enabled,this.gridLineGroup.visible=this.gridLine.enabled,this.tickLabelGroup.visible=this.label.enabled,this.updateLabels(),this.updateGridLines(),this.updateTickLines(),this.updateCrossLines()}getAxisLineCoordinates(){const[e,i]=Si(this.range);return{x:0,y1:e,y2:i}}getLabelStyles(e,i){const{label:s}=this,n={color:s.color,spacing:s.spacing,fontFamily:s.fontFamily,fontSize:s.fontSize,fontStyle:s.fontStyle,fontWeight:s.fontWeight};let a;s.itemStyler&&(a=this.moduleCtx.callbackCache.call(s.itemStyler,{...e,...n}));const{color:o,fontFamily:r,fontSize:l,fontStyle:c,fontWeight:h,spacing:u}=Tt(a,i,n);return{fill:o,fontFamily:r,fontSize:l,fontStyle:c,fontWeight:h,spacing:u}}getTickSize(){return this.tick.enabled?this.tick.size:0}setTitleProps(e,i){const{title:s}=this;if(!s.enabled){e.enabled=!1,e.node.visible=!1;return}e.enabled=!0,e.color=s.color,e.fontFamily=s.fontFamily,e.fontSize=s.fontSize,e.fontStyle=s.fontStyle,e.fontWeight=s.fontWeight,e.wrapping=s.wrapping;const n=e.node,a=(s.spacing??0)+i.spacing,o=this.label.getSideFlag(),r=re(this.rotation),l=o===-1&&r>Math.PI&&rm.defaultValue}=s,x=g.call(f,this.getTitleFormatterParams());e.text=x,n.setProperties({visible:!0,text:x,textBaseline:h,x:d,y:p,rotation:c})}processData(){const{includeInvisibleDomains:e,boundSeries:i,direction:s}=this,a=(e?i:i.filter(o=>o.isEnabled())).map(o=>o.getDomain(s));this.setDomains(...a)}setDomains(...e){let i,s;e.length>0?{domain:i,animatable:s}=this.scale.normalizeDomains(...e):(i=[],s=!0),this.dataDomain=this.normaliseDataDomain(i),this.reverse&&this.dataDomain.domain.reverse(),this.animatable=s}calculateLayout(e){const{scale:i,label:s,visibleRange:n,nice:a}=this;this.updateScale();const o=du(this.range),r=this.dataDomain.domain;let l;n[0]===0&&n[1]===1?l=void 0:a?this._scaleNiceDomainInputDomain===r&&this._scaleNiceDomainRangeExtent===o?l=this.scale.domain:l=this.calculateTickLayout(r,0,[0,1]).niceDomain:l=r;let c;a?l==null?c=0:c=1:c=2;const{niceDomain:h,primaryTickCount:u,ticks:d,tickDomain:p,fractionDigits:g,bbox:f}=this.calculateTickLayout(l??r,c,n,e);this.scale.domain=h,this._scaleNiceDomainInputDomain=a?r:void 0,this._scaleNiceDomainRangeExtent=a?o:NaN;const x=s.format;this.labelFormatter=i.tickFormatter({domain:p,specifier:x,ticks:d,fractionDigits:g})??(T=>this.defaultLabelFormatter(T,g)),this.datumFormatter=i.datumFormatter({domain:p,specifier:x,ticks:d,fractionDigits:g})??(T=>this.defaultDatumFormatter(T,g)),this.scaleFormatterParams={domain:p,ticks:d,fractionDigits:g},this.layout.label={fractionDigits:g,spacing:this.label.spacing,format:this.label.format};const m=s.getSideFlag(),b=this.isAnySeriesActive(),{rotation:v,parallelFlipRotation:S,regularFlipRotation:A}=this.calculateRotations();return this.crossLines.forEach(T=>{var D;T.sideFlag=-m,T.direction=v===-Math.PI/2?"x":"y",T instanceof As&&((D=T.label).parallel??(D.parallel=s.parallel)),T.parallelFlipRotation=S,T.regularFlipRotation=A,T.calculateLayout?.(b,this.reverse)}),{primaryTickCount:u,bbox:f}}getTransformBox(e){const i=new Pn,{rotation:s,translationX:n,translationY:a}=this.getAxisTransform();return Pn.updateTransformMatrix(i,1,1,s,n,a),i.transformBBox(e)}calculateRotations(){const e=ti(this.rotation),i=re(e),s=re(e-Math.PI/2);return{rotation:e,parallelFlipRotation:i,regularFlipRotation:s}}updateCrossLines(){const e=this.isAnySeriesActive();this.crossLines.forEach(i=>{i.update(e)})}updateTickLines(){const{tick:e,label:i}=this,s=i.getSideFlag();this.tickLineGroupSelection.each((n,a)=>{n.strokeWidth=a.tickWidth??e.width,n.stroke=a.tickStroke??e.stroke,n.x1=s*(a.tickSize??this.getTickSize()),n.x2=0})}getAxisTransform(){return{rotation:ti(this.rotation),translationX:Math.floor(this.translation.x),translationY:Math.floor(this.translation.y)}}updatePosition(){const{crossLineRangeGroup:e,crossLineLineGroup:i,crossLineLabelGroup:s,gridGroup:n,translation:a}=this,{rotation:o}=this.calculateRotations(),r=Math.floor(a.x),l=Math.floor(a.y);e.setProperties({rotation:o,translationX:r,translationY:l}),i.setProperties({rotation:o,translationX:r,translationY:l}),s.setProperties({rotation:o,translationX:r,translationY:l}),n.setProperties({rotation:o,translationX:r,translationY:l})}updateGridLines(){const e=this.label.getSideFlag(),{gridLine:{style:i,width:s},gridPadding:n,gridLength:a}=this;a===0||i.length===0||this.gridLineGroupSelection.each((o,r,l)=>{const{stroke:c,lineDash:h}=i[l%i.length];o.setProperties({x1:n,x2:-e*a+n,stroke:c,strokeWidth:s,lineDash:h})})}formatTick(e,i,s,n){const{labelFormatter:a,label:{formatter:o},moduleCtx:{callbackCache:r}}=this;let l;return o?l=r.call(o,{value:e,index:i,fractionDigits:s}):n?l=n(e):a&&(l=a(e)),String(l??e)}formatDatum(e){const{label:{formatter:i},moduleCtx:{callbackCache:s},datumFormatter:n=this.labelFormatter}=this;let a;return i?a=s.call(i,{value:e,index:NaN}):n?a=s.call(n,e):ne(e)&&(a=e.filter(Boolean).join(" - ")),String(a??e)}getScaleValueFormatter(e){const{scaleFormatterParams:i}=this;let s;try{e!=null&&i!=null&&(s=this.scale.tickFormatter({...i,specifier:e}))}catch{et.warnOnce(`the format string ${e} is invalid, ignoring.`)}return s??(s=n=>this.formatDatum(n)),s}getBBox(){return this.axisGroup.getBBox()}initCrossLine(e){e.scale=this.scale,e.gridLength=this.gridLength}isAnySeriesActive(){return this.boundSeries.some(e=>this.includeInvisibleDomains||e.isEnabled())}clipTickLines(e,i,s,n){this.tickLineGroup.setClipRect(new ht(e,i,s,n))}clipGrid(e,i,s,n){this.gridGroup.setClipRect(new ht(e,i,s,n))}getTitleFormatterParams(){const{direction:e}=this,i=[];for(const s of this.boundSeries){const n=s.getKeys(e),a=s.getNames(e);for(let o=0;obe.toCanvas(this.axisGroup),seriesKeyProperties:()=>this.boundSeries.reduce((i,s)=>(s.getKeyProperties(this.direction).forEach(a=>i.add(a)),i),new Set),seriesIds:()=>this.boundSeries.map(i=>i.id),scaleValueFormatter:i=>this.getScaleValueFormatter(i),scaleInvert:i=>e.invert(i,!0),scaleInvertNearest:i=>e.invert(i,!0),attachLabel:i=>this.attachLabel(i),inRange:(i,s)=>this.inRange(i,s)}}isReversed(){return this.reverse}},so.defaultTickMinSpacing=50,so.CrossLineConstructor=As,M([k(pt)],so.prototype,"nice",2),M([k(pt)],so.prototype,"reverse",2),M([k(r0)],so.prototype,"keys",2),M([k(lt)],so.prototype,"interval",2),M([k(lt)],so.prototype,"title",2),M([tl((t,e,i)=>t.onGridLengthChange(e,i))],so.prototype,"gridLength",2),_m=so}});function _Y(t,e,i,s,n,a){if(t.size===0)return!1;let o=t.x,r=t.y;e!=null&&(o-=(e.x-.5)*t.size,r-=(e.y-.5)*t.size);let l=o;oi+n&&(l=i+n);let c=r;rs+a&&(c=s+a);const h=o-l,u=r-c;return Math.sqrt(h*h+u*u)<=t.size*.5}function tw(t,e,i,s,n){const a=t.x+t.width>e&&t.xi&&t.yt.x&&i>t.y&&i+n[r,l.toSorted((c,h)=>h.point.size-c.point.size)])),o=[...a.values()].flat();for(const[r,l]of a.entries()){const c=[];if(l[0]?.label){for(let h=0,u=l.length;h0&&d.placement!=null){const N=ew[d.placement];S=(m*.5+v+i)*N.x,A=(b*.5+v+i)*N.y}const T=p.x-m*.5+S-((f?.x??.5)-.5)*p.size,D=p.y-b*.5+A-((f?.y??.5)-.5)*p.size;if(!(!e||PY(e,T,D,m,b))||o.some(N=>_Y(N.point,N.anchor,T,D,m,b))||n.some(N=>tw(N,T,D,m,b)))continue;const _={index:h,text:x,x:T,y:D,width:m,height:b,datum:d};c.push(_),n.push(_)}s.set(r,c)}}return s}function FY(t,e=0){const i=[];for(let s=0;stw(h,a,o,l,c)))return!0;i.push({index:s,text:r,x:a,y:o,width:l,height:c,datum:n})}return!1}var ew,iw=I({"packages/ag-charts-community/src/scene/util/labelPlacement.ts"(){"use strict";ew={top:{x:0,y:-1},bottom:{x:0,y:1},left:{x:-1,y:0},right:{x:1,y:0},"top-left":{x:-1,y:-1},"top-right":{x:1,y:-1},"bottom-left":{x:-1,y:1},"bottom-right":{x:1,y:1}}}});function jY(t,e,i){let[s,n]=Si(t);s=VY(Math.floor(s),n,e);const a=WY(s,n,e),o=e-1;n=s+o*a;const r=i?[n,s]:[s,n],l=GY(s,a,e);return{domain:r,ticks:l}}function VY(t,e,i){const s=Math.abs(e-t)/(i-1),n=Math.floor(Math.log10(s)),a=Math.pow(10,n);return Math.floor(t/a)*a}function GY(t,e,i){const s=Math.floor(Math.log10(e)),n=e>0&&e<1?Math.abs(s):0,a=Math.pow(10,n),o=[];for(let r=0;r0&&s<=1?i/10:s>1&&s<=2?2*i/10:s>1&&s<=5?5*i/10:s>5&&s<=10?10*i/10:s>10&&s<=20?20*i/10:s>20&&s<=40?40*i/10:s>40&&s<=50?50*i/10:s>50&&s<=100?100*i/10:s}var HY=I({"packages/ag-charts-community/src/util/secondaryAxisTicks.ts"(){"use strict";At()}});function nI(){const t=new Map;return e=>{const i=t.get(e);return i?(t.set(e,i+1),`${e}_${i}`):(t.set(e,1),e)}}var aI=I({"packages/ag-charts-community/src/util/tempUtils.ts"(){"use strict"}}),oI,sw=I({"packages/ag-charts-community/src/chart/axis/axisTickGenerator.ts"(){"use strict";ot(),Qi(),Nc(),x0(),iw(),Ii(),At(),HY(),aI(),ln(),Cc(),zn(),oI=class{constructor(t){this.axis=t}estimateTickCount(t,e,i){return OO(du(this.axis.range),du(t),e,i,Wt.defaultTickCount,this.axis.defaultTickMinSpacing)}filterTicks(t,e){const{minSpacing:i,maxSpacing:s}=this.axis.interval,a=!isNaN(i)||!isNaN(s)?Math.ceil(t.length/e):2,o=t.length%a?-1:0;return t.filter((r,l)=>(l+o)%a===0)}generateTicks({domain:t,primaryTickCount:e,visibleRange:i,niceMode:s,parallelFlipRotation:n,regularFlipRotation:a,labelX:o,sideFlag:r}){const{scale:l,label:c,interval:{minSpacing:h,maxSpacing:u}}=this.axis,{parallel:d,rotation:p,fontFamily:g,fontSize:f,fontStyle:x,fontWeight:m}=c,b=e!==void 0,{defaultRotation:v,configuredRotation:S,parallelFlipFlag:A,regularFlipFlag:T}=Cm({rotation:p,parallel:d,regularFlipRotation:a,parallelFlipRotation:n}),D=S+v,L=new Pn,{maxTickCount:C}=this.estimateTickCount(i,h,u),_=!(Wt.is(l)||da.is(l))||isNaN(C)?10:C;let N=zO(d,S,0,r,T);const P=DY(d,S,r,A),j=ge.toFontString({fontFamily:g,fontSize:f,fontStyle:x,fontWeight:m}),F=io.getMeasurer({font:j}),V={fontFamily:g,fontSize:f,fontStyle:x,fontWeight:m,textBaseline:P,textAlign:N},W=c.enabled&&c.avoidCollisions,H=({ticks:Z},X)=>{if(!W)return!1;const Q=S!==0||X!==0,$=D+X,q=AY(c.minSpacing,Q);Pn.updateTransformMatrix(L,1,1,$,0,0);const J=kY(Z,o,L,F);return FY(J,q)};let G={tickDomain:[],ticks:[],rawTicks:[],fractionDigits:0,niceDomain:void 0},B=0,z=0,U=!0,Y=!1;for(;!Y&&U&&B<=_;){z=0;for(const Z of this.getTickStrategies({domain:t,niceMode:s,secondaryAxis:b,index:B}))({tickData:G,index:B,autoRotation:z,terminate:Y}=Z({index:B,tickData:G,textProps:V,terminate:Y,primaryTickCount:e,visibleRange:i,get labelOverlap(){return H(G,z)}}));U=H(G,z)}N=zO(d,S,z,r,T);const K=v+S+z;return!b&&G.rawTicks.length>0&&(e=G.rawTicks.length),{tickData:G,primaryTickCount:e,combinedRotation:K,textBaseline:P,textAlign:N}}getTickStrategies({domain:t,niceMode:e,index:i,secondaryAxis:s}){const{scale:n,label:a,interval:o}=this.axis,{minSpacing:r}=o,l=Wt.is(n)||da.is(n),c=a.enabled&&a.avoidCollisions,h=!l&&i!==0&&c,u=a.autoRotate===!0&&a.rotation===void 0,d=[];let p;o.values?p=3:s?p=1:h?p=2:p=0;const g=({index:f,tickData:x,primaryTickCount:m,visibleRange:b,terminate:v})=>this.createTickData(t,e,b,m,p,f,x,v);if(d.push(g),!l&&!isNaN(r)){const f=({index:x,tickData:m,primaryTickCount:b,visibleRange:v,terminate:S})=>this.createTickData(t,e,v,b,2,x,m,S);d.push(f)}if(c&&u){const f=({index:x,tickData:m,labelOverlap:b,terminate:v})=>({index:x,tickData:m,autoRotation:b?re(ti(a.autoRotateAngle??0)):0,terminate:v});d.push(f)}return d}createTickData(t,e,i,s,n,a,o,r){const{scale:l,interval:c}=this.axis,{step:h,values:u,minSpacing:d,maxSpacing:p}=c,{maxTickCount:g,minTickCount:f,tickCount:x}=this.estimateTickCount(i,d,p),m=Wt.is(l)||da.is(l),b=!m||isNaN(g)?10:g,v=A=>m?Math.max(x-A,f):g,S=h==null&&u==null&&v(a)>f&&(m||n===2);for(;a<=b;){const A=o.rawTicks;if(o=this.getTicks({domain:t,niceMode:e,visibleRange:i,tickGenerationType:n,previousTicks:A,minTickCount:f,maxTickCount:g,primaryTickCount:s,tickCount:v(a)}),a++,!S||!$a(o.rawTicks,A))break}return r||(r=h!=null||u!=null),{tickData:o,index:a,autoRotation:0,terminate:r}}getTicks({domain:t,niceMode:e,visibleRange:i,tickGenerationType:s,previousTicks:n,tickCount:a,minTickCount:o,maxTickCount:r,primaryTickCount:l}){const{axis:c}=this,{label:h,range:u,scale:d,interval:p}=c,g=nI(),f={nice:e===0,interval:p.step,tickCount:a,minTickCount:o,maxTickCount:r},x={...f,nice:e===0||e===1};let m=e===0?d.niceDomain(f,t):t,b=m,v;switch(s){case 3:if(b=p.values,v=p.values,Wt.is(d)){const[O,_]=Si(m.map(Number));v=v.filter(N=>Number(N)>=O&&Number(N)<=_).sort((N,P)=>Number(N)-Number(P))}break;case 1:if(Wt.is(d)){const O=jY(t.map(Number),l??0,c.reverse);v=O.ticks,m=O.domain.map(_=>d.toDomain(_))}else v=d.ticks(x,m,i)??[];break;case 2:v=this.filterTicks(n,a);break;default:v=d.ticks(x,m,i)??[]}const S=v.reduce((O,_)=>Math.max(O,typeof _=="number"?Qy(_):0),0),A={domain:b,ticks:v,fractionDigits:S,specifier:h.format},T=d.tickFormatter(A),D=d.domain;d.domain=m;const L=(d.bandwidth??0)/2,C=[];for(let O=0;O0&&!c.inRange(N,.001))continue;const P=h.enabled?c.formatTick(_,O,S,T):"";C.push({tick:_,tickId:g(P),tickLabel:P,translationY:Math.floor(N)})}return d.domain=D,{tickDomain:b,rawTicks:v,fractionDigits:S,ticks:C,niceDomain:m}}}}}),Pm,YY=I({"packages/ag-charts-community/src/chart/axis/cartesianAxisLabel.ts"(){"use strict";mt(),wm(),Pm=class extends si{constructor(){super(...arguments),this.autoRotateAngle=335}},M([k(pt,{optional:!0})],Pm.prototype,"autoRotate",2),M([k(_t)],Pm.prototype,"autoRotateAngle",2)}}),Bm,Ou,gg=I({"packages/ag-charts-community/src/chart/axis/cartesianAxis.ts"(){"use strict";ot(),wi(),Ac(),Rt(),pe(),Fs(),ig(),mt(),Lc(),sI(),sw(),eI(),YY(),Bm=class QU extends _m{constructor(e,i){super(e,i),this.lineNode=this.axisGroup.appendChild(new pg({name:`${this.id}-Axis-line`,zIndex:1})),this.tempText=new kc,this.tempCaption=new te,this.tickGenerator=new oI(this),this.generatedTicks=void 0,this.animationManager=e.animationManager,this.animationState=new Cu("empty",{empty:{update:{target:"ready",action:()=>this.resetSelectionNodes()},reset:"empty"},ready:{update:n=>this.animateReadyUpdate(n),resize:()=>this.resetSelectionNodes(),reset:"empty"}}),this.axisGroup.appendChild(this.title.caption.node);let s;this.destroyFns.push(e.layoutManager.addListener("layout:complete",n=>{const a=[n.chart.width,n.chart.height];s!=null&&!$a(a,s)&&this.animationState.transition("resize"),s=a}),this.title.caption.registerInteraction(this.moduleCtx,"afterend"))}static is(e){return e instanceof QU}resetAnimation(e){e==="initial"&&this.animationState.transition("reset")}get direction(){return this.position==="top"||this.position==="bottom"?"x":"y"}createAxisContext(){return{...super.createAxisContext(),position:this.position}}createLabel(){return new Pm}updateDirection(){switch(this.position){case"top":this.rotation=-90,this.label.mirrored=!0,this.label.parallel=!0;break;case"right":this.rotation=0,this.label.mirrored=!0,this.label.parallel=!1;break;case"bottom":this.rotation=-90,this.label.mirrored=!1,this.label.parallel=!0;break;case"left":this.rotation=0,this.label.mirrored=!1,this.label.parallel=!1;break}this.axisContext&&(this.axisContext.position=this.position,this.axisContext.direction=this.direction)}calculateLayout(e){return this.updateDirection(),super.calculateLayout(e)}calculateTickLayout(e,i,s,n){const a=this.label.getSideFlag(),{parallelFlipRotation:o,regularFlipRotation:r}=this.calculateRotations(),l=a*(this.getTickSize()+this.label.spacing+this.seriesAreaPadding),c=this.tickGenerator.generateTicks({domain:e,niceMode:i,visibleRange:s,primaryTickCount:n,parallelFlipRotation:o,regularFlipRotation:r,labelX:l,sideFlag:a}),{tickData:h,primaryTickCount:u=n}=c,{ticks:d,tickDomain:p,rawTicks:g,fractionDigits:f,niceDomain:x=e}=h,m=d.map(v=>this.getTickLabelProps(v,c)),b=this.tickBBox(d,m);return this.generatedTicks={ticks:d,labels:m},{ticks:g,tickDomain:p,niceDomain:x,primaryTickCount:u,fractionDigits:f,bbox:b}}update(){this.updateDirection();const e=Array.from(this.tickLabelGroupSelection.nodes(),a=>a.datum.tickId);if(super.update(),this.animatable||this.moduleCtx.animationManager.skipCurrentBatch(),this.generatedTicks){const{ticks:a}=this.generatedTicks;if(this.animationManager.isSkipped())this.resetSelectionNodes();else{const o=a.map(l=>l.tickId),r=C3(e,o);this.animationState.transition("update",r)}}const{enabled:i,stroke:s,width:n}=this.line;this.lineNode.setProperties({stroke:s,strokeWidth:i?n:0}),this.updateTitle(!this.generatedTicks?.ticks.length)}updatePosition(){super.updatePosition(),this.axisGroup.datum=this.getAxisTransform()}tickBBox(e,i){const s=this.label.getSideFlag(),n=[],{x:a,y1:o,y2:r}=this.getAxisLineCoordinates(),l=new ht(a+Math.min(s*this.seriesAreaPadding,0),o,this.seriesAreaPadding,r-o);if(n.push(l),this.tick.enabled)for(const u of e){const{x1:d,x2:p,y:g}=this.getTickLineCoordinates(u),f=new ht(d,g,p-d,0);n.push(f)}const{tempText:c}=this;if(this.label.enabled)for(const u of i){if(!u.visible)continue;c.setProperties({...u,translationY:Math.round(u.translationY)});const d=c.getBBox();d&&n.push(d)}if(this.title?.enabled){const u=ht.merge(n).width;this.setTitleProps(this.tempCaption,{spacing:u});const d=this.tempCaption.node.getBBox();d&&n.push(d)}const h=ht.merge(n);return this.getTransformBox(h)}getTickLabelProps(e,i){const{combinedRotation:s,textBaseline:n,textAlign:a}=i,{range:o}=this.scale,r=e.tickLabel,c=this.label.getSideFlag()*(this.getTickSize()+this.label.spacing+this.seriesAreaPadding),h=r!==""&&r!=null;return{...this.getLabelStyles({value:e.tickLabel}),tickId:e.tickId,rotation:s,rotationCenterX:c,translationY:e.translationY,text:r,textAlign:a,textBaseline:n,visible:h,x:c,y:0,range:o}}getTickLineCoordinates(e){const s=this.label.getSideFlag()*this.getTickSize(),n=Math.min(0,s),a=n+Math.abs(s),o=e.translationY;return{x1:n,x2:a,y:o}}updateSelections(){if(!this.generatedTicks)return;const e=this.getAxisLineCoordinates(),{ticks:i,labels:s}=this.generatedTicks,n=a=>a.tickId;this.lineNode.datum=e,this.gridLineGroupSelection.update(this.gridLength?i:[],void 0,n),this.tickLineGroupSelection.update(i,void 0,n),this.tickLabelGroupSelection.update(s,void 0,n)}updateTitle(e,i){const{title:s,tickLineGroup:n,tickLabelGroup:a,lineNode:o}=this;s.enabled&&!e&&i==null&&(i=yt.computeChildrenBBox([n,a,o]).width+(a.visible?0:this.seriesAreaPadding)),i??(i=0),this.setTitleProps(s.caption,{spacing:i})}updateLabels(){this.label.enabled&&this.tickLabelGroupSelection.each((e,i)=>{e.fill=i.fill,e.fontFamily=i.fontFamily,e.fontSize=i.fontSize,e.fontStyle=i.fontStyle,e.fontWeight=i.fontWeight,e.text=i.text,e.textBaseline=i.textBaseline,e.textAlign=i.textAlign??"center"})}animateReadyUpdate(e){const{animationManager:i}=this.moduleCtx,s=Em(this),n=ZO(s);De(this.id,"axis-group",i,[this.axisGroup],n.group),De(this.id,"line",i,[this.lineNode],n.line),De(this.id,"line-paths",i,[this.gridLineGroupSelection,this.tickLineGroupSelection],n.tick,(a,o)=>o.tickId,e),De(this.id,"tick-labels",i,[this.tickLabelGroupSelection],n.label,(a,o)=>o.tickId,e)}resetSelectionNodes(){const e=Em(this);Mi([this.axisGroup],QO()),Mi([this.gridLineGroupSelection,this.tickLineGroupSelection],q0(e)),Mi([this.tickLabelGroupSelection],J0()),Mi([this.lineNode],qO())}},M([k(st,{optional:!0})],Bm.prototype,"thickness",2),M([k(um)],Bm.prototype,"position",2),Ou=Bm}}),Ec,Rc,wu=I({"packages/ag-charts-community/src/chart/axis/categoryAxis.ts"(){"use strict";ot(),Yp(),mt(),gg(),Ec=class qU extends Ou{constructor(e,i=new Su){super(e,i),this.groupPaddingInner=.1,this.includeInvisibleDomains=!0}static is(e){return e instanceof qU}normaliseDataDomain(e){return{domain:e,clipped:!1}}updateScale(){super.updateScale();let{paddingInner:e,paddingOuter:i}=this;if(!zt(e)||!zt(i)){const s=this.reduceBandScalePadding();e??(e=s.inner),i??(i=s.outer)}this.scale.paddingInner=e??0,this.scale.paddingOuter=i??0}reduceBandScalePadding(){return this.boundSeries.reduce((e,i)=>{const s=i.getBandScalePadding?.();return s&&(e.inner>s.inner&&(e.inner=s.inner),e.outere.type===s.type&&("optionsKey"in e&&"optionsKey"in s?e.optionsKey===s.optionsKey:!0)&&e.identifier===s.identifier);if(i){if(e.packageType==="enterprise"&&i.packageType==="community"){const s=this.modules.indexOf(i);this.modules.splice(s,1,e),"optionsKey"in e&&this.modulesByOptionKey.set(e.optionsKey,e)}}else this.modules.push(e),"optionsKey"in e&&this.modulesByOptionKey.set(e.optionsKey,e)}}hasEnterpriseModules(){return this.modules.some(t=>t.packageType==="enterprise")}*byType(...t){const e=new Set,i=this.modules.filter(a=>t.includes(a.type)),s=a=>{const o=this.dependencies.get(a);return o?.flatMap(s).concat(o)??[]},n=[];for(const a of i){const o="optionsKey"in a?a.optionsKey:a.contextKey;if(!e.has(o)){for(const r of s(o)){if(e.has(r))continue;const l=this.modulesByOptionKey.get(r);if(!l){n.push(r);continue}t.includes(l.type)&&(yield l,e.add(r))}yield a,e.add(o)}}if(n.length>0)throw new Error(`Could not resolve module dependencies: ${n}`)}registerDependencies(t){if(t.dependencies==null||t.dependencies.length===0)return;const e="optionsKey"in t?t.optionsKey:t.contextKey;this.dependencies.set(e,t.dependencies)}},pa=new nw}});function KY(){return new Promise(t=>{setTimeout(t,0)})}var rI,$Y=I({"packages/ag-charts-community/src/util/async.ts"(){"use strict";rI=class{constructor(){this.queue=[]}await(t=50){return new Promise(e=>{const i=()=>{clearTimeout(n),e(!0)},n=setTimeout(()=>{const a=this.queue.indexOf(i);a<0||(this.queue.splice(a,1),e(!1))},t);this.queue.push(i)})}notify(){this.queue.splice(0).forEach(t=>t())}}}});function zm(t,e){t&&(e=Cp.normalize(e),e.width==null?t.style.removeProperty("width"):t.style.width=`${e.width}px`,e.height==null?t.style.removeProperty("height"):t.style.height=`${e.height}px`,e.x==null?t.style.removeProperty("left"):t.style.left=`${e.x}px`,e.y==null?t.style.removeProperty("top"):t.style.top=`${e.y}px`)}function aw(t){const e=parseFloat(t.style.width)||t.offsetWidth,i=parseFloat(t.style.height)||t.offsetHeight,s=parseFloat(t.style.left)||t.offsetLeft,n=parseFloat(t.style.top)||t.offsetTop;return{x:s,y:n,width:e,height:i}}function XY(t){if(t.focus({preventScroll:!0}),t.lastChild?.textContent==null)return;const e=Go().createRange();e.setStart(t.lastChild,t.lastChild.textContent.length),e.setEnd(t.lastChild,t.lastChild.textContent.length);const i=ae().getSelection();i?.removeAllRanges(),i?.addRange(e)}function ZY(t){return`${t??"ag-charts-element"}-${rw++}`}function ow(){const t=ae("navigator");if("scheduling"in t){const e=t.scheduling;if("isInputPending"in e)return e.isInputPending({includeContinuous:!0})}return!1}function Fm(t){return`ag-charts-icon ag-charts-icon-${t}`}var rw,_c=I({"packages/ag-charts-community/src/util/dom.ts"(){"use strict";Lt(),Ky(),rw=0}});function Qo(t,e,i){if(ne(e)){if(!ne(t)||t.length!==e.length||e.some((s,n)=>Qo(t[n],s)!=null))return e}else if(Xi(e)){if(!Xi(t))return e;const s={},n=new Set([...Object.keys(t),...Object.keys(e)]);for(const a of n)if(!(t[a]===e[a]||i?.includes(a)))if(typeof t[a]==typeof e[a]){const o=Qo(t[a],e[a]);o!==null&&(s[a]=o)}else s[a]=e[a];return Object.keys(s).length?s:null}else if(t!==e)return e;return null}function lw(t,e){for(const i of Object.keys(t))if(t[i]!==e?.[i])return!1;return!0}function ni(t,e){return ne(t)?t.map(i=>ni(i,e)):Xi(t)?QY(t,e):t instanceof Map?new Map(ni(Array.from(t))):lI(t)}function QY(t,e){const i={};for(const s of Object.keys(t))i[s]=e?.has(s)?lI(t[s]):ni(t[s],e);return i}function lI(t){return ne(t)?t.slice(0):Xi(t)?{...t}:hu(t)?new Date(t):P3(t)?new RegExp(t.source,t.flags):t}function qo(t,e,i,s,n,a){if(ne(t)){a=e(t,s,n,a);let o=0;for(const r of t)a=qo(r,e,i,s?.[o],n,a),o++}else if(Xi(t)){a=e(t,s,n,a);for(const o of Object.keys(t)){if(i?.has(o))continue;const r=t[o];a=qo(r,e,i,s?.[o],n,a)}}return a}function yg(t,e,i={}){const{path:s,matcherPath:n=s?.replace(/(\[[0-9+]+])/i,"[]"),skip:a=[]}=i;if(t==null)throw new Error(`AG Charts - target is uninitialised: ${s??""}`);if(e==null)return t;if(qa(t))return t.set(e);const o=t,r=cI(t);for(const l of Object.keys(e)){if(sm.has(l))continue;const c=`${n?n+".":""}${l}`;if(a.includes(c))continue;const h=e[l],u=`${s?s+".":""}${l}`,d=o.constructor,p=o[l];try{const g=cI(p),f=cI(h);if(r===Vm&&!(l in t)){if(h===void 0)continue;et.warn(`unable to set [${u}] in ${d?.name} - property is unknown`);continue}if(g!=null&&f!=null&&f!==g&&(g!==Vm||f!=="object")){et.warn(`unable to set [${u}] in ${d?.name} - can't apply type of [${f}], allowed types are: [${g}]`);continue}if(qa(p))o[l].set(h);else if(f==="object"){if(p==null){et.warn(`unable to set [${u}] in ${d?.name} - property is unknown`);continue}yg(p,h,{...i,path:u,matcherPath:c})}else o[l]=h}catch(g){et.warn(`unable to set [${u}] in [${d?.name}]; nested error is: ${g.message}`)}}return t}function cI(t){return t==null?null:B3(t)||hu(t)?"primitive":ne(t)?"array":bi(t)?Xi(t)?"object":Vm:cc(t)?"function":"primitive"}function cw(t,e,i){return hI(t,e,t,i)}function hI(t,e,i,s,n=[],a={}){if(ne(t)){hw(t,e,i,n,a);let o=0;for(const r of t)hI(r,e,i,s,[...n,`${o}`],a),o++}else if(Xi(t)){hw(t,e,i,n,a);for(const o of Object.keys(t)){if(s?.has(o))continue;const r=t[o];hI(r,e,i,s,[...n,o],a)}}return a}function hw(t,e,i,s,n){if(ne(t))for(let a=0;a{const{operation:r,values:l}=uI(o);return r?dw(r,l,i,s,n,a):o})),pI[t](e,i,s,n,a)}function jm(t){return On(t)&&t>=0&&t<=1}var Vm,dI,pw,pI,jn=I({"packages/ag-charts-community/src/util/json.ts"(){"use strict";ot(),hc(),oe(),Qt(),Vm="class-instance",dI=(t=>(t.Ref="$ref",t.Path="$path",t.If="$if",t.Eq="$eq",t.Not="$not",t.Or="$or",t.And="$and",t.Mul="$mul",t.Round="$round",t.Rem="$rem",t.Mix="$mix",t.ForegroundBackgroundMix="$foregroundBackgroundMix",t.ForegroundBackgroundAccentMix="$foregroundBackgroundAccentMix",t))(dI||{}),pw=new Set(Object.values(dI)),pI={$ref:(t,e,i,s,n)=>{if(Es(t)&&t in e){const{operation:a,values:o}=uI(e[t]);if(a!=="$ref")return e[t];if(n?.has(o)){et.warnOnce(`\`$ref\` json operation failed on [${String(t)}] at [${s.join(".")}], circular reference detected with [${[...n].join(", ")}].`);return}return n?.add(o),pI.$ref(o,e,i,s,n)}et.warnOnce(`\`$ref\` json operation failed on [${String(t)}] at [${s.join(".")}], expecting one of [${Object.keys(e).join(", ")}].`)},$path:(t,e,i,s)=>{if(!Es(t)){et.warnOnce(`\`$path\` json operation failed on [${String(t)}] at [${s.join(".")}], expecting a string.`);return}const n=t.split("/"),a=[...s];for(const r of n)r===".."?(a.pop(),a.pop()):r==="."?a.pop():a.push(r);let o=i;for(const r of a){if(!(r in o)){et.warnOnce(`\`$path\` json operation failed on [${String(t)}] at [${s.join(".")}], could not find path in object.`);return}o=o[r]}return o},$if:([t,e,i])=>t?e:i,$eq:([t,e])=>t===e,$not:([t,e])=>t!==e,$or:([t,e])=>t||e,$and:([t,e])=>t&&e,$mul:([t,e],i,s,n)=>{if(typeof t=="number"&&typeof e=="number")return t*e;et.warnOnce(`\`$mul\` json operation failed on [${String(t)}] and [${String(e)}] at [${n.join(".")}], expecting two numbers.`)},$round:([t],e,i,s)=>{if(typeof t=="number")return Math.round(t);et.warnOnce(`\`$round\` json operation failed on [${String(t)}] at [${s.join(".")}], expecting a number.`)},$rem:([t],e)=>{if(typeof t=="number")return Math.round(t*e.fontSize)},$mix:([t,e,i],s,n,a)=>{if(typeof t=="string"&&typeof e=="string"&&jm(i))try{return xe.mix(xe.fromString(t),xe.fromString(e),i).toString()}catch{}et.warnOnce(`\`$mix\` json operation failed on [${String(t)}, ${String(e)}, ${String(i)}] at [${a.join(".")}], expecting two colors and a number between 0 and 1.`)},$foregroundBackgroundMix:([t],e,i,s)=>{if(jm(t))return xe.mix(xe.fromString(e.foregroundColor),xe.fromString(e.backgroundColor),t).toString();et.warnOnce(`\`$foregroundBackgroundMix\` json operation failed on [${String(t)}}}] at [${s.join(".")}], expecting a number between 0 and 1.`)},$foregroundBackgroundAccentMix:([t,e],i,s,n)=>{if(jm(t)&&jm(e))return xe.mix(xe.mix(xe.fromString(i.foregroundColor),xe.fromString(i.backgroundColor),t),xe.fromString(i.accentColor),e).toString();et.warnOnce(`\`$foregroundBackgroundAccentMix\` json operation failed on [${String(t)}, ${String(e)}}] at [${n.join(".")}], expecting two numbers between 0 and 1.`)}}}}),gw,qY=I({"packages/ag-charts-community/src/util/mutex.ts"(){"use strict";ot(),gw=class{constructor(){this.available=!0,this.acquireQueue=[]}acquire(t){return new Promise(e=>{this.acquireQueue.push([t,e]),this.available&&this.dispatchNext().catch(i=>et.errorOnce(i))})}async acquireImmediately(t){return this.available?(await this.acquire(t),!0):!1}async waitForClearAcquireQueue(){return this.acquire(()=>Promise.resolve(void 0))}async dispatchNext(){this.available=!1;let[t,e]=this.acquireQueue.shift()??[];for(;t;){try{await t(),e?.()}catch(i){et.error("mutex callback error",i),e?.()}[t,e]=this.acquireQueue.shift()??[]}this.available=!0}}}}),gI,fw=I({"packages/ag-charts-community/src/util/observable.ts"(){"use strict";gI=class{constructor(){this.eventListeners=new Map}addEventListener(t,e){if(typeof e!="function")throw new Error("AG Charts - listener must be a Function");const i=this.eventListeners.get(t);i?i.add(e):this.eventListeners.set(t,new Set([e]))}removeEventListener(t,e){this.eventListeners.get(t)?.delete(e),this.eventListeners.size===0&&this.eventListeners.delete(t)}hasEventListener(t){return this.eventListeners.has(t)}clearEventListeners(){this.eventListeners.clear()}fireEvent(t){this.eventListeners.get(t.type)?.forEach(e=>e(t))}}}}),Jo,fI=I({"packages/ag-charts-community/src/util/padding.ts"(){"use strict";Qt(),mt(),Jo=class extends bt{constructor(t=0,e=t,i=t,s=e){super(),this.top=t,this.right=e,this.bottom=i,this.left=s}},M([k(st)],Jo.prototype,"top",2),M([k(st)],Jo.prototype,"right",2),M([k(st)],Jo.prototype,"bottom",2),M([k(st)],Jo.prototype,"left",2)}});function JY(t){return yw((e,i)=>ae().requestAnimationFrame(e),t)}function t5(t){return yw((e,i=0)=>{i===0?queueMicrotask(e):setTimeout(e,i)},t)}function yw(t,e){let i=0,s=!1,n,a;const o=()=>s,r=()=>{s=!1,a?.(),a=void 0,n=void 0,i>0&&t(l)},l=()=>{const c=i;i=0,s=!0;const h=e({count:c});if(!h){r();return}h.then(r,r)};return{schedule(c){i===0&&!o()&&t(l,c),i++},async await(){if(o())for(n==null&&(n=new Promise(c=>{a=c}));o();)await n}}}var mw=I({"packages/ag-charts-community/src/util/render.ts"(){"use strict";Lt()}});function Pc(t){return t==="true"}function e5(t){return Number(t)}function ga(t){return t}function ee(t,e,i){i==null||i===""||i===""?t?.removeAttribute(e):t?.setAttribute(e,i.toString())}function Bc(t,e){if(e!=null)for(const[i,s]of Object.entries(e))i!=="class"&&ee(t,i,s)}function Gm(t,e,i){if(!(t instanceof HTMLElement))return;const s=t.getAttribute(e);return s===null?i:xw[e]?.(s)??void 0}function fa(t,e,i){t!=null&&(i==null?t.style.removeProperty(e):t.style.setProperty(e,i.toString()))}function i5(t,e){for(const[i,s]of Object.entries(e))fa(t,i,s)}var xw,ss=I({"packages/ag-charts-community/src/util/attributeUtil.ts"(){"use strict";xw={role:ga,"aria-checked":Pc,"aria-controls":ga,"aria-describedby":ga,"aria-disabled":Pc,"aria-expanded":Pc,"aria-haspopup":Pc,"aria-hidden":Pc,"aria-label":ga,"aria-labelledby":ga,"aria-live":ga,"aria-orientation":ga,"aria-selected":Pc,"data-preventdefault":Pc,class:ga,id:ga,tabindex:e5,title:ga,placeholder:ga}}});function Eu(t,e,i){const{offsetX:s,offsetY:n,clientX:a,clientY:o}=e,{currentX:r,currentY:l}=ao.calcCurrentXY(i,e);return{type:t,offsetX:s,offsetY:n,clientX:a,clientY:o,currentX:r,currentY:l,sourceEvent:e}}function Wm(t,e,i){return{type:t,sourceEvent:e}}var Um,bw,ao,Hm=I({"packages/ag-charts-community/src/widget/widgetEvents.ts"(){"use strict";Um=["blur","change","contextmenu","focus","keydown","keyup","click","dblclick","mouseenter","mousemove","mouseleave","wheel","touchstart","touchmove","touchend","touchcancel"],bw={blur:t=>({type:"blur",sourceEvent:t}),change:t=>({type:"change",sourceEvent:t}),contextmenu:(t,e)=>Eu("contextmenu",t,e),focus:t=>({type:"focus",sourceEvent:t}),keydown:t=>({type:"keydown",sourceEvent:t}),keyup:t=>({type:"keyup",sourceEvent:t}),click:(t,e)=>Eu("click",t,e),dblclick:(t,e)=>Eu("dblclick",t,e),mouseenter:(t,e)=>Eu("mouseenter",t,e),mousemove:(t,e)=>Eu("mousemove",t,e),mouseleave:(t,e)=>Eu("mouseleave",t,e),wheel:t=>{const{offsetX:e,offsetY:i,clientX:s,clientY:n}=t,a=t.deltaMode===0?.01:1,o=t.deltaX*a,r=t.deltaY*a;return{type:"wheel",offsetX:e,offsetY:i,clientX:s,clientY:n,deltaX:o,deltaY:r,sourceEvent:t}},touchstart:(t,e)=>Wm("touchstart",t,e),touchmove:(t,e)=>Wm("touchmove",t,e),touchend:(t,e)=>Wm("touchend",t,e),touchcancel:(t,e)=>Wm("touchcancel",t,e)},ao=class{static alloc(t,e,i){return bw[t](e,i)}static isHTMLEvent(t){return Um.includes(t)}static calcCurrentXY(t,e){const i=t.getBoundingClientRect();return{currentX:e.clientX-i.x,currentY:e.clientY-i.y}}}}}),Sw,s5=I({"packages/ag-charts-community/src/widget/widgetListenerHTML.ts"(){"use strict";Hm(),Sw=class{constructor(){this.widgetListeners={},this.sourceListeners={}}initSourceHandler(t,e){this.sourceListeners??(this.sourceListeners={}),this.sourceListeners[t]=e}lazyGetWidgetListeners(t,e){var i;if(!(t in(this.sourceListeners??{}))){const s=a=>{const o=ao.alloc(t,a,e.getElement());for(const r of this.widgetListeners?.[t]??[])r(o,e)},n={};t.startsWith("touch")&&(n.passive=!1),this.initSourceHandler(t,s),e.getElement().addEventListener(t,s,n)}return this.widgetListeners??(this.widgetListeners={}),(i=this.widgetListeners)[t]??(i[t]=[]),this.widgetListeners[t]}add(t,e,i){this.lazyGetWidgetListeners(t,e).push(i)}remove(t,e,i){const s=this.lazyGetWidgetListeners(t,e),n=s.indexOf(i);n>-1&&s.splice(n,1)}destroy(t){for(const[e,i]of Object.entries(this.sourceListeners??{})){const s=e;t.getElement().removeEventListener(s,i)}this.widgetListeners=void 0,this.sourceListeners=void 0}}}});function n5(t,e,i,s){if(t.globalMouseDragCallbacks==null)return new vw(t,e,i,s)}var vw,a5=I({"packages/ag-charts-community/src/widget/mouseDragger.ts"(){"use strict";Lt(),vw=class{constructor(t,e,i,s){this.glob=t,this.self=e,this.window=ae(),this.mousegeneral=l=>{l.stopPropagation(),l.stopImmediatePropagation()},this.mousemove=l=>{l.stopPropagation(),l.stopImmediatePropagation(),this.glob.globalMouseDragCallbacks?.mousemove(l)},this.mouseup=l=>{l.button===0&&(l.stopPropagation(),l.stopImmediatePropagation(),this.glob.globalMouseDragCallbacks?.mouseup(l),this.destroy())};const{window:n,mousegeneral:a,mousemove:o,mouseup:r}=this;n.addEventListener("mousedown",a,{capture:!0}),n.addEventListener("mouseenter",a,{capture:!0}),n.addEventListener("mouseleave",a,{capture:!0}),n.addEventListener("mouseout",a,{capture:!0}),n.addEventListener("mouseover",a,{capture:!0}),n.addEventListener("mousemove",o,{capture:!0}),n.addEventListener("mouseup",r,{capture:!0}),e.mouseDragger=this,t.globalMouseDragCallbacks=i,t.globalMouseDragCallbacks.mousedown(s)}destroy(){const{window:t,mousegeneral:e,mousemove:i,mouseup:s}=this;t.removeEventListener("mousedown",e,{capture:!0}),t.removeEventListener("mouseenter",e,{capture:!0}),t.removeEventListener("mouseleave",e,{capture:!0}),t.removeEventListener("mouseout",e,{capture:!0}),t.removeEventListener("mouseover",e,{capture:!0}),t.removeEventListener("mousemove",i,{capture:!0}),t.removeEventListener("mouseup",s,{capture:!0}),this.glob.globalMouseDragCallbacks=void 0,this.self.mouseDragger=void 0}}}});function o5(t,e){const i=t.clientX-e.clientX,s=t.clientY-e.clientY;return i*i+s*s}function r5(t,e,i,s,n){if(!(t.globalTouchDragCallbacks!=null||Ym))return new Aw(t,e,i,s,n)}var Mw,Iw,Ym,Aw,l5=I({"packages/ag-charts-community/src/widget/touchDragger.ts"(){"use strict";Lt(),Mw=500,Iw=100,Ym=!1,Aw=class{constructor(t,e,i,s,n){this.glob=t,this.self=e,this.initialTouch=s,this.target=n,this.longTapInterrupted=!1,this.longtap=()=>{const{target:r,initialTouch:l}=this;if(!this.longTapInterrupted){r.dispatchEvent(new TouchEvent("touchcancel",{touches:[l],bubbles:!0})),Ym=!0;const c=g=>{g.preventDefault()},h=g=>{Ym=!1,g.preventDefault(),r.removeEventListener("touchmove",c),r.removeEventListener("touchend",h),r.removeEventListener("touchcancel",h)};r.addEventListener("touchmove",c,{passive:!1}),r.addEventListener("touchend",h,{passive:!1}),r.addEventListener("touchcancel",h,{passive:!1});const{clientX:u,clientY:d}=l,p=new PointerEvent("contextmenu",{bubbles:!0,cancelable:!0,view:ae(),clientX:u,clientY:d,pointerType:"touch"});r.dispatchEvent(p)}},this.touchmove=r=>{const{glob:l,self:c,initialTouch:h}=this,u=this.findInitialFinger(r.targetTouches);u!=null&&(this.longTapInterrupted=this.longTapInterrupted||o5(h,u)>Iw,c.dragTouchEnabled&&u!=null&&l.globalTouchDragCallbacks?.touchmove(r,u))},this.touchend=r=>{this.longTapInterrupted=!0;const l=this.findInitialFinger(r.changedTouches,r.touches);l!=null&&this.glob.globalTouchDragCallbacks?.touchend(r,l),this.destroy()},this.longtapTimer=setTimeout(this.longtap,Mw);const{touchmove:a,touchend:o}=this;n.addEventListener("touchmove",a,{passive:!1}),n.addEventListener("touchstart",o,{passive:!1}),n.addEventListener("touchend",o,{passive:!1}),n.addEventListener("touchcancel",o,{passive:!1}),e.touchDragger=this,t.globalTouchDragCallbacks=i}destroy(){const{longtapTimer:t,touchmove:e,touchend:i}=this;clearTimeout(t),this.target.removeEventListener("touchstart",i),this.target.removeEventListener("touchmove",e),this.target.removeEventListener("touchend",i),this.target.removeEventListener("touchcancel",i),this.glob.globalTouchDragCallbacks=void 0,this.self.touchDragger=void 0}findInitialFinger(...t){const e=t.map(i=>Array.from(i)).flat();return Array.from(e).find(i=>i.identifier===this.initialTouch.identifier)}}}});function yI(t,e,i,s){const{currentX:n,currentY:a}=ao.calcCurrentXY(t.getElement(),s),o=s.pageX-i.pageX,r=s.pageY-i.pageY;return{type:e,device:"mouse",offsetX:i.offsetX+o,offsetY:i.offsetY+r,clientX:s.clientX,clientY:s.clientY,currentX:n,currentY:a,originDeltaX:o,originDeltaY:r,sourceEvent:s}}function c5(t,{pageX:e,pageY:i}){const{x:s,y:n}=t.getElement().getBoundingClientRect();return{offsetX:e-s,offsetY:i-n}}function mI(t,e,i,s,n){const{currentX:a,currentY:o}=ao.calcCurrentXY(t.getElement(),n),r=n.pageX-i.pageX,l=n.pageY-i.pageY;return{type:e,device:"touch",offsetX:i.offsetX+r,offsetY:i.offsetY+l,clientX:n.clientX,clientY:n.clientY,currentX:a,currentY:o,originDeltaX:r,originDeltaY:l,sourceEvent:s}}var xI,bI,h5=I({"packages/ag-charts-community/src/widget/widgetListenerInternal.ts"(){"use strict";Ky(),oe(),a5(),l5(),Hm(),xI={},bI=class{constructor(t){this.dispatchCallback=t,this.dragTouchEnabled=!0}destroy(){this.dragTriggerRemover?.(),this.dragTriggerRemover=void 0,this.dragStartListeners=void 0,this.dragMoveListeners=void 0,this.dragEndListeners=void 0,this.mouseDragger?.destroy(),this.touchDragger?.destroy()}add(t,e,i){switch(t){case"drag-start":{this.dragStartListeners??(this.dragStartListeners=[]),this.dragStartListeners.push(i),this.registerDragTrigger(e);break}case"drag-move":{this.dragMoveListeners??(this.dragMoveListeners=[]),this.dragMoveListeners.push(i),this.registerDragTrigger(e);break}case"drag-end":{this.dragEndListeners??(this.dragEndListeners=[]),this.dragEndListeners.push(i),this.registerDragTrigger(e);break}}}remove(t,e,i){switch(t){case"drag-start":return this.removeHandler(this.dragStartListeners,i);case"drag-move":return this.removeHandler(this.dragMoveListeners,i);case"drag-end":return this.removeHandler(this.dragEndListeners,i)}}removeHandler(t,e){const i=t?.indexOf(e);i!==void 0&&t?.splice(i,1)}registerDragTrigger(t){if(this.dragTriggerRemover==null){const e=s=>this.triggerMouseDrag(t,s),i=s=>this.triggerTouchDrag(t,s);t.getElement().addEventListener("mousedown",e),t.getElement().addEventListener("touchstart",i,{passive:!1}),this.dragTriggerRemover=()=>{t.getElement().removeEventListener("mousedown",e),t.getElement().removeEventListener("touchstart",i)}}}triggerMouseDrag(t,e){e.button===0&&this.startMouseDrag(t,e)}startMouseDrag(t,e){const i={pageX:NaN,pageY:NaN,offsetX:NaN,offsetY:NaN};FM(["pageX","pageY","offsetX","offsetY"],i,e);const s={mousedown:n=>{const a=yI(t,"drag-start",i,n);this.dispatch("drag-start",t,a)},mousemove:n=>{const a=yI(t,"drag-move",i,n);this.dispatch("drag-move",t,a)},mouseup:n=>{const a=yI(t,"drag-end",i,n);this.dispatch("drag-end",t,a),this.endDrag(t,a)}};this.mouseDragger=n5(xI,this,s,e)}endDrag(t,{sourceEvent:e,clientX:i,clientY:s}){const n=t.getElement(),a=n.getBoundingClientRect();Cp.containsPoint(a,i,s)||(n.dispatchEvent(new MouseEvent("mouseleave",e)),e.target?.dispatchEvent(new MouseEvent("mouseenter",e)))}triggerTouchDrag(t,e){const i=e.targetTouches.item(0);e.targetTouches.length===1&&i!=null&&this.startOneFingerTouch(t,e,i)}startOneFingerTouch(t,e,i){const s={pageX:NaN,pageY:NaN,...c5(t,i)};FM(["pageX","pageY"],s,i);const n={touchmove:(r,l)=>{const c=mI(t,"drag-move",s,r,l);this.dispatch("drag-move",t,c)},touchend:(r,l)=>{const c=mI(t,"drag-end",s,r,l);this.dispatch("drag-end",t,c)}},a=t.getElement();this.touchDragger=r5(xI,this,n,i,a);const o=mI(t,"drag-start",s,e,i);this.dispatch("drag-start",t,o)}dispatch(t,e,i){switch(t){case"drag-start":this.dragStartListeners?.forEach(s=>s(i,e));break;case"drag-move":this.dragMoveListeners?.forEach(s=>s(i,e));break;case"drag-end":this.dragEndListeners?.forEach(s=>s(i,e));break}this.dispatchCallback(t,i)}}}}),Dw,ya,tr=I({"packages/ag-charts-community/src/widget/widget.ts"(){"use strict";Lt(),ss(),_c(),Hm(),s5(),h5(),Dw=class{constructor(t){this.elem=t}setBounds(t){zm(this.elemContainer??this.elem,t)}getBounds(){return aw(this.elemContainer??this.elem)}static setElementContainer(t,e){const i=t.getBounds();zm(e,i),i5(t.elem,{width:"100%",height:"100%"}),t.elem.remove(),t.elemContainer=e,t.elemContainer.replaceChildren(t.elem)}},ya=class extends Dw{constructor(t){super(t),this.elem=t,this.index=NaN,this.children=[]}getElement(){return this.elem}getBoundingClientRect(){return this.elem.getBoundingClientRect()}get clientWidth(){return this.elem.clientWidth}get clientHeight(){return this.elem.clientHeight}destroy(){this.parent?.removeChild(this),this.children.forEach(t=>{t.parent=void 0,t.destroy()}),this.children.length=0,this.destructor(),this.elem.remove(),this.elemContainer?.remove(),this.internalListener?.destroy(),this.htmlListener?.destroy(this)}setHidden(t){fa(this.elem,"display",t?"none":void 0)}isHidden(){return ae()?.getComputedStyle?.(this.elem).display==="none"}setCursor(t){fa(this.elem,"cursor",t)}setTextContent(t){this.elem.textContent=t??null}setAriaDescribedBy(t){ee(this.elem,"aria-describedby",t)}setAriaHidden(t){ee(this.elem,"aria-hidden",t)}setAriaLabel(t){ee(this.elem,"aria-label",t)}setInnerHTML(t){this.elem.innerHTML=t}isDisabled(){return Gm(this.elem,"aria-disabled",!1)}parseFloat(t){return t===""?0:parseFloat(t)}cssLeft(){return this.parseFloat(this.elem.style.left)}cssTop(){return this.parseFloat(this.elem.style.top)}cssWidth(){return this.parseFloat(this.elem.style.width)}cssHeight(){return this.parseFloat(this.elem.style.height)}focus(){this.elem.focus()}setPreventsDefault(t){ee(this.elem,"data-preventdefault",t)}setTabIndex(t){ee(this.elem,"tabindex",t)}addChild(t){this.addChildToDOM(t,this.getBefore(t)),this.children.push(t),t.index=this.children.length-1,t.parent=this,this.onChildAdded(t)}removeChild(t){const e=this.children.findIndex(i=>i===t);this.children.splice(e,1),this.removeChildFromDOM(t),this.onChildRemoved(t)}moveChild(t,e){t.domIndex!==e&&(t.domIndex=e,this.removeChildFromDOM(t),this.addChildToDOM(t,this.getBefore(t)))}addClass(...t){this.elem.classList.add(...t)}removeClass(...t){this.elem.classList.remove(...t)}toggleClass(t,e){this.elem.classList.toggle(t,e)}appendOrInsert(t,e){e?e.getElement().insertAdjacentElement("beforebegin",t):this.elem.appendChild(t)}addChildToDOM(t,e){this.appendOrInsert(t.getElement(),e)}removeChildFromDOM(t){this.elem.removeChild(t.getElement())}onChildAdded(t){}onChildRemoved(t){}getBefore({domIndex:t}){if(t!==void 0)return this.children.filter(e=>e.domIndex!==void 0&&e.domIndex>t).reduce((e,i)=>!e||i.domIndexthis.removeListener(t,e)}removeListener(t,e){ao.isHTMLEvent(t)?this.htmlListener?.remove(t,this,e):this.htmlListener!=null&&this.internalListener?.remove(t,this,e)}setDragTouchEnabled(t){this.internalListener??(this.internalListener=new bI(this.onDispatch.bind(this))),this.internalListener.dragTouchEnabled=t}onDispatch(t,e){if(!e.sourceEvent.bubbles)return;let{parent:i}=this;for(;i!=null;){const{internalListener:s}=i;if(s!=null){const n={...e,...ao.calcCurrentXY(i.getElement(),e)};s.dispatch(t,i,n)}i=i.parent}}static addWindowEvent(t,e){const i=s=>{s.persisted||e()};return ae().addEventListener("pagehide",i),()=>ae().removeEventListener("pagehide",i)}}}}),Km,SI,kw,Lw=I({"packages/ag-charts-community/src/chart/layout/layoutManager.ts"(){"use strict";ot(),Rt(),Km=(t=>(t[t.Caption=0]="Caption",t[t.Legend=1]="Legend",t[t.ToolbarLeft=2]="ToolbarLeft",t[t.ToolbarBottom=3]="ToolbarBottom",t[t.Navigator=4]="Navigator",t[t.Overlay=5]="Overlay",t))(Km||{}),SI=class{constructor(){this.events=new jy,this.elements=new Map}addListener(t,e){return this.events.on(t,e)}registerElement(t,e){return this.elements.has(t)?this.elements.get(t).add(e):this.elements.set(t,new Set([e])),()=>this.elements.get(t)?.delete(e)}createContext(t,e){const i=new kw(t,e);for(const s of Object.values(Km))typeof s=="number"&&this.elements.get(s)?.forEach(n=>n(i));return i}emitLayoutComplete(t,e){const i="layout:complete",{width:s,height:n}=t;this.events.emit(i,{type:i,axes:e.axes??[],chart:{width:s,height:n},clipSeries:e.clipSeries??!1,series:e.series})}},kw=class{constructor(t,e){this.width=t,this.height=e,this.layoutBox=new ht(0,0,t,e)}}}}),mg,u5=I({"packages/ag-charts-community/src/chart/chartCaptions.ts"(){"use strict";ln(),mt(),Lc(),mg=class{constructor(){this.title=new te,this.subtitle=new te,this.footnote=new te}positionCaptions(t){const{title:e,subtitle:i,footnote:s}=this,n=t.layoutBox.height/10;if(e.enabled){const{spacing:a=i.enabled?te.SMALL_PADDING:te.LARGE_PADDING}=e;this.positionCaption("top",e,t.layoutBox,n),this.shrinkLayoutByCaption("top",e,t.layoutBox,a)}i.enabled&&(this.positionCaption("top",i,t.layoutBox,n),this.shrinkLayoutByCaption("top",i,t.layoutBox,i.spacing)),s.enabled&&(this.positionCaption("bottom",s,t.layoutBox,n),this.shrinkLayoutByCaption("bottom",s,t.layoutBox,s.spacing))}positionAbsoluteCaptions(t){const{title:e,subtitle:i,footnote:s}=this,{rect:n}=t.series;for(const a of[e,i,s])if(a.layoutStyle==="overlay"){if(a.textAlign==="left")a.node.x=n.x+a.padding;else if(a.textAlign==="right"){const o=a.node.getBBox();a.node.x=n.x+n.width-o.width-a.padding}}}computeX(t,e){return t==="left"?e.x:t==="right"?e.x+e.width:e.x+e.width/2}positionCaption(t,e,i,s){const n=Math.max(ge.getLineHeight(e.fontSize),s);e.node.x=this.computeX(e.textAlign,i)+e.padding,e.node.y=i.y+(t==="top"?0:i.height)+e.padding,e.node.textBaseline=t,e.computeTextWrap(i.width,n)}shrinkLayoutByCaption(t,e,i,s=0){if(e.layoutStyle==="block"){const n=e.node.getBBox();i.shrink(Math.ceil(t==="top"?n.y-i.y+n.height+s:i.y+i.height-n.y+s),t)}}},M([k(lt)],mg.prototype,"title",2),M([k(lt)],mg.prototype,"subtitle",2),M([k(lt)],mg.prototype,"footnote",2)}}),Tw,Cw,d5=I({"packages/ag-charts-community/src/api/preset/chartTypeOriginator.ts"(){"use strict";ot(),Tw=["candlestick","hollow-candlestick","ohlc","line","step-line","hlc","high-low"],Cw=class{constructor(t){this.chartService=t,this.mementoOriginatorKey="chartType"}createMemento(){let t=this.chartService.publicApi?.getOptions()?.chartType;return t==null&&(t="candlestick"),t}guardMemento(t){return t==null||Tw.includes(t)}restoreMemento(t,e,i){if(i==null)return;const s={chartType:i};this.chartService.publicApi?.updateDelta(s).catch(n=>et.error("error restoring state",n))}}}}),vI,Nw=I({"packages/ag-charts-community/src/util/destroy.ts"(){"use strict";vI=class{constructor(){this.destroyFns=[]}destroy(){this.destroyFns.forEach(t=>t()),this.destroyFns.length=0}setFns(t){this.destroy(),this.destroyFns=t}push(...t){this.destroyFns.push(...t)}}}}),zc,$m=I({"packages/ag-charts-community/src/version.ts"(){"use strict";zc="11.1.1"}}),MI,Ow,p5=I({"packages/ag-charts-community/src/api/state/historyManager.ts"(){"use strict";di(),Nw(),$m(),MI=Symbol("previous-memento-not-found"),Ow=class{constructor(t){this.history=[],this.historyIndex=-1,this.originators=new Map,this.clearState=new Map,this.maxHistoryLength=100,this.debug=Jt.create(!0,"history"),this.destroyFns=new vI,this.destroyFns.setFns([t.addListener("series-undo",this.undo.bind(this)),t.addListener("series-redo",this.redo.bind(this))])}destroy(){this.destroyFns.destroy()}addMementoOriginator(t){this.originators.set(t.mementoOriginatorKey,t),this.clearState.set(t.mementoOriginatorKey,t.createMemento()),this.debugEvent("History add originator:",t.mementoOriginatorKey)}clear(){this.debug("History clear:",Object.keys(this.originators)),this.history=[],this.historyIndex=-1;for(const[t,e]of this.originators.entries())this.clearState.set(t,e.createMemento())}record(t,...e){this.historyIndexthis.maxHistoryLength&&(this.history=this.history.slice(-this.maxHistoryLength));const i=new Map;for(const s of e){if(!this.originators.has(s.mementoOriginatorKey))throw new Error(`Originator [${s.mementoOriginatorKey}] has not been added to the HistoryManager.`);i.set(s.mementoOriginatorKey,s.createMemento())}this.history.push({label:t,mementos:i}),this.historyIndex=this.history.length-1,this.debugEvent(`History record: [${t}]`)}undo(){const t=this.history[this.historyIndex];if(t){for(const e of t.mementos.keys()){const i=this.findPreviousMemento(e);if(i===MI)throw new Error(`Could not find previous memento for [${e}].`);this.restoreMemento(e,i)}this.historyIndex-=1,this.debugEvent(`History undo: [${t.label}]`)}}redo(){const t=this.history[this.historyIndex+1];if(t){for(const[e,i]of t.mementos.entries())this.restoreMemento(e,i);this.historyIndex+=1,this.debugEvent(`History redo: [${t.label}]`)}}findPreviousMemento(t){for(let e=this.historyIndex-1;e>=0;e--)if(this.history[e].mementos.has(t))return this.history[e].mementos.get(t);return this.clearState.has(t)?this.clearState.get(t):MI}restoreMemento(t,e){this.originators.get(t)?.restoreMemento(zc,zc,e)}debugEvent(...t){this.debug(...t,this.history.map((e,i)=>i===this.historyIndex?`** ${e.label} **`:e.label))}}}}),II,ww=I({"packages/ag-charts-community/src/api/state/memento.ts"(){"use strict";ot(),II=class ON{constructor(e){this.version=e.split("-")[0]}save(...e){const i={version:this.version};for(const s of Object.values(e))i[s.mementoOriginatorKey]=this.encode(s,s.createMemento());return i}restore(e,...i){if(typeof e!="object"){et.warnOnce(`Could not restore data of type [${typeof e}], expecting an object, ignoring.`);return}if(e==null){et.warnOnce("Could not restore data of type [null], expecting an object, ignoring.");return}if(!("version"in e)||typeof e.version!="string"){et.warnOnce("Could not restore data, missing [version] string in object, ignoring.");return}for(const s of i){const n=this.decode(s,e[s.mementoOriginatorKey]),a=[];if(!s.guardMemento(n,a)){const o=a.length>0?` ${a.join(` `)} `:"";et.warnOnce(`Could not restore [${s.mementoOriginatorKey}] data, value was invalid, ignoring.${o}`,n);return}s.restoreMemento(this.version,e.version,n)}}encode(e,i){try{return JSON.parse(JSON.stringify(i,ON.encodeTypes))}catch(s){throw new Error(`Failed to encode [${e.mementoOriginatorKey}] value [${s}].`,{cause:s})}}decode(e,i){if(i==null)return i;try{return JSON.parse(JSON.stringify(i),ON.decodeTypes)}catch(s){throw new Error(`Failed to decode [${e.mementoOriginatorKey}] value [${s}].`,{cause:s})}}static encodeTypes(e,i){return hu(this[e])?{__type:"date",value:this[e].toISOString()}:i}static decodeTypes(e,i){return bi(this[e])&&"__type"in this[e]&&this[e].__type==="date"?new Date(this[e].value):i}}}}),Ew,g5=I({"packages/ag-charts-community/src/api/state/stateManager.ts"(){"use strict";oe(),$m(),ww(),Ew=class{constructor(){this.caretaker=new II(zc),this.state=new Map}setState(t,e){pc(this.state.get(t.mementoOriginatorKey),e)||this.setStateAndRestore(t,e)}setStateAndRestore(t,e){this.state.set(t.mementoOriginatorKey,e),this.restoreState(t)}restoreState(t){const{caretaker:e,state:i}=this;if(!i.has(t.mementoOriginatorKey))return;const s=i.get(t.mementoOriginatorKey);e.restore({version:e.version,[t.mementoOriginatorKey]:s},t)}}}}),Rw,f5=I({"packages/ag-charts-community/src/styles.css"(){Rw=`.ag-charts-wrapper,.ag-charts-wrapper:after,.ag-charts-wrapper:before,.ag-charts-wrapper *,.ag-charts-wrapper *:after,.ag-charts-wrapper *:before{box-sizing:border-box}.ag-charts-wrapper{--align-items: center;--justify-content: center;position:relative;user-select:none;-webkit-user-select:none;-webkit-tap-highlight-color:rgba(0,0,0,0)}.ag-charts-wrapper--safe-horizontal{--justify-content: flex-start}.ag-charts-wrapper--safe-vertical{--align-items: flex-start}.ag-charts-tab-guard{width:0%;height:0%;position:absolute;pointer-events:none}.ag-charts-canvas-center{width:100%;height:100%;position:absolute;touch-action:auto;pointer-events:auto;display:flex;align-items:var(--align-items);justify-content:var(--justify-content)}.ag-charts-canvas-container,.ag-charts-canvas{position:relative;user-select:none;-webkit-user-select:none}.ag-charts-canvas-container>*,.ag-charts-canvas>*{display:block;pointer-events:none}.ag-charts-series-area{outline:none;pointer-events:auto;position:absolute}.ag-charts-swapchain{outline:none;opacity:0;pointer-events:none;position:absolute;width:100%;height:100%}.ag-charts-swapchain:focus-visible{opacity:1}.ag-charts-canvas-proxy,.ag-charts-canvas-overlay{inset:0;pointer-events:none;position:absolute;user-select:none;-webkit-user-select:none}.ag-charts-canvas-overlay>*{position:absolute;pointer-events:auto}.ag-charts-theme-default,.ag-charts-theme-default-dark{--ag-charts-accent-color: #2196f3;--ag-charts-background-color: #fff;--ag-charts-border-color: #dddddd;--ag-charts-foreground-color: #464646;--ag-charts-font-family: Verdana, sans-serif;--ag-charts-font-size: 12px;--ag-charts-font-weight: 400;--ag-charts-padding: 20px;--ag-charts-shadow-color: #00000080;--ag-charts-subtle-text-color: #8c8c8c;--ag-charts-text-color: #464646;--ag-charts-chrome-background-color: #fafafa;--ag-charts-chrome-font-family: Verdana, sans-serif;--ag-charts-chrome-font-size: 12px;--ag-charts-chrome-font-weight: 400;--ag-charts-chrome-subtle-text-color: #8c8c8c;--ag-charts-chrome-text-color: #181d1f;--ag-charts-input-background-color: #fff;--ag-charts-input-text-color: #464646;--ag-charts-crosshair-label-background-color: #fff;--ag-charts-crosshair-label-text-color: #464646;--ag-charts-spacing: 4px;--ag-charts-border-radius: 4px;--ag-charts-shadow: 0 2px 8px 0 color-mix(in srgb, black 8%, transparent);--ag-charts-focus-shadow: 0 0 0 3px var(--ag-charts-accent-color);--ag-charts-focus-color: color-mix(in srgb, var(--ag-charts-background-color), var(--ag-charts-accent-color) 12%);--ag-charts-input-border-color: var(--ag-charts-border-color);--ag-charts-input-border-radius: var(--ag-charts-border-radius);--ag-charts-input-focus-border-color: var(--ag-charts-accent-color);--ag-charts-input-focus-text-color: var(--ag-charts-accent-color);--ag-charts-input-disabled-background-color: color-mix( in srgb, var(--ag-charts-chrome-background-color), var(--ag-charts-foreground-color) 6% );--ag-charts-input-disabled-border-color: var(--ag-charts-border-color);--ag-charts-input-disabled-text-color: color-mix( in srgb, var(--ag-charts-chrome-background-color), var(--ag-charts-input-text-color) 50% );--ag-charts-input-placeholder-text-color: color-mix( in srgb, var(--ag-charts-input-background-color), var(--ag-charts-input-text-color) 60% );--ag-charts-button-background-color: var(--ag-charts-background-color);--ag-charts-button-border-color: var(--ag-charts-border-color);--ag-charts-button-border-radius: var(--ag-charts-border-radius);--ag-charts-button-text-color: var(--ag-charts-text-color);--ag-charts-button-focus-background-color: color-mix( in srgb, var(--ag-charts-button-background-color), var(--ag-charts-accent-color) 12% );--ag-charts-button-focus-border-color: var(--ag-charts-accent-color);--ag-charts-button-focus-text-color: var(--ag-charts-accent-color);--ag-charts-button-disabled-background-color: color-mix( in srgb, var(--ag-charts-chrome-background-color), var(--ag-charts-foreground-color) 6% );--ag-charts-button-disabled-border-color: var(--ag-charts-border-color);--ag-charts-button-disabled-text-color: color-mix( in srgb, var(--ag-charts-chrome-background-color), var(--ag-charts-chrome-text-color) 50% );--ag-charts-checkbox-background-color: color-mix( in srgb, var(--ag-charts-background-color), var(--ag-charts-foreground-color) 35% );--ag-charts-checkbox-checked-background-color: var(--ag-charts-accent-color);--ag-charts-chrome-font-size-small: var(--ag-charts-chrome-font-size);--ag-charts-chrome-font-size-medium: calc(var(--ag-charts-chrome-font-size) * (13 / 12));--ag-charts-chrome-font-size-large: calc(var(--ag-charts-chrome-font-size) * (14 / 12));--ag-charts-border: solid 1px var(--ag-charts-border-color);--ag-charts-focus-border: solid 1px var(--ag-charts-accent-color);--ag-charts-focus-border-shadow: 0 0 0 3px color-mix(in srgb, transparent, var(--ag-charts-accent-color) 20%);--ag-charts-layer-menu: 6;--ag-charts-layer-ui-overlay: 5;--ag-charts-layer-tooltip: 4;--ag-charts-layer-toolbar: 3;--ag-charts-layer-crosshair: 2;--ag-charts-layer-annotations: 1}.ag-charts-theme-default-dark{--ag-charts-shadow: 0 2px 12px 0 color-mix(in srgb, black 33.3%, transparent);--ag-charts-focus-color: color-mix(in srgb, var(--ag-charts-background-color), var(--ag-charts-accent-color) 22%)}.ag-chart-canvas-wrapper .ag-charts-theme-default{--ag-charts-border-radius: var(--ag-border-radius, 4px);--ag-charts-border: var(--ag-borders-critical, solid 1px) var(--ag-charts-border-color);--ag-charts-focus-shadow: var(--ag-focus-shadow, 0 0 0 3px var(--ag-charts-accent-color));--ag-charts-focus-border-shadow: var( --ag-focus-shadow, 0 0 0 3px color-mix(in srgb, transparent, var(--ag-charts-accent-color) 20%) )}.ag-charts-icon{display:block;width:20px;height:20px;speak:none;speak:never;mask:var(--icon) center / contain no-repeat;background-color:currentColor;transition:background-color .25s ease-in-out}.ag-charts-icon-align-center{--icon: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBmaWxsPSIjMDAwIiBkPSJNNyAxMGg2djFIN3pNNCA3aDEydjFINHptMSA2aDEwdjFINXoiLz48L3N2Zz4=)}.ag-charts-icon-align-left{--icon: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBmaWxsPSIjMDAwIiBkPSJNNCAxMGg2djFINHptMC0zaDEydjFINHptMCA2aDEwdjFINHoiLz48L3N2Zz4=)}.ag-charts-icon-align-right{--icon: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBmaWxsPSIjMDAwIiBkPSJNMTAgMTBoNnYxaC02ek00IDdoMTJ2MUg0em0yIDZoMTB2MUg2eiIvPjwvc3ZnPg==)}.ag-charts-icon-arrow-drawing{--icon: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTTE1LjI5MyA0LjVIMTIuNXYtMUgxN3Y0aC0xVjUuMjA3bC05LjY0NiA5LjY0Ny0uNzA4LS43MDh6IiBmaWxsPSIjMDAwIi8+PHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik03IDE2YTIuNSAyLjUgMCAxIDEtNSAwIDIuNSAyLjUgMCAwIDEgNSAwbS0yLjUgMS41YTEuNSAxLjUgMCAxIDAgMC0zIDEuNSAxLjUgMCAwIDAgMCAzIiBmaWxsPSIjMDAwIi8+PC9zdmc+)}.ag-charts-icon-arrow-down-drawing{--icon: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik02IDhMMS41IDhMMTAgMThMMTguNSA4TDE0IDhMMTQgM0w2IDNMNiA4Wk03IDRMNyA5SDMuNjYyNDRMMTAgMTYuNDU2TDE2LjMzNzYgOUwxMyA5TDEzIDRMNyA0WiIgZmlsbD0iYmxhY2siLz4KPC9zdmc+Cg==)}.ag-charts-icon-arrow-up-drawing{--icon: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0xNCAxMkgxOC41TDEwIDJMMS41IDEySDZMNi4wMDAwMiAxN0gxNFYxMlpNMTMgMTZWMTFIMTYuMzM3NkwxMCAzLjU0NDA1TDMuNjYyNDQgMTFIN0w3LjAwMDAyIDE2SDEzWiIgZmlsbD0iYmxhY2siLz4KPC9zdmc+Cg==)}.ag-charts-icon-callout-annotation{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzAwMCIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNMyA0LjVBMS41IDEuNSAwIDAgMSA0LjUgM2gxMUExLjUgMS41IDAgMCAxIDE3IDQuNXY4YTEuNSAxLjUgMCAwIDEtMS41IDEuNWgtNC41MTRhMjYgMjYgMCAwIDAtMi4wMTcgMS41NGwtLjMxNC4yNmMtLjU1LjQ1Ny0xLjExNS45MjYtMS43NiAxLjQtLjY2OS40OTEtMS41NjItLjAxMi0xLjU2Mi0uOFYxNEg0LjVBMS41IDEuNSAwIDAgMSAzIDEyLjV6TTQuNSA0YS41LjUgMCAwIDAtLjUuNXY4YS41LjUgMCAwIDAgLjUuNWgxLjgzM3YzLjM3MmEzNiAzNiAwIDAgMCAxLjY3OC0xLjMzOGwuMzItLjI2NWEyNiAyNiAwIDAgMSAyLjIyNS0xLjY4NWwuMTI2LS4wODRIMTUuNWEuNS41IDAgMCAwIC41LS41di04YS41LjUgMCAwIDAtLjUtLjV6IiBjbGlwLXJ1bGU9ImV2ZW5vZGQiLz48L3N2Zz4=)}.ag-charts-icon-candlestick-series{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzEzMTcyMiIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNNyAxdjNoMnYxMkg3djNINnYtM0g0VjRoMlYxek01IDVoM3YxMEg1ek0xMSAxNFY2aDJWMy4yNWgxVjZoMnY4aC0ydjIuNzVoLTFWMTR6bTEtN2gzdjZoLTN6IiBjbGlwLXJ1bGU9ImV2ZW5vZGQiLz48L3N2Zz4=)}.ag-charts-icon-close{--icon: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBkPSJtNSA1IDEwIDEwTTUgMTUgMTUgNSIgc3Ryb2tlPSIjMDAwIi8+PC9zdmc+)}.ag-charts-icon-comment-annotation{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzAwMCIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNNy41MTMgMy45OTVhNi41IDYuNSAwIDAgMSA2LjA5OCAxMS40MWMtLjU4OC4zOTMtMS4yMTcuNTM2LTEuODI5LjU4NWExMyAxMyAwIDAgMS0xLjI3LjAxN0EyNyAyNyAwIDAgMCAxMCAxNkg0LjVhLjUuNSAwIDAgMS0uNS0uNVYxMHEwLS4yNDctLjAwNy0uNTEzYy0uMDA4LS40MTYtLjAxNi0uODU3LjAxNy0xLjI2OS4wNS0uNjEyLjE5Mi0xLjI0LjU4NS0xLjgzYTYuNSA2LjUgMCAwIDEgMi45MTgtMi4zOTNtMy41Ni42MWE1LjUgNS41IDAgMCAwLTUuNjQ2IDIuMzRjLS4yNjYuMzk3LS4zNzkuODQyLS40MiAxLjM1NC0uMDMuMzYtLjAyMi43MTgtLjAxNSAxLjEwOFE1IDkuNjg5IDUgMTB2NWg1cS4zMTEuMDAxLjU5My4wMDhjLjM5LjAwNy43NDcuMDE1IDEuMTA4LS4wMTUuNTEyLS4wNDEuOTU3LS4xNTQgMS4zNTUtLjQyYTUuNSA1LjUgMCAwIDAtMS45ODMtOS45NjciIGNsaXAtcnVsZT0iZXZlbm9kZCIvPjwvc3ZnPg==)}.ag-charts-icon-crosshair-add-line{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzAwMCIgZD0iTTEwIDUuNWEuNS41IDAgMCAxIC41LjV2My41aDMuODc1YS41LjUgMCAwIDEgMCAxSDEwLjV2NC4yNWEuNS41IDAgMSAxLTEgMFYxMC41SDUuNjI1YS41LjUgMCAxIDEgMC0xSDkuNVY2YS41LjUgMCAwIDEgLjUtLjUiLz48L3N2Zz4=)}.ag-charts-icon-date-range-drawing{--icon: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBkPSJNMiAyaDF2MTZIMnptMTUgMGgxdjE2aC0xeiIgZmlsbD0iIzE4MUQxRiIvPjxwYXRoIGQ9Ik0xMy4xNTcgMTFINXYtMWg3Ljc5M0wxMSA4LjIwN2wuNzA3LS43MDcgMy4xODIgMy4xODItMy4xODIgMy4xODItLjcwNy0uNzA3eiIgZmlsbD0iIzAwMCIvPjwvc3ZnPg==)}.ag-charts-icon-date-price-range-drawing{--icon: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBkPSJNMyAySDJ2MTZoMXptMy41MDcgNC44OUw4LjUgNC44OTVWMTBINXYxaDMuNXY3aDF2LTdoNS4wODhsLTEuOTU3IDEuOTU3LjcwNy43MDcgMy4xODItMy4xODJMMTMuMzM4IDcuM2wtLjcwNy43MDdMMTQuNjI0IDEwSDkuNVY0LjkzMmwxLjk1NyAxLjk1Ny43MDctLjcwN0w4Ljk4MiAzIDUuOCA2LjE4MnoiIGZpbGw9IiMxODFEMUYiLz48L3N2Zz4=)}.ag-charts-icon-delete{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzEzMTcyMiIgZD0iTTguNDk2IDguOTk2QS41LjUgMCAwIDEgOSA5LjQ5MnY0YS41LjUgMCAxIDEtMSAuMDA4di00YS41LjUgMCAwIDEgLjQ5Ni0uNTA0TTEyIDkuNWEuNS41IDAgMCAwLTEgMHY0YS41LjUgMCAwIDAgMSAweiIvPjxwYXRoIGZpbGw9IiMxMzE3MjIiIGZpbGwtcnVsZT0iZXZlbm9kZCIgZD0iTTYgNVYzLjVBMi41IDIuNSAwIDAgMSA4LjUgMWgzQTIuNSAyLjUgMCAwIDEgMTQgMy41VjVoMi44MzNhLjUuNSAwIDAgMSAwIDFIMTV2MTAuMjVjMCAuNDE1LS4wNjYuODYzLS4zIDEuMjIxLS4yNTcuMzk0LS42NzIuNjEyLTEuMi42MTJoLTdjLS41MjggMC0uOTQzLS4yMTgtMS4yLS42MTItLjIzNC0uMzU4LS4zLS44MDYtLjMtMS4yMjFWNkgzLjMzM2EuNS41IDAgMCAxIDAtMXptMS0xLjVBMS41IDEuNSAwIDAgMSA4LjUgMmgzQTEuNSAxLjUgMCAwIDEgMTMgMy41VjVIN3pNNiAxNi4yNVY2aDh2MTAuMjVjMCAuMzM1LS4wNTkuNTU0LS4xMzguNjc1LS4wNTUuMDg1LS4xNC4xNTgtLjM2Mi4xNThoLTdjLS4yMjIgMC0uMzA3LS4wNzMtLjM2Mi0uMTU4LS4wOC0uMTIxLS4xMzgtLjM0LS4xMzgtLjY3NSIgY2xpcC1ydWxlPSJldmVub2RkIi8+PC9zdmc+)}.ag-charts-icon-disjoint-channel,.ag-charts-icon-disjoint-channel-drawing{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzEzMTcyMiIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNMTkuMDI4IDE3LjQ2YTIuMjUgMi4yNSAwIDAgMC00LjA5Mi0xLjg1bC05LjUxMS0yLjM3OGEyLjI1IDIuMjUgMCAxIDAtLjIyNS45NzRsOS40NzUgMi4zNjlhMi4yNTEgMi4yNTEgMCAwIDAgNC4zNTMuODg2bS0xLjY2Mi0xLjk2NWExLjI1IDEuMjUgMCAxIDEtLjg4NSAyLjMzOCAxLjI1IDEuMjUgMCAwIDEgLjg4NS0yLjMzOE00LjM0MyAxMy42NjlhMS4yNSAxLjI1IDAgMSAwLTIuMzM4LS44ODUgMS4yNSAxLjI1IDAgMCAwIDIuMzM4Ljg4NU0zLjk3IDguNzY5YTIuMjUgMi4yNSAwIDAgMCAxLjQ1NS0yLjExbDkuNTExLTIuMzc4YTIuMjUgMi4yNSAwIDEgMC0uMjYtLjk2NUw1LjIgNS42ODVhMi4yNSAyLjI1IDAgMSAwLTEuMjMgMy4wODRtLjM3My0yLjU0N2ExLjI1IDEuMjUgMCAxIDEtMi4zMzguODg1IDEuMjUgMS4yNSAwIDAgMSAyLjMzOC0uODg1bTEzLjc1LTMuNDM4YTEuMjUgMS4yNSAwIDEgMS0yLjMzOC44ODUgMS4yNSAxLjI1IDAgMCAxIDIuMzM4LS44ODUiIGNsaXAtcnVsZT0iZXZlbm9kZCIvPjwvc3ZnPg==)}.ag-charts-icon-drag-handle{--icon: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48Y2lyY2xlIGN4PSI1Ljc1IiBjeT0iNy43NSIgcj0iLjc1IiBmaWxsPSIjMDAwIiBmaWxsLW9wYWNpdHk9Ii41Ii8+PGNpcmNsZSBjeD0iOS43NSIgY3k9IjcuNzUiIHI9Ii43NSIgZmlsbD0iIzAwMCIgZmlsbC1vcGFjaXR5PSIuNSIvPjxjaXJjbGUgY3g9IjEzLjc1IiBjeT0iNy43NSIgcj0iLjc1IiBmaWxsPSIjMDAwIiBmaWxsLW9wYWNpdHk9Ii41Ii8+PGNpcmNsZSBjeD0iMTMuNzUiIGN5PSIxMS43NSIgcj0iLjc1IiBmaWxsPSIjMDAwIiBmaWxsLW9wYWNpdHk9Ii41Ii8+PGNpcmNsZSBjeD0iOS43NSIgY3k9IjExLjc1IiByPSIuNzUiIGZpbGw9IiMwMDAiIGZpbGwtb3BhY2l0eT0iLjUiLz48Y2lyY2xlIGN4PSI1Ljc1IiBjeT0iMTEuNzUiIHI9Ii43NSIgZmlsbD0iIzAwMCIgZmlsbC1vcGFjaXR5PSIuNSIvPjwvc3ZnPg==)}.ag-charts-icon-fibonacci-retracement-drawing{--icon: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBmaWxsPSIjMDAwIiBkPSJNMiA1aDEydjFIMnoiLz48Y2lyY2xlIGN4PSIxNS43NSIgY3k9IjUuNSIgcj0iMS43NSIgc3Ryb2tlPSIjMDAwIi8+PGNpcmNsZSBjeD0iNC4yNSIgY3k9IjE0LjUiIHI9IjEuNzUiIHN0cm9rZT0iIzAwMCIvPjxwYXRoIGZpbGw9IiMwMDAiIGQ9Ik0xOCAxNUg2di0xaDEyem0wLTQuNUgydi0xaDE2eiIvPjwvc3ZnPg==)}.ag-charts-icon-fibonacci-retracement-trend-based-drawing{--icon: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBmaWxsPSIjMDAwIiBkPSJtNC45OTYgMTIuNjc0IDMuMjkxLTUuNzQzLjg2OC40OTctMy4yOTEgNS43NDN6Ii8+PGNpcmNsZSBjeD0iOS43NSIgY3k9IjUuNSIgcj0iMS43NSIgc3Ryb2tlPSIjMDAwIi8+PGNpcmNsZSBjeD0iNC4zNTEiIGN5PSIxNC41IiByPSIxLjc1IiBzdHJva2U9IiMwMDAiLz48cGF0aCBmaWxsPSIjMDAwIiBkPSJNMTggNmgtN1Y1aDd6bTAgNC41aC03di0xaDd6bTAgNC41SDZ2LTFoMTJ6Ii8+PC9zdmc+)}.ag-charts-icon-fill-color{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzAwMCIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJtOC4wNzEgNC4wNi0uOTI0LS45MjQuNzA3LS43MDcgNy4yODggNy4yODgtNC45NSA0Ljk1YTMuNSAzLjUgMCAwIDEtNC45NSAwbC0xLjQxNC0xLjQxNGEzLjUgMy41IDAgMCAxIDAtNC45NXptLjcwNy43MDhMNC41MzYgOS4wMWEyLjUgMi41IDAgMCAwIDAgMy41MzZMNS45NSAxMy45NmEyLjUgMi41IDAgMCAwIDMuNTM1IDBsNC4yNDMtNC4yNDN6bTYuOSA3LjIwMi0uMzQ1LjM2My0uMzQ0LS4zNjNhLjUuNSAwIDAgMSAuNjg4IDBtLS4zNDUgMS4wOGE4IDggMCAwIDAtLjI4LjMyMyA0LjMgNC4zIDAgMCAwLS40MDkuNTgyYy0uMTEzLjIwMS0uMTQ0LjMyNi0uMTQ0LjM3OGEuODMzLjgzMyAwIDAgMCAxLjY2NyAwYzAtLjA1Mi0uMDMxLS4xNzctLjE0NC0uMzc4YTQuMyA0LjMgMCAwIDAtLjQxLS41ODIgOCA4IDAgMCAwLS4yOC0uMzIybS0uMzQ0LTEuMDguMzQ0LjM2My4zNDQtLjM2My4wMDIuMDAyLjAwNC4wMDQuMDEzLjAxMmE2IDYgMCAwIDEgLjIwNi4yMDhjLjEzMS4xMzYuMzA4LjMyNy40ODUuNTQ1LjE3Ni4yMTUuMzYzLjQ2Ny41MDcuNzI0LjEzNy4yNDMuMjczLjU1My4yNzMuODY4YTEuODMzIDEuODMzIDAgMSAxLTMuNjY3IDBjMC0uMzE1LjEzNi0uNjI1LjI3My0uODY4LjE0NC0uMjU3LjMzLS41MDkuNTA3LS43MjRhOSA5IDAgMCAxIC42NDUtLjcwOGwuMDQ2LS4wNDUuMDEzLS4wMTIuMDA0LS4wMDR6IiBjbGlwLXJ1bGU9ImV2ZW5vZGQiLz48L3N2Zz4=)}.ag-charts-icon-hollow-candlestick-series{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzEzMTcyMiIgZmlsbC1vcGFjaXR5PSIuMTUiIGQ9Ik01IDVoM3YxMEg1eiIvPjxwYXRoIGZpbGw9IiMxMzE3MjIiIGZpbGwtcnVsZT0iZXZlbm9kZCIgZD0iTTcgMXYzaDJ2MTJIN3YzSDZ2LTNINFY0aDJWMXpNNSA1aDN2MTBINXptNyAyaDN2NmgtM3ptLTEgN1Y2aDJWMy4yNWgxVjZoMnY4aC0ydjIuNzVoLTFWMTR6IiBjbGlwLXJ1bGU9ImV2ZW5vZGQiLz48L3N2Zz4=)}.ag-charts-icon-horizontal-line,.ag-charts-icon-horizontal-line-drawing{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzEzMTcyMiIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNLjUgOS41aDcuMzA2YTIuMjUgMi4yNSAwIDAgMSA0LjM4OCAwSDE5LjV2MWgtNy4zMDZhMi4yNSAyLjI1IDAgMCAxLTQuMzg4IDBILjV6bTkuNSAxLjc1YTEuMjUgMS4yNSAwIDEgMCAwLTIuNSAxLjI1IDEuMjUgMCAwIDAgMCAyLjUiIGNsaXAtcnVsZT0iZXZlbm9kZCIvPjwvc3ZnPg==)}.ag-charts-icon-line-color{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzAwMCIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNMTQuMjQyIDIuNzIyYy0uNjEyIDAtMS4yLjI0My0xLjYzMi42NzVsLTEuMzQzIDEuMzQ0YS41LjUgMCAwIDAtLjExMi4xMTJMNC4wNSAxMS45NTljLS4yMDcuMjA3LS4zNi40Ni0uNDQ2Ljc0di4wMDFsLS42OSAyLjc2N3YuMDAyYS44Mi44MiAwIDAgMCAxLjAyMiAxLjAyMWguMDAybDIuNjM0LS44MjJjLjI4LS4wODUuNTM0LS4yMzcuNzQtLjQ0M2w3LjEwNy03LjEwOGEuNS41IDAgMCAwIC4xMTItLjExMmwxLjM0My0xLjM0M2EyLjMwOCAyLjMwOCAwIDAgMC0xLjYzMi0zLjk0TTE0LjEyMiA3bDEuMDQ0LTEuMDQ1YTEuMzA4IDEuMzA4IDAgMSAwLTEuODQ5LTEuODVMMTIuMjcxIDUuMTV6bS0yLjU1OC0xLjE0Mi02LjgwNyA2LjgwOWEuOC44IDAgMCAwLS4xOTYuMzI1bC0uNzUgMi40NjggMi40Ny0uNzQ5YS44LjggMCAwIDAgLjMyNS0uMTk0bDYuODA4LTYuODF6IiBjbGlwLXJ1bGU9ImV2ZW5vZGQiLz48L3N2Zz4=)}.ag-charts-icon-line-series{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzEzMTcyMiIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJtMTcuMzYyIDQuODczLTQuNTk0IDYuNjU0LTQuODUtMy4zMTctNC4yNTEgNi45NzctLjg1NC0uNTJMNy42MTIgNi43OWw0Ljg5OSAzLjM1IDQuMDI4LTUuODM2eiIgY2xpcC1ydWxlPSJldmVub2RkIi8+PC9zdmc+)}.ag-charts-icon-line-style-dashed{--icon: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBmaWxsPSIjMDAwIiBkPSJNMiA5aDR2MUgyem0xMiAwaDR2MWgtNHpNOCA5aDR2MUg4eiIvPjwvc3ZnPg==)}.ag-charts-icon-line-style-dotted{--icon: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48Y2lyY2xlIGN4PSIyLjUiIGN5PSI5LjUiIHI9Ii41IiBmaWxsPSIjMDAwIi8+PGNpcmNsZSBjeD0iNC41IiBjeT0iOS41IiByPSIuNSIgZmlsbD0iIzAwMCIvPjxjaXJjbGUgY3g9IjYuNSIgY3k9IjkuNSIgcj0iLjUiIGZpbGw9IiMwMDAiLz48Y2lyY2xlIGN4PSI4LjUiIGN5PSI5LjUiIHI9Ii41IiBmaWxsPSIjMDAwIi8+PGNpcmNsZSBjeD0iMTAuNSIgY3k9IjkuNSIgcj0iLjUiIGZpbGw9IiMwMDAiLz48Y2lyY2xlIGN4PSIxMi41IiBjeT0iOS41IiByPSIuNSIgZmlsbD0iIzAwMCIvPjxjaXJjbGUgY3g9IjE0LjUiIGN5PSI5LjUiIHI9Ii41IiBmaWxsPSIjMDAwIi8+PGNpcmNsZSBjeD0iMTYuNSIgY3k9IjkuNSIgcj0iLjUiIGZpbGw9IiMwMDAiLz48L3N2Zz4=)}.ag-charts-icon-line-style-solid{--icon: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBmaWxsPSIjMDAwIiBkPSJNMiA5aDE2djFIMnoiLz48L3N2Zz4=)}.ag-charts-icon-line-with-markers-series{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzEzMTcyMiIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJtMTguMTk4IDQuODg4LTMuNTU2IDQuOTE4YTIuMjUgMi4yNSAwIDEgMS0zLjg2Ni43NWwtMS40MzItLjlhMi4yNCAyLjI0IDAgMCAxLTIuMDA5LjQzNWwtMy44MjggNi40MjgtLjg2LS41MTJMNi40NSA5LjYyM2EyLjI1IDIuMjUgMCAxIDEgMy41MS0uNzYxbDEuMzI5LjgzNWEyLjI0IDIuMjQgMCAwIDEgMi41NTctLjQ5N2wzLjU0Mi00Ljg5OHptLTQuOTYgNS4xNTNhMS4yNSAxLjI1IDAgMSAwLS42NCAyLjQxOSAxLjI1IDEuMjUgMCAwIDAgLjY0LTIuNDE5TTkuMSA4LjMyMXEuMDY2LS4xOTIuMDY3LS40MDRhMS4yNSAxLjI1IDAgMSAwLS4wNjcuNDA0IiBjbGlwLXJ1bGU9ImV2ZW5vZGQiLz48L3N2Zz4=)}.ag-charts-icon-lock,.ag-charts-icon-locked{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzAwMCIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNMTAuMjA3IDMuNzY0YTIuODk0IDIuODk0IDAgMCAwLTIuODk1IDIuODk0VjloNS43ODlWNi42NThhMi44OTQgMi44OTQgMCAwIDAtMi44OTUtMi44OTRNMTQuMSA5VjYuNjU4YTMuODk0IDMuODk0IDAgMSAwLTcuNzg5IDB2Mi4zNDlBMi41IDIuNSAwIDAgMCA0IDExLjV2M0EyLjUgMi41IDAgMCAwIDYuNSAxN2g4YTIuNSAyLjUgMCAwIDAgMi41LTIuNXYtM0EyLjUgMi41IDAgMCAwIDE0LjUgOXpNNi41IDEwQTEuNSAxLjUgMCAwIDAgNSAxMS41djNBMS41IDEuNSAwIDAgMCA2LjUgMTZoOGExLjUgMS41IDAgMCAwIDEuNS0xLjV2LTNhMS41IDEuNSAwIDAgMC0xLjUtMS41eiIgY2xpcC1ydWxlPSJldmVub2RkIi8+PC9zdmc+)}.ag-charts-icon-measurer-drawing{--icon: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0ibTQuNDYxIDEyLjcxIDEuNTMyLTEuNTMxIDEuNDE0IDEuNDE0LjcwNy0uNzA3TDYuNyAxMC40NzJsMS41MzItMS41MzMgMiAyIC43MDctLjcwNy0yLTIgNi4wMS02LjAxIDIuODMgMi44MjhMNS4wNSAxNy43NzggMi4yMjIgMTQuOTVsMS41MzItMS41MzIgMS40MTQgMS40MTQuNzA3LS43MDd6TS44MDggMTQuOTVsLjcwNy0uNzA3TDE0LjI0MyAxLjUxNWwuNzA3LS43MDcuNzA3LjcwNyAyLjgyOCAyLjgyOC43MDcuNzA3LS43MDcuNzA3TDUuNzU3IDE4LjQ4NWwtLjcwNy43MDctLjcwNy0uNzA3LTIuODI4LTIuODI4em0xMS4wNzgtNi44MzVMMTAuNDcgNi43bC43MDctLjcwNyAxLjQxNSAxLjQxNHptLjgyNC0zLjY1NCAxIDEgLjcwOC0uNzA3LTEtMXoiIGZpbGw9IiMxODFEMUYiLz48L3N2Zz4=)}.ag-charts-icon-note-annotation{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzAwMCIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNMyA0LjVBMS41IDEuNSAwIDAgMSA0LjUgM2gxMUExLjUgMS41IDAgMCAxIDE3IDQuNXY4YTEuNSAxLjUgMCAwIDEtMS41IDEuNWgtMy4yMWwtMS40NjkgMi41N2ExIDEgMCAwIDEtMS42ODIuMDg1TDcuMjQzIDE0SDQuNUExLjUgMS41IDAgMCAxIDMgMTIuNXpNNC41IDRhLjUuNSAwIDAgMC0uNS41djhhLjUuNSAwIDAgMCAuNS41aDMuMjU3bDIuMTk2IDMuMDc0TDExLjcxIDEzaDMuNzlhLjUuNSAwIDAgMCAuNS0uNXYtOGEuNS41IDAgMCAwLS41LS41eiIgY2xpcC1ydWxlPSJldmVub2RkIi8+PHBhdGggZmlsbD0iIzAwMCIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNNi41IDYuNUEuNS41IDAgMCAxIDcgNmg2YS41LjUgMCAwIDEgMCAxSDdhLjUuNSAwIDAgMS0uNS0uNU02LjUgOS41QS41LjUgMCAwIDEgNyA5aDZhLjUuNSAwIDAgMSAwIDFIN2EuNS41IDAgMCAxLS41LS41IiBjbGlwLXJ1bGU9ImV2ZW5vZGQiLz48L3N2Zz4=)}.ag-charts-icon-ohlc-series{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzEzMTcyMiIgZD0iTTEzIDExaC0zdi0xaDNWM2gxdjJoNHYxaC00djExaC0xek02IDE3di0yaDN2LTFINlY0SDV2MUgydjFoM3YxMXoiLz48L3N2Zz4=)}.ag-charts-icon-pan-end{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzAwMCIgZD0ibTYuNjQ2IDEzLjgxMy0uMzUzLjM1NC43MDcuNzA3LjM1NC0uMzU0ek0xMS4xNjYgMTBsLjM1NC4zNTQuMzU0LS4zNTQtLjM1NC0uMzU0ek03LjM1NSA1LjQ4IDcgNS4xMjZsLS43MDcuNzA3LjM1My4zNTR6bTAgOS4wNCA0LjE2Ni00LjE2Ni0uNzA3LS43MDgtNC4xNjcgNC4xNjd6bTQuMTY2LTQuODc0TDcuMzU0IDUuNDhsLS43MDguNzA3IDQuMTY3IDQuMTY3ek0xMy4wODMgNXYxMGgxVjV6Ii8+PC9zdmc+)}.ag-charts-icon-pan-left{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzAwMCIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNMTIuNzkgNS44MzMgOC42MjUgMTBsNC4xNjYgNC4xNjctLjcwNy43MDdMNy4yMSAxMGw0Ljg3My00Ljg3NHoiIGNsaXAtcnVsZT0iZXZlbm9kZCIvPjwvc3ZnPg==)}.ag-charts-icon-pan-right{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzAwMCIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNNy4yMSAxNC4xNjcgMTEuMzc2IDEwIDcuMjEgNS44MzNsLjcwNy0uNzA3TDEyLjc5IDEwbC00Ljg3MyA0Ljg3NHoiIGNsaXAtcnVsZT0iZXZlbm9kZCIvPjwvc3ZnPg==)}.ag-charts-icon-pan-start{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzAwMCIgZD0iTTYgNXYxMGgxVjV6TTkuNjI0IDEwbDQuMTY2LTQuMTY3LS43MDctLjcwN0w4LjIxIDEwbDQuODc0IDQuODc0LjcwNy0uNzA3eiIvPjwvc3ZnPg==)}.ag-charts-icon-parallel-channel,.ag-charts-icon-parallel-channel-drawing{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzEzMTcyMiIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNMTcuNzIgNS4zMzFBMi4yNSAyLjI1IDAgMSAwIDE0LjcwNSAzLjZsLTkuNDkgNC41NjJhMi4yNSAyLjI1IDAgMSAwIC4yMDkgMS4wMWw5LjY2Mi00LjY0NmEyLjI1IDIuMjUgMCAwIDAgMi42MzQuODA1bS4zNzMtMi41NDdhMS4yNSAxLjI1IDAgMSAxLTIuMzM4Ljg4NSAxLjI1IDEuMjUgMCAwIDEgMi4zMzgtLjg4NU00LjM0MyA4LjY3YTEuMjUgMS4yNSAwIDEgMS0yLjMzOC44ODUgMS4yNSAxLjI1IDAgMCAxIDIuMzM4LS44ODVNNS4zMDcgMTYuNzI4YTIuMjUgMi4yNSAwIDEgMS0uNTI1LS44NThsOS45MjMtNC43N2EyLjI1IDIuMjUgMCAxIDEgLjM4MS45MjZ6bS0uOTY0LjI3NGExLjI1IDEuMjUgMCAxIDEtMi4zMzguODg1IDEuMjUgMS4yNSAwIDAgMSAyLjMzOC0uODg1bTEzLjAyMy01LjEwNmExLjI1IDEuMjUgMCAxIDAtLjg4NS0yLjMzOSAxLjI1IDEuMjUgMCAwIDAgLjg4NSAyLjMzOSIgY2xpcC1ydWxlPSJldmVub2RkIi8+PC9zdmc+)}.ag-charts-icon-position-bottom{--icon: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBmaWxsPSIjMDAwIiBmaWxsLW9wYWNpdHk9Ii4yNSIgZD0iTTMgMTBoMTR2MUgzem0zLTNoOHYxSDZ6Ii8+PHBhdGggZmlsbD0iIzAwMCIgZD0iTTYgMTNoOHYxSDZ6Ii8+PC9zdmc+)}.ag-charts-icon-position-center{--icon: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBmaWxsPSIjMDAwIiBkPSJNMyAxMGgxNHYxSDN6Ii8+PHBhdGggZmlsbD0iIzAwMCIgZmlsbC1vcGFjaXR5PSIuMjUiIGQ9Ik02IDdoOHYxSDZ6bTAgNmg4djFINnoiLz48L3N2Zz4=)}.ag-charts-icon-position-top{--icon: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBmaWxsPSIjMDAwIiBmaWxsLW9wYWNpdHk9Ii4yNSIgZD0iTTMgMTBoMTR2MUgzeiIvPjxwYXRoIGZpbGw9IiMwMDAiIGQ9Ik02IDdoOHYxSDZ6Ii8+PHBhdGggZmlsbD0iIzAwMCIgZmlsbC1vcGFjaXR5PSIuMjUiIGQ9Ik02IDEzaDh2MUg2eiIvPjwvc3ZnPg==)}.ag-charts-icon-price-label-annotation{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzAwMCIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNNC41IDNBMS41IDEuNSAwIDAgMCAzIDQuNVYxM2ExLjUgMS41IDAgMCAwIDEuNSAxLjVoLjgzM3YuMDU3Yy4yNDItLjI5OS41OTctLjUwMyAxLS41NDhWMTMuNUg0LjVBLjUuNSAwIDAgMSA0IDEzVjQuNWEuNS41IDAgMCAxIC41LS41aDExYS41LjUgMCAwIDEgLjUuNXY4YS41LjUgMCAwIDEtLjUuNWgtNC44MThsLS4xMjYuMDg0YTI2IDI2IDAgMCAwLTIuMjI1IDEuNjg1bC0uMzIuMjY1LS4wNjguMDU2YTEuNSAxLjUgMCAwIDEtMi42MDkgMS4zNTRjLjAzMy43NjMuOTA1IDEuMjM4IDEuNTYuNzU2LjY0Ni0uNDc0IDEuMjEtLjk0MyAxLjc2MS0xLjRsLjMxMy0uMjZBMjYgMjYgMCAwIDEgMTAuOTg2IDE0SDE1LjVhMS41IDEuNSAwIDAgMCAxLjUtMS41di04QTEuNSAxLjUgMCAwIDAgMTUuNSAzeiIgY2xpcC1ydWxlPSJldmVub2RkIi8+PHBhdGggZmlsbD0iIzEzMTcyMiIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNOC43MTYgMTQuODE1YTIuMjUgMi4yNSAwIDEgMS00LjIxIDEuNTkzIDIuMjUgMi4yNSAwIDAgMSA0LjIxLTEuNTkzbS0xLjY2MiAxLjk2NmExLjI1IDEuMjUgMCAxIDAtLjg4NS0yLjMzOSAxLjI1IDEuMjUgMCAwIDAgLjg4NSAyLjMzOSIgY2xpcC1ydWxlPSJldmVub2RkIi8+PC9zdmc+)}.ag-charts-icon-price-range-drawing{--icon: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBkPSJNOS4wNDYgMTVWNS44NzdoLjk0MlYxNXoiIGZpbGw9IiMxODFEMUYiLz48cGF0aCBkPSJNOS4wNDYgMTVWNS44NzdoLjk0MlYxNXoiIGZpbGw9IiMxODFEMUYiLz48cGF0aCBkPSJNOS41IDYuMjI4IDcuMTY3IDguMzc2IDYuNSA3Ljc2MiA5LjUgNWwzIDIuNzYyLS42NjcuNjE0eiIgZmlsbD0iIzAwMCIvPjxwYXRoIGQ9Ik0yIDE4di0xaDE2djF6TTIgM1YyaDE2djF6IiBmaWxsPSIjMTgxRDFGIi8+PC9zdmc+)}.ag-charts-icon-reset{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzAwMCIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNMTIuMDQgNC40NDVhNS44MSA1LjgxIDAgMCAwLTcuMjU3IDIuNDUzLjUuNSAwIDAgMS0uODY1LS41MDJBNi44MSA2LjgxIDAgMSAxIDMgOS44MTNhLjUuNSAwIDAgMSAxIDAgNS44MSA1LjgxIDAgMSAwIDguMDQtNS4zNjgiIGNsaXAtcnVsZT0iZXZlbm9kZCIvPjxwYXRoIGZpbGw9IiMwMDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIgZD0iTTQuMjg5IDMuMDAyYS41LjUgMCAwIDEgLjUuNXYyLjY1NWgyLjY1NWEuNS41IDAgMCAxIDAgMUg0LjI5YS41LjUgMCAwIDEtLjUtLjVWMy41MDJhLjUuNSAwIDAgMSAuNS0uNSIgY2xpcC1ydWxlPSJldmVub2RkIi8+PC9zdmc+)}.ag-charts-icon-settings{--icon: url(data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgMjAgMjAiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSIgc3R5bGU9ImZpbGwtcnVsZTpldmVub2RkIj48cGF0aCBkPSJNMTAgMTNhMyAzIDAgMSAwIDAtNiAzIDMgMCAwIDAgMCA2bTAtMWEyIDIgMCAxIDEtLjAwMS0zLjk5OUEyIDIgMCAwIDEgMTAgMTIiLz48cGF0aCBkPSJNMi4zMSAxNC4zNDVjLS44MTctMS40OTEuMDI3LTIuNDk5LjQ3NC0yLjg2NS41MzEtLjQzNC45NjktLjM2NS45NzItMS40OC0uMDAzLTEuMTE1LS40NDEtMS4wNDYtLjk3Mi0xLjQ4MS0uNDU0LS4zNzEtMS4zMTctMS40MDUtLjQzNC0yLjkzNmwuMDA1LS4wMDljLjg4NC0xLjUyIDIuMjA3LTEuMjkgMi43NTUtMS4wODMuNjQxLjI0My44MDEuNjU2IDEuNzY4LjEwMS45NjQtLjU2LjY4Ni0uOTA0Ljc5Ni0xLjU4Mi4wOTQtLjU3OC41NTktMS44NDMgMi4zMjYtMS44NDNoLjAxYzEuNzU5LjAwNSAyLjIyMiAxLjI2NiAyLjMxNiAxLjg0My4xMS42NzgtLjE2OCAxLjAyMi43OTYgMS41ODIuOTY3LjU1NSAxLjEyNy4xNDIgMS43NjgtLjEwMS41NDktLjIwOCAxLjg3Ni0uNDM4IDIuNzYgMS4wOTJzLjAyIDIuNTY1LS40MzQgMi45MzZjLS41MzEuNDM1LS45NjkuMzY2LS45NzIgMS40ODEuMDAzIDEuMTE1LjQ0MSAxLjA0Ni45NzIgMS40OC40NTQuMzcyIDEuMzE3IDEuNDA2LjQzNCAyLjkzN2wtLjAwNS4wMDljLS44ODQgMS41Mi0yLjIwNyAxLjI5LTIuNzU1IDEuMDgzLS42NDEtLjI0My0uODAxLS42NTYtMS43NjgtLjEwMS0uOTY0LjU2LS42ODYuOTA0LS43OTYgMS41ODEtLjA5NC41NzktLjU1OSAxLjg0NC0yLjMyNiAxLjg0NGgtLjAxYy0xLjc1OS0uMDA1LTIuMjIyLTEuMjY2LTIuMzE2LTEuODQ0LS4xMS0uNjc3LjE2OC0xLjAyMS0uNzk2LTEuNTgxLS45NjctLjU1NS0xLjEyNy0uMTQyLTEuNzY4LjEwMS0uNTQ5LjIwOC0xLjg3Ni40MzgtMi43Ni0xLjA5MmwtLjAyLS4wMzZ6TTkuOTg0IDIuMTYySDEwYzEuMzU1IDAgMS4zNDIgMS4wMzkgMS4zNTMgMS40MjUuMDA4LjMxMi4wNCAxLjE2IDEuMjU5IDEuODcybC4wMTUuMDA4YzEuMjI1LjcgMS45NzYuMzA0IDIuMjUxLjE1NS4zMzctLjE4MyAxLjIyNi0uNzExIDEuOTAyLjQ0NWwuMDA4LjAxNGMuNjc4IDEuMTczLS4yMjkgMS42ODItLjU1OCAxLjg4NC0uMjY2LjE2My0uOTg0LjYxNS0uOTkxIDIuMDI3di4wMTZjLjAwNyAxLjQxMi43MjUgMS44NjQuOTkxIDIuMDI3LjMyOC4yMDEgMS4yMjkuNzA3LjU2NiAxLjg3bC0uMDA4LjAxNGMtLjY3NyAxLjE3NC0xLjU3MS42NDMtMS45MS40NTktLjI3NS0uMTQ5LTEuMDI2LS41NDUtMi4yNTEuMTU0bC0uMDE1LjAwOWMtMS4yMTkuNzEyLTEuMjUxIDEuNTYtMS4yNTkgMS44NzItLjAxMS4zODYuMDAyIDEuNDI1LTEuMzUzIDEuNDI1cy0xLjM0Mi0xLjAzOS0xLjM1My0xLjQyNWMtLjAwOC0uMzEyLS4wNC0xLjE2LTEuMjU5LTEuODcybC0uMDE1LS4wMDljLTEuMjI1LS42OTktMS45NzYtLjMwMy0yLjI1MS0uMTU0LS4zMzYuMTgzLTEuMjE5LjcwNi0xLjg5NC0uNDMybC0uMDE2LS4wMjdjLS42NzgtMS4xNzQuMjI5LTEuNjgyLjU1OC0xLjg4NC4yNjYtLjE2My45ODQtLjYxNS45OTEtMi4wMjd2LS4wMTZjLS4wMDctMS40MTItLjcyNS0xLjg2NC0uOTkxLTIuMDI3LS4zMjgtLjIwMS0xLjIyOS0uNzA3LS41NjYtMS44N2wuMDA4LS4wMTRjLjY3Ny0xLjE3NCAxLjU3MS0uNjQzIDEuOTEtLjQ1OS4yNzUuMTQ5IDEuMDI2LjU0NSAyLjI1MS0uMTU1bC4wMTUtLjAwOGMxLjIxOS0uNzEyIDEuMjUxLTEuNTYgMS4yNTktMS44NzIuMDEtLjM4NC0uMDAyLTEuNDE3IDEuMzM3LTEuNDI1Ii8+PC9zdmc+)}.ag-charts-icon-step-line-series{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzE4MUQxRiIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNNiA0aDV2OGgzVjhoNXYxaC00djRoLTVWNUg3djEwSDJ2LTFoNHoiIGNsaXAtcnVsZT0iZXZlbm9kZCIvPjwvc3ZnPg==)}.ag-charts-icon-text-annotation{--icon: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik00IDRIMTZWN0gxNVY1SDEwLjVWMTVIMTRWMTZINlYxNUg5LjVWNUg1VjdINFY0WiIgZmlsbD0iYmxhY2siLz4KPC9zdmc+Cg==)}.ag-charts-icon-trend-line,.ag-charts-icon-trend-line-drawing{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzEzMTcyMiIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNNS4zMTQgMTAuOTM4YTIuMjUgMi4yNSAwIDEgMSAuMDEtMWg5LjM1MmEyLjI1IDIuMjUgMCAxIDEgLjAxIDF6bS0yLjE4OS43MjlhMS4yNSAxLjI1IDAgMSAwIDAtMi41IDEuMjUgMS4yNSAwIDAgMCAwIDIuNW0xMy43NSAwYTEuMjUgMS4yNSAwIDEgMCAwLTIuNSAxLjI1IDEuMjUgMCAwIDAgMCAyLjUiIGNsaXAtcnVsZT0iZXZlbm9kZCIvPjwvc3ZnPg==)}.ag-charts-icon-unlock,.ag-charts-icon-unlocked{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzAwMCIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNMTAuNjUxIDMuNWEyLjg5NCAyLjg5NCAwIDAgMC0yLjg5NCAyLjg5NFY5SDE0LjVhMi41IDIuNSAwIDAgMSAyLjUgMi41djNhMi41IDIuNSAwIDAgMS0yLjUgMi41aC04QTIuNSAyLjUgMCAwIDEgNCAxNC41di0zQTIuNSAyLjUgMCAwIDEgNi41IDloLjI1N1Y2LjM5NGEzLjg5NCAzLjg5NCAwIDEgMSA3Ljc4OSAwIC41LjUgMCAwIDEtMSAwQTIuODk0IDIuODk0IDAgMCAwIDEwLjY1IDMuNU02LjUgMTBBMS41IDEuNSAwIDAgMCA1IDExLjV2M0ExLjUgMS41IDAgMCAwIDYuNSAxNmg4YTEuNSAxLjUgMCAwIDAgMS41LTEuNXYtM2ExLjUgMS41IDAgMCAwLTEuNS0xLjV6IiBjbGlwLXJ1bGU9ImV2ZW5vZGQiLz48L3N2Zz4=)}.ag-charts-icon-vertical-line,.ag-charts-icon-vertical-line-drawing{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzEzMTcyMiIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNMTAuNSA3LjgwNmEyLjI1IDIuMjUgMCAwIDEgMCA0LjM4OFYxOS41aC0xdi03LjMwNmEyLjI1IDIuMjUgMCAwIDEgMC00LjM4OFYuNWgxem0tLjUuOTQ0YTEuMjUgMS4yNSAwIDEgMSAwIDIuNSAxLjI1IDEuMjUgMCAwIDEgMC0yLjUiIGNsaXAtcnVsZT0iZXZlbm9kZCIvPjwvc3ZnPg==)}.ag-charts-icon-zoom-in{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzAwMCIgZD0iTTEwIDUuNWEuNS41IDAgMCAxIC41LjV2My41aDMuODc1YS41LjUgMCAwIDEgMCAxSDEwLjV2NC4yNWEuNS41IDAgMSAxLTEgMFYxMC41SDUuNjI1YS41LjUgMCAxIDEgMC0xSDkuNVY2YS41LjUgMCAwIDEgLjUtLjUiLz48L3N2Zz4=)}.ag-charts-icon-zoom-out{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzAwMCIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNNS41IDEwYS41LjUgMCAwIDEgLjUtLjVoOGEuNS41IDAgMCAxIDAgMUg2YS41LjUgMCAwIDEtLjUtLjUiIGNsaXAtcnVsZT0iZXZlbm9kZCIvPjwvc3ZnPg==)}.ag-charts-icon-high-low-series{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzEzMTcyMiIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNNyA0aDJ2MTJINFY0aDNNNSA1aDN2MTBINXpNMTEgMTRWNmg1djhoLTVtMS03aDN2NmgtM3oiIGNsaXAtcnVsZT0iZXZlbm9kZCIvPjwvc3ZnPg==)}.ag-charts-icon-hlc-series{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzEzMTcyMiIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJtMTguMTYzIDEuODM3LTUuMzM0IDExLjYyMUw2Ljk1NyA4LjEybC00LjE5OSA5LjYyMi0uOTE2LS40IDQuNzU2LTEwLjlMMTIuNDkgMTEuOCAxNy4yNTQgMS40MnoiIGNsaXAtcnVsZT0iZXZlbm9kZCIvPjxwYXRoIGZpbGw9IiMwMDAiIGZpbGwtb3BhY2l0eT0iLjQiIGZpbGwtcnVsZT0iZXZlbm9kZCIgZD0iTTUuODI1IDIuNzA0LjU1IDEzLjc4NWwuOTAyLjQzIDQuNzI0LTkuOTE5IDYuMDM0IDUuMDI5IDMuMjU1LTguMTQtLjkyOC0uMzctMi43NDUgNi44NnptNy44NTIgMTQuNjM2IDUuNzgtMTMuMTM5LS45MTUtLjQwMi01LjIxOSAxMS44Ni02LjAwNS01LjUwNC0zLjI3OCA3LjY0OC45Mi4zOTQgMi43MjItNi4zNTJ6IiBjbGlwLXJ1bGU9ImV2ZW5vZGQiLz48L3N2Zz4=)}.ag-charts-icon-zoom-in-alt{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIiBzdHJva2U9ImN1cnJlbnRDb2xvciIgc3Ryb2tlLXdpZHRoPSIyIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiIGNsYXNzPSJsdWNpZGUgbHVjaWRlLXpvb20taW4iPjxjaXJjbGUgY3g9IjExIiBjeT0iMTEiIHI9IjgiLz48bGluZSB4MT0iMjEiIHgyPSIxNi42NSIgeTE9IjIxIiB5Mj0iMTYuNjUiLz48bGluZSB4MT0iMTEiIHgyPSIxMSIgeTE9IjgiIHkyPSIxNCIvPjxsaW5lIHgxPSI4IiB4Mj0iMTQiIHkxPSIxMSIgeTI9IjExIi8+PC9zdmc+)}.ag-charts-icon-zoom-out-alt{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIiBzdHJva2U9ImN1cnJlbnRDb2xvciIgc3Ryb2tlLXdpZHRoPSIyIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiIGNsYXNzPSJsdWNpZGUgbHVjaWRlLXpvb20tb3V0Ij48Y2lyY2xlIGN4PSIxMSIgY3k9IjExIiByPSI4Ii8+PGxpbmUgeDE9IjIxIiB4Mj0iMTYuNjUiIHkxPSIyMSIgeTI9IjE2LjY1Ii8+PGxpbmUgeDE9IjgiIHgyPSIxNCIgeTE9IjExIiB5Mj0iMTEiLz48L3N2Zz4=)}.ag-charts-input{--input-layer-active: 1;--input-layer-focus: 2;--input-padding: calc(var(--ag-charts-spacing) * 2);--input-padding-large: calc(var(--ag-charts-spacing) * 2.5);color:var(--ag-charts-input-text-color);font-family:var(--ag-charts-chrome-font-family);font-size:var(--ag-charts-chrome-font-size-large);transition-duration:.25s;transition-property:none;transition-timing-function:ease-out}.ag-charts-input:focus-visible{outline:var(--ag-charts-focus-border);box-shadow:var(--ag-charts-focus-border-shadow);z-index:var(--input-layer-focus)}.ag-charts-button{background:var(--ag-charts-button-background-color);border:1px solid var(--ag-charts-border-color);border-radius:var(--ag-charts-button-border-radius);color:var(--ag-charts-button-text-color);cursor:pointer;padding:var(--input-padding);transition-property:background,border-color}.ag-charts-button:hover{background:var(--ag-charts-focus-color)}.ag-charts-button:has(.ag-charts-icon){padding:2px}.ag-charts-checkbox{--checkbox-transition-duration: .1s;appearance:none;background:var(--ag-charts-checkbox-background-color);border-radius:calc(var(--ag-charts-border-radius) * 9);cursor:pointer;height:18px;margin:0;transition-duration:var(--checkbox-transition-duration);transition-property:margin;width:29px}.ag-charts-checkbox:before{display:block;background:var(--ag-charts-input-background-color);border-radius:calc(var(--ag-charts-border-radius) * 7);content:" ";height:14px;margin:2px;transition-duration:var(--checkbox-transition-duration);transition-property:margin;transition-timing-function:var(--ag-charts-input-transition-easing);width:14px}.ag-charts-checkbox:checked{background:var(--ag-charts-checkbox-checked-background-color)}.ag-charts-checkbox:checked:before{margin-left:13px}.ag-charts-select{background:var(--ag-charts-input-background-color);border:1px solid var(--ag-charts-input-border-color);border-radius:var(--ag-charts-input-border-radius);padding:3px 2px 4px;font-size:inherit}.ag-charts-textarea{--textarea-line-height: 1.38;background:var(--ag-charts-input-background-color);border:1px solid var(--ag-charts-border-color);border-radius:var(--ag-charts-input-border-radius);line-height:var(--textarea-line-height);font-family:var(--ag-charts-chrome-font-family);font-size:var(--ag-charts-chrome-font-size-large);padding:var(--input-padding-large) var(--input-padding)}.ag-charts-textarea::placeholder{color:var(--ag-charts-input-placeholder-text-color)}.ag-charts-proxy-container{pointer-events:none;position:absolute}.ag-charts-proxy-elem{-webkit-appearance:none;appearance:none;background:none;border:none;color:#0000;overflow:hidden;pointer-events:auto;position:absolute}.ag-charts-proxy-elem::-moz-range-thumb,.ag-charts-proxy-elem::-moz-range-track{opacity:0}.ag-charts-proxy-elem::-webkit-slider-runnable-track,.ag-charts-proxy-elem::-webkit-slider-thumb{opacity:0}.ag-charts-proxy-elem:focus-visible{outline:var(--ag-charts-focus-border);box-shadow:var(--ag-charts-focus-border-shadow)}.ag-charts-focus-indicator{position:absolute;display:block;pointer-events:none;user-select:none;-webkit-user-select:none;width:100%;height:100%}.ag-charts-focus-indicator>div{position:absolute;outline:solid 1px var(--ag-charts-chrome-background-color);box-shadow:var(--ag-charts-focus-shadow)}.ag-charts-focus-indicator>svg{width:100%;height:100%;fill:none;overflow:visible}.ag-charts-focus-svg-outer-path{stroke:var(--ag-charts-chrome-background-color);stroke-width:4px}.ag-charts-focus-svg-inner-path{stroke:var(--ag-charts-accent-color);stroke-width:2px}.ag-charts-overlay{color:#181d1f;pointer-events:none}.ag-charts-overlay.ag-charts-dark-overlay{color:#fff}.ag-charts-overlay--loading{color:#8c8c8c}.ag-charts-overlay__loading-background{background:#fff;pointer-events:none}.ag-charts-overlay.ag-charts-dark-overlay .ag-charts-overlay__loading-background{background:#192232}.ag-charts-tooltip{--tooltip-arrow-size: 8px;position:fixed;inset:unset;margin:0;padding:0;overflow:visible;width:max-content;max-width:100%;font-family:var(--ag-charts-chrome-font-family);font-size:var(--ag-charts-chrome-font-size);font-weight:var(--ag-charts-chrome-font-weight);color:var(--ag-charts-chrome-text-color);background:var(--ag-charts-chrome-background-color);border:var(--ag-charts-border);border-radius:var(--ag-charts-border-radius);box-shadow:var(--ag-charts-shadow)}.ag-charts-tooltip--compact .ag-charts-tooltip-content{padding:3px 6px}.ag-charts-tooltip--arrow:before{content:"";position:absolute;top:100%;left:50%;margin:0 auto;transform:translate(-50%) translateY(calc(var(--tooltip-arrow-size) * -.5)) rotate(45deg);display:block;width:var(--tooltip-arrow-size);height:var(--tooltip-arrow-size);border:inherit;border-top:none;border-left:none;clip-path:polygon(0% 100%,100% 0%,100% 100%)}.ag-charts-tooltip--arrow:after{--tooltip-inner-size: calc(var(--tooltip-arrow-size) - 2px);content:"";position:absolute;top:100%;left:50%;margin:0 auto;transform:translate(-50%) translateY(calc(var(--tooltip-inner-size) * -.5)) rotate(45deg);display:block;width:var(--tooltip-inner-size);height:var(--tooltip-inner-size);border:inherit;border-color:transparent;background:inherit;clip-path:polygon(-10% 100%,100% -10%,100% 100%)}.ag-charts-tooltip--no-interaction{pointer-events:none;user-select:none;-webkit-user-select:none}.ag-charts-tooltip--wrap-always{overflow-wrap:break-word;word-break:break-word;hyphens:none}.ag-charts-tooltip--wrap-hyphenate{overflow-wrap:break-word;word-break:break-word;hyphens:auto}.ag-charts-tooltip--wrap-on-space{overflow-wrap:normal;word-break:normal}.ag-charts-tooltip--wrap-never{white-space:nowrap}.ag-charts-tooltip-heading,.ag-charts-tooltip-title,.ag-charts-tooltip-label,.ag-charts-tooltip-value{overflow:hidden;text-overflow:ellipsis}.ag-charts-tooltip-content{display:grid;grid:auto-flow minmax(1em,auto) / 1fr;padding:8px 12px;gap:8px}.ag-charts-tooltip-content:has(.ag-charts-tooltip-symbol){grid:auto-flow minmax(1em,auto) / auto 1fr}.ag-charts-tooltip-heading{grid-column:1 / -1}.ag-charts-tooltip-symbol{grid-column:1 / 2;align-self:center}.ag-charts-tooltip-symbol svg{display:block}.ag-charts-tooltip-title{grid-column:-2 / -1}.ag-charts-tooltip-row{grid-column:1 / -1;display:flex;gap:16px;align-items:baseline;justify-content:space-between;overflow:hidden}.ag-charts-tooltip-row--inline{grid-column:-2 / -1}.ag-charts-tooltip-label{flex:1;min-width:0}.ag-charts-tooltip-value{min-width:0}.ag-charts-popover{position:absolute;border:var(--ag-charts-border);border-radius:var(--ag-charts-border-radius);background:var(--ag-charts-chrome-background-color);color:var(--ag-charts-chrome-text-color);font-family:var(--ag-charts-chrome-font-family);font-size:var(--ag-charts-chrome-font-size);font-weight:var(--ag-charts-chrome-font-weight);box-shadow:var(--ag-charts-shadow);z-index:var(--ag-charts-layer-ui-overlay)}.ag-charts-menu{--item-padding: 6px 12px;--icon-color: var(--ag-charts-chrome-text-color);display:grid;grid:auto-flow auto / 1fr;column-gap:12px;font-size:var(--ag-charts-chrome-font-size)}.ag-charts-menu:has(.ag-charts-menu__icon,.ag-charts-menu__row--stroke-width-visible){grid:auto-flow auto / auto 1fr}.ag-charts-menu__row--stroke-width-visible:before{content:"";height:var(--strokeWidth);width:12px;background:var(--icon-color)}.ag-charts-menu__row--stroke-width-visible[aria-disabled=true]:before{filter:grayscale(1);opacity:.5}.ag-charts-menu__row{display:grid;grid-column:1 / -1;grid-template-columns:subgrid;align-items:center;padding:var(--item-padding)}.ag-charts-menu__row:not(.ag-charts-menu__row--active){cursor:pointer}.ag-charts-menu__row:first-child{border-top-left-radius:inherit;border-top-right-radius:inherit}.ag-charts-menu__row:last-child{border-bottom-left-radius:inherit;border-bottom-right-radius:inherit}.ag-charts-menu__row:focus{background:var(--ag-charts-focus-color)}.ag-charts-menu__row:focus-visible{outline:var(--ag-charts-focus-border);box-shadow:var(--ag-charts-focus-border-shadow);z-index:var(--ag-charts-layer-menu)}.ag-charts-menu__row--active{--icon-color: var(--ag-charts-accent-color);background:var(--ag-charts-focus-color);color:var(--ag-charts-accent-color)}.ag-charts-menu__label{grid-column:-1 / span 1}.ag-charts-toolbar{--toolbar-gap: calc(var(--ag-charts-spacing) * 2);--toolbar-size: 34px;--toolbar-button-padding: 6px;align-items:center;display:flex;flex-wrap:nowrap;position:absolute}.ag-charts-toolbar__button{align-items:center;background:var(--ag-charts-chrome-background-color);border:var(--ag-charts-border);color:var(--ag-charts-chrome-text-color);cursor:pointer;display:flex;font-family:var(--ag-charts-chrome-font-family);font-size:var(--ag-charts-chrome-font-size-medium);font-weight:var(--ag-charts-chrome-font-weight);justify-content:center;min-height:var(--toolbar-size);min-width:var(--toolbar-size);padding:var(--toolbar-button-padding);position:relative;transition:background-color .25s ease-in-out,border-color .25s ease-in-out,color .25s ease-in-out;white-space:nowrap}.ag-charts-toolbar__button:hover{background:var(--ag-charts-focus-color);z-index:1}.ag-charts-toolbar__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-toolbar__button--active{background:var(--ag-charts-focus-color);border-color:var(--ag-charts-accent-color);color:var(--ag-charts-accent-color);z-index:2}.ag-charts-toolbar__button[aria-disabled=true]{background:var(--ag-charts-button-disabled-background-color);color:var(--ag-charts-button-disabled-text-color);cursor:default}.ag-charts-toolbar--horizontal{flex-direction:row;.ag-charts-toolbar__button{margin:0 0 0 -1px}.ag-charts-toolbar__button--first{border-bottom-left-radius:var(--ag-charts-border-radius);border-top-left-radius:var(--ag-charts-border-radius);margin:0}.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--vertical{flex-direction:column;.ag-charts-toolbar__button{margin:-1px 0 0;max-width:100%}.ag-charts-toolbar__button--first{border-top-left-radius:var(--ag-charts-border-radius);border-top-right-radius:var(--ag-charts-border-radius);margin:0}.ag-charts-toolbar__button--last{border-bottom-left-radius:var(--ag-charts-border-radius);border-bottom-right-radius:var(--ag-charts-border-radius)}}.ag-charts-toolbar__icon+.ag-charts-toolbar__label{margin-left:var(--toolbar-gap)}.ag-charts-toolbar__icon,.ag-charts-toolbar__label{pointer-events:none}.ag-charts-floating-toolbar{border:none;display:flex;.ag-charts-toolbar{align-items:unset;position:unset}}.ag-charts-floating-toolbar__drag-handle{align-items:center;background:var(--ag-charts-chrome-background-color);border:var(--ag-charts-border);border-bottom-left-radius:var(--ag-charts-border-radius);border-top-left-radius:var(--ag-charts-border-radius);cursor:grab;display:flex;justify-content:center;min-width:24px;padding-left:0;padding-right:0}.ag-charts-floating-toolbar__drag-handle--dragging{cursor:grabbing} `}}),oo,er=I({"packages/ag-charts-community/src/util/listeners.ts"(){"use strict";ot(),oo=class{constructor(){this.registeredListeners=new Map}addListener(t,e){const i={symbol:Symbol(t),handler:e};return this.registeredListeners.has(t)?this.registeredListeners.get(t).push(i):this.registeredListeners.set(t,[i]),()=>this.removeListener(i.symbol)}removeListener(t){for(const[e,i]of this.registeredListeners.entries()){const s=i.findIndex(n=>n.symbol===t);if(s>=0){i.splice(s,1),i.length===0&&this.registeredListeners.delete(e);break}}}dispatch(t,...e){for(const i of this.getListenersByType(t))try{i.handler(...e)}catch(s){et.errorOnce(String(s))}}getListenersByType(t){return this.registeredListeners.get(t)??[]}destroy(){this.registeredListeners.clear()}}}}),ir,al=I({"packages/ag-charts-community/src/util/baseManager.ts"(){"use strict";er(),ir=class{constructor(){this.listeners=new oo,this.destroyFns=[]}addListener(t,e){return this.listeners.addListener(t,e)}destroy(){this.listeners.destroy(),this.destroyFns.forEach(t=>t())}}}}),_w,y5=I({"packages/ag-charts-community/src/util/guardedElement.ts"(){"use strict";Lt(),ss(),_w=class AM{constructor(e,i,s){this.element=e,this.topTabGuard=i,this.bottomTabGuard=s,this.destroyFns=[],this.guardTabIndex=0,this.hasFocus=!1,this.initTabGuard(this.topTabGuard,n=>this.onTab(n,!1)),this.initTabGuard(this.bottomTabGuard,n=>this.onTab(n,!0)),this.element.addEventListener("focus",()=>this.onFocus(),{capture:!0}),this.element.addEventListener("blur",n=>this.onBlur(n),{capture:!0})}set tabIndex(e){this.guardTabIndex=e,this.guardTabIndex===0?this.setGuardIndices(void 0):this.hasFocus||this.setGuardIndices(this.guardTabIndex)}destroy(){for(const e of this.destroyFns)e();this.destroyFns.length=0}initTabGuard(e,i){const s=()=>i(e);e.addEventListener("focus",s),this.destroyFns.push(()=>e.removeEventListener("focus",s))}setGuardIndices(e){const i=e;ee(this.topTabGuard,"tabindex",i),ee(this.bottomTabGuard,"tabindex",i)}onFocus(){this.hasFocus=!0,this.guardTabIndex!==0&&this.setGuardIndices(0)}onBlur({relatedTarget:e}){const{topTabGuard:i,bottomTabGuard:s}=this;this.hasFocus=!1,this.guardTabIndex!==0&&e!==i&&e!==s&&this.setGuardIndices(this.guardTabIndex)}onTab(e,i){if(this.guardTabIndex!==0){let s;e.tabIndex===0?(s=this.findExitTarget(!i),this.setGuardIndices(this.guardTabIndex)):s=this.findEnterTarget(i),s?.focus()}}static queryFocusable(e,i){const s=ae();return Array.from(e.querySelectorAll(i)).filter(n=>{if(n instanceof HTMLElement){const a=s.getComputedStyle(n);return a.display!=="none"&&a.visibility!=="none"}return!1})}findEnterTarget(e){const i=AM.queryFocusable(this.element,'[tabindex="0"]'),s=e?i.length-1:0;return i[s]}findExitTarget(e){const i=AM.queryFocusable(Go(),"[tabindex]").filter(a=>a.tabIndex>0).sort((a,o)=>a.tabIndex-o.tabIndex),{before:s,after:n}=AM.findBeforeAndAfter(i,this.guardTabIndex);return e?s:n}static findBeforeAndAfter(e,i){let s=0,n=e.length-1,a,o;for(;s<=n;){const r=Math.floor((s+n)/2),l=e[r].tabIndex;if(l===i){a=e[r-1]||void 0,o=e[r+1]||void 0;break}else le.removeEventListener(i,s,n);return t.push(a),a}function Pw(t,e,i){ma(t,e,"keydown",s=>{s.key==="Escape"&&i(s)})}function m5(t,e,i){const s=ma(t,window,"mousedown",n=>{[0,2].includes(n.button)&&!Bw(e,n)&&(i(),s())});return s}function x5(t,e,i){const s=ma(t,window,"touchstart",n=>{Array.from(n.targetTouches).some(o=>!Bw(e,o))&&(i(),s())});return s}function Bw(t,e){if(e.target instanceof Element){const{x:i,y:s,width:n,height:a}=t.getBoundingClientRect(),{clientX:o,clientY:r}=e;return o>=i&&r>=s&&o<=i+n&&r<=s+a}return!1}function Xm(t){return!(t.shiftKey||t.altKey||t.ctrlKey||t.metaKey)}function AI(t,e,...i){return Xm(t)&&(t.key===e||i.some(s=>t.key===s))}function zw(t,e,i,s){i&&ma(t,e,"keydown",n=>{AI(n,s)&&i.focus()})}function b5(t,e,i,s,n,a){zw(t,e,n,a),zw(t,e,i,s),ma(t,e,"keydown",o=>{AI(o,s,a)&&o.preventDefault()})}function Fw(t){const{orientation:e,buttons:i,wrapAround:s=!1,onEscape:n,onFocus:a,onBlur:o}=t,{nextKey:r,prevKey:l}=Fc[e],c=p=>{p.target&&"tabIndex"in p.target&&(i.forEach(g=>g.tabIndex=-1),p.target.tabIndex=0)},[h,u]=s?[i.length,i.length]:[0,1/0],d=[];for(let p=0;pu.close(),{destroyFns:p}=u;if(s.role="menu",s.ariaOrientation=i,p.push(...Fw({orientation:i,buttons:n,onEscape:d,wrapAround:!0})),s.tabIndex=-1,Pw(p,s,d),ma(p,s,"keydown",g=>{g.target===s&&(g.key===l||g.key===c)&&(g.preventDefault(),n[0]?.focus())}),r){const g=f=>{!n.includes(f.relatedTarget)&&d()};for(const f of n)ma(p,f,"blur",g)}return n[0]?.focus({preventScroll:!0}),o!==void 0&&(n.forEach(f=>f.setAttribute("data-focus-visible-override",o.toString())),ma(p,s,"keydown",()=>{n.forEach(f=>f.setAttribute("data-focus-visible-override","true"))},{once:!0})),u}function S5(t,e){return i=>{if(t.ariaDisabled==="true")return i.preventDefault();e(i)}}function DI(t){return"button"in t?t.button===0:Xm(t)&&(t.code==="Space"||t.key==="Enter")}function kI(t){if(t?.target instanceof HTMLElement&&"tabindex"in t.target.attributes)return t.target}function Vw(t){const e=i=>{if(i.defaultPrevented)return;Gm(i.target,"data-preventdefault",!0)&&AI(i,"ArrowRight","ArrowLeft","ArrowDown","ArrowUp")&&i.preventDefault()};return t.addEventListener("keydown",e),()=>t.removeEventListener("keydown",e)}var Fc,Gw,Ru=I({"packages/ag-charts-community/src/util/keynavUtil.ts"(){"use strict";ss(),Fc={horizontal:{nextKey:"ArrowRight",prevKey:"ArrowLeft"},vertical:{nextKey:"ArrowDown",prevKey:"ArrowUp"}},Gw=class{constructor(t,e,i){this.lastFocus=e,this.closeCallback=i,this.destroyFns=[],this.destroyFns.push(m5(this.destroyFns,t,()=>this.close(!0))),this.destroyFns.push(x5(this.destroyFns,t,()=>this.close(!0)))}close(t){this.destroyFns.forEach(e=>e()),this.destroyFns.length=0,this.closeCallback(),this.finishClosing(t)}finishClosing(t){this.destroyFns.forEach(e=>e()),this.destroyFns.length=0,ee(this.lastFocus,"aria-expanded",!1),t||this.lastFocus?.focus({preventScroll:!0}),this.lastFocus=void 0}}}}),Ww,v5=I({"packages/ag-charts-community/src/util/pixelRatioObserver.ts"(){"use strict";Lt(),Ww=class{constructor(t){this.callback=t,this.devicePixelRatio=ae("devicePixelRatio")??1,this.devicePixelRatioMediaQuery=void 0,this.devicePixelRatioListener=e=>{e.matches||(this.devicePixelRatio=ae("devicePixelRatio")??1,this.unregisterDevicePixelRatioListener(),this.registerDevicePixelRatioListener(),this.callback(this.pixelRatio))}}get pixelRatio(){return this.devicePixelRatio}observe(){this.registerDevicePixelRatioListener()}disconnect(){this.unregisterDevicePixelRatioListener()}unregisterDevicePixelRatioListener(){this.devicePixelRatioMediaQuery?.removeEventListener("change",this.devicePixelRatioListener),this.devicePixelRatioMediaQuery=void 0}registerDevicePixelRatioListener(){const t=ae("matchMedia")?.(`(resolution: ${this.pixelRatio}dppx)`);t?.addEventListener("change",this.devicePixelRatioListener),this.devicePixelRatioMediaQuery=t}}}}),Uw,M5=I({"packages/ag-charts-community/src/util/sizeMonitor.ts"(){"use strict";Lt(),v5(),Uw=class{constructor(){this.elements=new Map,this.documentReady=!1,this.queuedObserveRequests=[],this.onLoad=()=>{this.documentReady=!0,this.queuedObserveRequests.forEach(([e,i])=>this.observe(e,i)),this.queuedObserveRequests=[],this.observeWindow()},typeof ResizeObserver<"u"&&(this.resizeObserver=new ResizeObserver(e=>{for(const{target:i,contentRect:{width:s,height:n}}of e){const a=this.elements.get(i);this.checkSize(a,i,s,n)}}));let t;this.pixelRatioObserver=new Ww(()=>{clearTimeout(t),t=setTimeout(()=>this.checkPixelRatio(),0)}),this.documentReady=Go("readyState")==="complete",this.documentReady?this.observeWindow():ae()?.addEventListener("load",this.onLoad)}destroy(){ae()?.removeEventListener("load",this.onLoad),this.resizeObserver?.disconnect(),this.resizeObserver=void 0,this.pixelRatioObserver?.disconnect(),this.pixelRatioObserver=void 0}observeWindow(){this.pixelRatioObserver?.observe()}checkPixelRatio(){const t=this.pixelRatioObserver?.pixelRatio??1;for(const[e,i]of this.elements)if(i.size!=null&&i.size.pixelRatio!==t){const{width:s,height:n}=i.size;i.size={width:s,height:n,pixelRatio:t},i.cb(i.size,e)}}checkSize(t,e,i,s){if(t&&(i!==t.size?.width||s!==t.size?.height)){const n=this.pixelRatioObserver?.pixelRatio??1;t.size={width:i,height:s,pixelRatio:n},t.cb(t.size,e)}}observe(t,e){if(!this.documentReady){this.queuedObserveRequests.push([t,e]);return}this.elements.has(t)?this.removeFromQueue(t):this.resizeObserver?.observe(t);const i={cb:e};this.elements.set(t,i)}unobserve(t){this.resizeObserver?.unobserve(t),this.elements.delete(t),this.removeFromQueue(t),this.elements.size||this.destroy()}removeFromQueue(t){this.queuedObserveRequests=this.queuedObserveRequests.filter(([e])=>e!==t)}}}}),jc,Zm=I({"packages/ag-charts-community/src/util/stateTracker.ts"(){"use strict";jc=class extends Map{constructor(t,e){super(),this.defaultValue=t,this.defaultState=e}set(t,e){return this.delete(t),typeof e<"u"&&super.set(t,e),this}stateId(){return Array.from(this.keys()).pop()??this.defaultState}stateValue(){return Array.from(this.values()).pop()??this.defaultValue}}}}),Hw,I5=I({"packages/ag-charts-community/src/dom/domLayout.html"(){Hw=''}});function A5(t,e){if(typeof IntersectionObserver>"u")return;const i=new IntersectionObserver(s=>{for(const n of s)n.target===t&&e(n.intersectionRatio)},{root:t});return i.observe(t),i}function Yw(t,e){const i=Ot("div");return i.className="ag-charts-tab-guard",t.insertAdjacentElement(e,i),i}var Kw,LI,$w,TI,CI,Xw=I({"packages/ag-charts-community/src/dom/domManager.ts"(){"use strict";Lt(),Rt(),f5(),ss(),al(),y5(),Ru(),M5(),Zm(),I5(),Kw=["styles","canvas","canvas-center","canvas-container","canvas-overlay","canvas-proxy","series-area"],LI={safeHorizontal:"ag-charts-wrapper--safe-horizontal",safeVertical:"ag-charts-wrapper--safe-vertical"},$w=new Map([["styles",{childElementType:"style"}],["canvas",{childElementType:"canvas"}],["canvas-proxy",{childElementType:"div"}],["canvas-overlay",{childElementType:"div"}],["canvas-center",{childElementType:"div"}],["series-area",{childElementType:"div"}]]),TI={x:0,y:0,width:0,height:0,top:0,bottom:0,left:0,right:0,toJSON(){return TI}},CI=class extends ir{constructor(t,e){super(),this.styles=new Map,this.container=void 0,this.containerSize=void 0,this.sizeMonitor=new Uw,this.cursorState=new jc("default"),this.minWidth=0,this.minHeight=0;const i=Ot("div");i.innerHTML=Hw,this.element=i.children.item(0),this.styleRootElement=e,this.rootElements=Kw.reduce((r,l)=>{const c=`ag-charts-${l}`,h=this.element.classList.contains(c)?this.element:this.element.querySelector(`.${c}`);if(!h)throw new Error(`AG Charts - unable to find DOM element ${c}`);return r[l]={element:h,children:new Map,listeners:[]},r},{});let s=!1;this.observer=A5(this.element,r=>{r===0&&!s&&this.listeners.dispatch("hidden",{type:"hidden"}),s=r===0}),this.setSizeOptions(),this.updateContainerSize(),this.addStyles("ag-charts-community",Rw),t&&this.setContainer(t),this.destroyFns.push(Vw(this.element));const n=this.element.querySelector(".ag-charts-canvas-center");if(n==null)throw new Error("Error initializing tab guards");const a=Yw(n,"beforebegin"),o=Yw(n,"afterend");this.tabGuards=new _w(n,a,o)}destroy(){super.destroy(),this.observer?.unobserve(this.element),this.container&&this.sizeMonitor.unobserve(this.container),Object.values(this.rootElements).forEach(t=>{t.children.forEach(e=>e.remove()),t.element.remove()}),this.element.remove()}setSizeOptions(t=300,e=300,i,s){const{style:n}=this.element;n.width=`${i??t}px`,n.height=`${s??e}px`,this.minWidth=i??t,this.minHeight=s??e,this.updateContainerClassName()}updateContainerSize(){const{style:t}=this.rootElements["canvas-center"].element;t.visibility=this.containerSize==null?"hidden":"",this.containerSize?(t.width=`${this.containerSize.width??0}px`,t.height=`${this.containerSize.height??0}px`):(t.width="",t.height=""),this.updateContainerClassName()}setTabGuardIndex(t){this.tabGuards.tabIndex=t}setContainer(t){if(t===this.container)return;if(this.container&&(this.container.removeChild(this.element),this.sizeMonitor.unobserve(this.container)),!(this.getShadowDocumentRoot(t)!=null))for(const i of this.rootElements.styles.children.keys())this.removeChild("styles",i);this.container=t;for(const[i,s]of this.styles)this.addStyles(i,s);t.appendChild(this.element),this.sizeMonitor.observe(t,i=>{this.containerSize=i,this.updateContainerSize(),this.listeners.dispatch("resize",{type:"resize"})}),this.listeners.dispatch("container-changed",{type:"container-changed"})}setThemeClass(t){const e="ag-charts-theme-";this.element.classList.forEach(i=>{i.startsWith(e)&&i!==t&&this.element.classList.remove(i)}),this.element.classList.add(t)}setThemeParameters(t){const e={accentColor:"accent-color",axisColor:"axis-color",backgroundColor:"background-color",borderColor:"border-color",foregroundColor:"foreground-color",fontFamily:"font-family",fontSize:"font-size",fontWeight:"font-weight",gridLineColor:"grid-line-color",padding:"padding",subtleTextColor:"subtle-text-color",textColor:"text-color",chromeBackgroundColor:"chrome-background-color",chromeFontFamily:"chrome-font-family",chromeFontSize:"chrome-font-size",chromeFontWeight:"chrome-font-weight",chromeSubtleTextColor:"chrome-subtle-text-color",chromeTextColor:"chrome-text-color",inputBackgroundColor:"input-background-color",inputTextColor:"input-text-color",crosshairLabelBackgroundColor:"crosshair-label-background-color",crosshairLabelTextColor:"crosshair-label-text-color"},i=["fontSize","chromeFontSize"];for(const[s,n]of Object.entries(t)){let a=`${n}`;i.includes(s)&&(a=`${n}px`),this.element.style.setProperty(`--ag-charts-${e[s]}`,a)}}updateCanvasLabel(t){ee(this.rootElements["canvas-proxy"].element,"aria-label",t)}getEventElement(t,e){return["focus","blur","keydown","keyup"].includes(e)?this.rootElements["series-area"].element:t}addEventListener(t,e,i){this.getEventElement(this.element,t).addEventListener(t,e,i)}removeEventListener(t,e,i){this.getEventElement(this.element,t).removeEventListener(t,e,i)}getBoundingClientRect(){return this.rootElements.canvas.element.getBoundingClientRect()}getOverlayClientRect(){const t=ae(),e=new ht(0,0,t.innerWidth,t.innerHeight),i=this.getRawOverlayClientRect();return e.intersection(i)?.toDOMRect()??TI}getRawOverlayClientRect(){let t=this.element;for(;t!=null;){const a=t.computedStyleMap?.()?.get("overflow-y")?.toString();if(a==="auto"||a==="scroll")return ht.fromDOMRect(t.getBoundingClientRect());t=t.parentElement}const e=this.getShadowDocumentRoot();if(e!=null)return ht.fromDOMRect(e.getBoundingClientRect());const{innerWidth:i,innerHeight:s}=ae();return new ht(0,0,i,s)}getShadowDocumentRoot(t=this.container){const e=t?.ownerDocument?.body??Go("body");for(;t!=null;){if(t===e)return;if(t.parentNode instanceof DocumentFragment)return t;t=t.parentNode}return this.container}getParent(t){return this.rootElements[t].element}getChildBoundingClientRect(t){const{children:e}=this.rootElements[t],i=[];for(const s of e.values())i.push(ht.fromDOMRect(s.getBoundingClientRect()));return ht.merge(i)}isManagedChildDOMElement(t,e,i){const{children:s}=this.rootElements[e],n=s?.get(i);return n!=null&&t.contains(n)}contains(t,e){return e==null?this.element.contains(t):this.rootElements[e].element.contains(t)}addStyles(t,e){const i="data-ag-charts";if(this.styles.set(t,e),this.container==null)return;const s=o=>o.getAttribute(i)===t,n=o=>{const r=new Set(["TITLE","META"]);let l=!0,c;for(const u of o.children){if(l&&r.has(u.tagName)){c=u;continue}if(l=!1,s(u))return;u.hasAttribute(i)&&(c=u)}const h=Ot("style");return c!=null?o.insertBefore(h,c.nextSibling):o.prepend(h),h};let a;this.styleRootElement?a=n(this.styleRootElement):this.getShadowDocumentRoot(this.container)!=null?a=this.addChild("styles",t):a=n(Go("head")),!(a==null||s(a))&&(a.setAttribute(i,t),a.innerHTML=e)}removeStyles(t){this.removeChild("styles",t)}updateCursor(t,e){this.cursorState.set(t,e),this.element.style.cursor=this.cursorState.stateValue()}getCursor(){return this.element.style.cursor}addChild(t,e,i,s){const{element:n,children:a,listeners:o}=this.rootElements[t];if(!a)throw new Error("AG Charts - unable to create DOM elements after destroy()");if(a.has(e))return a.get(e);const{childElementType:r="div"}=$w.get(t)??{};if(i&&i.tagName.toLowerCase()!==r.toLowerCase())throw new Error("AG Charts - mismatching DOM element type");const l=i??Ot(r);for(const[c,h,u]of o)l.addEventListener(c,h,u);if(a.set(e,l),s){const c=n.querySelector(s.query);if(c==null)throw new Error(`AG Charts - addChild query failed ${s.query}`);c.insertAdjacentElement(s.where,l)}else n?.appendChild(l);return l}removeChild(t,e){const{children:i}=this.rootElements[t];i&&(i.get(e)?.remove(),i.delete(e))}incrementDataCounter(t){const{dataset:e}=this.element;e[t]??(e[t]="0"),e[t]=String(Number(e[t])+1)}setDataBoolean(t,e){this.element.dataset[t]=String(e)}updateContainerClassName(){const{element:t,containerSize:e,minWidth:i,minHeight:s}=this;t.classList.toggle(LI.safeHorizontal,i>=(e?.width??1/0)),t.classList.toggle(LI.safeVertical,s>=(e?.height??1/0))}}}}),Zw,D5=I({"packages/ag-charts-community/src/widget/boundedTextWidget.ts"(){"use strict";Lt(),tr(),Zw=class extends ya{constructor(){super(Ot("div")),this.textElement=wn("text"),this.textElement.role="presentation",this.svgElement=wn("svg"),this.svgElement.appendChild(this.textElement),this.svgElement.style.width="100%",this.svgElement.style.opacity="0",this.svgElement.role="presentation",this.elem.appendChild(this.svgElement),this.elem.role="presentation"}set textContent(t){this.textElement.textContent=t;const i=this.textElement.getBBox?.();i&&this.svgElement.setAttribute("viewBox",`${i.x} ${i.y} ${i.width} ${i.height}`)}get textContent(){return this.textElement.textContent}destructor(){}}}}),_u,Qm=I({"packages/ag-charts-community/src/widget/buttonWidget.ts"(){"use strict";Lt(),ss(),tr(),_u=class extends ya{constructor(){super(Ot("button")),this.setEnabled(!0)}destructor(){}setEnabled(t){ee(this.elem,"aria-disabled",!t),fa(this.elem,"pointer-events",t?void 0:"none")}addListener(t,e){return super.addListener(t,(i,s)=>{(t==="click"||t==="dblclick")&&this.isDisabled()||e(i,s)})}}}}),Qw,k5=I({"packages/ag-charts-community/src/widget/groupWidget.ts"(){"use strict";Lt(),ss(),tr(),Qw=class extends ya{constructor(){super(Ot("div")),ee(this.elem,"role","group")}destructor(){}}}}),NI,qw=I({"packages/ag-charts-community/src/widget/rovingTabContainerWidget.ts"(){"use strict";Lt(),ss(),Ru(),tr(),NI=class extends ya{constructor(t,e){super(Ot("div")),this.focusedChildIndex=0,this.onChildFocus=(i,s)=>{const n=this.children[this.focusedChildIndex];this.focusedChildIndex=s.index,n?.setTabIndex(-1),s.setTabIndex(0)},this.onChildKeyDown=(i,s)=>{const n=this.orientation,[a,o]=n==="both"?[Fc.horizontal,Fc.vertical]:[Fc[n],void 0];let r=-1;if(Xm(i.sourceEvent)){const l=i.sourceEvent.key;l===a.nextKey||l===o?.nextKey?r=s.index+1:(l===a.prevKey||l===o?.prevKey)&&(r=s.index-1)}this.children[r]?.focus()},this.orientation=t,ee(this.elem,"role",e)}get orientation(){return Gm(this.elem,"aria-orientation")??"both"}set orientation(t){ee(this.elem,"aria-orientation",t!=="both"?t:void 0)}focus(){this.children[this.focusedChildIndex]?.focus()}onChildAdded(t){t.addListener("focus",this.onChildFocus),t.addListener("keydown",this.onChildKeyDown),t.setTabIndex(this.children.length===1?0:-1)}onChildRemoved(t){t.removeListener("focus",this.onChildFocus),t.removeListener("keydown",this.onChildKeyDown)}}}}),Jw,L5=I({"packages/ag-charts-community/src/widget/listWidget.ts"(){"use strict";Lt(),ss(),qw(),tr(),Jw=class extends NI{constructor(){super("both","list"),this.setHidden(!0)}destructor(){this.children.forEach(t=>t.getElement().parentElement.remove())}addChildToDOM(t,e){const i=Ot("div");ee(i,"role","listitem"),fa(i,"position","absolute"),ya.setElementContainer(t,i),this.appendOrInsert(i,e),this.setHidden(!1)}removeChildFromDOM(t){t.getElement().parentElement.remove(),this.setHidden(this.children.length===0)}setHidden(t){this.children.length===0&&(t=!0),super.setHidden(t)}}}}),Vc,qm=I({"packages/ag-charts-community/src/widget/nativeWidget.ts"(){"use strict";tr(),Vc=class extends ya{constructor(t){super(t)}destructor(){}}}}),Jm,tx,tE=I({"packages/ag-charts-community/src/widget/sliderWidget.ts"(){"use strict";Lt(),ss(),il(),At(),tr(),Jm=class _y extends ya{constructor(){super(Ot("input")),this._step=_y.STEP_ONE,this.orientation="both"}get step(){return this._step}set step(e){this._step=e,this.getElement().step=e.attributeValue}get keyboardStep(){return this._keyboardStep?.step??this._step}set keyboardStep(e){if(e!==this._keyboardStep?.step&&(this._keyboardStep!==void 0&&(this.removeListener("keydown",this._keyboardStep.onKeyDown),this.removeListener("keyup",this._keyboardStep.onKeyUp),this.removeListener("blur",this._keyboardStep.onBlur),this._keyboardStep=void 0),e!==void 0)){const i=()=>this.getElement().step=e.attributeValue,s=()=>this.getElement().step=this._step.attributeValue;this._keyboardStep={step:e,onKeyDown:i,onKeyUp:s,onBlur:s},this.addListener("keydown",this._keyboardStep.onKeyDown),this.addListener("keyup",this._keyboardStep.onKeyUp),this.addListener("blur",this._keyboardStep.onBlur)}}get orientation(){return Gm(this.elem,"aria-orientation")??"both"}set orientation(e){ee(this.elem,"aria-orientation",e!=="both"?e:void 0),_y.registerDefaultPreventers(this,e)}destructor(){}clampValueRatio(e,i){const s=this.getValueRatio(),n=It(e,s,i);return n!==s&&this.setValueRatio(n),n}setValueRatio(e,i){const{divider:s}=this.step,n=Math.round(e*1e4)/s,{ariaValueText:a=EO(n/s)}=i??{},o=this.getElement();o.value=`${n}`,o.ariaValueText=a}getValueRatio(){return parseFloat(this.getElement().value)/this.step.divider}static registerDefaultPreventers(e,i){i==="both"?e.removeListener("keydown",_y.onKeyDown):e.addListener("keydown",_y.onKeyDown)}static onKeyDown(e,i){let s=[];const{orientation:n}=i;n==="horizontal"?s=["ArrowUp","ArrowDown"]:n==="vertical"&&(s=["ArrowLeft","ArrowRight"]),s.includes(e.sourceEvent.code)&&e.sourceEvent.preventDefault()}},Jm.STEP_ONE={attributeValue:"1",divider:1},Jm.STEP_HUNDRETH={attributeValue:"0.01",divider:100},tx=Jm}}),eE,T5=I({"packages/ag-charts-community/src/widget/switchWidget.ts"(){"use strict";ss(),Qm(),eE=class extends _u{constructor(){super(),ee(this.elem,"role","switch"),this.setChecked(!1)}setChecked(t){ee(this.elem,"aria-checked",t)}}}}),xg,OI=I({"packages/ag-charts-community/src/widget/toolbarWidget.ts"(){"use strict";qw(),xg=class extends NI{constructor(t="horizontal"){super(t,"toolbar")}destructor(){}}}});function Pu(t,e){return e.params?.type===t}function C5(t){if(t==="button")return new _u;if(t==="slider")return new tx;if(t==="toolbar")return new xg;if(t==="group")return new Qw;if(t==="list")return new Jw;if(t==="region")return new Vc(Ot("div"));if(t==="text")return new Zw;if(t==="listswitch")return new eE;throw Error("AG Charts - error allocating meta")}function iE(t){const e={params:t,result:void 0};return e.result=C5(e.params.type),e}var wI,sE=I({"packages/ag-charts-community/src/dom/proxyInteractionService.ts"(){"use strict";Lt(),ss(),D5(),Qm(),k5(),L5(),qm(),tE(),T5(),OI(),wI=class{constructor(t,e){this.localeManager=t,this.domManager=e,this.destroyFns=[]}destroy(){this.destroyFns.forEach(t=>t())}addLocalisation(t){t(),this.destroyFns.push(this.localeManager.addListener("locale-changed",t))}createProxyContainer(t){const e=iE(t),{params:i,result:s}=e,n=s.getElement();return this.domManager.addChild("canvas-proxy",i.domManagerId,n),n.classList.add(...i.classList,"ag-charts-proxy-container"),n.role=i.type,"ariaOrientation"in i&&(n.ariaOrientation=i.ariaOrientation),Pu("toolbar",e)&&(e.result.orientation=e.params.orientation),this.addLocalisation(()=>{n.ariaLabel=this.localeManager.t(i.ariaLabel.id,i.ariaLabel.params)}),s}createProxyElement(t){const e=iE(t);if(Pu("button",e)){const{params:i,result:s}=e,n=s.getElement();if(this.initInteract(i,s),typeof i.textContent=="string")n.textContent=i.textContent;else{const{textContent:a}=i;this.addLocalisation(()=>{n.textContent=this.localeManager.t(a.id,a.params)})}this.setParent(e.params,e.result)}if(Pu("slider",e)){const{params:i,result:s}=e,n=s.getElement();this.initInteract(i,s),n.type="range",n.role="presentation",n.style.margin="0px",this.addLocalisation(()=>{n.ariaLabel=this.localeManager.t(i.ariaLabel.id,i.ariaLabel.params)}),this.setParent(e.params,e.result)}if(Pu("text",e)){const{params:i,result:s}=e;this.initElement(i,s),this.setParent(e.params,e.result)}if(Pu("listswitch",e)){const{params:i,result:s}=e;this.initInteract(i,s),s.setTextContent(i.textContent),s.setChecked(i.ariaChecked),s.setAriaDescribedBy(i.ariaDescribedBy),this.setParent(e.params,e.result)}if(Pu("region",e)){const{params:i,result:s}=e,n=s.getElement();this.initInteract(i,s),n.role="region",this.setParent(e.params,e.result)}return e.result}initElement(t,e){const i=e.getElement();return ee(i,"id",t.id),fa(i,"cursor",t.cursor),i.classList.toggle("ag-charts-proxy-elem",!0),i}initInteract(t,e){const{tabIndex:i,domIndex:s}=t,n=this.initElement(t,e);i!==void 0&&(n.tabIndex=i),s!==void 0&&(e.domIndex=s)}setParent(t,e){if("parent"in t)t.parent?.addChild(e);else{const i={where:t.where,query:".ag-charts-series-area"};this.domManager.addChild("canvas-proxy",t.domManagerId,e.getElement(),i)}}}}}),N5=I({"packages/ag-charts-locale/src/ar-EG.ts"(){"use strict"}}),O5=I({"packages/ag-charts-locale/src/bg-BG.ts"(){"use strict"}}),w5=I({"packages/ag-charts-locale/src/cs-CZ.ts"(){"use strict"}}),E5=I({"packages/ag-charts-locale/src/da-DK.ts"(){"use strict"}}),R5=I({"packages/ag-charts-locale/src/de-DE.ts"(){"use strict"}}),_5=I({"packages/ag-charts-locale/src/el-GR.ts"(){"use strict"}}),EI,P5=I({"packages/ag-charts-locale/src/en-US.ts"(){"use strict";EI={ariaAnnounceHoverDatum:"${datum}",ariaAnnounceChart:"chart, ${seriesCount}[number] series",ariaAnnounceHierarchyChart:"hierarchy chart, ${caption}",ariaAnnounceGaugeChart:"gauge chart, ${caption}",ariaAnnounceHierarchyDatum:"level ${level}[number], ${count}[number] children, ${description}",ariaAnnounceFlowProportionLink:"link ${index} of ${count}, from ${from} to ${to}, ${sizeName} ${size}",ariaAnnounceFlowProportionNode:"node ${index} of ${count}, ${description}",ariaDescriptionLegendItem:"Press Space or Enter to toggle visibility",ariaLabelAddHorizontalLine:"Add Horizontal Line",ariaLabelAnnotationOptionsToolbar:"Annotation Options",ariaLabelAnnotationSettingsDialog:"Annotation Settings",ariaLabelColorPicker:"Color picker",ariaLabelFinancialCharts:"Financial Charts",ariaLabelLegend:"Legend",ariaLabelLegendPagination:"Legend Pagination",ariaLabelLegendPagePrevious:"Previous Legend Page",ariaLabelLegendPageNext:"Next Legend Page",ariaLabelLegendItem:"${label}, Legend item ${index}[number] of ${count}[number]",ariaLabelLegendItemUnknown:"Unknown legend item",ariaLabelNavigator:"Navigator",ariaLabelNavigatorRange:"Range",ariaLabelNavigatorMinimum:"Minimum",ariaLabelNavigatorMaximum:"Maximum",ariaLabelRangesToolbar:"Ranges",ariaLabelSettingsTabBar:"Settings",ariaLabelZoomToolbar:"Zoom",ariaValuePanRange:"${min}[percent] to ${max}[percent]",iconAltTextLineStyleSolid:"Solid",iconAltTextLineStyleDashed:"Long-dashed",iconAltTextLineStyleDotted:"Short-dashed",iconAltTextPositionTop:"Top",iconAltTextPositionCenter:"Center",iconAltTextPositionBottom:"Bottom",iconAltTextAlignLeft:"Left",iconAltTextAlignCenter:"Center",iconAltTextAlignRight:"Right",iconAltTextClose:"Close",overlayLoadingData:"Loading data...",overlayNoData:"No data to display",overlayNoVisibleSeries:"No visible series",overlayUnsupportedBrowser:"Incompatible browser version. Please upgrade your browser.",seriesHistogramTooltipFrequency:"Frequency",seriesHistogramTooltipSum:"${yName} (sum)",seriesHistogramTooltipCount:"${yName} (count)",seriesHistogramTooltipMean:"${yName} (mean)",toolbarSeriesTypeDropdown:"Chart Type",toolbarSeriesTypeOHLC:"OHLC",toolbarSeriesTypeHLC:"HLC",toolbarSeriesTypeHighLow:"High Low",toolbarSeriesTypeCandles:"Candles",toolbarSeriesTypeHollowCandles:"Hollow Candles",toolbarSeriesTypeLine:"Line",toolbarSeriesTypeLineWithMarkers:"Line with Markers",toolbarSeriesTypeStepLine:"Step Line",toolbarAnnotationsTrendLine:"Trend Line",toolbarAnnotationsFibonacciRetracement:"Fib Retracement",toolbarAnnotationsFibonacciRetracementTrendBased:"Fib Trend Based",toolbarAnnotationsHorizontalLine:"Horizontal Line",toolbarAnnotationsVerticalLine:"Vertical Line",toolbarAnnotationsParallelChannel:"Parallel Channel",toolbarAnnotationsDisjointChannel:"Disjoint Channel",toolbarAnnotationsClearAll:"Clear All",toolbarAnnotationsFillColor:"Fill Color",toolbarAnnotationsLineColor:"Line Color",toolbarAnnotationsLineStyle:"Line Style",toolbarAnnotationsLineStrokeWidth:"Line Stroke Width",toolbarAnnotationsSettings:"Settings",toolbarAnnotationsTextColor:"Text Color",toolbarAnnotationsTextSize:"Text Size",toolbarAnnotationsLock:"Lock",toolbarAnnotationsUnlock:"Unlock",toolbarAnnotationsDelete:"Delete",toolbarAnnotationsDragHandle:"Drag Toolbar",toolbarAnnotationsLineAnnotations:"Trend Lines",toolbarAnnotationsFibonacciAnnotations:"Fibonacci",toolbarAnnotationsTextAnnotations:"Text Annotations",toolbarAnnotationsShapeAnnotations:"Arrows",toolbarAnnotationsMeasurerAnnotations:"Measurers",toolbarAnnotationsCallout:"Callout",toolbarAnnotationsComment:"Comment",toolbarAnnotationsNote:"Note",toolbarAnnotationsText:"Text",toolbarAnnotationsArrow:"Arrow",toolbarAnnotationsArrowUp:"Arrow Up",toolbarAnnotationsArrowDown:"Arrow Down",toolbarAnnotationsDateRange:"Date Range",toolbarAnnotationsPriceRange:"Price Range",toolbarAnnotationsDatePriceRange:"Date and Price",toolbarAnnotationsQuickDatePriceRange:"Measure",toolbarRange1Month:"1M",toolbarRange1MonthAria:"1 month",toolbarRange3Months:"3M",toolbarRange3MonthsAria:"3 months",toolbarRange6Months:"6M",toolbarRange6MonthsAria:"6 months",toolbarRangeYearToDate:"YTD",toolbarRangeYearToDateAria:"Year to date",toolbarRange1Year:"1Y",toolbarRange1YearAria:"1 year",toolbarRangeAll:"All",toolbarRangeAllAria:"All",toolbarZoomZoomOut:"Zoom out",toolbarZoomZoomIn:"Zoom in",toolbarZoomPanLeft:"Pan left",toolbarZoomPanRight:"Pan right",toolbarZoomPanStart:"Pan to the start",toolbarZoomPanEnd:"Pan to the end",toolbarZoomReset:"Reset the zoom",contextMenuDownload:"Download",contextMenuToggleSeriesVisibility:"Toggle Visibility",contextMenuToggleOtherSeries:"Toggle Other Series",contextMenuZoomToCursor:"Zoom to here",contextMenuPanToCursor:"Pan to here",dialogHeaderChannel:"Channel",dialogHeaderLine:"Line",dialogHeaderFibonacciRange:"Fib Retracement",dialogHeaderDateRange:"Date Range",dialogHeaderPriceRange:"Price Range",dialogHeaderDatePriceRange:"Date and Price",dialogHeaderText:"Text",dialogInputAlign:"Align",dialogInputColorPicker:"Color",dialogInputColorPickerAltText:"Text Color",dialogInputFillColorPicker:"Fill",dialogInputFillColorPickerAltText:"Fill Color",dialogInputExtendChannelStart:"Extend channel start",dialogInputExtendChannelEnd:"Extend channel end",dialogInputExtendLineStart:"Extend line start",dialogInputExtendLineEnd:"Extend line end",dialogInputExtendAbove:"Extend above",dialogInputExtendBelow:"Extend below",dialogInputExtendLeft:"Extend left",dialogInputExtendRight:"Extend right",dialogInputReverse:"Reverse",dialogInputShowFill:"Show Fill",dialogInputFontSize:"Size",dialogInputFontSizeAltText:"Font Size",dialogInputLineStyle:"Dash",dialogInputPosition:"Position",dialogInputStrokeWidth:"Weight",dialogInputStrokeWidthAltText:"Line Weight",dialogInputFibonacciBands:"Bands",dialogInputFibonacciBandsAltText:"Fibonacci Bands",inputTextareaPlaceholder:"Add Text",measurerDateRangeBars:"${value}[number] bars",measurerPriceRangeValue:"${value}[number]",measurerPriceRangePercent:"${value}[percent]",measurerVolume:"Vol ${value}"}}}),B5=I({"packages/ag-charts-locale/src/es-ES.ts"(){"use strict"}}),z5=I({"packages/ag-charts-locale/src/fa-IR.ts"(){"use strict"}}),F5=I({"packages/ag-charts-locale/src/fi-FI.ts"(){"use strict"}}),j5=I({"packages/ag-charts-locale/src/fr-FR.ts"(){"use strict"}}),V5=I({"packages/ag-charts-locale/src/he-IL.ts"(){"use strict"}}),G5=I({"packages/ag-charts-locale/src/hr-HR.ts"(){"use strict"}}),W5=I({"packages/ag-charts-locale/src/hu-HU.ts"(){"use strict"}}),U5=I({"packages/ag-charts-locale/src/it-IT.ts"(){"use strict"}}),H5=I({"packages/ag-charts-locale/src/ja-JP.ts"(){"use strict"}}),Y5=I({"packages/ag-charts-locale/src/ko-KR.ts"(){"use strict"}}),K5=I({"packages/ag-charts-locale/src/nb-NO.ts"(){"use strict"}}),$5=I({"packages/ag-charts-locale/src/nl-NL.ts"(){"use strict"}}),X5=I({"packages/ag-charts-locale/src/pl-PL.ts"(){"use strict"}}),Z5=I({"packages/ag-charts-locale/src/pt-BR.ts"(){"use strict"}}),Q5=I({"packages/ag-charts-locale/src/pt-PT.ts"(){"use strict"}}),q5=I({"packages/ag-charts-locale/src/ro-RO.ts"(){"use strict"}}),J5=I({"packages/ag-charts-locale/src/sk-SK.ts"(){"use strict"}}),tK=I({"packages/ag-charts-locale/src/sv-SE.ts"(){"use strict"}}),eK=I({"packages/ag-charts-locale/src/tr-TR.ts"(){"use strict"}}),iK=I({"packages/ag-charts-locale/src/uk-UA.ts"(){"use strict"}}),sK=I({"packages/ag-charts-locale/src/ur-PK.ts"(){"use strict"}}),nK=I({"packages/ag-charts-locale/src/vi-VN.ts"(){"use strict"}}),aK=I({"packages/ag-charts-locale/src/zh-CN.ts"(){"use strict"}}),oK=I({"packages/ag-charts-locale/src/zh-HK.ts"(){"use strict"}}),rK=I({"packages/ag-charts-locale/src/zh-TW.ts"(){"use strict"}}),nE=I({"packages/ag-charts-locale/src/main.ts"(){"use strict";N5(),O5(),w5(),E5(),R5(),_5(),P5(),B5(),z5(),F5(),j5(),V5(),G5(),W5(),U5(),H5(),Y5(),K5(),$5(),X5(),Z5(),Q5(),q5(),J5(),tK(),eK(),iK(),sK(),nK(),aK(),oK(),rK()}}),aE,ex,oE,lK=I({"packages/ag-charts-community/src/locale/defaultMessageFormatter.ts"(){"use strict";ot(),aE=/\$\{(\w+)}(?:\[(\w+)])?/gi,ex={number:new Intl.NumberFormat("en-US"),percent:new Intl.NumberFormat("en-US",{style:"percent",minimumFractionDigits:2,maximumFractionDigits:2}),date:new Intl.DateTimeFormat("en-US",{dateStyle:"full"}),time:new Intl.DateTimeFormat("en-US",{timeStyle:"full"}),datetime:new Intl.DateTimeFormat("en-US",{dateStyle:"full",timeStyle:"full"})},oE=({defaultValue:t,variables:e})=>t?.replaceAll(aE,(i,s,n)=>{const a=e[s],o=n!=null?ex[n]:null;return n!=null&&o==null&&et.warnOnce(`Format style [${n}] is not supported`),o!=null?o.format(a):typeof a=="number"?ex.number.format(a):a instanceof Date?ex.datetime.format(a):String(a)})}}),rE,cK=I({"packages/ag-charts-community/src/locale/localeManager.ts"(){"use strict";nE(),er(),lK(),rE=class extends oo{constructor(){super(...arguments),this.localeText=void 0,this.getLocaleText=void 0}setLocaleText(t){this.localeText!==t&&(this.localeText=t,this.dispatch("locale-changed"))}setLocaleTextFormatter(t){this.getLocaleText=t,this.getLocaleText!==t&&(this.getLocaleText=t,this.dispatch("locale-changed"))}t(t,e={}){const{localeText:i=EI,getLocaleText:s}=this,n=i[t];return s?.({key:t,defaultValue:n,variables:e})??oE({key:t,defaultValue:n,variables:e})??t}}}}),ix,lE=I({"packages/ag-charts-community/src/scene/canvas/hdpiCanvas.ts"(){"use strict";Lt(),Is(),Z2(),ix=class{constructor(t){this.enabled=!0,this.width=600,this.height=300;const{width:e,height:i,canvasElement:s,willReadFrequently:n=!1}=t;this.pixelRatio=t.pixelRatio??ae("devicePixelRatio")??1,this.element=s??Ot("canvas"),this.element.style.display="block",this.element.style.width=(e??this.width)+"px",this.element.style.height=(i??this.height)+"px",this.element.width=Math.round((e??this.width)*this.pixelRatio),this.element.height=Math.round((i??this.height)*this.pixelRatio),this.context=this.element.getContext("2d",{willReadFrequently:n}),this.onEnabledChange(),this.resize(e??0,i??0,this.pixelRatio),X2(this.context)}drawImage(t,e=0,i=0){return t.drawImage(this.context.canvas,e,i)}toDataURL(t){return this.element.toDataURL(t)}resize(t,e,i){if(!(t>0&&e>0))return;const{element:s,context:n}=this;s.width=Math.round(t*i),s.height=Math.round(e*i),n.setTransform(i,0,0,i,0,0),s.style.width=t+"px",s.style.height=e+"px",this.width=t,this.height=e,this.pixelRatio=i}clear(){$2(this)}destroy(){this.element.remove(),this.element.width=0,this.element.height=0,this.context.clearRect(0,0,0,0),Object.freeze(this)}onEnabledChange(){this.element&&(this.element.style.display=this.enabled?"":"none")}},M([tl(t=>t.onEnabledChange())],ix.prototype,"enabled",2)}}),cE,hK=I({"packages/ag-charts-community/src/scene/layersManager.ts"(){"use strict";di(),q2(),cE=class{constructor(t){this.canvas=t,this.debug=Jt.create(!0,"scene"),this.layersMap=new Map,this.nextLayerId=0}get size(){return this.layersMap.size}resize(t,e,i){this.canvas.resize(t,e,i),this.layersMap.forEach(({canvas:s})=>s.resize(t,e,i))}addLayer(t){const{width:e,height:i,pixelRatio:s}=this.canvas,{name:n}=t,a=new p0({width:e,height:i,pixelRatio:s});return this.layersMap.set(a,{id:this.nextLayerId++,name:n,canvas:a}),this.debug("Scene.addLayer() - layers",this.layersMap),a}removeLayer(t){this.layersMap.has(t)&&(this.layersMap.delete(t),t.destroy(),this.debug("Scene.removeLayer() - layers",this.layersMap))}clear(){for(const t of this.layersMap.values())t.canvas.destroy();this.layersMap.clear()}}}});function uK(t){for(const e of["B","KB","MB","GB"]){if(t<1536)return`${t.toFixed(1)}${e}`;t/=1024}return`${t.toFixed(1)}TB}`}function dK(){if(!("memory"in performance))return;const{totalJSHeapSize:t,usedJSHeapSize:e,jsHeapSizeLimit:i}=performance.memory,s=[];for(const n of[e,t,i])typeof n=="number"&&s.push(uK(n));return`Heap ${s.join(" / ")}`}function hE(t,e,i,s,n={},a=ht.zero){if(!Jt.check("scene:stats","scene:stats:verbose"))return;const{layersRendered:o=0,layersSkipped:r=0,nodesRendered:l=0,nodesSkipped:c=0,opsPerformed:h=0,opsSkipped:u=0}=s??{},d=performance.now(),{start:p,...g}=e,f=Object.entries(g).map(([O,_])=>dE(O,_)).filter(O=>O!=null).join(" + "),x=Object.entries(n).map(([O,_])=>`${O}: ${JSON.stringify(_)}`).join(" ; "),m=Jt.check("scene:stats:verbose"),b=dK(),v=[`${dE("\u23F1\uFE0F",p,d)} (${f})`,`${x}`,`Layers: ${m?RI(o,r):t.size}`,m?`Nodes: ${RI(l,c)}`:null,m?`Ops: ${RI(h,u)}`:null,m&&b?b:null].filter(Es),S=new vm(O=>i.measureText(O)),A=new Map(v.map(O=>[O,S.measureLines(O)])),T=Math.max(...Array.from(A.values(),O=>O.width)),D=yK(A.values(),O=>O.height),L=2+a.x;i.save(),i.fillStyle="white",i.fillRect(L,0,T,D),i.fillStyle="black";let C=0;for(const[O,_]of A.entries())C+=_.height,i.fillText(O,L,C);i.restore()}function pK(t){const e=Vy(ae("agChartsSceneDebug")),i=[];for(const s of e)s==="layout"?i.push("seriesRoot","legend","root",/.*Axis-\d+-axis.*/):i.push(s);t.debugNodeSearch=i}function gK(t,e){t.save();for(const[i,s]of Object.entries(e)){const n=be.toCanvas(s);if(!n){et.log(`Scene.render() - no bbox for debugged node [${i}].`);continue}t.globalAlpha=.8,t.strokeStyle="red",t.lineWidth=1,t.strokeRect(n.x,n.y,n.width,n.height),t.fillStyle="red",t.strokeStyle="white",t.font="16px sans-serif",t.textBaseline="top",t.textAlign="left",t.lineWidth=2,t.strokeText(i,n.x,n.y,n.width),t.fillText(i,n.x,n.y,n.width)}t.restore()}function fK(t){const{...e}=t;for(const i of Object.keys(e))gE.has(i)||typeof e[i]!="number"&&typeof e[i]!="string"&&typeof e[i]!="boolean"&&(pE.add(i),delete e[i]);return e}function sx(t,e){if(!Jt.check(!0,"scene"))return{};let i=0;return{node:e==="json"?fK(t):t,name:t.name??t.id,dirty:t.dirty,...Array.from(t.children(),s=>sx(s,e)).reduce((s,n)=>{let{name:a}=n;const{node:{visible:o,opacity:r,zIndex:l,translationX:c,translationY:h,rotation:u,scalingX:d,scalingY:p},node:g}=n;(!o||r<=0)&&(a=`(${a})`),yt.is(g)&&g.renderToOffscreenCanvas&&(a=`*${a}*`);const f=Array.isArray(l)?`(${l.join(", ")})`:l,x=[`${(i++).toString().padStart(3,"0")}|`,`${a??""}`,`z: ${f}`,c&&`x: ${c}`,h&&`y: ${h}`,u&&`r: ${u}`,d!=null&&d!==1&&`sx: ${d}`,p!=null&&p!==1&&`sy: ${p}`].filter(v=>!!v).join(" ");let m=x,b=1;for(;s[m]!=null&&b<100;)m=`${x} (${b++})`;return s[m]=n,s},{})}}function uE(t){if(!t.dirty)return{dirtyTree:{},paths:[]};const e=Array.from(t.children(),n=>uE(n)).filter(n=>n.paths.length>0),i=yt.is(t)?t.name??t.id:t.id,s=e.length?e.flatMap(n=>n.paths).map(n=>`${i}.${n}`):[i];return{dirtyTree:{name:i,node:t,dirty:t.dirty,...e.map(n=>n.dirtyTree).filter(n=>n.dirty!=null).reduce((n,a)=>(n[a.name??""]=a,n),{})},paths:s}}function RI(t,e){const i=t+e;return`${t} / ${i} (${Math.round(100*t/i)}%)`}function dE(t,e,i){const s=i!=null?i-e:e;return`${t}: ${Math.round(s*100)/100}ms`}function yK(t,e){let i=0;for(const s of t)i+=e(s);return i}var pE,gE,mK=I({"packages/ag-charts-community/src/scene/sceneDebug.ts"(){"use strict";ot(),Lt(),di(),ln(),Rt(),pe(),Ai(),pE=new Set,gE=new Set(["gradient","zIndex","clipRect","cachedBBox","childNodeCounts","path","__zIndex","name","__scalingCenterX","__scalingCenterY","__rotationCenterX","__rotationCenterY","_previousDatum","__fill","__lineDash","borderPath","borderClipPath","_clipPath"])}}),bg,_I=I({"packages/ag-charts-community/src/scene/scene.ts"(){"use strict";Lt(),di(),Rn(),lE(),hK(),nn(),mK(),bg=class{constructor(t){this.debug=Jt.create(!0,"scene"),this.id=En(this),this.root=null,this.pendingSize=null,this.isDirty=!1,this.canvas=new ix(t),this.layersManager=new cE(this.canvas)}get width(){return this.pendingSize?.[0]??this.canvas.width}get height(){return this.pendingSize?.[1]??this.canvas.height}get pixelRatio(){return this.pendingSize?.[2]??this.canvas.pixelRatio}setContainer(t){const{element:e}=this.canvas;return e.parentElement?.removeChild(e),t.appendChild(e),this}setRoot(t){return this.root===t?this:(this.isDirty=!0,this.root?._setLayerManager(),this.root=t,t&&(t.visible=!0,t._setLayerManager(this.layersManager)),this)}clear(){this.canvas.clear()}attachNode(t){return this.appendChild(t),()=>this.removeChild(t)}appendChild(t){return this.root?.appendChild(t),this}removeChild(t){return this.root?.removeChild(t),this}download(t,e){i2(this.canvas.toDataURL(e),t?.trim()??"image")}getDataURL(t){return this.canvas.toDataURL(t)}resize(t,e,i){return t=Math.round(t),e=Math.round(e),i??(i=this.pixelRatio),t>0&&e>0&&(t!==this.width||e!==this.height||i!==this.pixelRatio)?(this.pendingSize=[t,e,i],this.isDirty=!0,!0):!1}render(t){const{debugSplitTimes:e={start:performance.now()},extraDebugStats:i,seriesRect:s}=t??{},{canvas:n,canvas:{context:a}={},root:o,pendingSize:r,width:l,height:c,pixelRatio:h}=this;if(!a)return;const u=performance.now();if(r&&(this.layersManager.resize(...r),this.pendingSize=null),o&&!o.visible){this.isDirty=!1;return}if(o?.dirty===!1&&!this.isDirty){this.debug.check()&&this.debug("Scene.render() - no-op",{tree:sx(o,"console")}),hE(this.layersManager,e,a,void 0,i,s);return}const d={ctx:a,width:l,height:c,devicePixelRatio:h,debugNodes:{}};Jt.check("scene:stats:verbose")&&(d.stats={layersRendered:0,layersSkipped:0,nodesRendered:0,nodesSkipped:0,opsPerformed:0,opsSkipped:0}),pK(d);let p=!1;if(o?.dirty!==!1&&(p=!0,n.clear()),o&&Jt.check("scene:dirtyTree")){const{dirtyTree:g,paths:f}=uE(o);Jt.create("scene:dirtyTree")("Scene.render() - dirtyTree",{dirtyTree:g,paths:f})}if(o&&p){if(o.visible&&o.preRender(d),this.debug.check()){const g=sx(o,"console");this.debug("Scene.render() - before",{canvasCleared:p,tree:g})}o.visible&&(a.save(),o.render(d),a.restore())}e["\u270D\uFE0F"]=performance.now()-u,a.verifyDepthZero?.(),this.isDirty=!1,hE(this.layersManager,e,a,d.stats,i,s),gK(a,d.debugNodes),o&&this.debug.check()&&this.debug("Scene.render() - after",{tree:sx(o,"console"),canvasCleared:p})}toSVG(){const{root:t,width:e,height:i}=this;if(t!=null)return Wo.toSVG(t,e,i)}strip(){const{context:t,pixelRatio:e}=this.canvas;t.setTransform(e,0,0,e,0,0),this.layersManager.clear(),this.setRoot(null),this.isDirty=!1}destroy(){this.strip(),this.canvas.destroy(),Object.assign(this,{canvas:void 0})}},bg.className="Scene"}}),fE,xK=I({"packages/ag-charts-community/src/util/callbackCache.ts"(){"use strict";ot(),fE=class{constructor(){this.cache=new WeakMap}call(t,...e){let i,s=this.cache.get(t);try{i=JSON.stringify(e)}catch{return this.invoke(t,e,s)}return s==null&&(s=new Map,this.cache.set(t,s)),s.has(i)?s.get(i):this.invoke(t,e,s,i)}invoke(t,e,i,s){try{const n=t(...e);return i&&s!=null&&i.set(s,n),n}catch(n){et.warnOnce("User callback errored, ignoring",n);return}}invalidateCache(){this.cache=new WeakMap}}}}),yE,bK=I({"packages/ag-charts-community/src/chart/annotation/annotationManager.ts"(){"use strict";ot(),al(),oe(),yE=class extends ir{constructor(t){super(),this.annotationRoot=t,this.mementoOriginatorKey="annotations",this.annotations=[]}createMemento(){return this.annotations}guardMemento(t){return t==null||ne(t)}restoreMemento(t,e,i){this.annotations=this.cleanData(i??[]).map(s=>{const n=this.getAnnotationTypeStyles(s.type);return Tt(s,n)}),this.listeners.dispatch("restore-annotations",{type:"restore-annotations",annotations:this.annotations})}updateData(t){this.annotations=this.cleanData(t??[])}attachNode(t){return this.annotationRoot.append(t),()=>(this.annotationRoot?.removeChild(t),this)}setAnnotationStyles(t){this.styles=t}getAnnotationTypeStyles(t){return this.styles?.[t]}cleanData(t){for(const e of t)"textAlign"in e&&delete e.textAlign;return t}}}}),mE,SK=I({"packages/ag-charts-community/src/chart/axis/axisManager.ts"(){"use strict";pe(),mE=class{constructor(t){this.sceneRoot=t,this.axes=new Map,this.axisGridGroup=new yt({name:"Axes-Grids",zIndex:1}),this.axisGroup=new yt({name:"Axes",zIndex:2}),this.axisLabelGroup=new yt({name:"Axes-Labels",zIndex:13}),this.axisCrosslineRangeGroup=new yt({name:"Axes-Crosslines-Range",zIndex:4}),this.axisCrosslineLineGroup=new yt({name:"Axes-Crosslines-Line",zIndex:8}),this.axisCrosslineLabelGroup=new yt({name:"Axes-Crosslines-Label",zIndex:13}),this.sceneRoot.appendChild(this.axisGroup),this.sceneRoot.appendChild(this.axisGridGroup),this.sceneRoot.appendChild(this.axisLabelGroup),this.sceneRoot.appendChild(this.axisCrosslineRangeGroup),this.sceneRoot.appendChild(this.axisCrosslineLineGroup),this.sceneRoot.appendChild(this.axisCrosslineLabelGroup)}updateAxes(t,e){const i={axisNode:this.axisGroup,gridNode:this.axisGridGroup,labelNode:this.axisLabelGroup,crossLineRangeNode:this.axisCrosslineRangeGroup,crossLineLineNode:this.axisCrosslineLineGroup,crossLineLabelNode:this.axisCrosslineLabelGroup};for(const s of t)e.includes(s)||(s.detachAxis(i),s.destroy());for(const s of e)t?.includes(s)||s.attachAxis(i);this.axes.clear();for(const s of e){const n=s.createAxisContext();this.axes.has(n.direction)?this.axes.get(n.direction)?.push(n):this.axes.set(n.direction,[n])}}getAxisContext(t){return this.axes.get(t)??[]}destroy(){this.axes.clear(),this.sceneRoot.removeChild(this.axisGroup),this.sceneRoot.removeChild(this.axisGridGroup)}}}}),Sg,xE=I({"packages/ag-charts-community/src/chart/data/dataService.ts"(){"use strict";ot(),di(),er(),Is(),Sg=class extends oo{constructor(t){super(),this.animationManager=t,this.dispatchOnlyLatest=!0,this.dispatchThrottle=0,this.requestThrottle=300,this.isLoadingInitialData=!1,this.isLoadingData=!1,this.freshRequests=[],this.requestCounter=0,this.debug=Jt.create(!0,"data-model","data-source"),this.throttledFetch=this.createThrottledFetch(this.requestThrottle),this.throttledDispatch=this.createThrottledDispatch(this.dispatchThrottle)}updateCallback(t){typeof t=="function"&&(this.debug("DataService - updated data source callback"),this.dataSourceCallback=t,this.isLoadingInitialData=!0,this.animationManager.skip(),this.dispatch("data-source-change"))}clearCallback(){this.dataSourceCallback=void 0}load(t){this.isLoadingData=!0,this.throttledFetch(t)}isLazy(){return this.dataSourceCallback!=null}isLoading(){return this.isLazy()&&(this.isLoadingInitialData||this.isLoadingData)}createThrottledFetch(t){return HN(e=>this.fetch(e).catch(i=>et.error("callback failed",i)),t,{leading:!1,trailing:!0})}createThrottledDispatch(t){return HN((e,i)=>{this.debug(`DataService - dispatching 'data-load' | ${e}`),this.dispatch("data-load",{type:"data-load",data:i})},t,{leading:!0,trailing:!0})}async fetch(t){if(!this.dataSourceCallback)throw new Error("DataService - [dataSource.getData] callback not initialised");const e=performance.now(),i=this.requestCounter++;this.debug(`DataService - requesting | ${i}`),this.freshRequests.push(i);let s;try{s=await this.dataSourceCallback(t),this.debug(`DataService - response | ${performance.now()-e}ms | ${i}`)}catch(a){this.debug(`DataService - request failed | ${i}`),et.errorOnce(`DataService - request failed | [${a}]`)}this.isLoadingInitialData=!1;const n=this.freshRequests.findIndex(a=>a===i);if(n===-1||this.dispatchOnlyLatest&&n!==this.freshRequests.length-1){this.debug(`DataService - discarding stale request | ${i}`);return}this.freshRequests=this.freshRequests.slice(n+1),this.freshRequests.length===0&&(this.isLoadingData=!1),Array.isArray(s)?this.throttledDispatch(i,s):this.dispatch("data-error")}},M([js({newValue(t){this.throttledDispatch=this.createThrottledDispatch(t)}})],Sg.prototype,"dispatchThrottle",2),M([js({newValue(t){this.throttledFetch=this.createThrottledFetch(t)}})],Sg.prototype,"requestThrottle",2)}}),PI,vK=I({"packages/ag-charts-community/src/chart/interaction/animationBatch.ts"(){"use strict";ot(),fc(),di(),PI=class{constructor(t){this.maxAnimationTime=t,this.debug=Jt.create(!0,"animation"),this.controllers=new Map,this.stoppedCbs=new Set,this.currentPhase=0,this.phases=new Map(gc.map(e=>[e,[]])),this.skipAnimations=!1,this.animationTimeConsumed=0,this.isReady=!1}get size(){return this.controllers.size}get consumedTimeMs(){return this.animationTimeConsumed}isActive(){return this.controllers.size>0}getActiveControllers(){return this.phases.get(gc[this.currentPhase])??[]}checkOverlappingId(t){t!=null&&this.controllers.has(t)&&(this.controllers.get(t).stop(),this.debug(`Skipping animation batch due to update of existing animation: ${t}`),this.skip())}addAnimation(t){if(t.isComplete)return;if(gc.indexOf(t.phase)=0&&e?.splice(i,1)}progress(t){if(!this.isReady)return;let e=t===0?.01:t;const i=()=>{const c=gc[this.currentPhase];return{phaseControllers:[...this.getActiveControllers()],phase:c,phaseMeta:yu[c]}};let{phase:s,phaseControllers:n,phaseMeta:a}=i();const o=()=>gc[this.currentPhase]==null,r=()=>{for({phase:s,phaseControllers:n,phaseMeta:a}=i();!o()&&n.length===0;)this.currentPhase++,{phase:s,phaseControllers:n,phaseMeta:a}=i(),this.debug(`AnimationBatch - phase changing to ${s}`,{unusedTime:e},n)},l=this.controllers.size;this.debug(`AnimationBatch - ${t}ms; phase ${s} with ${n?.length} of ${l}`);do{const c=e,h=a.skipIfNoEarlierAnimations&&this.animationTimeConsumed===0;let u=0;for(const d of n)h?d.stop():e=Math.min(d.update(c),e),d.isComplete&&(u++,this.removeAnimation(d));this.animationTimeConsumed+=c-e,this.debug(`AnimationBatch - updated ${n.length} controllers; ${u} completed`),this.debug(`AnimationBatch - animationTimeConsumed: ${this.animationTimeConsumed}`),r()}while(e>0&&!o());this.animationTimeConsumed>this.maxAnimationTime&&(this.debug("Animation batch exceeded max animation time, skipping",[...this.controllers]),this.stop())}ready(){if(this.isReady)return;this.isReady=!0,this.debug(`AnimationBatch - ready; skipped: ${this.skipAnimations}`,[...this.controllers]);let t=!0;for(const[,e]of this.controllers)if(e.duration>0&&yu[e.phase].skipIfNoEarlierAnimations!==!0){t=!1;break}if(!t)for(const[,e]of this.controllers)e.autoplay&&e.play(!0)}skip(t=!0){if(this.skipAnimations===!1&&t===!0){for(const e of this.controllers.values())e.stop();this.controllers.clear()}this.skipAnimations=t}play(){for(const t of this.controllers.values())t.play()}stop(){for(const t of this.controllers.values())try{t.stop(),this.removeAnimation(t)}catch(e){et.error("Error during animation stop",e)}this.dispatchStopped()}stopByAnimationId(t){if(t!=null&&this.controllers.has(t)){const e=this.controllers.get(t);e&&(e.stop(),this.removeAnimation(e))}}stopByAnimationGroupId(t){for(const e of this.controllers.values())e.groupId===t&&this.stopByAnimationId(e.id)}dispatchStopped(){this.stoppedCbs.forEach(t=>t()),this.stoppedCbs.clear()}isSkipped(){return this.skipAnimations}destroy(){this.stop(),this.controllers.clear()}}}}),BI,zI,bE=I({"packages/ag-charts-community/src/chart/interaction/interactionManager.ts"(){"use strict";BI=(t=>(t[t.Default=32]="Default",t[t.ZoomDrag=16]="ZoomDrag",t[t.Annotations=8]="Annotations",t[t.ContextMenu=4]="ContextMenu",t[t.Animation=2]="Animation",t[t.AnnotationsSelected=1]="AnnotationsSelected",t[t.Clickable=41]="Clickable",t[t.Focusable=34]="Focusable",t[t.Keyable=43]="Keyable",t[t.ContextMenuable=36]="ContextMenuable",t[t.AnnotationsMoveable=9]="AnnotationsMoveable",t[t.AnnotationsDraggable=57]="AnnotationsDraggable",t[t.ZoomDraggable=50]="ZoomDraggable",t[t.ZoomClickable=34]="ZoomClickable",t[t.ZoomWheelable=59]="ZoomWheelable",t[t.All=63]="All",t))(BI||{}),zI=class{constructor(){this.stateQueue=34}pushState(t){this.stateQueue|=t}popState(t){this.stateQueue&=~t}isState(t){return!!(this.stateQueue&-this.stateQueue&t)}}}});function SE(t){return t==null?!0:!isNaN(t)&&t>=0&&t<=2}var FI,vE=I({"packages/ag-charts-community/src/chart/interaction/animationManager.ts"(){"use strict";ot(),Lt(),fc(),di(),vK(),FI=class{constructor(t,e){this.interactionManager=t,this.chartUpdateMutex=e,this.defaultDuration=1e3,this.batch=new PI(this.defaultDuration*1.5),this.debug=Jt.create(!0,"animation"),this.events=new jy,this.rafAvailable=typeof requestAnimationFrame<"u",this.isPlaying=!0,this.requestId=null,this.skipAnimations=!0,this.currentAnonymousAnimationId=0}addListener(t,e){return this.events.on(t,e)}animate(t){const e=this.batch;try{e.checkOverlappingId(t.id)}catch(r){this.failsafeOnError(r);return}let{id:i}=t;i==null&&(i=`__${this.currentAnonymousAnimationId}`,this.currentAnonymousAnimationId+=1);const s=this.isSkipped()||t.phase==="none";s&&this.debug("AnimationManager - skipping animation");const{delay:n,duration:a}=t;if(!SE(n))throw new Error(`Animation delay of ${n} is unsupported (${i})`);if(!SE(a))throw new Error(`Animation duration of ${a} is unsupported (${i})`);const o=new HM({...t,id:i,skip:s,autoplay:this.isPlaying?t.autoplay:!1,phase:t.phase,defaultDuration:this.defaultDuration});if(!this.forceTimeJump(o,this.defaultDuration))return this.batch.addAnimation(o),o}play(){if(!this.isPlaying){this.isPlaying=!0,this.debug("AnimationManager.play()");try{this.batch.play()}catch(t){this.failsafeOnError(t)}this.requestAnimation()}}stop(){this.isPlaying=!1,this.cancelAnimation(),this.debug("AnimationManager.stop()"),this.batch.stop()}stopByAnimationId(t){try{this.batch.stopByAnimationId(t)}catch(e){this.failsafeOnError(e)}}stopByAnimationGroupId(t){try{this.batch.stopByAnimationGroupId(t)}catch(e){this.failsafeOnError(e)}}reset(){this.isPlaying?(this.stop(),this.play()):this.stop()}skip(t=!0){this.skipAnimations=t}isSkipped(){return!this.rafAvailable||this.skipAnimations||this.batch.isSkipped()}isActive(){return this.isPlaying&&this.batch.isActive()}skipCurrentBatch(){this.debug.check()&&this.debug("AnimationManager - skipCurrentBatch()",{stack:new Error().stack}),this.batch.skip()}isSkippingFrames(){return!0}scheduleAnimationFrame(t){this.requestId=ae().requestAnimationFrame(e=>{t(e).catch(i=>et.error(i))})}forceTimeJump(t,e){return!1}requestAnimation(){if(!this.rafAvailable||!this.batch.isActive()||this.requestId!==null)return;let t;const e=async i=>{const s=()=>{const n=i-(t??i);t=i,this.debug("AnimationManager - onAnimationFrame()",{controllersCount:this.batch.size,deltaTime:n}),this.interactionManager.pushState(2);try{this.batch.progress(n)}catch(a){this.failsafeOnError(a)}this.events.emit("animation-frame",{type:"animation-frame",deltaMs:n})};this.isSkippingFrames()?await this.chartUpdateMutex.acquireImmediately(s):await this.chartUpdateMutex.acquire(s),this.batch.isActive()?this.scheduleAnimationFrame(e):(this.batch.stop(),this.events.emit("animation-stop",{type:"animation-stop",deltaMs:this.batch.consumedTimeMs}))};this.events.emit("animation-start",{type:"animation-start",deltaMs:0}),this.scheduleAnimationFrame(e)}cancelAnimation(){this.requestId!==null&&(cancelAnimationFrame(this.requestId),this.requestId=null,this.startBatch())}failsafeOnError(t,e=!0){et.error("Error during animation, skipping animations",t),e&&this.cancelAnimation()}startBatch(t){this.debug(`AnimationManager - startBatch() with skipAnimations=${t}.`),this.reset(),this.batch.destroy(),this.batch=new PI(this.defaultDuration*1.5),t===!0&&this.batch.skip()}endBatch(){this.batch.isActive()?(this.batch.ready(),this.requestAnimation()):(this.interactionManager.popState(2),this.batch.isSkipped()&&this.batch.skip(!1))}onBatchStop(t){this.batch.stoppedCbs.add(t)}destroy(){this.stop(),this.events.clear()}}}}),jI,ME=I({"packages/ag-charts-community/src/chart/interaction/chartEventManager.ts"(){"use strict";al(),jI=class extends ir{seriesEvent(t){this.listeners.dispatch(t,{type:t})}seriesKeyNavZoom(t,e){const i={type:"series-keynav-zoom",delta:t,widgetEvent:e};this.listeners.dispatch("series-keynav-zoom",i)}legendItemClick(t,e,i,s,n){const a={type:"legend-item-click",legendType:t,series:e,itemId:i,enabled:s,legendItemName:n};this.listeners.dispatch("legend-item-click",a)}legendItemDoubleClick(t,e,i,s,n,a){const o={type:"legend-item-double-click",legendType:t,series:e,itemId:i,enabled:s,legendItemName:a,numVisibleItems:n};this.listeners.dispatch("legend-item-double-click",o)}}}}),VI,IE=I({"packages/ag-charts-community/src/chart/interaction/contextMenuRegistry.ts"(){"use strict";er(),VI=class{constructor(){this.defaultActions=[],this.disabledActions=new Set,this.hiddenActions=new Set,this.listeners=new oo}static check(t,e){return e.type===t}static checkCallback(t,e,i){return t===e}dispatchContext(t,e,i,s){const{sourceEvent:n}=e,a=s?.x??e.canvasX,o=s?.y??e.canvasY;n.stopPropagation();const r={type:t,x:a,y:o,context:i,sourceEvent:n};this.listeners.dispatch("",r)}addListener(t){return this.listeners.addListener("",t)}filterActions(t){return this.defaultActions.filter(e=>e.id!=null&&!this.hiddenActions.has(e.id)&&["all",t].includes(e.type))}registerDefaultAction(t){const e=t.id!=null&&!this.defaultActions.some(({id:i})=>i===t.id);return e&&this.defaultActions.push(t),()=>{const i=e?this.defaultActions.findIndex(({id:s})=>s===t.id):-1;i!==-1&&this.defaultActions.splice(i,1)}}enableAction(t){this.disabledActions.delete(t)}disableAction(t){this.disabledActions.add(t)}showAction(t){this.hiddenActions.add(t)}hideAction(t){this.hiddenActions.delete(t)}isDisabled(t){return this.disabledActions.has(t)}}}}),GI,AE=I({"packages/ag-charts-community/src/chart/interaction/highlightManager.ts"(){"use strict";al(),Zm(),GI=class extends ir{constructor(){super(...arguments),this.highlightStates=new jc}updateHighlight(t,e){const{activeHighlight:i}=this;this.highlightStates.set(t,e),this.activeHighlight=this.highlightStates.stateValue(),this.isEqual(this.activeHighlight,i)||this.listeners.dispatch("highlight-change",{type:"highlight-change",currentHighlight:this.activeHighlight,previousHighlight:i,callerId:t})}getActiveHighlight(){return this.activeHighlight}isEqual(t,e){return t===e||t!=null&&e!=null&&t?.series===e?.series&&t?.itemId===e?.itemId&&t?.datum===e?.datum}}}});function DE(t,e){if(t==null||e.length===0)return[!1,!1];const i=t.valueOf(),s=e[0],n=e[e.length-1];if(typeof s=="string")return[i===s,i===n];let a=s.valueOf(),o=n.valueOf();return a>o&&([a,o]=[o,a]),[i===a,i===o]}function ol(t,e,i,s,n){const{xValue:a,yValue:o}=t,[r,l]=DE(o,n),[c,h]=DE(a,s);return{datum:t,xKey:e,yKey:i,xValue:a,yValue:o,first:c,last:h,min:r,max:l}}function kE(t,[e,i],s){const n=UN(0,t-1,o=>{const r=s(o)?.[1]??NaN;return!Number.isFinite(r)||r>e})??0;let a=WN(0,t-1,o=>{const r=s(o)?.[0]??NaN;return!Number.isFinite(r)||r=0&&(r+=1),l&&r<0&&(r-=1),ce){l=!0;continue}n(c)&&(o+=1)}return o}var Gc=I({"packages/ag-charts-community/src/chart/series/util.ts"(){"use strict";ot(),Ai()}}),vg,UI=I({"packages/ag-charts-community/src/chart/interaction/tooltipManager.ts"(){"use strict";Zm(),Gc(),vg=class{constructor(t,e){this.domManager=t,this.tooltip=e,this.stateTracker=new jc,this.suppressState=new jc(!1),this.appliedState=null,e.setup(t),t.addListener("hidden",()=>this.tooltip.hide())}updateTooltip(t,e,i){this.tooltip.enabled&&(i??(i=this.stateTracker.get(t)?.content),this.stateTracker.set(t,{content:i,meta:e}),this.applyStates())}removeTooltip(t){this.tooltip.enabled&&(this.stateTracker.delete(t),this.applyStates())}suppressTooltip(t){this.suppressState.set(t,!0)}unsuppressTooltip(t){this.suppressState.delete(t)}destroy(){this.domManager.removeStyles("tooltip")}applyStates(){const t=this.stateTracker.stateId(),e=t?this.stateTracker.get(t):null;if(this.suppressState.stateValue()||e?.meta==null||e?.content==null){this.appliedState=null,this.tooltip.hide();return}const i=this.domManager.getBoundingClientRect(),s=this.tooltip.bounds==="extended"?this.domManager.getOverlayClientRect():i;if(this.appliedState?.content===e?.content){const n=this.tooltip.isVisible();this.tooltip.show(s,i,e?.meta,null,n)}else this.tooltip.show(s,i,e?.meta,e?.content);this.appliedState=e}static makeTooltipMeta(t,e,i){const{canvasX:s,canvasY:n}=t,a=e.properties.tooltip,o={canvasX:s,canvasY:n,enableInteraction:a.interaction?.enabled??!1,lastPointerEvent:{type:t.type,canvasX:s,canvasY:n},showArrow:a.showArrow,position:{type:a.position.type,xOffset:a.position.xOffset,yOffset:a.position.yOffset}},r=WI(e,i);return(a.position.type==="node"||a.position.type==="sparkline")&&r?{...o,canvasX:r.canvasX,canvasY:r.canvasY}:o}isEnteringInteractiveTooltip(t){const{tooltip:e}=this,i=t.sourceEvent.relatedTarget;return e.interactive&&e.enabled&&e.isVisible()&&e.contains(i)}}}});function HI(t,e,i){const{offsetX:s,offsetY:n,clientX:a,clientY:o,currentX:r,currentY:l,sourceEvent:c}=i;return{type:e,device:t,offsetX:s,offsetY:n,clientX:a,clientY:o,currentX:r,currentY:l,sourceEvent:c}}function TE(t,e){const i=t*t+e*e,s=YI*YI;return i>=s}var YI,CE,KI,NE=I({"packages/ag-charts-community/src/chart/interaction/dragInterpreter.ts"(){"use strict";er(),YI=3,CE=505,KI=class{constructor(t){this.destroyFns=[],this.listeners=new oo,this.isDragging=!1,this.touch={distanceTravelledX:0,distanceTravelledY:0,clientX:0,clientY:0},this.destroyFns.push(t.addListener("touchstart",this.onTouchStart.bind(this)),t.addListener("touchmove",this.onTouchMove.bind(this)),t.addListener("touchend",this.onTouchEnd.bind(this)),t.addListener("mousemove",this.onMouseMove.bind(this)),t.addListener("dblclick",this.onDblClick.bind(this)),t.addListener("drag-start",this.onDragStart.bind(this)),t.addListener("drag-move",this.onDragMove.bind(this)),t.addListener("drag-end",this.onDragEnd.bind(this)))}destroy(){this.destroyFns.forEach(t=>t()),this.listeners.destroy()}addListener(t,e){return this.listeners.addListener(t,e)}dispatch(t){this.listeners.dispatch(t.type,t)}onTouchStart(t){const{clientX:e,clientY:i}=t.sourceEvent.targetTouches.item(0)??{clientX:1/0,clientY:1/0};this.touch.distanceTravelledX=0,this.touch.distanceTravelledY=0,this.touch.clientX=e,this.touch.clientY=i}onTouchMove(t){const{clientX:e,clientY:i}=t.sourceEvent.targetTouches.item(0)??{clientX:1/0,clientY:1/0};this.touch.distanceTravelledX+=Math.abs(this.touch.clientX-e),this.touch.distanceTravelledY+=Math.abs(this.touch.clientY-i),this.touch.clientX=e,this.touch.clientY=i}onTouchEnd(t){t.sourceEvent.preventDefault()}onMouseMove(t){this.dispatch(t)}onDblClick(t){this.dispatch({device:"mouse",...t})}onDragStart(t){this.dragStartEvent=t}onDragMove(t){this.dragStartEvent!=null&&TE(t.originDeltaX,t.originDeltaY)&&(this.dispatch(this.dragStartEvent),this.dispatch({...this.dragStartEvent,type:"drag-move"}),this.dragStartEvent=void 0,this.isDragging=!0),this.isDragging&&this.dispatch(t)}onDragEnd(t){if(this.isDragging){this.dispatch(t),this.isDragging=!1;return}if(t.device==="mouse"){const e=HI("mouse","click",t);this.dispatch(e)}else if(t.sourceEvent.type==="touchend"){if(TE(this.touch.distanceTravelledX,this.touch.distanceTravelledY))return;const e=HI("touch","click",t);this.dispatch(e);const i=Date.now();if(this.lastClickTime!==void 0&&i-this.lastClickTime<=CE){const s=HI(t.device,"dblclick",t);this.dispatch(s),this.lastClickTime=void 0}else this.lastClickTime=i}}}}}),nx,OE,MK=I({"packages/ag-charts-community/src/chart/interaction/widgetSet.ts"(){"use strict";qm(),NE(),nx=class extends Vc{constructor(t){super(t)}addChildToDOM(){}removeChildFromDOM(){}},OE=class{constructor(t){this.seriesWidget=new nx(t.getParent("series-area")),this.chartWidget=new nx(t.getParent("canvas-proxy")),this.containerWidget=new nx(t.getParent("canvas-container")),this.containerWidget.addChild(this.chartWidget),this.chartWidget.addChild(this.seriesWidget),this.seriesDragInterpreter=new KI(this.seriesWidget)}destroy(){this.seriesDragInterpreter.destroy(),this.seriesWidget.destroy(),this.chartWidget.destroy(),this.containerWidget.destroy()}}}});function IK(t){return{x:t.x1,y:t.y1}}function AK(t){return{x:t.x2,y:t.y2}}function DK(t){return{x:(t.x1+t.x2)/2,y:Math.min(t.y1,t.y2)}}function kK(t){return{x:(t.x1+t.x2)/2,y:(t.y1+t.y2)/2}}function LK(t){return{x:(t.x1+t.x2)/2,y:Math.max(t.y1,t.y2)}}function TK(t){return Math.abs(t.x2-t.x1)}function CK(t){return Math.abs(t.y2-t.y1)}function NK(t){return{x1:Math.round(t.x1),y1:Math.round(t.y1),x2:Math.round(t.x2),y2:Math.round(t.y2)}}function OK(t){return{x1:t.x1,y1:t.y1,x2:t.x2,y2:t.y2}}function wK(t,e){const i=wE(t),s=wE(e);return i.x1<=s.x2&&i.x2>=s.x1&&i.y1<=s.y2&&i.y2>=s.y1}function wE(t){return{x1:Math.min(t.x1,t.x2),x2:Math.max(t.x1,t.x2),y1:Math.min(t.y1,t.y2),y2:Math.max(t.y1,t.y2)}}function EK(t,e,i,s){if(typeof t=="number")return{x1:t,y1:e,x2:i,y2:s};if("width"in t)return{x1:t.x,y1:t.y,x2:t.x+t.width,y2:t.y+t.height};throw new Error(`Values can not be converted into a vector4: [${JSON.stringify(t)}] [${e}] [${i}] [${s}]`)}function RK(){return{x1:0,y1:0,x2:0,y2:0}}var ax,EE=I({"packages/ag-charts-community/src/util/vector4.ts"(){"use strict";ax={bottomCenter:LK,center:kK,clone:OK,collides:wK,end:AK,from:EK,height:CK,round:NK,start:IK,topCenter:DK,origin:RK,width:TK}}});function ox(t,e,i,s,n){return e+(s-e)*((n-t)/(i-t))}function RE(t,e,i,s,n){return t+(n-e)*((i-t)/(s-e))}function _E(t,e,i){return[RE(t,i.min,e,i.max,0),RE(t,i.min,e,i.max,1)]}function _K(t,e,i){const[s,n]=_E(t.x1,t.x2,e),[a,o]=_E(t.y1,t.y2,i);return{x1:s,x2:n,y1:a,y2:o}}function PE(t,e,i,s,n,a){if(i<=n&&a<=s)return i;const o=n-i,r=a-s,l=Math.abs(o)Zi((e,i)=>!Wt.is(t?.scale)&&!da.is(t?.scale)||e==null||i.end==null?!0:e<=i.end,"to be less than end"),XI=class extends ir{constructor(t,e){super(),this.fireChartEvent=t,this.mementoOriginatorKey="zoom",this.axisZoomManagers=new Map,this.state=new jc(void 0,"initial"),this.axes=[],this.didLayoutAxes=!1,this.autoScaleYAxis=new zE,this.lastRestoredState=void 0,this.independentAxes=!1,this.navigatorModule=!1,this.zoomModule=!1,this.pendingMemento=void 0,this.destroyFns.push(e.addListener("layout:complete",()=>{const{pendingMemento:i}=this,s=!this.didLayoutAxes;this.didLayoutAxes=!0,i?this.restoreMemento(i.version,i.mementoVersion,i.memento):s&&this.autoScaleYZoom("zoom-manager")}))}createMemento(){return this.getMementoRanges()}guardMemento(t,e){if(t==null)return!0;if(!bi(t))return!1;for(const o of Object.keys(t))if(!BE.includes(o))return!1;const i=this.getPrimaryAxis("x"),s=this.getPrimaryAxis("y"),n={rangeX:{start:kp($r(Xa,Lp),$I(i)),end:$r(Xa,Lp)},rangeY:{start:kp($r(Xa,Lp),$I(s)),end:$r(Xa,Lp)},ratioX:{start:kp(Tp,TM("end")),end:Tp},ratioY:{start:kp(Tp,TM("end")),end:Tp},autoScaledAxes:Hy(j3("y"))},a=Wy(t,n);return a.errors.length>0?(e.push(...a.errors.map(o=>o.message)),!1):!0}restoreMemento(t,e,i){const{independentAxes:s}=this;if(!this.axes||!this.didLayoutAxes){this.pendingMemento={version:t,mementoVersion:e,memento:i};return}this.pendingMemento=void 0;const n=this.getDefinedZoom();if(i?.rangeX?n.x=this.rangeToRatio(i.rangeX,"x")??{min:0,max:1}:i?.ratioX?n.x={min:i.ratioX.start??0,max:i.ratioX.end??1}:n.x={min:0,max:1},!this.navigatorModule||this.zoomModule){let r=i?.autoScaledAxes?.includes("y");i?.rangeY?(n.y=this.rangeToRatio(i.rangeY,"y")??{min:0,max:1},r??(r=!1)):i?.ratioY?(n.y={min:i.ratioY.start??0,max:i.ratioY.end??1},r??(r=!1)):(n.y={min:0,max:1},r??(r=!0)),n.autoScaleYAxis=r}if(this.lastRestoredState=n,s!==!0){this.updateZoom("zoom-manager",n);return}const a=this.getPrimaryAxis("x"),o=this.getPrimaryAxis("y");for(const r of[a,o])r&&this.updateAxisZoom("zoom-manager",r.id,n[r.direction])}updateAxes(t){this.axes=t;const e=new Map(t.map(i=>[i.id,this.axisZoomManagers.get(i.id)]));this.axisZoomManagers.clear();for(const i of t)this.axisZoomManagers.set(i.id,e.get(i.id)??new FE(i));this.state.size>0&&t.length>0&&this.updateZoom(this.state.stateId(),this.state.stateValue())}setIndependentAxes(t=!0){this.independentAxes=t}setAutoScaleYAxis(t,e){this.autoScaleYAxis.enabled=t,this.autoScaleYAxis.padding=e}setNavigatorEnabled(t=!0){this.navigatorModule=t}setZoomModuleEnabled(t=!0){this.zoomModule=t}isZoomEnabled(){return this.zoomModule}updateZoom(t,e){if(e?.x&&(e.x.min<0||e.x.max>1)&&(et.warnOnce(`Attempted to update x-axis zoom to an invalid ratio of [{ min: ${e.x.min}, max: ${e.x.max} }], expecting a ratio of 0 to 1, ignoring.`),e.x=void 0),e?.y&&(e.y.min<0||e.y.max>1)&&(et.warnOnce(`Attempted to update y-axis zoom to an invalid ratio of [{ min: ${e.y.min}, max: ${e.y.max} }], expecting a ratio of 0 to 1, ignoring.`),e.y=void 0),this.axisZoomManagers.size===0){const s=this.state.stateId();(s==="initial"||s===t)&&this.state.set(t,e);return}this.state.set(t,e);const i=e?.autoScaleYAxis;i!=null&&(this.autoScaleYAxis.manuallyAdjusted=!i),this.axisZoomManagers.forEach(s=>{s.updateZoom(t,e?.[s.getDirection()])}),this.applyChanges(t)}updateAxisZoom(t,e,i){this.axisZoomManagers.get(e)?.updateZoom(t,i),this.applyChanges(t)}resetZoom(t){this.autoScaleYAxis.manuallyAdjusted=!1;const e=this.getRestoredZoom();this.updateZoom(t,{x:{min:e?.x?.min??0,max:e?.x?.max??1},y:{min:e?.y?.min??0,max:e?.y?.max??1},autoScaleYAxis:e?.autoScaleYAxis??!0})}resetAxisZoom(t,e){const s=this.axisZoomManagers.get(e)?.getDirection();if(s==null)return;const n=this.getRestoredZoom();if(s==="y"){const a=n?.autoScaleYAxis??!0;this.autoScaleYAxis.manuallyAdjusted=!a}this.updateAxisZoom(t,e,n?.[s]??{min:0,max:1})}setAxisManuallyAdjusted(t,e){this.axisZoomManagers.get(e)?.getDirection()==="y"&&(this.autoScaleYAxis.manuallyAdjusted=!0)}updatePrimaryAxisZoom(t,e,i){const s=this.getPrimaryAxis(e);s&&this.updateAxisZoom(t,s.id,i)}panToBBox(t,e,i){if(!this.isZoomEnabled())return!1;const s=this.getZoom();if(s===void 0||!s.x&&!s.y)return!1;if(!(e.width>0&&e.height>0&&Math.abs(i.width)<=Math.abs(e.width)&&Math.abs(i.height)<=Math.abs(e.height)))return et.warnOnce("cannot pan to target BBox - chart too small?"),!1;const a=PK(e,s,i);return this.independentAxes?(this.updatePrimaryAxisZoom(t,"x",a.x),this.updatePrimaryAxisZoom(t,"y",a.y)):this.updateZoom(t,a),!0}fireZoomPanStartEvent(t){this.listeners.dispatch("zoom-pan-start",{type:"zoom-pan-start",callerId:t})}extendToEnd(t,e,i){return this.extendWith(t,e,s=>Number(s)-i)}extendWith(t,e,i){const s=this.getPrimaryAxis(e);if(!s)return;const n=this.getDomainExtents(s);if(!n)return;const[,a]=n,o=i(a),r=this.rangeToRatio({start:o,end:a},e);r&&this.updateZoom(t,{[e]:r})}updateWith(t,e,i){const s=this.getPrimaryAxis(e);if(!s)return;const n=this.getDomainExtents(s);if(!n)return;let[a,o]=n;[a,o]=i(a,o);const r=this.rangeToRatio({start:a,end:o},e);r&&this.updateZoom(t,{[e]:r})}getZoom(){let t,e;if(this.axisZoomManagers.forEach(i=>{i.getDirection()==="x"?t??(t=i.getZoom()):i.getDirection()==="y"&&(e??(e=i.getZoom()))}),t||e)return{x:t,y:e}}getAxisZoom(t){return this.axisZoomManagers.get(t)?.getZoom()??{min:0,max:1}}getAxisZooms(){const t={};for(const[e,i]of this.axisZoomManagers.entries())t[e]={direction:i.getDirection(),zoom:i.getZoom()};return t}getRestoredZoom(){return this.lastRestoredState}getPrimaryAxisId(t){return this.getPrimaryAxis(t)?.id}isVisibleItemsCountAtLeast(t,e){const i=this.getPrimaryAxis("x"),s=this.getPrimaryAxis("y"),n=new Set;let a=0;const o=[t.x.min,t.x.max],r=[t.y.min,t.y.max];for(const l of i?.boundSeries??[]){n.add(l.id);const c=e-(a??0),h=l.getVisibleItems(o,r,c);if(a+=h,a>=e)return!0}for(const l of s?.boundSeries??[]){if(n.has(l.id))continue;const c=e-(a??0),h=l.getVisibleItems(o,r,c);if(a+=h,a>=e)return!0}return n.size===0}getMementoRanges(){const t=this.getDefinedZoom();let e;return this.autoScaleYAxis.enabled&&(e=this.autoScaleYAxis.manuallyAdjusted?[]:["y"]),{rangeX:this.getRangeDirection(t.x,"x"),rangeY:this.getRangeDirection(t.y,"y"),ratioX:{start:t.x.min,end:t.x.max},ratioY:{start:t.y.min,end:t.y.max},autoScaledAxes:e}}autoScaleYZoom(t,e=!0){if(!this.isZoomEnabled())return;const{independentAxes:i,autoScaleYAxis:s}=this,n=this.getZoom();if(n?.x==null||!s.enabled||s.manuallyAdjusted)return;const{padding:a}=s;let o;if(n.x?.min===0&&n.x?.max===1?o={min:0,max:1}:i?o=this.primaryAxisZoom("y",n.x,{padding:a}):o=this.combinedAxisZoom("y",n.x,{padding:a}),o!=null){if(i){const r=this.getPrimaryAxis("y");(r==null?void 0:this.axisZoomManagers.get(r.id))?.updateZoom("zoom-manager",o)}else for(const r of this.axisZoomManagers.values())r.getDirection()==="y"&&r.updateZoom("zoom-manager",o);e&&this.applyChanges(t)}}applyChanges(t){if(this.autoScaleYZoom(t,!1),!Array.from(this.axisZoomManagers.values(),s=>s.applyChanges()).includes(!0))return;const i={};for(const[s,n]of this.axisZoomManagers.entries())i[s]=n.getZoom();this.listeners.dispatch("zoom-change",{type:"zoom-change",...this.getZoom(),axes:i,callerId:t}),this.fireChartEvent({type:"zoom",...this.getMementoRanges()})}getRangeDirection(t,e){const i=this.getPrimaryAxis(e);if(!i||!Wt.is(i.scale)&&!da.is(i.scale))return;const s=this.getDomainPixelExtents(i);if(!s)return;const[n,a]=s;let o,r;return n<=a?(o=i.scale.invert(0),r=i.scale.invert(n+(a-n)*t.max)):(o=i.scale.invert(n-(n-a)*t.min),r=i.scale.invert(0)),{start:o,end:r}}rangeToRatio(t,e){const i=this.getPrimaryAxis(e);if(!i)return;const s=this.getDomainPixelExtents(i);if(!s)return;const[n,a]=s;let o=t.start==null?n:i.scale.convert?.(t.start),r=t.end==null?a:i.scale.convert?.(t.end);if(!zt(o)||!zt(r))return;const[l,c]=[Math.min(n,a),Math.max(n,a)];if(oc){et.warnOnce(`Invalid range start [${t.start}], expecting a value between [${i.scale.invert?.(n)}] and [${i.scale.invert?.(a)}], ignoring.`);return}if(rc){et.warnOnce(`Invalid range end [${t.end}], expecting a value between [${i.scale.invert?.(n)}] and [${i.scale.invert?.(a)}], ignoring.`);return}o=Math.min(c,Math.max(l,o)),r=Math.min(c,Math.max(l,r));const h=a-n,u=Math.abs((o-n)/h),d=Math.abs((r-n)/h);return{min:u,max:d}}getPrimaryAxis(t){return this.axes?.find(e=>e.direction===t)}getDomainExtents(t){const{domain:e}=t.scale,i=e.at(0),s=e.at(-1);if(!(i==null||s==null))return[i,s]}getDomainPixelExtents(t){const{domain:e}=t.scale,i=t.scale.convert?.(e.at(0)),s=t.scale.convert?.(e.at(-1));if(!(!zt(i)||!zt(s)))return[i,s]}getDefinedZoom(){const t=this.getZoom();return{x:{min:t?.x?.min??0,max:t?.x?.max??1},y:{min:t?.y?.min??0,max:t?.y?.max??1}}}zoomBounds(t,e,i,s){const n=t.scale,a=n.range;n.range=[0,1];const o=e.scale,r=o.range;o.range=[0,1];let l=1,c=!1,h=0,u=!1;for(const g of e.boundSeries){const{connectsToYAxis:f}=g,x=g.getRange("y",[i.min,i.max]);for(const m of x){const b=o.convert(m);Number.isFinite(b)&&(bh&&(h=b,u=!f||m>0))}}if(zt(e.min)&&(l=0),zt(e.max)&&(h=1),n.range=a,o.range=r,l>=h)return;const d=(c?s:0)+(u?s:0),p=Math.min((h-l)*(1+d),1);if(!(p<=0)){if(c&&u){const g=(h+l)/2;l=g-p/2,h=g+p/2}else!c&&u?h=l+p:c&&!u&&(l=h-p);return l<0?(h+=-l,l=0):h>1&&(l-=h-1,h=1),{min:l,max:h}}}primaryAxisZoom(t,e,{padding:i=0}={}){const s=t==="x"?"y":"x",n=this.getPrimaryAxis(s),a=this.getPrimaryAxis(t);if(!(n==null||a==null))return this.zoomBounds(n,a,e,i)}combinedAxisZoom(t,e,{padding:i=0}={}){const s=t==="x"?"y":"x",n=new Map;for(const l of this.axes)if(l.direction===s)for(const c of l.boundSeries)n.set(c,l);let a=1,o=0;for(const l of this.axes)if(l.direction===t)for(const c of l.boundSeries){const h=n.get(c);if(h==null)continue;const u=this.zoomBounds(h,l,e,i);if(u==null)return;a=Math.min(a,u.min),o=Math.max(o,u.max)}const r=1e-6;if(a1-r&&(o=1),!(a>o))return{min:a,max:o}}},FE=class{constructor(t){this.axis=t;const[e=0,i=1]=t.visibleRange;this.state=new jc({min:e,max:i}),this.currentZoom=this.state.stateValue()}getDirection(){return this.axis.direction}updateZoom(t,e){this.state.set(t,e)}getZoom(){return ni(this.state.stateValue())}hasChanges(){const t=this.currentZoom,e=this.state.stateValue();return t.min!==e.min||t.max!==e.max}applyChanges(){const t=this.hasChanges();return this.currentZoom=this.state.stateValue(),t}}}}),VE,zK=I({"packages/ag-charts-community/src/chart/layout/seriesLabelLayoutManager.ts"(){"use strict";Rt(),iw(),VE=class{constructor(){this.labelData=new Map}updateLabels(t,e,i=ht.zero){const s={x:-e.left,y:-e.top,width:i.width+e.left+e.right,height:i.height+e.top+e.bottom},n=new Set(t.map(o=>o.id));for(const o of this.labelData.keys())n.has(o)||this.labelData.delete(o);for(const o of t){const r=o.getLabelData();r.every(BY)&&this.labelData.set(o.id,r)}const a=zY(this.labelData,s,5);for(const o of t)o.updatePlacedLabelData?.(a.get(o.id)??[])}}}}),GE,FK=I({"packages/ag-charts-community/src/chart/legend/legendManager.ts"(){"use strict";ot(),al(),GE=class extends ir{constructor(){super(...arguments),this.mementoOriginatorKey="legend",this.legendDataMap=new Map}createMemento(){return this.getData().filter(({hideInLegend:t,isFixed:e})=>!t&&!e).map(({enabled:t,seriesId:e,itemId:i,legendItemName:s})=>({visible:t,seriesId:e,itemId:i,legendItemName:s}))}guardMemento(t){return t==null||ne(t)}restoreMemento(t,e,i){i?.forEach(s=>{const{seriesId:n,data:a}=this.getRestoredData(s)??{};!n||!a||this.updateData(n,a)}),this.update()}getRestoredData(t){const{seriesId:e,itemId:i,legendItemName:s,visible:n}=t;if(e){const o=(this.legendDataMap.get(e)??[]).map(r=>{const l=r.seriesId===e&&(!i||r.itemId===i);return l&&r.isFixed&&this.warnFixed(r.seriesId,r.itemId),!r.isFixed&&l?{...r,enabled:n}:r});return{seriesId:e,data:o}}if(!(i==null&&s==null))for(const a of this.getData()){if(i!=null&&a.itemId!==i||s!=null&&a.legendItemName!==s)continue;if(a.isFixed){this.warnFixed(a.seriesId,i);return}const o=(this.legendDataMap.get(a.seriesId)??[]).map(r=>r.itemId===i||r.legendItemName===s?{...r,enabled:n}:r);return{seriesId:a.seriesId,data:o}}}warnFixed(t,e){et.warnOnce(`The legend item with seriesId [${t}] and itemId [${e}] is not configurable, this series item cannot be toggled through the legend.`)}update(t){this.listeners.dispatch("legend-change",{type:"legend-change",legendData:t??this.getData()})}updateData(t,e=[]){this.legendDataMap.set(t,e)}clearData(){this.legendDataMap.clear()}toggleItem({enabled:t,seriesId:e,itemId:i,legendItemName:s}){if(s){this.getData().forEach(r=>{const l=(this.legendDataMap.get(r.seriesId)??[]).map(c=>c.legendItemName===s?{...c,enabled:t}:c);this.updateData(r.seriesId,l)});return}const n=this.getData(e),a=n.length===1,o=n.map(r=>i==null&&a||r.itemId===i?{...r,enabled:t}:r);this.updateData(e,o)}getData(t){return t?this.legendDataMap.get(t)??[]:[...this.legendDataMap].reduce((e,[i,s])=>e.concat(s),[])}getDatum({seriesId:t,itemId:e}={}){return this.getData(t).find(i=>i.itemId===e)}getSeriesEnabled(t){const e=this.getData(t);if(e.length>0)return e.some(i=>i.enabled)}getItemEnabled({seriesId:t,itemId:e}={}){return this.getDatum({seriesId:t,itemId:e})?.enabled??!0}}}}),WE,jK=I({"packages/ag-charts-community/src/chart/series/seriesStateManager.ts"(){"use strict";WE=class{constructor(){this.groups={}}registerSeries({internalId:t,seriesGrouping:e,visible:i,type:s}){var n;e&&((n=this.groups)[s]??(n[s]={}),this.groups[s][t]={grouping:e,visible:i})}updateSeries({internalId:t,seriesGrouping:e,visible:i,type:s}){if(!e)return;const n=this.groups[s]?.[t];n&&(n.grouping=e,n.visible=i)}deregisterSeries({internalId:t,type:e}){this.groups[e]&&delete this.groups[e][t],this.groups[e]&&Object.keys(this.groups[e]).length===0&&delete this.groups[e]}getVisiblePeerGroupIndex({type:t,seriesGrouping:e,visible:i}){if(!e)return{visibleGroupCount:i?1:0,visibleSameStackCount:i?1:0,index:0};const s=new Set,n=new Set;for(const o of Object.values(this.groups[t]??{}))o.visible&&(s.add(o.grouping.groupIndex),o.grouping.groupIndex===e.groupIndex&&n.add(o.grouping.stackIndex));const a=Array.from(s);return a.sort((o,r)=>o-r),{visibleGroupCount:a.length,visibleSameStackCount:n.size,index:a.indexOf(e.groupIndex)}}}}}),Bu,UE=I({"packages/ag-charts-community/src/chart/chartUpdateType.ts"(){"use strict";Bu=(t=>(t[t.FULL=0]="FULL",t[t.UPDATE_DATA=1]="UPDATE_DATA",t[t.PROCESS_DATA=2]="PROCESS_DATA",t[t.PERFORM_LAYOUT=3]="PERFORM_LAYOUT",t[t.SERIES_UPDATE=4]="SERIES_UPDATE",t[t.PRE_SCENE_RENDER=5]="PRE_SCENE_RENDER",t[t.SCENE_RENDER=6]="SCENE_RENDER",t[t.NONE=7]="NONE",t))(Bu||{})}}),ZI,HE=I({"packages/ag-charts-community/src/chart/updateService.ts"(){"use strict";ot(),ZI=class{constructor(t){this.updateCallback=t,this.events=new jy}addListener(t,e){return this.events.on(t,e)}removeListener(t,e){return this.events.on(t,e)}destroy(){this.events.clear()}update(t=0,e){this.updateCallback(t,e)}dispatchUpdateComplete(){this.events.emit("update-complete",{type:"update-complete"})}dispatchPreDomUpdate(){this.events.emit("pre-dom-update",{type:"pre-dom-update"})}dispatchPreSceneRender(){this.events.emit("pre-scene-render",{type:"pre-scene-render"})}dispatchProcessData({series:t}){this.events.emit("process-data",{type:"process-data",series:t})}}}}),YE,VK=I({"packages/ag-charts-community/src/chart/chartContext.ts"(){"use strict";d5(),p5(),g5(),Xw(),sE(),cK(),no(),_I(),xK(),bK(),SK(),xE(),vE(),ME(),IE(),AE(),bE(),UI(),MK(),jE(),Lw(),zK(),FK(),jK(),HE(),YE=class{constructor(t,e){this.callbackCache=new fE,this.chartEventManager=new jI,this.highlightManager=new GI,this.layoutManager=new SI,this.localeManager=new rE,this.seriesStateManager=new WE,this.stateManager=new Ew,this.seriesLabelLayoutManager=new VE,this.contextModules=[];const{scene:i,root:s,syncManager:n,container:a,fireEvent:o,updateCallback:r,updateMutex:l,styleContainer:c,chartType:h}=e;this.chartService=t,this.syncManager=n,this.domManager=new CI(a,c),this.widgets=new OE(this.domManager);const u=this.domManager.addChild("canvas","scene-canvas",i?.canvas.element);this.scene=i??new bg({canvasElement:u}),this.scene.setRoot(s),this.axisManager=new mE(s),this.legendManager=new GE,this.annotationManager=new yE(t.annotationRoot),this.chartTypeOriginator=new Cw(t),this.interactionManager=new zI,this.contextMenuRegistry=new VI,this.updateService=new ZI(r),this.proxyInteractionService=new wI(this.localeManager,this.domManager),this.historyManager=new Ow(this.chartEventManager),this.animationManager=new FI(this.interactionManager,l),this.dataService=new Sg(this.animationManager),this.tooltipManager=new vg(this.domManager,t.tooltip),this.zoomManager=new XI(o,this.layoutManager);for(const d of pa.byType("context")){if(!d.chartTypes.includes(h))continue;const p=d.moduleFactory(this);this.contextModules.push(p),this[d.contextKey]=p}}destroy(){this.animationManager.destroy(),this.highlightManager.destroy(),this.axisManager.destroy(),this.callbackCache.invalidateCache(),this.chartEventManager.destroy(),this.domManager.destroy(),this.highlightManager.destroy(),this.proxyInteractionService.destroy(),this.syncManager.destroy(),this.tooltipManager.destroy(),this.zoomManager.destroy(),this.widgets.destroy(),this.contextModules.forEach(t=>t.destroy())}}}}),QI,GK=I({"packages/ag-charts-community/src/chart/chartHighlight.ts"(){"use strict";Qt(),mt(),QI=class extends bt{constructor(){super(...arguments),this.range="tooltip"}},M([k(ie(["tooltip","node"],"a range"))],QI.prototype,"range",2)}});function WK(t,e){if(t.size!==e.size)return!1;for(const i of t)if(!e.has(i))return!1;return!0}function UK(t,e){if(t==null||e==null)return t===e;if(t.size!==e.size)return!1;for(const[i,s]of t){const n=e.get(i);if(n==null||!WK(s,n))return!1}return!0}function HK(t,e){if(t.length!==e.length)return!1;for(let i=0;is&&(i[0]=s),i[1]e&&(this.domain[0]=e),this.domain[1]Math.max(a,o.length),0);let s=1<<32-Math.clz32(e);e===s/2&&(s=s>>>1),this.maxLevelSize=s;const n=new Float64Array((s*2-1)*2).fill(NaN);for(const a of t)for(let o=0;od)&&(n[h]=r)}for(let a=s/2|0;a>=1;a=a/2|0){const o=a-1|0,r=o+a|0;for(let l=0;lf?g:f}}this.buffer=n}computeRangeInto(t,e,i,s,n,a,o){const r=n+a-1;if(r=i)return o;if(n>=e&&r1&&(s=s*2|0,a=a/2|0,this.computeRangeInto(t,e,i,s+1|0,n,a,o),this.computeRangeInto(t,e,i,s+2|0,n+a,a,o));return o}rangeBetween(t,e){if(t>e)return[NaN,NaN];const{maxLevelSize:i,buffer:s}=this,n=[1/0,-1/0];return this.computeRangeInto(s,t,e,0,0,i,n),n}get range(){const{buffer:t}=this;return[t[Wc],t[Uc]]}}}});function ZK(t){return t.map(e=>bi(e)?JSON.stringify(e):e).join("-")}function XE(t){return Number.isInteger(t)?t:Math.abs(t)>1e4?Math.trunc(t):Math.round(t*1e4)/1e4}function Gs(t){const e=t?.map(Number);return e?.every(Number.isFinite)?e:[]}function JI(t,e){return e?.get(t.id)??0}function QK(t){return"scopes"in t&&Array.isArray(t.scopes)}function tA(t,e){const i=[];for(let s=0;s{let i=e;for(const s of t)i=i[s];return i}}function JK(t){const e=(i,s)=>{s.length>0&&(et.log(`DataModel.processData() - ${i}`),et.table(s))};et.log("DataModel.processData() - processedData",t),e("Key Domains",t.domain.keys),e("Group Domains",t.domain.groups??[]),e("Value Domains",t.domain.values),e("Aggregate Domains",t.domain.aggValues??[])}var eA,Mg,iA,Vn=I({"packages/ag-charts-community/src/chart/data/dataModel.ts"(){"use strict";ot(),di(),At(),KE(),XK(),eA=Symbol("domain-ranges"),Mg=Symbol("invalid"),iA=class{constructor(t,e="standalone",i=!1){this.opts=t,this.mode=e,this.suppressFieldDotNotation=i,this.debug=Jt.create(!0,"data-model"),this.scopeCache=new Map,this.keys=[],this.values=[],this.aggregates=[],this.groupProcessors=[],this.propertyProcessors=[],this.reducers=[],this.processors=[],this.markScopeDatumInvalid=function(r,l,c,h){for(const u of r)h.has(u)||h.set(u,tA(l.length,!1)),h.get(u)[c]=!0};let s=!0;for(const r of t.props){if(r.type==="key"&&!s)throw new Error("AG Charts - internal config error: keys must come before values.");r.type==="value"&&s&&(s=!1)}const n=({matchGroupIds:r=[]})=>{for(const l of r)if(this.values.every(c=>c.groupId!==l))throw new Error(`AG Charts - internal config error: matchGroupIds properties must match defined groups (${l}).`)},a=new Set,o=new Set;for(const r of t.props){const l=r.type==="key"?a:o;switch(QK(r)&&r.scopes?.forEach(c=>l.add(c)),r.type){case"key":this.keys.push({...r,index:this.keys.length,missing:new Map});break;case"value":if(r.property==null)throw new Error(`AG Charts - internal config error: no properties specified for value definitions: ${JSON.stringify(r)}`);this.values.push({...r,index:this.values.length,missing:new Map});break;case"aggregate":n(r),this.aggregates.push({...r,index:this.aggregates.length});break;case"group-value-processor":n(r),this.groupProcessors.push({...r,index:this.groupProcessors.length});break;case"property-value-processor":this.propertyProcessors.push({...r,index:this.propertyProcessors.length});break;case"reducer":this.reducers.push({...r,index:this.reducers.length});break;case"processor":this.processors.push({...r,index:this.processors.length});break}}if(this.opts.groupByKeys||this.opts.groupByFn!=null){const r=new Set(o.values());if(a.forEach(l=>r.delete(l)),r.size>0)throw new Error(`AG Charts - scopes missing key for grouping, illegal configuration: ${[...r.values()]}`)}}resolveProcessedDataDefById(t,e){const i=this.scopeCache.get(t.id)?.get(e);if(!i)throw new Error(`AG Charts - didn't find property definition for [${e}, ${t.id}]`);return{index:i.index,def:i}}resolveProcessedDataIndexById(t,e){return this.resolveProcessedDataDefById(t,e).index}resolveKeysById(t,e,i){const s=this.resolveProcessedDataIndexById(t,e),n=i.keys[s];if(n==null)throw new Error(`AG Charts - didn't find keys for [${e}, ${t.id}]`);return n.get(t.id)}hasColumnById(t,e){return this.scopeCache.get(t.id)?.get(e)!=null}resolveColumnById(t,e,i){const s=this.resolveProcessedDataIndexById(t,e),n=i.columns?.[s];if(n==null)throw new Error(`AG Charts - didn't find column for [${e}, ${t.id}]`);return n}*forEachDatum(t,e,i){const s=e.columnScopes.findIndex(n=>n.has(t.id));for(const n of i.datumIndices[s]??[])yield e.columns[s][n]}*forEachGroupDatum(t,e){const i=e.columnScopes.findIndex(a=>a.has(t.id)),s={groupIndex:0,columnIndex:i},n=[];for(const a of e.groups){s.group=a;let o=0;for(const r of a.datumIndices[i]??n)s.datumIndex=r,s.valueIndex=o++,yield s;s.groupIndex++}}*forEachGroupDatumTuple(t,e){const s={columnIndex:e.columnScopes.findIndex(n=>n.has(t.id)),datumIndexes:[void 0,void 0,void 0]};for(const n of this.forEachGroupDatum(t,e))s.group=s.nextGroup,s.groupIndex=s.nextGroupIndex,s.nextGroup=n.group,s.nextGroupIndex=n.groupIndex,s.datumIndexes[0]=s.datumIndexes[1],s.datumIndexes[1]=s.datumIndexes[2],s.datumIndexes[2]=n.datumIndex,s.group!=null&&s.datumIndexes[1]!=null&&(yield s);s.group=s.nextGroup,s.groupIndex=s.nextGroupIndex,s.nextGroup=void 0,s.nextGroupIndex=void 0,s.datumIndexes[0]=s.datumIndexes[1],s.datumIndexes[1]=s.datumIndexes[2],s.datumIndexes[2]=void 0,s.group!=null&&s.datumIndexes[1]!=null&&(yield s)}getDomain(t,e,i,s){return this.getDomainsByType(i??"value",s)?.[this.resolveProcessedDataIndexById(t,e)]??[]}getDomainBetweenRange(t,e,[i,s],n){const a=e.map(c=>this.resolveProcessedDataIndexById(t,c)),o=a.join(":"),r=n[eA];let l=r.get(o);if(l==null){const c=a.map(h=>n.columns[h]);l=new $E(c),r.set(o,l)}return l.rangeBetween(i,s)}getDomainsByType(t,e){switch(t){case"key":return e.domain.keys;case"value":return e.domain.values;case"aggregate":return e.domain.aggValues;case"group-value-processor":return e.domain.groups;default:return null}}processData(t){const{opts:{groupByKeys:e,groupByFn:i},aggregates:s,groupProcessors:n,reducers:a,processors:o,propertyProcessors:r}=this,l=performance.now();if(e&&this.keys.length===0)return;let c=this.extractData(t);e?c=this.groupData(c):i&&(c=this.groupData(c,i(c))),n.length>0&&c.type==="grouped"&&this.postProcessGroups(c),s.length>0&&c.type==="ungrouped"?this.aggregateUngroupedData(c):s.length>0&&c.type==="grouped"&&this.aggregateGroupedData(c),r.length>0&&this.postProcessProperties(c),a.length>0&&this.reduceData(c),o.length>0&&this.postProcessData(c),this.warnDataMissingProperties(t);const h=performance.now();return c.time=h-l,this.debug.check()&&JK(c),this.processScopeCache(),c}warnDataMissingProperties(t){if(t.size!==0)for(const e of lc(this.keys,this.values))for(const[i,s]of e.missing){if(s<(t.get(i)?.length??1/0))continue;const n=i==null?"":` for ${i}`;et.warnOnce(`the key '${e.property}' was not found in any data element${n}.`)}}processScopeCache(){this.scopeCache.clear();for(const t of lc(this.keys,this.values,this.aggregates))if(t.idsMap)for(const[e,i]of t.idsMap)for(const s of i)if(!this.scopeCache.has(e))this.scopeCache.set(e,new Map([[s,t]]));else{if(this.scopeCache.get(e)?.has(s))throw new Error("duplicate definition ids on the same scope are not allowed.");this.scopeCache.get(e).set(s,t)}}valueGroupIdxLookup({matchGroupIds:t}){const e=[];for(const[i,s]of this.values.entries())(!t||s.groupId&&t.includes(s.groupId))&&e.push(i);return e}valueIdxLookup(t,e){const i=t==null||t.length===0,s=typeof e=="string"?e:e.id,n=o=>{if(o.idsMap){for(const[r,l]of o.idsMap)if(t?.includes(r)&&l.has(s))return!0}return!1},a=this.values.reduce((o,r,l)=>((r.scopes==null||i&&!r.scopes.length||r.scopes.some(h=>t?.includes(h)))&&(r.property===s||r.id===s||n(r))&&o.push(l),o),[]);if(a.length===0)throw new Error(`AG Charts - configuration error, unknown property ${JSON.stringify(e)} in scope(s) ${JSON.stringify(t)}`);return a}extractData(t){const{dataDomain:e,processValue:i,allScopesHaveSameDefs:s}=this.initDataDomainProcessor(),{keys:n,values:a}=this,{invalidData:o,invalidKeys:r,allKeyMappings:l}=this.extractKeys(n,t,i),{columns:c,columnScopes:h,partialValidDataCount:u,maxDataLength:d}=this.extractValues(o,a,t,r,i),p=g=>{const f=e.get(g),x=f.getDomain();return sr.is(f)&&x[0]>x[1]?[]:x};return{type:"ungrouped",input:{count:d},scopes:new Set(t.keys()),dataSources:t,aggregation:void 0,keys:[...l.values()],columns:c,columnScopes:h,invalidKeys:r,invalidData:o,domain:{keys:n.map(p),values:a.map(p)},defs:{allScopesHaveSameDefs:s,keys:n,values:a},partialValidDataCount:u,time:0,[eA]:new Map}}extractKeys(t,e,i){const s=new Map,n=new Map,a=new Map;let o,r;const l=(c,h)=>{const u=r.get(c);o.set(h,o.get(u)),s.has(u)&&(s.set(h,s.get(u)),n.set(h,n.get(u)))};for(const c of t){const{invalidValue:h,scopes:u}=c;o=new Map,r=new Map,a.set(c,o);for(const d of u??[]){const p=e.get(d)??[];if(r.has(p)){l(p,d);continue}const g=[];o.set(d,g),r.set(p,d);let f,x;for(let m=0;mi.get(x))).size>1)throw new Error(`AG Charts - more than one data source for: ${JSON.stringify(c)}`);const d=new Set(c.scopes),p=Ip(c.scopes),g=i.get(p),f=g.map((x,m)=>{const b=s.get(p)?.[m];let v=n(c,x,m,c.scopes);return(b||v===Mg)&&this.markScopeDatumInvalid(c.scopes,g,m,t),b?v=h:v===Mg&&(a+=1,v=h),v});o.push(f),r.push(d),l=Math.max(l,f.length)}return{columns:o,columnScopes:r,partialValidDataCount:a,maxDataLength:l}}groupData(t,e){var i;const s=new Map,{keys:n,columns:a,columnScopes:o,invalidKeys:r,invalidData:l}=t,c=t.scopes,h=new Set;for(const p of c){const g=a.map((S,A)=>A).filter(S=>!h.has(S)&&o[S].has(p));if(g.length===0)continue;for(const S of g)h.add(S);const f=new Set;for(const S of g)for(const A of o[S])f.add(A);const x=n.map(S=>S.get(p)).filter(S=>S!=null),m=a[Ip(g)],b=l?.get(p),v=r?.get(p);for(let S=0;SC[S]);if(A==null||A.length===0)throw new Error("AG Charts - no keys found for scope: "+p);const T=e?.(A)??A,D=ZK(T),L=s.get(D)??{keys:T,datumIndices:[],validScopes:c};if(s.has(D)||s.set(D,L),b?.[S]===!0){L.validScopes===c&&(L.validScopes=new Set(c.values()));for(const C of f)L.validScopes.delete(C)}if(L.validScopes.size!==0)for(const C of g)(i=L.datumIndices)[C]??(i[C]=[]),L.datumIndices[C].push(S)}}const u=[],d=[];for(const{keys:p,datumIndices:g,validScopes:f}of s.values())f?.size!==0&&(u.push(p),d.push({datumIndices:g,keys:p,aggregation:[],validScopes:f}));return{...t,type:"grouped",domain:{...t.domain,groups:u},groups:d}}aggregateUngroupedData(t){const e=this.aggregates.map(()=>[1/0,-1/0]);t.domain.aggValues=e;const{keys:i,columns:s,dataSources:n}=t,a=Ip(n.keys()),o=n.get(a);t.aggregation=o?.map((r,l)=>{const c=[];for(const[h,u]of this.aggregates.entries()){const d=this.valueGroupIdxLookup(u);let p=u.groupAggregateFunction?.()??[1/0,-1/0];const g=d.map(b=>s[b][l]),f=rx(i,a,l),x=f!=null?u.aggregateFunction(g,f):void 0;x&&(p=u.groupAggregateFunction?.(x,p)??sr.extendDomain(x,p));const m=u.finalFunction?.(p)??p;if(u.round===!0)for(const b in m)m[b]=XE(m[b]);c[h]=m,sr.extendDomain(m,e[h])}return c})}aggregateGroupedData(t){const e=this.aggregates.map(()=>[1/0,-1/0]);t.domain.aggValues=e;const{columns:i}=t;for(const[s,n]of this.aggregates.entries()){const a=this.valueGroupIdxLookup(n);for(const o of t.groups){if(o.aggregation??(o.aggregation=[]),o.validScopes?.size===0)continue;const r=o.keys;let l=n.groupAggregateFunction?.()??[1/0,-1/0];const c=Math.max(...a.map(u=>o.datumIndices[u]?.length??0));for(let u=0;ui[g][o.datumIndices[g]?.[u]]),p=n.aggregateFunction(d,r);p&&(l=n.groupAggregateFunction?.(p,l)??sr.extendDomain(p,l))}const h=n.finalFunction?.(l)??l;if(n.round===!0)for(const u in h)h[u]=XE(h[u]);o.aggregation[s]=h,sr.extendDomain(h,e[s])}}}postProcessGroups(t){const{groupProcessors:e}=this,{columnScopes:i,columns:s,invalidData:n,scopes:a}=t;for(const o of e){const r=this.valueGroupIdxLookup(o),l=o.adjust()();for(const c of t.groups)c.validScopes===a&&l(s,r,c);for(const c of r){const u=this.values[c].valueType==="category",d=s[c],p=Ip(i[c]),g=n?.get(p),f=u?new qI:new sr;for(let x=0;xh.get(o)).filter(h=>h!=null),l=r.map(()=>{}),c=e.get(o);for(let h=0;h{for(const c of lc(t,e))c.valueType==="category"?s.set(c,new qI):(s.set(c,new sr),a&&(a=(c.scopes??[]).length===i.size))};o();const r=this.buildAccessors(lc(t,e));return{dataDomain:s,processValue:(c,h,u,d)=>{let p,g;if(r.has(c.property)){try{g=r.get(c.property)(h)}catch{}p=g!=null}else p=c.property in h,g=p?h[c.property]:c.missingValue;c.forceValue!=null&&(g=p&&Zy(g)?-1*c.forceValue:c.forceValue,p=!0);const f="missingValue"in c;if(!p&&!f)if(typeof d=="string"){const x=c.missing.get(d)??0;c.missing.set(d,x+1)}else for(const x of d){const m=c.missing.get(x)??0;c.missing.set(x,m+1)}if(s.has(c)||o(),p&&c.validation?.(g,h,u)===!1)if("invalidValue"in c)g=c.invalidValue;else return this.mode!=="integrated"&&et.warnOnce(`invalid value of type [${typeof g}] for [${c.scopes} / ${c.id}] ignored:`,`[${g}]`),Mg;return c.processor&&(n.has(c)||n.set(c,c.processor()),g=n.get(c)?.(g)),s.get(c)?.extend(g),g},initDataDomain:o,scopes:i,allScopesHaveSameDefs:a}}buildAccessors(t){const e=new Map;if(this.suppressFieldDotNotation)return e;for(const i of t){if(!(i.property.includes(".")||i.property.includes("[")))continue;const n=ZE(i.property);if(n==null){et.warnOnce("Invalid property path [%s]",i.property);continue}const a=qK(n);e.set(i.property,a)}return e}}}}),sA,nA,QE=I({"packages/ag-charts-community/src/chart/data/dataController.ts"(){"use strict";Lt(),di(),$K(),Vn(),sA=class Yr{constructor(e,i){this.mode=e,this.suppressFieldDotNotation=i,this.debug=Jt.create(!0,"data-model"),this.requested=[],this.status="setup"}async request(e,i,s){if(this.status!=="setup")throw new Error("AG Charts - data request after data setup phase.");return new Promise((n,a)=>{this.requested.push({id:e,opts:s,data:i,resolve:n,reject:a})})}execute(e){if(this.status!=="setup")throw new Error("AG Charts - data request after data setup phase.");this.status="executed",this.debug("DataController.execute() - requested",this.requested);const i=this.validateRequests(this.requested);this.debug("DataController.execute() - validated",i);const s=this.mergeRequested(i);this.debug("DataController.execute() - merged",s),this.debug.check()&&(ae().processedData=[]);const n=[];for(const{data:a,ids:o,opts:r,resolves:l,rejects:c}of s){const h=e?.find(p=>KK(p,a,o,r));let u,d;if(h==null)try{u=new iA(r,this.mode,this.suppressFieldDotNotation);const p=new Map(i.map(g=>[g.id,g.data]));d=u.processData(p)}catch(p){c.forEach(g=>g(p));continue}else({dataModel:u,processedData:d}=h);n.push({opts:r,data:a,ids:o,dataModel:u,processedData:d}),this.debug.check()&&ae("processedData").push(d),d?.partialValidDataCount===0?l.forEach(p=>p({dataModel:u,processedData:d})):d?this.splitResult(u,d,o,l):c.forEach(p=>p(new Error("AG Charts - no processed data generated")))}return n}validateRequests(e){const i=[];for(const[s,n]of e.entries())s>0&&n.data.length!==e[0].data.length&&n.opts.groupByData===!1&&n.opts.groupByKeys===!1?n.reject(new Error("all series[].data arrays must be of the same length and have matching keys.")):i.push(n);return i}mergeRequested(e){const i=[];for(const s of e){const n=i.find(Yr.groupMatch(s));n?n.push(s):i.push([s])}return i.map(Yr.mergeRequests)}splitResult(e,i,s,n){for(let a=0;ah.type==="key").map(h=>h.property).join(";")}const{groupByData:n,groupByKeys:a=!1,groupByFn:o,props:r}=i,l=s(r);return([c])=>(n===!1||c.data===e)&&(c.opts.groupByKeys??!1)===a&&c.opts.groupByFn===o&&s(c.opts.props)===l}static mergeRequests(e){const i=new Set(["key","group-value-processor"]);return e.reduce((s,{id:n,data:a,resolve:o,reject:r,opts:{props:l,...c}})=>{s.ids.push(n),s.rejects.push(r),s.resolves.push(o),s.data??(s.data=a),s.opts??(s.opts={...c,props:[]});for(const h of l){const u={...h,scopes:[n],data:a};Yr.createIdsMap(n,u);const d=s.opts.props.find(p=>p.type===u.type&&(i.has(p.type)||p.data===u.data)&&Yr.deepEqual(p,u));if(!d){s.opts.props.push(u);continue}d.scopes??(d.scopes=[]),d.scopes.push(...u.scopes??[]),(d.type==="key"||d.type==="value")&&u.idsMap?.size&&Yr.mergeIdsMap(u.idsMap,d.idsMap)}return s},{ids:[],rejects:[],resolves:[],data:null,opts:null})}static mergeIdsMap(e,i){for(const[s,n]of e){const a=i.get(s);if(a==null)i.set(s,new Set(n));else for(const o of n)a.add(o)}}static createIdsMap(e,i){i.id!=null&&(i.idsMap??(i.idsMap=new Map),i.idsMap.has(e)?i.idsMap.get(e).add(i.id):i.idsMap.set(e,new Set([i.id])))}static deepEqual(e,i){if(e===i)return!0;if(e&&i&&typeof e=="object"&&typeof i=="object"){if(e.constructor!==i.constructor)return!1;let s,n;if(Array.isArray(e)){if(n=e.length,n!==i.length)return!1;for(s=n-1;s>=0;s--)if(!Yr.deepEqual(e[s],i[s]))return!1;return!0}const a=Object.keys(e);if(n=a.length,n!==Object.keys(i).length)return!1;for(s=n-1;s>=0;s--){const o=a[s];if(!Yr.skipKeys.has(o)&&(!Object.hasOwn(i,o)||!Yr.deepEqual(e[o],i[o])))return!1}return!0}return!1}},sA.skipKeys=new Set(["id","idsMap","type","scopes","data"]),nA=sA}}),qE,ro,zu=I({"packages/ag-charts-community/src/chart/factory/axisRegistry.ts"(){"use strict";qE=class{constructor(){this.axesMap=new Map,this.themeTemplates=new Map}register(t,e){this.axesMap.set(t,e.moduleFactory),e.themeTemplate&&this.setThemeTemplate(t,e.themeTemplate)}create(t,e){const i=this.axesMap.get(t);if(i)return i(e);throw new Error(`AG Charts - unknown axis type: ${t}`)}has(t){return this.axesMap.has(t)}keys(){return this.axesMap.keys()}setThemeTemplate(t,e){return this.themeTemplates.set(t,e),this}getThemeTemplate(t){return this.themeTemplates.get(t)}},ro=new qE}});function t$(t){return Yc.some(e=>e.type==="series"&&e.identifier===t)}function Hc(t){return Yc.find(e=>e.type==="series"&&e.identifier===t)?.chartTypes}function e$(t){return Hc(t)?.find(i=>i==="cartesian")==="cartesian"}function i$(t){return Hc(t)?.find(i=>i==="polar")==="polar"}function s$(t){return Hc(t)?.find(i=>i==="hierarchy")==="hierarchy"}function n$(t){return Hc(t)?.find(i=>i==="topology")==="topology"}function a$(t){return Hc(t)?.find(i=>i==="flow-proportion")==="flow-proportion"}function o$(t){return Hc(t)?.find(i=>i==="standalone")==="standalone"}function r$(t){return Hc(t)?.find(i=>i==="gauge")==="gauge"}function l$(t){return t.packageType==="enterprise"}function c$(t){if(!l$(t))throw new Error("AG Charts - internal configuration error, only enterprise modules need verification.");const e=Yc.find(i=>i.type===t.type&&("optionsKey"in i&&"optionsKey"in t?i.optionsKey===t.optionsKey:!0)&&("contextKey"in i&&"contextKey"in t?i.contextKey===t.contextKey:!0)&&i.identifier===t.identifier&&t.chartTypes.every(s=>i.chartTypes.includes(s)));return e&&(e.useCount??(e.useCount=0),e.useCount++),e!=null}function h$(){return Yc.filter(({useCount:t})=>t==null||t===0)}var Yc,Ig=I({"packages/ag-charts-community/src/chart/factory/expectedEnterpriseModules.ts"(){"use strict";Yc=[{type:"root",optionsKey:"animation",chartTypes:["cartesian","polar","hierarchy","topology","flow-proportion","standalone","gauge"]},{type:"root",optionsKey:"annotations",chartTypes:["cartesian"]},{type:"root",optionsKey:"background",chartTypes:["cartesian","polar","hierarchy","topology","flow-proportion","standalone","gauge"],optionsInnerKey:"image"},{type:"root",optionsKey:"foreground",chartTypes:["cartesian","polar","hierarchy","topology","flow-proportion","standalone","gauge"],optionsInnerKey:"image"},{type:"root",optionsKey:"chartToolbar",chartTypes:["cartesian"]},{type:"root",optionsKey:"contextMenu",chartTypes:["cartesian","polar","hierarchy","topology","flow-proportion","standalone","gauge"]},{type:"root",optionsKey:"statusBar",chartTypes:["cartesian"],identifier:"status-bar"},{type:"root",optionsKey:"dataSource",chartTypes:["cartesian","polar","hierarchy","topology","flow-proportion","standalone","gauge"]},{type:"root",optionsKey:"sync",chartTypes:["cartesian"]},{type:"root",optionsKey:"zoom",chartTypes:["cartesian","topology"]},{type:"root",optionsKey:"ranges",chartTypes:["cartesian"]},{type:"legend",optionsKey:"gradientLegend",chartTypes:["cartesian","polar","hierarchy","topology","flow-proportion","standalone","gauge"],identifier:"gradient"},{type:"root",optionsKey:"navigator",chartTypes:["cartesian"]},{type:"axis",optionsKey:"axes[]",chartTypes:["polar"],identifier:"angle-category"},{type:"axis",optionsKey:"axes[]",chartTypes:["polar"],identifier:"angle-number"},{type:"axis",optionsKey:"axes[]",chartTypes:["polar"],identifier:"radius-category"},{type:"axis",optionsKey:"axes[]",chartTypes:["polar"],identifier:"radius-number"},{type:"series",optionsKey:"series[]",chartTypes:["cartesian"],identifier:"bar",community:!0},{type:"series",optionsKey:"series[]",chartTypes:["cartesian"],identifier:"line",community:!0},{type:"axis",optionsKey:"axes[]",chartTypes:["cartesian"],identifier:"ordinal-time"},{type:"axis-option",optionsKey:"crosshair",chartTypes:["cartesian"]},{type:"series",optionsKey:"series[]",chartTypes:["cartesian"],identifier:"box-plot"},{type:"series",optionsKey:"series[]",chartTypes:["cartesian"],identifier:"candlestick"},{type:"series",optionsKey:"series[]",chartTypes:["cartesian"],identifier:"cone-funnel"},{type:"series",optionsKey:"series[]",chartTypes:["cartesian"],identifier:"funnel"},{type:"series",optionsKey:"series[]",chartTypes:["cartesian"],identifier:"ohlc"},{type:"series",optionsKey:"series[]",chartTypes:["cartesian"],identifier:"heatmap"},{type:"series",optionsKey:"series[]",chartTypes:["cartesian"],identifier:"range-area"},{type:"series",optionsKey:"series[]",chartTypes:["cartesian"],identifier:"range-bar"},{type:"series",optionsKey:"series[]",chartTypes:["cartesian"],identifier:"waterfall"},{type:"series",optionsKey:"series[]",chartTypes:["polar"],identifier:"nightingale"},{type:"series",optionsKey:"series[]",chartTypes:["polar"],identifier:"radar-area"},{type:"series",optionsKey:"series[]",chartTypes:["polar"],identifier:"radar-line"},{type:"series",optionsKey:"series[]",chartTypes:["polar"],identifier:"radial-bar"},{type:"series",optionsKey:"series[]",chartTypes:["polar"],identifier:"radial-column"},{type:"series",optionsKey:"series[]",chartTypes:["hierarchy"],identifier:"sunburst"},{type:"series",optionsKey:"series[]",chartTypes:["hierarchy"],identifier:"treemap"},{type:"series",optionsKey:"series[]",chartTypes:["topology"],identifier:"map-shape"},{type:"series",optionsKey:"series[]",chartTypes:["topology"],identifier:"map-line"},{type:"series",optionsKey:"series[]",chartTypes:["topology"],identifier:"map-marker"},{type:"series",optionsKey:"series[]",chartTypes:["topology"],identifier:"map-shape-background"},{type:"series",optionsKey:"series[]",chartTypes:["topology"],identifier:"map-line-background"},{type:"series",optionsKey:"series[]",chartTypes:["flow-proportion"],identifier:"chord"},{type:"series",optionsKey:"series[]",chartTypes:["flow-proportion"],identifier:"sankey"},{type:"series",optionsKey:"series[]",chartTypes:["standalone"],identifier:"pyramid"},{type:"series",optionsKey:"series[]",chartTypes:["gauge"],identifier:"linear-gauge"},{type:"series",optionsKey:"series[]",chartTypes:["gauge"],identifier:"radial-gauge"},{type:"series-option",optionsKey:"errorBar",chartTypes:["cartesian"],identifier:"error-bars"},{type:"context",contextKey:"sharedToolbar",chartTypes:["cartesian"]}]}}),JE,lx,aA=I({"packages/ag-charts-community/src/chart/factory/legendRegistry.ts"(){"use strict";JE=class{constructor(){this.legendMap=new Map,this.themeTemplates=new Map}register(t,{optionsKey:e,moduleFactory:i,themeTemplate:s}){this.legendMap.set(t,{optionsKey:e,moduleFactory:i}),this.themeTemplates.set(e,s)}create(t,e){const i=this.legendMap.get(t)?.moduleFactory;if(i)return i(e);throw new Error(`AG Charts - unknown legend type: ${t}`)}getThemeTemplates(){return Object.fromEntries(this.themeTemplates)}getKeys(){return Array.from(this.legendMap.entries()).reduce((t,[e,i])=>(t[e]=i.optionsKey,t),{})}},lx=new JE}}),oA,tR,de,rA,cx,Fu=I({"packages/ag-charts-community/src/chart/factory/chartTypes.ts"(){"use strict";oe(),oA=class extends Map{get(t){return super.get(t)??"unknown"}isCartesian(t){return this.get(t)==="cartesian"}isPolar(t){return this.get(t)==="polar"}isHierarchy(t){return this.get(t)==="hierarchy"}isTopology(t){return this.get(t)==="topology"}isFlowProportion(t){return this.get(t)==="flow-proportion"}isStandalone(t){return this.get(t)==="standalone"}isGauge(t){return this.get(t)==="gauge"}get seriesTypes(){return Array.from(this.keys())}get cartesianTypes(){return this.seriesTypes.filter(t=>this.isCartesian(t))}get polarTypes(){return this.seriesTypes.filter(t=>this.isPolar(t))}get hierarchyTypes(){return this.seriesTypes.filter(t=>this.isHierarchy(t))}get topologyTypes(){return this.seriesTypes.filter(t=>this.isTopology(t))}get flowProportionTypes(){return this.seriesTypes.filter(t=>this.isFlowProportion(t))}get standaloneTypes(){return this.seriesTypes.filter(t=>this.isStandalone(t))}get gaugeTypes(){return this.seriesTypes.filter(t=>this.isGauge(t))}},tR=class extends Map{set(t,e){return super.set(t,Tt(e,this.get(t)))}},de=new oA,rA=new oA,cx=new tR}}),eR,Ds,hx=I({"packages/ag-charts-community/src/chart/factory/seriesRegistry.ts"(){"use strict";jn(),oe(),Fu(),eR=class{constructor(){this.seriesMap=new Map,this.themeTemplates=new Map}register(t,{chartTypes:[e],moduleFactory:i,tooltipDefaults:s,defaultAxes:n,themeTemplate:a,paletteFactory:o,solo:r,stackable:l,groupable:c,stackedByDefault:h,hidden:u}){this.setThemeTemplate(t,a),this.seriesMap.set(t,{moduleFactory:i,tooltipDefaults:s,defaultAxes:n,paletteFactory:o,solo:r,stackable:l,groupable:c,stackedByDefault:h}),de.set(t,e),u||rA.set(t,e)}create(t,e){const i=this.seriesMap.get(t)?.moduleFactory;if(i)return i(e);throw new Error(`AG Charts - unknown series type: ${t}`)}cloneDefaultAxes(t,e){const i=this.seriesMap.get(t)?.defaultAxes;if(i==null)return null;const s=typeof i=="function"?i(e):i;return{axes:ni(s)}}isDerivedDefaultAxes(t){return typeof this.seriesMap.get(t)?.defaultAxes=="function"}setThemeTemplate(t,e){const i=this.themeTemplates.get(t);this.themeTemplates.set(t,Tt(e,i))}getThemeTemplate(t){return this.themeTemplates.get(t)}getPaletteFactory(t){return this.seriesMap.get(t)?.paletteFactory}getTooltipDefauls(t){return this.seriesMap.get(t)?.tooltipDefaults}isSolo(t){return this.seriesMap.get(t)?.solo??!1}isGroupable(t){return this.seriesMap.get(t)?.groupable??!1}isStackable(t){return this.seriesMap.get(t)?.stackable??!1}isStackedByDefault(t){return this.seriesMap.get(t)?.stackedByDefault??!1}},Ds=new eR}}),ux,iR,u$=I({"packages/ag-charts-community/src/chart/interaction/syncManager.ts"(){"use strict";al(),ux=class ru extends ir{constructor(e){super(),this.chart=e}subscribe(e=ru.DEFAULT_GROUP){let i=this.get(e);return i||(i=new Set,ru.chartsGroups.set(e,i)),i.add(this.chart),this}unsubscribe(e=ru.DEFAULT_GROUP){return this.get(e)?.delete(this.chart),this}getChart(){return this.chart}getGroup(e=ru.DEFAULT_GROUP){const i=this.get(e);return i?Array.from(i):[]}getGroupSiblings(e=ru.DEFAULT_GROUP){return this.getGroup(e).filter(i=>i!==this.chart)}get(e){return ru.chartsGroups.get(e)}},ux.chartsGroups=new Map,ux.DEFAULT_GROUP=Symbol("sync-group-default"),iR=ux}}),dx,d$=I({"packages/ag-charts-community/src/chart/keyboard.ts"(){"use strict";Qt(),mt(),dx=class extends bt{constructor(){super(...arguments),this.enabled=!1}},M([k(pt)],dx.prototype,"enabled",2),M([k(_t)],dx.prototype,"tabIndex",2)}});function p$(t){return typeof t=="string"&&lA.includes(t)}function g$(t){const e=[],i=[],s=[...lA];for(const n of t)n instanceof Ou&&(p$(n.position)?i.push(n.position):e.push(n));for(const n of e){let a;do a=s.pop();while(a&&i.includes(a));if(a==null)break;n.position=a}}var lA,f$=I({"packages/ag-charts-community/src/chart/mapping/prepareAxis.ts"(){"use strict";gg(),lA=["top","right","bottom","left"]}});function y$(t,e,i){const s=(c,h,u)=>{const d=[c];for(const p of sR)p in h&&h[p]!=null&&d.push(`${p}=${h[p]}`);return u?.seriesGrouping&&d.push(`seriesGrouping.groupId=${u?.seriesGrouping.groupId}`),d.join(";")},n=new Map;let a=0;for(const c of t){const h=s(c.type,c.properties,i?.[a]);n.has(h)||n.set(h,[]),n.get(h)?.push([c,a++])}const o=new Map;a=0;for(const c of e){const h=s(c.type,c,c);o.has(h)||o.set(h,[]),o.get(h)?.push([c,a++])}if(![...n.keys()].some(c=>o.has(c)))return{status:"no-overlap",oldKeys:n.keys(),newKeys:o.keys()};const l=[];for(const[c,h]of o.entries())for(const[u,d]of h){const p=n.get(c);if(p==null||p.length<1){l.push({opts:u,targetIdx:d,idx:d,status:"add"}),n.delete(c);continue}const[g,f]=p.shift(),x=i?.[f]??{},m=Qo(x,u??{}),{groupIndex:b,stackIndex:v}=m?.seriesGrouping??{};b!=null||v!=null?l.push({opts:u,series:g,diff:m,targetIdx:d,idx:f,status:"series-grouping"}):m?l.push({opts:u,series:g,diff:m,targetIdx:d,idx:f,status:"update"}):l.push({opts:u,series:g,targetIdx:d,idx:f,status:"no-op"}),p.length===0&&n.delete(c)}for(const c of n.values())for(const[h,u]of c)l.push({series:h,idx:u,targetIdx:-1,status:"remove"});return{status:"overlap",changes:l}}var sR,m$=I({"packages/ag-charts-community/src/chart/mapping/prepareSeries.ts"(){"use strict";jn(),sR=["direction","xKey","yKey","sizeKey","angleKey","radiusKey","normalizedTo"]}});function nr(t){const{series:e}=t;if(e)return e[0]?.type??"line"}function cA(t){const e=nr(t);return e==null?!1:de.isCartesian(e)||e$(e)}function nR(t){const e=nr(t);return e==null?!1:de.isPolar(e)||i$(e)}function x$(t){const e=nr(t);return e==null?!1:de.isHierarchy(e)||s$(e)}function b$(t){const e=nr(t);return e==null?!1:de.isTopology(e)||n$(e)}function S$(t){const e=nr(t);return e==null?!1:de.isFlowProportion(e)||a$(e)}function aR(t){const e=nr(t);return e==null?!1:de.isStandalone(e)||o$(e)}function oR(t){const e=nr(t);return e==null?!1:de.isGauge(e)||r$(e)}function v$(t){const e=nr(t);return nR(t)&&e!=="pie"&&e!=="donut"}function M$(t){return t==null?!1:de.has(t)}function I$(t){return t==null?!1:ro.has(t)}var ju=I({"packages/ag-charts-community/src/chart/mapping/types.ts"(){"use strict";zu(),Fu(),Ig()}}),rR,A$=I({"packages/ag-charts-community/src/chart/modulesManager.ts"(){"use strict";L0(),Qt(),rR=class extends Lm{applyOptions(t){for(const e of this.moduleMap.values())e.module.optionsKey in t&&qa(e.moduleInstance)&&e.moduleInstance.set(t[e.module.optionsKey])}*legends(){for(const{module:t,moduleInstance:e}of this.moduleMap.values())t.type==="legend"&&(yield{legendType:t.identifier,legend:e})}}}}),px,hA,rl,uA=I({"packages/ag-charts-community/src/chart/overlay/overlay.ts"(){"use strict";Lt(),Qt(),mt(),px="ag-charts-overlay",hA="ag-charts-dark-overlay",rl=class extends bt{constructor(t,e){super(),this.className=t,this.defaultMessageId=e,this.enabled=!0}getText(t){return t.t(this.text??this.defaultMessageId)}getElement(t,e,i){if(this.content?.remove(),this.focusBox=i,this.renderer){const s=this.renderer();if(s instanceof HTMLElement)this.content=s;else{const n=Ot("div");n.innerHTML=s,this.content=n.firstElementChild}}else{const s=Ot("div",{display:"flex",alignItems:"center",justifyContent:"center",boxSizing:"border-box",height:"100%",margin:"8px",fontFamily:"var(--ag-charts-font-family)",fontSize:"var(--ag-charts-font-size)",fontWeight:"var(--ag-charts-font-weight)"});s.innerText=this.getText(e),this.content=s,t?.animate({from:0,to:1,id:"overlay",phase:"add",groupId:"opacity",onUpdate(n){s.style.opacity=String(n)},onStop(){s.style.opacity="1"}})}return this.content}removeElement(t=()=>this.content?.remove(),e){if(this.content){if(e){const{content:i}=this;e.animate({from:1,to:0,phase:"remove",id:"overlay",groupId:"opacity",onUpdate(s){i.style.opacity=String(s)},onStop(){t?.()}})}else t?.();this.content=void 0,this.focusBox=void 0}}},M([k(pt)],rl.prototype,"enabled",2),M([k(tt,{optional:!0})],rl.prototype,"text",2),M([k(ts,{optional:!0})],rl.prototype,"renderer",2)}}),Kc,D$=I({"packages/ag-charts-community/src/chart/overlay/chartOverlays.ts"(){"use strict";Qt(),mt(),uA(),Kc=class extends bt{constructor(){super(...arguments),this.darkTheme=!1,this.loading=new rl("ag-charts-loading-overlay","overlayLoadingData"),this.noData=new rl("ag-charts-no-data-overlay","overlayNoData"),this.noVisibleSeries=new rl("ag-charts-no-visible-series","overlayNoVisibleSeries"),this.unsupportedBrowser=new rl("ag-charts-unsupported-browser","overlayUnsupportedBrowser")}getFocusInfo(t){for(const e of[this.loading,this.noData,this.noVisibleSeries,this.unsupportedBrowser])if(e.focusBox!==void 0)return{text:e.getText(t),rect:e.focusBox}}destroy(){this.loading.removeElement(),this.noData.removeElement(),this.noVisibleSeries.removeElement(),this.unsupportedBrowser.removeElement()}},M([k(pt)],Kc.prototype,"darkTheme",2),M([k(lt)],Kc.prototype,"loading",2),M([k(lt)],Kc.prototype,"noData",2),M([k(lt)],Kc.prototype,"noVisibleSeries",2),M([k(lt)],Kc.prototype,"unsupportedBrowser",2)}});function k$(t,e){const{animationDuration:i}=yu.add,s=i*e,n=Ot("div",`${px}--loading`,{display:"flex",alignItems:"center",justifyContent:"center",flexDirection:"column",height:"100%",boxSizing:"border-box",font:"13px Verdana, sans-serif",userSelect:"none",animation:`ag-charts-loading ${s}ms linear 50ms both`}),a=Ot("span",{width:"45px",height:"40px",backgroundImage:["linear-gradient(#0000 calc(1 * 100% / 6), #ccc 0 calc(3 * 100% / 6), #0000 0), ","linear-gradient(#0000 calc(2 * 100% / 6), #ccc 0 calc(4 * 100% / 6), #0000 0), ","linear-gradient(#0000 calc(3 * 100% / 6), #ccc 0 calc(5 * 100% / 6), #0000 0)"].join(""),backgroundSize:"10px 400%",backgroundRepeat:"no-repeat",animation:"ag-charts-loading-matrix 1s infinite linear"}),o=Ot("p",{marginTop:"1em"});o.innerText=t;const r=Ot("div",`${px}__loading-background`,{position:"absolute",inset:"0",opacity:"0.5",zIndex:"-1"}),l=Ot("style");return l.innerText=["@keyframes ag-charts-loading { from { opacity: 0 } to { opacity: 1 } }","@keyframes ag-charts-loading-matrix {","0% { background-position: 0% 0%, 50% 0%, 100% 0%; }","100% { background-position: 0% 100%, 50% 100%, 100% 100%; }","}"].join(" "),n.replaceChildren(l,a,o,r),n}var L$=I({"packages/ag-charts-community/src/chart/overlay/loadingSpinner.ts"(){"use strict";Lt(),fc(),uA()}}),dA,pA,T$=I({"packages/ag-charts-community/src/chart/series/seriesZIndexMap.ts"(){"use strict";dA=(t=>(t[t.BACKGROUND=0]="BACKGROUND",t[t.ANY_CONTENT=1]="ANY_CONTENT",t))(dA||{}),pA=(t=>(t[t.FOREGROUND=0]="FOREGROUND",t[t.HIGHLIGHT=1]="HIGHLIGHT",t[t.LABEL=2]="LABEL",t))(pA||{})}}),gA,lR,cR,Vu,gx,Ag,$c=I({"packages/ag-charts-community/src/chart/series/series.ts"(){"use strict";L0(),Rt(),pe(),il(),Rn(),jn(),er(),gO(),Xy(),At(),oe(),fw(),Is(),gA=(t=>(t[t.EXACT_SHAPE_MATCH=0]="EXACT_SHAPE_MATCH",t[t.NEAREST_NODE=1]="NEAREST_NODE",t[t.AXIS_ALIGNED=2]="AXIS_ALIGNED",t))(gA||{}),lR=.25,cR=.125,Vu=class{constructor(t,e,{datum:i},s){this.type=t,this.event=e,this.datum=i,this.seriesId=s.id}},gx=class{constructor(t,e,i){this.series=t,this.seriesGrouping=e,this.oldGrouping=i,this.type="groupingChanged"}},Ag=class extends gI{constructor(t){super(),this.destroyFns=[],this.usesPlacedLabels=!1,this.seriesGrouping=void 0,this.NodeEvent=Vu,this.internalId=En(this),this.contentGroup=new is({name:`${this.internalId}-content`,zIndex:1}),this.highlightGroup=new is({name:`${this.internalId}-highlight`,zIndex:1}),this.annotationGroup=new is({name:`${this.internalId}-annotation`}),this.labelGroup=new is({name:`${this.internalId}-series-labels`}),this.axes={x:void 0,y:void 0},this.directions=["x","y"],this.nodeDataRefresh=!0,this.moduleMap=new Lm,this.datumCallbackCache=new Map,this.connectsToYAxis=!1,this._declarationOrder=-1,this.seriesListeners=new oo,this._pickNodeCache=new Sm;const{moduleCtx:e,pickModes:i,directionKeys:s={},directionNames:n={},canHaveAxes:a=!1,usesPlacedLabels:o=!1}=t;this.ctx=e,this.directionKeys=s,this.directionNames=n,this.canHaveAxes=a,this.usesPlacedLabels=o,this.highlightGroup=new is({name:`${this.internalId}-highlight`}),this.highlightNode=this.highlightGroup.appendChild(new yt({name:"highlightNode",zIndex:0})),this.highlightLabel=this.highlightGroup.appendChild(new yt({name:"highlightLabel",zIndex:10})),this.pickModes=i}get pickModeAxis(){return"main"}get id(){return this.properties?.id??this.internalId}get type(){return this.constructor.type??""}get focusable(){return!0}get data(){return this._data??this._chartData}set visible(t){this.properties.visible=t,this.ctx.legendManager.toggleItem({enabled:t,seriesId:this.id}),this.ctx.legendManager.update(),this.visibleMaybeChanged()}get visible(){return this.ctx.legendManager.getSeriesEnabled(this.id)??this.properties.visible}get hasData(){return this.data!=null&&this.data.length>0}get tooltipEnabled(){return this.properties.tooltip?.enabled??!1}onDataChange(){this.nodeDataRefresh=!0,this._pickNodeCache.clear()}setOptionsData(t){this._data=t,this.onDataChange()}setChartData(t){this._chartData=t,this.data===t&&this.onDataChange()}onSeriesGroupingChange(t,e){const{internalId:i,type:s,visible:n}=this;t&&this.ctx.seriesStateManager.deregisterSeries(this),e&&this.ctx.seriesStateManager.registerSeries({internalId:i,type:s,visible:n,seriesGrouping:e}),this.fireEvent(new gx(this,e,t))}getBandScalePadding(){return{inner:1,outer:0}}attachSeries(t,e,i){t.appendChild(this.contentGroup),e.appendChild(this.highlightGroup),e.appendChild(this.labelGroup),i?.appendChild(this.annotationGroup)}detachSeries(t,e,i){t?.removeChild(this.contentGroup),e.removeChild(this.highlightGroup),e.removeChild(this.labelGroup),i?.removeChild(this.annotationGroup)}setSeriesIndex(t){return t===this._declarationOrder?!1:(this._declarationOrder=t,this.contentGroup.zIndex=[1,t,0],this.highlightGroup.zIndex=[1,t,1],this.labelGroup.zIndex=[1,t,2],this.annotationGroup.zIndex=t,!0)}renderToOffscreenCanvas(){return!1}addEventListener(t,e){return super.addEventListener(t,e)}addListener(t,e){return this.seriesListeners.addListener(t,e)}dispatch(t,e){this.seriesListeners.dispatch(t,e)}addChartEventListeners(){}destroy(){this.destroyFns.forEach(t=>t()),this.destroyFns=[],this.resetDatumCallbackCache(),this.ctx.seriesStateManager.deregisterSeries(this)}getDirectionValues(t,e){const i=this.resolveKeyDirection(t),s=e?.[i],n=[];if(!s)return n;const a=(...o)=>{for(const r of o)Array.isArray(r)?a(...r):typeof r=="object"?a(...Object.values(r)):n.push(r)};return a(...s.map(o=>this.properties[o])),n}getKeys(t){return this.getDirectionValues(t,this.directionKeys)}getKeyProperties(t){return this.directionKeys[this.resolveKeyDirection(t)]??[]}getNames(t){return this.getDirectionValues(t,this.directionNames)}resolveKeyDirection(t){return t}getDomain(t){const e=this.getSeriesDomain(t),i=this.moduleMap.mapModules(s=>s.getDomain(t)).flat();return i.length!==0?e.concat(i):e}getRange(t,e){return this.getSeriesRange(t,e)}getVisibleItems(t,e,i){return 1/0}getGradientFillOptions({bounds:t},e){const{axes:i}=this,s=i.x,n=i.y,a=s?.range??[0,1],o=n?.range??[0,1],[r,l]=Si(a),[c,h]=Si(o),u=l-r,d=h-c;let p=[0,1];return t==="series"?p=this.getSeriesDomain("y"):t==="axes"&&(p=n?.scale.domain??[0,1]),{bbox:new ht(r,c,u,d),domain:p,defaultColorRange:e}}markNodeDataDirty(){this.nodeDataRefresh=!0,this._pickNodeCache.clear(),this.visibleMaybeChanged()}visibleMaybeChanged(){this.ctx.seriesStateManager.updateSeries(this)}getOpacity(){const{dimOpacity:e=1,enabled:i=!0}=this.properties.highlightStyle.series;if(!i||e===1)return 1;switch(this.isItemIdHighlighted()){case 0:case 1:return 1;case 2:default:return e}}getStrokeWidth(t){const{strokeWidth:e,enabled:i=!0}=this.properties.highlightStyle.series;if(!i||e===void 0)return t;switch(this.isItemIdHighlighted()){case 1:return e;case 0:case 2:return t}}isItemIdHighlighted(){const t=this.ctx.highlightManager?.getActiveHighlight()?.series;return t==null?0:t!==this?2:1}getModuleTooltipParams(){return this.moduleMap.mapModules(t=>t.getTooltipParams()).reduce((t,e)=>Object.assign(t,e),{})}pickNode(t,e,i=!1){const{pickModes:s,pickModeAxis:n,visible:a,contentGroup:o}=this;if(!a||!o.visible||e==="highlight"&&!this.properties.highlight.enabled||e==="highlight-tooltip"&&!this.properties.highlight.enabled)return;let r=1/0;if(e==="tooltip"||e==="highlight-tooltip"){const{tooltip:d}=this.properties;r=typeof d.range=="number"?d.range:1/0,i||(i=d.range==="exact")}else if(e==="event"||e==="context-menu"){const{nodeClickRange:d}=this.properties;r=typeof d=="number"?d:1/0,i||(i=d==="exact")}const l=s.filter(d=>!i||d===0),{x:c,y:h}=t,u=JSON.stringify({x:c,y:h,maxDistance:r,selectedPickModes:l});if(this._pickNodeCache.has(u))return this._pickNodeCache.get(u);for(const d of l){let p;switch(d){case 0:p=this.pickNodeExactShape(t);break;case 1:p=this.pickNodeClosestDatum(t);break;case 2:p=n!=null?this.pickNodeMainAxisFirst(t,n==="main-category"):void 0;break}if(p&&p.distance<=r)return this._pickNodeCache.set(u,{pickMode:d,match:p.datum,distance:p.distance})}return this._pickNodeCache.set(u,void 0)}pickNodeExactShape(t){const e=this.contentGroup.pickNode(t.x,t.y);if(e&&e.datum.missing!==!0)return{datum:e.datum,distance:0}}pickNodeClosestDatum(t){throw new Error("AG Charts - Series.pickNodeClosestDatum() not implemented")}pickNodeNearestDistantObject(t,e){const i=$y(t.x,t.y,e);if(i.nearest!==void 0&&i.nearest.datum.missing!==!0)return{datum:i.nearest.datum,distance:Math.sqrt(i.distanceSquared)}}pickNodeMainAxisFirst(t,e){throw new Error("AG Charts - Series.pickNodeMainAxisFirst() not implemented")}getLabelData(){return[]}updatePlacedLabelData(t){}fireNodeClickEvent(t,e){this.fireEvent(new this.NodeEvent("nodeClick",t,e,this))}fireNodeDoubleClickEvent(t,e){this.fireEvent(new this.NodeEvent("nodeDoubleClick",t,e,this))}createNodeContextMenuActionEvent(t,e){return new this.NodeEvent("nodeContextMenuAction",t,e,this)}onLegendInitialState(t,e){const{visible:i=!0,itemId:s,legendItemName:n}=e??{};this.toggleSeriesItem(i,t,s,n)}onLegendItemClick(t){const{enabled:e,itemId:i,series:s,legendType:n}=t,a="legendItemName"in this.properties?this.properties.legendItemName:void 0,o="legendItemKey"in this.properties?this.properties.legendItemKey:void 0,r=a!=null&&a===t.legendItemName;(s.id===this.id||r||o!=null)&&this.toggleSeriesItem(e,n,i,a,t)}onLegendItemDoubleClick(t){const{enabled:e,itemId:i,series:s,numVisibleItems:n,legendType:a}=t,o="legendItemName"in this.properties?this.properties.legendItemName:void 0,r="legendItemKey"in this.properties?this.properties.legendItemKey:void 0,l=o!=null&&o===t.legendItemName;s.id===this.id||l||r!=null?this.toggleSeriesItem(!0,a,i,o,t):e&&n===1?this.toggleSeriesItem(!0,a,void 0,o):this.toggleSeriesItem(!1,a,void 0,o)}toggleSeriesItem(t,e,i,s,n){const a=this.id;(t||e!=="category")&&(this.visible=t),this.nodeDataRefresh=!0,this._pickNodeCache.clear();const o={type:"seriesVisibilityChange",seriesId:a,itemId:i,legendItemName:n?.legendItemName??s,visible:t};this.fireEvent(o),this.ctx.legendManager.toggleItem({enabled:t,seriesId:a,itemId:i,legendItemName:s})}isEnabled(){return this.visible}getModuleMap(){return this.moduleMap}createModuleContext(){return{...this.ctx,series:this}}getLabelText(t,e,i=Zo){return t.formatter?this.ctx.callbackCache.call(t.formatter,{seriesId:this.id,...e})??i(e.value):i(e.value)}getMarkerStyle(t,e,i=t.getStyle()){const s={size:e.datum.point?.size??0},n=Tt(s,i);if(t.itemStyler){const a=this.ctx.callbackCache.call(t.itemStyler,{seriesId:this.id,...n,...e,datum:e.datum.datum});return Tt(a,n)}return n}updateMarkerStyle(t,e,i,s=e.getStyle(),{applyTranslation:n=!0,selected:a=!0}={}){const{point:o}=i.datum,r=this.getMarkerStyle(e,i,s),l=this.visible&&r.size>0&&o&&!isNaN(o.x)&&!isNaN(o.y);if(n?t.setProperties({visible:l,...r,translationX:o?.x,translationY:o?.y}):t.setProperties({visible:l,...r}),a||(t.fillOpacity*=lR,t.strokeOpacity*=cR),typeof e.shape=="function"&&!t.dirtyPath){t.path.clear(!0),t.updatePath(),t.checkPathDirty();const c=t.getBBox();if(o!==void 0&&c.isFinite()){const h=c.computeCenter(),[u,d]=["x","y"].map(p=>(r.strokeWidth??0)+Math.abs(h[p]-o[p]));o.focusSize=Math.max(c.width+u,c.height+d)}}}get nodeDataDependencies(){return this._nodeDataDependencies??{seriesRectWidth:NaN,seriesRectHeight:NaN}}checkResize(t){const{width:e,height:i}=t??{width:NaN,height:NaN},s=t?{seriesRectWidth:e,seriesRectHeight:i}:void 0,n=Qo(this.nodeDataDependencies,s)!=null;return n&&(this._nodeDataDependencies=s,this.markNodeDataDirty()),n}pickFocus(t){}resetDatumCallbackCache(){this.datumCallbackCache.clear()}cachedDatumCallback(t,e){const{datumCallbackCache:i}=this,s=i.get(t);if(s!=null)return s;const n=e();return i.set(t,n),n}},M([js({changeValue:function(t,e){this.onSeriesGroupingChange(e,t)}})],Ag.prototype,"seriesGrouping",2)}});function C$(t,e){const i=-e/t;return t!==0&&i>=0&&i<=1?[i]:[]}function N$(t,e,i){if(t===0)return C$(e,i);const s=e*e-4*t*i,n=[];if(s===0){const a=-e/(2*t);a>=0&&a<=1&&n.push(a)}else if(s>0){const a=Math.sqrt(s),o=(-e-a)/(2*t),r=(-e+a)/(2*t);o>=0&&o<=1&&n.push(o),r>=0&&r<=1&&n.push(r)}return n}function O$(t,e,i,s){if(t===0)return N$(e,i,s);const n=e/t,a=i/t,o=s/t,r=(3*a-n*n)/9,l=(9*n*a-27*o-2*n*n*n)/54,c=r*r*r+l*l,h=1/3,u=[];if(c>=0){const d=Math.sqrt(c),p=Math.sign(l+d)*Math.pow(Math.abs(l+d),h),g=Math.sign(l-d)*Math.pow(Math.abs(l-d),h),f=Math.abs(Math.sqrt(3)*(p-g)/2),x=-h*n+(p+g);if(x>=0&&x<=1&&u.push(x),f===0){const m=-h*n-(p+g)/2;m>=0&&m<=1&&u.push(m)}}else{const d=Math.acos(l/Math.sqrt(-r*r*r)),p=h*n,g=2*Math.sqrt(-r),f=g*Math.cos(h*d)-p,x=g*Math.cos(h*(d+2*Math.PI))-p,m=g*Math.cos(h*(d+4*Math.PI))-p;f>=0&&f<=1&&u.push(f),x>=0&&x<=1&&u.push(x),m>=0&&m<=1&&u.push(m)}return u}var w$=I({"packages/ag-charts-community/src/scene/polyRoots.ts"(){"use strict"}});function Gu(t,e,i,s,n,a,o,r){const l=(i-t)*(r-a)-(s-e)*(o-n);if(l===0)return 0;const c=((o-n)*(e-a)-(t-n)*(r-a))/l,h=((i-t)*(e-a)-(s-e)*(t-n))/l;return c>=0&&c<=1&&h>=0&&h<=1?1:0}function E$(t,e,i,s,n,a,o,r,l,c,h,u){let d=0;const p=c-u,g=h-l,f=l*(u-c)-c*(h-l),x=hR(t,i,n,o),m=hR(e,s,a,r),b=p*x[0]+g*m[0],v=p*x[1]+g*m[1],S=p*x[2]+g*m[2],A=p*x[3]+g*m[3]+f,T=O$(b,v,S,A);for(const D of T){const L=D*D,C=D*L,O=x[0]*C+x[1]*L+x[2]*D+x[3],_=m[0]*C+m[1]*L+m[2]*D+m[3];let N;l===h?N=(_-c)/(u-c):N=(O-l)/(h-l),N>=0&&N<=1&&d++}return d}function hR(t,e,i,s){return[-t+3*e-3*i+s,3*t-6*e+3*i,-3*t+3*e,t]}function uR(t,e,i,s,n,a,o,r,l,c){if(isNaN(t)||isNaN(e))return 0;a&&([n,s]=[s,n]);const h=(c-r)/(l-o),u=r-h*o,d=Math.pow(h,2)+1,p=2*(h*(u-e)-t),g=Math.pow(t,2)+Math.pow(u-e,2)-Math.pow(i,2),f=Math.pow(p,2)-4*d*g;if(f<0)return 0;const x=(-p+Math.sqrt(f))/2/d,m=(-p-Math.sqrt(f))/2/d;let b=0;return[x,m].forEach(v=>{if(!(v>=Math.min(o,l)&&v<=Math.max(o,l)))return;const A=h*v+u,T=v-t,D=A-e,L=Math.atan2(D,T);Qr(L,s,n)&&b++}),b}var dR=I({"packages/ag-charts-community/src/scene/intersection.ts"(){"use strict";Ii(),w$()}});function fx(t,e,i,s,n){return(1-n)**3*t+3*(1-n)**2*n*e+3*(1-n)*n**2*i+n**3*s}function yx(t,e,i,s,n){if(n<=Math.min(t,s))return t=Math.max(t,s))return t0&&l<1)return[l]}return[]}const r=a*a-4*n*o;if(r>=0){const l=Math.sqrt(r),c=(-a+l)/(2*n),h=(-a-l)/(2*n);return[c,h].filter(u=>u>0&&u<1)}return[]}function pR(t,e,i,s,n,a,o,r){const l=fA(t,i,n,o),c=fA(e,s,a,r);return[...l,...c]}var xx=I({"packages/ag-charts-community/src/scene/util/bezier.ts"(){"use strict"}}),Wu,yA=I({"packages/ag-charts-community/src/scene/extendedPath2D.ts"(){"use strict";ot(),Ii(),B0(),Rt(),dR(),xx(),Wu=class{constructor(){this.path2d=new Path2D,this.previousCommands=[],this.previousParams=[],this.previousClosedPath=!1,this.commands=[],this.params=[],this.openedPath=!1,this.closedPath=!1}isEmpty(){return this.commands.length===0}isDirty(){return this.closedPath!==this.previousClosedPath||this.previousCommands.length!==this.commands.length||this.previousParams.length!==this.params.length||this.previousCommands.toString()!==this.commands.toString()||this.previousParams.toString()!==this.params.toString()}getPath2D(){return this.path2d}moveTo(t,e){this.openedPath=!0,this.path2d.moveTo(t,e),this.commands.push(0),this.params.push(t,e)}lineTo(t,e){this.openedPath?(this.path2d.lineTo(t,e),this.commands.push(1),this.params.push(t,e)):this.moveTo(t,e)}rect(t,e,i,s){this.moveTo(t,e),this.lineTo(t+i,e),this.lineTo(t+i,e+s),this.lineTo(t,e+s),this.closePath()}roundRect(t,e,i,s,n){n=Math.min(n,i/2,s/2),this.moveTo(t,e+n),this.arc(t+n,e+n,n,Math.PI,1.5*Math.PI),this.lineTo(t+n,e),this.lineTo(t+i-n,e),this.arc(t+i-n,e+n,n,1.5*Math.PI,2*Math.PI),this.lineTo(t+i,e+n),this.lineTo(t+i,e+s-n),this.arc(t+i-n,e+s-n,n,0,Math.PI/2),this.lineTo(t+i-n,e+s),this.lineTo(t+n,e+s),this.arc(t+ +n,e+s-n,n,Math.PI/2,Math.PI),this.lineTo(t,e+s-n),this.closePath()}arc(t,e,i,s,n,a){this.openedPath=!0,this.path2d.arc(t,e,i,s,n,a),this.commands.push(2),this.params.push(t,e,i,s,n,a?1:0)}cubicCurveTo(t,e,i,s,n,a){this.openedPath||this.moveTo(t,e),this.path2d.bezierCurveTo(t,e,i,s,n,a),this.commands.push(3),this.params.push(t,e,i,s,n,a)}closePath(){this.openedPath&&(this.path2d.closePath(),this.commands.push(4),this.openedPath=!1,this.closedPath=!0)}clear(t){t&&(this.previousCommands=this.commands,this.previousParams=this.params,this.previousClosedPath=this.closedPath),this.path2d=new Path2D,this.openedPath=!1,this.closedPath=!1,this.commands=[],this.params=[]}isPointInPath(t,e){const i=this.commands,s=this.params,n=i.length,a=-1e4,o=-1e4;let r=NaN,l=NaN,c=0,h=0,u=0;for(let d=0,p=0;d({x:e,y:i})){const e=[],{commands:i,params:s}=this,n=(o,...r)=>{e.push(o);for(let l=0;l{i=Math.min(p,i),s=Math.min(d,s),n=Math.max(d,n),a=Math.max(p,a),g&&([o,r]=[d,p])};let u=0;for(const d of t)switch(d){case 0:h(e[u++],e[u++],!0),[l,c]=[o,r];break;case 1:h(e[u++],e[u++],!0);break;case 3:{const p=e[u++],g=e[u++],f=e[u++],x=e[u++],m=e[u++],b=e[u++];h(m,b,!0),pR(o,r,p,g,f,x,m,b).forEach(S=>{const A=fx(o,p,f,m,S),T=fx(r,g,x,b,S);h(A,T)});break}case 2:{const p=e[u++],g=e[u++],f=e[u++];let x=re(e[u++]),m=re(e[u++]);e[u++]&&([x,m]=[m,x]);const v=(A,T)=>{const D=p+f*Math.cos(A),L=g+f*Math.sin(A);h(D,L,T)};v(x),v(m,!0);const S=[0,Math.PI/2,Math.PI,3*Math.PI/2];for(const A of S)(xm&&(x<=A||A<=m))&&v(A);break}case 4:[o,r]=[l,c];break}return new ht(s,i,n-s,a-i)}}}});function St(t){const{changeCb:e,convertor:i}=t??{};return ct({type:"path",convertor:i,changeCb:e})}var ns,Gn=I({"packages/ag-charts-community/src/scene/shape/path.ts"(){"use strict";Lt(),yA(),nn(),qr(),ns=class extends rn{constructor(){super(...arguments),this.path=new Wu,this._clipX=NaN,this._clipY=NaN,this.clip=!1,this._dirtyPath=!0,this.lastPixelRatio=NaN}set clipX(t){this._clipX=t,this.dirtyPath=!0}set clipY(t){this._clipY=t,this.dirtyPath=!0}set dirtyPath(t){this._dirtyPath!==t&&(this._dirtyPath=t,t&&this.markDirty())}get dirtyPath(){return this._dirtyPath}checkPathDirty(){this._dirtyPath||(this.dirtyPath=this.path.isDirty()||(this.fillShadow?.isDirty()??!1)||(this._clipPath?.isDirty()??!1))}isPointInPath(t,e){return this.updatePathIfDirty(),this.path.closedPath&&this.path.isPointInPath(t,e)}distanceSquared(t,e){return this.distanceSquaredTransformedPoint(t,e)}svgPathData(t){return this.updatePathIfDirty(),this.path.toSVG(t)}distanceSquaredTransformedPoint(t,e){return this.updatePathIfDirty(),this.path.closedPath&&this.path.isPointInPath(t,e)?0:this.path.distanceSquared(t,e)}isDirtyPath(){return!1}updatePath(){}updatePathIfDirty(){(this.dirtyPath||this.isDirtyPath())&&(this.updatePath(),this.dirtyPath=!1)}preRender(t){return t.devicePixelRatio!==this.lastPixelRatio&&(this.dirtyPath=!0),this.lastPixelRatio=t.devicePixelRatio,this.updatePathIfDirty(),super.preRender(t,this.path.commands.length)}render(t){const{ctx:e}=t;if(this.clip&&!isNaN(this._clipX)&&!isNaN(this._clipY)){e.save();const i=this.strokeWidth/2;this._clipPath??(this._clipPath=new Wu),this._clipPath.clear(),this._clipPath.rect(-i,-i,this._clipX+i,this._clipY+i+i),e.clip(this._clipPath?.getPath2D()),this._clipX>0&&this._clipY>0&&this.drawPath(e),e.restore()}else this._clipPath=void 0,this.drawPath(e);this.fillShadow?.markClean(),super.render(t)}drawPath(t){this.fillStroke(t,this.path.getPath2D())}toSVG(){if(!this.visible)return;const t=wn("path");return t.setAttribute("d",this.svgPathData()),this.applySvgFillAttributes(t),this.applySvgStrokeAttributes(t),{elements:[t]}}},ns.className="Path",M([St()],ns.prototype,"clip",2),M([St()],ns.prototype,"clipX",1),M([St()],ns.prototype,"clipY",1)}}),gR,R$=I({"packages/ag-charts-community/src/dom/focusIndicator.ts"(){"use strict";Lt(),Rt(),Gn(),Ai(),_c(),gR=class{constructor(t){this.swapChain=t,this.div=Ot("div"),this.svg=wn("svg"),this.outerPath=wn("path"),this.innerPath=wn("path"),this.svg.append(this.outerPath),this.svg.append(this.innerPath),this.outerPath.classList.add("ag-charts-focus-svg-outer-path"),this.innerPath.classList.add("ag-charts-focus-svg-inner-path"),this.element=Ot("div","ag-charts-focus-indicator"),this.element.ariaHidden="true",this.element.append(this.svg),this.swapChain.addListener("swap",e=>this.onSwap(e))}clear(){}update(t,e,i){if(e!=null)if(t instanceof ns){const s=(a,o)=>{let{x:r,y:l}=be.toCanvasPoint(t,a,o);return r-=e.x??0,l-=e.y??0,{x:r,y:l}},n=t.svgPathData(s);this.outerPath.setAttribute("d",n),this.innerPath.setAttribute("d",n),this.show(this.svg)}else{let s;if(i){const n=Math.max(t.x-e.x,0),a=Math.max(t.y-e.y,0),o=Math.min(t.x+t.width-e.x,e.width),r=Math.min(t.y+t.height-e.y,e.height);s=new ht(n,a,o-n,r-a)}else s=new ht(t.x-e.x,t.y-e.y,t.width,t.height);zm(this.div,s),this.show(this.div)}}onSwap(t){t!==this.element.parentElement&&(this.element.remove(),t.appendChild(this.element),this.overrideFocusVisible(this.focusVisible))}show(t){this.element.innerHTML="",this.element.append(t)}overrideFocusVisible(t){this.focusVisible=t;const e={true:"1",false:"0",undefined:""};this.element.parentElement?.style.setProperty("opacity",e[`${t}`])}isFocusVisible(){const t=this.element.parentElement;return t!=null&&ae().getComputedStyle(t).opacity==="1"}}}}),fR,_$=I({"packages/ag-charts-community/src/dom/focusSwapChain.ts"(){"use strict";Lt(),ss(),fR=class{constructor(t,e,i,s){this.label1=t,this.label2=e,this.hasFocus=!1,this.skipDispatch=!1,this.listeners={blur:[],focus:[],swap:[]},this.onBlur=n=>(fa(n.target,"pointer-events",void 0),!this.skipDispatch&&this.dispatch("blur",n)),this.onFocus=n=>(fa(n.target,"pointer-events","auto"),!this.skipDispatch&&this.dispatch("focus",n)),ee(this.label1,"id",`${i}-label1`),ee(this.label2,"id",`${i}-label2`),fa(this.label1,"display","none"),fa(this.label2,"display","none"),this.activeAnnouncer=this.createAnnouncer(s),this.inactiveAnnouncer=this.createAnnouncer(s),ee(this.activeAnnouncer,"tabindex",0),this.label2.insertAdjacentElement("afterend",this.activeAnnouncer),this.label2.insertAdjacentElement("afterend",this.inactiveAnnouncer),this.swap("")}createAnnouncer(t){const e=Ot("div");return e.role=t,e.className="ag-charts-swapchain",e.addEventListener("blur",this.onBlur),e.addEventListener("focus",this.onFocus),e}destroy(){for(const t of[this.activeAnnouncer,this.inactiveAnnouncer])t.removeEventListener("blur",this.onBlur),t.removeEventListener("focus",this.onFocus),t.remove()}focus(t){this.focusOptions=t,this.activeAnnouncer.focus(t),this.focusOptions=void 0}update(t){this.skipDispatch=!0,this.swap(t),this.hasFocus&&this.activeAnnouncer.focus(this.focusOptions),this.skipDispatch=!1}addListener(t,e){this.listeners[t].push(e),t==="swap"&&e(this.activeAnnouncer)}dispatch(t,e){t==="focus"?this.hasFocus=!0:t==="blur"&&(this.hasFocus=!1),this.listeners[t].forEach(i=>i(e))}swap(t){const e=this.activeAnnouncer.tabIndex;this.label2.textContent=t,[this.inactiveAnnouncer,this.activeAnnouncer]=[this.activeAnnouncer,this.inactiveAnnouncer],[this.label1,this.label2]=[this.label2,this.label1],Bc(this.inactiveAnnouncer,{"aria-labelledby":this.label1.id,"aria-hidden":!0,tabindex:void 0}),Bc(this.activeAnnouncer,{"aria-labelledby":this.label1.id,"aria-hidden":!1,tabindex:e}),this.dispatch("swap",this.activeAnnouncer)}}}});function P$(t,e){for(const i of e)if("code"in i){if(i.code===t.code)return!0}else if(i.key===t.key&&(i.shift===void 0||i.shift===t.shiftKey)&&(i.ctrlOrMeta===void 0||i.ctrlOrMeta===t.ctrlKey||i.ctrlOrMeta===t.metaKey))return!0;return!1}function B$(t){for(const[e,{activatesFocusIndicator:i=!0,bindings:s}]of Object.entries(yR))if(P$(t,s))return{name:e,activatesFocusIndicator:i}}var yR,z$=I({"packages/ag-charts-community/src/chart/interaction/keyBindings.ts"(){"use strict";yR={arrowdown:{bindings:[{code:"ArrowDown"}]},arrowleft:{bindings:[{code:"ArrowLeft"}]},arrowright:{bindings:[{code:"ArrowRight"}]},arrowup:{bindings:[{code:"ArrowUp"}]},delete:{bindings:[{key:"Backspace"},{key:"Delete"}],activatesFocusIndicator:!1},redo:{bindings:[{key:"y",ctrlOrMeta:!0},{key:"z",ctrlOrMeta:!0,shift:!0}],activatesFocusIndicator:!1},undo:{bindings:[{key:"z",ctrlOrMeta:!0}],activatesFocusIndicator:!1},submit:{bindings:[{key:"Enter"},{code:"Enter"},{code:"Space"}]},zoomin:{bindings:[{key:"+"},{code:"ZoomIn"},{code:"Add"}],activatesFocusIndicator:!1},zoomout:{bindings:[{key:"-"},{code:"ZoomOut"},{code:"Substract"}],activatesFocusIndicator:!1}}}});function F$(t,e,i){const s=WI(t,i.datum);if(s!=null)return{x:s.canvasX,y:s.canvasY};const n=i.bounds;if(n!=null){if(n instanceof ht){const{x:a,y:o}=n.computeCenter();return{x:e.x+a,y:e.y+o}}return be.toCanvas(n).computeCenter()}}function j$({bounds:t}){return t instanceof ht?t:t!=null?be.toCanvas(t):ht.NaN}function V$(t,e,i){const{x:s,y:n}=F$(t,e,i)??{};if(s!==void 0&&n!==void 0)return{type:"keyboard",canvasX:s,canvasY:n}}var G$=I({"packages/ag-charts-community/src/chart/keyboardUtil.ts"(){"use strict";Rt(),Ai(),Gc()}});function mA(t,e,i,s){let{top:n,right:a,bottom:o,left:r,width:l,height:c}=s;return r!=null?l!=null?a=i.width-r+l:a!=null&&(l=i.width-r-a):a!=null&&l!=null&&(r=i.width-a-l),n!=null?c!=null?o=i.height-n-c:o!=null&&(c=i.height-o-n):o!=null&&c!=null&&(n=i.height-o-c),l==null?c==null?(l=t,c=e):l=Math.ceil(t*c/e):c==null&&(c=Math.ceil(e*l/t)),r==null&&(a==null?r=Math.floor((i.width-l)/2):r=i.width-a-l),n==null&&(o==null?n=Math.floor((i.height-c)/2):n=i.height-c-o),{x:r,y:n,width:l,height:c}}var mR=I({"packages/ag-charts-community/src/util/placement.ts"(){"use strict"}});function Uu(t){if(t!=null)return t===""?"":(Dg??(Dg=Ot("div")),Dg.textContent=String(t),Dg.innerHTML)}var Dg,xR=I({"packages/ag-charts-community/src/util/sanitize.ts"(){"use strict";Lt(),Dg=null}});function kg(t,e){const{path:i,size:s}=t,{x:n,y:a}=t;i.clear();let o=!1;for(const[r,l]of e){const c=n+(r-.5)*s,h=a+(l-.5)*s;o?i.lineTo(c,h):i.moveTo(c,h),o=!0}i.closePath()}var bR,SR=I({"packages/ag-charts-community/src/chart/marker/shapes.ts"(){"use strict";y0(),Ii(),bR={circle({path:t,x:e,y:i,size:s}){const n=s/2;t.clear(),t.arc(e,i,n,0,Math.PI*2),t.closePath()},cross(t){kg(t,[[.25,0],[.5,.25],[.75,0],[1,.25],[.75,.5],[1,.75],[.75,1],[.5,.75],[.25,1],[0,.75],[.25,.5],[0,.25]])},diamond(t){kg(t,[[.5,0],[1,.5],[.5,1],[0,.5]])},heart({path:t,x:e,y:i,size:s}){const n=s/4;i=i+n/2,t.clear(),t.arc(e-n,i-n,n,ti(130),ti(330)),t.arc(e+n,i-n,n,ti(220),ti(50)),t.lineTo(e,i+n),t.closePath()},pin({path:t,x:e,y:i,size:s}){t.moveTo(e+(.15625-.5)*s,i+(.34375-.5)*s),t.cubicCurveTo(e+(.15625-.5)*s,i+(.151491-.5)*s,e+(.307741-.5)*s,i+(0-.5)*s,e+(.5-.5)*s,i+(0-.5)*s),t.cubicCurveTo(e+(.692259-.5)*s,i+(0-.5)*s,e+(.84375-.5)*s,i+(.151491-.5)*s,e+(.84375-.5)*s,i+(.34375-.5)*s),t.cubicCurveTo(e+(.84375-.5)*s,i+(.493824-.5)*s,e+(.784625-.5)*s,i+(.600181-.5)*s,e+(.716461-.5)*s,i+(.695393-.5)*s),t.cubicCurveTo(e+(.699009-.5)*s,i+(.719769-.5)*s,e+(.681271-.5)*s,i+(.743104-.5)*s,e+(.663785-.5)*s,i+(.766105-.5)*s),t.cubicCurveTo(e+(.611893-.5)*s,i+(.834367-.5)*s,e+(.562228-.5)*s,i+(.899699-.5)*s,e+(.528896-.5)*s,i+(.980648-.5)*s),t.cubicCurveTo(e+(.524075-.5)*s,i+(.992358-.5)*s,e+(.512663-.5)*s,i+(1-.5)*s,e+(.5-.5)*s,i+(1-.5)*s),t.cubicCurveTo(e+(.487337-.5)*s,i+(1-.5)*s,e+(.475925-.5)*s,i+(.992358-.5)*s,e+(.471104-.5)*s,i+(.980648-.5)*s),t.cubicCurveTo(e+(.487337-.5)*s,i+(1-.5)*s,e+(.475925-.5)*s,i+(.992358-.5)*s,e+(.471104-.5)*s,i+(.980648-.5)*s),t.cubicCurveTo(e+(.437772-.5)*s,i+(.899699-.5)*s,e+(.388107-.5)*s,i+(.834367-.5)*s,e+(.336215-.5)*s,i+(.766105-.5)*s),t.cubicCurveTo(e+(.318729-.5)*s,i+(.743104-.5)*s,e+(.300991-.5)*s,i+(.719769-.5)*s,e+(.283539-.5)*s,i+(.695393-.5)*s),t.cubicCurveTo(e+(.215375-.5)*s,i+(.600181-.5)*s,e+(.15625-.5)*s,i+(.493824-.5)*s,e+(.15625-.5)*s,i+(.34375-.5)*s),t.closePath()},plus(t){kg(t,[[1/3,0],[2/3,0],[2/3,1/3],[1,1/3],[1,2/3],[2/3,2/3],[2/3,1],[1/3,1],[1/3,2/3],[0,2/3],[0,1/3],[1/3,1/3]])},square({path:t,x:e,y:i,size:s,pixelRatio:n}){const a=s/2;t.clear(),t.moveTo(Xo(n,e-a),Xo(n,i-a)),t.lineTo(Xo(n,e+a),Xo(n,i-a)),t.lineTo(Xo(n,e+a),Xo(n,i+a)),t.lineTo(Xo(n,e-a),Xo(n,i+a)),t.closePath()},star({path:t,x:e,y:i,size:s}){const a=s/2,o=a/2,r=Math.PI/2;for(let l=0;l<5*2;l++){const c=l%2===0?a:o,h=l*Math.PI/5-r,u=e+Math.cos(h)*c,d=i+Math.sin(h)*c;t.lineTo(u,d)}t.closePath()},triangle(t){kg(t,[[.5,0],[1,.87],[0,.87]])}}}}),Hu,ai,ba=I({"packages/ag-charts-community/src/chart/marker/marker.ts"(){"use strict";Rt(),Gn(),Ai(),SR(),Hu=class extends ns{constructor(){super(...arguments),this.shape="square",this.x=0,this.y=0,this.size=12}updatePath(){const{path:t,shape:e,x:i,y:s,size:n}=this,a=this.layerManager?.canvas?.pixelRatio??1,o=ai.anchor(e),r={path:t,x:i-(o.x-.5)*n,y:s-(o.y-.5)*n,size:n,pixelRatio:a};t.clear(),typeof e=="string"?bR[e](r):typeof e=="function"&&e(r)}computeBBox(){const{x:t,y:e,size:i}=this,s=ai.anchor(this.shape);return new ht(t-i*s.x,e-i*s.y,i,i)}executeFill(t,e){if(e)return super.executeFill(t,e)}executeStroke(t,e){if(e)return super.executeStroke(t,e)}},M([St()],Hu.prototype,"shape",2),M([St()],Hu.prototype,"x",2),M([St()],Hu.prototype,"y",2),M([St({convertor:Math.abs})],Hu.prototype,"size",2),ai=class extends Lu(S0(Dc(Hu))){static anchor(t){return t==="pin"?{x:.5,y:1}:typeof t=="function"&&"anchor"in t?t.anchor:{x:.5,y:.5}}constructor(t){super(t),t?.shape!=null&&(this.shape=t.shape)}}}});function vR(t,e,i=e*(5/3)){const s=new yt,n=Math.min(t.marker.strokeWidth,2),a=Math.min(t.line?.strokeWidth??0,2),o=Math.max(t.marker.enabled===!1?0:e,t.line==null?0:i),r=Math.max(t.marker.enabled===!1?0:e,a);if(t.line!=null){const{stroke:l,strokeOpacity:c,lineDash:h}=t.line,u=new Vs;u.x1=0,u.y1=r/2,u.x2=o,u.y2=r/2,u.stroke=l,u.strokeOpacity=c,u.strokeWidth=a,u.lineDash=h,s.append(u)}if(t.marker.enabled!==!1){const{shape:l,fill:c,fillOpacity:h,stroke:u,strokeOpacity:d,lineDash:p,lineDashOffset:g}=t.marker,f=new ai;f.shape=l??"square",f.size=e,f.fill=c,f.fillOpacity=h,f.stroke=u,f.strokeOpacity=d,f.strokeWidth=n,f.lineDash=p,f.lineDashOffset=g;const x=ai.anchor(l),m=o/2+(x.x-.5)*e,b=r/2+(x.y-.5)*e,v=e/(e+n);f.x=0,f.y=0,f.translationX=m,f.translationY=b,f.scalingX=v,f.scalingY=v,s.append(f)}return yt.toSVG(s,o,r)}var MR=I({"packages/ag-charts-community/src/chart/legend/legendSymbol.ts"(){"use strict";pe(),Oc(),ba()}}),xA,bA,SA,IR,AR,W$=I({"packages/ag-charts-community/src/chart/tooltip/springAnimation.ts"(){"use strict";er(),xA=.1,bA=200,SA=12,IR=.5,AR=class extends oo{constructor(){super(...arguments),this.x1=NaN,this.y1=NaN,this.x=NaN,this.y=NaN,this.vx=0,this.vy=0,this.t0=NaN,this.animationFrameHandle=void 0}reset(){this.x=NaN,this.y=NaN,this.animationFrameHandle!=null&&(cancelAnimationFrame(this.animationFrameHandle),this.animationFrameHandle=void 0)}update(t,e){if(Number.isNaN(this.x)||Number.isNaN(this.y)){this.x=t,this.y=e,this.vx=0,this.vy=0,this.emitUpdate(),this.animationFrameHandle!=null&&(cancelAnimationFrame(this.animationFrameHandle),this.animationFrameHandle=void 0);return}this.x1=t,this.y1=e,this.t0=Date.now(),this.animationFrameHandle==null&&(this.animationFrameHandle=requestAnimationFrame(this.onFrame.bind(this)))}onFrame(){this.animationFrameHandle=void 0;const{x1:t,y1:e,t0:i}=this,s=Date.now(),n=s-i;this.t0=s;const a=.001,o=Math.ceil(n/(a*1e3))|0;let{x:r,y:l,vx:c,vy:h}=this;for(let u=0;u{e.push(i.label??i.fallbackLabel,i.value)}),e.join("; "))}function kR(t,e,i){let s="";t==null?s+=`${Uu(e)}`:(s+=`${Uu(t)}`,s+=" ",s+=`${Uu(e)}`);const n=[`${Ri}-row`];return i&&n.push(`${Ri}-row--inline`),s=`
${s}
`,s}function U$(t){if(t.type==="raw")return t.rawHtmlString;let e="";if((t.heading==null||t.title==null)&&t.data?.length===1&&t.data[0].label==null&&t.data[0].value!=null){const i=t.data[0];e+=kR(t.heading??t.title,i.value,!1)}else{const i=t.title==null&&t.data?.length===1;t.heading!=null&&(e+=`${Uu(t.heading)}`,e+=" ");const s=t.symbol==null?void 0:vR(t.symbol,12);s!=null&&(t.title!=null||t.data?.length)&&(e+=`${s}`),t.title!=null&&(e+=`${Uu(t.title)}`,e+=" "),t.data?.forEach(n=>{e+=kR(n.label??n.fallbackLabel,n.value,i),e+=" "})}return e=`
${e.trimEnd()}
`,e}var Ri,vA,Xc,Sa,Lg=I({"packages/ag-charts-community/src/chart/tooltip/tooltip.ts"(){"use strict";Lt(),At(),mR(),Qt(),xR(),mt(),MR(),W$(),Ri="ag-charts-tooltip",vA="ag-charts-tooltip--dark",Xc=class extends bt{constructor(){super(...arguments),this.type="pointer",this.xOffset=0,this.yOffset=0}},M([k(ie(["pointer","node","top","right","bottom","left","top-left","top-right","bottom-right","bottom-left",{value:"sparkline",undocumented:!0},{value:"sparkline-",undocumented:!0}],"a position type"))],Xc.prototype,"type",2),M([k(_t)],Xc.prototype,"xOffset",2),M([k(_t)],Xc.prototype,"yOffset",2),Sa=class extends bt{constructor(){super(),this.enabled=!0,this.delay=0,this.range=void 0,this.wrapping="hyphenate",this.position=new Xc,this.darkTheme=!1,this.bounds="extended",this.destroyFns=[],this.springAnimation=new AR,this.enableInteraction=!1,this.wrapTypes=["always","hyphenate","on-space","never"],this.showTimeout=0,this._showArrow=!0,this._compact=!1,this._visible=!1,this.positionParams=void 0,this.destroyFns.push(this.springAnimation.addListener("update",this.updateTooltipPosition.bind(this)))}get interactive(){return this.enableInteraction}setup(t){"togglePopover"in ae().HTMLElement.prototype&&(this.element=t.addChild("canvas-overlay",Ri),this.element.setAttribute("popover","manual"),this.element.className=Ri)}destroy(t){t.removeChild("canvas-overlay",Ri),this.destroyFns.forEach(e=>e())}isVisible(){return this._visible}contains(t){return this.element?.contains(t)??!1}updateTooltipPosition(){const{element:t,positionParams:e}=this;if(t==null||e==null)return;const{canvasRect:i,relativeRect:s,meta:n}=e,{x:a,y:o}=this.springAnimation,r=n.position?.type??this.position.type,l=n.position?.xOffset??0,c=n.position?.yOffset??0,h=s.x,u=s.y,d=s.width-t.clientWidth-1+h,p=s.height-t.clientHeight+u;let g=this.getTooltipBounds({positionType:r,canvasX:a,canvasY:o,yOffset:c,xOffset:l,canvasRect:i}),f=mA(t.clientWidth,t.clientHeight,s,g);r==="sparkline"&&(f.x<=h||f.x>=d)&&(g=this.getTooltipBounds({positionType:"sparkline-constrained",canvasX:a,canvasY:o,yOffset:c,xOffset:l,canvasRect:i}),f=mA(t.clientWidth,t.clientHeight,s,g));const x=It(h,f.x,d),m=It(u,f.y,p),b=x!==f.x||m!==f.y,v=(r==="node"||r==="pointer")&&!b&&!l&&!c,S=n.showArrow??this.showArrow??v;this.updateShowArrow(S),this.updateCompact(r==="sparkline"||r==="sparkline-constrained"),t.style.transform=`translate(${x}px, ${m}px)`}show(t,e,i,s,n=!1){const{element:a}=this;if(a!=null&&s!=null)a.innerHTML=U$(s);else if(a==null||a.innerHTML===""){this.toggle(!1);return}const o={x:t.x-e.x,y:t.y-e.y,width:t.width,height:t.height};this.positionParams={canvasRect:e,relativeRect:o,meta:i},this.springAnimation.update(i.canvasX,i.canvasY),a.style.top=`${e.top}px`,a.style.left=`${e.left}px`,i.enableInteraction?(this.enableInteraction=!0,a.style.pointerEvents="auto",a.removeAttribute("aria-hidden")):(this.enableInteraction=!1,a.style.pointerEvents="none",a.setAttribute("aria-hidden","true")),this.delay>0&&!n?(this.toggle(!1),this.showTimeout=setTimeout(()=>{this.toggle(!0)},this.delay)):this.toggle(!0)}hide(){this.springAnimation.reset(),this.toggle(!1)}toggle(t){if(!this.element?.isConnected)return;this._visible=t;const{classList:e}=this.element,i=(s,n)=>e.toggle(`${Ri}--${s}`,n);t||clearTimeout(this.showTimeout),i("no-interaction",!this.enableInteraction),i("arrow",this._showArrow),i("compact",this._compact),e.toggle(vA,this.darkTheme),this.element.togglePopover(t),t&&this.updateTooltipPosition();for(const s of this.wrapTypes)e.toggle(`${Ri}--wrap-${s}`,s===this.wrapping)}updateShowArrow(t){this._showArrow=t}updateCompact(t){this._compact=t}getTooltipBounds(t){if(!this.element)return{};const{positionType:e,canvasX:i,canvasY:s,yOffset:n,xOffset:a,canvasRect:o}=t,{clientWidth:r,clientHeight:l}=this.element,c={width:r,height:l};switch(e){case"node":case"pointer":return c.top=s+n-l-8,c.left=i+a-r/2,c;case"top":return c.top=n,c.left=o.width/2-r/2+a,c;case"right":return c.top=o.height/2-l/2+n,c.left=o.width-r/2+a,c;case"left":return c.top=o.height/2-l/2+n,c.left=a,c;case"bottom":return c.top=o.height-l+n,c.left=o.width/2-r/2+a,c;case"top-left":return c.top=n,c.left=a,c;case"top-right":return c.top=n,c.left=o.width-r+a,c;case"bottom-right":return c.top=o.height-l+n,c.left=o.width-r+a,c;case"bottom-left":return c.top=o.height-l+n,c.left=a,c;case"sparkline":return c.top=s+n-l/2,c.left=i+a+8,c;case"sparkline-constrained":return c.top=s+n-l/2,c.left=i+a-8-r,c}}},M([k(pt)],Sa.prototype,"enabled",2),M([k(pt,{optional:!0})],Sa.prototype,"showArrow",2),M([k(st)],Sa.prototype,"delay",2),M([k(qp,{optional:!0})],Sa.prototype,"range",2),M([k(Qp)],Sa.prototype,"wrapping",2),M([k(lt)],Sa.prototype,"position",2),M([k(pt)],Sa.prototype,"darkTheme",2),M([k(ie(["extended","canvas"]))],Sa.prototype,"bounds",2)}});function H$(t,e){return t.type!==e}var LR,Y$=I({"packages/ag-charts-community/src/chart/series/seriesAreaManager.ts"(){"use strict";R$(),_$(),Ai(),al(),Rn(),At(),mw(),z$(),UI(),G$(),Lg(),LR=class extends ir{constructor(t){super(),this.chart=t,this.id=En(this),this.series=[],this.highlight={pendingHoverEvent:void 0,appliedHoverEvent:void 0,stashedHoverEvent:void 0},this.tooltip={lastHover:void 0},this.hoverDevice="pointer",this.previousInputDevice="keyboard",this.focus={sortedSeries:[],series:void 0,seriesIndex:0,datumIndex:0,datum:void 0},this.hoverScheduler=JY(()=>{if(!(!this.tooltip.lastHover&&!this.highlight.pendingHoverEvent)){if(this.chart.getUpdateType()<=4){this.hoverScheduler.schedule();return}this.highlight.pendingHoverEvent&&this.handleHoverHighlight(!1),this.tooltip.lastHover&&this.handleHoverTooltip(this.tooltip.lastHover,!1)}});const e=t.ctx.domManager.addChild("series-area","series-area-aria-label1"),i=t.ctx.domManager.addChild("series-area","series-area-aria-label2");this.swapChain=new fR(e,i,this.id,"img"),this.swapChain.addListener("blur",()=>this.onBlur()),this.swapChain.addListener("focus",()=>this.onFocus()),this.focusIndicator=new gR(this.swapChain),this.focusIndicator.overrideFocusVisible(t.mode==="integrated"?!1:void 0);const{seriesDragInterpreter:s,seriesWidget:n,containerWidget:a}=t.ctx.widgets;n.setTabIndex(-1),this.destroyFns.push(()=>t.ctx.domManager.removeChild("series-area","series-area-aria-label1"),()=>t.ctx.domManager.removeChild("series-area","series-area-aria-label2"),n.addListener("focus",()=>this.swapChain.focus()),n.addListener("mousemove",o=>this.onHover(o)),n.addListener("wheel",o=>this.onWheel(o)),n.addListener("mouseleave",o=>this.onLeave(o)),n.addListener("keydown",o=>this.onKeyDown(o)),n.addListener("contextmenu",(o,r)=>this.onContextMenu(o,r)),s.addListener("drag-move",o=>this.onDragMove(o)),s.addListener("click",o=>this.onClick(o,n)),s.addListener("dblclick",o=>this.onClick(o,n)),a.addListener("contextmenu",(o,r)=>this.onContextMenu(o,r)),a.addListener("click",(o,r)=>this.onClick(o,r)),a.addListener("dblclick",(o,r)=>this.onClick(o,r)),t.ctx.animationManager.addListener("animation-start",()=>this.clearAll()),t.ctx.domManager.addListener("resize",()=>this.clearAll()),t.ctx.highlightManager.addListener("highlight-change",o=>this.changeHighlightDatum(o)),t.ctx.layoutManager.addListener("layout:complete",o=>this.layoutComplete(o)),t.ctx.updateService.addListener("pre-scene-render",()=>this.preSceneRender()),t.ctx.updateService.addListener("update-complete",()=>this.updateComplete()),t.ctx.zoomManager.addListener("zoom-change",()=>this.clearAll()),t.ctx.zoomManager.addListener("zoom-pan-start",()=>this.clearAll()))}isState(t){return this.chart.ctx.interactionManager.isState(t)}isIgnoredTouch(t){return!(t.device!=="touch"||t.type==="click"||this.chart.ctx.chartService.touch.dragAction==="hover"||this.chart.ctx.chartService.touch.dragAction==="drag"&&this.isState(9))}dataChanged(){var t;(t=this.highlight).stashedHoverEvent??(t.stashedHoverEvent=this.highlight.appliedHoverEvent),this.chart.ctx.tooltipManager.removeTooltip(this.id),this.focusIndicator.clear(),this.clearHighlight()}preSceneRender(){this.highlight.stashedHoverEvent!=null&&(this.highlight.pendingHoverEvent=this.highlight.stashedHoverEvent,this.highlight.stashedHoverEvent=void 0,this.handleHoverHighlight(!0)),this.tooltip.lastHover!=null&&this.handleHoverTooltip(this.tooltip.lastHover,!0)}updateComplete(){this.focusIndicator.isFocusVisible()&&this.isState(34)&&this.handleSeriesFocus(0,0,!0)}update(t,e){this.chart.ctx.updateService.update(t,e)}seriesChanged(t){this.focus.sortedSeries=[...t].sort((e,i)=>{let s=e.properties.focusPriority??1/0,n=i.properties.focusPriority??1/0;return s===n&&([s,n]=[e._declarationOrder,i._declarationOrder]),sn?1:0}),this.series=t}layoutComplete(t){this.seriesRect=t.series.rect,this.hoverRect=t.series.paddedRect,this.chart.ctx.widgets.seriesWidget.setBounds(t.series.paddedRect),this.chart.ctx.widgets.chartWidget.setBounds(t.chart)}onContextMenu(t,e){const{sourceEvent:i}=t;if(i.currentTarget!=e.getElement())return;if(i.target==this.chart.ctx.widgets.containerWidget.getElement()){if(this.isState(36)){const{currentX:l,currentY:c}=t;this.chart.ctx.contextMenuRegistry.dispatchContext("all",{sourceEvent:i,canvasX:l,canvasY:c},{})}return}let s,n;if(this.focusIndicator.isFocusVisible())s=this.chart.ctx.highlightManager.getActiveHighlight(),s&&this.seriesRect&&s.midPoint&&(n=be.toCanvasPoint(s.series.contentGroup,s.midPoint.x,s.midPoint.y));else if(this.isState(36)){const l=this.pickNode({x:t.currentX,y:t.currentY},"context-menu");l&&(this.chart.ctx.highlightManager.updateHighlight(this.id),s=l.datum)}const a=s?.series;this.clearAll();const o=t.currentX+e.cssLeft(),r=t.currentY+e.cssTop();this.chart.ctx.contextMenuRegistry.dispatchContext("series-area",{sourceEvent:i,canvasX:o,canvasY:r},{pickedSeries:a,pickedNode:s},n)}onLeave(t){!this.isState(41)||t.sourceEvent.relatedTarget?.className==="ag-charts-text-input__textarea"||this.chart.ctx.tooltipManager.isEnteringInteractiveTooltip(t)||(this.chart.ctx.domManager.updateCursor(this.id),this.focusIndicator.isFocusVisible()||this.clearAll())}onWheel(t){this.isState(41)&&(this.focusIndicator?.overrideFocusVisible(!1),this.previousInputDevice="pointer")}onDragMove(t){this.isState(41)&&(this.focusIndicator?.overrideFocusVisible(!1),this.onHoverLikeEvent(t))}onHover(t){this.isState(41)&&this.onHoverLikeEvent(t)}onHoverLikeEvent(t){if(!this.isIgnoredTouch(t)&&((t.device==="touch"||H$(t,"drag-move"))&&(this.tooltip.lastHover=t),t.device==="touch"&&this.chart.ctx.chartService.touch.dragAction==="hover"&&t.sourceEvent.preventDefault(),this.hoverDevice="pointer",this.previousInputDevice="pointer",this.highlight.pendingHoverEvent=t,this.hoverScheduler.schedule(),this.isState(32))){const{currentX:e,currentY:i}=t,s=this.pickNode({x:e,y:i},"event");s?.series.hasEventListener("nodeClick")||s?.series.hasEventListener("nodeDoubleClick")?this.chart.ctx.domManager.updateCursor(this.id,"pointer"):this.chart.ctx.domManager.updateCursor(this.id)}}onClick(t,e){if(t.device==="touch"&&e===this.chart.ctx.widgets.seriesWidget&&this.swapChain.focus({preventScroll:!0}),!this.isState(41))return;if(e===this.chart.ctx.widgets.seriesWidget){if(!e.getElement().contains(t.sourceEvent.target))return}else if(t.sourceEvent.target!=e.getElement())return;if(this.focusIndicator.overrideFocusVisible(!1),this.onHoverLikeEvent(t),!this.isState(32))return;if(e==this.chart.ctx.widgets.seriesWidget&&this.checkSeriesNodeClick(t)){this.update(4),t.sourceEvent.preventDefault();return}const i={type:t.type==="click"?"click":"doubleClick",event:t.sourceEvent};this.chart.fireEvent(i)}onFocus(){this.isState(34)&&(this.hoverDevice=this.focusIndicator.isFocusVisible()?"keyboard":"pointer",this.handleFocus(0,0))}onBlur(){this.isState(34)&&(this.hoverDevice="pointer",this.clearAll(),this.focusIndicator.overrideFocusVisible(void 0))}onKeyDown(t){if(!this.isState(43))return;const e=B$(t.sourceEvent);switch(e?.activatesFocusIndicator===!1&&this.focusIndicator.overrideFocusVisible(this.previousInputDevice==="keyboard"),e?.name){case"redo":return this.chart.ctx.chartEventManager.seriesEvent("series-redo");case"undo":return this.chart.ctx.chartEventManager.seriesEvent("series-undo");case"zoomin":return this.chart.ctx.chartEventManager.seriesKeyNavZoom(1,t);case"zoomout":return this.chart.ctx.chartEventManager.seriesKeyNavZoom(-1,t);case"arrowup":return this.onArrow(-1,0,t);case"arrowdown":return this.onArrow(1,0,t);case"arrowleft":return this.onArrow(0,-1,t);case"arrowright":return this.onArrow(0,1,t);case"submit":return this.onSubmit(t)}}onArrow(t,e,i){this.isState(34)&&(this.hoverDevice="keyboard",this.previousInputDevice="keyboard",this.focusIndicator.overrideFocusVisible(!0),this.focus.seriesIndex+=t,this.focus.datumIndex+=e,this.handleFocus(t,e),i.sourceEvent.preventDefault(),this.chart.ctx.chartEventManager.seriesEvent("series-focus-change"))}onSubmit(t){if(!this.isState(34))return;const{series:e,datum:i}=this.focus,s=t.sourceEvent;e!==void 0&&i!==void 0?e.fireNodeClickEvent(s,i):this.chart.fireEvent({type:"click",event:s}),s.preventDefault()}checkSeriesNodeClick(t){const e=this.pickNode({x:t.currentX,y:t.currentY},"event");return e==null?!1:t.type==="click"?(e.series.fireNodeClickEvent(t.sourceEvent,e.datum),!0):t.type==="dblclick"?(t.preventZoomDblClick=e.distance===0,e.series.fireNodeDoubleClickEvent(t.sourceEvent,e.datum),!0):!1}handleFocus(t,e){const i=this.chart.overlays.getFocusInfo(this.chart.ctx.localeManager);i==null?this.handleSeriesFocus(t,e):this.focusIndicator.update(i.rect,this.seriesRect,!1)}handleSeriesFocus(t,e,i=!1){if(this.chart.chartType==="hierarchy"||this.chart.chartType==="gauge"){this.handleSoloSeriesFocus(t,e,i);return}const{focus:s,seriesRect:n}=this,a=s.sortedSeries.filter(h=>h.visible&&h.focusable);if(a.length===0)return;const o={datumIndex:s.datumIndex-e,otherIndex:s.seriesIndex-t};s.seriesIndex=It(0,s.seriesIndex,a.length-1),s.series=a[s.seriesIndex];const{datumIndex:r,seriesIndex:l}=s,c=s.series.pickFocus({datumIndex:r,datumIndexDelta:e,otherIndex:l,otherIndexDelta:t,seriesRect:n});this.updatePickedFocus(t,e,o,c,i)}handleSoloSeriesFocus(t,e,i){this.focus.series=this.focus.sortedSeries[0];const{focus:{series:s,seriesIndex:n,datumIndex:a},seriesRect:o}=this;if(s==null)return;const r={datumIndex:this.focus.datumIndex-e,otherIndex:this.focus.seriesIndex-t},l=s.pickFocus({datumIndex:a,datumIndexDelta:e,otherIndex:n,otherIndexDelta:t,seriesRect:o});this.updatePickedFocus(t,e,r,l,i)}updatePickedFocus(t,e,i,s,n){const{focus:a,hoverRect:o}=this;if(s===void 0||a.series===void 0||o===void 0)return;const{datum:r,datumIndex:l,otherIndex:c}=s;if(c!==void 0&&(a.seriesIndex=c),a.datumIndex=l,a.datum=r,this.focusIndicator.isFocusVisible()&&this.chart.ctx.animationManager.reset(),this.focusIndicator.isFocusVisible()){const u=j$(s),{x:d,y:p}=u.computeCenter();if(!o.containsPoint(d,p)&&this.chart.ctx.zoomManager.panToBBox(this.id,o,u))return}this.focusIndicator.update(s.bounds,this.seriesRect,s.clipFocusBox);const h=V$(a.series,o,s);if(h!==void 0&&this.hoverDevice==="keyboard"){this.tooltip.lastHover=void 0,this.highlight.appliedHoverEvent=void 0,this.highlight.pendingHoverEvent=void 0,this.highlight.stashedHoverEvent=void 0;const u=a.series.getTooltipContent(r),d=vg.makeTooltipMeta(h,a.series,r);this.chart.ctx.highlightManager.updateHighlight(this.id,r),this.chart.tooltip.enabled&&a.series.tooltipEnabled?this.chart.ctx.tooltipManager.updateTooltip(this.id,d,u):this.chart.ctx.tooltipManager.removeTooltip(this.id),n||(e===0&&t===0||i.datumIndex!==s.datumIndex||i.otherIndex!==(s.otherIndex??a.seriesIndex))&&this.swapChain.update(this.getDatumAriaText(r,u))}}getDatumAriaText(t,e){const i=e==null?"":DR(e);return this.chart.ctx.localeManager.t("ariaAnnounceHoverDatum",{datum:t.series.getDatumAriaText?.(t,i)??i})}clearHighlight(){this.highlight.pendingHoverEvent=void 0,this.highlight.appliedHoverEvent=void 0,this.chart.ctx.highlightManager.updateHighlight(this.id)}clearTooltip(){this.chart.ctx.tooltipManager.removeTooltip(this.id),this.tooltip.lastHover=void 0}clearAll(){this.clearHighlight(),this.clearTooltip(),this.focusIndicator.clear()}handleHoverHighlight(t){this.highlight.appliedHoverEvent=this.highlight.pendingHoverEvent,this.highlight.pendingHoverEvent=void 0;const e=this.highlight.appliedHoverEvent;if(!e||!this.isState(41))return;const{currentX:i,currentY:s}=e,n=e.currentX+(this.hoverRect?.x??0),a=e.currentY+(this.hoverRect?.y??0);if(t?this.chart.ctx.animationManager.isActive():!this.hoverRect?.containsPoint(n,a)){this.clearHighlight();return}const{range:o}=this.chart.highlight,r=o==="tooltip"?"highlight-tooltip":"highlight",l=this.pickNode({x:i,y:s},r);if(l){this.chart.ctx.highlightManager.updateHighlight(this.id,l.datum),this.hoverDevice="pointer";return}this.chart.ctx.highlightManager.updateHighlight(this.id)}handleHoverTooltip(t,e){if(!this.isState(41))return;const{currentX:i,currentY:s}=t,n=i+(this.hoverRect?.x??0),a=s+(this.hoverRect?.y??0),o=t.sourceEvent.target;if(e?this.chart.ctx.animationManager.isActive():!this.hoverRect?.containsPoint(n,a)){this.hoverDevice=="pointer"&&this.clearTooltip();return}if(o&&this.chart.tooltip.interactive&&this.chart.ctx.domManager.isManagedChildDOMElement(o,"canvas-overlay",Ri))return;const r=this.pickNode({x:t.currentX,y:t.currentY},"tooltip");if(!r){this.hoverDevice=="pointer"&&this.clearTooltip();return}this.hoverDevice="pointer";const l=r.series.getTooltipContent(r.datum);if(this.chart.tooltip.enabled&&r.series.tooltipEnabled&&l!=null){const u=vg.makeTooltipMeta({type:"pointermove",canvasX:n,canvasY:a},r.series,r.datum);this.chart.ctx.tooltipManager.updateTooltip(this.id,u,l)}else this.chart.ctx.tooltipManager.removeTooltip(this.id)}changeHighlightDatum(t){const e=new Set,{series:i=void 0,datum:s}=t.currentHighlight??{},{series:n=void 0,datum:a}=t.previousHighlight??{};n&&e.add(n),i&&e.add(i),n?.properties.cursor&&a&&this.chart.ctx.domManager.updateCursor(n.id),i?.properties.cursor&&i?.properties.cursor!=="default"&&s&&this.chart.ctx.domManager.updateCursor(i.id,i.properties.cursor),i==null||n==null?this.update(4):this.update(4,{seriesToUpdate:e})}pickNode(t,e,i){const s=[...this.series].reverse();let n;for(const a of s){if(!a.visible||!a.contentGroup.visible)continue;const{match:o,distance:r}=a.pickNode(t,e,i)??{};if(!(!o||r==null)&&((!n||n.distance>r)&&(n={series:a,distance:r,datum:o}),r===0))break}return n}}}}),MA,TR,K$=I({"packages/ag-charts-community/src/chart/series/seriesLayerManager.ts"(){"use strict";pe(),uO(),At(),MA=30,TR=class{constructor(t){this.seriesRoot=t,this.groups=new Map,this.series=new Map,this.expectedSeriesCount=1,this.mode="normal"}setSeriesCount(t){this.expectedSeriesCount=t}requestGroup(t){const{internalId:e,type:i,contentGroup:s,seriesGrouping:n}=t,{groupIndex:a=e}=n??{},o=this.series.get(e);if(o!=null)throw new Error(`AG Charts - series already has an allocated layer: ${JSON.stringify(o)}`);this.series.size===0&&(this.mode=this.expectedSeriesCount>=MA?"aggressive-grouping":"normal");let r=this.groups.get(i);r==null&&(r=new Map,this.groups.set(i,r));const l=this.lookupIdx(a);let c=r.get(l);return c==null&&(c={type:i,id:l,seriesIds:[],group:this.seriesRoot.appendChild(new yt({name:`${t.contentGroup.name??i}-managed-layer`,zIndex:t.contentGroup.zIndex,renderToOffscreenCanvas:!1}))},r.set(l,c)),this.series.set(e,{layerState:c,seriesConfig:t}),c.seriesIds.push(e),c.group.appendChild(s),c.group}changeGroup(t){const{internalId:e,seriesGrouping:i,type:s,contentGroup:n,oldGrouping:a}=t,{groupIndex:o=e}=i??{};this.groups.get(s)?.get(o)?.seriesIds.includes(e)||(this.series.has(e)&&this.releaseGroup({internalId:e,seriesGrouping:a,type:s,contentGroup:n}),this.requestGroup(t))}releaseGroup(t){const{internalId:e,contentGroup:i,type:s}=t;if(!this.series.has(e))throw new Error(`AG Charts - series doesn't have an allocated layer: ${e}`);const n=this.series.get(e)?.layerState;n&&(n.seriesIds=n.seriesIds.filter(a=>a!==e),n.group.removeChild(i)),n?.seriesIds.length===0?(this.seriesRoot.removeChild(n.group),this.groups.get(n.type)?.delete(n.id),this.groups.get(s)?.delete(e)):n!=null&&n.seriesIds.length>0&&(n.group.zIndex=this.getLowestSeriesZIndex(n.seriesIds)),this.series.delete(e)}updateLayerCompositing(){this.groups.forEach(t=>{t.forEach(e=>{const{group:i,seriesIds:s}=e;let n;s.length===0?n=!1:s.length>1?n=!0:n=this.series.get(s[0])?.seriesConfig.renderToOffscreenCanvas()===!0,i.renderToOffscreenCanvas=n,i.zIndex=this.getLowestSeriesZIndex(s)})})}lookupIdx(t){return this.mode==="normal"?t:typeof t=="string"&&(t=Number(t.split("-").at(-1)),!t)?0:Math.floor(It(0,t/this.expectedSeriesCount,1)*MA)}destroy(){this.groups.forEach(t=>{t.forEach(e=>{this.seriesRoot.removeChild(e.group)})}),this.groups.clear(),this.series.clear()}getLowestSeriesZIndex(t){return t.reduce((i,s)=>{const a=this.series.get(s)?.seriesConfig.contentGroup.zIndex;return i==null||a==null?a:hO(i,a)<=0?i:a},void 0)??1}}}}),IA,$$=I({"packages/ag-charts-community/src/chart/touch.ts"(){"use strict";Qt(),mt(),IA=class extends bt{constructor(){super(...arguments),this.dragAction="drag"}},M([k(ie(["none","drag","hover"]))],IA.prototype,"dragAction",2)}}),CR,X$=I({"packages/ag-charts-community/src/chart/update/dataWindowProcessor.ts"(){"use strict";CR=class{constructor(t,e,i,s,n){this.chart=t,this.dataService=e,this.updateService=i,this.zoomManager=s,this.animationManager=n,this.dirtyZoom=!1,this.dirtyDataSource=!1,this.lastAxisZooms=new Map,this.destroyFns=[],this.destroyFns.push(this.dataService.addListener("data-source-change",()=>this.onDataSourceChange()),this.dataService.addListener("data-load",()=>this.onDataLoad()),this.dataService.addListener("data-error",()=>this.onDataError()),this.updateService.addListener("update-complete",()=>this.onUpdateComplete()),this.zoomManager.addListener("zoom-change",()=>this.onZoomChange()))}destroy(){this.destroyFns.forEach(t=>t())}onDataLoad(){this.animationManager.skip(),this.updateService.update(1)}onDataError(){this.updateService.update(3)}onDataSourceChange(){this.dirtyDataSource=!0}onUpdateComplete(){!this.dirtyZoom&&!this.dirtyDataSource||this.updateWindow()}onZoomChange(){this.dirtyZoom=!0}updateWindow(){if(!this.dataService.isLazy())return;const t=this.getValidAxis();let e,i=!0;if(t){const s=this.zoomManager.getAxisZoom(t.id);e=this.getAxisWindow(t,s),i=this.shouldRefresh(t,s)}this.dirtyZoom=!1,this.dirtyDataSource=!1,i&&this.dataService.load({windowStart:e?.min,windowEnd:e?.max})}getValidAxis(){return this.chart.axes.find(t=>t.type==="time")}shouldRefresh(t,e){if(this.dirtyDataSource)return!0;if(!this.dirtyZoom)return!1;const i=this.lastAxisZooms.get(t.id);return i&&e.min===i.min&&e.max===i.max?!1:(this.lastAxisZooms.set(t.id,e),!0)}getAxisWindow(t,e){const{domain:i}=t.scale;if(!e||i.length===0||isNaN(Number(i[0])))return;const s=Number(i[1])-Number(i[0]),n=new Date(Number(i[0])+s*e.min),a=new Date(Number(i[0])+s*e.max);return{min:n,max:a}}}}});function Z$(){const{userAgent:t}=ae("navigator");if(NR.test(t)){const e=parseFloat(OR.exec(t)?.[1]??"0"),i=Math.floor(e)>16;return i||et.warnOnce(`Unsupported Safari version: ${e}; ${t}`),!i}else if(wR.test(t)&&!RR.test(t)&&!_R.test(t)){const e=parseInt(ER.exec(t)?.[1]??"0",10),i=e>126;return i||et.warnOnce(`Unsupported Chrome version: ${e}; ${t}`),!i}return!1}var NR,OR,wR,ER,RR,_R,Q$=I({"packages/ag-charts-community/src/util/browser.ts"(){"use strict";ot(),Lt(),NR=/^((?!chrome|android).)*safari/i,OR=/Version\/(\d+(\.\d+)?)/,wR=/Chrome/,ER=/Chrome\/(\d+)/,RR=/Edg/,_R=/OPR/}}),PR,BR,q$=I({"packages/ag-charts-community/src/chart/update/overlaysProcessor.ts"(){"use strict";ss(),Q$(),uA(),PR=new Set(["map-shape-background","map-line-background"]),BR=class{constructor(t,e,i,s,n,a,o){this.chartLike=t,this.overlays=e,this.dataService=i,this.layoutManager=s,this.localeManager=n,this.animationManager=a,this.domManager=o,this.destroyFns=[],this.overlayElem=this.domManager.addChild("canvas-overlay","overlay"),this.overlayElem.role="status",this.overlayElem.ariaAtomic="false",this.overlayElem.ariaLive="polite",this.overlayElem.classList.toggle(px),this.destroyFns.push(this.layoutManager.addListener("layout:complete",r=>this.onLayoutComplete(r)))}destroy(){this.destroyFns.forEach(t=>t()),this.domManager.removeStyles("overlays"),this.domManager.removeChild("canvas-overlay","overlay")}onLayoutComplete({series:{rect:t}}){const e=this.dataService.isLoading(),i=this.chartLike.series.some(c=>c.hasData),s=this.chartLike.series.some(c=>c.visible&&!PR.has(c.type));this.overlays.darkTheme?this.overlayElem.classList.add(hA):this.overlayElem.classList.remove(hA),this.overlayElem.style.left=`${t.x}px`,this.overlayElem.style.top=`${t.y}px`,this.overlayElem.style.width=`${t.width}px`,this.overlayElem.style.height=`${t.height}px`;const n=e,a=!e&&!i,o=i&&!s,r=this.overlays.unsupportedBrowser.enabled&&Z$();n?this.showOverlay(this.overlays.loading,t):this.hideOverlay(this.overlays.loading),a?this.showOverlay(this.overlays.noData,t):this.hideOverlay(this.overlays.noData),o?this.showOverlay(this.overlays.noVisibleSeries,t):this.hideOverlay(this.overlays.noVisibleSeries),r?this.showOverlay(this.overlays.unsupportedBrowser,t):this.hideOverlay(this.overlays.unsupportedBrowser);const l=n||a||o||r;ee(this.overlayElem,"aria-hidden",!l)}showOverlay(t,e){if(!t.enabled)return;const i=t.getElement(this.animationManager,this.localeManager,e);this.overlayElem.appendChild(i)}hideOverlay(t){t.removeElement(()=>{this.overlayElem.innerText="\xA0"},this.animationManager)}}}}),Wn,bx,we,Tg,Sx=I({"packages/ag-charts-community/src/chart/chart.ts"(){"use strict";ot(),no(),pe(),$Y(),di(),_c(),Rn(),jn(),qY(),oe(),fw(),fI(),Qt(),Is(),mw(),mt(),tr(),u5(),VK(),GK(),UE(),QE(),zu(),Ig(),aA(),hx(),u$(),d$(),f$(),m$(),ju(),A$(),D$(),L$(),$c(),Y$(),K$(),Lg(),$$(),X$(),q$(),Wn=Jt.create(!0,"opts"),bx=class extends bt{constructor(){super(...arguments),this.padding=new Jo(0)}},M([k(pt,{optional:!0})],bx.prototype,"clip",2),M([k(lt)],bx.prototype,"padding",2),we=class e3 extends gI{constructor(e,i){var s;super(),this.id=En(this),this.seriesRoot=new is({name:`${this.id}-series-root`,zIndex:5}),this.annotationRoot=new is({name:`${this.id}-annotation-root`,zIndex:9}),this.titleGroup=new yt({name:"titles",zIndex:13}),this.debug=Jt.create(),this.extraDebugStats={},this.data=[],this._firstAutoSize=!0,this._autoSizeNotify=new rI,this.padding=new Jo(20),this.seriesArea=new bx,this.keyboard=new dx,this.touch=new IA,this.mode="standalone",this.chartCaptions=new mg,this.suppressFieldDotNotation=!1,this.destroyed=!1,this._destroyFns=[],this.skipSync=!1,this.chartAnimationPhase="initial",this.modulesManager=new rR,this.processors=[],this.queuedUserOptions=[],this.queuedChartOptions=[],this.firstApply=!0,this._pendingFactoryUpdatesCount=0,this._performUpdateSkipAnimations=!1,this._performUpdateNotify=new rI,this.performUpdateType=7,this.runningUpdateType=7,this.updateShortcutCount=0,this.seriesToUpdate=new Set,this.updateMutex=new gw,this.updateRequestors={},this.performUpdateTrigger=t5(({count:h})=>{this.destroyed||this.updateMutex.acquire(async()=>{try{await this.performUpdate(h)}catch(u){et.error("update error",u)}}).catch(u=>et.errorOnce(u))}),this._performUpdateSplits={},this.axes=[],this.series=[],this._cachedData=void 0,this.onSeriesNodeClick=h=>{this.fireEvent({...h,type:"seriesNodeClick"})},this.onSeriesNodeDoubleClick=h=>{this.fireEvent({...h,type:"seriesNodeDoubleClick"})},this.onSeriesVisibilityChange=h=>{this.fireEvent(h)},this.seriesGroupingChanged=h=>{if(!(h instanceof gx))return;const{series:u,seriesGrouping:d,oldGrouping:p}=h;u.contentGroup.isRoot()||this.seriesLayerManager.changeGroup({internalId:u.internalId,type:u.type,contentGroup:u.contentGroup,renderToOffscreenCanvas:()=>u.renderToOffscreenCanvas(),seriesGrouping:d,oldGrouping:p})},this.chartOptions=e;const n=i?.scene,a=i?.container??e.processedOptions.container??void 0,o=i?.styleContainer??e.specialOverrides.styleContainer;n&&(this._firstAutoSize=!1,this._lastAutoSize=[n.width,n.height,n.pixelRatio]);const r=new yt({name:"root"});r.visible=!1,r.append(this.seriesRoot),r.append(this.annotationRoot),r.append(this.titleGroup),this.titleGroup.append(this.title.node),this.titleGroup.append(this.subtitle.node),this.titleGroup.append(this.footnote.node),this.tooltip=new Sa,this.seriesLayerManager=new TR(this.seriesRoot),this.mode=e.userOptions.mode??this.mode;const l=this.ctx=new YE(this,{chartType:this.getChartType(),scene:n,root:r,container:a,styleContainer:o,syncManager:new iR(this),fireEvent:h=>this.fireEvent(h),updateCallback:(h,u)=>this.update(h,u),updateMutex:this.updateMutex});this._destroyFns.push(l.domManager.addListener("resize",()=>this.parentResize(l.domManager.containerSize))),this.overlays=new Kc,(s=this.overlays.loading).renderer??(s.renderer=()=>k$(this.overlays.loading.getText(l.localeManager),l.animationManager.defaultDuration)),this.processors=[new CR(this,l.dataService,l.updateService,l.zoomManager,l.animationManager),new BR(this,this.overlays,l.dataService,l.layoutManager,l.localeManager,l.animationManager,l.domManager)],this.highlight=new QI,this.container=a;const c=this.getModuleContext();l.domManager.setDataBoolean("animating",!1),this.seriesAreaManager=new LR(this.initSeriesAreaDependencies()),this._destroyFns.push(l.layoutManager.registerElement(0,h=>{h.layoutBox.shrink(this.padding.toJson()),this.chartCaptions.positionCaptions(h)}),l.layoutManager.addListener("layout:complete",h=>this.chartCaptions.positionAbsoluteCaptions(h)),l.dataService.addListener("data-load",h=>{this.data=h.data}),this.title.registerInteraction(c,"beforebegin"),this.subtitle.registerInteraction(c,"beforebegin"),this.footnote.registerInteraction(c,"afterend"),ya.addWindowEvent("page-left",()=>this.destroy()),l.animationManager.addListener("animation-frame",()=>{this.update(6)}),l.animationManager.addListener("animation-start",()=>l.domManager.setDataBoolean("animating",!0)),l.animationManager.addListener("animation-stop",()=>l.domManager.setDataBoolean("animating",!1)),l.zoomManager.addListener("zoom-change",()=>{this.series.forEach(u=>u.animationState?.transition("updateData"));const h=this.chartAnimationPhase!=="initial";this.update(3,{forceNodeDataRefresh:!0,skipAnimations:h})})),this.parentResize(l.domManager.containerSize)}static getInstance(e){return e3.chartsInstances.get(e)}get canvasElement(){return this.ctx.scene.canvas.element}download(e,i){this.ctx.scene.download(e,i)}getCanvasDataURL(e){return this.ctx.scene.getDataURL(e)}toSVG(){return this.ctx.scene.toSVG()}getOptions(){return this.queuedUserOptions.at(-1)??this.chartOptions.userOptions}getChartOptions(){return this.queuedChartOptions.at(-1)??this.chartOptions}overrideFocusVisible(e){this.seriesAreaManager.focusIndicator.overrideFocusVisible(e)}initSeriesAreaDependencies(){const{ctx:e,tooltip:i,highlight:s,overlays:n,seriesRoot:a,mode:o}=this,r=this.getChartType();return{fireEvent:this.fireEvent.bind(this),getUpdateType:()=>this.performUpdateType,chartType:r,ctx:e,tooltip:i,highlight:s,overlays:n,seriesRoot:a,mode:o}}getModuleContext(){return this.ctx}getCaptionText(){return[this.title,this.subtitle,this.footnote].filter(e=>e.enabled&&e.text).map(e=>e.text).join(". ")}getAriaLabel(){return this.ctx.localeManager.t("ariaAnnounceChart",{seriesCount:this.series.length})}resetAnimations(){this.chartAnimationPhase="initial";for(const e of this.series)e.resetAnimation(this.chartAnimationPhase);for(const e of this.axes)e.resetAnimation(this.chartAnimationPhase);this.animationRect=void 0,this.ctx.animationManager.reset()}skipAnimations(){this.ctx.animationManager.skipCurrentBatch(),this._performUpdateSkipAnimations=!0}detachAndClear(){this.container=void 0,this.ctx.scene.clear()}destroy(e){if(this.destroyed)return;const i=e?.keepTransferableResources;let s;return this.performUpdateType=7,this._destroyFns.forEach(n=>n()),this.processors.forEach(n=>n.destroy()),this.tooltip.destroy(this.ctx.domManager),this.overlays.destroy(),this.modulesManager.destroy(),i?(this.ctx.scene.strip(),s={container:this.container,scene:this.ctx.scene}):(this.ctx.scene.destroy(),this.container=void 0),this.destroySeries(this.series),this.seriesLayerManager.destroy(),this.axes.forEach(n=>n.destroy()),this.axes=[],this.animationRect=void 0,this.ctx.destroy(),this.destroyed=!0,Object.freeze(this),s}requestFactoryUpdate(e){this.destroyed||(this._pendingFactoryUpdatesCount++,this.updateMutex.acquire(async()=>{if(!this.destroyed)try{await e(this)}finally{this.destroyed||this._pendingFactoryUpdatesCount--}}).catch(i=>et.errorOnce(i)))}update(e=0,i){if(this.destroyed)return;const{forceNodeDataRefresh:s=!1,skipAnimations:n,seriesToUpdate:a=this.series,newAnimationBatch:o}=i??{};this.ctx.widgets.seriesWidget.setDragTouchEnabled(this.touch.dragAction!=="none"),s&&this.series.forEach(r=>r.markNodeDataDirty());for(const r of a)this.seriesToUpdate.add(r);if(n&&(this.ctx.animationManager.skipCurrentBatch(),this._performUpdateSkipAnimations=!0),o&&this.ctx.animationManager.isActive()&&(this._performUpdateSkipAnimations=!0),this.skipSync=i?.skipSync??!1,this.debug.check()){let r=new Error().stack??"";r=r.replace(/\([^)]*/g,""),this.updateRequestors[r]=e}ethis.chartAnimationPhase="ready")),this.debug("Chart.performUpdate() - start",Bu[i]);let r=performance.now();n.start??(n.start=r);const l=h=>{n[h]??(n[h]=0),n[h]+=performance.now()-r,r=performance.now()};switch(i){case 0:if(this.checkUpdateShortcut(0))break;this.ctx.updateService.dispatchPreDomUpdate(),this.updateDOM();case 1:if(this.checkUpdateShortcut(1))break;await this.updateData(),l("\u2B07\uFE0F");case 2:if(this.checkUpdateShortcut(2))break;await this.processData(),this.seriesAreaManager.dataChanged(),l("\u{1F3ED}");case 3:if(await this.checkFirstAutoSize(),this.checkUpdateShortcut(3))break;await this.processLayout(),l("\u2316");case 4:{if(this.checkUpdateShortcut(4))break;await this.updateSeries(o),l("\u{1F914}"),this.updateAriaLabels(),this.seriesLayerManager.updateLayerCompositing()}case 5:if(this.checkUpdateShortcut(5))break;a.updateService.dispatchPreSceneRender(),l("\u2196");case 6:if(this.checkUpdateShortcut(6))break;a.animationManager.endBatch(),s.updateShortcutCount=this.updateShortcutCount,a.scene.render({debugSplitTimes:n,extraDebugStats:s,seriesRect:this.seriesRect}),this.extraDebugStats={};for(const h of Object.keys(n))delete n[h];this.ctx.domManager.incrementDataCounter("sceneRenders");case 7:this.updateShortcutCount=0,this.updateRequestors={},this._performUpdateSkipAnimations=!1,a.animationManager.endBatch()}this.destroyed||(a.updateService.dispatchUpdateComplete(),this.ctx.domManager.setDataBoolean("updatePending",!1),this.runningUpdateType=7),this._performUpdateNotify.notify();const c=performance.now();this.debug("Chart.performUpdate() - end",{chart:this,durationMs:Math.round((c-n.start)*100)/100,count:e,performUpdateType:Bu[i]})}updateThemeClassName(){const e="ag-charts-theme-",i=[`${e}default`,`${e}default-dark`];let s=i[0],n=!1,{theme:a}=this.chartOptions.processedOptions;for(;typeof a!="string"&&a!=null;)a=a.baseTheme;typeof a=="string"&&(s=a.replace("ag-",e),n=a.includes("-dark")),i.includes(s)||(s=n?i[1]:i[0]),this.ctx.domManager.setThemeClass(s)}updateDOM(){this.updateThemeClassName();const{enabled:e,tabIndex:i}=this.keyboard;this.ctx.domManager.setTabGuardIndex(e?i??0:-1),this.ctx.domManager.setThemeParameters(this.chartOptions.themeParameters)}updateAriaLabels(){this.ctx.domManager.updateCanvasLabel(this.getAriaLabel())}checkUpdateShortcut(e){return this.destroyed?!0:this.updateShortcutCount>3?(et.warn("exceeded the maximum number of simultaneous updates (4), discarding changes and rendering",this.updateRequestors),!1):this.performUpdateType<=e?(this.updateShortcutCount++,!0):!1}async checkFirstAutoSize(){this.width!=null&&this.height!=null||this._lastAutoSize||await this._autoSizeNotify.await(500)||this.debug("Chart.checkFirstAutoSize() - timeout for first size update.")}onAxisChange(e,i){i==null&&e.length===0||this.ctx.axisManager.updateAxes(i??[],e)}onSeriesChange(e,i){const s=i?.filter(n=>!e.includes(n))??[];this.destroySeries(s),this.seriesLayerManager?.setSeriesCount(e.length);for(const n of e){if(i?.includes(n))continue;const a=this.seriesLayerManager.requestGroup(n);n.attachSeries(a,this.seriesRoot,this.annotationRoot);const o=this;n.chart={get mode(){return o.mode},get isMiniChart(){return!1},get seriesRect(){return o.seriesRect}},n.resetAnimation(this.chartAnimationPhase),this.addSeriesListeners(n),n.addChartEventListeners()}this.seriesAreaManager?.seriesChanged(e)}destroySeries(e){e?.forEach(i=>{i.removeEventListener("nodeClick",this.onSeriesNodeClick),i.removeEventListener("nodeDoubleClick",this.onSeriesNodeDoubleClick),i.removeEventListener("groupingChanged",this.seriesGroupingChanged),i.destroy(),this.seriesLayerManager.releaseGroup(i),i.detachSeries(void 0,this.seriesRoot,this.annotationRoot),i.chart=void 0})}addSeriesListeners(e){this.hasEventListener("seriesNodeClick")&&e.addEventListener("nodeClick",this.onSeriesNodeClick),this.hasEventListener("seriesNodeDoubleClick")&&e.addEventListener("nodeDoubleClick",this.onSeriesNodeDoubleClick),this.hasEventListener("seriesVisibilityChange")&&e.addEventListener("seriesVisibilityChange",this.onSeriesVisibilityChange),e.addEventListener("groupingChanged",this.seriesGroupingChanged)}assignSeriesToAxes(){for(const e of this.axes)e.boundSeries=this.series.filter(i=>i.axes[e.direction]===e)}assignAxesToSeries(){const e=kM(this.axes,i=>i.direction);for(const i of this.series)for(const s of i.directions){const n=e[s];if(!n){et.warnOnce(`no available axis for direction [${s}]; check series and axes configuration.`);return}const a=i.getKeys(s),o=n.find(r=>!r.keys.length||a.some(l=>r.keys.includes(l)));if(!o){et.warnOnce(`no matching axis for direction [${s}] and keys [${a}]; check series and axes configuration.`);return}i.axes[s]=o}}parentResize(e){if(e==null||this.width!=null&&this.height!=null)return;let{width:i,height:s}=e;const{pixelRatio:n}=e;if(i=Math.floor(i),s=Math.floor(s),i===0&&s===0)return;const[a=0,o=0,r=1]=this._lastAutoSize??[];a===i&&o===s&&r===n||(this._lastAutoSize=[i,s,n],this.resize("SizeMonitor",{}))}resize(e,i){const{scene:s,animationManager:n}=this.ctx,{inWidth:a,inHeight:o,inMinWidth:r,inMinHeight:l,inOverrideDevicePixelRatio:c}=i;this.ctx.domManager.setSizeOptions(r??this.minWidth,l??this.minHeight,a??this.width,o??this.height);const h=a??this.width??this._lastAutoSize?.[0],u=o??this.height??this._lastAutoSize?.[1],d=c??this.overrideDevicePixelRatio??this._lastAutoSize?.[2];if(this.debug(`Chart.resize() from ${e}`,{width:h,height:u,pixelRatio:d,stack:new Error().stack}),!(h==null||u==null||!zt(h)||!zt(u))&&s.resize(h,u,d)){n.reset();let p=!0;(this.width==null||this.height==null)&&this._firstAutoSize&&(p=!1,this._firstAutoSize=!1),this.update(3,{forceNodeDataRefresh:!0,skipAnimations:p}),this._autoSizeNotify.notify()}}async updateData(){this.series.forEach(i=>i.setChartData(this.data));const e=this.modulesManager.mapModules(i=>i.updateData?.(this.data));await Promise.all(e)}async processData(){this.series.some(n=>n.canHaveAxes)&&(this.assignAxesToSeries(),this.assignSeriesToAxes());const e=new nA(this.mode,this.suppressFieldDotNotation),i=this.series.map(n=>(n.resetDatumCallbackCache(),n.processData(e))),s=this.modulesManager.mapModules(n=>n.processData?.(e));this._cachedData=e.execute(this._cachedData),await Promise.all([...i,...s]);for(const n of this.axes)n.processData();this.updateLegends()}updateLegends(e){for(const{legend:i,legendType:s}of this.modulesManager.legends())s==="category"?this.setCategoryLegendData(e):this.setLegendData(s,i)}setCategoryLegendData(e){var i;const{ctx:{legendManager:s,stateManager:n}}=this;e&&this.series.forEach(o=>{const r=e.find(l=>l.seriesId===o.id);o.onLegendInitialState("category",r)});const a=this.series.flatMap(o=>{const r=o.getLegendData("category");return s.updateData(o.id,r),r});if(e){n.setStateAndRestore(s,e);return}if(this.mode!=="integrated"){const o={},r=new Map(this.series.map(l=>[l.id,l.type]));for(const{seriesId:l,symbol:{marker:c},label:h}of a.filter(u=>!u.hideInLegend)){if(c.fill==null)continue;const u=r.get(l),d=o[u]??(o[u]={});d[i=h.text]??(d[i]=c.fill),d[h.text]!==c.fill&&et.warnOnce(`legend item '${h.text}' has multiple fill colors, this may cause unexpected behaviour.`)}}s.update()}setLegendData(e,i){i.data=this.series.filter(s=>s.properties.showInLegend).flatMap(s=>s.getLegendData(e))}async processLayout(){const e=this.animationRect,{width:i,height:s}=this.ctx.scene,n=this.ctx.layoutManager.createContext(i,s);await this.performLayout(n),e&&!this.animationRect?.equals(e)&&this.ctx.animationManager.skipCurrentBatch(),this.debug("Chart.performUpdate() - seriesRect",this.seriesRect)}async updateSeries(e){const{seriesRect:i}=this;await Promise.all(e.map(s=>s.update({seriesRect:i}))),this.ctx.seriesLabelLayoutManager.updateLabels(this.series.filter(s=>s.visible&&s.usesPlacedLabels),this.padding,this.seriesRect)}async waitForUpdate(e=1e4,i=!1){const s=performance.now();for(;(this._pendingFactoryUpdatesCount>0||this.performUpdateType!==7||this.runningUpdateType!==7)&&!this.destroyed;){if(this._pendingFactoryUpdatesCount>0&&await this.updateMutex.waitForClearAcquireQueue(),(this.performUpdateType!==7||this.runningUpdateType!==7)&&await this._performUpdateNotify.await(),performance.now()-s>e){const n=`Chart.waitForUpdate() timeout of ${e} reached - first chart update taking too long.`;if(i)throw new Error(n);et.warnOnce(n)}ow()&&await KY()}}filterMiniChartSeries(e){return e?.filter(i=>i.showInMiniChart!==!1)}applyOptions(e){const i=this.firstApply?e.processedOptions:e.diffOptions(this.chartOptions);if(i==null||Object.keys(i).length===0)return;const s=this.firstApply?{}:this.chartOptions.processedOptions,n=e.processedOptions;Wn("Chart.applyOptions() - applying delta",i);const a=this.applyModules(n),o=["type","data","series","listeners","preset","theme","legend.listeners","navigator.miniChart.series","navigator.miniChart.label","locale.localeText","axes","topology","nodes","initialState","styleContainer"];i.listeners&&this.registerListeners(this,i.listeners),yg(this,i,{skip:o});let r=!1,l="no-op";i.series!=null&&(l=this.applySeries(this,i.series,s?.series),r=!0),l==="replaced"&&this.resetAnimations(),this.applyAxes(this,n,s,l,[])&&(r=!0),i.data&&(this.data=i.data),i.legend?.listeners&&this.modulesManager.isEnabled("legend")&&Object.assign(this.legend.listeners,i.legend.listeners),i.locale?.localeText&&(this.modulesManager.getModule("locale").localeText=i.locale?.localeText),this.chartOptions=e;const c=this.modulesManager.getModule("navigator"),h=this.modulesManager.getModule("zoom");!c?.enabled&&!h?.enabled&&this.ctx.zoomManager.updateZoom("chart");const u=c?.miniChart,d=n.navigator?.miniChart?.series??n.series;u?.enabled===!0&&d!=null?this.applyMiniChartOptions(u,d,n,s):u?.enabled===!1&&(u.series=[],u.axes=[]),this.ctx.annotationManager.setAnnotationStyles(e.annotationThemes),r||(r=this.shouldForceNodeDataRefresh(i,l));const g=r||a?0:3;this.maybeResetAnimations(l),this.shouldClearLegendData(n,s,l)&&this.ctx.legendManager.clearData(),this.applyInitialState(n),Wn("Chart.applyOptions() - update type",Bu[g],{seriesStatus:l,forceNodeDataRefresh:r}),this.update(g,{forceNodeDataRefresh:r,newAnimationBatch:!0}),this.firstApply=!1}applyInitialState(e){const{annotationManager:i,chartTypeOriginator:s,historyManager:n,stateManager:a,zoomManager:o}=this.ctx,{initialState:r}=e;if("annotations"in e&&e.annotations?.enabled&&r?.annotations!=null){const l=r.annotations.map(c=>{const h=i.getAnnotationTypeStyles(c.type);return Tt(c,h)});a.setState(i,l)}r?.chartType!=null&&a.setState(s,r.chartType),(e.navigator?.enabled||e.zoom?.enabled)&&r?.zoom!=null&&a.setState(o,r.zoom),r?.legend!=null&&this.updateLegends(r.legend),r!=null&&n.clear()}maybeResetAnimations(e){if(this.mode==="standalone")switch(e){case"series-grouping-change":case"replaced":this.resetAnimations();break;default:}}shouldForceNodeDataRefresh(e,i){const s=!!e.data||i==="data-change"||i==="replaced",n=lx.getKeys(),a=Object.values(n).some(r=>e[r]!=null),o=e.title!=null&&e.subtitle!=null;return s||a||o}shouldClearLegendData(e,i,s){const n=s==="replaced"||s==="series-grouping-change"||s==="updated",a=i.legend!=null&&e.legend==null;return n||a}applyMiniChartOptions(e,i,s,n){const a=n?.navigator?.miniChart?.series??n?.series,o=this.applySeries(e,this.filterMiniChartSeries(i),this.filterMiniChartSeries(a));this.applyAxes(e,s,n,o,["axes[].tick","axes[].thickness","axes[].title","axes[].crosshair","axes[].gridLine","axes[].label"]);const r=e.series;for(const h of r)h.properties.id=void 0;const l=e.axes,c=l.find(h=>h.direction==="x");for(const h of l)h.nice=!1,h.gridLine.enabled=!1,h.label.enabled=h===c,h.tick.enabled=!1,h.interactionEnabled=!1;if(c!=null){const h=s.navigator?.miniChart,u=h?.label,d=h?.label?.interval;if(c.line.enabled=!1,c.label.set(PM(u,["interval","rotation","minSpacing","autoRotate","autoRotateAngle"])),c.tick.set(PM(d,["enabled","width","size","color","interval","step"])),c.type==="grouped-category"){c.label.enabled=!1,c.label.rotation=0;const{depthOptions:g}=c;if(g.length===0)g.set([{label:{enabled:!0}}]);else for(let f=1;fr.moduleFactory(this.getModuleContext())),n.type==="legend"&&this.modulesManager.getModule(n)?.attachLegend(this.ctx.scene),this[n.optionsKey]=this.modulesManager.getModule(n)):(this.modulesManager.removeModule(n),delete this[n.optionsKey]),s=!0)}return s}initSeriesDeclarationOrder(e){for(let i=0;ithis.createSeries(u));return this.initSeriesDeclarationOrder(h),e.series=h,"replaced"}Wn("Chart.applySeries() - matchResult",n);const a=[];let o=!1,r=!1,l=!1;const c=n.changes.toSorted((h,u)=>h.targetIdx-u.targetIdx);for(const h of c)switch(r||(r=h.status==="series-grouping"),o||(o=h.diff?.data!=null),l||(l=h.status!=="no-op"),h.status){case"add":{const u=this.createSeries(h.opts);a.push(u),Wn("Chart.applySeries() - created new series",u);break}case"remove":Wn(`Chart.applySeries() - removing series at previous idx ${h.idx}`,h.series);break;case"no-op":a.push(h.series),Wn(`Chart.applySeries() - no change to series at previous idx ${h.idx}`,h.series);break;case"series-grouping":case"update":default:{const{series:u,diff:d,idx:p}=h;Wn(`Chart.applySeries() - applying series diff previous idx ${p}`,d,u),this.applySeriesValues(u,d),u.markNodeDataDirty(),a.push(u)}}return this.initSeriesDeclarationOrder(a),Wn("Chart.applySeries() - final series instances",a),e.series=a,r?"series-grouping-change":o?"data-change":l?"updated":"no-op"}applyAxes(e,i,s,n,a=[]){if(!("axes"in i)||!i.axes)return!1;a=["axes[].type",...a];const{axes:o}=i;return!(n==="replaced")&&e.axes.length===o.length&&e.axes.every((c,h)=>c.type===o[h].type)&&cA(s)?(e.axes.forEach((c,h)=>{const u=s.axes?.[h]??{},d=Qo(u,o[h]);Wn(`Chart.applyAxes() - applying axis diff idx ${h}`,d);const p=`axes[${h}]`;yg(c,d,{path:p,skip:a})}),!0):(Wn(`Chart.applyAxes() - creating new axes instances; seriesStatus: ${n}`),e.axes=this.createAxis(o,a),!0)}createSeries(e){const i=Ds.create(e.type,this.getModuleContext());return this.applySeriesOptionModules(i,e),this.applySeriesValues(i,e),i}applySeriesOptionModules(e,i){const s=e.createModuleContext(),n=e.getModuleMap();for(const a of pa.byType("series-option"))a.optionsKey in i&&a.seriesTypes.includes(e.type)&&n.addModule(a,o=>o.moduleFactory(s))}applySeriesValues(e,i){const s=e.getModuleMap(),{type:n,data:a,listeners:o,seriesGrouping:r,showInMiniChart:l,...c}=i;for(const h of Yc)if(h.type==="series-option"&&h.optionsKey in c){const u=s.getModule(h.optionsKey);if(u){const d=c[h.optionsKey];delete c[h.optionsKey],u.properties.set(d)}}e.properties.set(c),"data"in i&&e.setOptionsData(a),o&&this.registerListeners(e,o),"seriesGrouping"in i&&(r==null?e.seriesGrouping=void 0:e.seriesGrouping={...e.seriesGrouping,...r})}createAxis(e,i){const s=[],n=this.getModuleContext();for(let a=0;ar.moduleFactory(s)),e[a.optionsKey]=n.getModule(a)):(n.removeModule(a),delete e[a.optionsKey]))}}registerListeners(e,i){e.clearEventListeners();for(const[s,n]of Object.entries(i))cc(n)&&e.addEventListener(s,n)}},we.chartsInstances=new WeakMap,M([js({newValue(t){this.destroyed||(this.ctx.domManager.setContainer(t),we.chartsInstances.set(t,this))},oldValue(t){we.chartsInstances.delete(t)}})],we.prototype,"container",2),M([js({newValue(t){this.resize("width option",{inWidth:t})}})],we.prototype,"width",2),M([js({newValue(t){this.resize("height option",{inHeight:t})}})],we.prototype,"height",2),M([js({newValue(t){this.resize("minWidth option",{inMinWidth:t})}})],we.prototype,"minWidth",2),M([js({newValue(t){this.resize("minHeight option",{inMinHeight:t})}})],we.prototype,"minHeight",2),M([js({newValue(t){this.resize("overrideDevicePixelRatio option",{inOverrideDevicePixelRatio:t})}})],we.prototype,"overrideDevicePixelRatio",2),M([k(lt)],we.prototype,"padding",2),M([k(lt)],we.prototype,"seriesArea",2),M([k(lt)],we.prototype,"keyboard",2),M([k(lt)],we.prototype,"touch",2),M([k(ie(["standalone","integrated"],"a chart mode"))],we.prototype,"mode",2),M([ue("chartCaptions.title")],we.prototype,"title",2),M([ue("chartCaptions.subtitle")],we.prototype,"subtitle",2),M([ue("chartCaptions.footnote")],we.prototype,"footnote",2),M([k(pt)],we.prototype,"suppressFieldDotNotation",2),M([js({changeValue(t,e){this.onAxisChange(t,e)}})],we.prototype,"axes",2),M([js({changeValue(t,e){this.onSeriesChange(t,e)}})],we.prototype,"series",2),Tg=we}});function AA(t,e,i){const s=Math.min(...e),n=zR[t]??FR;return s>=0?n(t,i):-n(t,-i)}function DA(t,e,i){const s=Math.min(...e),n=jR[t]??VR;return s>=0?n(t,i):-n(t,-i)}var zR,FR,jR,VR,vx,kA=I({"packages/ag-charts-community/src/scale/logScale.ts"(){"use strict";At(),kO(),Cc(),Qi(),_2(),zR={2:(t,e)=>Math.log2(e),[Math.E]:(t,e)=>Math.log(e),10:(t,e)=>Math.log10(e)},FR=(t,e)=>Math.log(e)/Math.log(t),jR={[Math.E]:(t,e)=>Math.exp(e),10:(t,e)=>e>=0?10**e:1/10**-e},VR=(t,e)=>t**e,vx=class extends Wt{constructor(t=[1,10],e=[0,1]){super(t,e),this.type="log",this.defaultClamp=!0,this.base=10,this.log=i=>AA(this.base,this.domain,i),this.pow=i=>DA(this.base,this.domain,i)}toDomain(t){return t}transform(t){const[e,i]=Si(this.domain);return e>=0!=i>=0?NaN:e>=0?Math.log(t):-Math.log(-t)}transformInvert(t){const[e,i]=Si(this.domain);return e>=0!=i>=0?NaN:e>=0?Math.exp(t):-Math.exp(-t)}niceDomain(t,e=this.domain){if(e.length<2)return[];const{base:i}=this,[s,n]=e,a=s>n?Math.ceil:Math.floor,o=s>n?Math.floor:Math.ceil,r=DA(i,e,a(AA(i,e,s))),l=DA(i,e,o(AA(i,e,n)));return[r,l]}ticks({interval:t,tickCount:e=Wt.defaultTickCount},i=this.domain,s){if(!i||i.length<2||e<1)return[];const n=this.base,[a,o]=i,r=Math.min(a,o),l=Math.max(a,o);let c=this.log(r),h=this.log(l);if(t){const f=b=>b>=r&&b<=l,x=Math.min(Math.abs(t),Math.abs(h-c)),m=ng(c,h,x).map(this.pow).filter(f);if(!ag(m.length,this.getPixelRange()))return m}if(!n2(n)||h-c>=e)return w0(c,h,Math.min(h-c,e)).map(this.pow);let u=[];const d=r>0;c=Math.floor(c)-1,h=Math.round(h)+1;const p=du(this.range)/e;let g=1/0;for(let f=c;f<=h;f++){const x=this.convert(this.pow(f+1));for(let m=1;m=p&&T>=p;v>=r&&v<=l&&(m===1||D||u.length===0)&&(u.push(v),g=S)}}return u=R2(u,d,s),u}tickFormatter({specifier:t}){return t!=null?SO(t):String}datumFormatter(t){return this.tickFormatter(t)}}}}),GR,WR,UR,HR,J$=I({"packages/ag-charts-community/src/scene/util/quadtree.ts"(){"use strict";Xy(),Rt(),GR=class{constructor(t,e,i){this.root=new HR(t,e,i)}clear(t){this.root.clear(t)}addValue(t,e){const i={hitTester:t,value:e,distanceSquared:(s,n)=>t.distanceSquared(s,n)};this.root.addElem(i)}find(t,e){const i={best:{nearest:void 0,distanceSquared:1/0}};return this.root.find(t,e,i),i.best}},WR=class{constructor(t,e,i,s){this.nw=t,this.ne=e,this.sw=i,this.se=s}addElem(t){this.nw.addElem(t),this.ne.addElem(t),this.sw.addElem(t),this.se.addElem(t)}find(t,e,i){this.nw.find(t,e,i),this.ne.find(t,e,i),this.sw.find(t,e,i),this.se.find(t,e,i)}},UR=class{constructor(t,e,i){this.capacity=t,this.maxdepth=e,this.boundary=i??ht.NaN,this.elems=[],this.subdivisions=void 0}clear(t){this.elems.length=0,this.boundary=t,this.subdivisions=void 0}addElem(t){this.addCondition(t)&&(this.subdivisions===void 0?this.maxdepth===0||this.elems.length1){const o=n>a?Math.ceil:Math.floor,r=n>a?Math.floor:Math.ceil,l=4;for(let c=0;cZo(n,i)}datumFormatter({ticks:e,fractionDigits:i,specifier:s}){return s!=null?NO(e,s):n=>Zo(n,i+1)}}}});function ar(t){if(t.length===0)return null;let e=1/0,i=-1/0;for(const n of t){const a=n instanceof Date?n.getTime():n;typeof a=="number"&&(ai&&(i=a))}const s=[e,i];return s.every(isFinite)?s:null}function LA(t,e,i){let s=!1;return t.length>2&&(t=ar(t)??[NaN,NaN]),isNaN(e)||(s||(s=e>t[0]),t=[e,t[1]]),isNaN(i)||(s||(s=it[1]&&(t=[]),{extent:t,clipped:s}}var lo=I({"packages/ag-charts-community/src/util/extent.ts"(){"use strict"}}),or,Mx=I({"packages/ag-charts-community/src/chart/axis/numberAxis.ts"(){"use strict";Zc(),ug(),lo(),mt(),gg(),or=class extends Ou{constructor(t,e=new Un){super(t,e),this.min=NaN,this.max=NaN}normaliseDataDomain(t){const{min:e,max:i}=this,{extent:s,clipped:n}=LA(t,e,i);return{domain:s,clipped:n}}},or.className="NumberAxis",or.type="number",M([k(ha(Ic,Iu("max"))),sl(NaN)],or.prototype,"min",2),M([k(ha(Ic,Au("min"))),sl(NaN)],or.prototype,"max",2)}}),ll,TA=I({"packages/ag-charts-community/src/chart/axis/timeAxis.ts"(){"use strict";P0(),lo(),mt(),gg(),ll=class extends Ou{constructor(t){super(t,new _0),this.min=void 0,this.max=void 0}normaliseDataDomain(t){let{min:e,max:i}=this,s=!1;return typeof e=="number"&&(e=new Date(e)),typeof i=="number"&&(i=new Date(i)),t.length>2&&(t=ar(t)?.map(n=>new Date(n))??[]),e instanceof Date&&(s||(s=e>t[0]),t=[e,t[1]]),i instanceof Date&&(s||(s=it[1]&&(t=[]),{domain:t,clipped:s}}},ll.className="TimeAxis",ll.type="time",M([k(ha(cm,Iu("max")),{optional:!0})],ll.prototype,"min",2),M([k(ha(cm,Au("min")),{optional:!0})],ll.prototype,"max",2)}}),Ix,CA=I({"packages/ag-charts-community/src/chart/series/dataModelSeries.ts"(){"use strict";Qi(),At(),$c(),Ix=class extends Ag{constructor(){super(...arguments),this.clipFocusBox=!0}getScaleInformation({xScale:t,yScale:e}){const i=Wt.is(t),s=Wt.is(e);return{isContinuousX:i,isContinuousY:s,xScaleType:t?.type,yScaleType:e?.type}}getModulePropertyDefinitions(){const t=this.axes.x?.scale,e=this.axes.y?.scale;return this.moduleMap.mapModules(i=>i.getPropertyDefinitions(this.getScaleInformation({xScale:t,yScale:e}))).flat()}async requestDataModel(t,e,i){i.props.push(...this.getModulePropertyDefinitions());const{dataModel:s,processedData:n}=await t.request(this.id,e??[],i);return this.dataModel=s,this.processedData=n,this.dispatch("data-processed",{dataModel:s,processedData:n}),{dataModel:s,processedData:n}}isProcessedDataAnimatable(){const t=this.processedData?.reduced?.animationValidation;if(!t)return!0;const{orderedKeys:e,uniqueKeys:i}=t;return e&&i}checkProcessedDataAnimatable(){this.isProcessedDataAnimatable()||this.ctx.animationManager.skipCurrentBatch()}pickFocus(t){const e=this.getNodeData();if(e===void 0||e.length===0)return;const i=this.computeFocusDatumIndex(t,e);if(i===void 0)return;const{clipFocusBox:s}=this,n=e[i],a={...t,datumIndex:i},o=this.computeFocusBounds(a);if(o!==void 0)return{bounds:o,clipFocusBox:s,datum:n,datumIndex:i}}computeFocusDatumIndex(t,e){const i=r=>{const{missing:l=!1,enabled:c=!0,focusable:h=!0}=e[r];return!l&&c&&h},s=(r,l)=>{for(;r>=0&&!i(r);)r+=l;return r===-1?void 0:r},n=(r,l)=>{for(;r0?a=n(o,t.datumIndexDelta):a=n(o,1)??s(o,-1),a===void 0?t.datumIndexDelta===0?void 0:t.datumIndex-t.datumIndexDelta:a}}}}),co,Cg,NA,Ax,Yu,Ws,Ng=I({"packages/ag-charts-community/src/chart/series/seriesProperties.ts"(){"use strict";Qt(),mt(),co=class extends bt{constructor(){super(...arguments),this.fill="rgba(255,255,255, 0.33)",this.stroke="rgba(0, 0, 0, 0.4)",this.strokeWidth=2}},M([k(jt,{optional:!0})],co.prototype,"fill",2),M([k(Ut,{optional:!0})],co.prototype,"fillOpacity",2),M([k(jt,{optional:!0})],co.prototype,"stroke",2),M([k(st,{optional:!0})],co.prototype,"strokeWidth",2),M([k(Ut,{optional:!0})],co.prototype,"strokeOpacity",2),M([k(ua,{optional:!0})],co.prototype,"lineDash",2),M([k(st,{optional:!0})],co.prototype,"lineDashOffset",2),Cg=class extends bt{},M([k(st,{optional:!0})],Cg.prototype,"strokeWidth",2),M([k(Ut,{optional:!0})],Cg.prototype,"dimOpacity",2),M([k(pt,{optional:!0})],Cg.prototype,"enabled",2),NA=class extends bt{constructor(){super(...arguments),this.color="black"}},M([k(jt,{optional:!0})],NA.prototype,"color",2),Ax=class extends bt{constructor(){super(...arguments),this.enabled=!0}},M([k(pt,{optional:!0})],Ax.prototype,"enabled",2),Yu=class extends bt{constructor(){super(...arguments),this.item=new co,this.series=new Cg,this.text=new NA}},M([k(lt)],Yu.prototype,"item",2),M([k(lt)],Yu.prototype,"series",2),M([k(lt)],Yu.prototype,"text",2),Ws=class extends bt{constructor(){super(...arguments),this.visible=!0,this.focusPriority=1/0,this.showInLegend=!0,this.cursor="default",this.nodeClickRange="exact",this.highlight=new Ax,this.highlightStyle=new Yu}},M([k(tt,{optional:!0})],Ws.prototype,"id",2),M([k(pt)],Ws.prototype,"visible",2),M([k(n0,{optional:!0})],Ws.prototype,"focusPriority",2),M([k(pt)],Ws.prototype,"showInLegend",2),M([k(tt)],Ws.prototype,"cursor",2),M([k(qp)],Ws.prototype,"nodeClickRange",2),M([k(lt)],Ws.prototype,"highlight",2),M([k(lt)],Ws.prototype,"highlightStyle",2)}});function t6(t){let e,i;if(t instanceof or&&(Number.isFinite(t.min)||Number.isFinite(t.max))?(e=Number.isFinite(t.min)?t.min:void 0,i=Number.isFinite(t.max)?t.max:void 0):t instanceof ll&&(t.min!=null||t.max!=null)&&({min:e,max:i}=t),!(e==null&&i==null))return e??(e=-1/0),i??(i=1/0),[e,i]}function e6(t,e,i){const s=e[0].valueOf(),n=e[1].valueOf(),a=UN(0,t-1,r=>{const l=i(r)?.valueOf();return!Number.isFinite(l)||l>=s});let o=WN(0,t-1,r=>{const l=i(r)?.valueOf();return!Number.isFinite(l)||l<=n});return a==null||o==null?[0,0]:(o=Math.min(o+1,t),[a,o])}var cl,hl,Dx,ho,Og,rr,Us=I({"packages/ag-charts-community/src/chart/series/cartesian/cartesianSeries.ts"(){"use strict";ot(),Ac(),Hp(),Qi(),kA(),Rt(),pe(),el(),Gn(),Fs(),J$(),di(),ig(),mt(),wu(),Mx(),TA(),yO(),ba(),CA(),$c(),Ng(),Gc(),cl={x:["xKey"],y:["yKey"]},hl={x:["xName"],y:["yName"]},Dx=class extends Vu{constructor(t,e,i,s){super(t,e,i,s),this.xKey=s.properties.xKey,this.yKey=s.properties.yKey}},ho=class extends Ws{constructor(){super(...arguments),this.pickOutsideVisibleMinorAxis=!1}},M([k(tt,{optional:!0})],ho.prototype,"legendItemName",2),M([k(pt,{optional:!0})],ho.prototype,"pickOutsideVisibleMinorAxis",2),Og=100,rr=class extends Ix{constructor({pathsPerSeries:t=["path"],hasMarkers:e=!1,hasHighlightedLabels:i=!1,pathsZIndexSubOrderOffset:s=[],datumSelectionGarbageCollection:n=!0,markerSelectionGarbageCollection:a=!0,animationAlwaysUpdateSelections:o=!1,animationResetFns:r,directionKeys:l,directionNames:c,...h}){if(super({directionKeys:l,directionNames:c,canHaveAxes:!0,...h}),this.NodeEvent=Dx,this.dataNodeGroup=this.contentGroup.appendChild(new yt({name:`${this.id}-series-dataNodes`,zIndex:0})),this.markerGroup=this.contentGroup.appendChild(new yt({name:`${this.id}-series-markers`,zIndex:1})),this.labelGroup=this.contentGroup.appendChild(new is({name:`${this.id}-series-labels`})),this.labelSelection=Oe.select(this.labelGroup,ei),this.highlightSelection=Oe.select(this.highlightNode,()=>this.opts.hasMarkers?new ai:this.nodeFactory()),this.highlightLabelSelection=Oe.select(this.highlightLabel,ei),this.annotationSelections=new Set,this.debug=Jt.create(),!l||!c)throw new Error(`Unable to initialise series type ${this.type}`);this.opts={pathsPerSeries:t,hasMarkers:e,hasHighlightedLabels:i,pathsZIndexSubOrderOffset:s,directionKeys:l,directionNames:c,animationResetFns:r,animationAlwaysUpdateSelections:o,datumSelectionGarbageCollection:n,markerSelectionGarbageCollection:a},this.paths=t.map(u=>new ns({name:`${this.id}-${u}`})),this.datumSelection=Oe.select(this.dataNodeGroup,()=>this.nodeFactory(),n),this.markerSelection=Oe.select(this.markerGroup,ai,a),this.animationState=new Cu("empty",{empty:{update:{target:"ready",action:u=>this.animateEmptyUpdateReady(u)},reset:"empty",skip:"ready",disable:"disabled"},ready:{updateData:"waiting",clear:"clearing",highlight:u=>this.animateReadyHighlight(u),highlightMarkers:u=>this.animateReadyHighlightMarkers(u),resize:u=>this.animateReadyResize(u),reset:"empty",skip:"ready",disable:"disabled"},waiting:{update:{target:"ready",action:u=>{this.ctx.animationManager.isSkipped()?this.resetAllAnimation(u):this.animateWaitingUpdateReady(u)}},reset:"empty",skip:"ready",disable:"disabled"},disabled:{update:u=>this.resetAllAnimation(u),reset:"empty"},clearing:{update:{target:"empty",action:u=>this.animateClearingUpdateEmpty(u)},reset:"empty",skip:"ready"}},()=>this.checkProcessedDataAnimatable())}get contextNodeData(){return this._contextNodeData}getNodeData(){return this.contextNodeData?.nodeData}attachSeries(t,e,i){super.attachSeries(t,e,i),this.attachPaths(this.paths,e,i)}detachSeries(t,e,i){super.detachSeries(t,e,i),this.detachPaths(this.paths,e,i)}attachPaths(t,e,i){for(const s of t)this.contentGroup.appendChild(s)}detachPaths(t,e,i){for(const s of t)this.contentGroup.removeChild(s)}renderToOffscreenCanvas(){const t=this.getNodeData();return t!=null&&t.length>Og}resetAnimation(t){t==="initial"?this.animationState.transition("reset"):t==="ready"?this.animationState.transition("skip"):t==="disabled"&&this.animationState.transition("disable")}addChartEventListeners(){this.destroyFns.push(this.ctx.chartEventManager.addListener("legend-item-click",t=>this.onLegendItemClick(t)),this.ctx.chartEventManager.addListener("legend-item-double-click",t=>this.onLegendItemDoubleClick(t)))}destroy(){super.destroy(),this._contextNodeData=void 0}update({seriesRect:t}){const{visible:e,_contextNodeData:i}=this,n=this.ctx.highlightManager?.getActiveHighlight()?.series===this,a=this.checkResize(t),o=this.updateHighlightSelection(n);this.updateSelections(e),this.updateNodes(o,n,e);const r=this.getAnimationData(t,i);r&&(a&&this.animationState.transition("resize",r),this.animationState.transition("update",r))}updateSelections(t){var e;const i=!this.opts.animationAlwaysUpdateSelections&&this.ctx.animationManager.isSkipped();if(!(!t&&i)&&!(!this.nodeDataRefresh&&!this.isPathOrSelectionDirty())){if(this.nodeDataRefresh){this.nodeDataRefresh=!1,this.debug("CartesianSeries.updateSelections() - calling createNodeData() for",this.id),this.markQuadtreeDirty(),this._contextNodeData=this.createNodeData();const s=this.isProcessedDataAnimatable();this._contextNodeData&&((e=this._contextNodeData).animationValid??(e.animationValid=s));const{dataModel:n,processedData:a}=this;n!==void 0&&a!==void 0&&this.dispatch("data-update",{dataModel:n,processedData:a})}this.updateSeriesSelections()}}updateSeriesSelections(t){const{datumSelection:e,labelSelection:i,markerSelection:s,paths:n}=this,a=this._contextNodeData;if(!a)return;const{nodeData:o,labelData:r,itemId:l}=a;this.updatePaths({seriesHighlighted:t,itemId:l,contextData:a,paths:n}),this.datumSelection=this.updateDatumSelection({nodeData:o,datumSelection:e}),this.labelSelection=this.updateLabelSelection({labelData:r,labelSelection:i})??i,this.opts.hasMarkers&&(this.markerSelection=this.updateMarkerSelection({nodeData:o,markerSelection:s}))}updateNodes(t,e,i){const{highlightSelection:s,highlightLabelSelection:n,opts:{hasMarkers:a,hasHighlightedLabels:o}}=this,r=!this.ctx.animationManager.isSkipped(),l=this.visible&&this._contextNodeData!=null&&i;this.contentGroup.visible=r||l,this.highlightGroup.visible=(r||l)&&e;const c=this.getOpacity();a?(this.updateMarkerNodes({markerSelection:s,isHighlight:!0}),this.animationState.transition("highlightMarkers",s)):(this.updateDatumNodes({datumSelection:s,isHighlight:!0}),this.animationState.transition("highlight",s)),o&&this.updateLabelNodes({labelSelection:n});const{dataNodeGroup:h,markerGroup:u,datumSelection:d,labelSelection:p,markerSelection:g,paths:f,labelGroup:x}=this,{itemId:m}=this.contextNodeData??{};h.opacity=c,h.visible=r||l,x.visible=l,a&&(u.opacity=c,u.visible=l),x&&(x.opacity=c),this.updatePathNodes({seriesHighlighted:e,itemId:m,paths:f,opacity:c,visible:l,animationEnabled:r}),h.visible&&(this.updateDatumNodes({datumSelection:d,highlightedItems:t,isHighlight:!1}),this.usesPlacedLabels||this.updateLabelNodes({labelSelection:p}),a&&this.updateMarkerNodes({markerSelection:g,isHighlight:!1}))}getHighlightLabelData(t,e){const i=t.filter(s=>s.datum===e.datum&&s.itemId===e.itemId);return i.length===0?void 0:i}getHighlightData(t,e){return e?[e]:void 0}updateHighlightSelection(t){const{highlightSelection:e,highlightLabelSelection:i,_contextNodeData:s}=this;if(!s)return;const n=this.ctx.highlightManager?.getActiveHighlight(),a=t&&n?.datum?n:void 0;let o,r;if(a!=null){const l=this.isLabelEnabled(),{labelData:c,nodeData:h}=s;r=this.getHighlightData(h,a),o=l?this.getHighlightLabelData(c,a):void 0}return this.highlightSelection=this.updateHighlightSelectionItem({items:r,highlightSelection:e}),this.highlightLabelSelection=this.updateHighlightSelectionLabel({items:o,highlightLabelSelection:i}),r}markQuadtreeDirty(){this.quadtree=void 0}*datumNodesIter(){for(const{node:t}of this.datumSelection)t.datum.missing!==!0&&(yield t)}getQuadTree(){if(this.quadtree===void 0){const{width:t,height:e}=this.ctx.scene.canvas,i=new ht(0,0,t,e);this.quadtree=new GR(100,10,i),this.initQuadTree(this.quadtree)}return this.quadtree}initQuadTree(t){}pickNodeExactShape(t){const e=super.pickNodeExactShape(t);if(e)return e;const{x:i,y:s}=t,{opts:{hasMarkers:n}}=this;let a;const{dataNodeGroup:o,markerGroup:r}=this;if(a=o.pickNode(i,s),!a&&n&&(a=r?.pickNode(i,s)),a&&a.datum.missing!==!0)return{datum:a.datum,distance:0};for(const l of this.moduleMap.modules()){const{datum:c}=l.pickNodeExact(t)??{};if(c!=null&&c?.missing!==!0)return{datum:c,distance:0}}}pickNodeClosestDatum(t){const{x:e,y:i}=t,{axes:s,_contextNodeData:n}=this;if(!n)return;const a=s.x,o=s.y,r={x:e,y:i};let l=1/0,c;for(const h of n.nodeData){const{point:{x:u=NaN,y:d=NaN}={}}=h;if(isNaN(u)||isNaN(d)||!(a?.inRange(u)&&o?.inRange(d)))continue;const g=Math.max((r.x-u)**2+(r.y-d)**2,0);gg.direction);if(e&&c.length===0)return;const[h="x"]=c,u=[i,s];h!=="x"&&u.reverse();const d=[1/0,1/0];let p;for(const g of a.nodeData){const{x:f=NaN,y:x=NaN}=g.point??g.midPoint??{};if(isNaN(f)||isNaN(x)||g.missing===!0)continue;const m=[r?.inRange(f),l?.inRange(x)];if(h!=="x"&&m.reverse(),!m[0]||!o&&!m[1])continue;const b=[f,x];h!=="x"&&b.reverse();let v=!0;for(let S=0;Sd[S]){v=!1;break}else A{const o=i?.[a]??a;return this.xCoordinateRange(s[o],n,o)})}domainForVisibleRange(t,e,i,s,n,a){const{processedData:o,dataModel:r}=this,[l,c]=s,h=this.keysOrValues(i);if(n){const g=this.visibleRange(i,s,a);return r.getDomainBetweenRange(this,e,g,o)}const u=e.map(g=>this.keysOrValues(g));let d=1/0,p=-1/0;return h.forEach((g,f)=>{const[x,m]=this.xCoordinateRange(g,0,f);if(!(mc))for(let b=0;bp?[NaN,NaN]:[d,p]}domainForClippedRange(t,e,i,s){const{processedData:n,dataModel:a,axes:o}=this,l=t6(o[t==="x"?"y":"x"]);if(!l)return e.flatMap(g=>a.getDomain(this,g,"value",n));const c=this.keysOrValues(i);if(s){const g=e6(c.length,l,f=>c[f]);return a.getDomainBetweenRange(this,e,g,n)}const h=e.map(g=>this.keysOrValues(g)),u=l[0].valueOf(),d=l[1].valueOf(),p=[];return c.forEach((g,f)=>{const x=g.valueOf();if(xd)return;const m=h.map(b=>b[f]);x>=u&&p.push(...m),x<=d&&p.push(...m)}),p}countVisibleItems(t,e,i,s,n){const{dataModel:a,processedData:o}=this;if(!a||!o)return 1/0;const r=this.keysOrValues(t),l=e.map(A=>a.resolveColumnById(this,A,o)),c=this.axes.x,h=this.axes.y,u=this.shouldFlipXY(),d=c.range,p=h.range,g=(A,T,D)=>A[0]+(D-T[0])/(T[1]-T[0])*(A[1]-A[0]),f=g(d,c.visibleRange,i[0]),x=g(d,c.visibleRange,i[1]),m=g(p,h.visibleRange,u?s[0]:s[1]),b=g(p,h.visibleRange,u?s[1]:s[0]),v=Math.round((i[0]+(i[1]-i[0])/2)*r.length),S=0;return LE(0,r.length-1,v,n,A=>{let[T,D]=this.xCoordinateRange(r[A],S,A),[L,C]=this.yCoordinateRange(l.map(O=>O[A]),S,A);return!zt(T)||!zt(D)||!zt(L)||!zt(C)?!1:(u&&([T,D,L,C]=[L,C,T,D]),T>=f&&D<=x&&L>=m&&C<=b)})}updateHighlightSelectionItem(t){const{opts:{hasMarkers:e}}=this,{items:i,highlightSelection:s}=t,n=i??[];if(e){const a=s;return this.updateMarkerSelection({nodeData:n,markerSelection:a})}else return this.updateDatumSelection({nodeData:n,datumSelection:s})}updateHighlightSelectionLabel(t){return this.updateLabelSelection({labelData:t.items??[],labelSelection:t.highlightLabelSelection})}updateDatumSelection(t){return t.datumSelection}updateDatumNodes(t){}updateMarkerSelection(t){return t.markerSelection}updateMarkerNodes(t){}updatePaths(t){t.paths.forEach(e=>e.visible=!1)}updatePathNodes(t){const{paths:e,opacity:i,visible:s}=t;for(const n of e)n.opacity=i,n.visible=s}resetPathAnimation(t){const{path:e}=this.opts?.animationResetFns??{};e&&t.paths.forEach(i=>{Mi([i],e)})}resetDatumAnimation(t){const{datum:e}=this.opts?.animationResetFns??{};e&&Mi([t.datumSelection],e)}resetLabelAnimation(t){const{label:e}=this.opts?.animationResetFns??{};e&&Mi([t.labelSelection],e)}resetMarkerAnimation(t){const{marker:e}=this.opts?.animationResetFns??{};e&&this.opts.hasMarkers&&Mi([t.markerSelection],e)}resetAllAnimation(t){this.ctx.animationManager.stopByAnimationGroupId(this.id),this.resetPathAnimation(t),this.resetDatumAnimation(t),this.resetLabelAnimation(t),this.resetMarkerAnimation(t),t.contextData?.animationValid===!1&&this.ctx.animationManager.skipCurrentBatch()}animateEmptyUpdateReady(t){this.ctx.animationManager.skipCurrentBatch(),this.resetAllAnimation(t)}animateWaitingUpdateReady(t){this.ctx.animationManager.skipCurrentBatch(),this.resetAllAnimation(t)}animateReadyHighlight(t){const{datum:e}=this.opts?.animationResetFns??{};e&&Mi([t],e)}animateReadyHighlightMarkers(t){const{marker:e}=this.opts?.animationResetFns??{};e&&Mi([t],e)}animateReadyResize(t){this.resetAllAnimation(t)}animateClearingUpdateEmpty(t){this.ctx.animationManager.skipCurrentBatch(),this.resetAllAnimation(t)}getAnimationData(t,e){const{_contextNodeData:i}=this;return i?{datumSelection:this.datumSelection,markerSelection:this.markerSelection,labelSelection:this.labelSelection,annotationSelections:[...this.annotationSelections],contextData:i,previousContextData:e,paths:this.paths,seriesRect:t}:void 0}updateLabelSelection(t){return t.labelSelection}getScaling(t){if(t instanceof vx){const{range:e,domain:i}=t;return{type:"log",convert:s=>t.convert(s),domain:[i[0],i[1]],range:[e[0],e[1]]}}else if(t instanceof Wt){const{range:e,domain:i}=t;return{type:"continuous",domain:[i[0],i[1]],range:[e[0],e[1]]}}else if(t instanceof bu){const{domain:e}=t;return{type:"category",domain:e,inset:t.inset,step:t.step}}}calculateScaling(){const t={};for(const e of Object.values(km)){const i=this.axes[e];if(!i)continue;const s=this.getScaling(i.scale);s!=null&&(t[e]=s)}return t}}}}),YR,wg,KR,i6=I({"packages/ag-charts-community/src/chart/cartesianChart.ts"(){"use strict";ot(),wi(),Qi(),At(),wu(),Sx(),Us(),YR=["top","right","bottom","left"],wg=class n3 extends Tg{constructor(e,i){super(e,i),this.paired=!0,this.lastUpdateClipRect=void 0,this.lastLayoutWidth=NaN,this.lastLayoutHeight=NaN}onAxisChange(e,i){super.onAxisChange(e,i),this.ctx!=null&&this.ctx.zoomManager.updateAxes(e)}destroySeries(e){super.destroySeries(e),this.lastLayoutWidth=NaN,this.lastLayoutHeight=NaN}getChartType(){return"cartesian"}setRootClipRects(e){const{seriesRoot:i,annotationRoot:s}=this;i.setClipRect(e),s.setClipRect(e)}async processData(){await super.processData();for(const e of this.axes){const i=this.getSyncedDomain(e);i!=null&&e.setDomains(i)}this.ctx.updateService.dispatchProcessData({series:{shouldFlipXY:this.shouldFlipXY()}})}performLayout(e){const{seriesRoot:i,annotationRoot:s}=this,{clipSeries:n,seriesRect:a,visible:o}=this.updateAxes(e.layoutBox);this.seriesRoot.visible=o,this.seriesRect=a,this.animationRect=e.layoutBox;const{x:r,y:l}=a;if(e.width!==this.lastLayoutWidth||e.height!==this.lastLayoutHeight)for(const d of[i,s])d.translationX=Math.floor(r),d.translationY=Math.floor(l);else{const{translationX:d,translationY:p}=i;Ho(this.id,"seriesRect",this.ctx.animationManager,[i,s],{translationX:d,translationY:p},{translationX:Math.floor(r),translationY:Math.floor(l)},{phase:"update"})}this.lastLayoutWidth=e.width,this.lastLayoutHeight=e.height;const c=a.clone().grow(this.seriesArea.padding),h=this.seriesArea.clip||n?c:void 0,{lastUpdateClipRect:u}=this;this.lastUpdateClipRect=h,this.ctx.animationManager.isActive()&&u!=null?this.ctx.animationManager.animate({id:this.id,groupId:"clip-rect",phase:"update",from:u,to:c,onUpdate:d=>this.setRootClipRects(d),onComplete:()=>this.setRootClipRects(h)}):this.setRootClipRects(h),this.ctx.layoutManager.emitLayoutComplete(e,{axes:this.axes.map(d=>d.getLayoutState()),series:{visible:o,rect:a,paddedRect:c},clipSeries:n})}updateAxes(e){const{clipSeries:i,seriesRect:s,overflows:n}=this.resolveAxesLayout(e);for(const a of this.axes)a.update(),a.setCrossLinesVisible(!n),this.clipAxis(a,s,e);return{clipSeries:i,seriesRect:s,visible:!n}}resolveAxesLayout(e){let i,s,n=0;const a=10;do if(s=i??this.getDefaultState(),i=this.updateAxesPass(new Map(s.axisAreaWidths),e.clone()),n++>a){et.warn("Max iterations reached. Unable to stabilize axes layout.");break}while(!this.isLayoutStable(i,s));return this.lastAreaWidths=i.axisAreaWidths,i}updateAxesPass(e,i){const s=new Map,n={};let a=!1,o=!1;for(const m of YR){const b=this.seriesArea.padding[m],v=this.axes.findLast(S=>S.position===m);v?v.seriesAreaPadding=b:i.shrink(b,m)}const r=(e.get("left")??0)+(e.get("right")??0),l=(e.get("top")??0)+(e.get("bottom")??0),c=this.buildCrossLinePadding(e);i.width<=r+c.hPadding||i.height<=l+c.vPadding?a=!0:i.shrink(c);const h=i.clone().shrink(Object.fromEntries(e));for(const m of this.axes){const{position:b="left",direction:v}=m;this.sizeAxis(m,h,b);const S=v==="y",{primaryTickCount:A,bbox:T}=m.calculateLayout(m.nice?n[v]:void 0);n[v]??(n[v]=A),o||(o=m.dataDomain.clipped||m.visibleRange[0]>0||m.visibleRange[1]<1),s.set(m.id,Math.ceil(m.thickness??(S?T?.width:T?.height)??0))}const u=Object.entries(kM(this.axes,m=>m.position??"left")),{width:d,height:p,pixelRatio:g}=this.ctx.scene,f=new Map,x=new Map;for(const[m,b]of u){let S=m==="left"||m==="right"?p%g:d%g,A=0;for(const T of b){x.set(T.id,S);const D=s.get(T.id)??0;A=Math.max(A,S+D),T.layoutConstraints.stacked&&(S+=D+n3.AxesPadding)}f.set(m,Math.ceil(A))}for(const[m,b]of u)this.positionAxes({axes:b,position:m,axisWidths:s,axisOffsets:x,axisAreaWidths:f,axisBound:i,seriesRect:h});return{clipSeries:o,seriesRect:h,axisAreaWidths:f,overflows:a}}buildCrossLinePadding(e){const i={top:0,right:0,bottom:0,left:0,hPadding:0,vPadding:0};this.axes.forEach(s=>{s.crossLines?.forEach(n=>{n.calculatePadding?.(i)})});for(const[s,n=0]of Object.entries(i))i[s]=Math.max(n-(e.get(s)??0),0);return i.hPadding=i.left+i.right,i.vPadding=i.top+i.bottom,i}clampToOutsideSeriesRect(e,i,s,n){const a=s==="x"?e.x:e.y,o=s==="x"?e.width:e.height;return n===1?Math.min(i,a+o):Math.max(i,a)}getSyncedDomain(e){const i=this.modulesManager.getModule("sync");if(!i?.enabled)return;const s=i.getSyncedDomain(e);if(s&&e.dataDomain.domain.length){let n;const{domain:a}=e.scale;if(Wt.is(e.scale)){const[o,r]=Si(s);n=o!==a[0]||r!==a[1]}else n=!$a(s,a);n&&!this.skipSync&&i.updateSiblings()}return s}sizeAxis(e,i,s){const n=e instanceof Rc,a=s==="left"||s==="right",{width:o,height:r}=i,l=a?r:o;let c=0,h=l,{min:u,max:d}=this.ctx.zoomManager.getAxisZoom(e.id);const{width:p,unit:g,align:f}=e.layoutConstraints;g==="px"?h=c+p:h=h*p/100,f==="end"&&(c=l-(h-c),h=l),a&&(n?[u,d]=[1-d,1-u]:[c,h]=[h,c]),e.range=[c,h],e.visibleRange=[u,d],e.gridLength=a?o:r}positionAxes(e){const{axes:i,axisBound:s,axisWidths:n,axisOffsets:a,axisAreaWidths:o,seriesRect:r,position:l}=e,c=o.get(l)??0;let h="x",u="y",d=1;(l==="top"||l==="bottom")&&(h="y",u="x");let p=s[h];(l==="right"||l==="bottom")&&(d=-1,p+=h==="x"?s.width:s.height);for(const g of i){const f=o.get(u==="x"?"left":"top")??0,x=n.get(g.id)??0,m=a.get(g.id)??0;g.gridPadding=c-m-x,g.translation[u]=s[u]+f,g.translation[h]=this.clampToOutsideSeriesRect(r,p+d*(m+x),h,d)}}shouldFlipXY(){return this.series.every(e=>e instanceof rr&&e.shouldFlipXY())}getDefaultState(){const e=new Map;if(this.lastAreaWidths)for(const{position:i="left"}of this.axes){const s=this.lastAreaWidths.get(i);s!=null&&e.set(i,s)}return{axisAreaWidths:e,clipSeries:!1,overflows:!1}}isLayoutStable(e,i){if(i.overflows!==e.overflows||i.clipSeries!==e.clipSeries)return!1;for(const s of e.axisAreaWidths.keys())if(!i.axisAreaWidths.has(s))return!1;for(const[s,n]of i.axisAreaWidths.entries()){const a=e.axisAreaWidths.get(s);if((n!=null||a!=null)&&n!==a)return!1}return!0}clipAxis(e,i,s){const n=Math.ceil(e.gridLine?.width??0),a=Math.ceil(e.line?.width??0);let{width:o,height:r}=i;switch(o+=e.direction==="x"?n:a,r+=e.direction==="y"?n:a,e.clipGrid(i.x,i.y,o,r),e.position){case"left":case"right":e.clipTickLines(s.x,i.y-n,s.width+n,i.height+n*2);break;case"top":case"bottom":e.clipTickLines(i.x-n,s.y,i.width+n*2,s.height+n);const{label:l,labelNodes:c,scale:h}=e;if(Wt.is(h)&&l.enabled&&l.avoidCollisions&&c.length>1){const u=c.toSorted((f,x)=>f.translationY-x.translationY),d=u.at(-1),p=d.getBBox(),g=i.x+p.y+p.height<=s.x+s.width+this.padding.right;if(d.visible=g,g||e.visibleRange[0]>0||e.visibleRange[1]<1)u[0].visible=!0;else{const f=u[0].getBBox();u[0].visible=f.y>=0}}break}}},wg.className="CartesianChart",wg.type="cartesian",wg.AxesPadding=15,KR=wg}}),$R,s6=I({"packages/ag-charts-community/src/chart/cartesianChartModule.ts"(){"use strict";i6(),ju(),$R={type:"chart",name:"cartesian",detect:cA,create(t,e){return new KR(t,e)}}}}),OA,Ku,wA,n6=I({"packages/ag-charts-community/src/chart/chartProxy.ts"(){"use strict";no(),di(),jn(),Is(),OA=Jt.create(!0,"opts"),Ku=class{constructor(e,i,s){this.factoryApi=i,this.licenseManager=s,this.chart=e}async update(e){return OA.group("AgChartInstance.update()",async()=>{this.factoryApi.update(e,this),await this.chart.waitForUpdate()})}async updateDelta(e){return OA.group("AgChartInstance.updateDelta()",async()=>{this.factoryApi.updateUserDelta(this,e),await this.chart.waitForUpdate()})}getOptions(){const e=ni(this.chart.getOptions());for(const i of Object.keys(e))i.startsWith("_")&&delete e[i];return e}waitForUpdate(){return this.chart.waitForUpdate()}async download(e){const i=await this.prepareResizedChart(this,e);try{i.chart.download(e?.fileName,e?.fileFormat)}finally{i.destroy()}}async __toSVG(e){const i=await this.prepareResizedChart(this,{width:600,height:300,...e});try{return i.chart.toSVG()}finally{i.destroy()}}async getImageDataURL(e){const i=await this.prepareResizedChart(this,e);try{return i.chart.getCanvasDataURL(e?.fileFormat)}finally{i.destroy()}}getState(){return this.factoryApi.caretaker.save(...this.getEnabledOriginators())}async setState(e){const i=this.getEnabledOriginators();if(!i.includes(this.chart.ctx.legendManager)){await this.setStateOriginators(e,i);return}await this.setStateOriginators(e,i.filter(s=>s!==this.chart.ctx.zoomManager)),await this.setStateOriginators(e,[this.chart.ctx.zoomManager])}resetAnimations(){this.chart.resetAnimations()}skipAnimations(){this.chart.skipAnimations()}destroy(){this.releaseChart?(this.releaseChart(),this.releaseChart=void 0):this.chart&&(this.chart.publicApi=void 0,this.chart.destroy()),this.chart=null}async prepareResizedChart(e,i={}){const{chart:s}=e,n=i.width??s.width??s.ctx.scene.canvas.width,a=i.height??s.height??s.ctx.scene.canvas.height,o=e.getState(),r=pa.hasEnterpriseModules(),l={...s.chartOptions.processedOverrides,container:document.createElement("div"),width:n,height:a};i.width!=null&&i.height!=null&&(l.overrideDevicePixelRatio=1);const c=s.getOptions();r&&(l.animation={enabled:!1},this.licenseManager?.isDisplayWatermark()&&(l.foreground={text:this.licenseManager.getWatermarkMessage(),image:{url:"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjU4IiBoZWlnaHQ9IjQwIiB2aWV3Qm94PSIwIDAgMjU4IDQwIiBmaWxsPSJub25lIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgo8cGF0aCBkPSJNMjUuNzc5IDI4LjY1N0gxMy4zNTlMMTEuMTczIDM0LjAxMkg1LjY3Mjk3TDE3LjE4MiA3LjA1OTk5SDIxLjk1M0wzMy40NjIgMzQuMDEySDI3Ljk2MkwyNS43NzYgMjguNjU3SDI1Ljc3OVpNMjQuMDY4IDI0LjM5N0wxOS41ODggMTMuNDM0TDE1LjEwNyAyNC4zOTdIMjQuMDY4Wk02Mi4wOTIgMTguODIzSDQ5LjgxN1YyMy4wODZINTYuNzc1QzU2LjU1NSAyNS4yMjIgNTUuNzU1IDI2LjkyNyA1NC4zNzIgMjguMjAyQzUyLjk4OSAyOS40NzYgNTEuMTY2IDMwLjExNSA0OC45MDkgMzAuMTE1QzQ3LjYyMiAzMC4xMTUgNDYuNDUgMjkuODg1IDQ1LjM5MyAyOS40MjNDNDQuMzU4MyAyOC45NzgxIDQzLjQzMjYgMjguMzEzOCA0Mi42OCAyNy40NzZDNDEuOTI3IDI2LjYzOSA0MS4zNDQgMjUuNjMxIDQwLjkzMSAyNC40NTNDNDAuNTE5IDIzLjI3NSA0MC4zMTEgMjEuOTcgNDAuMzExIDIwLjUzN0M0MC4zMTEgMTkuMTA1IDQwLjUxNiAxNy44IDQwLjkzMSAxNi42MjFDNDEuMzQ0IDE1LjQ0MyA0MS45MjcgMTQuNDM2IDQyLjY4IDEzLjU5OEM0My40Mzc2IDEyLjc1NzcgNDQuMzY5NiAxMi4wOTMyIDQ1LjQxMSAxMS42NTFDNDYuNDc4IDExLjE4OSA0Ny42NTYgMTAuOTYgNDguOTQ2IDEwLjk2QzUxLjYxMiAxMC45NiA1My42MzcgMTEuNjAyIDU1LjAyIDEyLjg4NUw1OC4zIDkuNjA0OTlDNTUuODE3IDcuNjY5OTkgNTIuNjc2IDYuNjk5OTkgNDguODcyIDYuNjk5OTlDNDYuNzYgNi42OTk5OSA0NC44NTMgNy4wMzQ5OSA0My4xNTQgNy43MDA5OUM0MS40NTUgOC4zNjc5OSAzOS45OTggOS4zMDM5OSAzOC43ODMgMTAuNTA0QzM3LjU2NyAxMS43MDcgMzYuNjM0IDEzLjE1OCAzNS45NzcgMTQuODU3QzM1LjMxOSAxNi41NTYgMzQuOTk0IDE4LjQ1MSAzNC45OTQgMjAuNTRDMzQuOTk0IDIyLjYzIDM1LjMyOSAyNC40OTQgMzUuOTk1IDI2LjIwNUMzNi42NjIgMjcuOTE2IDM3LjYwNSAyOS4zNzQgMzguODE3IDMwLjU3N0M0MC4wMzIgMzEuNzggNDEuNDg2IDMyLjcxMyA0My4xODggMzMuMzgzQzQ0Ljg4OCAzNC4wNDkgNDYuNzgyIDM0LjM4NCA0OC44NzIgMzQuMzg0QzUwLjk2MSAzNC4zODQgNTIuNzUgMzQuMDQ5IDU0LjM5IDMzLjM4M0M1Ni4wMzEgMzIuNzE2IDU3LjQyNiAzMS43OCA1OC41NzkgMzAuNTc3QzU5LjczMyAyOS4zNzQgNjAuNjE5IDI3LjkxNiA2MS4yMzkgMjYuMjA1QzYxLjg2IDI0LjQ5NCA2Mi4xNyAyMi42MDUgNjIuMTcgMjAuNTRDNjIuMTY5NiAxOS45Njg4IDYyLjE0NDUgMTkuMzk4IDYyLjA5NSAxOC44MjlMNjIuMDkyIDE4LjgyM1pNMTUxLjgxIDE2Ljk4MUMxNTMuNDEgMTQuNjA5IDE1Ny40MTkgMTQuMzU4IDE1OS4wMjIgMTQuMzU4VjE4LjkxQzE1Ni45NTcgMTguOTEgMTU0Ljk4NSAxOC45OTYgMTUzLjc1NyAxOS44OTJDMTUyLjUyOSAyMC43OTIgMTUxLjkxOSAyMS45ODIgMTUxLjkxOSAyMy40NjRWMzMuOTlIMTQ2Ljk2NFYxNC4zNThIMTUxLjczNkwxNTEuODEgMTYuOTgxWk0xNDMuMDExIDE0LjM2MVYzNC4wMzFIMTM4LjI0TDEzOC4xMzEgMzEuMDQ1QzEzNy40NjYgMzIuMDc2IDEzNi41NTEgMzIuOTIxOSAxMzUuNDcxIDMzLjUwNEMxMzQuMzc2IDM0LjA5OSAxMzMuMDY4IDM0LjM5NiAxMzEuNTM2IDM0LjM5NkMxMzAuMiAzNC4zOTYgMTI4Ljk2MyAzNC4xNTIgMTI3LjgyMiAzMy42NjhDMTI2LjcgMzMuMTk2NCAxMjUuNjg5IDMyLjQ5NSAxMjQuODU1IDMxLjYwOUMxMjQuMDE4IDMwLjcyMiAxMjMuMzU0IDI5LjY2MiAxMjIuODcxIDI4LjQyMkMxMjIuMzg0IDI3LjE4NSAxMjIuMTQyIDI1LjgxMSAxMjIuMTQyIDI0LjMwNEMxMjIuMTQyIDIyLjc5OCAxMjIuMzg0IDIxLjM3OCAxMjIuODcxIDIwLjExNkMxMjMuMzU3IDE4Ljg1NCAxMjQuMDE4IDE3Ljc3MiAxMjQuODU1IDE2Ljg3M0MxMjUuNjg4IDE1Ljk3NjQgMTI2LjY5OCAxNS4yNjM2IDEyNy44MjIgMTQuNzhDMTI4Ljk2MyAxNC4yODEgMTMwLjIwMyAxNC4wMzMgMTMxLjUzNiAxNC4wMzNDMTMzLjA0MyAxNC4wMzMgMTM0LjMzIDE0LjMxOCAxMzUuMzk3IDE0Ljg4OEMxMzYuNDYyIDE1LjQ1ODkgMTM3LjM3NSAxNi4yNzggMTM4LjA1NyAxNy4yNzZWMTQuMzYxSDE0My4wMTFaTTEzMi42MzEgMzAuMTMzQzEzNC4yNTYgMzAuMTMzIDEzNS41NjcgMjkuNTk0IDEzNi41NjUgMjguNTEyQzEzNy41NjEgMjcuNDMgMTM4LjA2IDI1Ljk5MSAxMzguMDYgMjQuMTk2QzEzOC4wNiAyMi40MDEgMTM3LjU2MSAyMC45OSAxMzYuNTY1IDE5Ljg5OUMxMzUuNTcgMTguODA3IDEzNC4yNTkgMTguMjU4IDEzMi42MzEgMTguMjU4QzEzMS4wMDMgMTguMjU4IDEyOS43MjkgMTguODA0IDEyOC43MzQgMTkuODk5QzEyNy43MzggMjAuOTkzIDEyNy4yMzkgMjIuNDM4IDEyNy4yMzkgMjQuMjMzQzEyNy4yMzkgMjYuMDI4IDEyNy43MzUgMjcuNDMzIDEyOC43MzQgMjguNTE1QzEyOS43MjkgMjkuNTk0IDEzMS4wMjggMzAuMTM2IDEzMi42MzEgMzAuMTM2VjMwLjEzM1pNOTMuNjk4IDI3Ljg3NkM5My41Nzk1IDI4LjAwMjUgOTMuNDU2NCAyOC4xMjQ2IDkzLjMyOSAyOC4yNDJDOTEuOTQ3IDI5LjUxNiA5MC4xMjMgMzAuMTU1IDg3Ljg2NiAzMC4xNTVDODYuNTggMzAuMTU1IDg1LjQwOCAyOS45MjYgODQuMzUgMjkuNDY0QzgzLjMxNTUgMjkuMDE4OSA4Mi4zODk4IDI4LjM1NDYgODEuNjM3IDI3LjUxN0M4MC44ODQgMjYuNjc5IDgwLjMwMSAyNS42NzIgNzkuODg5IDI0LjQ5NEM3OS40NzYgMjMuMzE1IDc5LjI2OSAyMi4wMSA3OS4yNjkgMjAuNTc4Qzc5LjI2OSAxOS4xNDUgNzkuNDczIDE3Ljg0IDc5Ljg4OSAxNi42NjJDODAuMzAxIDE1LjQ4NCA4MC44ODQgMTQuNDc2IDgxLjYzNyAxMy42MzlDODIuMzk0OSAxMi43OTg3IDgzLjMyNzMgMTIuMTM0MiA4NC4zNjkgMTEuNjkyQzg1LjQzNiAxMS4yMyA4Ni42MTQgMTEgODcuOTAzIDExQzkwLjU3IDExIDkyLjU5NSAxMS42NDIgOTMuOTc3IDEyLjkyNkw5Ny4yNTggOS42NDQ5OUM5NC43NzQgNy43MTA5OSA5MS42MzMgNi43Mzk5OSA4Ny44MjkgNi43Mzk5OUM4NS43MTggNi43Mzk5OSA4My44MTEgNy4wNzQ5OSA4Mi4xMTIgNy43NDE5OUM4MC40MTMgOC40MDc5OSA3OC45NTYgOS4zNDQ5OSA3Ny43NCAxMC41NDVDNzYuNTI1IDExLjc0NyA3NS41OTIgMTMuMTk5IDc0LjkzNCAxNC44OThDNzQuMjc3IDE2LjU5NyA3My45NTEgMTguNDkxIDczLjk1MSAyMC41ODFDNzMuOTUxIDIyLjY3IDc0LjI4NiAyNC41MzQgNzQuOTUzIDI2LjI0NUM3NS42MTkgMjcuOTU3IDc2LjU2MiAyOS40MTQgNzcuNzc0IDMwLjYxN0M3OC45OSAzMS44MiA4MC40NDQgMzIuNzUzIDgyLjE0NiAzMy40MjNDODMuODQ1IDM0LjA5IDg1LjczOSAzNC40MjQgODcuODI5IDM0LjQyNEM4OS45MTkgMzQuNDI0IDkxLjcwOCAzNC4wOSA5My4zNDggMzMuNDIzQzk0LjcxOCAzMi44NjUgOTUuOTE4IDMyLjEyMSA5Ni45NDggMzEuMTkxQzk3LjE0OSAzMS4wMDggOTcuMzQ4IDMwLjgxNSA5Ny41MzcgMzAuNjJMOTMuNzAxIDI3Ljg4NUw5My42OTggMjcuODc2Wk0xMTAuODAyIDE0LjAxNUMxMDkuMTk5IDE0LjAxNSAxMDYuODM2IDE0LjQ3MSAxMDUuNjExIDE2LjE1OEwxMDUuNTM3IDYuMDE1OTlIMTAwLjc2NVYzMy45MzlIMTA1LjcyVjIyLjY0MUMxMDUuNzcxIDIxLjQ2MDcgMTA2LjI4OCAyMC4zNDg4IDEwNy4xNTcgMTkuNTQ4OUMxMDguMDI3IDE4Ljc0OTEgMTA5LjE3OCAxOC4zMjY2IDExMC4zNTggMTguMzc0QzExMy4zOTcgMTguMzc0IDExNC4yNjggMjEuMTU5IDExNC4yNjggMjIuNjQxVjMzLjkzOUgxMTkuMjIzVjIxLjA1OUMxMTkuMjIzIDIxLjA1OSAxMTkuMTQyIDE0LjAxNSAxMTAuODAyIDE0LjAxNVpNMTczLjc2MyAxNC4zNThIMTY5Ljk5OVY4LjcxNDk5SDE2NS4wNDhWMTQuMzU4SDE2MS4yODRWMTguOTE2SDE2NS4wNDhWMzQuMDAzSDE2OS45OTlWMTguOTE2SDE3My43NjNWMTQuMzU4Wk0xOTAuNzg3IDI1LjI2MkMxOTAuMTI5IDI0LjUwMTQgMTg5LjMwNyAyMy44OTk0IDE4OC4zODQgMjMuNTAxQzE4Ny40ODggMjMuMTE3IDE4Ni4zMzEgMjIuNzMyIDE4NC45NDggMjIuMzY0QzE4NC4xNjUgMjIuMTQzOSAxODMuMzkgMjEuODk3OCAxODIuNjIzIDIxLjYyNkMxODIuMTYzIDIxLjQ2MjEgMTgxLjc0MSAyMS4yMDY2IDE4MS4zODMgMjAuODc1QzE4MS4yMzUgMjAuNzQyMSAxODEuMTE4IDIwLjU3ODkgMTgxLjAzOSAyMC4zOTY0QzE4MC45NjEgMjAuMjE0IDE4MC45MjIgMjAuMDE2NiAxODAuOTI3IDE5LjgxOEMxODAuOTI3IDE5LjI3MiAxODEuMTU2IDE4Ljg0NCAxODEuNjI1IDE4LjUxQzE4Mi4xMjEgMTguMTU2IDE4Mi44NjIgMTcuOTc2IDE4My44MjYgMTcuOTc2QzE4NC43OSAxNy45NzYgMTg1LjU4NyAxOC4yMDkgMTg2LjE0OCAxOC42NjhDMTg2LjcwNiAxOS4xMjQgMTg3LjAwNyAxOS43MjUgMTg3LjA3MiAyMC41TDE4Ny4wOTQgMjAuNzgySDE5MS42MzNMMTkxLjYxNyAyMC40NkMxOTEuNTIxIDE4LjQ4NSAxOTAuNzcxIDE2LjkgMTg5LjM4NSAxNS43NUMxODguMDEyIDE0LjYxMiAxODYuMTg1IDE0LjAzMyAxODMuOTYyIDE0LjAzM0MxODIuNDc3IDE0LjAzMyAxODEuMTQxIDE0LjI4NyAxNzkuOTk0IDE0Ljc4NkMxNzguODMxIDE1LjI5MSAxNzcuOTI2IDE1Ljk5NSAxNzcuMjk2IDE2Ljg4MkMxNzYuNjczIDE3Ljc0NTUgMTc2LjMzOCAxOC43ODQgMTc2LjM0MSAxOS44NDlDMTc2LjM0MSAyMS4xNjcgMTc2LjY5OCAyMi4yNDkgMTc3LjM5OSAyMy4wNjRDMTc4LjA2IDIzLjg0MzIgMTc4Ljg5OCAyNC40NTM0IDE3OS44NDIgMjQuODQ0QzE4MC43NDQgMjUuMjE2IDE4MS45MjggMjUuNjA3IDE4My4zNjEgMjZDMTg0LjgwNiAyNi40MSAxODUuODcyIDI2Ljc4NSAxODYuNTMgMjcuMTIzQzE4Ny4xIDI3LjQxNCAxODcuMzc5IDI3Ljg0NSAxODcuMzc5IDI4LjQ0NEMxODcuMzc5IDI5LjA0MiAxODcuMTIyIDI5LjQ2NyAxODYuNTk1IDI5LjgzOUMxODYuMDQzIDMwLjIyNiAxODUuMjM3IDMwLjQyNSAxODQuMjAxIDMwLjQyNUMxODMuMTY2IDMwLjQyNSAxODIuMzk0IDMwLjE3NCAxODEuNzQ5IDI5LjY3NEMxODEuMTEzIDI5LjE4MSAxODAuNzcyIDI4LjU4OSAxODAuNzEgMjcuODY0TDE4MC42ODUgMjcuNTgySDE3Ni4wMTNMMTc2LjAyNSAyNy45MDFDMTc2LjA2NyAyOS4wOTU1IDE3Ni40NzIgMzAuMjQ4NyAxNzcuMTg4IDMxLjIwNkMxNzcuOTA3IDMyLjE4IDE3OC44OTMgMzIuOTU4IDE4MC4xMTggMzMuNTE5QzE4MS4zMzYgMzQuMDc3IDE4Mi43MzIgMzQuMzYyIDE4NC4yNjYgMzQuMzYyQzE4NS44MDEgMzQuMzYyIDE4Ny4xMDkgMzQuMTA4IDE4OC4yMzggMzMuNjA5QzE4OS4zNzYgMzMuMTA0IDE5MC4yNzIgMzIuMzk0IDE5MC45MDEgMzEuNDk0QzE5MS41MzQgMzAuNTkyIDE5MS44NTMgMjkuNTU0IDE5MS44NTMgMjguNDAzQzE5MS44MjggMjcuMTEgMTkxLjQ2NiAyNi4wNTMgMTkwLjc3NyAyNS4yNjJIMTkwLjc4N1oiIGZpbGw9IiM5QjlCOUIiLz4KPHBhdGggZD0iTTI0MS45ODIgMjUuNjU4MlYxNy43MTE3SDIyOC40NDFMMjIwLjQ5NCAyNS42NTgySDI0MS45ODJaIiBmaWxsPSIjOUI5QjlCIi8+CjxwYXRoIGQ9Ik0yNTcuMjM5IDUuOTUwODFIMjQwLjI2NUwyMzIuMjU1IDEzLjg5NzNIMjU3LjIzOVY1Ljk1MDgxWiIgZmlsbD0iIzlCOUI5QiIvPgo8cGF0aCBkPSJNMjEyLjYxMSAzMy42MDQ4TDIxNi42OCAyOS41MzYxSDIzMC40MTJWMzcuNDgyN0gyMTIuNjExVjMzLjYwNDhaIiBmaWxsPSIjOUI5QjlCIi8+CjxwYXRoIGQ9Ik0yMTUuNTk5IDIxLjc4MDNIMjI0LjM3MkwyMzIuMzgyIDEzLjgzMzdIMjE1LjU5OVYyMS43ODAzWiIgZmlsbD0iIzlCOUI5QiIvPgo8cGF0aCBkPSJNMjA2IDMzLjYwNDdIMjEyLjYxMUwyMjAuNDk0IDI1LjY1ODJIMjA2VjMzLjYwNDdaIiBmaWxsPSIjOUI5QjlCIi8+CjxwYXRoIGQ9Ik0yNDAuMjY1IDUuOTUwODFMMjM2LjE5NyAxMC4wMTk0SDIxMC4yNTlWMi4wNzI4OEgyNDAuMjY1VjUuOTUwODFaIiBmaWxsPSIjOUI5QjlCIi8+Cjwvc3ZnPgo=",width:170,height:25,right:25,bottom:50,opacity:.7}}));const h={...s.chartOptions.specialOverrides},u={...s.chartOptions.optionMetadata},d=this.factoryApi.create(c,l,h,u);await d.setState(o),d.chart.ctx.zoomManager.updateZoom("chartProxy",s.ctx.zoomManager.getZoom()),d.chart.ctx.legendManager.clearData(),d.chart.ctx.legendManager.update(s.ctx.legendManager.getData()),s.series.forEach((g,f)=>{g.visible||(d.chart.series[f].visible=!1)});const p=[];for(const g of s.modulesManager.legends())p.push(g.legend.pagination?.currentPage??0);for(const g of d.chart.modulesManager.legends()){const f=p.shift()??0;g.legend.pagination&&g.legend.pagination.setPage(f)}return d.chart.update(0,{forceNodeDataRefresh:!0}),await d.waitForUpdate(),d}getEnabledOriginators(){const{chartOptions:{processedOptions:e,optionMetadata:i},ctx:{annotationManager:s,chartTypeOriginator:n,zoomManager:a,legendManager:o}}=this.chart,r=[];return"annotations"in e&&e.annotations?.enabled&&r.push(s),i.presetType==="price-volume"&&r.push(n),(e.navigator?.enabled||e.zoom?.enabled)&&r.push(a),"legend"in this.chart&&r.push(o),r}async setStateOriginators(e,i){this.factoryApi.caretaker.restore(e,...i),this.chart.ctx.updateService.update(2,{forceNodeDataRefresh:!0}),await this.chart.waitForUpdate()}},Ku.chartInstances=new WeakMap,M([js({oldValue(t){t.destroyed||(t.publicApi=void 0),Ku.chartInstances.delete(t)},newValue(t){t&&(t.publicApi=this,Ku.chartInstances.set(t,this))}})],Ku.prototype,"chart",2),wA=Ku}}),kx,a6=I({"packages/ag-charts-community/src/locale/locale.ts"(){"use strict";no(),Is(),mt(),kx=class extends fg{constructor(t){super(),this.ctx=t,this.localeText=void 0}},M([tl(t=>{t.ctx.localeManager.setLocaleText(t.localeText)}),k(s0,{optional:!0})],kx.prototype,"localeText",2),M([tl(t=>{t.ctx.localeManager.setLocaleTextFormatter(t.getLocaleText)}),k(ts,{optional:!0})],kx.prototype,"getLocaleText",2)}}),XR,o6=I({"packages/ag-charts-community/src/locale/localeModule.ts"(){"use strict";a6(),XR={type:"root",optionsKey:"locale",packageType:"community",chartTypes:["cartesian","polar","hierarchy","topology","flow-proportion","standalone","gauge"],moduleFactory:t=>new kx(t)}}}),EA,r6=I({"packages/ag-charts-community/src/scale/groupedCategoryScale.ts"(){"use strict";Yp(),EA=class extends Su{getIndex(t){return super.getIndex(t)??this.getMatchIndex(t)}getMatchIndex(t){const e=JSON.stringify(t),i=this._domain.find(s=>JSON.stringify(s)===e);if(i!=null)return super.getIndex(i)}}}});function Lx(t,e){const i=JSON.stringify(t,null,0);return $u.has(e)||$u.set(e,new Map),$u.get(e)?.has(i)||$u.get(e)?.set(i,e(t)),$u.get(e)?.get(i)}function ks(t){const e=new Map,i=(...a)=>a.map(o=>typeof o=="object"||typeof o=="symbol"?o:(e.has(o)||e.set(o,{v:o}),e.get(o))),s={},n=new WeakMap;return(...a)=>{const o=a.length===0?[s]:i(...a);let r=n;for(const h of o.slice(0,-1))r.has(h)||r.set(h,new WeakMap),r=r.get(h);const l=o.at(-1);let c=r.get(l);return c||(c=t(...a),r.set(l,c)),c}}var $u,RA=I({"packages/ag-charts-community/src/util/memo.ts"(){"use strict";$u=new WeakMap}});function Tx(t,e=[0,0]){for(const i of t)typeof i=="number"&&(i<0&&(e[0]+=i),i>0&&(e[1]+=i));return e}function l6(t,e){return{id:t,matchGroupIds:[e],type:"aggregate",aggregateFunction:s=>Tx(s)}}function ZR(t,e){return{id:t,type:"aggregate",matchGroupIds:e?[e]:void 0,aggregateFunction:i=>Tx(i),groupAggregateFunction:(i,s=[0,0])=>(s[0]+=i?.[0]??0,s[1]+=i?.[1]??0,s),round:!0}}function c6(t,e){return{id:t,matchGroupIds:[e],type:"aggregate",aggregateFunction:s=>sr.extendDomain(s)}}function _A(t){return{id:t,type:"aggregate",aggregateFunction:()=>[0,1],groupAggregateFunction:(e,i=[0,0])=>(i[0]+=e?.[0]??0,i[1]+=e?.[1]??0,i)}}function QR(t,e){return{id:t,matchGroupIds:e?[e]:void 0,type:"aggregate",aggregateFunction:s=>Tx(s),groupAggregateFunction:(s,n=[0,0,-1])=>(n[0]+=s?.[0]??0,n[1]+=s?.[1]??0,n[2]++,n),finalFunction:(s=[0,0,0])=>{const n=s[0]+s[1];return n>=0?[0,n/s[2]]:[n/s[2],0]},round:!0}}function PA(t,e,i){const s={id:t,matchGroupIds:i?[i]:void 0,type:"aggregate",aggregateFunction:(n,a=[])=>{const o=a[1]-a[0];return e.aggregateFunction(n).map(r=>r/o)},round:!0};return e.groupAggregateFunction&&(s.groupAggregateFunction=e.groupAggregateFunction),s}function qR(t){return()=>{let e=0;return i=>zt(i)?(e+=t?Math.max(0,i):i,e):i}}function JR(){return()=>{let t=0;return e=>{if(!zt(e))return e;const i=t;return t+=e,i}}}var BA=I({"packages/ag-charts-community/src/chart/data/aggregateFunctions.ts"(){"use strict";ot(),KE()}});function t1(t){return t!=null&&Nm(t)}function h6(t){return t!=null}function e1(t){switch(t){case"number":case"log":case"ordinal-time":case"time":case"color":return t1;default:return h6}}function i1(t){switch(t){case"number":case"log":case"time":case"color":return"range";default:return"category"}}function va(t,e,i={}){return{property:t,type:"key",valueType:i1(e),validation:e1(e),...i}}function Ct(t,e,i={}){return{property:t,type:"value",valueType:i1(e),validation:e1(e),...i}}function s1(t,e={}){return{property:t,type:"value",valueType:"range",missingValue:1,processor:()=>()=>1,...e}}function zA(t,e={}){const{min:i=-1/0,max:s=1/0,...n}=e;return{type:"value",property:t,valueType:"range",validation:t1,processor:()=>a=>zt(a)?It(i,a,s):a,...n}}function Eg(t,e,i={}){const{onlyPositive:s,...n}=i;return{...Ct(t,e,n),processor:qR(s)}}function u6(t,e,i={}){return{...Ct(t,e,i),processor:JR()}}function ul(t,e,i,s,n){return[Ct(t,n,s),a1(s.groupId,e,i,s.separateNegative),...s.rangeId!=null?[c6(s.rangeId,s.groupId)]:[]]}function n1(t,e,i){return[Ct(t,e,i),o1(i.groupId)]}function d6({normaliseTo:t}){const e=(i,s)=>{if(s===0)return null;const n=(i??0)*t/s;return n>=0?Math.min(t,n):Math.max(-t,n)};return()=>()=>(i,s,n)=>{const a=p6(i,s,n);for(const o of s)for(const r of n.datumIndices[o]){const l=i[o],c=l[r];if(c==null){l[r]=void 0;continue}l[r]=typeof c=="number"?e(c,a):c.map(h=>e(h,a))}}}function p6(t,e,i){const s=[0,0];for(const n of e){const a=t[n];for(const o of i.datumIndices[n]){const r=a[o];if(r==null)continue;const l=typeof r=="number"?r:Math.max(...r.map(h=>h??0)),c=l<0?0:1;c===0?s[c]=Math.min(s[c],l):s[c]=Math.max(s[c],l)}}return Math.max(Math.abs(s[0]),s[1])}function Cx(t,e){return{type:"group-value-processor",matchGroupIds:t,adjust:Lx({normaliseTo:e},d6)}}function g6({normaliseTo:t,zeroDomain:e,rangeMin:i,rangeMax:s}){const n=t[1]-t[0],a=(o,r,l)=>{const c=t[0]+(o-r)/l*n;return l===0?e:c>=t[1]?t[1]:c(o,r)=>{let[l,c]=o.domain.values[r];i!=null&&(l=i),s!=null&&(c=s);const h=c-l;o.domain.values[r]=[t[0],t[1]];const u=o.columns[r];for(let d=0;d()=>(i,s,n)=>{const a=[0,0];for(const o of s)for(const r of n.datumIndices[o]??[]){const l=i[o],c=l[r],h=Zy(c)&&e?0:1;zt(c)&&(t==="normal"&&(a[h]+=c),l[r]=a[h],t==="trailing"&&(a[h]+=c))}}}function y6({mode:t,sum:e}){return()=>{const i=[];let s=!0;return()=>(n,a,o)=>{let r=0;for(const l of a){const c=n[l];for(const h of o.datumIndices[l]??[]){const u=c[h],d=s&&e==="current"?0:i[l];i[l]=u;const p=e==="current"?u:d;if(!zt(u)||!zt(d)){c[h]=r;continue}t==="normal"&&(r+=p),c[h]=r,t==="trailing"&&(r+=p)}}s=!1}}}function a1(t,e,i,s=!1){let n;if(e.startsWith("window")){const a=e.endsWith("-trailing")?"trailing":"normal";n=Lx({mode:a,sum:i},y6)}else n=Lx({mode:e,separateNegative:s},f6);return{type:"group-value-processor",matchGroupIds:[t],adjust:n}}function m6(){return()=>(t,e,i)=>{const s=new Float64Array(e.length);let n=0;for(const a of e){const o=t[a];for(const r of i.datumIndices[a]??[]){const l=o[r];s[n]=Number.isFinite(l)?l:NaN,n+=1,o[r]=s.subarray(0,n)}}}}function o1(t){return{type:"group-value-processor",matchGroupIds:[t],adjust:m6}}function r1(t){return t.id??t.property}function x6(t,e,i){const s=new Map,n=e.defs.values;for(let r=0;r0||r.size>0||l.size>0,added:new Set(o.keys()),updated:new Set(r.keys()),removed:new Set(l.keys()),moved:new Set(a.keys())};return{...n,[t]:x}}}}function Ve(t,...e){let i;return ne(t)?i=t.map(n=>z0(n)).join("___"):i=z0(t),(typeof i=="string"||typeof i=="number"||typeof i=="boolean"||i instanceof Date)&&e.length>0&&(i+=`___${e.join("___")}`),i}var jA,VA,GA,Qu,Rg,WA,uo=I({"packages/ag-charts-community/src/chart/data/processors.ts"(){"use strict";ot(),RA(),At(),lg(),BA(),Vn(),jA={type:"reducer",property:"smallestKeyInterval",initialValue:1/0,reducer:()=>{let t=NaN;return(e=1/0,i)=>{const s=typeof i[0]=="number"?i[0]:Number(i[0]),n=Math.abs(s-t);return t=s,!isNaN(n)&&n>0&&n{let t=NaN;return(e=-1/0,i)=>{const s=typeof i[0]=="number"?i[0]:Number(i[0]),n=Math.abs(s-t);return t=s,!isNaN(n)&&n>0&&n>e?n:e}}},GA={type:"processor",property:"sortedGroupDomain",calculate:({domain:{groups:t}})=>t?.slice().sort((e,i)=>{for(let s=0;s{let n=Qu|Rg;if(e.valueType==="category")return i.length!==t&&(n&=~Qu),n;let a=s[0]?.valueOf();for(let o=1;n!==0&&or)&&(n&=~Rg),Number.isFinite(r)&&a===r&&(n&=~Qu),a=r}return n}}});function b6(t){const e=t.reduce((s,n)=>s=0?t.ancestor:i}function M6({children:t}){let e=0,i=0;for(let s=t.length-1;s>=0;s--){const n=t[s];n.prelim+=e,n.mod+=e,i+=n.change,e+=n.shift+i}}function I6(t,e){const i=t.getLeftSibling();if(i){let s=t,n=t,a=i,o=n.getLeftmostSibling(),r=n.mod,l=s.mod,c=a.mod,h=o.mod;for(;a.nextRight()&&n.nextLeft();){a=a.nextRight(),n=n.nextLeft(),o=o.nextLeft(),s=s.nextRight(),s.ancestor=t;const u=a.prelim+c-(n.prelim+r)+1;u>0&&(S6(v6(a,t,e),t,u),r+=u,l+=u),c+=a.mod,r+=n.mod,h+=o.mod,l+=s.mod}a.nextRight()&&!s.nextRight()?s.mod+=c-l:(n.nextLeft()&&!o.nextLeft()&&(o.mod+=r-h),e=t)}return e}function l1(t){const{children:e}=t;if(e.length){let[i]=e;for(const a of e)l1(a),i=I6(a,i);M6(t);const s=(e[0].prelim+e.at(-1).prelim)/2,n=t.getLeftSibling();n?(t.prelim=n.prelim+1,t.mod=t.prelim-s):t.prelim=s}else{const i=t.getLeftSibling();t.prelim=i?i.prelim+1:0}}function c1(t,e,i){t.x=t.prelim+e,t.y=t.depth,i.insertNode(t);for(const s of t.children)c1(s,e+t.mod,i)}function h1(t){const{children:e}=t;let i=0;for(const s of e)h1(s),s.children.length?i+=s.leafCount:i++;t.leafCount=i,e.length?(t.subtreeLeft=e[0].subtreeLeft,t.subtreeRight=e[e.length-1].subtreeRight,t.x=(t.subtreeLeft+t.subtreeRight)/2):(t.subtreeLeft=t.x,t.subtreeRight=t.x)}function A6(t){const e=new p1,i=b6(t);return l1(i),c1(i,-i.prelim,e),h1(i),e}var u1,d1,p1,D6=I({"packages/ag-charts-community/src/chart/axis/tree.ts"(){"use strict";u1=class{constructor(){this.top=1/0,this.right=-1/0,this.bottom=-1/0,this.left=1/0}update(t,e){t>this.right&&(this.right=t),tthis.bottom&&(this.bottom=e),ec.label===a);if(l&&o)s=l;else{const c=new a3(a,s,i);c.index=r.length,r.push(c),o&&(s=c)}}}getLeftSibling(){return this.index>0?this.parent?.children[this.index-1]:void 0}getLeftmostSibling(){return this.index>0?this.parent?.children[0]:void 0}nextLeft(){return this.children[0]}nextRight(){return this.children.at(-1)}getSiblings(){return this.parent?.children.filter((e,i)=>i!==this.index)??[]}},p1=class{constructor(){this.dimensions=new u1,this.nodes=[],this.depth=0}insertNode(t){this.depth0){const{left:s,right:n}=this.dimensions;i=t/(n-s)}return e&&(i*=-1),i}}}}),po,_g,Nx,qc,UA=I({"packages/ag-charts-community/src/chart/axis/groupedCategoryAxis.ts"(){"use strict";ot(),r6(),Rt(),Fs(),Ai(),Ii(),lo(),At(),Qt(),aI(),ln(),mt(),uo(),zn(),wu(),D6(),po=class extends bt{constructor(){super(...arguments),this.enabled=!0}},M([k(pt)],po.prototype,"enabled",2),M([k(pt,{optional:!0})],po.prototype,"avoidCollisions",2),M([k(jt,{optional:!0})],po.prototype,"color",2),M([k(st,{optional:!0})],po.prototype,"spacing",2),M([k(to,{optional:!0})],po.prototype,"fontStyle",2),M([k(eo,{optional:!0})],po.prototype,"fontWeight",2),M([k(_t.restrict({min:1}),{optional:!0})],po.prototype,"fontSize",2),M([k(tt,{optional:!0})],po.prototype,"fontFamily",2),_g=class extends bt{constructor(){super(...arguments),this.enabled=!0}},M([k(pt)],_g.prototype,"enabled",2),M([k(st,{optional:!0})],_g.prototype,"width",2),M([k(jt,{optional:!0})],_g.prototype,"stroke",2),Nx=class extends bt{constructor(){super(...arguments),this.label=new po,this.tick=new _g}},M([k(lt)],Nx.prototype,"label",2),M([k(lt)],Nx.prototype,"tick",2),qc=class extends Rc{constructor(t){super(t,new EA),this.tickScale=new EA,this.depthOptions=new vu(Nx),this.includeInvisibleDomains=!0,this.tickScale.paddingInner=1,this.tickScale.paddingOuter=0}resizeTickTree(){if(!this.tickTreeLayout)return;const{nodes:t}=this.tickTreeLayout,{range:e,step:i,inset:s,bandwidth:n}=this.scale,a=Math.abs(e[1]-e[0])-i,o=this.tickTreeLayout.scalingX(a,e[0]>e[1]),r=s+n/2;let l=0;for(const c of t){const h=c.x*o;l>h&&(l=h),c.screenX=h+r}for(const c of t)c.screenX-=l}getDepthOptionsMap(t){const e=[],{depthOptions:i,label:s}=this;for(let n=0;nt.setProperties(e))}updateAxisLine(){this.computedLayout&&(this.lineNode.visible=this.line.enabled,this.lineNode.stroke=this.line.stroke,this.lineNode.strokeWidth=this.line.width)}computeLayout(){if(this.updateDirection(),this.updateScale(),this.resizeTickTree(),!this.tickTreeLayout?.depth)return{bbox:ht.zero,separatorLayout:[],tickLabelLayout:[]};const{step:t}=this.scale,{title:e,label:i,range:s,depthOptions:n}=this,{depth:a,nodes:o}=this.tickTreeLayout,r=Math.ceil(i.fontSize/t),l=ti(this.rotation),c=this.position==="top"||this.position==="bottom",h=i.getSideFlag(),u=[],d=new Map,p=new kc,{defaultRotation:g,configuredRotation:f}=Cm({rotation:i.rotation,parallel:i.parallel,regularFlipRotation:re(l-Math.PI/2),parallelFlipRotation:re(l)}),x=g+f,m=this.getDepthOptionsMap(a),b=(F,V)=>{const W=a-F.depth;if(!m[W]?.enabled||V%r!==0||!s2(F.screenX,s))return!1;const H=this.formatTick(F.label,V-1),G=this.getLabelStyles({value:H,depth:W},n[W]?.label);return p.setProperties({...G,text:H,textAlign:"center",textBaseline:i.parallel?"hanging":"bottom",rotation:0,translationX:0,translationY:F.screenX}),!0};let v=0;const S={};o.forEach((F,V)=>{const W=a-F.depth,H=_3(F.label);if(S[W]??(S[W]=1),S[W]{let V=v;for(let W=1;W<=F;W++)V+=m[W].spacing,(i.mirrored||W!==F)&&(V+=S[W]*m[W].lineHeight);return V};o.forEach((F,V)=>{if(V===0)return;const W=b(F,V),H=!F.children.length,G=a-F.depth;if(F.parent){const z=H?F.x:F.x-(F.leafCount-1)/2;if(!D.has(z)){const U=this.depthOptions[G]?.tick;let Y=v;for(let K=0;K<=G;K++)Y+=m[K].spacing,K!==0&&(Y+=S[K]*m[K].lineHeight);D.set(z,{tickSize:Y,tickStroke:U?.stroke,tickWidth:U?.enabled!==!1?U?.width:0})}}if(!W)return;if(p.x=T,p.y=0,H){const{width:z}=d.get(V),U=tO(x);p.rotation=x,p.textAlign="end",p.textBaseline="middle",p.rotationCenterX=T-z/2,p.translationX=(m[G].spacing-z)/2*U*h,i.mirrored&&(p.translationX+=z)}else p.rotation=c?g:-Math.PI/2,p.rotationCenterX=T,p.translationX=h*L(G);if(m[G].avoidCollisions){const z=H?t:F.leafCount*t;if(p.getBBox().height>z){d.delete(V);return}}const{text:B=""}=p;u.push({text:B,visible:!0,range:this.scale.range,tickId:A(B),fill:p.fill,fontFamily:p.fontFamily,fontSize:p.fontSize,fontStyle:p.fontStyle,fontWeight:p.fontWeight,rotation:p.rotation,rotationCenterX:p.rotationCenterX,textAlign:p.textAlign,textBaseline:p.textBaseline,translationX:p.translationX,translationY:p.translationY,x:p.x,y:p.y}),d.set(V,be.toCanvas(p))});const{enabled:C,stroke:O,width:_}=this.line;this.lineNode.datum={x:0,y1:s[0],y2:s[1]},this.lineNode.setProperties({stroke:O,strokeWidth:C?_:0});const N=[...D.values()];N.push(N[0]);const P=[this.lineNode.getBBox(),new ht(0,0,N[0].tickSize*h,0)];e.enabled&&(this.updateTitle(!1,N[0].tickSize),P.push(e.caption.node.getBBox()));const j=ht.merge(lc(d.values(),P));return{bbox:this.getTransformBox(j),separatorLayout:N,tickLabelLayout:u}}update(){if(!this.computedLayout)return;const{tickScale:t,gridLine:e,gridLength:i}=this,{separatorLayout:s}=this.computedLayout,n=t.ticks({nice:!1,interval:void 0,tickCount:void 0,minTickCount:0,maxTickCount:1/0}).map((a,o)=>({...s[o],tick:a,tickId:Ve(a,o),tickLabel:a.filter(Boolean).join(" - "),translationY:Math.round(t.convert(a))}));this.gridLineGroupSelection.update(e.enabled&&i?n:[]),this.tickLineGroupSelection.update(this.tick.enabled?n:[]),this.updatePosition(),this.updateCategoryLabels(),this.updateAxisLine(),this.updateGridLines(),this.updateTickLines(),this.updateTitle(),this.resetSelectionNodes()}calculateLayout(){const{separatorLayout:t,tickLabelLayout:e,bbox:i}=this.computeLayout();return this.computedLayout={separatorLayout:t,tickLabelLayout:e},{bbox:i,primaryTickCount:void 0,niceDomain:this.scale.domain}}onGridVisibilityChange(){this.gridLineGroupSelection.clear(),this.tickLabelGroupSelection.clear()}updateScale(){super.updateScale(),this.tickScale.range=this.scale.range,this.scale.paddingOuter=this.scale.paddingInner/2}processData(){const{direction:t}=this,e=this.boundSeries.filter(n=>n.visible).flatMap(n=>n.getDomain(t));this.dataDomain={domain:ar(e)??this.filterDuplicateArrays(e),clipped:!1},this.isReversed()&&this.dataDomain.domain.reverse();const i=this.dataDomain.domain.map(n=>Vy(bi(n)&&"value"in n?n.value:n));this.tickTreeLayout=A6(i);const s=[];for(const n of this.tickTreeLayout.nodes)n.leafCount||n.refId==null||s.push(this.dataDomain.domain[n.refId]);return this.scale.domain=D3(this.dataDomain.domain,s),this.tickScale.domain=i.concat([[""]]),{animatable:!0}}updateGridLines(){if(!this.gridLength)return;const{width:t,style:e}=this.gridLine,i=this.gridLength*-this.label.getSideFlag();this.gridLineGroupSelection.each((s,n,a)=>{const{stroke:o,lineDash:r}=e[a%e.length],l=n.translationY;s.visible=this.inRange(l),s.x1=0,s.x2=i,s.y=l,s.stroke=o,s.strokeWidth=t,s.lineDash=r})}filterDuplicateArrays(t){const e=new Set;return t.filter(i=>{const s=ne(i)?JSON.stringify(i):i;return e.has(s)?!1:(e.add(s),!0)})}},qc.className="GroupedCategoryAxis",qc.type="grouped-category",M([k(hm)],qc.prototype,"depthOptions",2)}}),HA,dl,YA=I({"packages/ag-charts-community/src/chart/axis/logAxis.ts"(){"use strict";ot(),kA(),ug(),lo(),mt(),Mx(),HA=qt(t=>On(t)&&t!==0,"a non-zero number"),dl=class extends or{constructor(t){super(t,new vx),this.min=NaN,this.max=NaN}normaliseDataDomain(t){const{min:e,max:i}=this,{extent:s,clipped:n}=LA(t,e,i);return s[0]<0&&s[1]>0||t[0]<0&&t[1]>0?(et.warn("The log axis domain crosses zero, the chart data cannot be rendered. See log axis documentation for more information."),{domain:[],clipped:n}):s[0]===0||s[1]===0||t[0]===0||t[1]===0?(et.warn("The log axis domain contains a value of 0, the chart data cannot be rendered. See log axis documentation for more information."),{domain:[],clipped:n}):{domain:s,clipped:n}}set base(t){this.scale.base=t}get base(){return this.scale.base}defaultDatumFormatter(t,e){return String(t)}defaultLabelFormatter(t,e){return String(t)}},dl.className="LogAxis",dl.type="log",M([k(ha(Ic,HA,Iu("max"))),sl(NaN)],dl.prototype,"min",2),M([k(ha(Ic,HA,Au("min"))),sl(NaN)],dl.prototype,"max",2)}}),qu,g1=I({"packages/ag-charts-community/src/scene/util/corner.ts"(){"use strict";qu=(t,{x0:e,y0:i,x1:s,y1:n,cx:a,cy:o},r,l)=>{if(l&&t.moveTo(e,i),e!==s||i!==n){const c=Math.atan2(i-o,e-a),h=Math.atan2(n-o,s-a);t.arc(a,o,r,c,h)}else t.lineTo(e,i)}}}),KA,Pg,Bg,_i,zg=I({"packages/ag-charts-community/src/scene/shape/rect.ts"(){"use strict";Rt(),yA(),g1(),Gn(),qr(),KA=1e-6,Pg=(t,e,i,s,n)=>{let a=!1,o=!1,r=s-Math.sqrt(Math.max(n**2-i**2,0)),l=0,c=0,h=i-Math.sqrt(Math.max(n**2-s**2,0));return r>t?(a=!0,r=t,l=i-Math.sqrt(Math.max(n**2-(s-t)**2))):re?(o=!0,c=s-Math.sqrt(Math.max(n**2-(i-e)**2)),h=e):h{let{topLeft:r,topRight:l,bottomRight:c,bottomLeft:h}=a;const u=Math.max(r+h,l+c),d=Math.max(r+l,h+c);if(u<=0&&d<=0){o==null?t.rect(e,i,s,n):t.rect(o.x,o.y,o.width,o.height);return}else if(o==null&&r===l&&r===c&&r===h){t.roundRect(e,i,s,n,r);return}if(s<0&&(e+=s,s=Math.abs(s)),n<0&&(i+=n,n=Math.abs(n)),s<=0||n<=0)return;if(o==null)o=new ht(e,i,s,n);else{const D=Math.max(e,o.x),L=Math.min(e+s,o.x+o.width),C=Math.max(i,o.y),O=Math.min(i+n,o.y+o.height);o=new ht(D,C,L-D,O-C)}const p=Math.max(u/n,d/s,1);p>1&&(r/=p,l/=p,c/=p,h/=p);let g=!0,f=!0,x=!0,m=!0,b,v,S,A;if(g){const D=Pg(o.height,o.width,Math.max(e+r-o.x,0),Math.max(i+r-o.y,0),r);D.leadingClipped&&(m=!1),D.trailingClipped&&(f=!1);const L=Math.max(o.x+D.leading1,o.x),C=Math.max(o.y+D.leading0,o.y),O=Math.max(o.x+D.trailing1,o.x),_=Math.max(o.y+D.trailing0,o.y),N=e+r,P=i+r;b={x0:L,y0:C,x1:O,y1:_,cx:N,cy:P}}if(f){const D=Pg(o.width,o.height,Math.max(i+l-o.y,0),Math.max(o.x+o.width-(e+s-l),0),l);D.leadingClipped&&(g=!1),D.trailingClipped&&(x=!1);const L=Math.min(o.x+o.width-D.leading0,o.x+o.width),C=Math.max(o.y+D.leading1,o.y),O=Math.min(o.x+o.width-D.trailing0,o.x+o.width),_=Math.max(o.y+D.trailing1,o.y),N=e+s-l,P=i+l;v={x0:L,y0:C,x1:O,y1:_,cx:N,cy:P}}if(x){const D=Pg(o.height,o.width,Math.max(o.x+o.width-(e+s-c),0),Math.max(o.y+o.height-(i+n-c),0),c);D.leadingClipped&&(f=!1),D.trailingClipped&&(m=!1);const L=Math.min(o.x+o.width-D.leading1,o.x+o.width),C=Math.min(o.y+o.height-D.leading0,o.y+o.height),O=Math.min(o.x+o.width-D.trailing1,o.x+o.width),_=Math.min(o.y+o.height-D.trailing0,o.y+o.height),N=e+s-c,P=i+n-c;S={x0:L,y0:C,x1:O,y1:_,cx:N,cy:P}}if(m){const D=Pg(o.width,o.height,Math.max(o.y+o.height-(i+n-h),0),Math.max(e+h-o.x,0),h);D.leadingClipped&&(x=!1),D.trailingClipped&&(g=!1);const L=Math.max(o.x+D.leading0,o.x),C=Math.min(o.y+o.height-D.leading1,o.y+o.height),O=Math.max(o.x+D.trailing0,o.x),_=Math.min(o.y+o.height-D.trailing1,o.y+o.height),N=e+h,P=i+n-h;A={x0:L,y0:C,x1:O,y1:_,cx:N,cy:P}}let T=!1;g&&b!=null&&(qu(t,b,r,!T),T||(T=!0)),f&&v!=null&&(qu(t,v,l,!T),T||(T=!0)),x&&S!=null&&(qu(t,S,c,!T),T||(T=!0)),m&&A!=null&&qu(t,A,h,!T),t.closePath()},_i=class extends ns{constructor(){super(...arguments),this.borderPath=new Wu,this.x=0,this.y=0,this.width=10,this.height=10,this.topLeftCornerRadius=0,this.topRightCornerRadius=0,this.bottomRightCornerRadius=0,this.bottomLeftCornerRadius=0,this.clipBBox=void 0,this.crisp=!1,this.lastUpdatePathStrokeWidth=rn.defaultStyles.strokeWidth,this.effectiveStrokeWidth=rn.defaultStyles.strokeWidth,this.hittester=super.isPointInPath.bind(this),this.distanceCalculator=super.distanceSquaredTransformedPoint.bind(this),this.microPixelEffectOpacity=1}set cornerRadius(t){this.topLeftCornerRadius=t,this.topRightCornerRadius=t,this.bottomRightCornerRadius=t,this.bottomLeftCornerRadius=t}isDirtyPath(){return this.lastUpdatePathStrokeWidth!==this.strokeWidth||!!(this.path.isDirty()||this.borderPath.isDirty())}updatePath(){const{path:t,borderPath:e,crisp:i,topLeftCornerRadius:s,topRightCornerRadius:n,bottomRightCornerRadius:a,bottomLeftCornerRadius:o}=this;let{x:r,y:l,width:c,height:h,strokeWidth:u,clipBBox:d}=this;const g=1/(this.layerManager?.canvas.pixelRatio??1);let f=1;if(t.clear(!0),e.clear(!0),i&&(c<=g&&(f*=c/g),h<=g&&(f*=h/g),c=this.align(r,c),h=this.align(l,h),r=this.align(r),l=this.align(l),d=d!=null?new ht(this.align(d.x),this.align(d.y),this.align(d.x,d.width),this.align(d.y,d.height)):void 0),u)if(c0?s-u:0,topRight:n>0?n-u:0,bottomRight:a>0?a-u:0,bottomLeft:o>0?o-u:0};this.borderClipPath=void 0,c>0&&h>0&&(m==null||m?.width>0&&m?.height>0)&&(Bg(t,r,l,c,h,b,m),Bg(e,r,l,c,h,b,m))}else this.borderClipPath=this.borderClipPath??new Wu,this.borderClipPath.clear(!0),this.borderClipPath.rect(r,l,c,h),e.rect(r,l,c,h);else{const x={topLeft:s,topRight:n,bottomRight:a,bottomLeft:o};this.borderClipPath=void 0,Bg(t,r,l,c,h,x,d)}if([s,n,a,o].every(x=>x===0)){const x=this.getBBox();this.hittester=x.containsPoint.bind(x),this.distanceSquared=(m,b)=>this.getBBox().distanceSquared(m,b)}else this.hittester=super.isPointInPath,this.distanceCalculator=super.distanceSquaredTransformedPoint;this.effectiveStrokeWidth=u,this.lastUpdatePathStrokeWidth=u,this.microPixelEffectOpacity=f}computeBBox(){const{x:t,y:e,width:i,height:s,clipBBox:n}=this;return n?.clone()??new ht(t,e,i,s)}isPointInPath(t,e){return this.hittester(t,e)}get midPoint(){return{x:this.x+this.width/2,y:this.y+this.height/2}}distanceSquared(t,e){return this.distanceCalculator(t,e)}applyFillAlpha(t){const{fillOpacity:e,microPixelEffectOpacity:i,opacity:s}=this;t.globalAlpha*=s*e*i}renderStroke(t){const{stroke:e,effectiveStrokeWidth:i}=this;if(e&&i){const{globalAlpha:s}=t,{strokeOpacity:n,lineDash:a,lineDashOffset:o,lineCap:r,lineJoin:l,borderPath:c,borderClipPath:h,opacity:u,microPixelEffectOpacity:d}=this;h&&t.clip(h.getPath2D()),this.applyStroke(t),t.globalAlpha*=u*n*d,t.lineWidth=i,a&&t.setLineDash(a),o&&(t.lineDashOffset=o),r&&(t.lineCap=r),l&&(t.lineJoin=l),t.stroke(c.getPath2D()),t.globalAlpha=s}}},_i.className="Rect",M([St()],_i.prototype,"x",2),M([St()],_i.prototype,"y",2),M([St()],_i.prototype,"width",2),M([St()],_i.prototype,"height",2),M([St()],_i.prototype,"topLeftCornerRadius",2),M([St()],_i.prototype,"topRightCornerRadius",2),M([St()],_i.prototype,"bottomRightCornerRadius",2),M([St()],_i.prototype,"bottomLeftCornerRadius",2),M([St()],_i.prototype,"clipBBox",2),M([St()],_i.prototype,"crisp",2)}}),Jc,f1=I({"packages/ag-charts-community/src/chart/background/background.ts"(){"use strict";no(),pe(),zg(),Fs(),Is(),mt(),Jc=class extends fg{constructor(t){super(),this.ctx=t,this.rectNode=new _i,this.textNode=new ei,this.fill="white",this.node=this.createNode(),this.node.append([this.rectNode,this.textNode]),this.visible=!0,this.destroyFns.push(t.scene.attachNode(this.node),t.layoutManager.addListener("layout:complete",e=>this.onLayoutComplete(e)))}createNode(){return new yt({name:"background",zIndex:0})}onLayoutComplete(t){const{width:e,height:i}=t.chart;this.rectNode.width=e,this.rectNode.height=i}},M([k(pt),Di("node","visible")],Jc.prototype,"visible",2),M([k(jt,{optional:!0}),Di("rectNode","fill")],Jc.prototype,"fill",2),M([k(lt,{optional:!0})],Jc.prototype,"image",2),M([k(tt,{optional:!0}),Di("textNode")],Jc.prototype,"text",2)}}),$A,y1=I({"packages/ag-charts-community/src/chart/background/backgroundModule.ts"(){"use strict";f1(),$A={type:"root",optionsKey:"background",packageType:"community",chartTypes:["cartesian","polar","hierarchy","topology","flow-proportion","standalone","gauge"],moduleFactory:t=>new Jc(t)}}});function k6({orientation:t,bboxes:e,maxHeight:i,maxWidth:s,itemPaddingY:n=0,itemPaddingX:a=0,forceResult:o=!1}){const r=t==="horizontal",l={max:r?s:i,fn:r?d=>d.width:d=>d.height,padding:r?a:n},c={max:r?i:s,fn:r?d=>d.height:d=>d.width,padding:r?n:a};let h=0;const u=[];for(;h=1;){const l=T6(t,e,r,i,s,n);if(l==null&&r<=1)return;if(l==null){r--;continue}if(typeof l=="number"){if(l<=1)return;r=l1?l:r,r--;continue}return{processedBBoxCount:l.length*l[0].length,pageIndices:l}}}function T6(t,e,i,s,n,a){const o=[];let r=0,l=0,c=[];const h=[];for(let u=0;u0&&o.push(c),c=[]);const p=s.fn(t[u])+s.padding;h[d]=Math.max(h[d]??0,p),l=Math.max(l,n.fn(t[u])+n.padding);const g=r+l,f=!a||o.length>0;if(g>n.max&&f){c=[];break}if(h.reduce((m,b)=>m+b,0)>s.max&&!a)return h.length0&&o.push(c),o.length>0?o:void 0}function C6(t,e,i,s,n){let a=0,o=0;return{pages:t.map(l=>{e==="horizontal"&&(l=N6(l));let c=0;const h=l.map(p=>{const g=p.map(m=>(c=Math.max(m,c),i[m]));let f=0,x=0;return g.forEach(m=>{f+=m.height+s,x=Math.max(x,m.width+n)}),{indices:p,bboxes:g,columnHeight:Math.ceil(f),columnWidth:Math.ceil(x)}});let u=0,d=0;return h.forEach(p=>{u+=p.columnWidth,d=Math.max(d,p.columnHeight)}),a=Math.max(u,a),o=Math.max(d,o),{columns:h,startIndex:l[0][0],endIndex:c,pageWidth:u,pageHeight:d}}),maxPageWidth:a,maxPageHeight:o}}function N6(t){const e=[];for(const i of t[0])e.push([]);return t.forEach((i,s)=>{i.forEach((n,a)=>{e[a][s]=n})}),e}function O6(t,e){const i=t.length;let s=0;for(let n=0;ne.max)return i/n<2?Math.ceil(i/2):n;return i}var w6=I({"packages/ag-charts-community/src/chart/gridLayout.ts"(){"use strict"}}),th,go,Fg,pl,E6=I({"packages/ag-charts-community/src/chart/pagination/pagination.ts"(){"use strict";pe(),Fs(),Ai(),Rn(),At(),Qt(),Is(),mt(),ba(),th=class extends bt{constructor(){super(...arguments),this.color="black",this.fontStyle=void 0,this.fontWeight=void 0,this.fontSize=12,this.fontFamily="Verdana, sans-serif"}},M([k(jt)],th.prototype,"color",2),M([k(to,{optional:!0})],th.prototype,"fontStyle",2),M([k(eo,{optional:!0})],th.prototype,"fontWeight",2),M([k(st)],th.prototype,"fontSize",2),M([k(tt)],th.prototype,"fontFamily",2),go=class extends bt{constructor(){super(...arguments),this.size=15,this.fill=void 0,this.fillOpacity=void 0,this.stroke=void 0,this.strokeWidth=1,this.strokeOpacity=1}},M([k(st)],go.prototype,"size",2),M([k(jt,{optional:!0})],go.prototype,"fill",2),M([k(Ut,{optional:!0})],go.prototype,"fillOpacity",2),M([k(jt,{optional:!0})],go.prototype,"stroke",2),M([k(st)],go.prototype,"strokeWidth",2),M([k(Ut)],go.prototype,"strokeOpacity",2),Fg=class extends bt{constructor(t){super(),this.parent=t,this.shape="triangle",this.size=15,this.padding=8}},M([js({changeValue(){this.parent.marker===this&&this.parent.onMarkerShapeChange()}})],Fg.prototype,"shape",2),M([k(st)],Fg.prototype,"size",2),M([k(st)],Fg.prototype,"padding",2),pl=class extends bt{constructor(t,e){super(),this.chartUpdateCallback=t,this.pageUpdateCallback=e,this.id=En(this),this.marker=new Fg(this),this.activeStyle=new go,this.inactiveStyle=new go,this.highlightStyle=new go,this.label=new th,this.group=new is({name:"pagination"}),this.labelNode=new ei,this.totalPages=0,this.currentPage=0,this.translationX=0,this.translationY=0,this.nextButtonDisabled=!1,this.previousButtonDisabled=!1,this._visible=!0,this._enabled=!0,this._orientation="vertical",this.nextButton=new ai,this.previousButton=new ai,this.labelNode.setProperties({textBaseline:"middle",fontSize:12,fontFamily:"Verdana, sans-serif",fill:"black",y:1}),this.group.append([this.nextButton,this.previousButton,this.labelNode]),this.update(),this.updateMarkers()}set visible(t){this._visible=t,this.updateGroupVisibility()}get visible(){return this._visible}set enabled(t){this._enabled=t,this.updateGroupVisibility()}get enabled(){return this._enabled}updateGroupVisibility(){this.group.visible=this.enabled&&this.visible}set orientation(t){switch(this._orientation=t,t){case"horizontal":{this.previousButton.rotation=-Math.PI/2,this.nextButton.rotation=Math.PI/2;break}case"vertical":default:this.previousButton.rotation=0,this.nextButton.rotation=Math.PI}}get orientation(){return this._orientation}update(){this.updateLabel(),this.updatePositions(),this.enableOrDisableButtons()}updatePositions(){this.group.translationX=this.translationX,this.group.translationY=this.translationY,this.updateLabelPosition(),this.updateNextButtonPosition()}updateLabelPosition(){const{size:t,padding:e}=this.marker;this.nextButton.size=t,this.previousButton.size=t,this.labelNode.x=t/2+e}updateNextButtonPosition(){const t=this.labelNode.getBBox();this.nextButton.translationX=t.width+(this.marker.size/2+this.marker.padding)*2}updateLabel(){const{currentPage:t,totalPages:e,labelNode:i,label:{color:s,fontStyle:n,fontWeight:a,fontSize:o,fontFamily:r}}=this;i.text=`${t+1} / ${e}`,i.fill=s,i.fontStyle=n,i.fontWeight=a,i.fontSize=o,i.fontFamily=r}updateMarkers(){const{nextButton:t,previousButton:e,nextButtonDisabled:i,previousButtonDisabled:s,activeStyle:n,inactiveStyle:a,highlightStyle:o,highlightActive:r}=this,l=(c,h)=>h?a:c===r?o:n;this.updateMarker(t,l("next",i)),this.updateMarker(e,l("previous",s))}updateMarker(t,e){const{shape:i,size:s}=this.marker;t.shape=i,t.size=s,t.fill=e.fill,t.fillOpacity=e.fillOpacity??1,t.stroke=e.stroke,t.strokeWidth=e.strokeWidth,t.strokeOpacity=e.strokeOpacity}enableOrDisableButtons(){const{currentPage:t,totalPages:e}=this,i=e===0,s=t===e-1,n=t===0;this.nextButtonDisabled=s||i,this.previousButtonDisabled=n||i}setPage(t){t=It(0,t,Math.max(0,this.totalPages-1)),this.currentPage!==t&&(this.currentPage=t,this.onPaginationChanged())}getCursor(t){return{previous:this.previousButtonDisabled,next:this.nextButtonDisabled}[t]?void 0:"pointer"}onClick(t,e){t.preventDefault(),e==="next"&&!this.nextButtonDisabled?(this.incrementPage(),this.onPaginationChanged()):e==="previous"&&!this.previousButtonDisabled&&(this.decrementPage(),this.onPaginationChanged())}onMouseHover(t){this.highlightActive=t,this.updateMarkers(),this.chartUpdateCallback(6)}onPaginationChanged(){this.pageUpdateCallback(this.currentPage)}incrementPage(){this.currentPage=Math.min(this.currentPage+1,this.totalPages-1)}decrementPage(){this.currentPage=Math.max(this.currentPage-1,0)}onMarkerShapeChange(){this.updatePositions(),this.updateMarkers(),this.chartUpdateCallback(6)}attachPagination(t){t.append(this.group)}getBBox(){return this.group.getBBox()}computeCSSBounds(){const t=be.toCanvas(this.previousButton),e=be.toCanvas(this.nextButton);return{prev:t,next:e}}},pl.className="Pagination",M([k(lt)],pl.prototype,"marker",2),M([k(lt)],pl.prototype,"activeStyle",2),M([k(lt)],pl.prototype,"inactiveStyle",2),M([k(lt)],pl.prototype,"highlightStyle",2),M([k(lt)],pl.prototype,"label",2)}}),Ox,XA=I({"packages/ag-charts-community/src/scene/util/changeDetectableProperties.ts"(){"use strict";Qt(),Ox=class extends bt{constructor(){super(...arguments),this._dirty=!0}markDirty(){this._dirty=!0}markClean(t){this._dirty=!1}isDirty(){return this._dirty}}}});function R6(t){return typeof t=="string"&&m1.has(t)}var m1,_6=I({"packages/ag-charts-community/src/chart/marker/util.ts"(){"use strict";m1=new Set(["circle","cross","diamond","heart","pin","plus","square","star","triangle"])}}),wx,Pi,Ju=I({"packages/ag-charts-community/src/chart/series/seriesMarker.ts"(){"use strict";qy(),XA(),mt(),_6(),wx=qt(t=>R6(t)||typeof t=="function","a marker shape keyword such as 'circle', 'diamond' or 'square' or an object extending the Marker class"),Pi=class extends Ox{constructor(){super(...arguments),this.enabled=!0,this.shape="circle",this.size=6,this.fillOpacity=1,this.strokeWidth=1,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0}getStyle(){const{size:t,shape:e,fill:i,fillOpacity:s,stroke:n,strokeWidth:a,strokeOpacity:o,lineDash:r,lineDashOffset:l}=this;return{size:t,shape:e,fill:i,fillOpacity:s,stroke:n,strokeWidth:a,strokeOpacity:o,lineDash:r,lineDashOffset:l}}getDiameter(){return this.size+this.strokeWidth}},M([k(pt),ct()],Pi.prototype,"enabled",2),M([k(wx),ct()],Pi.prototype,"shape",2),M([k(st),ct()],Pi.prototype,"size",2),M([k(jt,{optional:!0}),ct()],Pi.prototype,"fill",2),M([k(Ut),ct()],Pi.prototype,"fillOpacity",2),M([k(jt,{optional:!0}),ct()],Pi.prototype,"stroke",2),M([k(st),ct()],Pi.prototype,"strokeWidth",2),M([k(Ut),ct()],Pi.prototype,"strokeOpacity",2),M([k(ua)],Pi.prototype,"lineDash",2),M([k(st)],Pi.prototype,"lineDashOffset",2),M([k(ts,{optional:!0}),ct()],Pi.prototype,"itemStyler",2)}});function jg(t,e,i){t.fill=i?.fill??e.fill,t.fillOpacity=i?.fillOpacity??e.fillOpacity??1,t.stroke=i?.stroke??e.stroke,t.strokeOpacity=i?.strokeOpacity??e.strokeOpacity??1,t.strokeWidth=i?.strokeWidth??e.strokeWidth??0,t.lineDash=i?.lineDash??e.lineDash,t.lineDashOffset=i?.lineDashOffset??e.lineDashOffset??0}var Ex=I({"packages/ag-charts-community/src/chart/series/shapeUtil.ts"(){"use strict"}}),x1,P6=I({"packages/ag-charts-community/src/chart/legend/legendDOMProxy.ts"(){"use strict";Lt(),Ai(),Nw(),x1=class{constructor(t,e){this.idPrefix=e,this.dirty=!0,this.destroyFns=new vI,this.itemList=t.proxyInteractionService.createProxyContainer({type:"list",domManagerId:`${e}-toolbar`,classList:["ag-charts-proxy-legend-toolbar"],ariaLabel:{id:"ariaLabelLegend"}}),this.paginationGroup=t.proxyInteractionService.createProxyContainer({type:"group",domManagerId:`${e}-pagination`,classList:["ag-charts-proxy-legend-pagination"],ariaLabel:{id:"ariaLabelLegendPagination"},ariaOrientation:"horizontal"}),this.itemDescription=Ot("p"),this.itemDescription.style.display="none",this.itemDescription.id=`${e}-ariaDescription`,this.itemDescription.textContent=this.getItemAriaDescription(t.localeManager),this.itemList.getElement().append(this.itemDescription)}destroy(){this.destroyFns.destroy()}initLegendList(t){if(!this.dirty)return;const{ctx:e,itemSelection:i,datumReader:s,itemListener:n}=t,a=e.localeManager,o=i.length;i.each((r,l,c)=>{r.proxyButton?.destroy(),r.proxyButton=e.proxyInteractionService.createProxyElement({type:"listswitch",textContent:this.getItemAriaText(a,s.getItemLabel(l),c,o),ariaChecked:!!r.datum.enabled,ariaDescribedBy:this.itemDescription.id,parent:this.itemList});const h=r.proxyButton;h.addListener("click",u=>n.onClick(u.sourceEvent,r.datum,h)),h.addListener("dblclick",u=>n.onDoubleClick(u.sourceEvent,r.datum)),h.addListener("mouseenter",u=>n.onHover(u.sourceEvent,r)),h.addListener("mouseleave",()=>n.onLeave()),h.addListener("contextmenu",u=>n.onContextClick(u.sourceEvent,r)),h.addListener("blur",()=>n.onLeave()),h.addListener("focus",u=>n.onHover(u.sourceEvent,r)),h.addListener("drag-start",()=>{})}),this.dirty=!1}update(t){t.visible&&(this.initLegendList(t),this.updateItemProxyButtons(t),this.updatePaginationProxyButtons(t,!0)),this.updateVisibility(t.visible)}updateVisibility(t){this.itemList.setHidden(!t),this.paginationGroup.setHidden(!t)}updateItemProxyButtons({itemSelection:t,group:e,pagination:i,interactive:s}){const n=be.toCanvas(e);this.itemList.setBounds(n);const a=Math.max(...t.nodes().map(o=>o.getBBox().height));t.each((o,r)=>{if(o.proxyButton){const l=o.pageIndex===i.currentPage,{x:c,y:h,height:u,width:d}=be.toCanvas(o),p=(a-u)/2,g={x:c-n.x,y:h-p-n.y,height:a,width:d};o.proxyButton.setCursor("pointer"),o.proxyButton.setEnabled(s&&l),o.proxyButton.setBounds(g)}})}updatePaginationProxyButtons(t,e){const{pagination:i}=t;if(this.paginationGroup.setHidden(!i.visible),e&&"ctx"in t){const{ctx:a,oldPages:o,newPages:r}=t,l=(o?.length??r.length)>1,c=r.length>1;l!==c&&(c?(this.prevButton=a.proxyInteractionService.createProxyElement({type:"button",id:`${this.idPrefix}-prev-page`,textContent:{id:"ariaLabelLegendPagePrevious"},tabIndex:0,parent:this.paginationGroup}),this.prevButton.addListener("click",h=>this.onPageButton(t,h,"previous")),this.prevButton.addListener("mouseenter",()=>i.onMouseHover("previous")),this.prevButton.addListener("mouseleave",()=>i.onMouseHover(void 0)),this.nextButton??(this.nextButton=a.proxyInteractionService.createProxyElement({type:"button",id:`${this.idPrefix}-next-page`,textContent:{id:"ariaLabelLegendPageNext"},tabIndex:0,parent:this.paginationGroup})),this.nextButton.addListener("click",h=>this.onPageButton(t,h,"next")),this.nextButton.addListener("mouseenter",()=>i.onMouseHover("next")),this.nextButton.addListener("mouseleave",()=>i.onMouseHover(void 0))):(this.nextButton?.destroy(),this.prevButton?.destroy(),this.nextButton=void 0,this.prevButton=void 0))}const{prev:s,next:n}=i.computeCSSBounds();this.prevButton?.setBounds(s),this.nextButton?.setBounds(n),this.prevButton?.setEnabled(i.currentPage!==0),this.nextButton?.setEnabled(i.currentPage!==i.totalPages-1),this.nextButton?.setCursor(i.getCursor("next")),this.prevButton?.setCursor(i.getCursor("previous"))}onPageButton(t,e,i){t.pagination.onClick(e.sourceEvent,i),this.updatePaginationProxyButtons(t,!1)}onDataUpdate(t,e){this.dirty=t.length!==e.length||t.some((i,s,n)=>{const[a,o]=[e[s],t[s]];return a.id!==o.id})}onLocaleChanged(t,e,i){const s=e.length;e.each(({proxyButton:n},a,o)=>{const r=n?.getElement();if(r!=null){const l=i.getItemLabel(a);r.textContent=this.getItemAriaText(t,l,o,s)}}),this.itemDescription.textContent=this.getItemAriaDescription(t)}onPageChange(t){this.updateItemProxyButtons(t),this.updatePaginationProxyButtons(t,!1)}getItemAriaText(t,e,i,s){return i>=0&&e?(i++,t.t("ariaLabelLegendItem",{label:e,index:i,count:s})):t.t("ariaLabelLegendItemUnknown")}getItemAriaDescription(t){return t.t("ariaDescriptionLegendItem")}}}});function b1(t,e,i,s){const n={defaultPrevented:!1,apiEvent:{type:t,itemId:e,seriesId:i,event:s,preventDefault:()=>n.defaultPrevented=!0}};return n}var B6=I({"packages/ag-charts-community/src/chart/legend/legendEvent.ts"(){"use strict"}}),un,S1=I({"packages/ag-charts-community/src/chart/legend/legendMarkerLabel.ts"(){"use strict";qy(),pe(),Oc(),Fs(),Ai(),Is(),ba(),un=class extends Dc(yt){constructor(){super({name:"markerLabelGroup"}),this.symbolsGroup=this.appendChild(new yt({name:"legend-markerLabel-symbols"})),this.label=this.appendChild(new ei),this.enabled=!0,this.pageIndex=NaN,this.spacing=0,this.length=0,this.isCustomMarker=!1,this.marker=this.symbolsGroup.appendChild(new ai({zIndex:1})),this.line=this.symbolsGroup.appendChild(new Vs({zIndex:0}));const{label:t,line:e,symbolsGroup:i}=this;e.visible=!1,i.renderToOffscreenCanvas=!0,i.optimizeForInfrequentRedraws=!0,t.textBaseline="middle",t.fontSize=12,t.fontFamily="Verdana, sans-serif",t.fill="black",t.y=1}destroy(){super.destroy(),this.proxyButton?.destroy()}setEnabled(t){this.enabled=t,this.refreshVisibilities()}refreshVisibilities(){const t=this.enabled?1:.5;this.label.opacity=t,this.opacity=t}layout(){const{marker:t,line:e,length:i,isCustomMarker:s}=this;let n=0,a=0;if(t.visible){const{size:o}=t,r=ai.anchor(t.shape);n=(r.x-.5)*o+i/2,a=(r.y-.5)*o,s?(t.x=0,t.y=0,t.translationX=n,t.translationY=a):(t.x=n,t.y=a,t.translationX=0,t.translationY=0)}e.visible&&(e.x1=0,e.x2=i,e.y1=0,e.y2=0)}preRender(t){const e=super.preRender(t);return this.layout(),e}layoutLabel(){const{length:t,spacing:e}=this;this.label.x=t+e}computeBBox(){return this.layout(),super.computeBBox()}},un.className="MarkerLabel",M([Di("label")],un.prototype,"text",2),M([Di("label")],un.prototype,"fontStyle",2),M([Di("label")],un.prototype,"fontWeight",2),M([Di("label")],un.prototype,"fontSize",2),M([Di("label")],un.prototype,"fontFamily",2),M([Di("label","fill")],un.prototype,"color",2),M([tl(t=>t.layoutLabel())],un.prototype,"spacing",2),M([tl(t=>t.layoutLabel())],un.prototype,"length",2),M([ct()],un.prototype,"isCustomMarker",2)}}),lr,eh,Rx,cr,_x,td,Px,Ls,z6=I({"packages/ag-charts-community/src/chart/legend/legend.ts"(){"use strict";ot(),Rt(),pe(),el(),Ai(),Rn(),At(),oe(),Qt(),Is(),ln(),k0(),mt(),w6(),ba(),E6(),Ju(),Ex(),P6(),B6(),S1(),lr=class extends bt{constructor(){super(...arguments),this.maxLength=void 0,this.color="black",this.fontStyle=void 0,this.fontWeight=void 0,this.fontSize=12,this.fontFamily="Verdana, sans-serif"}},M([k(st,{optional:!0})],lr.prototype,"maxLength",2),M([k(jt)],lr.prototype,"color",2),M([k(to,{optional:!0})],lr.prototype,"fontStyle",2),M([k(eo,{optional:!0})],lr.prototype,"fontWeight",2),M([k(st)],lr.prototype,"fontSize",2),M([k(tt)],lr.prototype,"fontFamily",2),M([k(ts,{optional:!0})],lr.prototype,"formatter",2),eh=class extends bt{constructor(){super(...arguments),this.shape=void 0,this.size=15,this.padding=8}},M([k(wx,{optional:!0})],eh.prototype,"shape",2),M([k(st)],eh.prototype,"size",2),M([k(st)],eh.prototype,"padding",2),M([k(st,{optional:!0})],eh.prototype,"strokeWidth",2),M([k(pt)],eh.prototype,"enabled",2),Rx=class extends bt{},M([k(st,{optional:!0})],Rx.prototype,"strokeWidth",2),M([k(st,{optional:!0})],Rx.prototype,"length",2),cr=class extends bt{constructor(){super(...arguments),this.paddingX=16,this.paddingY=8,this.showSeriesStroke=!1,this.marker=new eh,this.label=new lr,this.line=new Rx}},M([k(st,{optional:!0})],cr.prototype,"maxWidth",2),M([k(st)],cr.prototype,"paddingX",2),M([k(st)],cr.prototype,"paddingY",2),M([k(pt)],cr.prototype,"showSeriesStroke",2),M([k(lt)],cr.prototype,"marker",2),M([k(lt)],cr.prototype,"label",2),M([k(lt)],cr.prototype,"line",2),_x=class extends bt{},M([k(ts,{optional:!0})],_x.prototype,"legendItemClick",2),M([k(ts,{optional:!0})],_x.prototype,"legendItemDoubleClick",2),td="legend-visibility",Px="legend-other-series",Ls=class extends bt{constructor(t){super(),this.ctx=t,this.id=En(this),this.group=new is({name:"legend",zIndex:14}),this.itemSelection=Oe.select(this.group,un),this.oldSize=[0,0],this.pages=[],this.maxPageSize=[0,0],this.paginationTrackingIndex=0,this.truncatedItems=new Set,this._data=[],this.toggleSeries=!0,this.item=new cr,this.listeners=new _x,this.enabled=!0,this.position="bottom",this.spacing=20,this.destroyFns=[],this.size=[0,0],this._visible=!0,this.pagination=new pl(e=>t.updateService.update(e),e=>this.updatePageNumber(e)),this.pagination.attachPagination(this.group),this.destroyFns.push(t.contextMenuRegistry.registerDefaultAction({id:td,type:"legend",label:"contextMenuToggleSeriesVisibility",action:e=>this.contextToggleVisibility(e)}),t.contextMenuRegistry.registerDefaultAction({id:Px,type:"legend",label:"contextMenuToggleOtherSeries",action:e=>this.contextToggleOtherSeries(e)}),t.legendManager.addListener("legend-change",this.onLegendDataChange.bind(this))),this.destroyFns.push(t.layoutManager.registerElement(1,e=>this.positionLegend(e)),t.localeManager.addListener("locale-changed",()=>this.onLocaleChanged()),()=>this.group.remove()),this.domProxy=new x1(this.ctx,this.id),this.ctx.historyManager.addMementoOriginator(t.legendManager)}set data(t){pc(t,this._data)||(this.domProxy.onDataUpdate(this._data,t),this._data=t,this.updateGroupVisibility())}get data(){return this._data}onLegendDataChange({legendData:t=[]}){this.enabled&&(this.data=t.filter(e=>!e.hideInLegend))}destroy(){this.ctx.domManager.removeChild("canvas-overlay",`${this.id}-toolbar`),this.ctx.domManager.removeChild("canvas-overlay",`${this.id}-pagination`),this.destroyFns.forEach(t=>t()),this.itemSelection.clear(),this.domProxy.destroy()}getOrientation(){if(this.orientation!==void 0)return this.orientation;switch(this.position){case"right":case"left":return"vertical";case"bottom":case"top":return"horizontal"}}set visible(t){this._visible=t,this.updateGroupVisibility()}get visible(){return this._visible}updateGroupVisibility(){this.group.visible=this.enabled&&this.visible&&this.data.length>0}attachLegend(t){t.appendChild(this.group)}getItemLabel(t){const{ctx:{callbackCache:e}}=this,{formatter:i}=this.item.label;if(i){const s=t.datum;return e.call(i,{itemId:t.itemId,value:t.label.text,seriesId:t.seriesId,...s&&{datum:s}})}return t.label.text}calcLayout(t,e){const{paddingX:i,paddingY:s,label:n,maxWidth:a,label:{maxLength:o=1/0,fontStyle:r,fontWeight:l,fontSize:c,fontFamily:h}}=this.item,u=[...this.data];this.reverseOrder&&u.reverse(),this.itemSelection.update(u);const d=[],p=ge.toFontString(n),f=a??t*.8,x=this.calculateMarkerWidth();if(this.itemSelection.each((C,O)=>{C.fontStyle=r,C.fontWeight=l,C.fontSize=c,C.fontFamily=h;const _=this.updateMarkerLabel(C,O,x),N=O.itemId??O.id,j=(this.getItemLabel(O)??"").replace(/\r?\n/g," ");C.text=this.truncate(j,o,f,_,p,N),d.push(C.getBBox())}),t=Math.max(1,t),e=Math.max(1,e),!isFinite(t))return{};const m=this.size,b=this.oldSize;m[0]=t,m[1]=e,(m[0]!==b[0]||m[1]!==b[1])&&(b[0]=m[0],b[1]=m[1]);const{pages:v,maxPageHeight:S,maxPageWidth:A}=this.updatePagination(d,t,e),T=this.pages;this.pages=v,this.maxPageSize=[A-i,S-s];const D=this.pagination.currentPage,L=this.pages[D];return this.pages.length<1||!L?(this.visible=!1,{oldPages:T}):(this.visible=!0,this.updatePositions(D),this.update(),{oldPages:T})}isCustomMarker(t,e){return t&&e!==void 0&&typeof e!="string"}calcSymbolsEnabled(t){const{showSeriesStroke:e,marker:i}=this.item,s=!!i.enabled||!e||(t.marker.enabled??!0),n=!!(t.line&&e),a=this.isCustomMarker(s,t.marker.shape);return{markerEnabled:s,lineEnabled:n,isCustomMarker:a}}calcSymbolsLengths(t){const{marker:e,line:i}=this.item,{markerEnabled:s,lineEnabled:n}=this.calcSymbolsEnabled(t),{strokeWidth:a}=this.getMarkerStyles(t),{strokeWidth:o}=n?this.getLineStyles(t):{strokeWidth:0};let r;const{shape:l}=t.marker;if(this.isCustomMarker(s,l)){const u=new ai;u.shape=l,u.updatePath();const d=u.getBBox();r=Math.max(d.width,d.height)}const c=s?e.size:0,h=n?i.length??25:0;return{markerLength:c,markerStrokeWidth:a,lineLength:h,lineStrokeWidth:o,customMarkerSize:r}}calculateMarkerWidth(){let t=0;return this.itemSelection.each((e,i)=>{const{symbol:s}=i,{markerLength:n,lineLength:a,customMarkerSize:o=-1/0}=this.calcSymbolsLengths(s);t=Math.max(t,a,o,n)}),t}updateMarkerLabel(t,e,i){const{marker:s,paddingX:n}=this.item,{symbol:a}=e;let o=n;const{markerEnabled:r,lineEnabled:l,isCustomMarker:c}=this.calcSymbolsEnabled(a),h=s.padding;(r||l)&&(o+=h+i);const{marker:u,line:d}=t;return u.visible=r,u.visible&&(u.shape=s.shape??a.marker.shape??"square",u.size=s.size,jg(u,this.getMarkerStyles(a))),d.visible=l,d.visible&&jg(d,this.getLineStyles(a)),t.length=i,t.spacing=h,t.isCustomMarker=c,o}truncate(t,e,i,s,n,a){let o=!1;t.length>e&&(t=t.substring(0,e),o=!0);const r=io.getMeasurer({font:n}),l=Dm.truncateLine(t,r,i-s,o);return l.endsWith(ge.EllipsisChar)?this.truncatedItems.add(a):this.truncatedItems.delete(a),l}updatePagination(t,e,i){const s=this.getOrientation(),n=Math.min(this.paginationTrackingIndex,t.length);this.pagination.orientation=s,this.pagination.translationX=0,this.pagination.translationY=0;const{pages:a,maxPageHeight:o,maxPageWidth:r,paginationBBox:l,paginationVertical:c}=this.calculatePagination(t,e,i),h=a.findIndex(v=>v.endIndex>=n);this.pagination.currentPage=It(0,h,a.length-1);const{paddingX:u,paddingY:d}=this.item,p=8,g=r-u,f=o-d;let x=0,m=-l.y-this.item.marker.size/2;c?m+=f+p:(x+=-l.x+g+p,m+=(f-l.height)/2),this.pagination.translationX=x,this.pagination.translationY=m,this.pagination.update(),this.pagination.updateMarkers();let b=0;return this.itemSelection.each((v,S,A)=>{A>(a[b]?.endIndex??1/0)&&b++,v.pageIndex=b}),{maxPageHeight:o,maxPageWidth:r,pages:a}}calculatePagination(t,e,i){const{paddingX:s,paddingY:n}=this.item,a=this.getOrientation(),o=["left","right"].includes(this.position);let r=this.pagination.getBBox(),l=new ht(0,0,0,0),c=[],h=0,u=0,d=0;const p=f=>f.width===r.width&&f.height===r.height,g=this.maxWidth!==void 0&&this.maxHeight!==void 0;do{if(d++>10){et.warn("unable to find stable legend layout.");break}r=l;const f=e-(o?0:r.width),x=i-(o?r.height:0),m=k6({orientation:a,bboxes:t,maxHeight:x,maxWidth:f,itemPaddingY:n,itemPaddingX:s,forceResult:g});c=m?.pages??[],h=m?.maxPageWidth??0,u=m?.maxPageHeight??0;const b=c.length;if(this.pagination.visible=b>1,this.pagination.totalPages=b,this.pagination.update(),this.pagination.updateMarkers(),l=this.pagination.getBBox(),!this.pagination.visible)break}while(!p(l));return{maxPageWidth:h,maxPageHeight:u,pages:c,paginationBBox:l,paginationVertical:o}}updatePositions(t=0){const{item:{paddingY:e},itemSelection:i,pages:s}=this;if(s.length<1||!s[t])return;const{columns:n,startIndex:a,endIndex:o}=s[t];let r=0,l=0;const c=n.length,h=n[0].indices.length,u=this.getOrientation()==="horizontal",d=n[0].bboxes[0].height+e,p=[];i.each((g,f,x)=>{if(xo){g.visible=!1;return}const m=x-a;let b,v;u?(b=m%c,v=Math.floor(m/c)):(b=Math.floor(m/h),v=m%h),g.visible=!0;const S=n[b];S&&(l=Math.floor(d*v),r=Math.floor(p[v]??0),p[v]=(p[v]??0)+S.columnWidth,g.translationX=r,g.translationY=l)})}updatePageNumber(t){const{itemSelection:e,group:i,pagination:s,pages:n,toggleSeries:a}=this,{startIndex:o,endIndex:r}=n[t];o===0?this.paginationTrackingIndex=0:t===n.length-1?this.paginationTrackingIndex=r:this.paginationTrackingIndex=Math.floor((o+r)/2),this.pagination.update(),this.pagination.updateMarkers(),this.updatePositions(t),this.domProxy.onPageChange({itemSelection:e,group:i,pagination:s,interactive:a}),this.ctx.updateService.update(6)}update(){const{label:{color:t}}=this.item;this.itemSelection.each((e,i)=>{e.setEnabled(i.enabled),e.color=t}),this.updateContextMenu()}updateContextMenu(){const{toggleSeries:t,ctx:{contextMenuRegistry:e}}=this;t?(e.hideAction(td),e.hideAction(Px)):(e.showAction(td),e.showAction(Px))}getLineStyles(t){const{stroke:e,strokeOpacity:i=1,strokeWidth:s,lineDash:n}=t.line??{},a=Math.min(2,s??1);return{stroke:e,strokeOpacity:i,strokeWidth:this.item.line.strokeWidth??a,lineDash:n}}getMarkerStyles(t){const{fill:e,stroke:i,strokeOpacity:s=1,fillOpacity:n=1,strokeWidth:a,lineDash:o,lineDashOffset:r}=t.marker,l=Math.min(2,a??1);return{fill:e,stroke:i,strokeOpacity:s,fillOpacity:n,strokeWidth:this.item.marker.strokeWidth??l,lineDash:o,lineDashOffset:r}}computePagedBBox(){const t=yt.computeChildrenBBox(this.group.children());if(this.pages.length>1){const[e,i]=this.maxPageSize;t.height=Math.max(i,t.height),t.width=Math.max(e,t.width)}return t}findNode(t){const{datum:e,proxyButton:i}=this.itemSelection.select(s=>s.datum?.itemId===t.itemId)[0]??{};if(e===void 0||i===void 0)throw new Error(`AG Charts - Missing required properties { datum: ${e}, proxyButton: ${JSON.stringify(i)} }`);return{datum:e,proxyButton:i}}contextToggleVisibility(t){const{datum:e,proxyButton:i}=this.findNode(t);this.doClick(t.event,e,i)}contextToggleOtherSeries(t){this.doDoubleClick(t.event,this.findNode(t).datum)}onContextClick(t,e){const i=e.datum;this.preventHidingAll&&this.contextMenuDatum?.enabled&&this.getVisibleItemCount()<=1?this.ctx.contextMenuRegistry.disableAction(td):this.ctx.contextMenuRegistry.enableAction(td);const{offsetX:s,offsetY:n}=t,{x:a,y:o}=be.toCanvasPoint(e,s,n);this.ctx.contextMenuRegistry.dispatchContext("legend",{sourceEvent:t,canvasX:a,canvasY:o},{legendItem:i})}onClick(t,e,i){this.doClick(t,e,i)&&t.preventDefault()}getVisibleItemCount(){return this.ctx.chartService.series.flatMap(t=>t.getLegendData("category")).filter(t=>t.enabled).length}doClick(t,e,i){const{listeners:{legendItemClick:s},ctx:{chartService:n,highlightManager:a},preventHidingAll:o,toggleSeries:r}=this;if(!e)return!1;const{legendType:l,seriesId:c,itemId:h,enabled:u}=e,d=n.series.find(f=>f.id===c);if(!d)return!1;let p=u;const g=b1("click",h,d.id,t);return s?.(g.apiEvent),g.defaultPrevented||(r&&(p=!u,o&&!p&&this.getVisibleItemCount()<2&&(p=!0),i.setChecked(p),this.ctx.chartEventManager.legendItemClick(l,d,h,p,e.legendItemName)),p?a.updateHighlight(this.id,{series:d,itemId:h,datum:void 0,datumIndex:void 0}):a.updateHighlight(this.id),this.ctx.legendManager.update(),this.ctx.updateService.update(2,{forceNodeDataRefresh:!0,skipAnimations:e.skipAnimations??!1})),!0}onDoubleClick(t,e){this.doDoubleClick(t,e)&&t.preventDefault()}doDoubleClick(t,e){const{listeners:{legendItemDoubleClick:i},ctx:{chartService:s},toggleSeries:n}=this;if(s.mode==="integrated"||!e)return!1;const{legendType:a,id:o,itemId:r,seriesId:l}=e,c=s.series.find(u=>u.id===o);if(!c)return!1;const h=b1("dblclick",r,c.id,t);if(i?.(h.apiEvent),h.defaultPrevented)return!0;if(n){const u=s.series.flatMap(g=>g.getLegendData("category")),d=u.filter(g=>g.enabled).length,p=u.find(g=>g.itemId===r&&g.seriesId===l);this.ctx.chartEventManager.legendItemDoubleClick(a,c,r,p?.enabled??!1,d,p?.legendItemName)}return this.ctx.legendManager.update(),this.ctx.updateService.update(2,{forceNodeDataRefresh:!0}),!0}toTooltipMeta(t,e){let i;if(t instanceof FocusEvent){const{x:a,y:o}=be.toCanvas(e).computeCenter();i={type:"keyboard",canvasX:a,canvasY:o}}else{t.preventDefault();const{x:a,y:o}=be.toCanvasPoint(e,t.offsetX,t.offsetY);i={type:"pointermove",canvasX:a,canvasY:o}}const{canvasX:s,canvasY:n}=i;return{canvasX:s,canvasY:n,lastPointerEvent:i,showArrow:!1}}onHover(t,e){if(!this.enabled)throw new Error("AG Charts - onHover handler called on disabled legend");this.pagination.setPage(e.pageIndex);const i=e.datum,s=i?this.ctx.chartService.series.find(n=>n.id===i?.id):void 0;if(i&&this.truncatedItems.has(i.itemId??i.id)){const n=this.toTooltipMeta(t,e);this.ctx.tooltipManager.updateTooltip(this.id,n,{type:"structured",title:this.getItemLabel(i)})}else this.ctx.tooltipManager.removeTooltip(this.id);i?.enabled&&s?this.updateHighlight({series:s,itemId:i?.itemId,datum:void 0,datumIndex:void 0}):this.updateHighlight()}onLeave(){this.ctx.tooltipManager.removeTooltip(this.id),this.updateHighlight()}updateHighlight(t){this.ctx.interactionManager.isState(32)?this.ctx.highlightManager.updateHighlight(this.id,t):this.ctx.interactionManager.isState(2)&&(this.pendingHighlightDatum=t,this.ctx.animationManager.onBatchStop(()=>{this.ctx.highlightManager.updateHighlight(this.id,this.pendingHighlightDatum)}))}onLocaleChanged(){this.domProxy.onLocaleChanged(this.ctx.localeManager,this.itemSelection,this)}positionLegend(t){const e=this.positionLegendScene(t);this.positionLegendDOM(e)}positionLegendScene(t){if(!this.enabled||!this.data.length)return;const{layoutBox:e}=t,{x:i,y:s,width:n,height:a}=e,[o,r]=this.calculateLegendDimensions(e),{oldPages:l}=this.calcLayout(o,r),c=this.computePagedBBox(),h=()=>{switch(this.position){case"top":case"left":return 0;case"bottom":return a-c.height;case"right":default:return n-c.width}};if(this.visible){const u=this.spacing;let d,p;switch(this.position){case"top":case"bottom":d=(n-c.width)/2,p=h(),e.shrink(c.height+u,this.position);break;case"left":case"right":default:d=h(),p=(a-c.height)/2,e.shrink(c.width+u,this.position)}this.group.translationX=Math.floor(i+d-c.x),this.group.translationY=Math.floor(s+p-c.y)}return l}positionLegendDOM(t){const{ctx:e,itemSelection:i,pagination:s,pages:n,toggleSeries:a,group:o,listeners:{legendItemClick:r,legendItemDoubleClick:l}}=this,c=this.visible&&this.enabled,h=a||l!=null||r!=null;this.domProxy.update({visible:c,interactive:h,ctx:e,itemSelection:i,group:o,pagination:s,oldPages:t,newPages:n,datumReader:this,itemListener:this})}calculateLegendDimensions(t){const{width:e,height:i}=t,s=e/i,n=.5,a=.2,o=.25;let r,l;switch(this.position){case"top":case"bottom":{const c=s<1?Math.min(n,a*(1/s)):a;r=this.maxWidth?Math.min(this.maxWidth,e):e,l=this.maxHeight?Math.min(this.maxHeight,i):Math.round(i*c);break}case"left":case"right":default:{const c=s>1?Math.min(n,o*s):o;r=this.maxWidth?Math.min(this.maxWidth,e):Math.round(e*c),l=this.maxHeight?Math.min(this.maxHeight,i):i}}return[r,l]}},Ls.className="Legend",M([k(pt)],Ls.prototype,"toggleSeries",2),M([k(lt)],Ls.prototype,"pagination",2),M([k(lt)],Ls.prototype,"item",2),M([k(lt)],Ls.prototype,"listeners",2),M([tl((t,e,i)=>{if(t.updateGroupVisibility(),e===i)return;const{ctx:{legendManager:s,stateManager:n}}=t;i===!1&&e===!0&&n.restoreState(s)}),k(pt)],Ls.prototype,"enabled",2),M([k(um)],Ls.prototype,"position",2),M([k(st,{optional:!0})],Ls.prototype,"maxWidth",2),M([k(st,{optional:!0})],Ls.prototype,"maxHeight",2),M([k(pt,{optional:!0})],Ls.prototype,"reverseOrder",2),M([k(ie(["horizontal","vertical"],"an orientation"),{optional:!0})],Ls.prototype,"orientation",2),M([k(pt,{optional:!0})],Ls.prototype,"preventHidingAll",2),M([k(st)],Ls.prototype,"spacing",2)}}),v1,F6=I({"packages/ag-charts-community/src/chart/legend/legendModule.ts"(){"use strict";z6(),v1={type:"legend",optionsKey:"legend",identifier:"category",chartTypes:["cartesian","polar","hierarchy","topology","flow-proportion","standalone","gauge"],moduleFactory:t=>new Ls(t),packageType:"community",removable:"standalone-only"}}}),M1={};sn(M1,{CARTESIAN_AXIS_TYPE:()=>qA,CARTESIAN_POSITION:()=>QA,FONT_SIZE:()=>ZA,FONT_SIZE_RATIO:()=>Bx,POLAR_AXIS_SHAPE:()=>tD,POLAR_AXIS_TYPE:()=>JA});var ZA,Bx,QA,qA,JA,tD,I1=I({"packages/ag-charts-community/src/chart/themes/constants.ts"(){"use strict";ZA=(t=>(t[t.SMALLEST=8]="SMALLEST",t[t.SMALLER=10]="SMALLER",t[t.SMALL=12]="SMALL",t[t.MEDIUM=13]="MEDIUM",t[t.LARGE=14]="LARGE",t[t.LARGEST=17]="LARGEST",t))(ZA||{}),Bx=(t=>(t[t.SMALLEST=.6666666666666666]="SMALLEST",t[t.SMALLER=.8333333333333334]="SMALLER",t[t.SMALL=1]="SMALL",t[t.MEDIUM=1.0833333333333333]="MEDIUM",t[t.LARGE=1.1666666666666667]="LARGE",t[t.LARGEST=1.4166666666666667]="LARGEST",t))(Bx||{}),QA=(t=>(t.TOP="top",t.RIGHT="right",t.BOTTOM="bottom",t.LEFT="left",t))(QA||{}),qA=(t=>(t.CATEGORY="category",t.GROUPED_CATEGORY="grouped-category",t.ORDINAL_TIME="ordinal-time",t.NUMBER="number",t.TIME="time",t.LOG="log",t))(qA||{}),JA=(t=>(t.ANGLE_CATEGORY="angle-category",t.ANGLE_NUMBER="angle-number",t.RADIUS_CATEGORY="radius-category",t.RADIUS_NUMBER="radius-number",t))(JA||{}),tD=(t=>(t.CIRCLE="circle",t.POLYGON="polygon",t))(tD||{})}}),eD={};sn(eD,{DEFAULT_ANNOTATION_HANDLE_FILL:()=>od,DEFAULT_ANNOTATION_STATISTICS_COLOR:()=>cd,DEFAULT_ANNOTATION_STATISTICS_DIVIDER_STROKE:()=>hd,DEFAULT_ANNOTATION_STATISTICS_DOWN_FILL:()=>ud,DEFAULT_ANNOTATION_STATISTICS_DOWN_STROKE:()=>dd,DEFAULT_ANNOTATION_STATISTICS_FILL:()=>rd,DEFAULT_ANNOTATION_STATISTICS_STROKE:()=>ld,DEFAULT_BACKGROUND_COLOUR:()=>Vg,DEFAULT_CAPTION_ALIGNMENT:()=>dr,DEFAULT_CAPTION_LAYOUT_STYLE:()=>ur,DEFAULT_COLOR_RANGE:()=>Kg,DEFAULT_DIVERGING_SERIES_COLOR_RANGE:()=>Ts,DEFAULT_FIBONACCI_STROKES:()=>nd,DEFAULT_FINANCIAL_CHARTS_ANNOTATION_BACKGROUND_FILL:()=>Ge,DEFAULT_FINANCIAL_CHARTS_ANNOTATION_COLOR:()=>ve,DEFAULT_FUNNEL_SERIES_COLOR_RANGE:()=>Ma,DEFAULT_GAUGE_SERIES_COLOR_RANGE:()=>dn,DEFAULT_GRIDLINE_ENABLED:()=>Ia,DEFAULT_HIERARCHY_FILLS:()=>Xg,DEFAULT_HIERARCHY_STROKES:()=>Zg,DEFAULT_POLAR_SERIES_STROKE:()=>Yg,DEFAULT_SEPARATION_LINES_COLOUR:()=>ed,DEFAULT_SHADOW_COLOUR:()=>hr,DEFAULT_SPARKLINE_CROSSHAIR_STROKE:()=>$g,DEFAULT_TEXTBOX_COLOR:()=>fd,DEFAULT_TEXTBOX_FILL:()=>pd,DEFAULT_TEXTBOX_STROKE:()=>gd,DEFAULT_TEXT_ANNOTATION_COLOR:()=>ad,DEFAULT_TOOLBAR_POSITION:()=>yd,IS_COMMUNITY:()=>zx,IS_DARK_THEME:()=>ih,IS_ENTERPRISE:()=>Fx,PALETTE_ALT_DOWN_FILL:()=>Wx,PALETTE_ALT_DOWN_STROKE:()=>Vx,PALETTE_ALT_NEUTRAL_FILL:()=>Ux,PALETTE_ALT_NEUTRAL_STROKE:()=>Hg,PALETTE_ALT_UP_FILL:()=>Gx,PALETTE_ALT_UP_STROKE:()=>jx,PALETTE_DOWN_FILL:()=>sd,PALETTE_DOWN_STROKE:()=>Wg,PALETTE_NEUTRAL_FILL:()=>Ug,PALETTE_NEUTRAL_STROKE:()=>sh,PALETTE_UP_FILL:()=>id,PALETTE_UP_STROKE:()=>Gg});var ih,zx,Fx,ed,Vg,hr,ur,dr,Gg,Wg,id,sd,sh,Ug,jx,Vx,Gx,Wx,Ux,Hg,Yg,Ts,Kg,$g,dn,Ma,Xg,Zg,ve,nd,ad,Ge,od,rd,ld,cd,hd,ud,dd,pd,gd,fd,yd,Ia,ke=I({"packages/ag-charts-community/src/chart/themes/symbols.ts"(){"use strict";ih=Symbol("is-dark-theme"),zx=Symbol("is-community"),Fx=Symbol("is-enterprise"),ed=Symbol("default-separation-lines-colour"),Vg=Symbol("default-background-colour"),hr=Symbol("default-shadow-colour"),ur=Symbol("default-caption-layout-style"),dr=Symbol("default-caption-alignment"),Gg=Symbol("palette-up-stroke"),Wg=Symbol("palette-down-stroke"),id=Symbol("palette-up-fill"),sd=Symbol("palette-down-fill"),sh=Symbol("palette-neutral-stroke"),Ug=Symbol("palette-neutral-fill"),jx=Symbol("palette-alt-up-stroke"),Vx=Symbol("palette-alt-down-stroke"),Gx=Symbol("palette-alt-up-fill"),Wx=Symbol("palette-alt-down-fill"),Ux=Symbol("palette-gray-fill"),Hg=Symbol("palette-gray-stroke"),Yg=Symbol("default-polar-series-stroke"),Ts=Symbol("default-diverging-series-colour-range"),Kg=Symbol("default-colour-range"),$g=Symbol("default-sparkline-crosshair-stroke"),dn=Symbol("default-gauge-series-colour-range"),Ma=Symbol("default-funnel-series-colour-range"),Xg=Symbol("default-hierarchy-fills"),Zg=Symbol("default-hierarchy-strokes"),ve=Symbol("default-financial-charts-annotation-stroke"),nd=Symbol("default-hierarchy-strokes"),ad=Symbol("default-text-annotation-color"),Ge=Symbol("default-financial-charts-annotation-background-fill"),od=Symbol("default-annotation-handle-fill"),rd=Symbol("default-annotation-statistics-fill"),ld=Symbol("default-annotation-statistics-stroke"),cd=Symbol("default-annotation-statistics-color"),hd=Symbol("default-annotation-statistics-divider-stroke"),ud=Symbol("default-annotation-statistics-fill"),dd=Symbol("default-annotation-statistics-stroke"),pd=Symbol("default-textbox-fill"),gd=Symbol("default-textbox-stroke"),fd=Symbol("default-textbox-color"),yd=Symbol("default-toolbar-position"),Ia=Symbol("default-gridline-enabled")}});function A1(t,e){return i=>e(i)?[{...t[0],position:t[1].position},{...t[1],position:t[0].position}]:t}function Qg({takeColors:t}){const{fills:[e],strokes:[i]}=t(1);return{fill:e,stroke:i}}function iD(t){return{marker:Qg(t)}}var md=I({"packages/ag-charts-community/src/chart/themes/util.ts"(){"use strict"}});function Hx(t,e,i,s,n){const{addPhaseFn:a,updatePhaseFn:o,removePhaseFn:r}=n,l=(c,h,u)=>{i.animate({id:`${t}_${e}_${h.id}_${c}`,groupId:t,from:0,to:1,ease:gu,collapsable:!1,onUpdate(d,p){p&&c!=="removed"||(h.path.clear(!0),u(d,h),h.checkPathDirty())},onStop(){c==="added"&&(h.path.clear(!0),u(1,h),h.checkPathDirty())},phase:_n[c]})};for(const c of s)i.isSkipped()||(l("removed",c,r),l("updated",c,o)),l("added",c,a)}var sD=I({"packages/ag-charts-community/src/motion/pathMotion.ts"(){"use strict";fu(),wi()}});function Ht({id:t},e,i,...s){Ho(t,e,i,s,{opacity:0},{opacity:1},{phase:"trailing"})}function gl({id:t},e,i,...s){Ho(t,e,i,s,{opacity:1},{opacity:0},{phase:"remove"})}function pr(t){return{opacity:1}}var gr=I({"packages/ag-charts-community/src/chart/series/seriesLabelUtil.ts"(){"use strict";wi()}}),Hn,xd=I({"packages/ag-charts-community/src/scene/dropShadow.ts"(){"use strict";mt(),nn(),XA(),Hn=class extends Ox{constructor(){super(...arguments),this.enabled=!0,this.color="rgba(0, 0, 0, 0.5)",this.xOffset=0,this.yOffset=0,this.blur=5}},M([k(pt),ct()],Hn.prototype,"enabled",2),M([k(jt),ct()],Hn.prototype,"color",2),M([k(_t),ct()],Hn.prototype,"xOffset",2),M([k(_t),ct()],Hn.prototype,"yOffset",2),M([k(st),ct()],Hn.prototype,"blur",2)}}),nD,Bi,fr=I({"packages/ag-charts-community/src/chart/series/seriesTooltip.ts"(){"use strict";Qt(),mt(),Lg(),nD=class extends bt{constructor(){super(...arguments),this.enabled=!1}},M([k(pt)],nD.prototype,"enabled",2),Bi=class extends bt{constructor(){super(...arguments),this.enabled=!0,this.interaction=new nD,this.position=new Xc,this.range=void 0,this.class=void 0}formatTooltip(t,e){const i=this.renderer?.(e);return typeof i=="string"?{type:"raw",rawHtmlString:i}:i!=null?{type:"structured",...t,...i}:{type:"structured",...t}}},M([k(pt)],Bi.prototype,"enabled",2),M([k(pt,{optional:!0})],Bi.prototype,"showArrow",2),M([k(ts,{optional:!0})],Bi.prototype,"renderer",2),M([k(lt)],Bi.prototype,"interaction",2),M([k(lt)],Bi.prototype,"position",2),M([k(qp,{optional:!0})],Bi.prototype,"range",2),M([k(tt,{optional:!0})],Bi.prototype,"class",2)}}),aD,oD,nh,rD=I({"packages/ag-charts-community/src/chart/series/cartesian/interpolationProperties.ts"(){"use strict";Qt(),mt(),aD=ie(["linear","smooth","step"],"a line style"),oD=ie(["start","middle","end"]),nh=class extends bt{constructor(){super(...arguments),this.type="linear",this.tension=1,this.position="end"}},M([k(aD)],nh.prototype,"type",2),M([k(Ut)],nh.prototype,"tension",2),M([k(oD)],nh.prototype,"position",2)}}),Ee,j6=I({"packages/ag-charts-community/src/chart/series/cartesian/areaSeriesProperties.ts"(){"use strict";xd(),mt(),zn(),Ju(),fr(),Us(),rD(),Ee=class extends ho{constructor(){super(...arguments),this.xName=void 0,this.defaultColorRange=[],this.fill="#c16068",this.fillOpacity=1,this.stroke="#874349",this.strokeWidth=2,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.interpolation=new nh,this.shadow=new Hn,this.marker=new Pi,this.label=new ii,this.tooltip=new Bi,this.connectMissingData=!1}},M([k(tt)],Ee.prototype,"xKey",2),M([k(tt,{optional:!0})],Ee.prototype,"xName",2),M([k(tt)],Ee.prototype,"yKey",2),M([k(tt,{optional:!0})],Ee.prototype,"yName",2),M([k(tt,{optional:!0})],Ee.prototype,"yFilterKey",2),M([k(st,{optional:!0})],Ee.prototype,"normalizedTo",2),M([k(Bs)],Ee.prototype,"defaultColorRange",2),M([k(Ko(o0,jt))],Ee.prototype,"fill",2),M([k(Ut)],Ee.prototype,"fillOpacity",2),M([k(jt)],Ee.prototype,"stroke",2),M([k(st)],Ee.prototype,"strokeWidth",2),M([k(Ut)],Ee.prototype,"strokeOpacity",2),M([k(ua)],Ee.prototype,"lineDash",2),M([k(st)],Ee.prototype,"lineDashOffset",2),M([k(lt)],Ee.prototype,"interpolation",2),M([k(lt)],Ee.prototype,"shadow",2),M([k(lt)],Ee.prototype,"marker",2),M([k(lt)],Ee.prototype,"label",2),M([k(lt)],Ee.prototype,"tooltip",2),M([k(pt)],Ee.prototype,"connectMissingData",2)}});function fo(t){switch(t.type){case"linear":case"step":return[{x:t.x0,y:t.y0},{x:t.x1,y:t.y1}];case"cubic":return[{x:t.cp0x,y:t.cp0y},{x:t.cp3x,y:t.cp3y}]}}function V6(t){const e=fo(t);return e[0].x>e[1].x&&e.reverse(),e}function G6(t,e){const{x:i,y:s}=e;switch(t.type){case"linear":return{type:"linear",moveTo:t.moveTo,x0:i,y0:s,x1:i,y1:s};case"step":return{type:"step",moveTo:t.moveTo,x0:i,y0:s,x1:i,y1:s,stepX:i};case"cubic":return{type:"cubic",moveTo:t.moveTo,cp0x:i,cp0y:s,cp1x:i,cp1y:s,cp2x:i,cp2y:s,cp3x:i,cp3y:s}}}function qg(t,e,i){const[s,n]=fo(t),a=n.x!==s.x?(i.x-e.x)/(n.x-s.x):0,o=n.y!==s.y?(i.y-e.y)/(n.y-s.y):0;switch(t.type){case"linear":return{type:"linear",moveTo:t.moveTo,x0:e.x,y0:e.y,x1:i.x,y1:i.y};case"cubic":return{type:"cubic",moveTo:t.moveTo,cp0x:e.x,cp0y:e.y,cp1x:i.x-(t.cp2x-s.x)*a,cp1y:i.y-(t.cp2y-s.y)*o,cp2x:i.x-(t.cp1x-s.x)*a,cp2y:i.y-(t.cp1y-s.y)*o,cp3x:i.x,cp3y:i.y};case"step":return{type:"step",moveTo:t.moveTo,x0:e.x,y0:e.y,x1:i.x,y1:i.y,stepX:i.x-(t.stepX-s.x)*a}}}function D1(t,e,i){const{moveTo:s}=t,[n,a]=V6(t),{x:o,y:r}=n,{x:l,y:c}=a;if(il)return qg(t,a,a);switch(t.type){case"linear":{const h=r===c?void 0:(c-r)/(l-o),u=h==null?r:h*(e-o)+r,d=h==null?r:h*(i-o)+r;return{type:"linear",moveTo:s,x0:e,y0:u,x1:i,y1:d}}case"step":if(i<=t.stepX){const h=t.y0;return{type:"step",moveTo:s,x0:e,y0:h,x1:i,y1:h,stepX:i}}else if(e>=t.stepX){const h=t.y1;return{type:"step",moveTo:s,x0:e,y0:h,x1:i,y1:h,stepX:e}}else{const{y0:h,y1:u,stepX:d}=t;return{type:"step",moveTo:s,x0:e,y0:h,x1:i,y1:u,stepX:d}}case"cubic":{const h=yx(t.cp0x,t.cp1x,t.cp2x,t.cp3x,e);let[u,d]=mx(t.cp0x,t.cp0y,t.cp1x,t.cp1y,t.cp2x,t.cp2y,t.cp3x,t.cp3y,h);const p=yx(d[0].x,d[1].x,d[2].x,d[3].x,i);return[d,u]=mx(d[0].x,d[0].y,d[1].x,d[1].y,d[2].x,d[2].y,d[3].x,d[3].y,p),{type:"cubic",moveTo:s,cp0x:d[0].x,cp0y:d[0].y,cp1x:d[1].x,cp1y:d[1].y,cp2x:d[2].x,cp2y:d[2].y,cp3x:d[3].x,cp3y:d[3].y}}}}function W6(t){const e=[];let i=0,s=NaN,n=NaN;for(const{x:a,y:o}of t){if(i>0){const r=i===1;e.push({type:"linear",moveTo:r,x0:s,y0:n,x1:a,y1:o})}i+=1,s=a,n=o}return e}function U6(t,e){const i=[];let s=0,n=NaN,a=NaN;const o=typeof e=="number"?e:k1[e];for(const{x:r,y:l}of t){if(s>0){const c=s===1,h=n+(r-n)*o;i.push({type:"step",moveTo:c,x0:n,y0:a,x1:r,y1:l,stepX:h})}s+=1,n=r,a=l}return i}function H6(t,e){const i=Array.isArray(t)?t:Array.from(t);if(i.length<=1)return[];const s=i.map((a,o)=>{const r=o===0?a:i[o-1],l=o===i.length-1?a:i[o+1],c=o===0||o===i.length-1;if(Math.sign(r.y-a.y)===Math.sign(l.y-a.y))return 0;if(!c){const h=Math.abs(r.y-l.y),u=Math.abs(a.y-r.y)/h,d=Math.abs(a.y-l.y)/h;if(u<=Jg||1-u<=Jg||d<=Jg||1-d<=Jg)return 0}return(l.y-r.y)/(l.x-r.x)});s[1]===0&&(s[0]*=2),s[s.length-2]===0&&(s[s.length-1]*=2);const n=[];for(let a=1;aMath.abs(u)&&(d*=Math.abs(u/p),p=Math.sign(p)*Math.abs(u)),r===0&&Math.abs(f)>Math.abs(u)&&(g*=Math.abs(u/f),f=Math.sign(f)*Math.abs(u)),n.push({type:"cubic",moveTo:a===1,cp0x:o.x,cp0y:o.y,cp1x:o.x+d,cp1y:o.y+p,cp2x:l.x-g,cp2y:l.y-f,cp3x:l.x,cp3y:l.y})}return n}var k1,Jg,lD=I({"packages/ag-charts-community/src/chart/series/cartesian/lineInterpolation.ts"(){"use strict";xx(),k1={start:0,middle:.5,end:1},Jg=.05}});function oi(t,e,i){return(e-t)*i+t}function Y6(t,e){const{x0:i,y0:s,x1:n,y1:a}=t,r=(a-s)/(n-i)*(e-i)+s;return{leftCp1x:i,leftCp1y:s,leftCp2x:e,leftCp2y:r,stepX:e,stepY0:r,stepY1:r,rightCp1x:e,rightCp1y:r,rightCp2x:n,rightCp2y:a}}function K6(t,e){const{cp0x:i,cp0y:s,cp1x:n,cp1y:a,cp2x:o,cp2y:r,cp3x:l,cp3y:c}=t,h=yx(i,n,o,l,e),[u,d]=mx(i,s,n,a,o,r,l,c,h),p=u[3].y;return{leftCp1x:u[1].x,leftCp1y:u[1].y,leftCp2x:u[2].x,leftCp2y:u[2].y,stepX:e,stepY0:p,stepY1:p,rightCp1x:d[1].x,rightCp1y:d[1].y,rightCp2x:d[2].x,rightCp2y:d[2].y}}function $6(t){const{x0:e,y0:i,x1:s,y1:n,stepX:a}=t;return{leftCp1x:(e+a)/2,leftCp1y:i,leftCp2x:(e+a)/2,leftCp2y:i,stepX:a,stepY0:i,stepY1:n,rightCp1x:(a+s)/2,rightCp1y:n,rightCp2x:(a+s)/2,rightCp2y:n}}function L1(t,e){return t.type==="linear"?Y6(t,e):t.type==="cubic"?K6(t,e):$6(t)}function T1(t,e,i,s,n,a,o){switch(e){case 0:o?t.moveTo(n,a):t.moveTo(i,s);break;case 1:o?t.lineTo(n,a):t.lineTo(i,s);break}}function C1(t,e,i,s,n,a){a?t.lineTo(e,i):t.lineTo(s,n)}function N1(t,e,i,s,n,a,o,r,l,c){c?t.cubicCurveTo(a,o,s,n,e,i):t.cubicCurveTo(s,n,a,o,r,l)}function O1(t,e,i,s,n,a,o){o?(t.lineTo(a,n),t.lineTo(a,i),t.lineTo(e,i)):(t.lineTo(a,i),t.lineTo(a,n),t.lineTo(s,n))}function cD(t,e,i,s){const[n,a]=fo(e);switch(T1(t,i,n.x,n.y,a.x,a.y,s),e.type){case"linear":C1(t,e.x0,e.y0,e.x1,e.y1,s);break;case"cubic":N1(t,e.cp0x,e.cp0y,e.cp1x,e.cp1y,e.cp2x,e.cp2y,e.cp3x,e.cp3y,s);break;case"step":O1(t,e.x0,e.y0,e.x1,e.y1,e.stepX,s);break}}function w1(t,e,i){const[s,n]=fo(t),[a,o]=fo(e),r=oi(s.x,a.x,i),l=oi(s.y,a.y,i),c=oi(n.x,o.x,i),h=oi(n.y,o.y,i);return[{x:r,y:l},{x:c,y:h}]}function hD(t,e,i,s,n,a){const[{x:o,y:r},{x:l,y:c}]=w1(e,i,s);if(T1(t,n,o,r,l,c,a),e.type==="cubic"&&i.type==="cubic"){const h=oi(e.cp1x,i.cp1x,s),u=oi(e.cp1y,i.cp1y,s),d=oi(e.cp2x,i.cp2x,s),p=oi(e.cp2y,i.cp2y,s);N1(t,o,r,h,u,d,p,l,c,a)}else if(e.type==="step"&&i.type==="step"){const h=oi(e.stepX,i.stepX,s);O1(t,o,r,l,c,h,a)}else if(e.type==="linear"&&i.type==="linear")C1(t,o,r,l,c,a);else{let h;e.type==="step"?h=e.stepX:i.type==="step"?h=i.stepX:h=(o+l)/2;const u=L1(e,h),d=L1(i,h),p=oi(u.leftCp1x,d.leftCp1x,s),g=oi(u.leftCp1y,d.leftCp1y,s),f=oi(u.leftCp2x,d.leftCp2x,s),x=oi(u.leftCp2y,d.leftCp2y,s),m=oi(u.stepX,d.stepX,s),b=oi(u.stepY0,d.stepY0,s),v=oi(u.stepY1,d.stepY1,s),S=oi(u.rightCp1x,d.rightCp1x,s),A=oi(u.rightCp1y,d.rightCp1y,s),T=oi(u.rightCp2x,d.rightCp2x,s),D=oi(u.rightCp2y,d.rightCp2y,s);a?(t.cubicCurveTo(T,D,S,A,m,v),t.lineTo(m,b),t.cubicCurveTo(f,x,p,g,o,r)):(t.cubicCurveTo(p,g,f,x,m,b),t.lineTo(m,v),t.cubicCurveTo(S,A,T,D,l,c))}}var E1=I({"packages/ag-charts-community/src/chart/series/cartesian/lineInterpolationPlotting.ts"(){"use strict";xx(),lD()}});function X6(t,e){return t==null||e==null||typeof t!="object"||typeof e!="object"?!1:"id"in t&&"id"in e?t.id===e.id:t.toString()===e.toString()}function as(t,e){if(!e)return NaN;if(t instanceof Date&&(t=t.getTime()),e.type==="continuous"&&typeof t=="number")return(t-e.domain[0])/(e.domain[1]-e.domain[0])*(e.range[1]-e.range[0])+e.range[0];if(e.type==="log"&&typeof t=="number")return e.convert(t);if(e.type!=="category")return NaN;const i=e.domain.findIndex(n=>n===t);return i>=0||e.domain.findIndex(n=>X6(t,n))>=0?e.inset+e.step*i:NaN}function Yn(t){return z0(t).valueOf()}function R1({data:t},e){return t.map((i,s)=>({xValue0Index:e.indexOf(Yn(i.xValue0)),xValue1Index:e.indexOf(Yn(i.xValue1)),datumIndex:s}))}function Z6(t,e){const i=e.scales.x,s=t.scales.x;if(i?.type!=="category"||s?.type!=="category")return!0;let n=-1/0;for(const a of i.domain){const o=as(a,s);if(Number.isFinite(o)){if(o({axisValue:h,value:u}));s.sort((h,u)=>as(h.value,t.scales.x)-as(u.value,t.scales.x));const n=[];for(const{xValue0:h,xValue1:u}of e.data){const d=Yn(h),p=Yn(u);i.has(d)||(i.set(d,h),n.push({axisValue:d,value:h})),i.has(p)||(i.set(p,u),n.push({axisValue:p,value:u}))}n.sort((h,u)=>as(h.value,e.scales.x)-as(u.value,e.scales.x));const a=s;let o=0;for(const h of n){for(let u=a.length-1;u>o;u-=1){const d=as(h.value,e.scales.x),p=as(a[u].value,e.scales.x);if(d>p){o=u+1;break}}a.splice(o,0,h),o+=1}if(!Q6(a,e))return;const r=a.map(h=>h.axisValue),l=R1(e,r),c=R1(t,r);return{axisValues:r,oldDataAxisIndices:l,newDataAxisIndices:c}}function _1(t,e,i){if(i.xValue1Index===i.xValue0Index+1)return t;const s=fo(t),n=(s[1].x-s[0].x)/(i.xValue1Index-i.xValue0Index),a=s[0].x+(e-i.xValue0Index)*n,o=a+n;return D1(t,a,o)}function P1(t,e){const[i,s]=fo(t),n=as(0,e.scales.y);return qg(t,{x:i.x,y:n},{x:s.x,y:n})}function B1(t){const[e,i]=fo(t);return G6(t,{x:(e.x+i.x)/2,y:(e.y+i.y)/2})}function z1(t,e,i,s,n,a){let o,r;if(n.xValue0Index>=a.xValue1Index){const u=s.findLast(p=>p.xValue1Index<=a.xValue1Index)?.datumIndex,d=u!=null?i.data[u]:void 0;o=d?.xValue1,r=d?.yValue1}else if(n.xValue0Index<=a.xValue0Index){const u=s.find(p=>p.xValue0Index>=a.xValue0Index)?.datumIndex,d=u!=null?i.data[u]:void 0;o=d?.xValue0,r=d?.yValue0}if(o==null||r==null)switch(e){case 0:return P1(t,i);case 1:return B1(t)}const l=as(o,i.scales.x),c=as(r,i.scales.y),h={x:l,y:c};return qg(t,h,h)}function uD(t,e){if(e==null)return;const i=Yn(t.xValue0),s=Yn(t.xValue1);return e.find(n=>Yn(n.xValue0)===i&&Yn(n.xValue1)===s)?.span}function F1(t,e,i,s,n,a,o){const r=t.data[s.datumIndex],l=r.span,c=uD(r,n);if(c!=null)o.removed.push({from:c,to:c}),o.moved.push({from:c,to:l}),o.added.push({from:l,to:l});else{const h=z1(l,e,t,i,s,a);o.added.push({from:h,to:l})}}function j1(t,e,i,s,n,a,o){const r=t.data[s.datumIndex],l=r.span,c=uD(r,n);if(c!=null)o.removed.push({from:l,to:l}),o.moved.push({from:l,to:c}),o.added.push({from:c,to:c});else{const h=z1(l,e,t,i,s,a);o.removed.push({from:l,to:h})}}function V1(t,e,i,s,n){const a=e[n.xValue0Index],o=i.data.find(x=>Yn(x.xValue0)===a),r=e[n.xValue1Index],l=i.data.find(x=>Yn(x.xValue1)===r);if(o==null||l==null)return;const[{x:c},{x:h}]=fo(t),u=as(o.xValue0,i.scales.x),d=as(o.yValue0,i.scales.y),p=as(l.xValue1,i.scales.x),g=as(l.yValue1,i.scales.y);let f=s.data[n.datumIndex].span;return f=qg(f,{x:u,y:d},{x:p,y:g}),f=D1(f,c,h),f}function J6(t,e,i,s,n,a,o,r,l){const c=n+1,h=o.find(v=>v.xValue0Index<=n&&v.xValue1Index>=c),u=a.find(v=>v.xValue0Index<=n&&v.xValue1Index>=c),d=e.zeroData,p=t.zeroData;if(h==null&&u!=null){F1(t,i,a,u,d,r,l);return}else if(h!=null&&u==null){j1(e,i,o,h,p,r,l);return}else if(h==null||u==null)return;let g;h.xValue0Index===u.xValue0Index&&h.xValue1Index===u.xValue1Index?g=0:h.xValue0Index<=u.xValue0Index&&h.xValue1Index>=u.xValue1Index?g=-1:h.xValue0Index>=u.xValue0Index&&h.xValue1Index<=u.xValue1Index?g=1:g=0;const f=e.data[h.datumIndex],x=_1(f.span,n,h),m=t.data[u.datumIndex],b=_1(m.span,n,u);if(g===1){const v=V1(x,s,e,t,u);v!=null?(l.removed.push({from:x,to:v}),l.moved.push({from:v,to:b}),l.added.push({from:b,to:b})):j1(e,i,o,h,p,r,l)}else if(g===-1){const v=V1(b,s,t,e,h);v!=null?(l.removed.push({from:x,to:x}),l.moved.push({from:x,to:v}),l.added.push({from:v,to:b})):F1(t,i,a,u,d,r,l)}else l.removed.push({from:x,to:x}),l.moved.push({from:x,to:b}),l.added.push({from:b,to:b})}function tX(t,e,i,s){const n={removed:[],moved:[],added:[]},{axisValues:a,oldDataAxisIndices:o,newDataAxisIndices:r}=t,l={xValue0Index:Math.max(o.at(0)?.xValue0Index??-1/0,r.at(0)?.xValue0Index??-1/0),xValue1Index:Math.min(o.at(-1)?.xValue1Index??1/0,r.at(-1)?.xValue1Index??1/0)};for(let c=0;c(t[t.Zero=0]="Zero",t[t.Split=1]="Split",t))(dD||{})}});function W1(t){return t.type==="continuous"||t.type==="log"}function U1(t){return t.type==="category"}function bd(t,e){return t===void 0||e===void 0?t!==void 0||e!==void 0:W1(t)&&W1(e)?t.type===e.type&&$a(t.domain,e.domain)&&$a(t.range,e.range):U1(t)&&U1(e)?t.inset===e.inset&&t.step===e.step&&$a(t.domain,e.domain):!1}function ef(t){return t==null?!1:t.type==="category"?t.domain.every(e=>e!=null):t.domain.every(e=>Number.isFinite(e)||e instanceof Date)&&t.range.every(e=>Number.isFinite(e))}var Yx=I({"packages/ag-charts-community/src/chart/series/cartesian/scaling.ts"(){"use strict";ot()}});function Kx(t,e){let i;const s=t.map(n=>n.point);switch(e.type){case"linear":i=W6(s);break;case"smooth":i=H6(s,e.tension);break;case"step":i=U6(s,e.position);break}return i.map((n,a)=>({span:n,xValue0:t[a].xDatum,yValue0:t[a].yDatum,xValue1:t[a+1].xDatum,yValue1:t[a+1].yDatum}))}function H1(t,e,i=.001){return Math.abs(t.x-e.x)$x(r,l,e.removed),n=(r,l)=>$x(r,l,e.moved),a=(r,l)=>$x(r,l,e.added),o=yD(t,i);return{status:t,path:{addPhaseFn:a,updatePhaseFn:n,removePhaseFn:s},pathProperties:o}}function yD(t,e){const i=e==="none"?"updated":t,s={fromFn:n=>{let a;return t==="removed"?a={finish:{visible:!1}}:t==="added"?a={start:{visible:!0}}:a={},{phase:_n[i],...a}},toFn:n=>({phase:_n[i]})};return e==="fade"?{fromFn:n=>({opacity:t==="added"?0:n.opacity,...s.fromFn(n)}),toFn:n=>({opacity:t==="removed"?0:1,...s.toFn(n)})}:s}function Y1(t,e,i){const s=t.scales.x?.type==="category",n=e.scales.x?.type==="category";if(s!==n||!ef(t.scales.x)||!ef(e.scales.x)||t.strokeData==null||e.strokeData==null)return;let a="updated";e.visible&&!t.visible?a="removed":!e.visible&&t.visible&&(a="added");const o=tf({scales:t.scales,data:t.strokeData.spans},{scales:e.scales,data:e.strokeData.spans},1);if(o==null)return;const r=fD(a,o,"fade"),l=(i?.changed??!0)||!bd(t.scales.x,e.scales.x)||!bd(t.scales.y,e.scales.y)||a!=="updated";return{status:a,stroke:r,hasMotion:l}}var Xx=I({"packages/ag-charts-community/src/chart/series/cartesian/lineUtil.ts"(){"use strict";wi(),lD(),E1(),pD(),Yx()}});function K1({path:t},{spans:e,phantomSpans:i}){for(let s=0;sZx(l,c,e.removed,i.removed),a=(l,c)=>Zx(l,c,e.moved,i.moved),o=(l,c)=>Zx(l,c,e.added,i.added),r=yD(t,s);return{status:t,path:{addPhaseFn:o,updatePhaseFn:a,removePhaseFn:n},pathProperties:r}}function X1(t,e){const i=t.scales.x?.type==="category",s=e.scales.x?.type==="category";if(i!==s||!ef(t.scales.x)||!ef(e.scales.x))return;let n="updated";e.visible&&!t.visible?n="removed":!e.visible&&t.visible&&(n="added");const a=tf({scales:t.scales,data:t.fillData.spans},{scales:e.scales,data:e.fillData.spans},0);if(a==null)return;const o=tf({scales:t.scales,data:t.fillData.phantomSpans},{scales:e.scales,data:e.fillData.phantomSpans},0);if(o==null)return;const r=tf({scales:t.scales,data:t.strokeData.spans,zeroData:t.fillData.phantomSpans},{scales:e.scales,data:e.strokeData.spans,zeroData:e.fillData.phantomSpans},0);if(r==null)return;const l="none",c=$1(n,a,o,l),h=fD(n,r,l);return{status:n,fill:c,stroke:h}}var Z1=I({"packages/ag-charts-community/src/chart/series/cartesian/areaUtil.ts"(){"use strict";E1(),pD(),Xx(),Yx()}});function sf({id:t},e,i,...s){const n={phase:i?_n[i]:"trailing"};Ho(t,"markers",e,s,{opacity:0},{opacity:1},n),s.forEach(a=>a.cleanup())}function mD({id:t},e,...i){Ho(t,"markers",e,i,{scalingX:0,scalingY:0},{scalingX:1,scalingY:1},{phase:"initial"}),i.forEach(s=>s.cleanup())}function xD({id:t,nodeDataDependencies:e},i,...s){const n=e.seriesRectWidth;De(t,"markers",i,s,{fromFn:(r,l)=>{const c=l.midPoint?.x??n;let h=It(0,GM(c/n),1);return isNaN(h)&&(h=0),{scalingX:0,scalingY:0,delay:h,duration:Bp,phase:"initial"}},toFn:()=>({scalingX:1,scalingY:1})})}function nf(t){return{opacity:1,scalingX:1,scalingY:1}}function af(t,e){return{translationX:e.point?.x??NaN,translationY:e.point?.y??NaN}}function of(t,{datumIndex:e}){const i=t.getNodeData();if(i===void 0)return;const s=i[e],{point:n}=s;if(s==null||n==null)return;const a=4+(n.focusSize??t.getFormattedMarkerStyle(s).size),o=a/2,r=s.point.x-o,l=s.point.y-o;return be.toCanvas(t.contentGroup,new ht(r,l,a,a))}var rf=I({"packages/ag-charts-community/src/chart/series/cartesian/markerUtil.ts"(){"use strict";fc(),wi(),Rt(),Ai(),At(),fu()}});function bD({id:t,visible:e,nodeDataDependencies:i},s,...n){const{seriesRectWidth:a,seriesRectHeight:o}=i;Ho(t,"path_properties",s,n,{clipX:0},{clipX:a},{phase:"initial",start:{clip:!0,clipY:o,visible:e},finish:{clip:!1,visible:e}})}function Qx({id:t},e,i,s="add",...n){Ho(t,e,i,n,{opacity:0},{opacity:1},{phase:s})}function SD(t){return e=>({visible:t.getVisible(),opacity:t.getOpacity(),clipScalingX:1,clip:!1})}function qx({nodeDataDependencies:t},e){const i=s=>isFinite(s)?s:0;e.clipX=i(t.seriesRectWidth),e.clipY=i(t.seriesRectHeight)}var vD=I({"packages/ag-charts-community/src/chart/series/cartesian/pathUtil.ts"(){"use strict";wi()}}),Q1,q1,Jx,iX=I({"packages/ag-charts-community/src/chart/series/cartesian/areaSeries.ts"(){"use strict";ot(),wi(),sD(),Ac(),pe(),oO(),lo(),oe(),lg(),YA(),TA(),Vn(),uo(),gr(),Gc(),j6(),Z1(),Us(),Xx(),rf(),vD(),Q1=.125,q1=.25,Jx=class extends rr{constructor(t){super({moduleCtx:t,directionKeys:cl,directionNames:hl,pathsPerSeries:["fill","stroke"],pathsZIndexSubOrderOffset:[0,1e3],hasMarkers:!0,markerSelectionGarbageCollection:!1,pickModes:[2,0],animationResetFns:{path:SD({getVisible:()=>this.visible,getOpacity:()=>this.getOpacity()}),label:pr,marker:(e,i)=>({...nf(e),...af(e,i)})}}),this.properties=new Ee,this.connectsToYAxis=!0,this.backgroundGroup=new yt({name:`${this.id}-background`,zIndex:0}),this._isStacked=void 0}get pickModeAxis(){return"main"}renderToOffscreenCanvas(){return super.renderToOffscreenCanvas()||this.contextNodeData!=null&&(this.contextNodeData.fillData.spans.length>Og||this.contextNodeData.strokeData.spans.length>Og)}attachSeries(t,e,i){super.attachSeries(t,e,i),t.appendChild(this.backgroundGroup)}detachSeries(t,e,i){super.detachSeries(t,e,i),t?.removeChild(this.backgroundGroup)}attachPaths([t,e]){this.backgroundGroup.appendChild(t),this.contentGroup.appendChild(e),e.zIndex=-1}detachPaths([t,e]){this.backgroundGroup.removeChild(t),this.contentGroup.removeChild(e)}isStacked(){return(this.seriesGrouping?.stackCount??1)>1}setSeriesIndex(t){const e=this.isStacked();return!super.setSeriesIndex(t)&&this._isStacked===e?!1:(this._isStacked=e,e?(this.backgroundGroup.zIndex=[0,t],this.contentGroup.zIndex=[1,t,0]):(this.backgroundGroup.zIndex=[1,t,0,0],this.contentGroup.zIndex=[1,t,0,1]),!0)}async processData(t){if(this.data==null||!this.properties.isValid())return;const{data:e,visible:i,seriesGrouping:{groupIndex:s=this.id,stackCount:n=1}={}}=this,{xKey:a,yKey:o,yFilterKey:r,connectMissingData:l,normalizedTo:c}=this.properties,h=!this.ctx.animationManager.isSkipped(),u=this.axes.x?.scale,d=this.axes.y?.scale,{xScaleType:p,yScaleType:g}=this.getScaleInformation({xScale:u,yScale:d}),f={value:`area-stack-${s}-yValue`,values:`area-stack-${s}-yValues`,stack:`area-stack-${s}-yValue-stack`,marker:`area-stack-${s}-yValues-marker`},x=[];Gy(c)&&x.push(Cx(Object.values(f),c)),h&&x.push(Xu());const m={invalidValue:null};(Gy(c)||l)&&n>1&&(m.invalidValue=0),i||(m.forceValue=0),await this.requestDataModel(t,e,{props:[va(a,p,{id:"xValue"}),Ct(o,g,{id:"yValueRaw",...m}),...r!=null?[Ct(r,g,{id:"yFilterRaw"})]:[],...n1(o,g,{id:"yValueStack",...m,groupId:f.stack}),Ct(o,g,{id:"yValue",...m,groupId:f.value}),...ul(o,"window","current",{id:"yValueEnd",...m,groupId:f.values},g),...ul(o,"normal","current",{id:"yValueCumulative",...m,groupId:f.marker},g),...x],groupByKeys:!0,groupByData:!1}),this.animationState.transition("updateData")}xCoordinateRange(t,e){const{marker:i}=this.properties,s=this.axes.x.scale.convert(t),n=i.enabled?.5*i.size*e:0;return[s-n,s+n]}yCoordinateRange(t,e){const{marker:i}=this.properties,s=this.axes.y.scale.convert(t[0]),n=i.enabled?.5*i.size*e:0;return[s-n,s+n]}getSeriesDomain(t){const{processedData:e,dataModel:i,axes:s}=this;if(!e||!i)return[];const n=s.y;if(t==="x"){const o=i.resolveProcessedDataDefById(this,"xValue"),r=i.getDomain(this,"xValue","key",e);return o?.def.type==="key"&&o.def.valueType==="category"?r:Gs(ar(r))}const a=this.domainForClippedRange("y",["yValueEnd"],"xValue",!0);if(n instanceof dl||n instanceof ll)return Gs(a);{const o=Number.isFinite(a[1]-a[0])?[a[0]>0?0:a[0],a[1]<0?0:a[1]]:[];return Gs(o)}}getSeriesRange(t,e){const[i,s]=this.domainForVisibleRange("y",["yValueEnd"],"xValue",e,!0);return[Math.min(i,0),Math.max(s,0)]}getVisibleItems(t,e,i){return this.countVisibleItems("xValue",["yValueEnd"],t,e,i)}createNodeData(){const{axes:t,data:e,processedData:i,dataModel:s}=this,n=t.x,a=t.y;if(!n||!a||!e||!s||i?.type!=="grouped"||!this.properties.isValid())return;const{yKey:o,xKey:r,yFilterKey:l,marker:c,label:h,fill:u,stroke:d,connectMissingData:p,interpolation:g}=this.properties,{scale:f}=n,{scale:x}=a,{isContinuousY:m}=this.getScaleInformation({xScale:f,yScale:x}),b=(f.bandwidth??0)/2,v=s.resolveKeysById(this,"xValue",i),S=s.resolveColumnById(this,"yValueEnd",i),A=s.resolveColumnById(this,"yValueRaw",i),T=s.resolveColumnById(this,"yValueCumulative",i),D=l!=null?s.resolveColumnById(this,"yFilterRaw",i):void 0,L=s.resolveColumnById(this,"yValueStack",i),C=(X,Q,$)=>{let q;return(Gy(this.properties.normalizedTo)?m&&Nm($):!isNaN($))&&(q=Q),{x:f.convert(X)+b,y:x.convert(q),size:c.size}},O=[],_=[],{visibleSameStackCount:N}=this.ctx.seriesStateManager.getVisiblePeerGroupIndex(this);let P=!1;const{dataSources:j}=i,F=j.get(this.id)??[];for(const{datumIndex:X}of s.forEachGroupDatum(this,i)){const Q=v[X];if(Q==null)return;const $=F[X],q=A[X],J=T[X],nt=S[X],it=Number.isFinite(q),rt=C(Q,+J,q),dt=D!=null?D[X]===q:void 0;if(dt===!1&&(P=!0),it&&c&&_.push({series:this,itemId:o,datum:$,datumIndex:X,midPoint:{x:rt.x,y:rt.y},cumulativeValue:nt,yValue:q,xValue:Q,yKey:o,xKey:r,point:rt,fill:c.fill??u,stroke:c.stroke??d,strokeWidth:c.strokeWidth??this.getStrokeWidth(this.properties.strokeWidth),selected:dt}),it&&h){const at=this.getLabelText(h,{value:q,datum:$,xKey:r,yKey:o,xName:this.properties.xName,yName:this.properties.yName});O.push({series:this,itemId:o,datum:$,datumIndex:X,x:rt.x,y:rt.y,labelText:at})}}const V=X=>X.flatMap(Q=>Array.isArray(Q)?Kx(Q,g):new Array(Q.skip).fill(null)),W=(X,Q)=>({point:{x:f.convert(X)+b,y:x.convert(Q)},xDatum:X,yDatum:Q}),H=X=>{const Q=[];for(const{datumIndexes:[$,q,J]}of s.forEachGroupDatumTuple(this,i)){const nt=v[q],it=L[q],rt=it[X],dt=Number.isFinite(rt);if(p&&!dt)continue;const at=$!=null?L[$]:void 0,Dt=J!=null?L[J]:void 0;let kt=0,Mt=0;for(let xt=0;xt<=X;xt+=1){const Nt=it[xt];if(Number.isFinite(Nt)){const Yt=at==null||Number.isFinite(at[xt]),Nn=Dt==null||Number.isFinite(Dt[xt]);Yt&&(kt+=Nt),Nn&&(Mt+=Nt)}}const ft=Q[Q.length-1];if(!p&&(kt!==Mt||!dt))if(!dt&&Array.isArray(ft)&&ft.length===1)Q[Q.length-1]={skip:1};else{const xt=W(nt,kt),Nt=W(nt,Mt);Array.isArray(ft)?ft.push(xt):ft!=null&&(ft.skip+=1),Q.push(dt?[Nt]:{skip:0})}else{const xt=Math.max(kt,Mt),Nt=W(nt,xt);Array.isArray(ft)?ft.push(Nt):ft!=null?(ft.skip+=1,Q.push([Nt])):Q.push([Nt])}}return V(Q)},G=this.seriesGrouping?.stackIndex??0,B=()=>{const X=Array.from(s.forEachGroupDatum(this,i),({datumIndex:Q})=>{const $=v[Q],J=L[Q][G];if(!(p&&!Number.isFinite(J)))return W($,0)}).filter(Q=>Q!=null);return Kx(X,g)},z=H(G),U=z.map(()=>null);for(let X=G-1;X>=-1;X-=1){let Q;for(let $=0;$X??U[Q]),K=z.filter(X=>X!=null);return{itemId:o,fillData:{itemId:o,spans:Y,phantomSpans:U},strokeData:{itemId:o,spans:K},labelData:O,nodeData:_,scales:this.calculateScaling(),visible:this.visible,stackVisible:N>0,crossFiltering:P}}isPathOrSelectionDirty(){return this.properties.marker.isDirty()}updatePathNodes(t){const{opacity:e,visible:i,animationEnabled:s}=t,[n,a]=t.paths,o=this.contextNodeData?.crossFiltering===!0,r=this.getStrokeWidth(this.properties.strokeWidth);a.setProperties({fill:void 0,lineCap:"round",lineJoin:"round",pointerEvents:1,stroke:this.properties.stroke,strokeWidth:r,strokeOpacity:this.properties.strokeOpacity*(o?q1:1),lineDash:this.properties.lineDash,lineDashOffset:this.properties.lineDashOffset,opacity:e,visible:i||s});const{fill:l}=this.properties;if(aO(l)){const c=this.getGradientFillOptions(l,this.properties.defaultColorRange);n.gradientFillOptions=c}n.setProperties({stroke:void 0,lineJoin:"round",pointerEvents:1,fill:this.properties.fill,fillOpacity:this.properties.fillOpacity*(o?Q1:1),fillShadow:this.properties.shadow,opacity:e,visible:i||s}),qx(this,a),qx(this,n)}updatePaths(t){this.updateAreaPaths(t.paths,t.contextData)}updateAreaPaths(t,e){for(const i of t)i.visible=e.visible;if(e.visible)this.updateFillPath(t,e),this.updateStrokePath(t,e);else for(const i of t)i.path.clear(),i.markDirty()}updateFillPath(t,e){const[i]=t;i.path.clear(),K1(i,e.fillData),i.markDirty()}updateStrokePath(t,e){const{spans:i}=e.strokeData,[,s]=t;s.path.clear(),gD(s,i),s.markDirty()}updateMarkerSelection(t){const{nodeData:e,markerSelection:i}=t,s=this.properties.marker.enabled||this.contextNodeData?.crossFiltering===!0;return this.properties.marker.isDirty()&&(i.clear(),i.cleanup()),i.update(s?e:[])}getMarkerItemBaseStyle(t){const{marker:e}=this.properties,i=t?this.properties.highlightStyle.item:void 0;return{fill:i?.fill??e.fill,fillOpacity:i?.fillOpacity??e.fillOpacity,stroke:i?.stroke??e.stroke,strokeWidth:i?.strokeWidth??e.strokeWidth,strokeOpacity:i?.strokeOpacity??e.strokeOpacity}}getMarkerItemStyleOverrides(t,e,i,s,n,a){const{marker:o}=this.properties,{itemStyler:r}=o;if(r==null)return;const{id:l,properties:c}=this,{xKey:h,yKey:u}=c,{xDomain:d,yDomain:p}=this.cachedDatumCallback("domain",()=>({xDomain:this.getSeriesDomain("x"),yDomain:this.getSeriesDomain("y")}));return this.cachedDatumCallback(Ve(t,a?"highlight":"node"),()=>r({seriesId:l,...ol(e,h,u,d,p),xValue:i,yValue:s,highlighted:a,...n}))}updateMarkerNodes(t){const{markerSelection:e,isHighlight:i}=t,{xKey:s,yKey:n,marker:a,fill:o,stroke:r,strokeWidth:l,fillOpacity:c,strokeOpacity:h,highlightStyle:u}=this.properties,d=this.getSeriesDomain("x"),p=this.getSeriesDomain("y"),g=Tt(i&&u.item,a.getStyle(),{fill:o,stroke:r,strokeWidth:l,fillOpacity:c,strokeOpacity:h});e.each((f,x)=>{this.updateMarkerStyle(f,a,{...ol(x,s,n,d,p),highlighted:i},g,{selected:x.selected})}),i||this.properties.marker.markClean()}updateLabelSelection(t){const{labelData:e,labelSelection:i}=t;return i.update(e)}updateLabelNodes(t){const{labelSelection:e}=t,{enabled:i,fontStyle:s,fontWeight:n,fontSize:a,fontFamily:o,color:r}=this.properties.label;e.each((l,c)=>{const{x:h,y:u,labelText:d}=c;d&&i&&this.visible?(l.fontStyle=s,l.fontWeight=n,l.fontSize=a,l.fontFamily=o,l.textAlign="center",l.textBaseline="bottom",l.text=d,l.x=h,l.y=u-10,l.fill=r,l.visible=!0):l.visible=!1})}getTooltipContent(t){const{id:e,dataModel:i,processedData:s,axes:n,properties:a}=this,{xKey:o,xName:r,yKey:l,yName:c,tooltip:h}=a,u=n.x,d=n.y;if(!i||!s||!u||!d)return;const{datumIndex:p}=t,g=s.dataSources.get(this.id)?.[p],f=i.resolveKeysById(this,"xValue",s)[p],x=i.resolveColumnById(this,"yValueRaw",s)[p];if(f==null)return;const m=this.getMarkerItemBaseStyle(!1);return Object.assign(m,this.getMarkerItemStyleOverrides(String(p),g,f,x,m,!1)),h.formatTooltip({heading:u.formatDatum(f),symbol:this.legendItemSymbol(),data:[{label:c,fallbackLabel:l,value:d.formatDatum(x)}]},{seriesId:e,datum:g,title:c,xKey:o,xName:r,yKey:l,yName:c,...m,...this.getModuleTooltipParams()})}legendItemSymbol(){const{fill:t,stroke:e,fillOpacity:i,strokeOpacity:s,strokeWidth:n,lineDash:a,marker:o}=this.properties,r=!o.enabled||o.fill===void 0;return{marker:{shape:o.shape,fill:r?t:o.fill,fillOpacity:r?i:o.fillOpacity,stroke:o.stroke??e,strokeOpacity:o.strokeOpacity,strokeWidth:o.strokeWidth,lineDash:o.lineDash,lineDashOffset:o.lineDashOffset,enabled:o.enabled||n<=0},line:{stroke:e,strokeOpacity:s,strokeWidth:n,lineDash:a}}}getLegendData(t){if(!this.properties.isValid()||t!=="category")return[];const{id:e,ctx:{legendManager:i},visible:s}=this,{yKey:n,yName:a,legendItemName:o,showInLegend:r}=this.properties;return[{legendType:t,id:e,itemId:n,seriesId:e,enabled:s&&i.getItemEnabled({seriesId:e,itemId:n}),label:{text:o??a??n},symbol:this.legendItemSymbol(),legendItemName:o,hideInLegend:!r}]}animateEmptyUpdateReady(t){const{markerSelection:e,labelSelection:i,contextData:s,paths:n}=t,{animationManager:a}=this.ctx;this.updateAreaPaths(n,s),bD(this,a,...n),Mi([e],af),xD(this,a,e),Ht(this,"labels",a,i)}animateReadyResize(t){const{contextData:e,paths:i}=t;this.updateAreaPaths(i,e),super.animateReadyResize(t)}animateWaitingUpdateReady(t){const{animationManager:e}=this.ctx,{markerSelection:i,labelSelection:s,contextData:n,paths:a,previousContextData:o}=t,[r,l]=a;if(r==null&&l==null)return;this.resetMarkerAnimation(t),this.resetLabelAnimation(t);const c=()=>{this.resetPathAnimation(t),this.updateAreaPaths(a,n)},h=()=>{e.skipCurrentBatch(),c()};if(n==null||o==null){c(),sf(this,e,"added",i),Qx(this,"fill_path_properties",e,"add",r),Qx(this,"stroke_path_properties",e,"add",l),Ht(this,"labels",e,s);return}if(n.crossFiltering!==o.crossFiltering){h();return}const u=X1(n,o);if(u===void 0){h();return}else if(u.status==="no-op")return;sf(this,e,void 0,i),De(this.id,"fill_path_properties",e,[r],u.fill.pathProperties),Hx(this.id,"fill_path_update",e,[r],u.fill.path),De(this.id,"stroke_path_properties",e,[l],u.stroke.pathProperties),Hx(this.id,"stroke_path_update",e,[l],u.stroke.path),Ht(this,"labels",e,s),this.ctx.animationManager.animate({id:this.id,groupId:"reset_after_animation",phase:"trailing",from:{},to:{},onComplete:()=>this.updateAreaPaths(a,n)})}isLabelEnabled(){return this.properties.label.enabled}nodeFactory(){return new yt}getFormattedMarkerStyle(t){const{xKey:e,yKey:i}=t,s=this.getSeriesDomain("x"),n=this.getSeriesDomain("y");return this.getMarkerStyle(this.properties.marker,{...ol(t,e,i,s,n),highlighted:!0})}computeFocusBounds(t){return of(this,t)}},Jx.className="AreaSeries",Jx.type="area"}}),J1,sX=I({"packages/ag-charts-community/src/chart/series/cartesian/areaSeriesModule.ts"(){"use strict";ke(),md(),iX(),J1={type:"series",optionsKey:"series[]",packageType:"community",chartTypes:["cartesian"],identifier:"area",moduleFactory:t=>new Jx(t),stackable:!0,tooltipDefaults:{range:"nearest"},defaultAxes:[{type:"number",position:"left"},{type:"category",position:"bottom"}],themeTemplate:{series:{nodeClickRange:"nearest",tooltip:{position:{type:"node"}},fillOpacity:.8,strokeOpacity:1,strokeWidth:0,lineDash:[0],lineDashOffset:0,shadow:{enabled:!1,color:hr,xOffset:3,yOffset:3,blur:5},interpolation:{type:"linear",tension:1,position:"end"},marker:{enabled:!1,shape:"circle",size:7,strokeWidth:0},label:{enabled:!1,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"textColor"}}}},paletteFactory:t=>{const{marker:e}=iD(t),i=t.themeTemplateParameters.get(Kg);return{fill:e.fill,stroke:e.stroke,marker:e,defaultColorRange:i}}}}});function MD(t,e){for(const i of e){const s=i.datum;s===void 0?et.error("undefined datum"):t.addValue(i,s)}}function ID(t,e){const{x:i,y:s}=e,{nearest:n,distanceSquared:a}=t.getQuadTree().find(i,s);if(n!==void 0)return{datum:n.value,distance:Math.sqrt(a)}}var AD=I({"packages/ag-charts-community/src/chart/series/cartesian/quadtreeUtil.ts"(){"use strict";ot()}}),tb,DD,kD=I({"packages/ag-charts-community/src/chart/series/cartesian/abstractBarSeries.ts"(){"use strict";ot(),Yp(),Qi(),lo(),mt(),wu(),UA(),Vn(),Us(),AD(),tb=class extends ho{constructor(){super(...arguments),this.direction="vertical"}},M([k(c0)],tb.prototype,"direction",2),DD=class extends rr{constructor(){super(...arguments),this.groupScale=new Su,this.smallestDataInterval=void 0,this.largestDataInterval=void 0}padBandExtent(t,e){const i=typeof e=="boolean"?1:.5,s=zt(this.smallestDataInterval)?this.smallestDataInterval*i:0,n=ar(t)??[NaN,NaN];return typeof e=="boolean"?n[e?0:1]-=(e?1:-1)*s:(n[0]-=s,n[1]+=s),Gs(n)}getBandScalePadding(){return{inner:.3,outer:.15}}shouldFlipXY(){return!this.isVertical()}isVertical(){return this.properties.direction==="vertical"}getBarDirection(){return this.shouldFlipXY()?"x":"y"}getCategoryDirection(){return this.shouldFlipXY()?"y":"x"}getValueAxis(){const t=this.getBarDirection();return this.axes[t]}getCategoryAxis(){const t=this.getCategoryDirection();return this.axes[t]}getBandwidth(t){return Wt.is(t.scale)?t.scale.calcBandwidth(this.smallestDataInterval):t.scale.bandwidth}xCoordinateRange(t){const e=this.axes[this.getCategoryDirection()],i=e.scale,s=this.getBandwidth(e)??0,n=Wt.is(i)?s*-.5:0,a=i.convert(t)+n;return[a,a+s]}yCoordinateRange(t){const i=this.axes[this.getBarDirection()].scale,s=t.map(n=>i.convert(n));if(s.length===1){const n=i.convert(0);return[Math.min(s[0],n),Math.max(s[0],n)]}return[Math.min(...s),Math.max(...s)]}updateGroupScale(t){const e=[],{groupScale:i}=this,s=this.getBandwidth(t),{index:n,visibleGroupCount:a}=this.ctx.seriesStateManager.getVisiblePeerGroupIndex(this);for(let r=0;r=1?i.bandwidth:i.rawBandwidth,groupIndex:n}}resolveKeyDirection(t){return this.getBarDirection()==="x"?t==="x"?"y":"x":t}initQuadTree(t){MD(t,this.datumNodesIter())}pickNodeClosestDatum(t){return ID(this,t)}}}}),eb,Me,nX=I({"packages/ag-charts-community/src/chart/series/cartesian/barSeriesProperties.ts"(){"use strict";xd(),mt(),zn(),fr(),kD(),eb=class extends ii{constructor(){super(...arguments),this.placement="inside-center",this.padding=0}},M([k(ie(["inside-center","inside-start","inside-end","outside-start","outside-end"],"a placement"))],eb.prototype,"placement",2),M([k(_t)],eb.prototype,"padding",2),Me=class extends tb{constructor(){super(...arguments),this.fill="#c16068",this.fillOpacity=1,this.stroke="#874349",this.strokeWidth=1,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.cornerRadius=0,this.crisp=void 0,this.shadow=new Hn,this.label=new eb,this.tooltip=new Bi,this.sparklineMode=!1,this.fastDataProcessing=!1}},M([k(tt)],Me.prototype,"xKey",2),M([k(tt,{optional:!0})],Me.prototype,"xName",2),M([k(tt)],Me.prototype,"yKey",2),M([k(tt,{optional:!0})],Me.prototype,"yName",2),M([k(tt,{optional:!0})],Me.prototype,"yFilterKey",2),M([k(tt,{optional:!0})],Me.prototype,"stackGroup",2),M([k(_t,{optional:!0})],Me.prototype,"normalizedTo",2),M([k(jt)],Me.prototype,"fill",2),M([k(Ut)],Me.prototype,"fillOpacity",2),M([k(jt)],Me.prototype,"stroke",2),M([k(st)],Me.prototype,"strokeWidth",2),M([k(Ut)],Me.prototype,"strokeOpacity",2),M([k(ua)],Me.prototype,"lineDash",2),M([k(st)],Me.prototype,"lineDashOffset",2),M([k(st)],Me.prototype,"cornerRadius",2),M([k(pt,{optional:!0})],Me.prototype,"crisp",2),M([k(ts,{optional:!0})],Me.prototype,"itemStyler",2),M([k(lt,{optional:!0})],Me.prototype,"shadow",2),M([k(lt)],Me.prototype,"label",2),M([k(lt)],Me.prototype,"tooltip",2),M([k(pt)],Me.prototype,"sparklineMode",2),M([k(pt)],Me.prototype,"fastDataProcessing",2)}});function t_(t,e,i,s){if(e!=null){const[n,a]=e;if(n!==0||a!==1)return!1}if(Wt.is(t)){const n=t.calcBandwidth(s)-t.calcBandwidth(i);if(n>0&&n<1)return!1}return!0}function lf(t,e,i){const{startingX:s,startingY:n}=oX(t,e);return{isVertical:t,calculate:(o,r)=>{let l=t?o.x:s,c=t?n:o.y,h=t?o.width:0,u=t?0:o.height;const{opacity:d=1}=o;r&&(isNaN(l)||isNaN(c))&&({x:l,y:c}=r,h=t?r.width:0,u=t?0:r.height,t&&!ib(r)?c+=r.height:!t&&ib(r)&&(l+=r.width));let p;return o.clipBBox==null?p=void 0:ib(o)?p=t?new ht(l,c-u,h,u):new ht(l-h,c,h,u):p=new ht(l,c,h,u),{x:l,y:c,width:h,height:u,clipBBox:p,opacity:d}},mode:i}}function aX(t,e){return{isVertical:t,calculate:i=>({x:t?i.x:i.x+i.width/2,y:t?i.y+i.height/2:i.y,width:t?i.width:0,height:t?0:i.height,clipBBox:i.clipBBox,opacity:i.opacity??1}),mode:e}}function cf(t){const e=a=>a==null||isNaN(a.x)||isNaN(a.y);return{toFn:(a,o,r)=>r==="removed"&&a.datum==null&&t.mode==="fade"?{...hf(a,o),opacity:0}:r==="removed"||e(o)?t.calculate(o,a.previousDatum):{x:o.x,y:o.y,width:o.width,height:o.height,clipBBox:o.clipBBox,opacity:o.opacity??1},fromFn:(a,o,r)=>{r==="updated"&&e(o)?r="removed":r==="updated"&&e(a.previousDatum)&&(r="added");let l;r==="added"&&a.previousDatum==null&&t.mode==="fade"?l={...hf(a,o),opacity:0}:r==="unknown"||r==="added"?l=t.calculate(o,a.previousDatum):l={x:a.x,y:a.y,width:a.width,height:a.height,clipBBox:a.clipBBox,opacity:a.opacity??1};const c=_n[r];return{...l,phase:c}},applyFn:(a,o,r)=>{a.setProperties(o),a.crisp=r==="end"&&(a.datum?.crisp??!1)}}}function oX(t,e){const i=e[t?"y":"x"];let s=1/0,n=0;return i?(t?n=i.scale.convert(Wt.is(i.scale)?0:Math.max(...i.range)):s=i.scale.convert(Wt.is(i.scale)?0:Math.min(...i.range)),{startingX:s,startingY:n}):{startingX:s,startingY:n}}function hf(t,{x:e,y:i,width:s,height:n,clipBBox:a,opacity:o=1}){return{x:e,y:i,width:s,height:n,clipBBox:a,opacity:o,crisp:t.datum?.crisp??!1}}function LD(t,e){if(e===void 0)return;const{x:i,y:s,width:n,height:a}=e;return be.toCanvas(t.contentGroup,new ht(i,s,n,a))}var ib,TD=I({"packages/ag-charts-community/src/chart/series/cartesian/barUtil.ts"(){"use strict";wi(),Qi(),Rt(),Ai(),At(),ib=t=>Zy(t.yValue??0)}});function e_(t,e,i){if(e.enabled&&i){const{x:s,y:n,text:a,textAlign:o,textBaseline:r}=i,{color:l,fontStyle:c,fontWeight:h,fontSize:u,fontFamily:d}=e;t.setProperties({visible:!0,x:s,y:n,text:a,fill:l,fontStyle:c,fontWeight:h,fontSize:u,fontFamily:d,textAlign:o,textBaseline:r})}else t.visible=!1}function i_({isUpward:t,isVertical:e,placement:i,padding:s=0,rect:n}){let a=n.x+n.width/2,o=n.y+n.height/2,r="center",l="middle";if(i!=="inside-center"){const c=(t?1:-1)*(e?-1:1),{direction:h,textAlignment:u}=s_[i],d=(h+1)*.5;if(e){const p=t?n.y+n.height:n.y,g=n.height*c;o=p+g*d+s*u*c,l=u===c?"top":"bottom"}else{const p=t?n.x:n.x+n.width,g=n.width*c;a=p+g*d+s*u*c,r=u===c?"left":"right"}}return{x:a,y:o,textAlign:r,textBaseline:l}}var s_,n_=I({"packages/ag-charts-community/src/chart/series/cartesian/labelUtil.ts"(){"use strict";s_={"inside-start":{inside:!0,direction:-1,textAlignment:1},"inside-end":{inside:!0,direction:1,textAlignment:-1},"outside-start":{inside:!1,direction:-1,textAlignment:-1},"outside-end":{inside:!1,direction:1,textAlignment:1}}}}),a_,o_,r_,l_,c_,uf,h_=I({"packages/ag-charts-community/src/chart/series/cartesian/barSeries.ts"(){"use strict";ot(),wi(),Qi(),Rt(),zg(),YA(),Vn(),uo(),gr(),Ex(),Gc(),kD(),nX(),TD(),Us(),n_(),Yx(),a_=0,o_=1,r_=2,l_=3,c_=4,uf=class extends DD{constructor(t){super({moduleCtx:t,directionKeys:cl,directionNames:hl,pickModes:[2,1,0],pathsPerSeries:[],hasHighlightedLabels:!0,datumSelectionGarbageCollection:!1,animationAlwaysUpdateSelections:!0,animationResetFns:{datum:hf,label:pr}}),this.properties=new Me,this.connectsToYAxis=!0,this.dataAggregationFilters=void 0}get pickModeAxis(){return this.properties.sparklineMode?"main":void 0}crossFilteringEnabled(){return this.properties.yFilterKey!=null&&(this.seriesGrouping==null||this.seriesGrouping.stackIndex===0)}async processData(t){if(!this.properties.isValid()||!this.data)return;const{xKey:e,yKey:i,yFilterKey:s,normalizedTo:n,fastDataProcessing:a}=this.properties,{seriesGrouping:{groupIndex:o=this.id}={},data:r}=this,l=this.seriesGrouping?.groupCount??0,h=(this.seriesGrouping?.stackCount??0)>=1||n!=null,u=!a||l>1||h,d=!this.ctx.animationManager.isSkipped(),p=this.getCategoryAxis()?.scale,g=this.getValueAxis()?.scale,{isContinuousX:f,xScaleType:x,yScaleType:m}=this.getScaleInformation({xScale:p,yScale:g}),b=`bar-stack-${o}-yValues`,v=`${b}-trailing`,S=this.visible?{}:{forceValue:0},A=[va(e,x,{id:"xValue"}),Ct(i,m,{id:"yValue-raw",invalidValue:null,...S})];this.crossFilteringEnabled()&&A.push(Ct(s,m,{id:"yFilterValue",invalidValue:null,...S})),h&&A.push(...ul(i,"normal","current",{id:"yValue-end",rangeId:"yValue-range",invalidValue:null,missingValue:0,groupId:b,separateNegative:!0,...S},m),...ul(i,"trailing","current",{id:"yValue-start",invalidValue:null,missingValue:0,groupId:v,separateNegative:!0,...S},m)),f&&A.push(jA,VA),zt(n)&&A.push(Cx([b,v],Math.abs(n))),d&&this.processedData&&A.push(Zu(this.id,this.processedData)),(d||!u)&&A.push(Xu());const{dataModel:T,processedData:D}=await this.requestDataModel(t,r,{props:A,groupByKeys:u,groupByData:!u});this.dataAggregationFilters=this.aggregateData(T,D),this.smallestDataInterval=D.reduced?.smallestKeyInterval,this.largestDataInterval=D.reduced?.largestKeyInterval,this.animationState.transition("updateData")}getSeriesDomain(t){const{processedData:e,dataModel:i}=this;if(i==null||e==null)return[];if(t===this.getCategoryDirection()){const o=i.resolveProcessedDataDefById(this,"xValue"),r=i.getDomain(this,"xValue","key",e);return o?.def.type==="key"&&o.def.valueType==="category"?r:this.padBandExtent(r)}const s=this.dataModel?.hasColumnById(this,"yValue-end")?"yValue-end":"yValue-raw";let n=this.domainForClippedRange("y",[s],"xValue",!0);const a=this.crossFilteringEnabled()?i.getDomain(this,"yFilterValue","value",e):void 0;if(a!=null&&(n=[Math.min(n[0],a[0]),Math.max(n[1],a[1])]),this.getValueAxis()instanceof dl)return Gs(n);{const o=Number.isFinite(n[1]-n[0])?[Math.min(0,n[0]),Math.max(0,n[1])]:[];return Gs(o)}}getSeriesRange(t,e){const i=this.dataModel?.hasColumnById(this,"yValue-end")?"yValue-end":"yValue-raw",[s,n]=this.domainForVisibleRange("y",[i],"xValue",e,!0);return[Math.min(s,0),Math.max(n,0)]}getVisibleItems(t,e,i){const s=this.dataModel?.hasColumnById(this,"yValue-end")?"yValue-end":"yValue-raw";return this.countVisibleItems("xValue",[s],t,e,i)}aggregateData(t,e){}createNodeData(){const{dataModel:t,processedData:e,groupScale:i,dataAggregationFilters:s}=this,n=this.getCategoryAxis(),a=this.getValueAxis();if(!t||!e||!n||!a||!this.properties.isValid())return;const o=e.dataSources?.get(this.id);if(o==null)return;const r=n.scale,l=a.scale,{xKey:c,yKey:h,xName:u,yName:d,legendItemName:p,label:g}=this.properties,f=a.isReversed(),{barWidth:x,groupIndex:m}=this.updateGroupScale(n),b=i.convert(String(m)),v=Wt.is(r)?x*-.5:0,S=t.resolveKeysById(this,"xValue",e),A=t.resolveColumnById(this,"yValue-raw",e),T=this.crossFilteringEnabled()?t.resolveColumnById(this,"yFilterValue",e):void 0,D=!this.ctx.animationManager.isSkipped(),L=B=>r.convert(S[B])+b+v,C=this.properties.crisp??t_(n?.scale,n?.visibleRange,this.smallestDataInterval,this.largestDataInterval),O=l.convert(0),_=({datum:B,datumIndex:z,valueIndex:U,xValue:Y,yValue:K,cumulativeValue:Z,phantom:X,currY:Q,prevY:$,x:q,width:J,isPositive:nt,yRange:it,labelText:rt,opacity:dt,crossScale:at=1})=>{const Dt=nt!==f,kt=l.convert(Q),Mt=l.convert($),ft=l.convert(it),xt=this.getBarDirection()==="x",Nt=J*.5*(1-at),Yt={x:xt?Math.min(kt,Mt):q+Nt,y:xt?q+Nt:Math.min(kt,Mt),width:xt?Math.abs(Mt-kt):J*at,height:xt?J*at:Math.abs(Mt-kt)},Nn=new ht(Yt.x,Yt.y,Yt.width,Yt.height),$i={x:xt?Math.min(O,ft):q+Nt,y:xt?q+Nt:Math.min(O,ft),width:xt?Math.abs(O-ft):J*at,height:xt?J*at:Math.abs(O-ft)},Ya=this.shouldFlipXY()?Yt.height:Yt.width;return{series:this,itemId:X?Ve(h,X):h,datum:B,datumIndex:z,valueIndex:U,cumulativeValue:Z,phantom:X,xValue:Y,yValue:K,yKey:h,xKey:c,capDefaults:{lengthRatioMultiplier:Ya,lengthMax:Ya},x:$i.x,y:$i.y,width:$i.width,height:$i.height,midPoint:{x:Yt.x+Yt.width/2,y:Yt.y+Yt.height/2},opacity:dt,topLeftCornerRadius:xt!==Dt,topRightCornerRadius:Dt,bottomRightCornerRadius:xt===Dt,bottomLeftCornerRadius:!Dt,clipBBox:Nn,crisp:C,label:rt!=null?{text:rt,...i_({isUpward:Dt,isVertical:!xt,placement:g.placement,padding:g.padding,rect:Yt})}:void 0,missing:K==null,focusable:!X}},N=[],P=[],j=[],F=(B,z,U,Y,K,Z,X,Q)=>{const $=S[B];if($==null)return;const q=A[B],J=T!=null?Number(T[B]):void 0,nt=q>=0&&!Object.is(q,-0);if(!Number.isFinite(Z)||J!=null&&!Number.isFinite(J))return;const it=q!=null?this.getLabelText(this.properties.label,{datum:o[B],value:J??q,xKey:c,yKey:h,xName:u,yName:d,legendItemName:p}):void 0,rt=J!=null&&J>q,dt=_({datum:o[B],datumIndex:B,valueIndex:z,xValue:$,yValue:J??q,cumulativeValue:J??Z,phantom:!1,currY:J!=null?K+J:Z,prevY:K,x:U,width:Y,isPositive:nt,yRange:Math.max(K+(J??-1/0),X),labelText:it,opacity:Q,crossScale:rt?.6:void 0});if(P.push(dt),j.push(dt),J!=null){const at=_({datum:o[B],datumIndex:B,valueIndex:z,xValue:$,yValue:J,cumulativeValue:J,phantom:!0,currY:Z,prevY:K,x:U,width:Y,isPositive:nt,yRange:X,labelText:void 0,opacity:Q,crossScale:void 0});N.push(at)}},[V,W]=r.range,H=W-V,G=s?.find(B=>B.maxRange>H);if(e.type==="grouped"){const B=x,z=t.hasColumnById(this,"yValue-start"),U=z?t.resolveColumnById(this,"yValue-start",e):void 0,Y=z?t.resolveColumnById(this,"yValue-end",e):void 0,K=z?t.resolveProcessedDataIndexById(this,"yValue-range"):-1;for(const{datumIndex:Z,valueIndex:X,group:{aggregation:Q}}of t.forEachGroupDatum(this,e)){const $=L(Z),q=A[Z],J=q>=0&&!Object.is(q,-0),nt=z?Number(U?.[Z]):0,it=z?Number(Y?.[Z]):q;let rt=it;z&&(rt=Q[K][J?1:0]),F(Z,X,$,B,nt,it,rt,1)}}else if(G==null){const B=x;let[z,U]=this.visibleRange("xValue",n.range);e.input.count<1e3&&(z=0,U=e.input.count);for(let Y=z;Y0){const dt=rt>=0?rt/it:1;F(q,0,J,nt,0,it,it,dt)}if(rt<0){const dt=it<=0?it/rt:1;F($,1,J,nt,0,rt,rt,dt)}}}return{itemId:h,nodeData:N.length>0?[...N,...P]:P,labelData:j,scales:this.calculateScaling(),visible:this.visible||D,groupScale:this.getScaling(this.groupScale)}}nodeFactory(){return new _i}getHighlightData(t,e){const i=t.find(s=>s.datum===e.datum&&!s.phantom);return i!=null?[i]:void 0}updateDatumSelection(t){return t.datumSelection.update(t.nodeData,void 0,e=>this.getDatumId(e))}getItemBaseStyle(t){const{properties:e}=this,{cornerRadius:i}=e,s=t?e.highlightStyle.item:void 0;return{fill:s?.fill??e.fill,fillOpacity:s?.fillOpacity??e.fillOpacity,stroke:s?.stroke??e.stroke,strokeWidth:s?.strokeWidth??this.getStrokeWidth(e.strokeWidth),strokeOpacity:s?.strokeOpacity??e.strokeOpacity,lineDash:s?.lineDash??e.lineDash??[],lineDashOffset:s?.lineDashOffset??e.lineDashOffset,cornerRadius:i}}getItemStyleOverrides(t,e,i,s,n,a){const{id:o,properties:r}=this,{xKey:l,yKey:c,itemStyler:h}=r;if(h==null)return;const{xDomain:u,yDomain:d}=this.cachedDatumCallback("domain",()=>({xDomain:this.getSeriesDomain("x"),yDomain:this.getSeriesDomain("y")}));return this.cachedDatumCallback(Ve(t,a?"highlight":"node"),()=>h({seriesId:o,...ol(e,l,c,u,d),xValue:i,yValue:s,highlighted:a,...n}))}updateDatumNodes(t){if(!this.properties.isValid())return;const{shadow:e}=this.properties,i=this.getCategoryDirection()==="x",s=this.getItemBaseStyle(t.isHighlight);t.datumSelection.each((n,a)=>{const o=this.getItemStyleOverrides(String(a.datumIndex),a.datum,a.xValue,a.yValue,s,t.isHighlight);n.opacity=a.opacity??0,jg(n,s,o);const r=o?.cornerRadius??s.cornerRadius;n.topLeftCornerRadius=a.topLeftCornerRadius?r:0,n.topRightCornerRadius=a.topRightCornerRadius?r:0,n.bottomRightCornerRadius=a.bottomRightCornerRadius?r:0,n.bottomLeftCornerRadius=a.bottomLeftCornerRadius?r:0,n.visible=i?(a.clipBBox?.width??a.width)>0:(a.clipBBox?.height??a.height)>0,n.crisp=a.crisp,n.fillShadow=e})}updateLabelSelection(t){const e=this.isLabelEnabled()?t.labelData:[];return t.labelSelection.update(e,i=>{i.pointerEvents=1})}updateLabelNodes(t){t.labelSelection.each((e,i)=>{e_(e,this.properties.label,i.label)})}getTooltipContent(t){const{id:e,dataModel:i,processedData:s,properties:n}=this,{xKey:a,xName:o,yKey:r,yName:l,legendItemName:c,stackGroup:h,tooltip:u}=n,d=this.getCategoryAxis(),p=this.getValueAxis();if(!i||!s||!d||!p)return;const{datumIndex:g}=t,f=s.dataSources.get(this.id)?.[g],x=i.resolveKeysById(this,"xValue",s)[g],m=i.resolveColumnById(this,"yValue-raw",s)[g];if(x==null)return;const b=this.getItemBaseStyle(!1);return Object.assign(b,this.getItemStyleOverrides(String(g),f,x,m,b,!1)),u.formatTooltip({heading:d.formatDatum(x),symbol:this.legendItemSymbol(),data:[{label:l,fallbackLabel:r,value:p.formatDatum(m)}]},{seriesId:e,datum:f,title:l,xKey:a,xName:o,yKey:r,yName:l,legendItemName:c,stackGroup:h,...b,...this.getModuleTooltipParams()})}legendItemSymbol(){const{fill:t,stroke:e,strokeWidth:i,fillOpacity:s,strokeOpacity:n,lineDash:a,lineDashOffset:o}=this.properties;return{marker:{fill:t,fillOpacity:s,stroke:e,strokeWidth:i,strokeOpacity:n,lineDash:a,lineDashOffset:o}}}getLegendData(t){const{showInLegend:e}=this.properties;if(t!=="category"||!this.properties.isValid())return[];const{id:i,ctx:{legendManager:s},visible:n}=this,{yKey:a,yName:o,legendItemName:r}=this.properties;return[{legendType:"category",id:i,itemId:a,seriesId:i,enabled:n&&s.getItemEnabled({seriesId:i,itemId:a}),label:{text:r??o??a},symbol:this.legendItemSymbol(),legendItemName:r,hideInLegend:!e}]}animateEmptyUpdateReady({datumSelection:t,labelSelection:e,annotationSelections:i}){const s=cf(lf(this.isVertical(),this.axes,"normal"));De(this.id,"nodes",this.ctx.animationManager,[t],s),Ht(this,"labels",this.ctx.animationManager,e),Ht(this,"annotations",this.ctx.animationManager,...i)}animateWaitingUpdateReady(t){const{datumSelection:e,labelSelection:i,annotationSelections:s,previousContextData:n}=t;this.ctx.animationManager.stopByAnimationGroupId(this.id);let a=this.processedData?.reduced?.diff?.[this.id];a==null&&this.processedData?.reduced?.diff!=null&&(a={changed:!0,added:new Set(Array.from(e,({datum:h})=>this.getDatumId(h))),updated:new Set,removed:new Set,moved:new Set});const o=n==null?"fade":"normal",r=cf(lf(this.isVertical(),this.axes,o));De(this.id,"nodes",this.ctx.animationManager,[e],r,(h,u)=>this.getDatumId(u),a);const l=n!=null&&(!bd(t.contextData.scales.x,n.scales.x)||!bd(t.contextData.scales.y,n.scales.y)||!bd(t.contextData.groupScale,t.previousContextData.groupScale));((a?.changed??!1)||l)&&(Ht(this,"labels",this.ctx.animationManager,i),Ht(this,"annotations",this.ctx.animationManager,...s))}getDatumId(t){return Ve(t.xValue,t.valueIndex,t.phantom)}isLabelEnabled(){return this.properties.label.enabled}computeFocusBounds({datumIndex:t}){const e=this.contextNodeData?.nodeData[t].clipBBox;return LD(this,e)}},uf.className="BarSeries",uf.type="bar"}}),CD,u_=I({"packages/ag-charts-community/src/chart/series/cartesian/barSeriesModule.ts"(){"use strict";ke(),md(),h_(),CD={type:"series",optionsKey:"series[]",packageType:"community",chartTypes:["cartesian"],identifier:"bar",moduleFactory:t=>new uf(t),stackable:!0,groupable:!0,tooltipDefaults:{range:"exact"},defaultAxes:A1([{type:"number",position:"left"},{type:"category",position:"bottom"}],t=>t?.direction==="horizontal"),themeTemplate:{series:{direction:"vertical",fillOpacity:1,strokeWidth:0,lineDash:[0],lineDashOffset:0,label:{enabled:!1,fontWeight:{$ref:"fontWeight"},fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},color:{$if:[{$or:[{$eq:[{$path:"./placement"},"outside-start"]},{$eq:[{$path:"./placement"},"outside-end"]}]},{$ref:"textColor"},{$ref:"backgroundColor"}]},placement:"inside-center"},shadow:{enabled:!1,color:hr,xOffset:3,yOffset:3,blur:5},errorBar:{cap:{lengthRatio:.3}}}},paletteFactory:Qg}}}),sb,ND,Kt,rX=I({"packages/ag-charts-community/src/chart/series/cartesian/bubbleSeriesProperties.ts"(){"use strict";qy(),Is(),mt(),zn(),Ju(),fr(),Us(),sb=class extends Pi{constructor(){super(...arguments),this.maxSize=30}},M([k(st),ct()],sb.prototype,"maxSize",2),M([k(Zp,{optional:!0}),ct()],sb.prototype,"domain",2),ND=class extends ii{constructor(){super(...arguments),this.placement="top"}},M([k(dm)],ND.prototype,"placement",2),Kt=class extends ho{constructor(){super(...arguments),this.colorRange=["#ffff00","#00ff00","#0000ff"],this.label=new ND,this.tooltip=new Bi,this.marker=new sb}},M([k(tt)],Kt.prototype,"xKey",2),M([k(tt)],Kt.prototype,"yKey",2),M([k(tt)],Kt.prototype,"sizeKey",2),M([k(tt,{optional:!0})],Kt.prototype,"labelKey",2),M([k(tt,{optional:!0})],Kt.prototype,"colorKey",2),M([k(tt,{optional:!0})],Kt.prototype,"xFilterKey",2),M([k(tt,{optional:!0})],Kt.prototype,"yFilterKey",2),M([k(tt,{optional:!0})],Kt.prototype,"sizeFilterKey",2),M([k(tt,{optional:!0})],Kt.prototype,"xName",2),M([k(tt,{optional:!0})],Kt.prototype,"yName",2),M([k(tt,{optional:!0})],Kt.prototype,"sizeName",2),M([k(tt,{optional:!0})],Kt.prototype,"labelName",2),M([k(tt,{optional:!0})],Kt.prototype,"colorName",2),M([k(Zp,{optional:!0})],Kt.prototype,"colorDomain",2),M([k(Bs)],Kt.prototype,"colorRange",2),M([k(tt,{optional:!0})],Kt.prototype,"title",2),M([ue("marker.shape")],Kt.prototype,"shape",2),M([ue("marker.size")],Kt.prototype,"size",2),M([ue("marker.maxSize")],Kt.prototype,"maxSize",2),M([ue("marker.domain",{optional:!0})],Kt.prototype,"domain",2),M([ue("marker.fill",{optional:!0})],Kt.prototype,"fill",2),M([ue("marker.fillOpacity")],Kt.prototype,"fillOpacity",2),M([ue("marker.stroke",{optional:!0})],Kt.prototype,"stroke",2),M([ue("marker.strokeWidth")],Kt.prototype,"strokeWidth",2),M([ue("marker.strokeOpacity")],Kt.prototype,"strokeOpacity",2),M([ue("marker.lineDash")],Kt.prototype,"lineDash",2),M([ue("marker.lineDashOffset")],Kt.prototype,"lineDashOffset",2),M([ue("marker.itemStyler",{optional:!0})],Kt.prototype,"itemStyler",2),M([k(lt)],Kt.prototype,"label",2),M([k(lt)],Kt.prototype,"tooltip",2)}}),d_,nb,lX=I({"packages/ag-charts-community/src/chart/series/cartesian/bubbleSeries.ts"(){"use strict";Du(),Zc(),pe(),lo(),oe(),ln(),Vn(),uo(),ba(),gr(),rX(),Us(),rf(),d_=class extends Dx{constructor(t,e,i,s){super(t,e,i,s),this.sizeKey=s.properties.sizeKey}},nb=class extends rr{constructor(t){super({moduleCtx:t,directionKeys:cl,directionNames:hl,pickModes:[2,1,0],pathsPerSeries:[],hasMarkers:!0,markerSelectionGarbageCollection:!1,animationResetFns:{label:pr,marker:nf},usesPlacedLabels:!0}),this.NodeEvent=d_,this.clipFocusBox=!1,this.properties=new Kt,this.sizeScale=new Un,this.colorScale=new $o}get pickModeAxis(){return"main-category"}async processData(t){if(!this.properties.isValid()||this.data==null||!this.visible)return;const e=this.axes.x?.scale,i=this.axes.y?.scale,{xScaleType:s,yScaleType:n}=this.getScaleInformation({xScale:e,yScale:i}),a=this.colorScale.type,o=this.sizeScale.type,{xKey:r,yKey:l,sizeKey:c,xFilterKey:h,yFilterKey:u,sizeFilterKey:d,labelKey:p,colorDomain:g,colorRange:f,colorKey:x,marker:m}=this.properties,{dataModel:b,processedData:v}=await this.requestDataModel(t,this.data,{props:[Ct(r,s,{id:"xValue"}),Ct(l,n,{id:"yValue"}),...h!=null?[Ct(h,s,{id:"xFilterValue"})]:[],...u!=null?[Ct(u,n,{id:"yFilterValue"})]:[],...d!=null?[Ct(d,o,{id:"sizeFilterValue"})]:[],Ct(c,o,{id:"sizeValue"}),...x?[Ct(x,a,{id:"colorValue"})]:[],...p?[Ct(p,"band",{id:"labelValue"})]:[]]}),S=b.resolveProcessedDataIndexById(this,"sizeValue"),A=v.domain.values[S]??[];if(this.sizeScale.domain=m.domain?m.domain:A,x){const T=b.resolveProcessedDataIndexById(this,"colorValue");this.colorScale.domain=g??v.domain.values[T]??[],this.colorScale.range=f,this.colorScale.update()}this.animationState.transition("updateData")}xCoordinateRange(t,e,i){const{properties:s,sizeScale:n}=this,{size:a,sizeKey:o}=s,r=this.axes.x.scale.convert(t),l=o!=null?this.dataModel.resolveColumnById(this,"sizeValue",this.processedData):void 0,h=.5*(l!=null?n.convert(l[i]):a)*e;return[r-h,r+h]}yCoordinateRange(t,e,i){const{properties:s,sizeScale:n}=this,{size:a,sizeKey:o}=s,r=this.axes.y.scale.convert(t[0]),l=o!=null?this.dataModel.resolveColumnById(this,"sizeValue",this.processedData):void 0,h=.5*(l!=null?n.convert(l[i]):a)*e;return[r-h,r+h]}getSeriesDomain(t){const{dataModel:e,processedData:i}=this;if(!i||!e)return[];const s={x:"xValue",y:"yValue"},n=s[t],a=e.resolveProcessedDataDefById(this,n),o=e.getDomain(this,n,"value",i);if(a?.def.type==="value"&&a?.def.valueType==="category")return o;const l=s[t==="x"?"y":"x"],c=this.domainForClippedRange(t,[n],l,!1);return Gs(ar(c))}getSeriesRange(t,e){return this.domainForVisibleRange("y",["yValue"],"xValue",e,!1)}getVisibleItems(t,e,i){return this.countVisibleItems("xValue",["yValue"],t,e,i)}createNodeData(){const{axes:t,dataModel:e,processedData:i,colorScale:s,sizeScale:n,visible:a}=this,{xKey:o,yKey:r,sizeKey:l,xFilterKey:c,yFilterKey:h,sizeFilterKey:u,labelKey:d,xName:p,yName:g,sizeName:f,labelName:x,label:m,colorKey:b,marker:v}=this.properties,{placement:S}=m,A=ai.anchor(v.shape),T=t.x,D=t.y;if(!(e&&i&&a&&T&&D))return;const L=e.resolveColumnById(this,"xValue",i),C=e.resolveColumnById(this,"yValue",i),O=l!=null?e.resolveColumnById(this,"sizeValue",i):void 0,_=b!=null?e.resolveColumnById(this,"colorValue",i):void 0,N=d!=null?e.resolveColumnById(this,"labelValue",i):void 0,P=c!=null?e.resolveColumnById(this,"xFilterValue",i):void 0,j=h!=null?e.resolveColumnById(this,"yFilterValue",i):void 0,F=u!=null?e.resolveColumnById(this,"sizeFilterValue",i):void 0,V=T.scale,W=D.scale,H=(V.bandwidth??0)/2,G=(W.bandwidth??0)/2,B=[];n.range=[v.size,v.maxSize];const z=m.getFont(),U=io.getMeasurer({font:z});return i.dataSources.get(this.id)?.forEach((Y,K)=>{const Z=L[K],X=C[K],Q=O?.[K],$=V.convert(Z)+H,q=W.convert(X)+G;let J;P!=null&&j!=null&&(J=P[K]===Z&&j[K]===X,F!=null&&J&&(J=F[K]===Q));const nt=this.getLabelText(m,{value:N!=null?N[K]:X,datum:Y,xKey:o,yKey:r,sizeKey:l,labelKey:d,xName:p,yName:g,sizeName:f,labelName:x}),it=U.measureText(String(nt)),rt=Q!=null?n.convert(Q):v.size,dt=_!=null?s.convert(_[K]):void 0;B.push({series:this,itemId:r,yKey:r,xKey:o,datum:Y,datumIndex:K,xValue:Z,yValue:X,sizeValue:Q,point:{x:$,y:q,size:rt},midPoint:{x:$,y:q},fill:dt,label:{text:nt,...it},anchor:A,placement:S,selected:J})}),{itemId:r,nodeData:B,labelData:B,scales:this.calculateScaling(),visible:this.visible}}isPathOrSelectionDirty(){return this.properties.marker.isDirty()}getLabelData(){return this.isLabelEnabled()?this.contextNodeData?.labelData??[]:[]}updateMarkerSelection(t){const{nodeData:e,markerSelection:i}=t;this.properties.marker.isDirty()&&(i.clear(),i.cleanup());const s=this.properties.marker.enabled?e:[];return i.update(s,void 0,n=>Ve([n.xValue,n.yValue,n.label.text]))}getMarkerItemBaseStyle(t){const{properties:e}=this,{marker:i}=e,s=t?e.highlightStyle.item:void 0;return{fill:s?.fill??i.fill,fillOpacity:s?.fillOpacity??i.fillOpacity,stroke:s?.stroke??i.stroke,strokeWidth:s?.strokeWidth??i.strokeWidth,strokeOpacity:s?.strokeOpacity??i.strokeOpacity,lineDash:s?.lineDash??i.lineDash,lineDashOffset:s?.lineDashOffset??i.lineDashOffset}}getMarkerItemStyleOverrides(t,e,i,s){const{id:n,properties:a}=this,{xKey:o,yKey:r,sizeKey:l,labelKey:c,marker:h}=a,{itemStyler:u}=h;if(u!=null)return this.cachedDatumCallback(Ve(t,s?"highlight":"node"),()=>u({seriesId:n,datum:e,xKey:o,yKey:r,sizeKey:l,labelKey:c,highlighted:s,...i}))}updateMarkerNodes(t){const{markerSelection:e,isHighlight:i}=t,{xKey:s,yKey:n,sizeKey:a,labelKey:o,marker:r}=this.properties,{size:l,shape:c,fill:h,fillOpacity:u,stroke:d,strokeWidth:p,strokeOpacity:g,lineDash:f,lineDashOffset:x}=Tt(i&&this.properties.highlightStyle.item,r.getStyle()),m={size:l,shape:c,fill:h,fillOpacity:u,stroke:d,strokeWidth:p,strokeOpacity:g,lineDash:f,lineDashOffset:x};this.sizeScale.range=[r.size,r.maxSize],e.each((b,v)=>{this.updateMarkerStyle(b,r,{datum:v,highlighted:i,xKey:s,yKey:n,sizeKey:a,labelKey:o},m,{selected:v.selected})}),i||this.properties.marker.markClean()}updatePlacedLabelData(t){this.labelSelection.update(t.map(e=>({...e.datum,point:{x:e.x,y:e.y,size:e.datum.point.size}})),e=>{e.pointerEvents=1}),this.updateLabelNodes({labelSelection:this.labelSelection})}updateLabelNodes(t){const{label:e}=this.properties;t.labelSelection.each((i,s)=>{i.text=s.label.text,i.fill=e.color,i.x=s.point?.x??0,i.y=s.point?.y??0,i.fontStyle=e.fontStyle,i.fontWeight=e.fontWeight,i.fontSize=e.fontSize,i.fontFamily=e.fontFamily,i.textAlign="left",i.textBaseline="top"})}getTooltipContent(t){const{id:e,dataModel:i,processedData:s,axes:n,properties:a}=this,{xKey:o,xName:r,yKey:l,yName:c,sizeKey:h,sizeName:u,labelKey:d,labelName:p,title:g,tooltip:f}=a,x=n.x,m=n.y;if(!i||!s||!x||!m)return;const{datumIndex:b}=t,v=s.dataSources.get(this.id)?.[b],S=i.resolveColumnById(this,"xValue",s)[b],A=i.resolveColumnById(this,"yValue",s)[b];if(S==null)return;const T=[{label:r,fallbackLabel:o,value:x.formatDatum(S)},{label:c,fallbackLabel:l,value:m.formatDatum(A)}];if(h!=null){const L=i.resolveColumnById(this,"sizeValue",s)[b];T.push({label:u,fallbackLabel:h,value:String(L)})}const D=this.getMarkerItemBaseStyle(!1);return Object.assign(D,this.getMarkerItemStyleOverrides(String(b),v,D,!1)),f.formatTooltip({title:g,symbol:this.legendItemSymbol(),data:T},{seriesId:e,datum:v,title:l,xKey:o,xName:r,yKey:l,yName:c,sizeKey:h,sizeName:u,labelKey:d,labelName:p,...D,...this.getModuleTooltipParams()})}legendItemSymbol(){const{marker:t}=this.properties,{shape:e,fill:i,stroke:s,fillOpacity:n,strokeOpacity:a,strokeWidth:o,lineDash:r,lineDashOffset:l}=t;return{marker:{shape:e,fill:i??"rgba(0, 0, 0, 0)",stroke:s??"rgba(0, 0, 0, 0)",fillOpacity:n,strokeOpacity:a,strokeWidth:o,lineDash:r,lineDashOffset:l}}}getLegendData(){if(!this.properties.isValid())return[];const{id:t,ctx:{legendManager:e},visible:i}=this,{yKey:s,yName:n,title:a}=this.properties;return[{legendType:"category",id:t,itemId:s,seriesId:t,enabled:i&&e.getItemEnabled({seriesId:t,itemId:s}),label:{text:a??n??s},symbol:this.legendItemSymbol()}]}animateEmptyUpdateReady({markerSelection:t,labelSelection:e}){mD(this,this.ctx.animationManager,t),Ht(this,"labels",this.ctx.animationManager,e)}isLabelEnabled(){return this.properties.label.enabled}nodeFactory(){return new yt}getFormattedMarkerStyle(t){const{xKey:e,yKey:i,sizeKey:s,labelKey:n}=this.properties;return this.getMarkerStyle(this.properties.marker,{datum:t,xKey:e,yKey:i,sizeKey:s,labelKey:n,highlighted:!1})}computeFocusBounds(t){return of(this,t)}},nb.className="BubbleSeries",nb.type="bubble"}}),p_,cX=I({"packages/ag-charts-community/src/chart/series/cartesian/bubbleSeriesModule.ts"(){"use strict";md(),lX(),p_={type:"series",optionsKey:"series[]",packageType:"community",chartTypes:["cartesian"],identifier:"bubble",moduleFactory:t=>new nb(t),tooltipDefaults:{range:"nearest"},defaultAxes:[{type:"number",position:"bottom"},{type:"number",position:"left"}],themeTemplate:{series:{shape:"circle",size:7,maxSize:30,fillOpacity:.8,tooltip:{position:{type:"node"}},label:{enabled:!1,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"textColor"}}}},paletteFactory:Qg}}}),We,hX=I({"packages/ag-charts-community/src/chart/series/cartesian/histogramSeriesProperties.ts"(){"use strict";xd(),mt(),zn(),fr(),Us(),We=class extends ho{constructor(){super(...arguments),this.fillOpacity=1,this.strokeWidth=1,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.cornerRadius=0,this.areaPlot=!1,this.aggregation="sum",this.shadow=new Hn,this.label=new ii,this.tooltip=new Bi}},M([k(tt)],We.prototype,"xKey",2),M([k(tt,{optional:!0})],We.prototype,"yKey",2),M([k(tt,{optional:!0})],We.prototype,"xName",2),M([k(tt,{optional:!0})],We.prototype,"yName",2),M([k(jt,{optional:!0})],We.prototype,"fill",2),M([k(Ut)],We.prototype,"fillOpacity",2),M([k(jt,{optional:!0})],We.prototype,"stroke",2),M([k(st)],We.prototype,"strokeWidth",2),M([k(Ut)],We.prototype,"strokeOpacity",2),M([k(ua)],We.prototype,"lineDash",2),M([k(st)],We.prototype,"lineDashOffset",2),M([k(st)],We.prototype,"cornerRadius",2),M([k(pt)],We.prototype,"areaPlot",2),M([k(Mu,{optional:!0})],We.prototype,"bins",2),M([k(ie(["count","sum","mean"],"a histogram aggregation"))],We.prototype,"aggregation",2),M([k(st,{optional:!0})],We.prototype,"binCount",2),M([k(lt)],We.prototype,"shadow",2),M([k(lt)],We.prototype,"label",2),M([k(lt)],We.prototype,"tooltip",2)}}),OD,ab,uX=I({"packages/ag-charts-community/src/chart/series/cartesian/histogramSeries.ts"(){"use strict";ot(),wi(),zg(),At(),Cc(),BA(),Vn(),uo(),gr(),Ex(),TD(),Us(),hX(),AD(),OD=10,ab=class extends rr{constructor(t){super({moduleCtx:t,directionKeys:cl,directionNames:hl,pickModes:[1,0],datumSelectionGarbageCollection:!1,animationResetFns:{datum:hf,label:pr}}),this.properties=new We,this.calculatedBins=[]}deriveBins(t){const e=w0(t[0],t[1],OD),i=sg(t[0],t[1],OD),[s]=e,n=a=>[a,a+i];return[[s-i,s],...e.map(n)]}calculateNiceBins(t,e){const i=Math.floor(t[0]),s=t[1],n=e||1,{start:a,binSize:o}=this.calculateNiceStart(i,s,n);return this.getBins(a,s,o,n)}getBins(t,e,i,s){const n=[],a=this.calculatePrecision(i);for(let o=0;o0)for(;t<1;)e*=10,t*=10;return e}calculateNiceStart(t,e,i){const s=Math.abs(e-t)/i,n=Math.floor(Math.log10(s)),a=Math.pow(10,n);return{start:Math.floor(t/a)*a,binSize:s}}async processData(t){this.visible||(this.processedData=void 0,this.animationState.transition("updateData"));const{xKey:e,yKey:i,areaPlot:s,aggregation:n}=this.properties,a=this.axes.x?.scale,o=this.axes.y?.scale,{xScaleType:r,yScaleType:l}=this.getScaleInformation({yScale:o,xScale:a}),c=[va(e,r),GA];if(i){let u=_A("groupAgg");n==="count"||(n==="sum"?u=ZR("groupAgg"):n==="mean"&&(u=QR("groupAgg"))),s&&(u=PA("groupAgg",u)),c.push(Ct(i,l,{invalidValue:void 0}),u)}else{c.push(s1("count"));let u=_A("groupAgg");s&&(u=PA("groupAgg",u)),c.push(u)}const h=u=>{const d=Gs(u.domain.keys[0]);if(d.length===0)return u.domain.groups=[],()=>[];const p=On(this.properties.binCount)?this.calculateNiceBins(d,this.properties.binCount):this.properties.bins??this.deriveBins(d),g=p.length;return this.calculatedBins=[...p],f=>{let x=f[0];if(hu(x)&&(x=x.getTime()),!On(x))return[];for(let m=0;m=b[0]&&x{const[[h,u]=[0,0]]=c,[d,p]=l,[g,f]=Si([a.convert(d),a.convert(p)]);if(f>=e&&g<=i){const x=h+u;r=Math.max(r,x)}}),o>r?[NaN,NaN]:[o,r]}createNodeData(){const{id:t,axes:e,processedData:i,dataModel:s}=this,n=e.x,a=e.y;if(!n||!a||!s)return;const{scale:o}=n,{scale:r}=a,{xKey:l,yKey:c,xName:h,yName:u}=this.properties,d=this.properties.label.formatter??(f=>String(f.value)),p=[],g={itemId:this.properties.yKey??this.id,nodeData:p,labelData:p,scales:this.calculateScaling(),animationValid:!0,visible:this.visible};return!this.visible||i==null||i.type!=="grouped"||(i.groups.forEach((f,x)=>{const{keys:m,datumIndices:b,aggregation:v}=f,[[S,A]=[0,0]]=v,T=b.length,D=m,[L,C]=D,O=[...s.forEachDatum(this,i,f)],_=o.convert(L),N=o.convert(C),P=S+A,j=r.convert(0),F=r.convert(P),V=Math.abs(N-_),W=Math.abs(F-j),H=Math.min(_,N),G=Math.min(j,F);let B;P!==0&&(B={x:H+V/2,y:G+W/2,text:this.cachedDatumCallback(Ve(x,"label"),()=>d({value:P,datum:O,seriesId:t,xKey:l,yKey:c,xName:h,yName:u}))??String(P)});const z={x:H+V/2,y:G+W/2},U=a.isReversed();p.push({series:this,datumIndex:x,datum:O,aggregatedValue:P,frequency:T,domain:D,yKey:c,xKey:l,x:H,y:G,xValue:_,yValue:F,width:V,height:W,midPoint:z,topLeftCornerRadius:!U,topRightCornerRadius:!U,bottomRightCornerRadius:U,bottomLeftCornerRadius:U,label:B,crisp:!0})}),p.sort((f,x)=>f.x-x.x)),g}nodeFactory(){return new _i}updateDatumSelection(t){const{nodeData:e,datumSelection:i}=t;return i.update(e,void 0,s=>s.domain.join("_"))}getItemBaseStyle(t){const{properties:e}=this,i=t?e.highlightStyle.item:void 0;return{fill:i?.fill??e.fill,fillOpacity:i?.fillOpacity??e.fillOpacity,stroke:i?.stroke??e.stroke,strokeWidth:i?.strokeWidth??this.getStrokeWidth(e.strokeWidth),strokeOpacity:i?.strokeOpacity??e.strokeOpacity,lineDash:i?.lineDash??e.lineDash,lineDashOffset:i?.lineDashOffset??e.lineDashOffset,cornerRadius:e.cornerRadius}}updateDatumNodes(t){const{isHighlight:e}=t,{shadow:i}=this.properties,s=this.getItemBaseStyle(e);t.datumSelection.each((n,a)=>{const{cornerRadius:o}=s,{topLeftCornerRadius:r,topRightCornerRadius:l,bottomRightCornerRadius:c,bottomLeftCornerRadius:h}=a;jg(n,s),n.topLeftCornerRadius=r?o:0,n.topRightCornerRadius=l?o:0,n.bottomRightCornerRadius=c?o:0,n.bottomLeftCornerRadius=h?o:0,n.crisp=a.crisp,n.fillShadow=i,n.visible=a.height>0})}updateLabelSelection(t){const{labelData:e,labelSelection:i}=t;return i.update(e,s=>{s.pointerEvents=1,s.textAlign="center",s.textBaseline="middle"})}updateLabelNodes(t){const{fontStyle:e,fontWeight:i,fontFamily:s,fontSize:n,color:a}=this.properties.label,o=this.isLabelEnabled();t.labelSelection.each((r,l)=>{o&&l?.label?(r.text=l.label.text,r.x=l.label.x,r.y=l.label.y,r.fontStyle=e,r.fontWeight=i,r.fontFamily=s,r.fontSize=n,r.fill=a,r.visible=!0):r.visible=!1})}initQuadTree(t){const{value:e}=this.contentGroup.children().next();e&&MD(t,e.children())}pickNodeClosestDatum(t){return ID(this,t)}getTooltipContent(t){const{id:e,dataModel:i,processedData:s,axes:n,properties:a,ctx:{localeManager:o}}=this,{xKey:r,xName:l,yKey:c,yName:h,tooltip:u}=a,d=n.x,p=n.y;if(!i||s?.type!=="grouped"||!d||!p)return;const g=t.datumIndex,f=s.groups[g],{aggregation:x,datumIndices:m,keys:b}=f,[[v,S]=[0,0]]=x,A=m.length,T=b,[D,L]=T,C=v+S,O={data:[...i.forEachDatum(this,s,f)],aggregatedValue:C,frequency:A,domain:T},_=[{label:l,fallbackLabel:r,value:`${d.formatDatum(D)} - ${d.formatDatum(L)}`},{label:o.t("seriesHistogramTooltipFrequency"),value:p.formatDatum(A)}];if(c!=null){let N;switch(a.aggregation){case"sum":N=o.t("seriesHistogramTooltipSum",{yName:h});break;case"mean":N=o.t("seriesHistogramTooltipMean",{yName:h});break;case"count":N=o.t("seriesHistogramTooltipCount",{yName:h});break}_.push({label:N,value:p.formatDatum(C)})}return u.formatTooltip({symbol:this.legendItemSymbol(),data:_},{seriesId:e,datum:O,title:h,xKey:r,xName:l,yKey:c,yName:h,xRange:[D,L],frequency:A,...this.getItemBaseStyle(!1)})}legendItemSymbol(){const{fill:t,fillOpacity:e,stroke:i,strokeWidth:s,strokeOpacity:n,lineDash:a,lineDashOffset:o}=this.properties;return{marker:{fill:t??"rgba(0, 0, 0, 0)",stroke:i??"rgba(0, 0, 0, 0)",fillOpacity:e,strokeOpacity:n,strokeWidth:s,lineDash:a,lineDashOffset:o}}}getLegendData(t){if(t!=="category")return[];const{id:e,ctx:{legendManager:i},visible:s}=this,{xKey:n,yName:a,showInLegend:o}=this.properties;return[{legendType:"category",id:e,itemId:n,seriesId:e,enabled:s&&i.getItemEnabled({seriesId:e,itemId:n}),label:{text:a??n??"Frequency"},symbol:this.legendItemSymbol(),hideInLegend:!o}]}animateEmptyUpdateReady({datumSelection:t,labelSelection:e}){const i=cf(lf(!0,this.axes,"normal"));De(this.id,"datums",this.ctx.animationManager,[t],i),Ht(this,"labels",this.ctx.animationManager,e)}animateWaitingUpdateReady(t){const e=this.processedData?.reduced?.diff?.[this.id],i=cf(lf(!0,this.axes,"normal"));De(this.id,"datums",this.ctx.animationManager,[t.datumSelection],i,(s,n)=>Ve(n.domain),e),Ht(this,"labels",this.ctx.animationManager,t.labelSelection)}isLabelEnabled(){return this.properties.label.enabled}computeFocusBounds({datumIndex:t}){return LD(this,this.contextNodeData?.nodeData[t])}},ab.className="HistogramSeries",ab.type="histogram"}}),g_,dX=I({"packages/ag-charts-community/src/chart/series/cartesian/histogramSeriesModule.ts"(){"use strict";ke(),uX(),g_={type:"series",optionsKey:"series[]",packageType:"community",chartTypes:["cartesian"],identifier:"histogram",moduleFactory:t=>new ab(t),tooltipDefaults:{range:"exact"},defaultAxes:[{type:"number",position:"bottom"},{type:"number",position:"left"}],themeTemplate:{series:{strokeWidth:1,fillOpacity:1,strokeOpacity:1,lineDash:[0],lineDashOffset:0,label:{enabled:!1,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"backgroundColor"}},shadow:{enabled:!1,color:hr,xOffset:3,yOffset:3,blur:5}}},paletteFactory:({takeColors:t})=>{const{fills:[e],strokes:[i]}=t(1);return{fill:e,stroke:i}}}}}),Ue,pX=I({"packages/ag-charts-community/src/chart/series/cartesian/lineSeriesProperties.ts"(){"use strict";mt(),zn(),Ju(),fr(),Us(),rD(),Ue=class extends ho{constructor(){super(...arguments),this.stroke="#874349",this.strokeWidth=2,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.interpolation=new nh,this.marker=new Pi,this.label=new ii,this.tooltip=new Bi,this.connectMissingData=!1,this.sparklineMode=!1}},M([k(tt)],Ue.prototype,"xKey",2),M([k(tt)],Ue.prototype,"yKey",2),M([k(tt,{optional:!0})],Ue.prototype,"xName",2),M([k(tt,{optional:!0})],Ue.prototype,"yName",2),M([k(tt,{optional:!0})],Ue.prototype,"yFilterKey",2),M([k(tt,{optional:!0})],Ue.prototype,"stackGroup",2),M([k(st,{optional:!0})],Ue.prototype,"normalizedTo",2),M([k(tt,{optional:!0})],Ue.prototype,"title",2),M([k(jt)],Ue.prototype,"stroke",2),M([k(st)],Ue.prototype,"strokeWidth",2),M([k(Ut)],Ue.prototype,"strokeOpacity",2),M([k(ua)],Ue.prototype,"lineDash",2),M([k(st)],Ue.prototype,"lineDashOffset",2),M([k(lt)],Ue.prototype,"interpolation",2),M([k(lt)],Ue.prototype,"marker",2),M([k(lt)],Ue.prototype,"label",2),M([k(lt)],Ue.prototype,"tooltip",2),M([k(pt)],Ue.prototype,"connectMissingData",2),M([k(pt)],Ue.prototype,"sparklineMode",2)}}),f_,df,y_=I({"packages/ag-charts-community/src/chart/series/cartesian/lineSeries.ts"(){"use strict";ot(),wi(),sD(),Ac(),pe(),lo(),oe(),Vn(),uo(),gr(),Gc(),Us(),pX(),Xx(),rf(),vD(),f_=.25,df=class extends rr{constructor(t){super({moduleCtx:t,directionKeys:cl,directionNames:hl,hasMarkers:!0,pickModes:[2,1,0],markerSelectionGarbageCollection:!1,animationResetFns:{path:SD({getVisible:()=>this.visible,getOpacity:()=>this.getOpacity()}),label:pr,marker:(e,i)=>({...nf(e),...af(e,i)})}}),this.clipFocusBox=!1,this.properties=new Ue,this.dataAggregationFilters=void 0}get pickModeAxis(){return this.properties.sparklineMode?"main":"main-category"}async processData(t){if(this.data==null||!this.properties.isValid())return;const{data:e,visible:i,seriesGrouping:{groupIndex:s=this.id,stackCount:n=0}={}}=this,{xKey:a,yKey:o,yFilterKey:r,connectMissingData:l,normalizedTo:c}=this.properties,h=!this.ctx.animationManager.isSkipped(),u=this.axes.x?.scale,d=this.axes.y?.scale,{isContinuousX:p,xScaleType:g,yScaleType:f}=this.getScaleInformation({xScale:u,yScale:d}),x=n>=1||c!=null,m={invalidValue:null};l&&x&&(m.invalidValue=0),x&&!i&&(m.forceValue=0);const b=[];if((!p||x)&&b.push(va(a,g,{id:"xKey"})),b.push(Ct(a,g,{id:"xValue"}),Ct(o,f,{id:"yValueRaw",...m,invalidValue:void 0})),r!=null&&b.push(Ct(r,f,{id:"yFilterRaw"})),x){const A=[`line-stack-${s}-yValues`,`line-stack-${s}-yValues-trailing`,`line-stack-${s}-yValues-marker`];b.push(...ul(o,"window","current",{id:"yValueEnd",...m,groupId:A[0]},f),...ul(o,"window-trailing","current",{id:"yValueStart",...m,groupId:A[1]},f),...ul(o,"normal","current",{id:"yValueCumulative",...m,groupId:A[2]},f)),Gy(c)&&b.push(Cx([A[0],A[1],A[2]],c))}h&&(b.push(Xu(p?["xValue"]:void 0)),this.processedData&&b.push(Zu(this.id,this.processedData)));const{dataModel:v,processedData:S}=await this.requestDataModel(t,e,{props:b,groupByKeys:x,groupByData:!x});this.dataAggregationFilters=this.aggregateData(v,S),this.animationState.transition("updateData")}xCoordinateRange(t,e){const{marker:i}=this.properties,s=this.axes.x.scale.convert(t),n=i.enabled?.5*i.size*e:0;return[s-n,s+n]}yCoordinateRange(t,e){const{marker:i}=this.properties,s=this.axes.y.scale.convert(t[0]),n=i.enabled?.5*i.size*e:0;return[s-n,s+n]}getSeriesDomain(t){const{dataModel:e,processedData:i}=this;if(!e||!i)return[];if(t==="x"){const a=e.resolveProcessedDataDefById(this,"xValue"),o=e.getDomain(this,"xValue","value",i);return a?.def.type==="value"&&a.def.valueType==="category"?o:Gs(ar(o))}const s=this.dataModel?.hasColumnById(this,"yValueEnd")?"yValueEnd":"yValueRaw",n=this.domainForClippedRange("y",[s],"xValue",!0);return Gs(n)}getSeriesRange(t,e){const i=this.dataModel?.hasColumnById(this,"yValueEnd")?"yValueEnd":"yValueRaw";return this.domainForVisibleRange("y",[i],"xValue",e,!0)}getVisibleItems(t,e,i){const s=this.dataModel?.hasColumnById(this,"yValueEnd")?"yValueEnd":"yValueRaw";return this.countVisibleItems("xValue",[s],t,e,i)}aggregateData(t,e){}createNodeData(){const{dataModel:t,processedData:e,axes:i,dataAggregationFilters:s}=this,n=i.x,a=i.y;if(!t||!e||!n||!a)return;const{xKey:o,yKey:r,yFilterKey:l,xName:c,yName:h,marker:u,label:d,connectMissingData:p,interpolation:g,legendItemName:f}=this.properties,x=this.dataModel?.hasColumnById(this,"yValueEnd"),m=n.scale,b=a.scale,v=(m.bandwidth??0)/2,S=(b.bandwidth??0)/2,A=u.enabled?u.size:0,T=e.dataSources.get(this.id)??[],D=t.resolveColumnById(this,"xValue",e),L=t.resolveColumnById(this,"yValueRaw",e),C=x?t.resolveColumnById(this,"yValueEnd",e):void 0,O=x?t.resolveColumnById(this,"yValueCumulative",e):L,_=l!=null?t.resolveColumnById(this,"yFilterRaw",e):void 0,N=$=>m.convert(D[$])+v,P=$=>b.convert(O[$])+S,j={lengthRatioMultiplier:this.properties.marker.getDiameter(),lengthMax:1/0},F=[];let V;const W=$=>{const q=T[$],J=D[$],nt=L[$],it=C?.[$],rt=_?.[$],dt=N($),at=P($);if(!Number.isFinite(dt))return;if(nt!=null){const kt=d.enabled?this.getLabelText(d,{value:nt,datum:q,xKey:o,yKey:r,xName:c,yName:h,legendItemName:f}):void 0;F.push({series:this,datum:q,datumIndex:$,yKey:r,xKey:o,point:{x:dt,y:at,size:A},midPoint:{x:dt,y:at},cumulativeValue:it,yValue:nt,xValue:J,capDefaults:j,labelText:kt,selected:rt})}if(V==null)return;const Dt=V[V.length-1];if(nt!=null){const kt={point:{x:dt,y:at},xDatum:J,yDatum:nt};Array.isArray(Dt)?Dt.push(kt):Dt!=null?(Dt.skip+=1,V.push([kt])):V.push([kt])}else p||(Array.isArray(Dt)||Dt==null?V.push({skip:0}):Dt.skip+=1)},[H,G]=m.range,B=G-H,U=s?.find($=>$.maxRange>B)?.indices;let[Y,K]=this.visibleRange("xValue",n.range,U);Y=Math.max(Y-1,0),K=Math.min(K+1,U?.length??D.length),e.input.count<1e3&&(Y=0,K=e.input.count),U==null&&(V=[]);for(let $=Y;$Array.isArray($)?Kx($,g):[]),X=Z!=null?{itemId:r,spans:Z}:void 0,Q=_?.some(($,q)=>$===L[q])??!1;return{itemId:r,nodeData:F,labelData:F,strokeData:X,scales:this.calculateScaling(),visible:this.visible,crossFiltering:Q}}isPathOrSelectionDirty(){return this.properties.marker.isDirty()}updatePathNodes(t){const{paths:[e],opacity:i,visible:s,animationEnabled:n}=t,a=this.contextNodeData?.crossFiltering===!0;e.setProperties({fill:void 0,lineJoin:"round",pointerEvents:1,opacity:i,stroke:this.properties.stroke,strokeWidth:this.getStrokeWidth(this.properties.strokeWidth),strokeOpacity:this.properties.strokeOpacity*(a?f_:1),lineDash:this.properties.lineDash,lineDashOffset:this.properties.lineDashOffset}),n||(e.visible=s),qx(this,e)}getMarkerItemBaseStyle(t){const{properties:e}=this,{marker:i}=e,s=t?e.highlightStyle.item:void 0;return{size:i.size,shape:i.shape,fill:s?.fill??i.fill,fillOpacity:s?.fillOpacity??i.fillOpacity,stroke:s?.stroke??i.stroke,strokeWidth:s?.strokeWidth??i.strokeWidth,strokeOpacity:s?.strokeOpacity??i.strokeOpacity,lineDash:s?.lineDash??i.lineDash,lineDashOffset:s?.lineDashOffset??i.lineDashOffset}}getMarkerItemStyleOverrides(t,e,i,s){const{id:n,properties:a}=this,{xKey:o,yKey:r,marker:l}=a,{itemStyler:c}=l;if(c!=null)return this.cachedDatumCallback(Ve(t,s?"highlight":"node"),()=>{const h=this.getSeriesDomain("x"),u=this.getSeriesDomain("y");return c({seriesId:n,...ol(e,o,r,h,u),highlighted:s,...i})})}updateMarkerSelection(t){let{nodeData:e}=t;const{markerSelection:i}=t;return e=this.properties.marker.enabled||this.contextNodeData?.crossFiltering===!0?e:[],this.properties.marker.isDirty()&&(i.clear(),i.cleanup()),i.update(e,void 0,n=>Ve(n.xValue))}updateMarkerNodes(t){const{markerSelection:e,isHighlight:i}=t,{xKey:s,yKey:n,stroke:a,strokeWidth:o,strokeOpacity:r,marker:l,highlightStyle:c}=this.properties,h=this.getSeriesDomain("x"),u=this.getSeriesDomain("y"),d=Tt(i&&c.item,l.getStyle(),{stroke:a,strokeWidth:o,strokeOpacity:r}),p=this.ctx.animationManager.isSkipped();e.each((g,f)=>{this.updateMarkerStyle(g,l,{...ol(f,s,n,h,u),highlighted:i},d,{applyTranslation:p,selected:f.selected})}),i||l.markClean()}updateLabelSelection(t){return t.labelSelection.update(this.isLabelEnabled()?t.labelData:[])}updateLabelNodes(t){const{enabled:e,fontStyle:i,fontWeight:s,fontSize:n,fontFamily:a,color:o}=this.properties.label;t.labelSelection.each((r,l)=>{e&&l?.labelText?(r.fontStyle=i,r.fontWeight=s,r.fontSize=n,r.fontFamily=a,r.textAlign="center",r.textBaseline="bottom",r.text=l.labelText,r.x=l.point.x,r.y=l.point.y-10,r.fill=o,r.visible=!0):r.visible=!1})}getTooltipContent(t){const{id:e,dataModel:i,processedData:s,axes:n,properties:a}=this,{xKey:o,xName:r,yKey:l,yName:c,tooltip:h}=a,u=n.x,d=n.y;if(!i||!s||!u||!d)return;const{datumIndex:p}=t,g=s.dataSources.get(this.id)?.[p],f=i.resolveColumnById(this,"xValue",s)[p],x=i.resolveColumnById(this,"yValueRaw",s)[p];if(f==null)return;const m=this.getMarkerItemBaseStyle(!1);return Object.assign(m,this.getMarkerItemStyleOverrides(String(p),g,m,!1)),h.formatTooltip({heading:u.formatDatum(f),symbol:this.legendItemSymbol(),data:[{label:c,fallbackLabel:l,value:d.formatDatum(x)}]},{seriesId:e,datum:g,title:c,xKey:o,xName:r,yKey:l,yName:c,...m,...this.getModuleTooltipParams()})}legendItemSymbol(){const t="rgba(0, 0, 0, 0)",{stroke:e,strokeOpacity:i,strokeWidth:s,lineDash:n,marker:a}=this.properties;return{marker:{shape:a.shape,fill:a.fill??t,stroke:a.stroke??e??t,fillOpacity:a.fillOpacity,strokeOpacity:a.strokeOpacity,strokeWidth:a.strokeWidth,lineDash:a.lineDash,lineDashOffset:a.lineDashOffset,enabled:a.enabled},line:{stroke:e??t,strokeOpacity:i,strokeWidth:s,lineDash:n}}}getLegendData(t){if(!(this.properties.isValid()&&t==="category"))return[];const{id:e,ctx:{legendManager:i},visible:s}=this,{yKey:n,yName:a,title:o,legendItemName:r,showInLegend:l}=this.properties;return[{legendType:"category",id:e,itemId:n,legendItemName:r,seriesId:e,enabled:s&&i.getItemEnabled({seriesId:e,itemId:n}),label:{text:r??o??a??n},symbol:this.legendItemSymbol(),hideInLegend:!l}]}updatePaths(t){this.updateLinePaths(t.paths,t.contextData)}plotNodeDataPoints(t,e){if(e.length===0)return;const i=e[0].point;t.moveTo(i.x,i.y);for(let s=1;s{this.resetPathAnimation(t),this.updateLinePaths(o,a)},h=()=>{e.skipCurrentBatch(),c()};if(a==null||r==null){c(),sf(this,e,"added",i),Qx(this,"path_properties",e,"add",l),Ht(this,"labels",e,s),Ht(this,"annotations",e,...n);return}if(a.crossFiltering!==r.crossFiltering){h();return}const u=Y1(a,r,this.processedData?.reduced?.diff?.[this.id]);if(u===void 0){h();return}else if(u.status==="no-op")return;De(this.id,"path_properties",e,[l],u.stroke.pathProperties),u.status==="added"?this.updateLinePaths(o,a):u.status==="removed"?this.updateLinePaths(o,r):Hx(this.id,"path_update",e,[l],u.stroke.path),u.hasMotion&&(sf(this,e,void 0,i),Ht(this,"labels",e,s),Ht(this,"annotations",e,...n))}isLabelEnabled(){return this.properties.label.enabled}getBandScalePadding(){return{inner:1,outer:.1}}nodeFactory(){return new yt}getFormattedMarkerStyle(t){const{xKey:e,yKey:i}=this.properties,s=this.getSeriesDomain("x"),n=this.getSeriesDomain("y");return this.getMarkerStyle(this.properties.marker,{...ol(t,e,i,s,n),highlighted:!0})}computeFocusBounds(t){return of(this,t)}},df.className="LineSeries",df.type="line"}}),wD,m_=I({"packages/ag-charts-community/src/chart/series/cartesian/lineSeriesModule.ts"(){"use strict";md(),y_(),wD={type:"series",optionsKey:"series[]",packageType:"community",chartTypes:["cartesian"],identifier:"line",moduleFactory:t=>new df(t),stackable:!0,tooltipDefaults:{range:"nearest"},defaultAxes:[{type:"number",position:"left"},{type:"category",position:"bottom"}],themeTemplate:{series:{tooltip:{position:{type:"node"}},strokeWidth:2,strokeOpacity:1,lineDash:[0],lineDashOffset:0,interpolation:{type:"linear",tension:1,position:"end"},marker:{shape:"circle",size:7,strokeWidth:0},label:{enabled:!1,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"textColor"}},errorBar:{cap:{lengthRatio:1}}}},paletteFactory:t=>{const{marker:e}=iD(t);return{stroke:e.fill,marker:e}}}}}),ED,le,gX=I({"packages/ag-charts-community/src/chart/series/cartesian/scatterSeriesProperties.ts"(){"use strict";Is(),mt(),zn(),Ju(),fr(),Us(),ED=class extends ii{constructor(){super(...arguments),this.placement="top"}},M([k(dm)],ED.prototype,"placement",2),le=class extends ho{constructor(){super(...arguments),this.colorRange=["#ffff00","#00ff00","#0000ff"],this.label=new ED,this.tooltip=new Bi,this.marker=new Pi}},M([k(tt)],le.prototype,"xKey",2),M([k(tt)],le.prototype,"yKey",2),M([k(tt,{optional:!0})],le.prototype,"labelKey",2),M([k(tt,{optional:!0})],le.prototype,"colorKey",2),M([k(tt,{optional:!0})],le.prototype,"xFilterKey",2),M([k(tt,{optional:!0})],le.prototype,"yFilterKey",2),M([k(tt,{optional:!0})],le.prototype,"xName",2),M([k(tt,{optional:!0})],le.prototype,"yName",2),M([k(tt,{optional:!0})],le.prototype,"labelName",2),M([k(tt,{optional:!0})],le.prototype,"colorName",2),M([k(Zp,{optional:!0})],le.prototype,"colorDomain",2),M([k(Bs)],le.prototype,"colorRange",2),M([k(tt,{optional:!0})],le.prototype,"title",2),M([ue("marker.shape")],le.prototype,"shape",2),M([ue("marker.size")],le.prototype,"size",2),M([ue("marker.fill")],le.prototype,"fill",2),M([ue("marker.fillOpacity")],le.prototype,"fillOpacity",2),M([ue("marker.stroke")],le.prototype,"stroke",2),M([ue("marker.strokeWidth")],le.prototype,"strokeWidth",2),M([ue("marker.strokeOpacity")],le.prototype,"strokeOpacity",2),M([ue("marker.lineDash")],le.prototype,"lineDash",2),M([ue("marker.lineDashOffset")],le.prototype,"lineDashOffset",2),M([ue("marker.itemStyler",{optional:!0})],le.prototype,"itemStyler",2),M([k(lt)],le.prototype,"label",2),M([k(lt)],le.prototype,"tooltip",2)}}),ob,fX=I({"packages/ag-charts-community/src/chart/series/cartesian/scatterSeries.ts"(){"use strict";Du(),pe(),lo(),oe(),ln(),Vn(),uo(),ba(),gr(),Us(),rf(),gX(),ob=class extends rr{constructor(t){super({moduleCtx:t,directionKeys:cl,directionNames:hl,pickModes:[2,1,0],pathsPerSeries:[],hasMarkers:!0,markerSelectionGarbageCollection:!1,animationResetFns:{marker:nf,label:pr},usesPlacedLabels:!0}),this.clipFocusBox=!1,this.properties=new le,this.colorScale=new $o}get pickModeAxis(){return"main-category"}async processData(t){if(!this.properties.isValid()||this.data==null||!this.visible)return;const e=this.axes.x?.scale,i=this.axes.y?.scale,{xScaleType:s,yScaleType:n}=this.getScaleInformation({xScale:e,yScale:i}),a=this.colorScale.type,{xKey:o,yKey:r,xFilterKey:l,yFilterKey:c,labelKey:h,colorKey:u,colorDomain:d,colorRange:p}=this.properties,{dataModel:g,processedData:f}=await this.requestDataModel(t,this.data,{props:[Ct(o,s,{id:"xValue"}),Ct(r,n,{id:"yValue"}),...l!=null?[Ct(l,s,{id:"xFilterValue"})]:[],...c!=null?[Ct(c,n,{id:"yFilterValue"})]:[],...u?[Ct(u,a,{id:"colorValue"})]:[],...h?[Ct(h,"band",{id:"labelValue"})]:[]]});if(u){const x=g.resolveProcessedDataIndexById(this,"colorValue");this.colorScale.domain=d??f.domain.values[x]??[],this.colorScale.range=p,this.colorScale.update()}this.animationState.transition("updateData")}xCoordinateRange(t,e){const i=this.axes.x.scale.convert(t),s=.5*this.properties.size*e;return[i-s,i+s]}yCoordinateRange(t,e){const i=this.axes.y.scale.convert(t[0]),s=.5*this.properties.size*e;return[i-s,i+s]}getSeriesDomain(t){const{dataModel:e,processedData:i}=this;if(!i||!e)return[];const s={x:"xValue",y:"yValue"},n=s[t],a=e.resolveProcessedDataDefById(this,n),o=e.getDomain(this,n,"value",i);if(a?.def.type==="value"&&a?.def.valueType==="category")return o;const l=s[t==="x"?"y":"x"],c=this.domainForClippedRange(t,[n],l,!1);return Gs(ar(c))}getSeriesRange(t,e){return this.domainForVisibleRange("y",["yValue"],"xValue",e,!1)}getVisibleItems(t,e,i){return this.countVisibleItems("xValue",["yValue"],t,e,i)}createNodeData(){const{axes:t,dataModel:e,processedData:i,colorScale:s,visible:n}=this,{xKey:a,yKey:o,xFilterKey:r,yFilterKey:l,labelKey:c,colorKey:h,xName:u,yName:d,labelName:p,marker:g,label:f}=this.properties,{placement:x}=f,m=ai.anchor(g.shape),b=t.x,v=t.y;if(!(e&&i&&n&&b&&v))return;const S=e.resolveColumnById(this,"xValue",i),A=e.resolveColumnById(this,"yValue",i),T=h!=null?e.resolveColumnById(this,"colorValue",i):void 0,D=c!=null?e.resolveColumnById(this,"labelValue",i):void 0,L=r!=null?e.resolveColumnById(this,"xFilterValue",i):void 0,C=l!=null?e.resolveColumnById(this,"yFilterValue",i):void 0,O=b.scale,_=v.scale,N=(O.bandwidth??0)/2,P=(_.bandwidth??0)/2,j=[],F=f.getFont(),V=io.getMeasurer({font:F});return(i.dataSources.get(this.id)??[]).forEach((H,G)=>{const B=S[G],z=A[G],U=O.convert(B)+N,Y=_.convert(z)+P,K=L!=null&&C!=null?L[G]===B&&C[G]===z:void 0,Z=this.getLabelText(f,{value:D!=null?D?.[G]:z,datum:H,xKey:a,yKey:o,labelKey:c,xName:u,yName:d,labelName:p}),X=V.measureText(Z),Q=T!=null?s.convert(T[G]):void 0;j.push({series:this,itemId:o,yKey:o,xKey:a,datum:H,datumIndex:G,xValue:B,yValue:z,capDefaults:{lengthRatioMultiplier:g.getDiameter(),lengthMax:1/0},point:{x:U,y:Y,size:g.size},midPoint:{x:U,y:Y},fill:Q,label:{text:Z,...X},anchor:m,placement:x,selected:K})}),{itemId:o,nodeData:j,labelData:j,scales:this.calculateScaling(),visible:this.visible}}isPathOrSelectionDirty(){return this.properties.marker.isDirty()}getLabelData(){return this.isLabelEnabled()?this.contextNodeData?.labelData??[]:[]}updateMarkerSelection(t){const{nodeData:e,markerSelection:i}=t;return this.properties.marker.isDirty()&&(i.clear(),i.cleanup()),i.update(this.properties.marker.enabled?e:[])}getMarkerItemBaseStyle(t){const{properties:e}=this,{marker:i}=e,s=t?e.highlightStyle.item:void 0;return{fill:s?.fill??i.fill,fillOpacity:s?.fillOpacity??i.fillOpacity,stroke:s?.stroke??i.stroke,strokeWidth:s?.strokeWidth??i.strokeWidth,strokeOpacity:s?.strokeOpacity??i.strokeOpacity,lineDash:s?.lineDash??i.lineDash,lineDashOffset:s?.lineDashOffset??i.lineDashOffset}}getMarkerItemStyleOverrides(t,e,i,s){const{id:n,properties:a}=this,{xKey:o,yKey:r,labelKey:l,marker:c}=a,{itemStyler:h}=c;if(h!=null)return this.cachedDatumCallback(Ve(t,s?"highlight":"node"),()=>h({seriesId:n,datum:e,xKey:o,yKey:r,labelKey:l,highlighted:s,...i}))}updateMarkerNodes(t){const{markerSelection:e,isHighlight:i}=t,{xKey:s,yKey:n,labelKey:a,marker:o,highlightStyle:r}=this.properties,l=Tt(i&&r.item,o.getStyle());e.each((c,h)=>{this.updateMarkerStyle(c,o,{datum:h,highlighted:i,xKey:s,yKey:n,labelKey:a},l,{selected:h.selected})}),i||o.markClean()}updatePlacedLabelData(t){this.labelSelection.update(t.map(e=>({...e.datum,point:{x:e.x,y:e.y,size:e.datum.point.size}})),e=>{e.pointerEvents=1}),this.updateLabelNodes({labelSelection:this.labelSelection})}updateLabelNodes(t){const{label:e}=this.properties;t.labelSelection.each((i,s)=>{i.text=s.label.text,i.fill=e.color,i.x=s.point?.x??0,i.y=s.point?.y??0,i.fontStyle=e.fontStyle,i.fontWeight=e.fontWeight,i.fontSize=e.fontSize,i.fontFamily=e.fontFamily,i.textAlign="left",i.textBaseline="top"})}getTooltipContent(t){const{id:e,dataModel:i,processedData:s,axes:n,properties:a}=this,{xKey:o,xName:r,yKey:l,yName:c,labelKey:h,labelName:u,title:d,tooltip:p}=a,g=n.x,f=n.y;if(!i||!s||!g||!f)return;const{datumIndex:x}=t,m=s.dataSources.get(this.id)?.[x],b=i.resolveColumnById(this,"xValue",s)[x],v=i.resolveColumnById(this,"yValue",s)[x];if(b==null)return;const S=this.getMarkerItemBaseStyle(!1);return Object.assign(S,this.getMarkerItemStyleOverrides(String(x),m,S,!1)),p.formatTooltip({symbol:this.legendItemSymbol(),title:d,data:[{label:r,fallbackLabel:o,value:g.formatDatum(b)},{label:c,fallbackLabel:l,value:f.formatDatum(v)}]},{seriesId:e,datum:m,title:c,xKey:o,xName:r,yKey:l,yName:c,labelKey:h,labelName:u,...S,...this.getModuleTooltipParams()})}legendItemSymbol(){const{shape:t,fill:e,stroke:i,fillOpacity:s,strokeOpacity:n,strokeWidth:a,lineDash:o,lineDashOffset:r}=this.properties.marker;return{marker:{shape:t,fill:e??"rgba(0, 0, 0, 0)",stroke:i??"rgba(0, 0, 0, 0)",fillOpacity:s,strokeOpacity:n,strokeWidth:a,lineDash:o,lineDashOffset:r}}}getLegendData(t){if(!this.properties.isValid()||t!=="category")return[];const{yKey:e,yName:i,title:s,showInLegend:n}=this.properties,{id:a,ctx:{legendManager:o},visible:r}=this;return[{legendType:"category",id:a,itemId:e,seriesId:a,enabled:r&&o.getItemEnabled({seriesId:a,itemId:e}),label:{text:s??i??e},symbol:this.legendItemSymbol(),hideInLegend:!n}]}animateEmptyUpdateReady(t){const{markerSelection:e,labelSelection:i,annotationSelections:s}=t;mD(this,this.ctx.animationManager,e),Ht(this,"labels",this.ctx.animationManager,i),Ht(this,"annotations",this.ctx.animationManager,...s)}isLabelEnabled(){return this.properties.label.enabled}nodeFactory(){return new yt}getFormattedMarkerStyle(t){const{xKey:e,yKey:i,labelKey:s}=this.properties;return this.getMarkerStyle(this.properties.marker,{datum:t,xKey:e,yKey:i,labelKey:s,highlighted:!0})}computeFocusBounds(t){return of(this,t)}},ob.className="ScatterSeries",ob.type="scatter"}}),x_,yX=I({"packages/ag-charts-community/src/chart/series/cartesian/scatterSeriesModule.ts"(){"use strict";md(),fX(),x_={type:"series",optionsKey:"series[]",packageType:"community",chartTypes:["cartesian"],identifier:"scatter",moduleFactory:t=>new ob(t),tooltipDefaults:{range:"nearest"},defaultAxes:[{type:"number",position:"bottom"},{type:"number",position:"left"}],themeTemplate:{series:{shape:"circle",size:7,fillOpacity:.8,tooltip:{position:{type:"node"}},label:{enabled:!1,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"textColor"}},errorBar:{cap:{lengthRatio:1}}}},paletteFactory:Qg}}}),RD,b_=I({"packages/ag-charts-community/src/scene/sectorBox.ts"(){"use strict";NM(),RD=class wN{constructor(e,i,s,n){this.startAngle=e,this.endAngle=i,this.innerRadius=s,this.outerRadius=n}clone(){const{startAngle:e,endAngle:i,innerRadius:s,outerRadius:n}=this;return new wN(e,i,s,n)}equals(e){return this.startAngle===e.startAngle&&this.endAngle===e.endAngle&&this.innerRadius===e.innerRadius&&this.outerRadius===e.outerRadius}[Np](e,i){return new wN(this.startAngle*(1-i)+e.startAngle*i,this.endAngle*(1-i)+e.endAngle*i,this.innerRadius*(1-i)+e.innerRadius*i,this.outerRadius*(1-i)+e.outerRadius*i)}}}});function S_({startAngle:t,endAngle:e,innerRadius:i,outerRadius:s}){let n=1/0,a=1/0,o=-1/0,r=-1/0;const l=(c,h)=>{n=Math.min(c,n),a=Math.min(h,a),o=Math.max(c,o),r=Math.max(h,r)};return l(i*Math.cos(t),i*Math.sin(t)),l(i*Math.cos(e),i*Math.sin(e)),l(s*Math.cos(t),s*Math.sin(t)),l(s*Math.cos(e),s*Math.sin(e)),Qr(0,t,e)&&l(s,0),Qr(Math.PI*.5,t,e)&&l(0,s),Qr(Math.PI,t,e)&&l(-s,0),Qr(Math.PI*1.5,t,e)&&l(0,-s),new ht(n,a,o-n,r-a)}function rb(t,e,i){const s=Math.sqrt(Math.pow(t,2)+Math.pow(e,2)),{innerRadius:n,outerRadius:a}=i;if(i.startAngle===i.endAngle||sMath.max(n,a))return!1;const o=tg(i.startAngle),r=tg(i.endAngle),l=Math.atan2(e,t);return o=o:l<=r&&l>=-Math.PI||l>=o&&l<=Math.PI}function v_(t,e){const{startAngle:i,endAngle:s,innerRadius:n,outerRadius:a}=e,o={x:a*Math.cos(i),y:a*Math.sin(i)},r={x:a*Math.cos(s),y:a*Math.sin(s)},l=n===0?{x:0,y:0}:{x:n*Math.cos(i),y:n*Math.sin(i)},c=n===0?{x:0,y:0}:{x:n*Math.cos(s),y:n*Math.sin(s)};return Gu(t.start.x,t.start.y,t.end.x,t.end.y,o.x,o.y,l.x,l.y)||Gu(t.start.x,t.start.y,t.end.x,t.end.y,r.x,r.y,c.x,c.y)||uR(0,0,a,i,s,!0,t.start.x,t.start.y,t.end.x,t.end.y)}function M_(t,e){const i={x:t.x,y:t.y},s={x:t.x+t.width,y:t.y},n={x:t.x,y:t.y+t.height},a={x:t.x+t.width,y:t.y+t.height};return v_({start:i,end:s},e)||v_({start:n,end:a},e)}function I_(t,e,i,s){if(i===0&&s===0)return 0;if(Math.asin(Math.abs(1*i)/(t+1*i))+Math.asin(Math.abs(1*s)/(t+1*s))-e<0)return 1;let a=0,o=1;for(let r=0;r<8;r+=1){const l=(a+o)/2;Math.asin(Math.abs(l*i)/(t+l*i))+Math.asin(Math.abs(l*s)/(t+l*s))-e<0?a=l:o=l}return a}function fl(t,e){return fm(t,e)=2*Math.PI?2*Math.PI:re(e-t);return t=fl(t,i),e=t+n,{startAngle:t,endAngle:e}}function cb(t,e,i,s,n,a){const o=Math.sin(a),r=Math.cos(a),l=t**2+e**2-i**2;let c,h,u,d;if(r>.5){const v=o/r,S=1+v**2,A=-2*(t+e*v),T=A**2-4*S*l;if(T<0)return;const D=(-A+Math.sqrt(T))/(2*S),L=(-A-Math.sqrt(T))/(2*S);c=D,h=D*v,u=L,d=L*v}else{const v=r/o,S=1+v**2,A=-2*(e+t*v),T=A**2-4*S*l;if(T<0)return;const D=(-A+Math.sqrt(T))/(2*S),L=(-A-Math.sqrt(T))/(2*S);c=D*v,h=D,u=L*v,d=L}const p=r,g=o,f=c*p+h*g,x=u*p+d*g,m=f>0?fl(Math.atan2(h-e,c-t),s):NaN,b=x>0?fl(Math.atan2(d-e,u-t),s):NaN;if(m>=s&&m<=n)return m;if(b>=s&&b<=n)return b}function hb(t,e,i,s,n,a){const o=Math.hypot(t,e),r=(o**2-i**2+a**2)/(2*o),l=o-r,c=Math.atan2(e,t),h=Math.acos(-l/i),u=fl(c+h,s),d=fl(c-h,s);if(u>=s&&u<=n)return u;if(d>=s&&d<=n)return d}var A_,ub=I({"packages/ag-charts-community/src/scene/util/sector.ts"(){"use strict";Ii(),Rt(),dR(),A_=1e-6}}),db,pi,pb=I({"packages/ag-charts-community/src/scene/shape/sector.ts"(){"use strict";b_(),ub(),Gn(),db=class{constructor(t,e,i,s,n){this.cx=t,this.cy=e,this.r=i,this.a0=s,this.a1=n,this.a0>=this.a1&&(this.a0=NaN,this.a1=NaN)}isValid(){return Number.isFinite(this.a0)&&Number.isFinite(this.a1)}pointAt(t){return{x:this.cx+this.r*Math.cos(t),y:this.cy+this.r*Math.sin(t)}}clipStart(t){t==null||!this.isValid()||t=this.a1)&&(this.a0=NaN,this.a1=NaN))}clipEnd(t){t==null||!this.isValid()||t>this.a1||(this.a1=t,(Number.isNaN(t)||this.a0>=this.a1)&&(this.a0=NaN,this.a1=NaN))}},pi=class extends ns{constructor(){super(...arguments),this.centerX=0,this.centerY=0,this.innerRadius=10,this.outerRadius=20,this.startAngle=0,this.endAngle=Math.PI*2,this.clipSector=void 0,this.concentricEdgeInset=0,this.radialEdgeInset=0,this.startOuterCornerRadius=0,this.endOuterCornerRadius=0,this.startInnerCornerRadius=0,this.endInnerCornerRadius=0}set inset(t){this.concentricEdgeInset=t,this.radialEdgeInset=t}set cornerRadius(t){this.startOuterCornerRadius=t,this.endOuterCornerRadius=t,this.startInnerCornerRadius=t,this.endInnerCornerRadius=t}computeBBox(){return S_(this).translate(this.centerX,this.centerY)}normalizedRadii(){const{concentricEdgeInset:t}=this;let{innerRadius:e,outerRadius:i}=this;return e=e>0?e+t:0,i=Math.max(i-t,0),{innerRadius:e,outerRadius:i}}normalizedClipSector(){const{clipSector:t}=this;if(t==null)return;const{startAngle:e,endAngle:i}=lb(this.startAngle,this.endAngle),{innerRadius:s,outerRadius:n}=this.normalizedRadii(),a=lb(t.startAngle,t.endAngle,e);return new RD(Math.max(e,a.startAngle),Math.min(i,a.endAngle),Math.max(s,t.innerRadius),Math.min(n,t.outerRadius))}getAngleOffset(t){return t>0?this.radialEdgeInset/t:0}arc(t,e,i,s,n,a,o,r){if(t<=0)return;const{startAngle:l,endAngle:c}=lb(this.startAngle,this.endAngle),{innerRadius:h,outerRadius:u}=this.normalizedRadii(),d=this.normalizedClipSector();if(r&&h<=0)return;const p=r?this.getAngleOffset(h+t):this.getAngleOffset(u-t),g=o?l+p+e:c-p-e,f=r?h+t:u-t,x=f*Math.cos(g),m=f*Math.sin(g);if(d!=null&&(!o&&!(g>=l-1e-6&&g<=d.endAngle-1e-6)||o&&!(g>=d.startAngle+1e-6&&g<=c-1e-6)||r&&fd.outerRadius+1e-6))return;const b=new db(x,m,t,i,s);if(d!=null){r?(b.clipStart(cb(x,m,t,i,s,d.endAngle)),b.clipEnd(cb(x,m,t,i,s,d.startAngle))):(b.clipStart(cb(x,m,t,i,s,d.startAngle)),b.clipEnd(cb(x,m,t,i,s,d.endAngle)));let D,L;if(o?(D=hb(x,m,t,i,s,d.innerRadius),L=hb(x,m,t,i,s,d.outerRadius)):(D=hb(x,m,t,i,s,d.outerRadius),L=hb(x,m,t,i,s,d.innerRadius)),b.clipStart(D),b.clipEnd(L),D!=null){const{x:C,y:O}=b.pointAt(D),_=fl(Math.atan2(O,C),l);o?a?.clipStart(_):n.clipEnd(_)}if(L!=null){const{x:C,y:O}=b.pointAt(L),_=fl(Math.atan2(O,C),l);o?n.clipStart(_):a?.clipEnd(_)}}if(d!=null){const{x:D,y:L}=b.pointAt((b.a0+b.a1)/2);if(!rb(D,L,d))return}const{x:v,y:S}=b.pointAt(o===r?b.a0:b.a1),A=fl(Math.atan2(S,v),l),T=r?a:n;return o?T?.clipStart(A):T?.clipEnd(A),b}updatePath(){const{path:e,centerX:i,centerY:s,concentricEdgeInset:n,radialEdgeInset:a}=this;let{startOuterCornerRadius:o,endOuterCornerRadius:r,startInnerCornerRadius:l,endInnerCornerRadius:c}=this;const{startAngle:h,endAngle:u}=lb(this.startAngle,this.endAngle),{innerRadius:d,outerRadius:p}=this.normalizedRadii(),g=this.normalizedClipSector(),f=u-h,x=f>=2*Math.PI-1e-6;if(e.clear(),d===0&&p===0||d>p)return;if((g?.startAngle??h)===(g?.endAngle??u))return;if(x&&this.clipSector==null&&o===0&&r===0&&l===0&&c===0){e.moveTo(i+p*Math.cos(h),s+p*Math.sin(h)),e.arc(i,s,p,h,u),d>n&&(e.moveTo(i+d*Math.cos(u),s+d*Math.sin(u)),e.arc(i,s,d,u,h,!0)),e.closePath();return}else if(this.clipSector==null&&Math.abs(d-p)<1e-6){e.arc(i,s,p,h,u,!1),e.arc(i,s,p,u,h,!0),e.closePath();return}const m=this.getAngleOffset(d),b=this.getAngleOffset(p);if(f<2*b)return;const S=(g?.innerRadius??d)>n,A=d0?Math.min(T/D,1):1;o*=L,r*=L,l*=L,c*=L;const C=I_(p,f-2*b,-o,-r);if(o*=C,r*=C,!A&&S){const $=I_(d,f-2*m,l,c);l*=$,c*=$}else l=0,c=0;const O=Math.max(o+l,r+c),_=O>0?Math.min(T/O,1):1;o*=_,r*=_,l*=_,c*=_;let N=0,P=0;const j=o/(p-o),F=r/(p-r);if(j>=0&&j<1-1e-6)N=Math.asin(j);else{N=f/2;const $=p/(1/Math.sin(N)+1);o=Math.min($,o)}if(F>=0&&F<1-1e-6)P=Math.asin(F);else{P=f/2;const $=p/(1/Math.sin(P)+1);r=Math.min($,r)}const V=Math.asin(l/(d+l)),W=Math.asin(c/(d+c)),H=g?.outerRadius??p,G=this.getAngleOffset(H),B=new db(0,0,H,h+G,u-G),z=g?.innerRadius??d,U=this.getAngleOffset(z),Y=S?new db(0,0,z,h+U,u-U):void 0;g!=null&&(B.clipStart(g.startAngle),B.clipEnd(g.endAngle),Y?.clipStart(g.startAngle),Y?.clipEnd(g.endAngle));const K=this.arc(o,N,h-Math.PI*.5,h+N,B,Y,!0,!1),Z=this.arc(r,P,u-P,u+Math.PI*.5,B,Y,!1,!1),X=this.arc(c,W,u+Math.PI*.5,u+Math.PI-W,B,Y,!1,!0),Q=this.arc(l,V,h+Math.PI+V,h+Math.PI*1.5,B,Y,!0,!0);if(A){const $=f0&&$({innerRadius:n[0],outerRadius:n[0]+(n[1]-n[0])*g}),c=({radius:g})=>({innerRadius:a[0],outerRadius:a[0]+(a[1]-a[0])*g});return{nodes:{toFn:(g,f,x,{prevLive:m})=>{let{startAngle:b,endAngle:v,innerRadius:S,outerRadius:A}=f;const{stroke:T,fill:D}=f.sectorFormat;if(x==="removed"&&m?(b=m.datum?.endAngle,v=m.datum?.endAngle):x==="removed"&&!m&&(b=o,v=o),x==="removed"){const L=l(f);S=L.innerRadius,A=L.outerRadius}return{startAngle:b,endAngle:v,outerRadius:A,innerRadius:S,stroke:T,fill:D}},fromFn:(g,f,x,{prevFromProps:m})=>{let{startAngle:b,endAngle:v,innerRadius:S,outerRadius:A}=g,{fill:T,stroke:D}=f.sectorFormat;if(x==="unknown"||x==="added"&&!m?(b=o,v=o,S=f.innerRadius,A=f.outerRadius):x==="added"&&m&&(b=m.endAngle??o,v=m.endAngle??o,S=m.innerRadius??f.innerRadius,A=m.outerRadius??f.outerRadius),x==="added"&&!t){const L=c(f);S=L.innerRadius,A=L.outerRadius}return x==="updated"&&(T=g.fill??T,D=(typeof g.stroke=="string"?g.stroke:void 0)??D),{startAngle:b,endAngle:v,innerRadius:S,outerRadius:A,fill:T,stroke:D,phase:r}}},innerCircle:{fromFn:(g,f)=>({size:g.previousDatum?.radius??g.size??0,phase:r}),toFn:(g,f)=>({size:f.radius??0})}}}function PD(t,e){return{startAngle:e.startAngle,endAngle:e.endAngle,innerRadius:e.innerRadius,outerRadius:e.outerRadius,fill:e.sectorFormat.fill,stroke:e.sectorFormat.stroke}}function BD(t,e){const i=e.y-t.centerY,s=e.x-t.centerX,n=Math.atan2(i,s),a=t.getItemNodes();for(const o of a)if(o.datum.missing!==!0&&Qr(n,o.startAngle,o.endAngle)){const r=Math.sqrt(s*s+i*i);let l=0;return ro.outerRadius&&(l=r-o.outerRadius),{datum:o.datum,distance:l}}}var zD=I({"packages/ag-charts-community/src/chart/series/polar/pieUtil.ts"(){"use strict";Ii()}}),FD,xX=I({"packages/ag-charts-community/src/chart/series/polar/polarZIndexMap.ts"(){"use strict";FD=(t=>(t[t.BACKGROUND=0]="BACKGROUND",t[t.FOREGROUND=1]="FOREGROUND",t[t.HIGHLIGHT=2]="HIGHLIGHT",t[t.LABEL=3]="LABEL",t))(FD||{})}}),gf,xb=I({"packages/ag-charts-community/src/chart/series/polar/polarSeries.ts"(){"use strict";Ac(),pe(),el(),Gn(),Fs(),ig(),CA(),gf=class extends Ix{constructor({useLabelLayer:t=!1,pickModes:e=[1,0],canHaveAxes:i=!1,animationResetFns:s,...n}){super({...n,useLabelLayer:t,pickModes:e,directionKeys:{x:["angleKey"],y:["radiusKey"]},directionNames:{x:["angleName"],y:["radiusName"]},canHaveAxes:i}),this.itemGroup=this.contentGroup.appendChild(new yt),this.nodeData=[],this.itemSelection=Oe.select(this.itemGroup,()=>this.nodeFactory(),!1),this.labelSelection=Oe.select(this.labelGroup,()=>this.labelFactory(),!1),this.highlightSelection=Oe.select(this.highlightGroup,()=>this.nodeFactory()),this.highlightLabelSelection=Oe.select(this.highlightLabel,()=>this.labelFactory()),this.centerX=0,this.centerY=0,this.radius=0,this.animationResetFns=s,this.animationState=new Cu("empty",{empty:{update:{target:"ready",action:a=>this.animateEmptyUpdateReady(a)},reset:"empty",skip:"ready"},ready:{updateData:"waiting",clear:"clearing",highlight:a=>this.animateReadyHighlight(a),highlightMarkers:a=>this.animateReadyHighlightMarkers(a),resize:a=>this.animateReadyResize(a),reset:"empty",skip:"ready"},waiting:{update:{target:"ready",action:a=>this.animateWaitingUpdateReady(a)},reset:"empty",skip:"ready"},clearing:{update:{target:"empty",action:a=>this.animateClearingUpdateEmpty(a)},reset:"empty",skip:"ready"}},()=>this.checkProcessedDataAnimatable())}getItemNodes(){return[...this.itemGroup.children()]}getNodeData(){return this.nodeData}setSeriesIndex(t){return super.setSeriesIndex(t)?(this.contentGroup.zIndex=[t,1],this.highlightGroup.zIndex=[t,2],this.labelGroup.zIndex=[t,3],!0):!1}resetAnimation(t){t==="initial"?this.animationState.transition("reset"):t==="ready"&&this.animationState.transition("skip")}labelFactory(){const t=new ei;return t.pointerEvents=1,t}addChartEventListeners(){this.destroyFns.push(this.ctx.chartEventManager?.addListener("legend-item-click",t=>this.onLegendItemClick(t)))}getInnerRadius(){return 0}computeLabelsBBox(t,e){return null}resetAllAnimation(){const{item:t,label:e}=this.animationResetFns??{};this.ctx.animationManager.stopByAnimationGroupId(this.id),t&&Mi([this.itemSelection,this.highlightSelection],t),e&&Mi([this.labelSelection,this.highlightLabelSelection],e),this.itemSelection.cleanup(),this.labelSelection.cleanup(),this.highlightSelection.cleanup(),this.highlightLabelSelection.cleanup()}animateEmptyUpdateReady(t){this.ctx.animationManager.skipCurrentBatch(),this.resetAllAnimation()}animateWaitingUpdateReady(t){this.ctx.animationManager.skipCurrentBatch(),this.resetAllAnimation()}animateReadyHighlight(t){const{item:e,label:i}=this.animationResetFns??{};e&&Mi([this.highlightSelection],e),i&&Mi([this.highlightLabelSelection],i)}animateReadyHighlightMarkers(t){}animateReadyResize(t){this.resetAllAnimation()}animateClearingUpdateEmpty(t){this.ctx.animationManager.skipCurrentBatch(),this.resetAllAnimation()}computeFocusBounds(t){const e=this.getNodeData()?.[t.datumIndex];if(e!==void 0)return this.itemSelection.select(i=>i instanceof ns&&i.datum===e)[0]}getSeriesRange(t,e){return[NaN,NaN]}}}}),D_,bb,bX=I({"packages/ag-charts-community/src/chart/series/polar/donutSeries.ts"(){"use strict";ot(),wi(),Zc(),Rt(),pe(),el(),Oc(),pb(),Fs(),ub(),Ii(),il(),jn(),At(),oe(),Vn(),uo(),ba(),$c(),gr(),mX(),zD(),xb(),D_=class extends Vu{constructor(t,e,i,s){super(t,e,i,s),this.angleKey=s.properties.angleKey,this.radiusKey=s.properties.radiusKey,this.calloutLabelKey=s.properties.calloutLabelKey,this.sectorLabelKey=s.properties.sectorLabelKey}},bb=class extends gf{constructor(t){super({moduleCtx:t,pickModes:[1,0],useLabelLayer:!0,animationResetFns:{item:PD,label:pr}}),this.properties=new wt,this.phantomNodeData=void 0,this.backgroundGroup=new is({name:`${this.id}-background`,zIndex:0}),this.noVisibleData=!1,this.previousRadiusScale=new Un,this.radiusScale=new Un,this.phantomGroup=this.backgroundGroup.appendChild(new yt({name:"phantom"})),this.phantomSelection=Oe.select(this.phantomGroup,()=>this.nodeFactory(),!1),this.calloutLabelGroup=this.contentGroup.appendChild(new yt({name:"pieCalloutLabels"})),this.calloutLabelSelection=new Oe(this.calloutLabelGroup,yt),this.zerosumRingsGroup=this.backgroundGroup.appendChild(new yt({name:`${this.id}-zerosumRings`})),this.zerosumOuterRing=this.zerosumRingsGroup.appendChild(new ai({shape:"circle"})),this.zerosumInnerRing=this.zerosumRingsGroup.appendChild(new ai({shape:"circle"})),this.innerLabelsGroup=this.contentGroup.appendChild(new yt({name:"innerLabels"})),this.innerCircleGroup=this.backgroundGroup.appendChild(new yt({name:`${this.id}-innerCircle`})),this.innerLabelsSelection=Oe.select(this.innerLabelsGroup,ei),this.innerCircleSelection=Oe.select(this.innerCircleGroup,()=>new ai({shape:"circle"})),this.surroundingRadius=void 0,this.NodeEvent=D_,this.angleScale=new Un,this.angleScale.domain=[0,1],this.angleScale.range=[-Math.PI,Math.PI].map(e=>e+Math.PI/2),this.phantomGroup.opacity=.2}get calloutNodeData(){return this.phantomNodeData??this.nodeData}attachSeries(t,e,i){super.attachSeries(t,e,i),t?.appendChild(this.backgroundGroup)}detachSeries(t,e,i){super.detachSeries(t,e,i),t?.removeChild(this.backgroundGroup)}setSeriesIndex(t){return super.setSeriesIndex(t)?(this.backgroundGroup.zIndex=[0,t],!0):!1}nodeFactory(){return new pi}getSeriesDomain(t){return t==="x"?this.angleScale.domain:this.radiusScale.domain}async processData(t){if(this.data==null||!this.properties.isValid())return;const{visible:e,id:i}=this,{angleKey:s,angleFilterKey:n,radiusKey:a,calloutLabelKey:o,sectorLabelKey:r,legendItemKey:l}=this.properties,c=(f,x,m)=>e&&this.ctx.legendManager.getItemEnabled({seriesId:i,itemId:m}),h=!this.ctx.animationManager.isSkipped(),u=[],d=[];l?u.push(va(l,"band",{id:"legendItemKey"})):o?u.push(va(o,"band",{id:"calloutLabelKey"})):r&&u.push(va(r,"band",{id:"sectorLabelKey"}));const p=this.radiusScale.type,g=this.angleScale.type;a&&d.push(zA(a,{id:"radiusValue",min:this.properties.radiusMin??0,max:this.properties.radiusMax}),Ct(a,p,{id:"radiusRaw"}),Qc("radiusValue",[0,1],1,this.properties.radiusMin??0,this.properties.radiusMax)),o&&d.push(Ct(o,"band",{id:"calloutLabelValue"})),r&&d.push(Ct(r,"band",{id:"sectorLabelValue"})),l&&d.push(Ct(l,"band",{id:"legendItemValue"})),n&&d.push(Eg(n,g,{id:"angleFilterValue",onlyPositive:!0,validation:c,invalidValue:0}),Ct(n,g,{id:"angleFilterRaw"}),Qc("angleFilterValue",[0,1],0,0)),h&&this.processedData&&u.length>0&&d.push(Zu(this.id,this.processedData)),d.push(Xu()),await this.requestDataModel(t,this.data,{props:[...u,Eg(s,g,{id:"angleValue",onlyPositive:!0,validation:c,invalidValue:0}),Ct(s,g,{id:"angleRaw"}),Qc("angleValue",[0,1],0,0),...d]});for(const f of this.processedData?.defs?.values??[]){const{id:x,missing:m,property:b}=f,v=JI(this,m);x!=="angleRaw"&&v>0&&et.warnOnce(`no value was found for the key '${String(b)}' on ${v} data element${v>1?"s":""}`)}this.animationState.transition("updateData")}maybeRefreshNodeData(){if(!this.nodeDataRefresh)return;const{nodeData:t=[],phantomNodeData:e}=this.createNodeData()??{};this.nodeData=t,this.phantomNodeData=e,this.nodeDataRefresh=!1}getProcessedDataValues(t,e){const i=t.resolveColumnById(this,"angleValue",e),s=t.resolveColumnById(this,"angleRaw",e),n=this.properties.angleFilterKey!=null?t.resolveColumnById(this,"angleFilterValue",e):void 0,a=this.properties.angleFilterKey!=null?t.resolveColumnById(this,"angleFilterRaw",e):void 0,o=this.properties.radiusKey?t.resolveColumnById(this,"radiusValue",e):void 0,r=this.properties.radiusKey?t.resolveColumnById(this,"radiusRaw",e):void 0,l=this.properties.calloutLabelKey?t.resolveColumnById(this,"calloutLabelValue",e):void 0,c=this.properties.sectorLabelKey?t.resolveColumnById(this,"sectorLabelValue",e):void 0,h=this.properties.legendItemKey?t.resolveColumnById(this,"legendItemValue",e):void 0;return{angleValues:i,angleRawValues:s,angleFilterValues:n,angleFilterRawValues:a,radiusValues:o,radiusRawValues:r,calloutLabelValues:l,sectorLabelValues:c,legendItemValues:h}}createNodeData(){const{id:t,processedData:e,dataModel:i,angleScale:s,ctx:{legendManager:n},visible:a}=this,{rotation:o,innerRadiusRatio:r}=this.properties;if(!this.properties.isValid())return this.zerosumOuterRing.visible=!0,this.zerosumInnerRing.visible=!0,{itemId:t,nodeData:[],labelData:[]};if(!i||e?.type!=="ungrouped")return;const{angleValues:l,angleRawValues:c,angleFilterValues:h,angleFilterRawValues:u,radiusValues:d,radiusRawValues:p,calloutLabelValues:g,sectorLabelValues:f,legendItemValues:x}=this.getProcessedDataValues(i,e),m=u?.some((L,C)=>L>c[C])??!1;let b=0,v=0;const S=[],A=u!=null?[]:void 0,T=e.dataSources.get(this.id)??[],D=e.invalidData?.get(this.id);return T.forEach((L,C)=>{if(D?.[C]===!0)return;const O=m?h[C]:l[C],_=u!=null&&!m?Math.sqrt(u[C]/c[C]):1,N=s.convert(b)+ti(o);b=O,v+=O;const P=s.convert(b)+ti(o),j=Math.abs(P-N),F=N+j/2,V=c[C],H=(d?.[C]??1)*_,G=p?.[C],B=x?.[C],z=this.getLabels(L,F,j,!0,g?.[C],f?.[C],B),U=this.getSectorFormat(L,C,!1),Y={itemId:C,series:this,datum:L,datumIndex:C,angleValue:V,midAngle:F,midCos:Math.cos(F),midSin:Math.sin(F),startAngle:N,endAngle:P,radius:H,innerRadius:Math.max(this.radiusScale.convert(0),0),outerRadius:Math.max(this.radiusScale.convert(H),0),sectorFormat:U,radiusValue:G,legendItemValue:B,enabled:a&&n.getItemEnabled({seriesId:t,itemId:C}),focusable:!0,...z};S.push(Y),A?.push({...Y,radius:1,innerRadius:Math.max(this.radiusScale.convert(0),0),outerRadius:Math.max(this.radiusScale.convert(1),0),focusable:!1})}),this.zerosumOuterRing.visible=v===0,this.zerosumInnerRing.visible=v===0&&r!=null&&r!==1&&r>0,{itemId:t,nodeData:S,labelData:S,phantomNodeData:A}}getLabels(t,e,i,s,n,a,o){const{calloutLabel:r,sectorLabel:l,legendItemKey:c}=this.properties,h=!s||r.enabled?this.properties.calloutLabelKey:void 0,u=!s||l.enabled?this.properties.sectorLabelKey:void 0;if(!h&&!u&&!c)return{};const d={datum:t,angleKey:this.properties.angleKey,angleName:this.properties.angleName,radiusKey:this.properties.radiusKey,radiusName:this.properties.radiusName,calloutLabelKey:this.properties.calloutLabelKey,calloutLabelName:this.properties.calloutLabelName,sectorLabelKey:this.properties.sectorLabelKey,sectorLabelName:this.properties.sectorLabelName,legendItemKey:this.properties.legendItemKey},p={};return h&&i>=ti(r.minAngle)&&(p.calloutLabel={...this.getTextAlignment(e),text:this.getLabelText(r,{...d,value:n}),hidden:!1,collisionTextAlign:void 0,collisionOffsetY:0,box:void 0}),u&&(p.sectorLabel={text:this.getLabelText(l,{...d,value:a})}),c!=null&&o!=null&&(p.legendItem={key:c,text:o}),p}getTextAlignment(t){const e=[{textAlign:"center",textBaseline:"bottom"},{textAlign:"left",textBaseline:"middle"},{textAlign:"center",textBaseline:"hanging"},{textAlign:"right",textBaseline:"middle"}],i=tg(t),s=-.75*Math.PI,n=i-s,a=Math.floor(n/(Math.PI/2)),o=wM(a,e.length);return e[o]}getSectorFormat(t,e,i){const{angleKey:s,radiusKey:n,calloutLabelKey:a,sectorLabelKey:o,legendItemKey:r,fills:l,strokes:c,itemStyler:h}=this.properties,u=c[e%c.length],{fill:d,fillOpacity:p,stroke:g,strokeWidth:f,strokeOpacity:x,lineDash:m,lineDashOffset:b,cornerRadius:v}=Tt(i&&this.properties.highlightStyle.item,{fill:l.length>0?l[e%l.length]:void 0,stroke:u,strokeWidth:this.getStrokeWidth(this.properties.strokeWidth),strokeOpacity:this.getOpacity()},this.properties);let S;return h&&(S=this.cachedDatumCallback(this.getDatumId(t,e)+(i?"-highlight":"-hide"),()=>h({datum:t,angleKey:s,radiusKey:n,calloutLabelKey:a,sectorLabelKey:o,legendItemKey:r,fill:d,fillOpacity:p,stroke:g,strokeWidth:f,strokeOpacity:x,lineDash:m,lineDashOffset:b,cornerRadius:v,highlighted:i,seriesId:this.id}))),{fill:S?.fill??d,fillOpacity:S?.fillOpacity??p,stroke:S?.stroke??g,strokeWidth:S?.strokeWidth??f,strokeOpacity:S?.strokeOpacity??x,lineDash:S?.lineDash??m,lineDashOffset:S?.lineDashOffset??b,cornerRadius:S?.cornerRadius??v}}getInnerRadius(){const{radius:t}=this,{innerRadiusRatio:e=1,innerRadiusOffset:i=0}=this.properties,s=t*e+i;return s===t||s<0?0:s}getOuterRadius(){const{outerRadiusRatio:t,outerRadiusOffset:e}=this.properties;return Math.max(this.radius*t+e,0)}updateRadiusScale(t){const e=[this.getInnerRadius(),this.getOuterRadius()];this.radiusScale.range=e,t&&(this.previousRadiusScale.range=e);const i=s=>({...s,innerRadius:Math.max(this.radiusScale.convert(0),0),outerRadius:Math.max(this.radiusScale.convert(s.radius),0)});this.nodeData=this.nodeData.map(i),this.phantomNodeData=this.phantomNodeData?.map(i)}getTitleTranslationY(){const t=Math.max(0,this.radiusScale.range[1]);if(t===0)return NaN;const i=2+(this.properties.title?.spacing??0),s=Math.max(0,-t);return-t-i-s}update({seriesRect:t}){const{title:e}=this.properties,i={seriesRectWidth:t?.width,seriesRectHeight:t?.height},s=Qo(this.nodeDataDependencies,i)!=null;if(s&&(this._nodeDataDependencies=i),this.maybeRefreshNodeData(),this.updateTitleNodes(),this.updateRadiusScale(s),this.contentGroup.translationX=this.centerX,this.contentGroup.translationY=this.centerY,this.highlightGroup.translationX=this.centerX,this.highlightGroup.translationY=this.centerY,this.backgroundGroup.translationX=this.centerX,this.backgroundGroup.translationY=this.centerY,this.labelGroup&&(this.labelGroup.translationX=this.centerX,this.labelGroup.translationY=this.centerY),e){const n=this.getTitleTranslationY();e.node.y=isFinite(n)?n:0;const a=e.node.getBBox();e.node.visible=e.enabled&&isFinite(n)&&!this.bboxIntersectsSurroundingSeries(a)}for(const n of[this.zerosumInnerRing,this.zerosumOuterRing])n.fillOpacity=0,n.stroke=this.properties.calloutLabel.color,n.strokeWidth=1,n.strokeOpacity=1;this.updateNodeMidPoint(),this.updateSelections(),this.updateNodes(t)}updateTitleNodes(){const{oldTitle:t}=this,{title:e}=this.properties;t!==e&&(t&&this.labelGroup?.removeChild(t.node),e&&(e.node.textBaseline="bottom",this.labelGroup?.appendChild(e.node)),this.oldTitle=e)}updateNodeMidPoint(){const t=e=>{const i=e.innerRadius+(e.outerRadius-e.innerRadius)/2;e.midPoint={x:e.midCos*Math.max(0,i),y:e.midSin*Math.max(0,i)}};this.nodeData.forEach(t),this.phantomNodeData?.forEach(t)}updateSelections(){this.updateGroupSelection(),this.updateInnerCircleSelection()}updateGroupSelection(){const{itemSelection:t,highlightSelection:e,phantomSelection:i,highlightLabelSelection:s,calloutLabelSelection:n,labelSelection:a,innerLabelsSelection:o}=this,r=this.nodeData.map(c=>({...c,sectorFormat:{...c.sectorFormat}})),l=(c,h)=>{c.update(h,void 0,u=>this.getDatumId(u.datum,u.datumIndex)),this.ctx.animationManager.isSkipped()&&c.cleanup()};l(t,this.nodeData),l(e,r),l(i,this.phantomNodeData??[]),n.update(this.calloutNodeData,c=>{const h=new Vs;h.tag=0,h.pointerEvents=1,c.appendChild(h);const u=new ei;u.tag=1,u.pointerEvents=1,c.appendChild(u)}),a.update(this.nodeData),s.update(r),o.update(this.properties.innerLabels,c=>{c.pointerEvents=1})}updateInnerCircleSelection(){const{innerCircle:t}=this.properties;let e=0;const i=this.getInnerRadius();if(i>0){const n=Math.min(i,this.getOuterRadius()),a=1;e=Math.ceil(n*2+a)}const s=t?[{radius:e}]:[];this.innerCircleSelection.update(s)}updateNodes(t){const e=this.ctx.highlightManager.getActiveHighlight(),{visible:i}=this;this.backgroundGroup.visible=i,this.contentGroup.visible=i,this.highlightGroup.visible=i&&e?.series===this,this.highlightLabel.visible=i&&e?.series===this,this.labelGroup.visible=i,this.contentGroup.opacity=this.getOpacity(),this.innerCircleSelection.each((a,{radius:o})=>{a.setProperties({fill:this.properties.innerCircle?.fill,opacity:this.properties.innerCircle?.fillOpacity,size:o})});const s=this.ctx.animationManager.isSkipped(),n=(a,o,r,l)=>{const c=this.getSectorFormat(o.datum,o.itemId,l);o.sectorFormat.fill=c.fill,o.sectorFormat.stroke=c.stroke,s&&(a.startAngle=o.startAngle,a.endAngle=o.endAngle,a.innerRadius=o.innerRadius,a.outerRadius=o.outerRadius),(l||s)&&(a.fill=c.fill,a.stroke=c.stroke),a.strokeWidth=c.strokeWidth,a.fillOpacity=c.fillOpacity,a.strokeOpacity=c.strokeOpacity,a.lineDash=c.lineDash,a.lineDashOffset=c.lineDashOffset,a.cornerRadius=c.cornerRadius,a.fillShadow=this.properties.shadow;const h=Math.max((this.properties.sectorSpacing+(c.stroke!=null?c.strokeWidth:0))/2,0);a.inset=h,a.lineJoin=this.properties.sectorSpacing>=0||h>0?"miter":"round"};this.itemSelection.each((a,o,r)=>n(a,o,r,!1)),this.highlightSelection.each((a,o,r)=>{n(a,o,r,!0),a.visible=o.itemId===e?.itemId}),this.phantomSelection.each((a,o,r)=>n(a,o,r,!1)),this.updateCalloutLineNodes(),this.updateCalloutLabelNodes(t),this.updateSectorLabelNodes(),this.updateInnerLabelNodes(),this.updateZerosumRings(),this.animationState.transition("update")}updateCalloutLineNodes(){const{calloutLine:t}=this.properties,e=t.length,i=t.strokeWidth,s=t.colors??this.properties.strokes,{offset:n}=this.properties.calloutLabel;this.calloutLabelSelection.selectByTag(0).forEach((a,o)=>{const r=a.datum,{calloutLabel:l,outerRadius:c}=r;if(l?.text&&!l.hidden&&c!==0){a.visible=!0,a.strokeWidth=i,a.stroke=s[o%s.length],a.fill=void 0;const h=r.midCos*c,u=r.midSin*c;let d=r.midCos*(c+e),p=r.midSin*(c+e);if((l.collisionTextAlign??l.collisionOffsetY!==0)&&l.box!=null){const f=l.box;let x=d,m=p;df.x+f.width&&(x=f.x+f.width),pf.y+f.height&&(m=f.y+f.height);const b=x-d,v=m-p,S=Math.sqrt(Math.pow(b,2)+Math.pow(v,2)),A=S-n;A>0&&(d=d+b*A/S,p=p+v*A/S)}a.x1=h,a.y1=u,a.x2=d,a.y2=p}else a.visible=!1})}getLabelOverflow(t,e,i){const s=-this.centerX,n=s+i.width,a=-this.centerY,o=a+i.height,r=1;let l=1;e.x+rn&&(l=(n-e.x)/e.width);const c=e.y+ro,h=l===1?t.length:Math.floor(t.length*l)-1,u=this.bboxIntersectsSurroundingSeries(e);return{textLength:h,hasVerticalOverflow:c,hasSurroundingSeriesOverflow:u}}bboxIntersectsSurroundingSeries(t){const{surroundingRadius:e}=this;if(e==null)return!1;const i=[{x:t.x,y:t.y},{x:t.x+t.width,y:t.y},{x:t.x+t.width,y:t.y+t.height},{x:t.x,y:t.y+t.height}],s=e**2;return i.some(n=>n.x**2+n.y**2>s)}computeCalloutLabelCollisionOffsets(){const{radiusScale:t}=this,{calloutLabel:e,calloutLine:i}=this.properties,{offset:s,minSpacing:n}=e,a=t.convert(0),o=m=>!m.calloutLabel||m.outerRadius===0,r=this.calloutNodeData,l=r.filter(m=>!o(m));if(l.forEach(m=>{const b=m.calloutLabel;b!=null&&(b.hidden=!1,b.collisionTextAlign=void 0,b.collisionOffsetY=0)}),l.length<=1)return;const c=l.filter(m=>m.midCos<0).sort((m,b)=>m.midSin-b.midSin),h=l.filter(m=>m.midCos>=0).sort((m,b)=>m.midSin-b.midSin),u=l.filter(m=>m.midSin<0&&m.calloutLabel?.textAlign==="center").sort((m,b)=>m.midCos-b.midCos),d=l.filter(m=>m.midSin>=0&&m.calloutLabel?.textAlign==="center").sort((m,b)=>m.midCos-b.midCos),p=m=>{const b=m.calloutLabel;if(b==null)return ht.zero.clone();const v=m.outerRadius+i.length+s,S=m.midCos*v,A=m.midSin*v+b.collisionOffsetY,T=b.collisionTextAlign??b.textAlign,D=b.textBaseline;return ei.computeBBox(b.text,S,A,{font:this.properties.calloutLabel,textAlign:T,textBaseline:D})},g=(m,b,v)=>{const S=p(m).grow(n/2),A=p(b).grow(n/2);S.xA.x&&(v==="to-top"?S.yA.y)&&(b.calloutLabel.collisionOffsetY=v==="to-top"?S.y-A.y-A.height:S.y+S.height-A.y)},f=m=>{const b=m.slice().sort((S,A)=>Math.abs(S.midSin)-Math.abs(A.midSin))[0],v=m.indexOf(b);for(let S=v-1;S>=0;S--){const A=m[S+1],T=m[S];g(A,T,"to-top")}for(let S=v+1;S{const b=l.some(L=>L.calloutLabel.collisionOffsetY!==0),v=m.map(L=>p(L)),S=v.map(L=>L.clone().grow(n/2));let A=!1;for(let L=0;L{const{startAngle:C,endAngle:O,outerRadius:_}=L;return{startAngle:C,endAngle:O,innerRadius:a,outerRadius:_}}),D=v.some(L=>T.some(C=>M_(L,C)));!A&&!b&&!D||m.filter(L=>L.calloutLabel.textAlign==="center").forEach(L=>{const C=L.calloutLabel;L.midCos<0?C.collisionTextAlign="right":L.midCos>0?C.collisionTextAlign="left":C.collisionTextAlign="center"})};f(c),f(h),x(u),x(d)}updateCalloutLabelNodes(t){const{radiusScale:e}=this,{calloutLabel:i,calloutLine:s}=this.properties,n=s.length,{offset:a,color:o}=i,r=new ei;this.calloutLabelSelection.selectByTag(1).forEach(l=>{const{datum:c}=l,h=c.calloutLabel,u=e.convert(c.radius),d=Math.max(0,u);if(!h?.text||d===0||h.hidden){l.visible=!1;return}const p=d+n+a,g=c.midCos*p,f=c.midSin*p+h.collisionOffsetY,x={textAlign:h.collisionTextAlign??h.textAlign,textBaseline:h.textBaseline};r.text=h.text,r.x=g,r.y=f,r.setFont(this.properties.calloutLabel),r.setAlign(x);const m=r.getBBox();let b=h.text,v=!0;if(i.avoidCollisions){const{textLength:S,hasVerticalOverflow:A}=this.getLabelOverflow(h.text,m,t);b=h.text.length===S?h.text:`${h.text.substring(0,S)}\u2026`,v=!A}l.text=b,l.x=g,l.y=f,l.setFont(this.properties.calloutLabel),l.setAlign(x),l.fill=o,l.visible=v})}computeLabelsBBox(t,e){const{calloutLabel:i,calloutLine:s}=this.properties,n=s.length,{offset:a,maxCollisionOffset:o,minSpacing:r}=i;if(!i.avoidCollisions)return null;this.maybeRefreshNodeData(),this.updateRadiusScale(!1),this.computeCalloutLabelCollisionOffsets();const l=[],c=new ei;let h;const{title:u}=this.properties;if(u?.text&&u.enabled){const d=this.getTitleTranslationY();isFinite(d)&&(c.text=u.text,c.x=0,c.y=d,c.setFont(u),c.setAlign({textBaseline:"bottom",textAlign:"center"}),h=c.getBBox(),l.push(h))}return this.calloutNodeData.forEach(d=>{const p=d.calloutLabel;if(!p||d.outerRadius===0)return null;const g=d.outerRadius+n+a,f=d.midCos*g,x=d.midSin*g+p.collisionOffsetY;c.text=p.text,c.x=f,c.y=x,c.setFont(this.properties.calloutLabel),c.setAlign({textAlign:p.collisionTextAlign??p.textAlign,textBaseline:p.textBaseline});const m=c.getBBox();if(p.box=m,Math.abs(p.collisionOffsetY)>o){p.hidden=!0;return}if(h){const b=-this.centerY,v=new ht(h.x-r,b,h.width+2*r,h.y+h.height+r-b);if(m.collidesBBox(v)){p.hidden=!0;return}}if(t.hideWhenNecessary){const{textLength:b,hasVerticalOverflow:v,hasSurroundingSeriesOverflow:S}=this.getLabelOverflow(p.text,m,e),A=p.text.length>2&&b<2;if(v||A||S){p.hidden=!0;return}}p.hidden=!1,l.push(m)}),l.length===0?null:ht.merge(l)}updateSectorLabelNodes(){const{radiusScale:t}=this,e=t.convert(0),{fontSize:i,fontStyle:s,fontWeight:n,fontFamily:a,positionOffset:o,positionRatio:r,color:l}=this.properties.sectorLabel,c=(h,u)=>{const{sectorLabel:d,outerRadius:p}=u;let g=!1;if(d&&p!==0){const f=e*(1-r)+p*r+o;h.fill=l,h.fontStyle=s,h.fontWeight=n,h.fontSize=i,h.fontFamily=a,h.text=d.text,h.x=u.midCos*f,h.y=u.midSin*f,h.textAlign="center",h.textBaseline="middle";const x=h.getBBox(),m=[[x.x,x.y],[x.x+x.width,x.y],[x.x+x.width,x.y+x.height],[x.x,x.y+x.height]],{startAngle:b,endAngle:v}=u,S={startAngle:b,endAngle:v,innerRadius:e,outerRadius:p};m.every(([A,T])=>rb(A,T,S))&&(g=!0)}h.visible=g};this.labelSelection.each(c),this.highlightLabelSelection.each(c)}updateInnerLabelNodes(){const t=[],e=[];this.innerLabelsSelection.each((h,u)=>{const{fontStyle:d,fontWeight:p,fontSize:g,fontFamily:f,color:x}=u;h.fontStyle=d,h.fontWeight=p,h.fontSize=g,h.fontFamily=f,h.text=u.text,h.x=0,h.y=0,h.fill=x,h.textAlign="center",h.textBaseline="alphabetic",t.push(h.getBBox()),e.push(u.spacing)});const i=h=>h===0?0:e[h],s=h=>h===e.length-1?0:e[h],n=t.reduce((h,u,d)=>h+u.height+i(d)+s(d),0),a=Math.max(...t.map(h=>h.width)),o=this.getInnerRadius(),l=Math.sqrt(Math.pow(a/2,2)+Math.pow(n/2,2))<=(o>0?o:this.getOuterRadius()),c=[];for(let h=0,u=-n/2;h{h.y=c[d],h.visible=l})}updateZerosumRings(){this.zerosumOuterRing.size=this.getOuterRadius()*2,this.zerosumInnerRing.size=this.getInnerRadius()*2}pickNodeClosestDatum(t){return BD(this,t)}getTooltipContent(t){const{id:e,dataModel:i,processedData:s,properties:n}=this,{legendItemKey:a,calloutLabelKey:o,calloutLabelName:r,sectorLabelKey:l,sectorLabelName:c,angleKey:h,angleName:u,radiusKey:d,radiusName:p,tooltip:g}=n,f=this.properties.title.text;if(!i||!s)return;const{datumIndex:x}=t,m=s.dataSources.get(this.id)?.[x],{angleRawValues:b,legendItemValues:v,calloutLabelValues:S,sectorLabelValues:A}=this.getProcessedDataValues(i,s),T=b[x],D=v?.[x]??(o===h?void 0:S?.[x])??(l===h?void 0:A?.[x])??u;return g.formatTooltip({title:f,symbol:this.legendItemSymbol(x),data:[{label:D,fallbackLabel:h,value:Zo(T,3)}]},{seriesId:e,datum:m,title:u,legendItemKey:a,calloutLabelKey:o,calloutLabelName:r,sectorLabelKey:l,sectorLabelName:c,angleKey:h,angleName:u,radiusKey:d,radiusName:p,...this.getSectorFormat(m,x,!1)})}legendItemSymbol(t){const e=this.processedData?.dataSources.get(this.id)?.[t],i=this.getSectorFormat(e,t,!1);return{marker:{fill:i.fill,stroke:i.stroke,fillOpacity:this.properties.fillOpacity,strokeOpacity:this.properties.strokeOpacity,strokeWidth:this.properties.strokeWidth,lineDash:this.properties.lineDash,lineDashOffset:this.properties.lineDashOffset}}}getLegendData(t){const{visible:e,processedData:i,dataModel:s,id:n,ctx:{legendManager:a}}=this;if(!s||!i||!this.properties.isValid()||t!=="category")return[];const{angleKey:o,calloutLabelKey:r,sectorLabelKey:l,legendItemKey:c,showInLegend:h}=this.properties;if(!c&&(!r||r===o)&&(!l||l===o))return[];const{angleRawValues:u,calloutLabelValues:d,sectorLabelValues:p,legendItemValues:g}=this.getProcessedDataValues(s,i),f=this.properties.title?.showInLegend&&this.properties.title.text,x=[],m=this.properties.hideZeroValueSectorsInLegend,b=i.dataSources.get(this.id),v=i.invalidData?.get(this.id);for(let S=0;Si.toggleItem({enabled:n,seriesId:e,itemId:a})),i.update(),s.update(4)}animateEmptyUpdateReady(t){const{animationManager:e}=this.ctx,i=oh(!0,this.properties.rotation,this.radiusScale,this.previousRadiusScale);De(this.id,"nodes",e,[this.itemSelection,this.highlightSelection,this.phantomSelection],i.nodes,(s,n)=>this.getDatumId(n.datum,n.datumIndex)),De(this.id,"innerCircle",e,[this.innerCircleSelection],i.innerCircle),Ht(this,"callout",e,this.calloutLabelSelection),Ht(this,"sector",e,this.labelSelection),Ht(this,"highlight",e,this.highlightLabelSelection),Ht(this,"inner",e,this.innerLabelsSelection),this.previousRadiusScale.range=this.radiusScale.range}animateWaitingUpdateReady(){const{itemSelection:t,highlightSelection:e,phantomSelection:i,processedData:s,radiusScale:n,previousRadiusScale:a}=this,{animationManager:o}=this.ctx,r=s?.reduced?.diff?.[this.id];this.ctx.animationManager.stopByAnimationGroupId(this.id);const l=(r?.moved.size??0)===0,c=(s?.defs.keys.length??0)>0,h=s?.reduced?.animationValidation?.uniqueKeys??!0;(!l||!c||!h)&&this.ctx.animationManager.skipCurrentBatch();const u=!this.nodeData.some(p=>p.enabled),d=oh(!1,this.properties.rotation,n,a);De(this.id,"nodes",o,[t,e,i],d.nodes,(p,g)=>this.getDatumId(g.datum,g.datumIndex),r),De(this.id,"innerCircle",o,[this.innerCircleSelection],d.innerCircle),Ht(this,"callout",this.ctx.animationManager,this.calloutLabelSelection),Ht(this,"sector",this.ctx.animationManager,this.labelSelection),Ht(this,"highlight",this.ctx.animationManager,this.highlightLabelSelection),this.noVisibleData!==u&&(this.noVisibleData=u,Ht(this,"inner",this.ctx.animationManager,this.innerLabelsSelection)),this.previousRadiusScale.range=this.radiusScale.range}animateClearingUpdateEmpty(){const{itemSelection:t,highlightSelection:e,phantomSelection:i,radiusScale:s,previousRadiusScale:n}=this,{animationManager:a}=this.ctx,o=oh(!1,this.properties.rotation,s,n);De(this.id,"nodes",a,[t,e,i],o.nodes,(r,l)=>this.getDatumId(l.datum,l.datumIndex)),De(this.id,"innerCircle",a,[this.innerCircleSelection],o.innerCircle),gl(this,"callout",this.ctx.animationManager,this.calloutLabelSelection),gl(this,"sector",this.ctx.animationManager,this.labelSelection),gl(this,"highlight",this.ctx.animationManager,this.highlightLabelSelection),gl(this,"inner",this.ctx.animationManager,this.innerLabelsSelection),this.previousRadiusScale.range=this.radiusScale.range}getDatumId(t,e){const{calloutLabelKey:i,sectorLabelKey:s,legendItemKey:n}=this.properties;return this.processedData?.reduced?.animationValidation?.uniqueKeys?n?Ve(t[n]):i?Ve(t[i]):s?Ve(t[s]):`${e}`:`${e}`}},bb.className="DonutSeries",bb.type="donut"}}),k_,SX=I({"packages/ag-charts-community/src/chart/series/polar/donutTheme.ts"(){"use strict";ke(),k_={series:{title:{enabled:!0,fontWeight:{$ref:"fontWeight"},fontSize:{$rem:[1.1666666666666667]},fontFamily:{$ref:"fontFamily"},color:{$ref:"subtleTextColor"},spacing:5},calloutLabel:{enabled:!0,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"textColor"},offset:3,minAngle:.001},sectorLabel:{enabled:!0,fontWeight:{$ref:"fontWeight"},fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},color:{$ref:"backgroundColor"},positionOffset:0,positionRatio:.5},calloutLine:{length:10,strokeWidth:2},fillOpacity:1,strokeOpacity:1,strokeWidth:0,lineDash:[0],lineDashOffset:0,rotation:0,sectorSpacing:1,shadow:{enabled:!1,color:hr,xOffset:3,yOffset:3,blur:5},innerLabels:{fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"textColor"},spacing:2}},legend:{enabled:!0}}}}),L_,jD,T_=I({"packages/ag-charts-community/src/chart/series/polar/pieTheme.ts"(){"use strict";ke(),L_={series:{title:{enabled:!0,fontWeight:{$ref:"fontWeight"},fontSize:{$rem:[1.1666666666666667]},fontFamily:{$ref:"fontFamily"},color:{$ref:"subtleTextColor"},spacing:5},calloutLabel:{enabled:!0,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"textColor"},offset:3,minAngle:.001},sectorLabel:{enabled:!0,fontWeight:{$ref:"fontWeight"},fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},color:{$ref:"backgroundColor"},positionOffset:0,positionRatio:.5},calloutLine:{length:10,strokeWidth:2},fillOpacity:1,strokeOpacity:1,strokeWidth:0,lineDash:[0],lineDashOffset:0,rotation:0,sectorSpacing:1,shadow:{enabled:!1,color:hr,xOffset:3,yOffset:3,blur:5}},legend:{enabled:!0}},jD=({takeColors:t,colorsCount:e})=>{const{fills:i,strokes:s}=t(e);return{fills:i,strokes:s,calloutLine:{colors:s}}}}}),C_,vX=I({"packages/ag-charts-community/src/chart/series/polar/donutSeriesModule.ts"(){"use strict";bX(),SX(),T_(),C_={type:"series",optionsKey:"series[]",packageType:"community",chartTypes:["polar"],identifier:"donut",moduleFactory:t=>new bb(t),tooltipDefaults:{range:"exact"},themeTemplate:k_,paletteFactory:jD}}}),VD,rh,Sb,ff,Vt,MX=I({"packages/ag-charts-community/src/chart/series/polar/pieSeriesProperties.ts"(){"use strict";xd(),Qt(),mt(),Lc(),zn(),gb(),Ng(),fr(),VD=class extends te{constructor(){super(...arguments),this.showInLegend=!1}},M([k(pt)],VD.prototype,"showInLegend",2),rh=class extends ii{constructor(){super(...arguments),this.offset=3,this.minAngle=0,this.minSpacing=4,this.maxCollisionOffset=50,this.avoidCollisions=!0}},M([k(st)],rh.prototype,"offset",2),M([k(_t.restrict({min:0,max:360}))],rh.prototype,"minAngle",2),M([k(st)],rh.prototype,"minSpacing",2),M([k(st)],rh.prototype,"maxCollisionOffset",2),M([k(pt)],rh.prototype,"avoidCollisions",2),Sb=class extends ii{constructor(){super(...arguments),this.positionOffset=0,this.positionRatio=.5}},M([k(_t)],Sb.prototype,"positionOffset",2),M([k(Ut)],Sb.prototype,"positionRatio",2),ff=class extends bt{constructor(){super(...arguments),this.length=10,this.strokeWidth=1}},M([k(Bs,{optional:!0})],ff.prototype,"colors",2),M([k(st)],ff.prototype,"length",2),M([k(st)],ff.prototype,"strokeWidth",2),Vt=class extends Ws{constructor(){super(...arguments),this.fills=Object.values(Re),this.strokes=Object.values(Aa),this.fillOpacity=1,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.cornerRadius=0,this.rotation=0,this.outerRadiusOffset=0,this.outerRadiusRatio=1,this.strokeWidth=1,this.sectorSpacing=0,this.hideZeroValueSectorsInLegend=!1,this.title=new VD,this.shadow=new Hn,this.calloutLabel=new rh,this.sectorLabel=new Sb,this.calloutLine=new ff,this.tooltip=new Bi}},M([k(tt)],Vt.prototype,"angleKey",2),M([k(tt,{optional:!0})],Vt.prototype,"angleName",2),M([k(tt,{optional:!0})],Vt.prototype,"angleFilterKey",2),M([k(tt,{optional:!0})],Vt.prototype,"radiusKey",2),M([k(tt,{optional:!0})],Vt.prototype,"radiusName",2),M([k(st,{optional:!0})],Vt.prototype,"radiusMin",2),M([k(st,{optional:!0})],Vt.prototype,"radiusMax",2),M([k(tt,{optional:!0})],Vt.prototype,"calloutLabelKey",2),M([k(tt,{optional:!0})],Vt.prototype,"calloutLabelName",2),M([k(tt,{optional:!0})],Vt.prototype,"sectorLabelKey",2),M([k(tt,{optional:!0})],Vt.prototype,"sectorLabelName",2),M([k(tt,{optional:!0})],Vt.prototype,"legendItemKey",2),M([k(Bs)],Vt.prototype,"fills",2),M([k(Bs)],Vt.prototype,"strokes",2),M([k(Ut)],Vt.prototype,"fillOpacity",2),M([k(Ut)],Vt.prototype,"strokeOpacity",2),M([k(ua)],Vt.prototype,"lineDash",2),M([k(st)],Vt.prototype,"lineDashOffset",2),M([k(st)],Vt.prototype,"cornerRadius",2),M([k(ts,{optional:!0})],Vt.prototype,"itemStyler",2),M([k(_t)],Vt.prototype,"rotation",2),M([k(_t)],Vt.prototype,"outerRadiusOffset",2),M([k(Ut)],Vt.prototype,"outerRadiusRatio",2),M([k(st)],Vt.prototype,"strokeWidth",2),M([k(_t)],Vt.prototype,"sectorSpacing",2),M([k(pt)],Vt.prototype,"hideZeroValueSectorsInLegend",2),M([k(lt)],Vt.prototype,"title",2),M([k(lt)],Vt.prototype,"shadow",2),M([k(lt)],Vt.prototype,"calloutLabel",2),M([k(lt)],Vt.prototype,"sectorLabel",2),M([k(lt)],Vt.prototype,"calloutLine",2),M([k(lt)],Vt.prototype,"tooltip",2)}}),N_,vb,IX=I({"packages/ag-charts-community/src/chart/series/polar/pieSeries.ts"(){"use strict";ot(),wi(),Zc(),Rt(),pe(),el(),Oc(),pb(),Fs(),ub(),Ii(),il(),jn(),At(),oe(),Vn(),uo(),ba(),$c(),gr(),MX(),zD(),xb(),N_=class extends Vu{constructor(t,e,i,s){super(t,e,i,s),this.angleKey=s.properties.angleKey,this.radiusKey=s.properties.radiusKey,this.calloutLabelKey=s.properties.calloutLabelKey,this.sectorLabelKey=s.properties.sectorLabelKey}},vb=class extends gf{constructor(t){super({moduleCtx:t,pickModes:[1,0],useLabelLayer:!0,animationResetFns:{item:PD,label:pr}}),this.properties=new Vt,this.phantomNodeData=void 0,this.backgroundGroup=new is({name:`${this.id}-background`,zIndex:0}),this.previousRadiusScale=new Un,this.radiusScale=new Un,this.phantomGroup=this.backgroundGroup.appendChild(new yt({name:"phantom"})),this.phantomSelection=Oe.select(this.phantomGroup,()=>this.nodeFactory(),!1),this.calloutLabelGroup=this.contentGroup.appendChild(new yt({name:"pieCalloutLabels"})),this.calloutLabelSelection=new Oe(this.calloutLabelGroup,yt),this.zerosumRingsGroup=this.backgroundGroup.appendChild(new yt({name:`${this.id}-zerosumRings`})),this.zerosumOuterRing=this.zerosumRingsGroup.appendChild(new ai({shape:"circle"})),this.surroundingRadius=void 0,this.NodeEvent=N_,this.angleScale=new Un,this.angleScale.domain=[0,1],this.angleScale.range=[-Math.PI,Math.PI].map(e=>e+Math.PI/2),this.phantomGroup.opacity=.2}get calloutNodeData(){return this.phantomNodeData??this.nodeData}attachSeries(t,e,i){super.attachSeries(t,e,i),t.appendChild(this.backgroundGroup)}detachSeries(t,e,i){super.detachSeries(t,e,i),t?.removeChild(this.backgroundGroup)}setSeriesIndex(t){return super.setSeriesIndex(t)?(this.backgroundGroup.zIndex=[0,t],!0):!1}nodeFactory(){const t=new pi;return t.miterLimit=1e9,t}getSeriesDomain(t){return t==="x"?this.angleScale.domain:this.radiusScale.domain}async processData(t){if(this.data==null||!this.properties.isValid())return;const{visible:e,id:i,ctx:{legendManager:s}}=this,{angleKey:n,angleFilterKey:a,radiusKey:o,calloutLabelKey:r,sectorLabelKey:l,legendItemKey:c}=this.properties,h=(x,m,b)=>e&&s.getItemEnabled({seriesId:i,itemId:b}),u=!this.ctx.animationManager.isSkipped(),d=[],p=[];c?d.push(va(c,"band",{id:"legendItemKey"})):r?d.push(va(r,"band",{id:"calloutLabelKey"})):l&&d.push(va(l,"band",{id:"sectorLabelKey"}));const g=this.radiusScale.type,f=this.angleScale.type;o&&p.push(zA(o,{id:"radiusValue",min:this.properties.radiusMin??0,max:this.properties.radiusMax}),Ct(o,g,{id:"radiusRaw"}),Qc("radiusValue",[0,1],1,this.properties.radiusMin??0,this.properties.radiusMax)),r&&p.push(Ct(r,"band",{id:"calloutLabelValue"})),l&&p.push(Ct(l,"band",{id:"sectorLabelValue"})),c&&p.push(Ct(c,"band",{id:"legendItemValue"})),a&&p.push(Eg(a,f,{id:"angleFilterValue",onlyPositive:!0,validation:h,invalidValue:0}),Ct(a,f,{id:"angleFilterRaw"}),Qc("angleFilterValue",[0,1],0,0)),u&&this.processedData?.reduced?.animationValidation?.uniqueKeys&&d.length>0&&p.push(Zu(this.id,this.processedData)),p.push(Xu()),await this.requestDataModel(t,this.data,{props:[...d,Eg(n,f,{id:"angleValue",onlyPositive:!0,validation:h,invalidValue:0}),Ct(n,f,{id:"angleRaw"}),Qc("angleValue",[0,1],0,0),...p]});for(const x of this.processedData?.defs?.values??[]){const{id:m,missing:b,property:v}=x,S=JI(this,b);m!=="angleRaw"&&S>0&&et.warnOnce(`no value was found for the key '${String(v)}' on ${S} data element${S>1?"s":""}`)}this.animationState.transition("updateData")}maybeRefreshNodeData(){if(!this.nodeDataRefresh)return;const{nodeData:t=[],phantomNodeData:e}=this.createNodeData()??{};this.nodeData=t,this.phantomNodeData=e,this.nodeDataRefresh=!1}getProcessedDataValues(t,e){const i=t.resolveColumnById(this,"angleValue",e),s=t.resolveColumnById(this,"angleRaw",e),n=this.properties.angleFilterKey!=null?t.resolveColumnById(this,"angleFilterValue",e):void 0,a=this.properties.angleFilterKey!=null?t.resolveColumnById(this,"angleFilterRaw",e):void 0,o=this.properties.radiusKey?t.resolveColumnById(this,"radiusValue",e):void 0,r=this.properties.radiusKey?t.resolveColumnById(this,"radiusRaw",e):void 0,l=this.properties.calloutLabelKey?t.resolveColumnById(this,"calloutLabelValue",e):void 0,c=this.properties.sectorLabelKey?t.resolveColumnById(this,"sectorLabelValue",e):void 0,h=this.properties.legendItemKey?t.resolveColumnById(this,"legendItemValue",e):void 0;return{angleValues:i,angleRawValues:s,angleFilterValues:n,angleFilterRawValues:a,radiusValues:o,radiusRawValues:r,calloutLabelValues:l,sectorLabelValues:c,legendItemValues:h}}createNodeData(){const{id:t,processedData:e,dataModel:i,angleScale:s,ctx:{legendManager:n},visible:a}=this,{rotation:o}=this.properties;if(!i||e?.type!=="ungrouped")return;const{angleValues:r,angleRawValues:l,angleFilterValues:c,angleFilterRawValues:h,radiusValues:u,radiusRawValues:d,calloutLabelValues:p,sectorLabelValues:g,legendItemValues:f}=this.getProcessedDataValues(i,e),x=h?.some((D,L)=>D>l[L])??!1;let m=0,b=0;const v=[],S=h!=null?[]:void 0,A=e.dataSources.get(this.id)??[],T=e.invalidData?.get(this.id);return A.forEach((D,L)=>{if(T?.[L]===!0)return;const C=x?c[L]:r[L],O=h!=null&&!x?Math.sqrt(h[L]/l[L]):1,_=s.convert(m)+ti(o);m=C,b+=C;const N=s.convert(m)+ti(o),P=Math.abs(N-_),j=_+P/2,F=l[L],W=(u?.[L]??1)*O,H=d?.[L],G=f?.[L],B=this.getLabels(D,j,P,!0,p?.[L],g?.[L],G),z=this.getSectorFormat(D,L,!1),U={itemId:L,series:this,datum:D,datumIndex:L,angleValue:F,midAngle:j,midCos:Math.cos(j),midSin:Math.sin(j),startAngle:_,endAngle:N,radius:W,innerRadius:Math.max(this.radiusScale.convert(0),0),outerRadius:Math.max(this.radiusScale.convert(W),0),sectorFormat:z,radiusValue:H,legendItemValue:G,enabled:a&&n.getItemEnabled({seriesId:t,itemId:L}),...B};v.push(U),S?.push({...U,radius:1,innerRadius:Math.max(this.radiusScale.convert(0),0),outerRadius:Math.max(this.radiusScale.convert(1),0)})}),this.zerosumOuterRing.visible=b===0,{itemId:t,nodeData:v,labelData:v,phantomNodeData:S}}getLabels(t,e,i,s,n,a,o){const{calloutLabel:r,sectorLabel:l,legendItemKey:c}=this.properties,h=!s||r.enabled?this.properties.calloutLabelKey:void 0,u=!s||l.enabled?this.properties.sectorLabelKey:void 0;if(!h&&!u&&!c)return{};const d={datum:t,angleKey:this.properties.angleKey,angleName:this.properties.angleName,radiusKey:this.properties.radiusKey,radiusName:this.properties.radiusName,calloutLabelKey:this.properties.calloutLabelKey,calloutLabelName:this.properties.calloutLabelName,sectorLabelKey:this.properties.sectorLabelKey,sectorLabelName:this.properties.sectorLabelName,legendItemKey:this.properties.legendItemKey},p={};return h&&i>=ti(r.minAngle)&&(p.calloutLabel={...this.getTextAlignment(e),text:this.getLabelText(r,{...d,value:n}),hidden:!1,collisionTextAlign:void 0,collisionOffsetY:0,box:void 0}),u&&(p.sectorLabel={text:this.getLabelText(l,{...d,value:a})}),c!=null&&o!=null&&(p.legendItem={key:c,text:o}),p}getTextAlignment(t){const e=[{textAlign:"center",textBaseline:"bottom"},{textAlign:"left",textBaseline:"middle"},{textAlign:"center",textBaseline:"hanging"},{textAlign:"right",textBaseline:"middle"}],i=tg(t),s=-.75*Math.PI,n=i-s,a=Math.floor(n/(Math.PI/2)),o=wM(a,e.length);return e[o]}getSectorFormat(t,e,i){const{angleKey:s,radiusKey:n,calloutLabelKey:a,sectorLabelKey:o,legendItemKey:r,fills:l,strokes:c,itemStyler:h}=this.properties,u=c[e%c.length],{fill:d,fillOpacity:p,stroke:g,strokeWidth:f,strokeOpacity:x,lineDash:m,lineDashOffset:b,cornerRadius:v}=Tt(i&&this.properties.highlightStyle.item,{fill:l.length>0?l[e%l.length]:void 0,stroke:u,strokeWidth:this.getStrokeWidth(this.properties.strokeWidth),strokeOpacity:this.getOpacity()},this.properties);let S;return h&&(S=this.cachedDatumCallback(this.getDatumId(t,e)+(i?"-highlight":"-hide"),()=>h({datum:t,angleKey:s,radiusKey:n,calloutLabelKey:a,sectorLabelKey:o,legendItemKey:r,fill:d,strokeOpacity:x,stroke:g,strokeWidth:f,fillOpacity:p,lineDash:m,lineDashOffset:b,cornerRadius:v,highlighted:i,seriesId:this.id}))),{fill:S?.fill??d,fillOpacity:S?.fillOpacity??p,stroke:S?.stroke??g,strokeWidth:S?.strokeWidth??f,strokeOpacity:S?.strokeOpacity??x,lineDash:S?.lineDash??m,lineDashOffset:S?.lineDashOffset??b,cornerRadius:S?.cornerRadius??v}}getOuterRadius(){return Math.max(this.radius*this.properties.outerRadiusRatio+this.properties.outerRadiusOffset,0)}updateRadiusScale(t){const e=[0,this.getOuterRadius()];this.radiusScale.range=e,t&&(this.previousRadiusScale.range=e);const i=s=>({...s,innerRadius:Math.max(this.radiusScale.convert(0),0),outerRadius:Math.max(this.radiusScale.convert(s.radius),0)});this.nodeData=this.nodeData.map(i),this.phantomNodeData=this.phantomNodeData?.map(i)}getTitleTranslationY(){const t=Math.max(0,this.radiusScale.range[1]);if(t===0)return NaN;const i=2+(this.properties.title?.spacing??0),s=Math.max(0,-t);return-t-i-s}update({seriesRect:t}){const{title:e}=this.properties,i={seriesRectWidth:t?.width,seriesRectHeight:t?.height},s=Qo(this.nodeDataDependencies,i)!=null;if(s&&(this._nodeDataDependencies=i),this.maybeRefreshNodeData(),this.updateTitleNodes(),this.updateRadiusScale(s),this.contentGroup.translationX=this.centerX,this.contentGroup.translationY=this.centerY,this.highlightGroup.translationX=this.centerX,this.highlightGroup.translationY=this.centerY,this.backgroundGroup.translationX=this.centerX,this.backgroundGroup.translationY=this.centerY,this.labelGroup&&(this.labelGroup.translationX=this.centerX,this.labelGroup.translationY=this.centerY),e){const n=this.getTitleTranslationY();e.node.y=isFinite(n)?n:0;const a=e.node.getBBox();e.node.visible=e.enabled&&isFinite(n)&&!this.bboxIntersectsSurroundingSeries(a)}this.zerosumOuterRing.fillOpacity=0,this.zerosumOuterRing.stroke=this.properties.calloutLabel.color,this.zerosumOuterRing.strokeWidth=1,this.zerosumOuterRing.strokeOpacity=1,this.updateNodeMidPoint(),this.updateSelections(),this.updateNodes(t)}updateTitleNodes(){const{oldTitle:t}=this,{title:e}=this.properties;t!==e&&(t&&this.labelGroup?.removeChild(t.node),e&&(e.node.textBaseline="bottom",this.labelGroup?.appendChild(e.node)),this.oldTitle=e)}updateNodeMidPoint(){const t=e=>{const i=e.innerRadius+(e.outerRadius-e.innerRadius)/2;e.midPoint={x:e.midCos*Math.max(0,i),y:e.midSin*Math.max(0,i)}};this.nodeData.forEach(t),this.phantomNodeData?.forEach(t)}updateSelections(){const{itemSelection:t,highlightSelection:e,phantomSelection:i,highlightLabelSelection:s,calloutLabelSelection:n,labelSelection:a}=this,o=this.nodeData.map(l=>({...l,sectorFormat:{...l.sectorFormat}})),r=(l,c)=>{l.update(c,void 0,h=>this.getDatumId(h.datum,h.datumIndex)),this.ctx.animationManager.isSkipped()&&l.cleanup()};r(t,this.nodeData),r(e,o),r(i,this.phantomNodeData??[]),n.update(this.calloutNodeData,l=>{const c=new Vs;c.tag=0,c.pointerEvents=1,l.appendChild(c);const h=new ei;h.tag=1,h.pointerEvents=1,l.appendChild(h)}),a.update(this.nodeData),s.update(o)}updateNodes(t){const e=this.ctx.highlightManager.getActiveHighlight(),{visible:i}=this;this.backgroundGroup.visible=i,this.contentGroup.visible=i,this.highlightGroup.visible=i&&e?.series===this,this.highlightLabel.visible=i&&e?.series===this,this.labelGroup&&(this.labelGroup.visible=i),this.contentGroup.opacity=this.getOpacity();const s=this.ctx.animationManager.isSkipped(),n=(a,o,r,l)=>{const c=this.getSectorFormat(o.datum,o.itemId,l);o.sectorFormat.fill=c.fill,o.sectorFormat.stroke=c.stroke,s&&(a.startAngle=o.startAngle,a.endAngle=o.endAngle,a.innerRadius=o.innerRadius,a.outerRadius=o.outerRadius),(l||s)&&(a.fill=c.fill,a.stroke=c.stroke),a.strokeWidth=c.strokeWidth,a.fillOpacity=c.fillOpacity,a.strokeOpacity=c.strokeOpacity,a.lineDash=c.lineDash,a.lineDashOffset=c.lineDashOffset,a.cornerRadius=c.cornerRadius,a.fillShadow=this.properties.shadow;const h=Math.max((this.properties.sectorSpacing+(c.stroke!=null?c.strokeWidth:0))/2,0);a.inset=h,a.lineJoin=this.properties.sectorSpacing>=0||h>0?"miter":"round"};this.itemSelection.each((a,o,r)=>n(a,o,r,!1)),this.highlightSelection.each((a,o,r)=>{n(a,o,r,!0),a.visible=o.itemId===e?.itemId}),this.phantomSelection.each((a,o,r)=>n(a,o,r,!1)),this.updateCalloutLineNodes(),this.updateCalloutLabelNodes(t),this.updateSectorLabelNodes(),this.updateZerosumRings(),this.animationState.transition("update")}updateCalloutLineNodes(){const{calloutLine:t}=this.properties,e=t.length,i=t.strokeWidth,s=t.colors??this.properties.strokes,{offset:n}=this.properties.calloutLabel;this.calloutLabelSelection.selectByTag(0).forEach((a,o)=>{const r=a.datum,{calloutLabel:l,outerRadius:c}=r;if(l?.text&&!l.hidden&&c!==0){a.visible=!0,a.strokeWidth=i,a.stroke=s[o%s.length],a.fill=void 0;const h=r.midCos*c,u=r.midSin*c;let d=r.midCos*(c+e),p=r.midSin*(c+e);if((l.collisionTextAlign??l.collisionOffsetY!==0)&&l.box!=null){const f=l.box;let x=d,m=p;df.x+f.width&&(x=f.x+f.width),pf.y+f.height&&(m=f.y+f.height);const b=x-d,v=m-p,S=Math.sqrt(Math.pow(b,2)+Math.pow(v,2)),A=S-n;A>0&&(d=d+b*A/S,p=p+v*A/S)}a.x1=h,a.y1=u,a.x2=d,a.y2=p}else a.visible=!1})}getLabelOverflow(t,e,i){const s=-this.centerX,n=s+i.width,a=-this.centerY,o=a+i.height,r=1;let l=1;e.x+rn&&(l=(n-e.x)/e.width);const c=e.y+ro,h=l===1?t.length:Math.floor(t.length*l)-1,u=this.bboxIntersectsSurroundingSeries(e);return{textLength:h,hasVerticalOverflow:c,hasSurroundingSeriesOverflow:u}}bboxIntersectsSurroundingSeries(t){const{surroundingRadius:e}=this;if(e==null)return!1;const i=[{x:t.x,y:t.y},{x:t.x+t.width,y:t.y},{x:t.x+t.width,y:t.y+t.height},{x:t.x,y:t.y+t.height}],s=e**2;return i.some(n=>n.x**2+n.y**2>s)}computeCalloutLabelCollisionOffsets(){const{radiusScale:t}=this,{calloutLabel:e,calloutLine:i}=this.properties,{offset:s,minSpacing:n}=e,a=t.convert(0),o=m=>!m.calloutLabel||m.outerRadius===0,r=this.calloutNodeData,l=r.filter(m=>!o(m));if(l.forEach(m=>{const b=m.calloutLabel;b!=null&&(b.hidden=!1,b.collisionTextAlign=void 0,b.collisionOffsetY=0)}),l.length<=1)return;const c=l.filter(m=>m.midCos<0).sort((m,b)=>m.midSin-b.midSin),h=l.filter(m=>m.midCos>=0).sort((m,b)=>m.midSin-b.midSin),u=l.filter(m=>m.midSin<0&&m.calloutLabel?.textAlign==="center").sort((m,b)=>m.midCos-b.midCos),d=l.filter(m=>m.midSin>=0&&m.calloutLabel?.textAlign==="center").sort((m,b)=>m.midCos-b.midCos),p=m=>{const b=m.calloutLabel;if(b==null)return ht.zero.clone();const v=m.outerRadius+i.length+s,S=m.midCos*v,A=m.midSin*v+b.collisionOffsetY,T=b.collisionTextAlign??b.textAlign,D=b.textBaseline;return ei.computeBBox(b.text,S,A,{font:this.properties.calloutLabel,textAlign:T,textBaseline:D})},g=(m,b,v)=>{const S=p(m).grow(n/2),A=p(b).grow(n/2);S.xA.x&&(v==="to-top"?S.yA.y)&&(b.calloutLabel.collisionOffsetY=v==="to-top"?S.y-A.y-A.height:S.y+S.height-A.y)},f=m=>{const b=m.slice().sort((S,A)=>Math.abs(S.midSin)-Math.abs(A.midSin))[0],v=m.indexOf(b);for(let S=v-1;S>=0;S--){const A=m[S+1],T=m[S];g(A,T,"to-top")}for(let S=v+1;S{const b=l.some(L=>L.calloutLabel.collisionOffsetY!==0),v=m.map(L=>p(L)),S=v.map(L=>L.clone().grow(n/2));let A=!1;for(let L=0;L{const{startAngle:C,endAngle:O,outerRadius:_}=L;return{startAngle:C,endAngle:O,innerRadius:a,outerRadius:_}}),D=v.some(L=>T.some(C=>M_(L,C)));!A&&!b&&!D||m.filter(L=>L.calloutLabel.textAlign==="center").forEach(L=>{const C=L.calloutLabel;L.midCos<0?C.collisionTextAlign="right":L.midCos>0?C.collisionTextAlign="left":C.collisionTextAlign="center"})};f(c),f(h),x(u),x(d)}updateCalloutLabelNodes(t){const{radiusScale:e}=this,{calloutLabel:i,calloutLine:s}=this.properties,n=s.length,{offset:a,color:o}=i,r=new ei;this.calloutLabelSelection.selectByTag(1).forEach(l=>{const{datum:c}=l,h=c.calloutLabel,u=e.convert(c.radius),d=Math.max(0,u);if(!h?.text||d===0||h.hidden){l.visible=!1;return}const p=d+n+a,g=c.midCos*p,f=c.midSin*p+h.collisionOffsetY,x={textAlign:h.collisionTextAlign??h.textAlign,textBaseline:h.textBaseline};r.text=h.text,r.x=g,r.y=f,r.setFont(this.properties.calloutLabel),r.setAlign(x);const m=r.getBBox();let b=h.text,v=!0;if(i.avoidCollisions){const{textLength:S,hasVerticalOverflow:A}=this.getLabelOverflow(h.text,m,t);b=h.text.length===S?h.text:`${h.text.substring(0,S)}\u2026`,v=!A}l.text=b,l.x=g,l.y=f,l.setFont(this.properties.calloutLabel),l.setAlign(x),l.fill=o,l.visible=v})}computeLabelsBBox(t,e){const{calloutLabel:i,calloutLine:s}=this.properties,n=s.length,{offset:a,maxCollisionOffset:o,minSpacing:r}=i;if(!i.avoidCollisions)return null;this.maybeRefreshNodeData(),this.updateRadiusScale(!1),this.computeCalloutLabelCollisionOffsets();const l=[],c=new ei;let h;const{title:u}=this.properties;if(u?.text&&u.enabled){const d=this.getTitleTranslationY();isFinite(d)&&(c.text=u.text,c.x=0,c.y=d,c.setFont(u),c.setAlign({textBaseline:"bottom",textAlign:"center"}),h=c.getBBox(),l.push(h))}return this.calloutNodeData.forEach(d=>{const p=d.calloutLabel;if(!p||d.outerRadius===0)return null;const g=d.outerRadius+n+a,f=d.midCos*g,x=d.midSin*g+p.collisionOffsetY;c.text=p.text,c.x=f,c.y=x,c.setFont(this.properties.calloutLabel),c.setAlign({textAlign:p.collisionTextAlign??p.textAlign,textBaseline:p.textBaseline});const m=c.getBBox();if(p.box=m,Math.abs(p.collisionOffsetY)>o){p.hidden=!0;return}if(h){const b=-this.centerY,v=new ht(h.x-r,b,h.width+2*r,h.y+h.height+r-b);if(m.collidesBBox(v)){p.hidden=!0;return}}if(t.hideWhenNecessary){const{textLength:b,hasVerticalOverflow:v,hasSurroundingSeriesOverflow:S}=this.getLabelOverflow(p.text,m,e),A=p.text.length>2&&b<2;if(v||A||S){p.hidden=!0;return}}p.hidden=!1,l.push(m)}),l.length===0?null:ht.merge(l)}updateSectorLabelNodes(){const{radiusScale:t}=this,e=t.convert(0),{fontSize:i,fontStyle:s,fontWeight:n,fontFamily:a,positionOffset:o,positionRatio:r,color:l}=this.properties.sectorLabel,c=e>0,h=this.ctx.legendManager.getData(this.id)?.filter(d=>d.enabled).length===1,u=(d,p)=>{const{sectorLabel:g,outerRadius:f,startAngle:x,endAngle:m}=p;let b=!1;if(g&&f!==0){const v=e*(1-r)+f*r+o;d.fill=l,d.fontStyle=s,d.fontWeight=n,d.fontSize=i,d.fontFamily=a,d.text=g.text,!c&&h?(d.x=0,d.y=0):(d.x=p.midCos*v,d.y=p.midSin*v),d.textAlign="center",d.textBaseline="middle";const A=d.getBBox(),T=[[A.x,A.y],[A.x+A.width,A.y],[A.x+A.width,A.y+A.height],[A.x,A.y+A.height]],D={startAngle:x,endAngle:m,innerRadius:e,outerRadius:f};T.every(([L,C])=>rb(L,C,D))&&(b=!0)}d.visible=b};this.labelSelection.each(u),this.highlightLabelSelection.each(u)}updateZerosumRings(){this.zerosumOuterRing.size=this.getOuterRadius()*2}pickNodeClosestDatum(t){return BD(this,t)}getTooltipContent(t){const{id:e,dataModel:i,processedData:s,properties:n}=this,{legendItemKey:a,calloutLabelKey:o,calloutLabelName:r,sectorLabelKey:l,sectorLabelName:c,angleKey:h,angleName:u,radiusKey:d,radiusName:p,tooltip:g}=n,f=this.properties.title.text;if(!i||!s)return;const{datumIndex:x}=t,m=s.dataSources.get(this.id)?.[x],{angleRawValues:b,legendItemValues:v,calloutLabelValues:S,sectorLabelValues:A}=this.getProcessedDataValues(i,s),T=b[x],D=v?.[x]??(o===h?void 0:S?.[x])??(l===h?void 0:A?.[x])??u;return g.formatTooltip({title:f,symbol:this.legendItemSymbol(x),data:[{label:D,fallbackLabel:h,value:Zo(T,3)}]},{seriesId:e,datum:m,title:u,legendItemKey:a,calloutLabelKey:o,calloutLabelName:r,sectorLabelKey:l,sectorLabelName:c,angleKey:h,angleName:u,radiusKey:d,radiusName:p,...this.getSectorFormat(m,x,!1)})}legendItemSymbol(t){const e=this.processedData?.dataSources.get(this.id)?.[t],i=this.getSectorFormat(e,t,!1);return{marker:{fill:i.fill,stroke:i.stroke,fillOpacity:this.properties.fillOpacity,strokeOpacity:this.properties.strokeOpacity,strokeWidth:this.properties.strokeWidth,lineDash:this.properties.lineDash,lineDashOffset:this.properties.lineDashOffset}}}getLegendData(t){const{id:e,visible:i,processedData:s,dataModel:n,ctx:{legendManager:a}}=this;if(!n||!s||t!=="category")return[];const{angleKey:o,calloutLabelKey:r,sectorLabelKey:l,legendItemKey:c,showInLegend:h}=this.properties;if(!c&&(!r||r===o)&&(!l||l===o))return[];const{calloutLabelValues:u,sectorLabelValues:d,legendItemValues:p,angleRawValues:g}=this.getProcessedDataValues(n,s),f=this.properties.title?.showInLegend&&this.properties.title.text,x=[],m=this.properties.hideZeroValueSectorsInLegend,b=s.dataSources.get(this.id),v=s.invalidData?.get(this.id);for(let S=0;Si.toggleItem({enabled:n,seriesId:e,itemId:a})),i.update(),s.update(4)}animateEmptyUpdateReady(t){const{animationManager:e}=this.ctx,i=oh(!0,this.properties.rotation,this.radiusScale,this.previousRadiusScale);De(this.id,"nodes",e,[this.itemSelection,this.highlightSelection,this.phantomSelection],i.nodes,(s,n)=>this.getDatumId(n.datum,n.datumIndex)),Ht(this,"callout",e,this.calloutLabelSelection),Ht(this,"sector",e,this.labelSelection),Ht(this,"highlight",e,this.highlightLabelSelection),this.previousRadiusScale.range=this.radiusScale.range}animateWaitingUpdateReady(){const{itemSelection:t,highlightSelection:e,phantomSelection:i,processedData:s,radiusScale:n,previousRadiusScale:a}=this,{animationManager:o}=this.ctx,r=s?.reduced?.diff?.[this.id];this.ctx.animationManager.stopByAnimationGroupId(this.id);const l=(r?.moved.size??0)===0,c=(s?.defs.keys.length??0)>0,h=s?.reduced?.animationValidation?.uniqueKeys??!0;(!l||!c||!h)&&this.ctx.animationManager.skipCurrentBatch();const u=oh(!1,this.properties.rotation,n,a);De(this.id,"nodes",o,[t,e,i],u.nodes,(d,p)=>this.getDatumId(p.datum,p.datumIndex),r),Ht(this,"callout",this.ctx.animationManager,this.calloutLabelSelection),Ht(this,"sector",this.ctx.animationManager,this.labelSelection),Ht(this,"highlight",this.ctx.animationManager,this.highlightLabelSelection),this.previousRadiusScale.range=this.radiusScale.range}animateClearingUpdateEmpty(){const{itemSelection:t,highlightSelection:e,phantomSelection:i,radiusScale:s,previousRadiusScale:n}=this,{animationManager:a}=this.ctx,o=oh(!1,this.properties.rotation,s,n);De(this.id,"nodes",a,[t,e,i],o.nodes,(r,l)=>this.getDatumId(l.datum,l.datumIndex)),gl(this,"callout",this.ctx.animationManager,this.calloutLabelSelection),gl(this,"sector",this.ctx.animationManager,this.labelSelection),gl(this,"highlight",this.ctx.animationManager,this.highlightLabelSelection),this.previousRadiusScale.range=this.radiusScale.range}getDatumId(t,e){const{calloutLabelKey:i,sectorLabelKey:s,legendItemKey:n}=this.properties;return this.processedData?.reduced?.animationValidation?.uniqueKeys?n?Ve(t[n]):i?Ve(t[i]):s?Ve(t[s]):`${e}`:`${e}`}},vb.className="PieSeries",vb.type="pie"}}),O_,AX=I({"packages/ag-charts-community/src/chart/series/polar/pieSeriesModule.ts"(){"use strict";IX(),T_(),O_={type:"series",optionsKey:"series[]",packageType:"community",chartTypes:["polar"],identifier:"pie",moduleFactory:t=>new vb(t),tooltipDefaults:{range:"exact"},themeTemplate:L_,paletteFactory:jD}}});function GD(){pa.register($A,v1,XR,J1,CD,p_,wD,x_,C_,O_,g_);for(const t of[or,Rc,ll,qc,dl])ro.register(t.type,{moduleFactory:e=>new t(e)})}var w_=I({"packages/ag-charts-community/src/chart/factory/registerInbuiltModules.ts"(){"use strict";o6(),no(),wu(),UA(),YA(),Mx(),TA(),y1(),F6(),sX(),u_(),cX(),dX(),m_(),yX(),vX(),AX(),zu()}});function DX(){for(const t of pa.modules){if(t.packageType==="enterprise"&&!c$(t)&&et.errorOnce("Unexpected enterprise module registered: "+t.identifier),t.type==="root"&&t.themeTemplate)for(const e of t.chartTypes)cx.set(e,t.themeTemplate);if(t.type==="series"){if(t.chartTypes.length>1)throw new Error(`AG Charts - Module definition error: ${t.identifier}`);Ds.register(t.identifier,t)}if(t.type==="series-option"&&t.themeTemplate)for(const e of t.seriesTypes)Ds.setThemeTemplate(e,t.themeTemplate);if(t.type==="axis-option"&&t.themeTemplate)for(const e of t.axisTypes){const i=ro.getThemeTemplate(e),s=Tt(t.themeTemplate,i);ro.setThemeTemplate(e,s)}t.type==="axis"&&ro.register(t.identifier,t),t.type==="legend"&&lx.register(t.identifier,t)}if(pa.hasEnterpriseModules()){const t=h$();t.length>0&&et.errorOnce("Enterprise modules expected but not registered: ",t)}}var kX=I({"packages/ag-charts-community/src/chart/factory/setupModules.ts"(){"use strict";ot(),no(),oe(),zu(),Fu(),Ig(),aA(),hx()}}),lh,E_=I({"packages/ag-charts-community/src/chart/axis/polarAxis.ts"(){"use strict";mt(),sI(),eI(),lh=class extends _m{constructor(){super(...arguments),this.shape="polygon",this.innerRadiusRatio=0,this.defaultTickMinSpacing=20}updatePosition(){super.updatePosition();const t=Em(this),e=q0(t);this.axisGroup.setProperties(this.getAxisTransform()),this.gridLineGroupSelection.each(e),this.tickLineGroupSelection.each(e),this.tickLabelGroupSelection.each(J0())}computeLabelsBBox(t,e){return null}computeRange(){}getAxisLinePoints(){}},M([k(ie(["polygon","circle"],"a polar axis shape"))],lh.prototype,"shape",2),M([k(Ut)],lh.prototype,"innerRadiusRatio",2)}});function LX(t){return t instanceof gf}function TX(t){return t instanceof lh}var Mb,CX=I({"packages/ag-charts-community/src/chart/polarChart.ts"(){"use strict";ot(),Rt(),fI(),E_(),Sx(),xb(),Mb=class extends Tg{constructor(t,e){super(t,e),this.padding=new Jo(40),this.ctx.axisManager.axisGroup.zIndex=6}getChartType(){return"polar"}async performLayout(t){const{layoutBox:e}=t;e.shrink(this.seriesArea.padding.toJson());const i=e.clone();this.seriesRect=i,this.animationRect=i,this.seriesRoot.translationX=i.x,this.seriesRoot.translationY=i.y,await this.computeCircle(i),this.axes.forEach(s=>s.update()),this.ctx.layoutManager.emitLayoutComplete(t,{series:{visible:!0,rect:i,paddedRect:i}})}updateAxes(t,e,i,s){const n=this.axes.find(l=>l.direction==="x"),a=this.axes.find(l=>l.direction==="y");if(!(n instanceof lh)||!(a instanceof lh))return;const o=n.scale,r=a.innerRadiusRatio;n.innerRadiusRatio=r,n.computeRange(),n.gridLength=s,a.gridAngles=o.ticks({nice:n.nice,interval:void 0,tickCount:void 0,minTickCount:0,maxTickCount:1/0})?.map(l=>o.convert(l)),a.gridRange=n.range,a.range=[s,s*r],[n,a].forEach(l=>{l.translation.x=t.x+e,l.translation.y=t.y+i,l.calculateLayout()})}async computeCircle(t){const e=this.series.filter(LX),i=this.axes.filter(TX),s=(c,h,u)=>{this.updateAxes(t,c,h,u),e.forEach(p=>{p.centerX=c,p.centerY=h,p.radius=u});const d=e.filter(p=>p.type==="donut"||p.type==="pie");if(d.length>1){const p=d.map(g=>{const f=g.getInnerRadius();return{series:g,innerRadius:f}}).sort((g,f)=>g.innerRadius-f.innerRadius);p.at(-1).series.surroundingRadius=void 0;for(let g=0;g{const h=[];for(const p of lc(i,e)){const g=await p.computeLabelsBBox({hideWhenNecessary:c},t);g&&h.push(g)}if(h.length===0){s(n,a,o);return}const u=ht.merge(h),d=this.refineCircle(u,r,t);s(d.centerX,d.centerY,d.radius),r=d.radius};await l(),await l(),await l(),await l({hideWhenNecessary:!0}),await l({hideWhenNecessary:!0});for(const c of lc(i,e))await c.computeLabelsBBox({hideWhenNecessary:!0},t);return{radius:r,centerX:n,centerY:a}}refineCircle(t,e,i){const n=-e,a=-e,o=e,r=e;let l=Math.max(0,n-t.x),c=Math.max(0,a-t.y),h=Math.max(0,t.x+t.width-o),u=Math.max(0,t.y+t.height-r);l=h=Math.max(l,h),c=u=Math.max(c,u);const d=i.width-l-h,p=i.height-c-u;let g=Math.min(d,p)/2;const f=.5*i.width/2,x=.5*i.height/2,m=Math.min(f,x);if(gi.height){const T=i.height-2*g;Math.min(c,u)*2>T?(c=T/2,u=T/2):c>u?c=T-u:u=T-c}if(2*g+S>i.width){const T=i.width-2*g;Math.min(l,h)*2>T?(l=T/2,h=T/2):l>h?l=T-h:h=T-l}}const b=l+2*g+h,v=c+2*g+u;return{centerX:(i.width-b)/2+l+g,centerY:(i.height-v)/2+c+g,radius:g}}},Mb.className="PolarChart",Mb.type="polar"}}),R_,NX=I({"packages/ag-charts-community/src/chart/polarChartModule.ts"(){"use strict";ju(),CX(),R_={type:"chart",name:"polar",detect:nR,create(t,e){return new Mb(t,e)}}}}),yo,Ib=I({"packages/ag-charts-community/src/module/enterpriseModule.ts"(){"use strict";yo={isEnterprise:!1}}}),OX=I({"packages/ag-charts-types/src/api/initialStateOptions.ts"(){"use strict"}}),wX=I({"packages/ag-charts-types/src/api/agCharts.ts"(){"use strict"}}),EX=I({"packages/ag-charts-types/src/chart/annotationsOptions.ts"(){"use strict"}}),RX=I({"packages/ag-charts-types/src/chart/axisOptions.ts"(){"use strict"}}),_X=I({"packages/ag-charts-types/src/chart/callbackOptions.ts"(){"use strict"}}),PX=I({"packages/ag-charts-types/src/chart/chartOptions.ts"(){"use strict"}}),BX=I({"packages/ag-charts-types/src/chart/chartToolbarOptions.ts"(){"use strict"}}),zX=I({"packages/ag-charts-types/src/chart/contextMenuOptions.ts"(){"use strict"}}),FX=I({"packages/ag-charts-types/src/chart/crossLineOptions.ts"(){"use strict"}}),jX=I({"packages/ag-charts-types/src/chart/crosshairOptions.ts"(){"use strict"}}),VX=I({"packages/ag-charts-types/src/chart/dropShadowOptions.ts"(){"use strict"}}),__,GX=I({"packages/ag-charts-types/src/chart/errorBarOptions.ts"(){"use strict";__=["bar","line","scatter"]}}),WX=I({"packages/ag-charts-types/src/chart/eventOptions.ts"(){"use strict"}}),UX=I({"packages/ag-charts-types/src/chart/gradientLegendOptions.ts"(){"use strict"}}),HX=I({"packages/ag-charts-types/src/chart/icons.ts"(){"use strict"}}),YX=I({"packages/ag-charts-types/src/chart/labelOptions.ts"(){"use strict"}}),KX=I({"packages/ag-charts-types/src/chart/legendOptions.ts"(){"use strict"}}),$X=I({"packages/ag-charts-types/src/chart/localeOptions.ts"(){"use strict"}}),P_,B_,XX=I({"packages/ag-charts-types/src/chart/navigatorOptions.ts"(){"use strict";P_=void 0,B_=void 0,B_=P_}}),ZX=I({"packages/ag-charts-types/src/chart/polarAxisOptions.ts"(){"use strict"}}),QX=I({"packages/ag-charts-types/src/chart/rangesOptions.ts"(){"use strict"}}),z_,F_,qX=I({"packages/ag-charts-types/src/chart/themeOptions.ts"(){"use strict";z_=void 0,F_=void 0,F_=z_}}),Ab,JX=I({"packages/ag-charts-types/src/chart/tooltipOptions.ts"(){"use strict";Ab=(t=>(t.POINTER="pointer",t.NODE="node",t.TOP="top",t.RIGHT="right",t.BOTTOM="bottom",t.LEFT="left",t.TOP_LEFT="top-left",t.TOP_RIGHT="top-right",t.BOTTOM_RIGHT="bottom-right",t.BOTTOM_LEFT="bottom-left",t))(Ab||{})}}),tZ=I({"packages/ag-charts-types/src/chart/types.ts"(){"use strict"}}),eZ=I({"packages/ag-charts-types/src/chart/zoomOptions.ts"(){"use strict"}}),iZ=I({"packages/ag-charts-types/src/chartBuilderOptions.ts"(){"use strict"}}),sZ=I({"packages/ag-charts-types/src/integratedCharts.ts"(){"use strict"}}),nZ=I({"packages/ag-charts-types/src/presets/financial/financialOptions.ts"(){"use strict"}}),aZ=I({"packages/ag-charts-types/src/presets/financial/priceVolumeOptions.ts"(){"use strict"}}),j_,V_,G_,W_,oZ=I({"packages/ag-charts-types/src/presets/gauge/commonOptions.ts"(){"use strict";j_=void 0,V_=void 0,V_=j_,G_=void 0,W_=void 0,W_=G_}}),rZ=I({"packages/ag-charts-types/src/presets/gauge/gaugeOptions.ts"(){"use strict"}}),lZ=I({"packages/ag-charts-types/src/presets/gauge/linearGaugeOptions.ts"(){"use strict"}}),cZ=I({"packages/ag-charts-types/src/presets/gauge/radialGaugeOptions.ts"(){"use strict"}}),hZ=I({"packages/ag-charts-types/src/presets/sparkline/sparklineAxisOptions.ts"(){"use strict"}}),uZ=I({"packages/ag-charts-types/src/presets/sparkline/sparklineOptions.ts"(){"use strict"}}),dZ=I({"packages/ag-charts-types/src/presets/presetOptions.ts"(){"use strict"}}),pZ=I({"packages/ag-charts-types/src/series/cartesian/areaOptions.ts"(){"use strict"}}),gZ=I({"packages/ag-charts-types/src/series/cartesian/barOptions.ts"(){"use strict"}}),fZ=I({"packages/ag-charts-types/src/series/cartesian/boxPlotOptions.ts"(){"use strict"}}),yZ=I({"packages/ag-charts-types/src/series/cartesian/bubbleOptions.ts"(){"use strict"}}),mZ=I({"packages/ag-charts-types/src/series/cartesian/candlestickOptions.ts"(){"use strict"}}),xZ=I({"packages/ag-charts-types/src/series/cartesian/cartesianOptions.ts"(){"use strict"}}),bZ=I({"packages/ag-charts-types/src/series/cartesian/cartesianSeriesTooltipOptions.ts"(){"use strict"}}),SZ=I({"packages/ag-charts-types/src/series/cartesian/cartesianSeriesTypes.ts"(){"use strict"}}),vZ=I({"packages/ag-charts-types/src/series/cartesian/commonOptions.ts"(){"use strict"}}),MZ=I({"packages/ag-charts-types/src/series/cartesian/coneFunnelOptions.ts"(){"use strict"}}),IZ=I({"packages/ag-charts-types/src/series/cartesian/funnelOptions.ts"(){"use strict"}}),AZ=I({"packages/ag-charts-types/src/series/cartesian/heatmapOptions.ts"(){"use strict"}}),DZ=I({"packages/ag-charts-types/src/series/cartesian/histogramOptions.ts"(){"use strict"}}),kZ=I({"packages/ag-charts-types/src/series/cartesian/lineOptions.ts"(){"use strict"}}),LZ=I({"packages/ag-charts-types/src/series/cartesian/ohlcBaseOptions.ts"(){"use strict"}}),TZ=I({"packages/ag-charts-types/src/series/cartesian/ohlcOptions.ts"(){"use strict"}}),CZ=I({"packages/ag-charts-types/src/series/cartesian/rangeAreaOptions.ts"(){"use strict"}}),NZ=I({"packages/ag-charts-types/src/series/cartesian/rangeBarOptions.ts"(){"use strict"}}),OZ=I({"packages/ag-charts-types/src/series/cartesian/scatterOptions.ts"(){"use strict"}}),wZ=I({"packages/ag-charts-types/src/series/cartesian/waterfallOptions.ts"(){"use strict"}}),EZ=I({"packages/ag-charts-types/src/series/flow-proportion/chordOptions.ts"(){"use strict"}}),RZ=I({"packages/ag-charts-types/src/series/flow-proportion/flowProportionOptions.ts"(){"use strict"}}),_Z=I({"packages/ag-charts-types/src/series/flow-proportion/sankeyOptions.ts"(){"use strict"}}),PZ=I({"packages/ag-charts-types/src/series/standalone/pyramidOptions.ts"(){"use strict"}}),BZ=I({"packages/ag-charts-types/src/series/standalone/standaloneOptions.ts"(){"use strict"}}),zZ=I({"packages/ag-charts-types/src/series/hierarchy/hierarchyOptions.ts"(){"use strict"}}),FZ=I({"packages/ag-charts-types/src/series/hierarchy/sunburstOptions.ts"(){"use strict"}}),jZ=I({"packages/ag-charts-types/src/series/hierarchy/treemapOptions.ts"(){"use strict"}}),VZ=I({"packages/ag-charts-types/src/series/interpolationOptions.ts"(){"use strict"}}),GZ=I({"packages/ag-charts-types/src/series/markerOptions.ts"(){"use strict"}}),WZ=I({"packages/ag-charts-types/src/series/polar/donutOptions.ts"(){"use strict"}}),UZ=I({"packages/ag-charts-types/src/series/polar/nightingaleOptions.ts"(){"use strict"}}),HZ=I({"packages/ag-charts-types/src/series/polar/pieOptions.ts"(){"use strict"}}),YZ=I({"packages/ag-charts-types/src/series/polar/polarOptions.ts"(){"use strict"}}),KZ=I({"packages/ag-charts-types/src/series/polar/radarAreaOptions.ts"(){"use strict"}}),$Z=I({"packages/ag-charts-types/src/series/polar/radarLineOptions.ts"(){"use strict"}}),XZ=I({"packages/ag-charts-types/src/series/polar/radarOptions.ts"(){"use strict"}}),ZZ=I({"packages/ag-charts-types/src/series/polar/radialBarOptions.ts"(){"use strict"}}),QZ=I({"packages/ag-charts-types/src/series/polar/radialColumnOptions.ts"(){"use strict"}}),qZ=I({"packages/ag-charts-types/src/series/polar/radialOptions.ts"(){"use strict"}}),JZ=I({"packages/ag-charts-types/src/series/seriesOptions.ts"(){"use strict"}}),t9=I({"packages/ag-charts-types/src/series/topology/mapLineBackgroundOptions.ts"(){"use strict"}}),e9=I({"packages/ag-charts-types/src/series/topology/mapLineOptions.ts"(){"use strict"}}),i9=I({"packages/ag-charts-types/src/series/topology/mapMarkerOptions.ts"(){"use strict"}}),s9=I({"packages/ag-charts-types/src/series/topology/mapShapeBackgroundOptions.ts"(){"use strict"}}),n9=I({"packages/ag-charts-types/src/series/topology/mapShapeOptions.ts"(){"use strict"}}),a9=I({"packages/ag-charts-types/src/series/topology/topologyOptions.ts"(){"use strict"}}),Db=I({"packages/ag-charts-types/src/main.ts"(){"use strict";OX(),wX(),EX(),RX(),_X(),PX(),BX(),zX(),FX(),jX(),VX(),GX(),WX(),UX(),HX(),YX(),KX(),$X(),XX(),ZX(),QX(),qX(),JX(),tZ(),eZ(),iZ(),sZ(),nZ(),aZ(),oZ(),rZ(),lZ(),cZ(),hZ(),uZ(),dZ(),pZ(),gZ(),fZ(),yZ(),mZ(),xZ(),bZ(),SZ(),vZ(),MZ(),IZ(),AZ(),DZ(),kZ(),LZ(),TZ(),CZ(),NZ(),OZ(),wZ(),EZ(),RZ(),_Z(),PZ(),BZ(),zZ(),FZ(),jZ(),VZ(),GZ(),WZ(),UZ(),HZ(),YZ(),KZ(),$Z(),XZ(),ZZ(),QZ(),qZ(),JZ(),t9(),e9(),i9(),s9(),n9(),a9()}});function pn(t,e){const i={};for(const[s,n]of Object.entries(e))n!==gn&&Object.hasOwn(t,s)&&(i[s]=n);return i}var gn,U_=I({"packages/ag-charts-community/src/api/preset/presetUtils.ts"(){"use strict";gn=Symbol("IGNORED_PROP")}});function H_(t){if(t===void 0)return;const{enabled:e,showArrow:i,range:s,position:n,delay:a,wrapping:o}=t;return Object.fromEntries(Object.entries({enabled:e,showArrow:i,range:s,position:n,delay:a,wrapping:o}).filter(([l,c])=>c!==void 0))}function o9(t){return t.type==="radial-gauge"}function r9(t){return t.type==="linear-gauge"}function l9(t){const{animation:e,background:i,container:s,contextMenu:n,footnote:a,height:o,listeners:r,locale:l,minHeight:c,minWidth:h,overrideDevicePixelRatio:u,padding:d,subtitle:p,theme:g,title:f,width:x,type:m,cursor:b,nodeClickRange:v,tooltip:S,value:A,scale:T={},startAngle:D,endAngle:L,highlightStyle:C,segmentation:O,bar:_,needle:N,targets:P,outerRadius:j,innerRadius:F,outerRadiusRatio:V,innerRadiusRatio:W,cornerRadius:H,cornerMode:G,label:B,secondaryLabel:z,spacing:U,...Y}=t,{fills:K,fillMode:Z,fill:X,fillOpacity:Q,stroke:$,strokeWidth:q,strokeOpacity:J,lineDash:nt,lineDashOffset:it,min:rt=0,max:dt=1,interval:at={},label:Dt={}}=T,kt=pn(t,{animation:e,background:i,container:s,contextMenu:n,footnote:a,height:o,listeners:r,locale:l,minHeight:c,minWidth:h,overrideDevicePixelRatio:u,padding:d,subtitle:p,theme:g,title:f,tooltip:H_(S),width:x}),Mt=pn(T,{fills:K,fillMode:Z,fill:X,fillOpacity:Q,stroke:$,strokeWidth:q,strokeOpacity:J,lineDash:nt,lineDashOffset:it}),ft=pn(t,{startAngle:gn,endAngle:gn,needle:N!=null?{enabled:!0,...N}:gn,scale:Mt,type:m,cursor:b,nodeClickRange:v,listeners:r,tooltip:S,value:A,highlightStyle:C,segmentation:O,bar:_,targets:P,outerRadius:j,innerRadius:F,outerRadiusRatio:V,innerRadiusRatio:W,cornerRadius:H,cornerMode:G,label:B,secondaryLabel:z,spacing:U,...Y});return{...kt,series:[ft],axes:[{type:"angle-number",min:rt,max:dt,startAngle:D,endAngle:L,interval:at??{},label:Dt??{}},{type:"radius-number"}]}}function c9(t){const{animation:e,background:i,container:s,contextMenu:n,footnote:a,height:o,listeners:r,locale:l,minHeight:c,minWidth:h,overrideDevicePixelRatio:u,padding:d,subtitle:p,theme:g,title:f,width:x,type:m,cursor:b,nodeClickRange:v,tooltip:S,value:A,scale:T={},direction:D="vertical",thickness:L,highlightStyle:C,segmentation:O,bar:_,targets:N,cornerRadius:P,cornerMode:j,label:F,...V}=t,{fills:W,fillMode:H,fill:G,fillOpacity:B,stroke:z,strokeWidth:U,strokeOpacity:Y,lineDash:K,lineDashOffset:Z,min:X=0,max:Q=1,interval:$={},label:q={}}=T,J=pn(t,{animation:e,background:i,container:s,contextMenu:n,footnote:a,height:o,listeners:r,locale:l,minHeight:c,minWidth:h,overrideDevicePixelRatio:u,padding:d,subtitle:p,theme:g,title:f,tooltip:H_(S),width:x}),nt=pn(T,{fills:W,fillMode:H,fill:G,fillOpacity:B,stroke:z,strokeWidth:U,strokeOpacity:Y,lineDash:K,lineDashOffset:Z}),it=pn(t,{scale:nt,type:m,cursor:b,nodeClickRange:v,listeners:r,tooltip:S,value:A,direction:D,thickness:L,highlightStyle:C,segmentation:O,bar:_,targets:N,cornerRadius:P,cornerMode:j,label:F,...V}),{placement:rt,...dt}=q;let at,Dt;const kt=D==="horizontal";kt?(at=rt==="before"?"top":"bottom",Dt="left"):(at=rt==="after"?"right":"left",Dt="bottom");const Mt={type:"number",position:at,min:X,max:Q,reverse:!kt,interval:$,label:dt,nice:!1},ft={type:"number",position:Dt,min:0,max:1,label:{enabled:!1}};return{...J,series:[it],axes:kt?[Mt,ft]:[ft,Mt]}}function Y_(t,e){if(e==null)return t;const{targets:i,...s}=e;return t=Tt(t,s),t.targets!=null&&i!=null&&(t.targets=im(t.targets,i)),t}function h9(t,e){if(o9(t)){const b=Y_(t,e);return l9(b)}else if(r9(t)){const b=Y_(t,e);return c9(b)}const{animation:i,background:s,container:n,contextMenu:a,footnote:o,height:r,listeners:l,locale:c,minHeight:h,minWidth:u,padding:d,subtitle:p,theme:g,title:f,tooltip:x,width:m}=t;return pn(t,{animation:i,background:s,container:n,contextMenu:a,footnote:o,height:r,listeners:l,locale:c,minHeight:h,minWidth:u,padding:d,subtitle:p,theme:g,title:f,tooltip:x,width:m})}var u9=I({"packages/ag-charts-community/src/api/preset/gauge.ts"(){"use strict";Db(),oe(),U_()}}),fn,ki,WD,mo,yf,mf,kb,Lb,K_,d9=I({"packages/ag-charts-community/src/api/preset/priceVolumePresetTheme.ts"(){"use strict";ke(),fn={stroke:ve},ki={fill:od},WD={color:"white",fill:ve},mo={color:ve},yf={color:ad,fontSize:{$rem:[1.1666666666666667]},fontFamily:{$ref:"fontFamily"}},mf={...yf,textAlign:"left"},kb={...yf,fontSize:{$ref:"fontSize"},color:cd,fill:rd,stroke:ld,strokeWidth:1,divider:{stroke:hd,strokeWidth:1,strokeOpacity:.5}},Lb={...fn,background:{fill:Ge,fillOpacity:.2},handle:{...ki},text:{...mo},statistics:{...kb}},K_={line:{...fn,handle:{...ki},text:{...mo}},"horizontal-line":{...fn,handle:{...ki},axisLabel:{...WD},text:{...mo}},"vertical-line":{...fn,handle:{...ki},axisLabel:{...WD},text:{...mo}},"disjoint-channel":{...fn,background:{fill:Ge,fillOpacity:.2},handle:{...ki},text:{...mo}},"parallel-channel":{...fn,background:{fill:Ge,fillOpacity:.2},handle:{...ki},text:{...mo}},"fibonacci-retracement":{...fn,strokes:nd,rangeStroke:ve,handle:{...ki},text:{...mo,position:"center"},label:{...yf,color:void 0,fontSize:{$round:[{$mul:[{$ref:"fontSize"},10/12]}]}}},"fibonacci-retracement-trend-based":{...fn,strokes:nd,rangeStroke:ve,handle:{...ki},text:{...mo,position:"center"},label:{...yf,color:void 0,fontSize:{$round:[{$mul:[{$ref:"fontSize"},10/12]}]}}},callout:{...fn,...mf,color:{$ref:"textColor"},handle:{...ki},fill:Ge,fillOpacity:.2},comment:{...mf,color:"white",fontWeight:700,handle:{...ki},fill:ve},note:{...mf,color:fd,fill:ve,stroke:{$ref:"backgroundColor"},strokeWidth:1,strokeOpacity:1,handle:{...ki},background:{fill:pd,stroke:gd,strokeWidth:1}},text:{...mf,handle:{...ki}},arrow:{...fn,handle:{...ki},text:{...mo}},"arrow-up":{fill:id,handle:{...ki,stroke:ve}},"arrow-down":{fill:sd,handle:{...ki,stroke:ve}},"date-range":{...Lb},"price-range":{...Lb},"date-price-range":{...Lb},"quick-date-price-range":{up:{...fn,fill:Ge,fillOpacity:.2,handle:{...ki},statistics:{...kb,color:"#fff",fill:Ge,strokeWidth:0,divider:{stroke:"#fff",strokeWidth:1,strokeOpacity:.5}}},down:{...fn,stroke:dd,fill:ud,fillOpacity:.2,handle:{...ki,stroke:dd},statistics:{...kb,color:"#fff",fill:ud,strokeWidth:0,divider:{stroke:"#fff",strokeWidth:1,strokeOpacity:.5}}}}}}});function gi(t,e){if(bi(t))return e(t)}function p9(t,e,i){const{dateKey:s="date",highKey:n="high",openKey:a="open",lowKey:o="low",closeKey:r="close",volumeKey:l="volume",chartType:c="candlestick",navigator:h=!1,volume:u=!0,rangeButtons:d=!0,statusBar:p=!0,toolbar:g=!0,zoom:f=!0,theme:x,data:m,...b}=t,v=f9(x,c,s,n,o,a,r),S=g9(x,i,a,r,u,l),T={navigator:{enabled:h,...u?{miniChart:{enabled:h,series:[{type:"line",xKey:s,yKey:l,marker:{enabled:!1}}]},height:40,minHandle:{height:46},maxHandle:{height:46}}:null}},D=typeof x=="string"?!0:x?.overrides?.common?.annotations?.axesButtons?.enabled??!0,L={annotations:{enabled:g,optionsToolbar:{enabled:g},snap:!0,axesButtons:{enabled:D},toolbar:{enabled:g,buttons:Q_,padding:0},data:m,xKey:s,volumeKey:u?l:void 0}},C=p?{statusBar:{enabled:!0,data:m,highKey:n,openKey:a,lowKey:o,closeKey:r,volumeKey:u?l:void 0}}:null,O={zoom:{enabled:f,autoScaling:{enabled:!0},enableIndependentAxes:!0}},_={ranges:{enabled:d}},N=u?[{type:"number",position:"left",keys:[l],label:{enabled:!1},crosshair:{enabled:!1},gridLine:{enabled:!1},nice:!1,layoutConstraints:{stacked:!1,width:20,unit:"percentage",align:"end"}}]:[];return{theme:{baseTheme:typeof x=="string"?x:"ag-financial",...Tt(typeof x=="object"?x:null,{overrides:{common:{title:{padding:4},padding:{top:6,right:8,bottom:5},chartToolbar:{enabled:g},annotations:{...K_}}}})},animation:{enabled:!1},legend:{enabled:!1},series:[...S,...v],axes:[{type:"number",position:"right",keys:[a,r,n,o],interval:{maxSpacing:gi(x,P=>P.overrides?.common?.axes?.number?.interval?.maxSpacing)??45},label:{format:gi(x,P=>P.overrides?.common?.axes?.number?.label?.format)??".2f"},crosshair:{enabled:!0,snap:!1},layoutConstraints:{stacked:!1,width:100,unit:"percentage",align:"start"}},...N,{type:"ordinal-time",position:"bottom",line:{enabled:!1},label:{enabled:!0},crosshair:{enabled:!0}}],tooltip:{enabled:!1},data:m,...L,...T,...C,...O,..._,...b}}function g9(t,e,i,s,n,a){if(!n)return[];const o=gi(t,l=>l.overrides?.bar?.series?.fill),r=o?{fill:o}:{itemStyler({datum:l}){const{up:c,down:h}=e().palette;return{fill:l[i]l.overrides?.bar?.series?.fillOpacity)??.5,...r,focusPriority:1,fastDataProcessing:!0}]}function f9(t,e,i,s,n,a,o){const r={xKey:i,openKey:a,closeKey:o,highKey:s,lowKey:n},l={xKey:i,yKey:o},c={pickOutsideVisibleMinorAxis:!0};switch(e??"candlestick"){case"ohlc":return y9(c,r);case"line":return m9(c,t,l);case"step-line":return x9(c,t,l);case"hlc":return b9(c,t,l,r);case"high-low":return S9(c,t,r);case"candlestick":return $_(c,r);case"hollow-candlestick":return v9(c,t,r);default:return et.warnOnce(`unknown chart type: ${e}; expected one of: ${Z_.join(", ")}`),$_(c,r)}}function y9(t,e){return[{type:"ohlc",focusPriority:0,...t,...e}]}function m9(t,e,i){return[{type:"line",focusPriority:0,...t,...i,stroke:gi(e,s=>s.overrides?.line?.series?.stroke)??sh,marker:gi(e,s=>s.overrides?.line?.series?.marker)??{enabled:!1}}]}function x9(t,e,i){return[{type:"line",focusPriority:0,...t,...i,stroke:gi(e,s=>s.overrides?.line?.series?.stroke)??sh,interpolation:gi(e,s=>s.overrides?.line?.series?.interpolation)??{type:"step"},marker:gi(e,s=>s.overrides?.line?.series?.marker)??{enabled:!1}}]}function b9(t,e,i,{xKey:s,highKey:n,closeKey:a,lowKey:o}){const r=X_(Tb,e);return[{type:Tb,focusPriority:0,...t,xKey:s,yHighKey:n,yLowKey:a,fill:r.fill??id,stroke:r.stroke??Gg,fillOpacity:gi(e,l=>l.overrides?.["range-area"]?.series?.fillOpacity)??.3,strokeWidth:gi(e,l=>l.overrides?.["range-area"]?.series?.strokeWidth)??2},{type:Tb,focusPriority:0,...t,xKey:s,yHighKey:a,yLowKey:o,fill:r.fill??sd,stroke:r.stroke??Wg,fillOpacity:gi(e,l=>l.overrides?.["range-area"]?.series?.fillOpacity)??.3,strokeWidth:gi(e,l=>l.overrides?.["range-area"]?.series?.strokeWidth)??2},{type:"line",...t,...i,stroke:gi(e,l=>l.overrides?.line?.series?.stroke)??Hg,strokeWidth:gi(e,l=>l.overrides?.line?.series?.strokeWidth)??2,marker:gi(e,l=>l.overrides?.line?.series?.marker)??{enabled:!1}}]}function S9(t,e,{xKey:i,highKey:s,lowKey:n}){const a=X_("range-bar",e);return[{type:"range-bar",...t,xKey:i,yHighKey:s,yLowKey:n,fill:a.fill??Ug,stroke:a.stroke??sh,tooltip:{range:"nearest"},focusPriority:0,fastDataProcessing:!0}]}function $_(t,e){return[{type:"candlestick",focusPriority:0,...t,...e}]}function v9(t,e,i){const s=gi(e,n=>n.overrides?.candlestick?.series?.item);return[{type:"candlestick",focusPriority:0,...t,...i,item:{up:{fill:s?.up?.fill??"transparent"}}}]}function X_(t,e){const i=gi(e,n=>n.overrides?.[t]?.series?.fill),s=gi(e,n=>n.overrides?.[t]?.series?.stroke);return{fill:i,stroke:s}}var Z_,Q_,Tb,M9=I({"packages/ag-charts-community/src/api/preset/priceVolumePreset.ts"(){"use strict";ot(),ke(),oe(),d9(),Z_=["ohlc","line","step-line","hlc","high-low","candlestick","hollow-candlestick"],Q_=[{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"}],Tb="range-area"}});function I9(t,e){return typeof t=="string"?{...e,baseTheme:t}:t!=null?{...t,baseTheme:HD(t.baseTheme,e)}:e}function q_(t){if(Array.isArray(t)&&t.length!==0){const e=t[0];if(typeof e=="number")return{data:t.map((s,n)=>({x:n,y:s})),series:[{xKey:"x",yKey:"y"}],datumKey:"y"};if(Array.isArray(e))return{data:t.map(s=>({x:s[0],y:s[1],datum:s})),series:[{xKey:"x",yKey:"y"}],datumKey:"datum"}}return{data:t}}function A9(t,e){switch(t?.type){case"number":{const{type:i,min:s,max:n,reverse:a}=t;return pn(t,{type:i,reverse:a,min:s,max:n})}case"time":{const{type:i,min:s,max:n,reverse:a}=t;return pn(t,{type:i,reverse:a,min:s,max:n})}case"category":{const{type:i,paddingInner:s,paddingOuter:n,reverse:a}=t;return pn(t,{type:i,reverse:a,paddingInner:s,paddingOuter:n})}}return{type:e}}function D9(t,e,i){const s={};return t?.stroke!=null&&(s.style=[{stroke:t?.stroke}],s.enabled??(s.enabled=!0)),t?.strokeWidth!=null&&(s.width=t?.strokeWidth,s.enabled??(s.enabled=!0)),i.type==="bar"&&i.direction!=="horizontal"&&(s.enabled??(s.enabled=!0)),t?.visible!=null&&(s.enabled=t.visible),s.enabled??(s.enabled=e),s}function k9(t){const{background:e,container:i,height:s,listeners:n,locale:a,minHeight:o,minWidth:r,overrideDevicePixelRatio:l,padding:c,width:h,theme:u,data:d,crosshair:p,axis:g,min:f,max:x,tooltip:m,context:b,...v}=t,S=pn(t,{background:e,container:i,height:s,listeners:n,locale:a,minHeight:o,minWidth:r,overrideDevicePixelRatio:l,padding:c,width:h,tooltip:gn,context:gn,data:gn,crosshair:gn,axis:gn,min:gn,max:gn,theme:gn}),{data:A,series:[T]=[],datumKey:D}=q_(d),L=v;T!=null&&Object.assign(L,T),L.tooltip={...m,renderer:eP(b,m,D)},S.theme=HD(u,tP),S.data=A,S.series=[L];const C=L.type!=="bar"||L.direction!=="horizontal",[O,_]=C?["bottom","left"]:["left","bottom"],N={...A9(g,"category"),position:O,...pn(t,{crosshair:p})},P={type:"number",gridLine:D9(g,!1,t),position:_,...pn(t,{min:f,max:x})};return S.axes=C?[P,N]:[N,P],S}var UD,Cb,Nb,Ob,J_,tP,HD,eP,L9=I({"packages/ag-charts-community/src/api/preset/sparkline.ts"(){"use strict";Db(),ke(),RA(),U_(),UD={title:{enabled:!1},label:{enabled:!1},line:{enabled:!1},gridLine:{enabled:!1},crosshair:{enabled:!1,stroke:$g,lineDash:[0],label:{enabled:!1}}},Cb={...UD,nice:!1},Nb={position:{type:"sparkline"}},Ob={style:[{stroke:{$ref:"gridLineColor"}}],width:2},J_={number:{gridLine:Ob},time:{gridLine:Ob},category:{gridLine:Ob}},tP={overrides:{common:{animation:{enabled:!1},contextMenu:{enabled:!1},keyboard:{enabled:!1},background:{visible:!1},padding:{top:0,right:0,bottom:0,left:0},axes:{number:{...Cb,interval:{values:[0]}},log:{...Cb},time:{...Cb},category:{...UD}}},bar:{series:{crisp:!1,label:{placement:"inside-end",padding:4},sparklineMode:!0},tooltip:{...Nb,range:"nearest"},axes:J_},line:{seriesArea:{padding:{top:2,right:2,bottom:2,left:2}},series:{sparklineMode:!0,strokeWidth:1,marker:{enabled:!1,size:3},tooltip:Nb}},area:{seriesArea:{padding:{top:1,right:0,bottom:1,left:0}},series:{strokeWidth:1,fillOpacity:.4,tooltip:Nb}}}},HD=ks(I9),eP=ks((t,e,i)=>s=>{const n=s.datum[s.xKey],a=s.datum[s.yKey],o=i!=null?s.datum[i]:s.datum,r=e?.renderer?.({context:t,datum:o,xValue:n,yValue:a});if(typeof r=="string")return r;const l=r?.title,c=r?.content;return l!=null&&c!=null?{heading:l,title:void 0,data:[{label:void 0,value:c}]}:{heading:l??c??a.toFixed(2),title:void 0,data:[]}})}}),iP,sP,T9=I({"packages/ag-charts-community/src/api/preset/presets.ts"(){"use strict";u9(),M9(),L9(),iP={"price-volume":p9,gauge:h9,sparkline:k9},sP={sparkline:q_}}});function nP(t,e){let i=[];const s=oR(t),n=nr(t),a=n?de.get(n):"unknown";for(const o of Yc)if(!(a!=="unknown"&&!o.chartTypes.includes(a))){if(o.type==="root"||o.type==="legend"){const r=t[o.optionsKey];if(r==null)continue;o.optionsInnerKey?r[o.optionsInnerKey]&&(i.push(`${o.optionsKey}.${o.optionsInnerKey}`),delete r[o.optionsInnerKey]):(i.push(o.optionsKey),delete t[o.optionsKey])}else if(o.type==="axis"){if(!("axes"in t)||!t.axes?.some(r=>r.type===o.identifier))continue;i.push(`axis[type=${o.identifier}]`),t.axes=t.axes.filter(r=>r.type!==o.identifier)}else if(o.type==="axis-option"){if(!("axes"in t)||!t.axes?.some(r=>r[o.optionsKey]))continue;i.push(`axis.${o.optionsKey}`),t.axes.forEach(r=>{r[o.optionsKey]&&delete r[o.optionsKey]})}else if(o.type==="series"){if(o.community||!t.series?.some(r=>r.type===o.identifier))continue;i.push(`series[type=${o.identifier}]`),t.series=t.series.filter(r=>r.type!==o.identifier)}else if(o.type==="series-option"){if(!t.series?.some(r=>r[o.optionsKey]))continue;i.push(`series.${o.optionsKey}`),t.series.forEach(r=>{r[o.optionsKey]&&delete r[o.optionsKey]})}}if(i.length&&!e){s&&(i=["AgCharts.createGauge"]);let o="ag-charts-enterprise",r="https://www.ag-grid.com/charts/javascript/installation/";t.mode==="integrated"&&(o="ag-grid-charts-enterprise' or 'ag-grid-enterprise/charts-enterprise",r="https://www.ag-grid.com/javascript-data-grid/integrated-charts-installation/"),et.warnOnce([`unable to use these enterprise features as '${o}' has not been loaded:`,"",...i,"",`See: ${r}`].join(` `))}}function C9(t){const e="mode"in t&&t.mode==="integrated";for(const i of pa.byType("root","legend")){const s=t[i.optionsKey],n=s!=null&&s.enabled===!1,a=!("removable"in i)||i.removable===!0||i.removable==="standalone-only"&&!e;n&&a&&delete t[i.optionsKey]}}var N9=I({"packages/ag-charts-community/src/chart/factory/processEnterpriseOptions.ts"(){"use strict";ot(),no(),ju(),Fu(),Ig()}});function YD(t){return t?.up||t?.down||t?.neutral?"user-full":t?.fills||t?.strokes?"user-indexed":"inbuilt"}var aP=I({"packages/ag-charts-community/src/module/coreModulesTypes.ts"(){"use strict"}});function oP(t){return rP[t]===!0}var xf,wb,rP,lP,yn,xo,yl=I({"packages/ag-charts-community/src/chart/themes/chartTheme.ts"(){"use strict";ot(),aP(),Ib(),jn(),oe(),zu(),Fu(),aA(),hx(),gb(),ke(),xf="white",wb={get cartesian(){return{seriesTypes:de.cartesianTypes,commonOptions:["zoom","navigator"]}},get polar(){return{seriesTypes:de.polarTypes,commonOptions:[]}},get hierarchy(){return{seriesTypes:de.hierarchyTypes,commonOptions:[]}},get topology(){return{seriesTypes:de.topologyTypes,commonOptions:[]}},get"flow-proportion"(){return{seriesTypes:de.flowProportionTypes,commonOptions:[]}},get standalone(){return{seriesTypes:de.standaloneTypes,commonOptions:[]}},get gauge(){return{seriesTypes:de.gaugeTypes,commonOptions:[]}}},rP={"radial-gauge":!0,"linear-gauge":!0},lP=Object.values(wb).reduce((t,{commonOptions:e})=>t.concat(e),[]),yn=class EN{static getAxisDefaults(e){return Tt(e,{title:{enabled:!1,text:"Axis Title",spacing:25,fontWeight:{$ref:"fontWeight"},fontSize:{$rem:[1.0833333333333333]},fontFamily:{$ref:"fontFamily"},color:{$ref:"textColor"}},label:{fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},spacing:11,color:{$ref:"textColor"},avoidCollisions:!0},line:{enabled:!0,width:1,stroke:{$ref:"axisColor"}},tick:{enabled:!1,width:1,stroke:{$ref:"axisColor"}},gridLine:{enabled:!0,style:[{stroke:{$ref:"gridLineColor"},lineDash:[]}]},crossLines:{enabled:!1,fill:{$ref:"foregroundColor"},stroke:{$ref:"foregroundColor"},fillOpacity:.1,strokeWidth:1,label:{enabled:!1,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},padding:5,color:{$ref:"textColor"}}},crosshair:{enabled:!0}})}getChartDefaults(){return{minHeight:300,minWidth:300,background:{visible:!0,fill:{$ref:"backgroundColor"}},padding:{top:{$ref:"padding"},right:{$ref:"padding"},bottom:{$ref:"padding"},left:{$ref:"padding"}},seriesArea:{padding:{top:0,right:0,bottom:0,left:0}},keyboard:{enabled:!0},title:{enabled:!1,text:"Title",fontWeight:{$ref:"fontWeight"},fontSize:{$rem:[1.4166666666666667]},fontFamily:{$ref:"fontFamily"},color:{$ref:"textColor"},wrapping:"hyphenate",layoutStyle:ur,textAlign:dr},subtitle:{enabled:!1,text:"Subtitle",spacing:20,fontWeight:{$ref:"fontWeight"},fontSize:{$rem:[1.0833333333333333]},fontFamily:{$ref:"fontFamily"},color:{$ref:"subtleTextColor"},wrapping:"hyphenate",layoutStyle:ur,textAlign:dr},footnote:{enabled:!1,text:"Footnote",spacing:20,fontSize:{$rem:[1.0833333333333333]},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"subtleTextColor"},wrapping:"hyphenate",layoutStyle:ur,textAlign:dr},legend:{position:"bottom",spacing:30,listeners:{},toggleSeries:!0,item:{paddingX:16,paddingY:8,marker:{size:15,padding:8},showSeriesStroke:!0,label:{color:{$ref:"textColor"},fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"}}},reverseOrder:!1,pagination:{marker:{size:12},activeStyle:{fill:{$ref:"foregroundColor"}},inactiveStyle:{fill:{$ref:"subtleTextColor"}},highlightStyle:{fill:{$ref:"foregroundColor"}},label:{color:{$ref:"textColor"}}}},tooltip:{enabled:!0,darkTheme:ih,delay:0},overlays:{darkTheme:ih},listeners:{}}}constructor(e={}){const{overrides:i,palette:s}=ni(e),n=this.createChartConfigPerChartType(this.getDefaults()),a={};i&&this.mergeOverrides(n,a,i);const{fills:o,strokes:r,...l}=this.getDefaultColors();this.palette=Pp(Tt(s,{fills:Object.values(o),strokes:Object.values(r),...l})),this.paletteType=YD(s),this.config=Pp(this.templateTheme(n)),this.presets=Pp(a)}mergeOverrides(e,i,s){for(const{seriesTypes:n,commonOptions:a}of Object.values(wb)){const o={...s.common};for(const r of lP)a.includes(r)||delete o[r];if(o)for(const r of n){const l=r;oP(l)||(e[l]=Tt(o,e[l]))}}de.seriesTypes.forEach(n=>{const a=n,o=s[a];oP(a)?i[a]=o:e[a]=Tt(o,e[a])})}createChartConfigPerChartType(e){for(const[i,{seriesTypes:s}]of Object.entries(wb)){const n=cx.get(i);for(const a of s)e[a]??(e[a]=ni(n))}return e}getDefaults(){const e=(i,s)=>{const n={},a={axes:{},...lx.getThemeTemplates(),...this.getChartDefaults(),...cx.get(i)};for(const o of s){n[o]=Tt(Ds.getThemeTemplate(o),n[o]??ni(a));const{axes:r}=n[o];for(const l of ro.keys())r[l]=Tt(r[l],ro.getThemeTemplate(l),EN.cartesianAxisDefault[l])}return n};return Tt(e("cartesian",de.cartesianTypes),e("polar",de.polarTypes),e("hierarchy",de.hierarchyTypes),e("topology",de.topologyTypes),e("flow-proportion",de.flowProportionTypes),e("standalone",de.standaloneTypes),e("gauge",de.gaugeTypes))}static applyTemplateTheme(e,i,s){if(ne(e))for(let n=0;nnew xo),bP=ks(()=>new ch),Eb={"ag-default-dark":bP,"ag-sheets-dark":ks(()=>new fP),"ag-polychroma-dark":ks(()=>new pP),"ag-vivid-dark":ks(()=>new mP),"ag-material-dark":ks(()=>new uP),"ag-financial-dark":ks(()=>new cP),null:hh,undefined:hh,"ag-default":hh,"ag-sheets":ks(()=>new yP),"ag-polychroma":ks(()=>new gP),"ag-vivid":ks(()=>new xP),"ag-material":ks(()=>new dP),"ag-financial":ks(()=>new hP)},Sf=ks(V9),SP={baseTheme:$r(Rs,Uy),overrides:Uy,params:Uy,palette:{fills:Hy(Rs),strokes:Hy(Rs),up:{fill:Rs,stroke:Rs},down:{fill:Rs,stroke:Rs},neutral:{fill:Rs,stroke:Rs}}}}}),vP,_b,KD,MP=I({"packages/ag-charts-community/src/module/optionsModule.ts"(){"use strict";ot(),Db(),T9(),zu(),Fu(),Ig(),N9(),hx(),Rb(),ju(),Lt(),hc(),di(),jn(),oe(),aP(),Ib(),vP=new Set(["map-shape-background","map-line-background"]),_b=class Vo{constructor(e,i,s,n,a,o=!1){this.themeParameters={},this.debug=Jt.create(!0,"opts"),this.optionMetadata=n??{},this.processedOverrides=i??{};let r=null;if(e instanceof Vo){if(r=e,this.specialOverrides=r.specialOverrides,!a)throw new Error("AG Charts - internal error: deltaOptions must be supplied.");this.userOptions=Tt(a,ni(r.userOptions,Vo.OPTIONS_CLONE_OPTS))}else this.userOptions=e,this.specialOverrides=this.specialOverridesDefaults({...s});o&&this.removeLeftoverSymbols(this.userOptions);let l,c,h,u,d;!o&&a!=null&&Vo.isFastPathDelta(a)&&r!=null?{activeTheme:l,processedOptions:c,defaultAxes:h,fastDelta:u}=this.fastSetup(a,r):{activeTheme:l,processedOptions:c,defaultAxes:h,themeParameters:d}=this.slowSetup(i,a,o),this.activeTheme=l,this.processedOptions=c,this.defaultAxes=h,this.fastDelta=u,this.themeParameters=d??{}}static isFastPathDelta(e){for(const i of Object.keys(e))if(!this.FAST_PATH_OPTIONS.has(i))return!1;return!0}fastSetup(e,i){const{activeTheme:s,defaultAxes:n,processedOptions:a}=i,{presetType:o}=this.optionMetadata,r=o?sP[o]:void 0;if(o!=null&&e.data!=null&&r!=null){const{series:c,data:h}=r(e.data);e=Tt({series:c,data:h},e)}this.fastSeriesSetup(e,a);const l=Tt(e,a);return{activeTheme:s,defaultAxes:n,processedOptions:l,fastDelta:e}}fastSeriesSetup(e,i){e.series&&(e.series?.every((s,n)=>lw(s,i.series?.[n]??{}))?delete e.series:e.series=e.series.map((s,n)=>Tt(s,i.series?.[n]??{})))}slowSetup(e,i,s=!1){let n=ni(this.userOptions,Vo.OPTIONS_CLONE_OPTS);i&&(n=Tt(i,n),s&&this.removeLeftoverSymbols(n));const{presetType:a}=this.optionMetadata;if(a!=null){const m=iP[a],b=this.userOptions,v=this.userOptions.type,S=v!=null?Sf(this.userOptions.theme).presets[v]:void 0;this.debug(">>> AgCharts.createOrUpdate() - applying preset",b),n=m?.(b,S,()=>this.activeTheme)??n}yo.isEnterprise||nP(n);const o=Sf(n.theme);this.sanityCheck(n),this.removeDisabledOptions(n);const r=this.optionsType(n),{axes:l={},annotations:c={},series:h,...u}=this.getSeriesThemeConfig(r,o),[d,p]=this.splitAnnotationsOptions(c);this.annotationThemes=ni(p);const g=this.getDefaultAxes(n,h);let f=Tt(e,n,d,u,g);this.processAxesOptions(f,l),this.processSeriesOptions(f,o),this.processMiniChartSeriesOptions(f,o),f=ni(f,Vo.OPTIONS_CLONE_OPTS);const x=this.getThemeParameters(o,f);return this.resolveThemeOperations(x,x),this.resolveThemeOperations(x,f),this.resolveThemeOperations(x,this.annotationThemes),(cA(f)||aR(f)||v$(f))&&f.legend?.enabled==null&&(f.legend??(f.legend={}),f.legend.enabled=f.series.length>1),this.enableConfiguredOptions(f,this.userOptions),o.templateTheme(f,!1),this.removeDisabledOptions(n),C9(f),yo.isEnterprise||nP(f,!0),this.debug("AgCharts.createOrUpdate() - processed options",f),{activeTheme:o,processedOptions:f,defaultAxes:g,themeParameters:x}}diffOptions(e){return this===e?{}:e==null?this.processedOptions:this.fastDelta??Qo(e.processedOptions,this.processedOptions)}getSeriesThemeConfig(e,i){return i?.config[e]??{}}getDefaultAxes(e,i){const s=this.optionsType(e);let n=e.series?.find(a=>(a.type??"line")===s)??{};return Ds.isDerivedDefaultAxes(s)&&(n=Tt(n,i)),Ds.cloneDefaultAxes(s,n)}optionsType(e){return e.series?.[0]?.type??"line"}sanityCheck(e){this.axesTypeIntegrity(e),this.seriesTypeIntegrity(e),this.soloSeriesIntegrity(e)}splitAnnotationsOptions(e){const{axesButtons:i=null,enabled:s=null,optionsToolbar:n=null,toolbar:a=null,...o}=e;return i==null&&s==null&&n==null&&a==null?[{},o]:[{annotations:{axesButtons:i,enabled:s,optionsToolbar:n,toolbar:a}},o]}processAxesOptions(e,i){"axes"in e&&(e.axes=e.axes?.map(s=>{const{crossLines:n,...a}=Tt(i[s.type]?.[s.position],i[s.type]);s.crossLines&&(s.crossLines=im(s.crossLines,n));const o=a.gridLine?.style;s.gridLine?.style&&o?.length&&(s.gridLine.style=s.gridLine.style.map((d,p)=>d.stroke!=null||d.lineDash!=null?Tt(d,o.at(p%o.length)):d));const{top:r,right:l,bottom:c,left:h,...u}=Tt(s,a);return u}))}processSeriesOptions(e,i){const s=this.getTooltipPositionDefaults(e),n=bi(e.theme)?YD(e.theme?.palette):"inbuilt",a={colourIndex:0,userPalette:n},o=e.series?.map(r=>{r.type??(r.type=this.getDefaultSeriesType(e));const{innerLabels:l,...c}=this.getSeriesThemeConfig(r.type,i).series??{},h=vP.has(r.type)?{colourIndex:0,userPalette:n}:a,u=this.getSeriesPalette(r.type,h,i),d=this.getTooltipRangeDefaults(e,r.type),p=Tt(this.getSeriesGroupingOptions(r),r,s,d,c,u,{visible:!0});return p.innerLabels&&(p.innerLabels=im(p.innerLabels,l)),p});e.series=this.setSeriesGroupingOptions(o??[])}processMiniChartSeriesOptions(e,i){let s=e.navigator?.miniChart?.series;if(s==null)return;const n={colourIndex:0,userPalette:bi(e.theme)?YD(e.theme.palette):"inbuilt"};s=s.map(a=>{a.type??(a.type="line");const{innerLabels:o,...r}=this.getSeriesThemeConfig(a.type,i).series??{};return Tt(this.getSeriesGroupingOptions(a),a,r,this.getSeriesPalette(a.type,n,i))}),e.navigator.miniChart.series=this.setSeriesGroupingOptions(s)}getThemeParameters(e,i){const s=e.getPublicParameters();if(!Xi(i.theme)||!i.theme.params)return s;const n=Zi(l=>Es(l)&&xe.validColorString(l),"a color"),a={accentColor:n,axisColor:n,backgroundColor:n,borderColor:n,foregroundColor:n,fontFamily:Rs,fontSize:Xa,fontWeight:$r(Rs,Xa),gridLineColor:n,padding:Xa,subtleTextColor:n,textColor:n,chromeBackgroundColor:n,chromeFontFamily:Rs,chromeFontSize:Xa,chromeFontWeight:$r(Rs,Xa),chromeSubtleTextColor:n,chromeTextColor:n,inputBackgroundColor:n,inputTextColor:n,crosshairLabelBackgroundColor:n,crosshairLabelTextColor:n},{valid:o,errors:r}=Wy(i.theme.params,a);for(const{message:l}of r)et.warnOnce(l);return Tt(o,s)}resolveThemeOperations(e,i){const s=cw(i,e,new Set(["palette","data"]));this.debug("resolveTheme()",s)}getSeriesPalette(e,i,s){const n=Ds.getPaletteFactory(e),{colourIndex:a,userPalette:o}=i,{fills:r=[],strokes:l=[]}=s.palette;return n?.({userPalette:o,colorsCount:Math.max(r.length,l.length),themeTemplateParameters:s.getTemplateParameters(),palette:s.palette,takeColors(c){return i.colourIndex+=c,{fills:GN(r,c,a),strokes:GN(l,c,a)}}})}getSeriesGroupingOptions(e){const i=Ds.isGroupable(e.type),s=Ds.isStackable(e.type),n=Ds.isStackedByDefault(e.type);e.grouped&&!i&&et.warnOnce(`unsupported grouping of series type "${e.type}".`),(e.stacked||e.stackGroup)&&!s&&et.warnOnce(`unsupported stacking of series type "${e.type}".`);let{grouped:a,stacked:o}=e;return o??(o=(n||e.stackGroup!=null)&&!(i&&a)),a??(a=!0),{stacked:s&&o,grouped:i&&a&&!(s&&o)}}setSeriesGroupingOptions(e){const i=this.getSeriesGrouping(e);this.debug("setSeriesGroupingOptions() - series grouping: ",i);const s={},n=i.reduce((a,o)=>{var r;return o.groupType==="default"||(a[r=o.seriesType]??(a[r]=0),a[o.seriesType]+=o.groupType==="stack"?1:o.series.length),a},{});return i.flatMap(a=>{var o;switch(s[o=a.seriesType]??(s[o]=0),a.groupType){case"stack":{const r=s[a.seriesType]++;return a.series.map((l,c)=>Object.assign(l,{seriesGrouping:{groupId:a.groupId,groupIndex:r,groupCount:n[a.seriesType],stackIndex:c,stackCount:a.series.length}}))}case"group":return a.series.map(r=>Object.assign(r,{seriesGrouping:{groupId:a.groupId,groupIndex:s[a.seriesType]++,groupCount:n[a.seriesType],stackIndex:0,stackCount:0}}))}return a.series}).map(({stacked:a,grouped:o,...r})=>r)}getSeriesGroupId(e){return[e.type,e.xKey,e.stacked?e.stackGroup??"stacked":"grouped"].filter(Boolean).join("-")}getSeriesGrouping(e){const i=new Map;return e.reduce((s,n)=>{const a=n.type;if(!n.stacked&&!n.grouped)s.push({groupType:"default",seriesType:a,series:[n],groupId:"__default__"});else{const o=this.getSeriesGroupId(n);if(!i.has(o)){const l={groupType:n.stacked?"stack":"group",seriesType:a,series:[],groupId:o};i.set(o,l),s.push(l)}i.get(o).series.push(n)}return s},[])}getDefaultSeriesType(e){switch(Kr.detectChartDefinition(e).name){case"cartesian":return"line";case"polar":return"pie";case"hierarchy":return"treemap";case"topology":return"map-shape";case"flow-proportion":return"sankey";case"standalone":return"pyramid";case"gauge":return"radial-gauge";default:throw new Error("Invalid chart options type detected.")}}getTooltipPositionDefaults(e){const i=e.tooltip?.position;if(!Xi(i))return;const{type:s,xOffset:n,yOffset:a}=i,o={};return Es(s)&&z3(Ab,s)&&(o.type=s),zt(n)&&(o.xOffset=n),zt(a)&&(o.yOffset=a),{tooltip:{position:o}}}getTooltipRangeDefaults(e,i){return{tooltip:{range:e.tooltip?.range??Ds.getTooltipDefauls(i)?.range}}}axesTypeIntegrity(e){if("axes"in e&&e.axes){const i=e.axes;for(const{type:s}of i)if(!I$(s)){delete e.axes;const n=[...ro.keys()].join(", ");et.warnOnce(`unknown axis type: ${s}; expected one of: ${n}`)}}}seriesTypeIntegrity(e){e.series=e.series?.filter(({type:i})=>{if(i==null||M$(i)||t$(i))return!0;et.warnOnce(`unknown series type: ${JSON.stringify(i)}; expected one of: ${rA.seriesTypes.join(", ")}`)})}soloSeriesIntegrity(e){const i=e.series;if(i&&i.length>1&&i.some(s=>Ds.isSolo(s.type))){const s=this.optionsType(e);if(Ds.isSolo(s))et.warn(`series[0] of type '${s}' is incompatible with other series types. Only processing series[0]`),e.series=i.slice(0,1);else{const{solo:n,nonSolo:a}=kM(i,r=>Ds.isSolo(r.type)?"solo":"nonSolo"),o=A3(n.map(r=>r.type)).join(", ");et.warn(`Unable to mix these series types with the lead series type: ${o}`),e.series=a}}}static enableConfiguredJsonOptions(e,i){typeof i=="object"&&"enabled"in i&&!i._enabledFromTheme&&e.enabled==null&&(i.enabled=!0)}static cleanupEnabledFromThemeJsonOptions(e){e._enabledFromTheme!=null&&delete e._enabledFromTheme}enableConfiguredOptions(e,i){qo(i,Vo.enableConfiguredJsonOptions,new Set(["data","theme"]),e),qo(e,Vo.cleanupEnabledFromThemeJsonOptions,new Set(["data","theme"]))}static removeDisabledOptionJson(e){"enabled"in e&&e.enabled===!1&&Object.keys(e).forEach(i=>{i!=="enabled"&&delete e[i]})}removeDisabledOptions(e){qo(e,Vo.removeDisabledOptionJson,new Set(["data","theme"]))}static removeLeftoverSymbolsJson(e){if(!(!e||!bi(e)))for(const[i,s]of Object.entries(e))F3(s)&&delete e[i]}removeLeftoverSymbols(e){qo(e,Vo.removeLeftoverSymbolsJson,new Set(["data"]))}specialOverridesDefaults(e){if(e.window!=null?t2(e.window):typeof window<"u"?e.window=window:typeof global<"u"&&(e.window=global.window),e.document!=null?JN(e.document):typeof document<"u"?e.document=document:typeof global<"u"&&(e.document=global.document),e.window==null)throw new Error("AG Charts - unable to resolve global window");if(e.document==null)throw new Error("AG Charts - unable to resolve global document");return e}},_b.OPTIONS_CLONE_OPTS=new Set(["data","container"]),_b.FAST_PATH_OPTIONS=new Set(["data","width","height"]),KD=_b}}),IP,Pb,AP,W9=I({"packages/ag-charts-community/src/util/pool.ts"(){"use strict";di(),IP=100,Pb=class lu{constructor(e,i,s,n,a,o=IP){this.name=e,this.buildItem=i,this.releaseItem=s,this.destroyItem=n,this.maxPoolSize=a,this.cleanupTimeMs=o,this.freePool=[],this.busyPool=new Set}static getPool(e,i,s,n,a){return this.pools.has(e)||this.pools.set(e,new lu(e,i,s,n,a)),this.pools.get(e)}isFull(){return this.freePool.length+this.busyPool.size>=this.maxPoolSize}obtain(e){if(this.freePool.length===0&&this.isFull())throw new Error("AG Charts - pool exhausted");let i=this.freePool.pop();return i==null?(i=this.buildItem(e),lu.debug(`Pool[name=${this.name}]: Created instance (${this.freePool.length} / ${this.busyPool.size+1} / ${this.maxPoolSize})`,i)):lu.debug(`Pool[name=${this.name}]: Re-used instance (${this.freePool.length} / ${this.busyPool.size+1} / ${this.maxPoolSize})`,i),this.busyPool.add(i),{item:i,release:()=>this.release(i)}}release(e){if(!this.busyPool.has(e))throw new Error("AG Charts - cannot free item from pool which is not tracked as busy.");lu.debug(`Pool[name=${this.name}]: Releasing instance (${this.freePool.length} / ${this.busyPool.size} / ${this.maxPoolSize})`,e),this.releaseItem(e),this.busyPool.delete(e),this.freePool.push(e),lu.debug(`Pool[name=${this.name}]: Returned instance to free pool (${this.freePool.length} / ${this.busyPool.size} / ${this.maxPoolSize})`,e),this.cleanPoolTimer&&clearTimeout(this.cleanPoolTimer),this.cleanPoolTimer=setTimeout(()=>{this.cleanPool()},this.cleanupTimeMs)}cleanPool(){const e=this.freePool.splice(0);for(const i of e)this.destroyItem(i);lu.debug(`Pool[name=${this.name}]: Cleaned pool of ${e.length} items (${this.freePool.length} / ${this.busyPool.size} / ${this.maxPoolSize})`)}destroy(){this.cleanPool();for(const e of this.busyPool.values())this.destroyItem(e);this.busyPool.clear()}},Pb.pools=new Map,Pb.debug=Jt.create(!0,"pool"),AP=Pb}}),So,mr,Da,$D,U9=I({"packages/ag-charts-community/src/api/agCharts.ts"(){"use strict";ot(),s6(),Sx(),n6(),w_(),kX(),NX(),Ib(),MP(),di(),jn(),W9(),$m(),ww(),Kr.registerMany([$R,R_]),So=Jt.create(!0,"opts"),mr=class{static licenseCheck(t){this.licenseChecked||(this.licenseManager=yo.licenseManager?.(t),this.licenseManager?.validateLicense(),this.licenseChecked=!0)}static getLicenseDetails(t){return yo.licenseManager?.({}).getLicenseDetails(t)}static getInstance(t){return $D.getInstance(t)}static create(t,e){return So.group("AgCharts.create()",()=>{this.licenseCheck(t);const i=$D.createOrUpdate({userOptions:t,licenseManager:this.licenseManager,optionsMetadata:e});return this.licenseManager?.isDisplayWatermark()&&this.licenseManager&&yo.injectWatermark?.(i.chart.ctx.domManager,this.licenseManager.getWatermarkMessage()),i})}static createFinancialChart(t){return So.group("AgCharts.createFinancialChart()",()=>this.create(t,{presetType:"price-volume"}))}static createGauge(t){return So.group("AgCharts.createGauge()",()=>this.create(t,{presetType:"gauge"}))}static __createSparkline(t){return So.group("AgCharts.__createSparkline()",()=>{const{pool:e,...i}=t;return this.create(i,{presetType:"sparkline",pool:e??!0})})}},mr.licenseChecked=!1,Da=class rc{static getInstance(e){const i=Tg.getInstance(e);return i?wA.chartInstances.get(i):void 0}static initialiseModules(){rc.initialised||(GD(),DX(),rc.initialised=!0)}static createOrUpdate(e){let{proxy:i}=e;const{userOptions:s,licenseManager:n,processedOverrides:a=i?.chart.chartOptions.processedOverrides??{},specialOverrides:o=i?.chart.chartOptions.specialOverrides??{},optionsMetadata:r=i?.chart.chartOptions.optionMetadata??{},deltaOptions:l,stripSymbols:c=!1}=e,h=yo.styles!=null?[["ag-charts-enterprise",yo.styles]]:[],{presetType:u}=r;rc.initialiseModules(),So(()=>[">>> AgCharts.createOrUpdate() user options",ni(s)]);let d=s;mr.optionsMutationFn&&d&&(d=mr.optionsMutationFn(ni(d),u),So(()=>[">>> AgCharts.createOrUpdate() MUTATED user options",ni(d)]));const{document:p,window:g,styleContainer:f,...x}=d??{},m=(l?i?.chart.getChartOptions():x)??x,b=new KD(m,a,{...o,document:p,window:g,styleContainer:f},r,l,c);let v=!1,S=i?.chart,A;return(S==null||Kr.detectChartDefinition(b.processedOptions)!==Kr.detectChartDefinition(S.chartOptions.processedOptions))&&(A=this.getPool(b)?.obtain(b),A?S=A.item:(v=!0,S=rc.createChartInstance(b,S)),h.forEach(([T,D])=>{S?.ctx.domManager.addStyles(T,D)})),i==null?(i=new wA(S,rc.callbackApi,n),i.releaseChart=A?.release):(A||v)&&(i.releaseChart?.(),i.chart=S,i.releaseChart=A?.release),So.check()&&typeof window<"u"&&(window.agChartInstances??(window.agChartInstances={}),window.agChartInstances[S.id]=S),S.queuedUserOptions.push(b.userOptions),S.queuedChartOptions.push(b),S.requestFactoryUpdate(T=>{So.group(">>>> Chart.applyOptions()",()=>{T.applyOptions(b);const D=T.queuedUserOptions.indexOf(b.userOptions)+1;T.queuedUserOptions.splice(0,D),T.queuedChartOptions.splice(0,D)})}),i}static markRemovedProperties(e,i,s=!1){if(typeof e!="object")return s;for(const[n,a]of Object.entries(e))typeof a>"u"&&(Object.assign(e,{[n]:Symbol("UNSET")}),s||(s=!0));return s}static updateUserDelta(e,i){i=ni(i,new Set(["data"]));const s=qo(i,rc.markRemovedProperties,new Set(["data"]),void 0,void 0,!1);So(()=>[">>> AgCharts.updateUserDelta() user delta",ni(i)]),rc.createOrUpdate({proxy:e,deltaOptions:i,stripSymbols:s})}static createChartInstance(e,i){const s=i?.destroy({keepTransferableResources:!0});return Kr.detectChartDefinition(e.processedOptions).create(e,s)}static getPool(e){if(e.optionMetadata.pool===!0)return AP.getPool(e.optionMetadata.presetType??"default",this.createChartInstance,this.detachAndClear,this.destroy,1/0)}},Da.caretaker=new II(zc),Da.initialised=!1,Da.callbackApi={caretaker:Da.caretaker,create(t,e,i,s){return Da.createOrUpdate({userOptions:t,processedOverrides:e,specialOverrides:i,optionsMetadata:s})},update(t,e){return Da.createOrUpdate({userOptions:t,proxy:e})},updateUserDelta(t,e){return Da.updateUserDelta(t,e)}},Da.detachAndClear=t=>t.detachAndClear(),Da.destroy=t=>t.destroy(),$D=Da}}),ka,DP=I({"packages/ag-charts-community/src/scene/shape/arc.ts"(){"use strict";Ii(),At(),Rt(),Gn(),ka=class extends ns{constructor(){super(),this.centerX=0,this.centerY=0,this.radius=10,this.startAngle=0,this.endAngle=Math.PI*2,this.counterClockwise=!1,this.type=0,this.restoreOwnStyles()}get fullPie(){return ca(re(this.startAngle),re(this.endAngle))}updatePath(){const t=this.path;t.clear(),t.arc(this.centerX,this.centerY,this.radius,this.startAngle,this.endAngle,this.counterClockwise),this.type===1?t.closePath():this.type===2&&!this.fullPie&&(t.lineTo(this.centerX,this.centerY),t.closePath())}computeBBox(){return new ht(this.centerX-this.radius,this.centerY-this.radius,this.radius*2,this.radius*2)}isPointInPath(t,e){const i=this.getBBox();return this.type!==0&&i.containsPoint(t,e)&&this.path.isPointInPath(t,e)}},ka.className="Arc",M([St()],ka.prototype,"centerX",2),M([St()],ka.prototype,"centerY",2),M([St()],ka.prototype,"radius",2),M([St()],ka.prototype,"startAngle",2),M([St()],ka.prototype,"endAngle",2),M([St()],ka.prototype,"counterClockwise",2),M([St()],ka.prototype,"type",2)}});function XD(t,e,i){const s=Math.sqrt(t**2+e**2),a=Math.atan2(e,t)+i;return{x:Math.cos(a)*s,y:Math.sin(a)*s}}function kP(t,e,i,s,n){const a=fm(t,e),o=a*(1-s)/2;if(t+=o,e-=o,a<.001)return 2*i*n;if(a>=2*Math.PI){const p=t+a/2;t=p-Math.PI,e=p+Math.PI}const r=i*Math.cos(t),l=i*Math.sin(t),c=i*Math.cos(e),h=i*Math.sin(e),u=Math.floor(Math.sqrt((r-c)**2+(l-h)**2)),d=2*i*n;return Math.max(1,Math.min(d,u))}var bn,LP=I({"packages/ag-charts-community/src/scene/shape/radialColumnShape.ts"(){"use strict";Ii(),At(),Rt(),Gn(),bn=class extends ns{constructor(){super(...arguments),this.isBeveled=!0,this.columnWidth=0,this.startAngle=0,this.endAngle=0,this.outerRadius=0,this.innerRadius=0,this.axisInnerRadius=0,this.axisOuterRadius=0,this.isRadiusAxisReversed=!1}set cornerRadius(t){}computeBBox(){const{innerRadius:t,outerRadius:e,columnWidth:i}=this,s=this.getRotation(),n=-i/2,a=i/2,o=-e,r=-t;let l=1/0,c=1/0,h=-1/0,u=-1/0;for(let d=0;d<4;d+=1){const{x:p,y:g}=XD(d%2===0?n:a,d<2?o:r,s);l=Math.min(p,l),c=Math.min(g,c),h=Math.max(p,h),u=Math.max(g,u)}return new ht(l,c,h-l,u-c)}getRotation(){const{startAngle:t,endAngle:e}=this,i=fm(t,e);return re(t+i/2+Math.PI/2)}updatePath(){const{isBeveled:t}=this;t?this.updateBeveledPath():this.updateRectangularPath(),this.checkPathDirty()}updateRectangularPath(){const{columnWidth:t,innerRadius:e,outerRadius:i,path:s}=this,n=-t/2,a=t/2,o=-i,r=-e,l=this.getRotation(),c=[[n,r],[n,o],[a,o],[a,r]].map(([h,u])=>XD(h,u,l));s.clear(!0),s.moveTo(c[0].x,c[0].y),s.lineTo(c[1].x,c[1].y),s.lineTo(c[2].x,c[2].y),s.lineTo(c[3].x,c[3].y),s.closePath()}updateBeveledPath(){const{columnWidth:t,path:e,outerRadius:i,innerRadius:s,axisInnerRadius:n,axisOuterRadius:a,isRadiusAxisReversed:o}=this,r=ca(s,n),l=Math.asin(t/2/s),c=this.getRotation(),h=(L,C)=>XD(L,C,c),u=(L,C)=>Math.sqrt(L**2+C**2),d=(L,C)=>C>L?0:Math.sqrt(L**2-C**2),p=(L,C,O)=>O?LC,g=r&&!isNaN(l)&&lka,BBox:()=>ht,Caption:()=>te,CategoryScale:()=>Su,Group:()=>yt,Line:()=>Vs,LinearScale:()=>Un,Marker:()=>ai,Path:()=>ns,RadialColumnShape:()=>bn,Rect:()=>_i,Scene:()=>bg,Sector:()=>pi,Shape:()=>rn,TranslatableGroup:()=>is,getRadialColumnWidth:()=>kP,toRadians:()=>ti});var H9=I({"packages/ag-charts-community/src/integrated-charts-scene.ts"(){"use strict";Lc(),ba(),Yp(),Zc(),Rt(),pe(),_I(),DP(),Oc(),Gn(),LP(),zg(),pb(),qr(),Ii()}}),QD={};sn(QD,{ChartTheme:()=>xo,DEFAULT_ANNOTATION_HANDLE_FILL:()=>od,DEFAULT_ANNOTATION_STATISTICS_COLOR:()=>cd,DEFAULT_ANNOTATION_STATISTICS_DIVIDER_STROKE:()=>hd,DEFAULT_ANNOTATION_STATISTICS_DOWN_FILL:()=>ud,DEFAULT_ANNOTATION_STATISTICS_DOWN_STROKE:()=>dd,DEFAULT_ANNOTATION_STATISTICS_FILL:()=>rd,DEFAULT_ANNOTATION_STATISTICS_STROKE:()=>ld,DEFAULT_BACKGROUND_COLOUR:()=>Vg,DEFAULT_CAPTION_ALIGNMENT:()=>dr,DEFAULT_CAPTION_LAYOUT_STYLE:()=>ur,DEFAULT_COLOR_RANGE:()=>Kg,DEFAULT_DIVERGING_SERIES_COLOR_RANGE:()=>Ts,DEFAULT_FIBONACCI_STROKES:()=>nd,DEFAULT_FINANCIAL_CHARTS_ANNOTATION_BACKGROUND_FILL:()=>Ge,DEFAULT_FINANCIAL_CHARTS_ANNOTATION_COLOR:()=>ve,DEFAULT_FUNNEL_SERIES_COLOR_RANGE:()=>Ma,DEFAULT_GAUGE_SERIES_COLOR_RANGE:()=>dn,DEFAULT_GRIDLINE_ENABLED:()=>Ia,DEFAULT_HIERARCHY_FILLS:()=>Xg,DEFAULT_HIERARCHY_STROKES:()=>Zg,DEFAULT_POLAR_SERIES_STROKE:()=>Yg,DEFAULT_SEPARATION_LINES_COLOUR:()=>ed,DEFAULT_SHADOW_COLOUR:()=>hr,DEFAULT_SPARKLINE_CROSSHAIR_STROKE:()=>$g,DEFAULT_TEXTBOX_COLOR:()=>fd,DEFAULT_TEXTBOX_FILL:()=>pd,DEFAULT_TEXTBOX_STROKE:()=>gd,DEFAULT_TEXT_ANNOTATION_COLOR:()=>ad,DEFAULT_TOOLBAR_POSITION:()=>yd,IS_COMMUNITY:()=>zx,IS_DARK_THEME:()=>ih,IS_ENTERPRISE:()=>Fx,PALETTE_ALT_DOWN_FILL:()=>Wx,PALETTE_ALT_DOWN_STROKE:()=>Vx,PALETTE_ALT_NEUTRAL_FILL:()=>Ux,PALETTE_ALT_NEUTRAL_STROKE:()=>Hg,PALETTE_ALT_UP_FILL:()=>Gx,PALETTE_ALT_UP_STROKE:()=>jx,PALETTE_DOWN_FILL:()=>sd,PALETTE_DOWN_STROKE:()=>Wg,PALETTE_NEUTRAL_FILL:()=>Ug,PALETTE_NEUTRAL_STROKE:()=>sh,PALETTE_UP_FILL:()=>id,PALETTE_UP_STROKE:()=>Gg,getChartTheme:()=>Sf,themeNames:()=>TP,themeSymbols:()=>eD,themes:()=>Eb});var TP,Y9=I({"packages/ag-charts-community/src/integrated-charts-theme.ts"(){"use strict";Rb(),Rb(),ke(),yl(),Rb(),ke(),TP=Object.keys(Eb)}}),qD={};sn(qD,{Color:()=>xe,interpolateColor:()=>a2});var K9=I({"packages/ag-charts-community/src/integrated-charts-util.ts"(){"use strict";hc(),o2()}});function JD(){return(t,e)=>{const i=[`Property [${t}] is deprecated.`,e].filter(Boolean).join(" ");et.warnOnce(i)}}function $9(t,e){const i=JD(),s=e?.default;return Uo((n,a,o)=>(o!==s&&i(a.toString(),t),o))}function X9(t,e){const i=JD();return Uo((s,n,a)=>(a!==s[t]&&(i(n.toString(),`Use [${t}] instead.`),zM(s,t,e?e(a):a)),_p),(s,n)=>(i(n.toString(),`Use [${t}] instead.`),BM(s,t)))}var Z9=I({"packages/ag-charts-community/src/util/deprecation.ts"(){"use strict";ot(),Xr(),oe()}});function Q9(t,e){return typeof e=="number"?{x:t.x+e,y:t.y+e}:{x:t.x+e.x,y:t.y+e.y}}function tk(t,e){return typeof e=="number"?{x:t.x-e,y:t.y-e}:{x:t.x-e.x,y:t.y-e.y}}function q9(t,e){return typeof e=="number"?{x:t.x*e,y:t.y*e}:{x:t.x*e.x,y:t.y*e.y}}function ek(t){return Math.sqrt(t.x*t.x+t.y*t.y)}function J9(t){return t.x*t.x+t.y*t.y}function t8(t,e){const i=tk(t,e);return Math.sqrt(i.x*i.x+i.y*i.y)}function e8(t,e){const i=tk(t,e);return i.x*i.x+i.y*i.y}function i8(t){const e=ek(t);return{x:t.x/e,y:t.y/e}}function s8(t,e=ik()){return Math.atan2(t.y,t.x)-Math.atan2(e.y,e.x)}function n8(t,e,i=ik()){const s=ek(t);return{x:i.x+s*Math.cos(e),y:i.y+s*Math.sin(e)}}function a8(t,e,i){const s=e.x-t.x;return(i==null?e.y-t.y:i-e.y-(i-t.y))/s}function o8(t,e,i){return(i==null?t.y:i-t.y)-e*t.x}function r8(t,e,i=0,s){return{x:t===1/0?1/0:(i-e)/t,y:s==null?i:s-i}}function l8(t,e,i=0,s){const n=t===1/0?1/0:t*i+e;return{x:i,y:s==null?n:s-n}}function c8(t){return{x:Math.round(t.x),y:Math.round(t.y)}}function h8(t,e){return t.x===e.x&&t.y===e.y}function u8(t,e){if(typeof t=="number")return{x:t,y:e};if("currentX"in t)return{x:t.currentX,y:t.currentY};if("offsetWidth"in t)return{x:t.offsetWidth,y:t.offsetHeight};if("width"in t)return[{x:t.x,y:t.y},{x:t.x+t.width,y:t.y+t.height}];if("x1"in t)return[{x:t.x1,y:t.y1},{x:t.x2,y:t.y2}];throw new Error(`Values can not be converted into a vector: [${JSON.stringify(t)}] [${e}]`)}function d8(t,e){return t.x=e.x,t.y=e.y,t}function p8(t){return{x:t?.x??0,y:t?.y??0}}function ik(){return{x:0,y:0}}var uh,CP=I({"packages/ag-charts-community/src/util/vector.ts"(){"use strict";uh={add:Q9,angle:s8,apply:d8,equal:h8,distance:t8,distanceSquared:e8,from:u8,gradient:a8,intercept:o8,intersectAtX:l8,intersectAtY:r8,length:ek,lengthSquared:J9,multiply:q9,normalized:i8,origin:ik,required:p8,rotate:n8,round:c8,sub:tk}}}),g8=I({"packages/ag-charts-community/src/module/axisModule.ts"(){"use strict"}}),f8=I({"packages/ag-charts-community/src/module/axisOptionModule.ts"(){"use strict"}}),y8=I({"packages/ag-charts-community/src/module/baseModule.ts"(){"use strict"}}),m8=I({"packages/ag-charts-community/src/module/coreModules.ts"(){"use strict"}}),x8=I({"packages/ag-charts-community/src/module/optionsModuleTypes.ts"(){"use strict"}}),b8=I({"packages/ag-charts-community/src/module/axisContext.ts"(){"use strict"}}),S8=I({"packages/ag-charts-community/src/module/moduleContext.ts"(){"use strict"}}),v8=I({"packages/ag-charts-community/src/chart/chartAnimationPhase.ts"(){"use strict"}}),M8=I({"packages/ag-charts-community/src/chart/series/seriesEvents.ts"(){"use strict"}}),I8=I({"packages/ag-charts-community/src/chart/series/seriesTypes.ts"(){"use strict"}}),sk,NP,OP,A8=I({"packages/ag-charts-community/src/chart/series/hierarchy/hierarchySeries.ts"(){"use strict";ot(),Du(),At(),ig(),$c(),sk=class DM{constructor(e,i,s,n,a,o,r,l,c){this.series=e,this.datumIndex=i,this.datum=s,this.sizeValue=n,this.colorValue=a,this.sumSize=o,this.depth=r,this.parent=l,this.children=c,this.midPoint={x:0,y:0}}get hasChildren(){return this.children.length>0}walk(e,i=DM.Walk.PreOrder){i===DM.Walk.PreOrder&&e(this),this.children.forEach(s=>{s.walk(e,i)}),i===DM.Walk.PostOrder&&e(this)}*[Symbol.iterator](){yield this;for(const e of this.children)yield*e}},sk.Walk={PreOrder:0,PostOrder:1},NP=sk,OP=class extends Ag{constructor(t){super({moduleCtx:t,pickModes:[1,0]}),this.colorDomain=[0,0],this.maxDepth=0,this.colorScale=new $o,this.animationState=new Cu("empty",{empty:{update:{target:"ready",action:e=>this.animateEmptyUpdateReady(e)},reset:"empty",skip:"ready"},ready:{updateData:"waiting",clear:"clearing",highlight:e=>this.animateReadyHighlight(e),resize:e=>this.animateReadyResize(e),reset:"empty",skip:"ready"},waiting:{update:{target:"ready",action:e=>this.animateWaitingUpdateReady(e)},reset:"empty",skip:"ready"},clearing:{update:{target:"empty",action:e=>this.animateClearingUpdateEmpty(e)},reset:"empty",skip:"ready"}},()=>this.checkProcessedDataAnimatable())}resetAnimation(t){t==="initial"?this.animationState.transition("reset"):t==="ready"&&this.animationState.transition("skip")}processData(){const{NodeClass:t}=this,{childrenKey:e,sizeKey:i,colorKey:s,colorRange:n}=this.properties;let a=0,o=1/0,r=-1/0;const l=(d,p,g)=>{const f=g.depth!=null?g.depth+1:0,x=e!=null?d[e]:void 0,m=x==null||x.length===0;let b=i!=null?d[i]:void 0;Number.isFinite(b)?b=Math.max(b,0):b=m?1:0;const v=b;a=Math.max(a,f);const S=s!=null?d[s]:void 0;return typeof S=="number"&&(o=Math.min(o,S),r=Math.max(r,S)),c(new t(this,p,d,b,S,v,f,g,[]),x)},c=(d,p)=>{const{datumIndex:g}=d;return p?.forEach((f,x)=>{const m=l(f,g.concat(x),d);d.children.push(m),d.sumSize+=m.sumSize}),d},h=c(new t(this,[],void 0,0,void 0,0,void 0,void 0,[]),this.data),u=[o,r];this.colorScale.domain=ol.children[c],this.rootNode);if(s>0&&a.hasChildren)n=[...n,0];else if(s<0&&n.length>1)n=n.slice(0,-1);else if(s===0&&i!==0){const l=a.parent.children.length-1;n=n.slice(),n[n.length-1]=It(0,n[n.length-1]+i,l)}const o=n.reduce((l,c)=>l.children[c],this.rootNode),r=this.computeFocusBounds(this.datumSelection.at(e+1));if(r!=null)return{datum:o,datumIndex:this.removeMeIndexForIndexPath(n),otherIndex:o.depth,bounds:r,clipFocusBox:!0}}getDatumAriaText(t,e){if(!(t instanceof this.NodeClass)){et.error(`datum is not HierarchyNode: ${JSON.stringify(t)}`);return}return this.ctx.localeManager.t("ariaAnnounceHierarchyDatum",{level:(t.depth??-1)+1,count:t.children.length,description:e})}}}}),xr,D8=I({"packages/ag-charts-community/src/chart/series/hierarchy/hierarchySeriesProperties.ts"(){"use strict";mt(),gb(),Ng(),xr=class extends Ws{constructor(){super(...arguments),this.childrenKey="children",this.fills=Object.values(Re),this.strokes=Object.values(Aa)}},M([k(tt)],xr.prototype,"childrenKey",2),M([k(tt,{optional:!0})],xr.prototype,"sizeKey",2),M([k(tt,{optional:!0})],xr.prototype,"colorKey",2),M([k(tt,{optional:!0})],xr.prototype,"colorName",2),M([k(Bs)],xr.prototype,"fills",2),M([k(Bs)],xr.prototype,"strokes",2),M([k(Bs,{optional:!0})],xr.prototype,"colorRange",2)}}),k8=I({"packages/ag-charts-community/src/chart/series/topologySeries.ts"(){"use strict"}}),L8=I({"packages/ag-charts-community/src/chart/series/flowProportionSeries.ts"(){"use strict"}}),T8=I({"packages/ag-charts-community/src/chart/series/topology/geojson.ts"(){"use strict"}}),wP,C8=I({"packages/ag-charts-community/src/chart/series/topology/lonLatBbox.ts"(){"use strict";wP=class{constructor(t,e,i,s){this.lon0=t,this.lat0=e,this.lon1=i,this.lat1=s}merge(t){this.lon0=Math.min(this.lon0,t.lon0),this.lat0=Math.min(this.lat0,t.lat0),this.lon1=Math.max(this.lon1,t.lon1),this.lat1=Math.max(this.lat1,t.lat1)}}}}),vf,Bb,zb,Fb,jb,EP,N8=I({"packages/ag-charts-community/src/chart/series/topology/mercatorScale.ts"(){"use strict";am(),Rt(),vf=Math.PI/180,Bb=t=>t*vf,zb=t=>-Math.log(Math.tan(Math.PI*.25+t*vf*.5)),Fb=t=>t/vf,jb=t=>(Math.atan(Math.exp(-t))-Math.PI*.25)/(vf*.5),EP=class RN extends zp{constructor(e,i){super(),this.domain=e,this.range=i,this.type="mercator",this.bounds=RN.bounds(e)}static bounds(e){const[[i,s],[n,a]]=e,o=Bb(i),r=zb(s),l=Bb(n),c=zb(a);return new ht(Math.min(o,l),Math.min(r,c),Math.abs(l-o),Math.abs(c-r))}static fixedScale(){return new RN([[Fb(0),jb(0)],[Fb(1),jb(1)]],[[0,0],[1,1]])}toDomain(){}normalizeDomains(...e){let i=-1/0,s=1/0,n=-1/0,a=1/0;for(const o of e)for(const[r,l]of o)i=Math.min(r,i),s=Math.max(r,s),n=Math.min(l,n),a=Math.max(l,a);return{domain:[[i,n],[s,a]],animatable:!0}}convert([e,i]){const[[s,n],[a,o]]=this.range,r=(a-s)/this.bounds.width,l=(o-n)/this.bounds.height;return[(Bb(e)-this.bounds.x)*r+s,(zb(i)-this.bounds.y)*l+n]}invert([e,i]){const[[s,n],[a,o]]=this.range,r=(a-s)/this.bounds.width,l=(o-n)/this.bounds.height;return[Fb((e-s)/r+this.bounds.x),jb((i-n)/l+this.bounds.y)]}}}}),O8=I({"packages/ag-charts-community/src/chart/series/gaugeSeries.ts"(){"use strict"}}),Vb,RP,w8=I({"packages/ag-charts-community/src/chart/axis/axisTicks.ts"(){"use strict";Zc(),Rt(),pe(),el(),Fs(),il(),Rn(),At(),aI(),ln(),Cc(),Q0(),wm(),Vb=class _N{constructor(){this.id=En(this),this.axisGroup=new is({name:`${this.id}-AxisTicks`,zIndex:2}),this.labelSelection=Oe.select(this.axisGroup,ei),this.interval=new nl,this.label=new si,this.scale=new Un,this.position="bottom",this.translationX=0,this.translationY=0,this.padding=0}attachAxis(e){e.appendChild(this.axisGroup)}calculateLayout(){const e=[],i=this.generateTicks(),{translationX:s,translationY:n}=this;return this.labelSelection.update(i.ticks.map(a=>this.createLabelDatum(a)),void 0,a=>a.tickId),this.labelSelection.each((a,o)=>{a.setProperties(o),o.visible&&e.push(a.getBBox())}),this.axisGroup.setProperties({translationX:s,translationY:n}),ht.merge(e)}getLabelParams(e){const{padding:i}=this,{translate:s}=e;switch(this.position){case"top":case"bottom":return{x:s,y:i,textAlign:"center",textBaseline:"top"};case"left":case"right":return{x:i,y:s,textAlign:"start",textBaseline:"middle"}}}inRange(e,i=.001){const[s,n]=Si(this.scale.range);return e>=s-i&&e<=n+i}createLabelDatum(e){const{x:i,y:s,textBaseline:n,textAlign:a}=this.getLabelParams(e);return{visible:!!e.tickLabel,tickId:e.tickId,fill:this.label.color,fontFamily:this.label.fontFamily,fontSize:this.label.fontSize,fontStyle:this.label.fontStyle,fontWeight:this.label.fontWeight,rotation:0,rotationCenterX:0,text:e.tickLabel,textAlign:a,textBaseline:n,x:i,y:s}}generateTicks(){const{minSpacing:e,maxSpacing:i}=this.interval,{maxTickCount:s,minTickCount:n,tickCount:a}=OO(du(this.scale.range),1,e,i,_N.DefaultTickCount,_N.DefaultMinSpacing),o=this.getTicksData({nice:!0,interval:this.interval.step,tickCount:a,minTickCount:n,maxTickCount:s});if(this.position==="bottom"||this.position==="top"){const r=io.getMeasurer({font:this.label}),{domain:l}=this.scale,h=l[0]>l[1]?-1:1;let u=-1/0*h;o.ticks=o.ticks.filter(d=>Math.sign(d.translate-u)!==h?!1:(u=d.translate+r.textWidth(d.tickLabel,!0)*h,!0))}return o}getTicksData(e){const i=[],s=e.nice?this.scale.niceDomain(e):this.scale.domain,n=this.scale.ticks(e,s),a=n.reduce((l,c)=>Math.max(l,Qy(c)),0),o=nI(),r=this.label.format?this.scale.tickFormatter({domain:s,ticks:n,fractionDigits:a,specifier:this.label.format}):l=>Zo(l,a);for(let l=0;lt.onChange(i.checked,s)),i.addEventListener("keydown",s=>{DI(s)&&(s.preventDefault(),i.click())}),Bc(i,e),i}function B8(t,e){const i=Ot("select",Gb("ag-charts-input ag-charts-select",e));return i.append(...t.options.map(s=>{const n=Ot("option");return n.value=s.value,n.textContent=s.label,n})),ee(i,"data-preventdefault",!1),i.value=t.value,i.addEventListener("change",s=>t.onChange(i.value,s)),Bc(i,e),i}function z8(t,e){const i=Ot("textarea",Gb("ag-charts-input ag-charts-textarea",e));return i.value=t.value,i.addEventListener("input",s=>t.onChange(i.value,s)),Bc(i,e),ee(i,"data-preventdefault",!1),i}function _P(t){const e=Ot("span",`ag-charts-icon ag-charts-icon-${t}`);return ee(e,"aria-hidden",!0),e}function Gb(t,e){return e==null?t:`${t} ${e.class}`}var F8=I({"packages/ag-charts-community/src/dom/elements.ts"(){"use strict";Lt(),ss(),Ru()}}),j8=I({"packages/ag-charts-community/src/scale/scale.ts"(){"use strict"}}),PP,V8=I({"packages/ag-charts-community/src/scene/gradient/conicGradient.ts"(){"use strict";Ii(),gm(),PP=class extends Jp{constructor(t,e,i=0,s){super(t,e,s),this.angle=i}createCanvasGradient(t,e){const{angle:s}=this,n=re(ti(s+90)),a=e.x+e.width*.5,o=e.y+e.height*.5;return t.createConicGradient(n,a,o)}}}}),Wb,G8=I({"packages/ag-charts-community/src/scene/shape/svgPath.ts"(){"use strict";Gn(),Wb=class extends ns{constructor(t=""){super(),this.x=0,this.y=0,this.commands=[],this._d="",this.d=t}get d(){return this._d}set d(t){if(t!==this._d){this._d=t,this.commands.length=0;for(const[e,i,s]of t.matchAll(/([A-Z])([0-9. ]*)/g)){const n=s.split(/\s+/g).map(Number);this.commands.push([i,n])}this.checkPathDirty()}}updatePath(){const{path:t,x:e,y:i}=this;t.clear();let s=e,n=i;for(const[a,o]of this.commands)switch(a){case"M":t.moveTo(e+o[0],i+o[1]),s=e+o[0];break;case"C":t.cubicCurveTo(e+o[0],i+o[1],e+o[2],i+o[3],e+o[4],i+o[5]),s=e+o[4],n=i+o[5];break;case"H":t.lineTo(e+o[0],n),s=i+o[0];break;case"L":t.lineTo(e+o[0],i+o[1]),s=e+o[0],n=i+o[1];break;case"V":t.lineTo(s,i+o[0]),n=i+o[0];break;case"Z":t.closePath();break;default:throw new Error(`Could not translate command '${a}' with '${o.join(" ")}'`)}t.closePath()}},M([St()],Wb.prototype,"x",2),M([St()],Wb.prototype,"y",2)}}),dh,W8=I({"packages/ag-charts-community/src/scene/image.ts"(){"use strict";nn(),dh=class extends Wo{constructor(t){super(),this.sourceImage=t,this.x=0,this.y=0,this.width=0,this.height=0,this.opacity=1}render(t){const{ctx:e}=t,i=this.sourceImage;i&&(e.globalAlpha=this.opacity,e.drawImage(i,0,0,i.width,i.height,this.x,this.y,this.width,this.height)),super.render(t)}},M([ct()],dh.prototype,"x",2),M([ct()],dh.prototype,"y",2),M([ct()],dh.prototype,"width",2),M([ct()],dh.prototype,"height",2),M([ct()],dh.prototype,"opacity",2)}}),BP={};sn(BP,{ButtonWidget:()=>_u,NativeWidget:()=>Vc,SliderWidget:()=>tx,ToolbarWidget:()=>xg,WIDGET_HTML_EVENTS:()=>Um,Widget:()=>ya,WidgetEventUtil:()=>ao});var zP=I({"packages/ag-charts-community/src/widget/exports.ts"(){"use strict";tr(),Hm(),qm(),OI(),Qm(),tE()}}),nk,Ub,ak=I({"packages/ag-charts-community/src/components/popover/popover.ts"(){"use strict";Lt(),no(),Ru(),nk="canvas-overlay",Ub=class extends fg{constructor(t,e,i){super(),this.ctx=t,this.hideFns=[],this.moduleId=`popover-${e}`,i?.detached?this.element=Ot("div"):this.element=t.domManager.addChild(nk,this.moduleId),this.element.setAttribute("role","presentation"),this.destroyFns.push(()=>t.domManager.removeChild(nk,this.moduleId))}attachTo(t){this.element.parentElement||t.element.append(this.element)}hide(t){const{lastFocus:e=this.lastFocus}=t??{};this.element.children.length!==0&&(this.hideFns.forEach(i=>i()),e?.focus(),this.lastFocus=void 0)}removeChildren(){this.element.replaceChildren()}showWithChildren(t,e){if(!this.element.parentElement)throw new Error("Can not show popover that has not been attached to a parent.");const i=Ot("div","ag-charts-popover");if(e.ariaLabel!=null&&i.setAttribute("aria-label",e.ariaLabel),e.class!=null&&i.classList.add(e.class),i.replaceChildren(...t),this.element.replaceChildren(i),this.hideFns.push(()=>this.removeChildren()),e.onHide&&this.hideFns.push(e.onHide),e.initialFocus&&e.sourceEvent){const s=kI(e.sourceEvent);s!==void 0&&(this.lastFocus=s,this.initialFocus=e.initialFocus)}return i}getPopoverElement(){return this.element.firstElementChild}updatePosition(t){const e=this.getPopoverElement();e&&(e.style.setProperty("right","unset"),e.style.setProperty("bottom","unset"),t.x!=null&&e.style.setProperty("left",`${Math.floor(t.x)}px`),t.y!=null&&e.style.setProperty("top",`${Math.floor(t.y)}px`),this.initialFocus?.focus(),this.initialFocus=void 0)}}}}),ok,FP=I({"packages/ag-charts-community/src/components/popover/anchoredPopover.ts"(){"use strict";Lt(),At(),ak(),ok=class extends Ub{setAnchor(t,e){this.anchor=t,this.fallbackAnchor=e,this.updatePosition(t),this.repositionWithinBounds()}showWithChildren(t,e){const i=e.anchor??this.anchor,s=e.fallbackAnchor??this.fallbackAnchor,n=super.showWithChildren(t,e);return i&&this.setAnchor(i,s),ae().requestAnimationFrame(()=>{this.repositionWithinBounds()}),n}repositionWithinBounds(){const{anchor:t,ctx:e,fallbackAnchor:i}=this,s=this.getPopoverElement();if(!t||!s)return;const n=e.domManager.getBoundingClientRect(),{offsetWidth:a,offsetHeight:o}=s;let r=It(0,t.x,n.width-a),l=It(0,t.y,n.height-o);r!==t.x&&i?.x!=null&&(r=It(0,i.x-a,n.width-a)),l!==t.y&&i?.y!=null&&(l=It(0,i.y-o,n.height-o)),this.updatePosition({x:r,y:l})}}}}),jP,U8=I({"packages/ag-charts-community/src/components/menu/menu.ts"(){"use strict";Lt(),_c(),Ru(),FP(),jP=class extends ok{show(t){const e=t.items.map(s=>this.createRow(t,s)),i=this.showWithChildren(e,t);i.classList.add("ag-charts-menu"),i.setAttribute("role","menu"),this.menuCloser=jw({orientation:"vertical",menu:i,buttons:e,sourceEvent:t.sourceEvent,closeCallback:()=>this.hide()}),this.hideFns.push(()=>{this.menuCloser?.finishClosing(),this.menuCloser=void 0})}createRow(t,e){const{menuItemRole:i="menuitem"}=t,s=e.value===t.value,n=Ot("div","ag-charts-menu__row");if(n.setAttribute("role",i),i==="menuitemradio"&&n.setAttribute("aria-checked",(t.value===e.value).toString()),typeof e.value=="string"&&(n.dataset.popoverId=e.value),n.classList.toggle("ag-charts-menu__row--active",s),e.icon!=null){const l=Ot("span",`ag-charts-menu__icon ${Fm(e.icon)}`);n.appendChild(l)}const a=e.strokeWidth!=null;if(a&&(n.classList.toggle("ag-charts-menu__row--stroke-width-visible",a),n.style.setProperty("--strokeWidth",a?`${e.strokeWidth}px`:null)),e.label!=null){const l=Ot("span","ag-charts-menu__label");l.textContent=this.ctx.localeManager.t(e.label),n.appendChild(l)}"altText"in e&&(n.ariaLabel=this.ctx.localeManager.t(e.altText));const o=()=>{t.onPress?.(e)},r=l=>{DI(l)&&(o(),l.preventDefault(),l.stopPropagation())};return n.addEventListener("keydown",r),n.addEventListener("click",r),n.addEventListener("mousemove",()=>{n.focus({preventScroll:!0})}),n}}}}),rk,VP=I({"packages/ag-charts-community/src/components/popover/draggablePopover.ts"(){"use strict";CP(),ak(),rk=class extends Ub{constructor(){super(...arguments),this.dragged=!1}setDragHandle(t){t.addListener("drag-start",e=>{t.addClass(this.dragHandleDraggingClass),this.onDragStart(e)}),t.addListener("drag-move",this.onDragMove.bind(this)),t.addListener("drag-end",()=>{t.removeClass(this.dragHandleDraggingClass),this.onDragEnd.bind(this)})}onDragStart(t){const e=this.getPopoverElement();e&&(t.sourceEvent.preventDefault(),this.dragged=!0,this.dragStartState={client:uh.from(t.clientX,t.clientY),position:uh.from(Number(e.style.getPropertyValue("left").replace("px","")),Number(e.style.getPropertyValue("top").replace("px","")))})}onDragMove(t){const{dragStartState:e}=this,i=this.getPopoverElement();if(!e||!i)return;const s=uh.sub(uh.from(t.clientX,t.clientY),e.client),n=uh.add(e.position,s),a=this.ctx.domManager.getBoundingClientRect(),o={};n.x>=a.x&&n.x+i.offsetWidth<=a.width&&(o.x=n.x),n.y>=a.y&&n.y+i.offsetHeight<=a.height&&(o.y=n.y),this.updatePosition(o)}onDragEnd(){this.dragStartState=void 0}}}}),vd,H8=I({"packages/ag-charts-community/src/components/toolbar/toolbarButtonProperties.ts"(){"use strict";Qt(),mt(),vd=class extends bt{},M([k(tt,{optional:!0})],vd.prototype,"icon",2),M([k(tt,{optional:!0})],vd.prototype,"label",2),M([k(tt,{optional:!0})],vd.prototype,"ariaLabel",2),M([k(tt,{optional:!0})],vd.prototype,"tooltip",2)}}),lk,GP=I({"packages/ag-charts-community/src/components/toolbar/toolbarButtonWidget.ts"(){"use strict";ss(),_c(),Qm(),lk=class extends _u{constructor(t){super(),this.localeManager=t}update(t){const{localeManager:e}=this;t.tooltip&&(this.elem.title=e.t(t.tooltip));let i="";if(t.icon!=null&&(i=``),t.label!=null){const s=e.t(t.label);i=`${i}${s}`}this.elem.innerHTML=i}setChecked(t){ee(this.elem,"aria-checked",t)}}}}),ck,Hb,WP,UP=I({"packages/ag-charts-community/src/components/toolbar/toolbar.ts"(){"use strict";Rt(),er(),Qt(),OI(),GP(),ck="ag-charts-toolbar__button--active",Hb=class extends xg{constructor(t,e="horizontal"){super(e),this.localeManager=t,this.horizontalSpacing=10,this.verticalSpacing=10,this.events=new oo,this.hasPrefix=!1,this.buttonWidgets=[],this.addClass("ag-charts-toolbar"),this.toggleClass("ag-charts-toolbar--horizontal",e==="horizontal"),this.toggleClass("ag-charts-toolbar--vertical",e==="vertical")}addToolbarListener(t,e){return this.events.addListener(t,e)}clearButtons(){for(const t of this.buttonWidgets)t.destroy();this.buttonWidgets.splice(0)}updateButtons(t){const{buttonWidgets:e}=this;for(const[i,s]of t.entries())(this.buttonWidgets.at(i)??this.createButton(i,s)).update(s);for(let i=t.length;ithis.getButtonWidgetBounds(t))}setButtonHiddenByIndex(t,e){this.buttonWidgets.at(t)?.setHidden(e)}getButtonWidgetBounds(t){const e=this.getBounds(),i=t.getBounds();return new ht(i.x+e.x,i.y+e.y,i.width,i.height)}refreshButtonClasses(){const{buttonWidgets:t,hasPrefix:e}=this;let i,s,n;for(const[a,o]of t.entries())i=!e&&a===0||n!=o.section,s=a===t.length-1||o.section!=t.at(a+1)?.section,o.toggleClass("ag-charts-toolbar__button--first",i),o.toggleClass("ag-charts-toolbar__button--last",s),o.toggleClass("ag-charts-toolbar__button--gap",a>0&&i),n=o.section}createButton(t,e){const i=this.createButtonWidget();return i.addClass("ag-charts-toolbar__button"),i.addListener("click",s=>{const n={index:t,...e instanceof bt?e.toJson():e},a=this.getButtonWidgetBounds(i);this.events.dispatch("button-pressed",{event:s,button:n,buttonBounds:a})}),i.addListener("focus",()=>{this.events.dispatch("button-focused",{button:{index:t}})}),e.section&&(i.section=e.section),this.buttonWidgets.push(i),this.addChild(i),i}},WP=class extends Hb{createButtonWidget(){return new lk(this.localeManager)}}}}),HP,YP,KP,Y8=I({"packages/ag-charts-community/src/components/toolbar/floatingToolbar.ts"(){"use strict";Lt(),Rt(),_c(),At(),qm(),VP(),UP(),HP=class extends rk{constructor(t,e,i){super(t,e),this.onPopoverMoved=i,this.dragHandleDraggingClass="ag-charts-floating-toolbar__drag-handle--dragging"}show(t,e={}){this.showWithChildren(t,{...e,class:"ag-charts-floating-toolbar"})}hide(){this.dragged=!1,super.hide()}getBounds(){const t=this.getPopoverElement();return new ht(t?.offsetLeft??0,t?.offsetTop??0,t?.offsetWidth??0,t?.offsetHeight??0)}hasBeenDragged(){return this.dragged}setAnchor(t,e,i){const s=this.getPopoverElement();if(!s)return;const n=t.position??"above",{offsetWidth:a,offsetHeight:o}=s;let r=t.y-o-i,l=t.x-a/2;n==="below"?r=t.y+i:n==="right"?(r=t.y-o/2,l=t.x+e):n==="above-left"&&(l=t.x),this.updatePosition({x:l,y:r})}ignorePointerEvents(){const t=this.getPopoverElement();t&&(t.style.pointerEvents="none")}capturePointerEvents(){const t=this.getPopoverElement();t&&(t.style.pointerEvents="unset")}updatePosition(t){const e=this.getBounds(),i=this.ctx.domManager.getBoundingClientRect();t.x=Math.floor(It(0,t.x,i.width-e.width)),t.y=Math.floor(It(0,t.y,i.height-e.height)),super.updatePosition(t),this.onPopoverMoved()}},YP=class extends Hb{constructor(t,e){super(t.localeManager),this.hasPrefix=!0,this.popover=new HP(t,e,this.onPopoverMoved.bind(this)),this.dragHandle=new KP(t.localeManager.t("toolbarAnnotationsDragHandle")),this.popover.setDragHandle(this.dragHandle)}show(t={}){this.popover.show([this.dragHandle.getElement(),this.getElement()],t)}hide(){this.popover.hide()}setAnchor(t){this.popover.setAnchor(t,this.horizontalSpacing,this.verticalSpacing)}hasBeenDragged(){return this.popover.hasBeenDragged()}ignorePointerEvents(){this.popover.ignorePointerEvents()}capturePointerEvents(){this.popover.capturePointerEvents()}onPopoverMoved(){const t=this.popover.getBounds();if(this.popoverBounds?.equals(t))return;this.popoverBounds=t.clone();const e=this.getButtonBounds();this.events.dispatch("toolbar-moved",{popoverBounds:t,buttonBounds:e})}getButtonWidgetBounds(t){const e=this.popover.getBounds(),i=super.getButtonWidgetBounds(t),s=this.dragHandle.getBounds();return new ht(i.x+e.x-s.width,i.y+e.y,i.width,i.height)}},KP=class extends Vc{constructor(t){super(Ot("div","ag-charts-floating-toolbar__drag-handle"));const e=new Vc(Ot("span",`${Fm("drag-handle")} ag-charts-toolbar__icon`));e.setAriaHidden(!0),this.addChild(e),this.elem.title=t}}}}),$P={};sn($P,{AND:()=>ha,ARRAY:()=>Mu,ARRAY_OF:()=>Ja,AbstractBarSeries:()=>DD,AbstractBarSeriesProperties:()=>tb,ActionOnSet:()=>js,AnchoredPopover:()=>ok,Animation:()=>HM,AnimationManager:()=>FI,Arc:()=>ka,Axis:()=>_m,AxisGroupZIndexMap:()=>iI,AxisInterval:()=>nl,AxisLabel:()=>si,AxisTick:()=>wc,AxisTickGenerator:()=>oI,AxisTicks:()=>RP,BBox:()=>ht,BBoxValues:()=>Cp,BOOLEAN:()=>pt,BOOLEAN_ARRAY:()=>B2,Background:()=>Jc,BackgroundModule:()=>$A,BandScale:()=>bu,BarSeries:()=>uf,BarSeriesModule:()=>CD,BaseModuleInstance:()=>fg,BaseProperties:()=>bt,BaseToolbar:()=>Hb,ButtonWidget:()=>_u,COLOR_GRADIENT:()=>o0,COLOR_STRING:()=>jt,COLOR_STRING_ARRAY:()=>Bs,CachedTextMeasurer:()=>M0,CachedTextMeasurerPool:()=>io,Caption:()=>te,CartesianAxis:()=>Ou,CartesianSeries:()=>rr,CartesianSeriesNodeEvent:()=>Dx,CartesianSeriesProperties:()=>ho,CategoryAxis:()=>Rc,CategoryScale:()=>Su,ChangeDetectableProperties:()=>Ox,Chart:()=>Tg,ChartAxisDirection:()=>km,ChartEventManager:()=>jI,ChartOptions:()=>KD,ChartUpdateType:()=>Bu,CollapseMode:()=>dD,Color:()=>xe,ColorScale:()=>$o,ConicGradient:()=>PP,ContextMenuRegistry:()=>VI,ContinuousScale:()=>Wt,DATE:()=>lm,DATE_ARRAY:()=>z2,DATE_OR_DATETIME_MS:()=>cm,DEFAULT_CARTESIAN_DIRECTION_KEYS:()=>cl,DEFAULT_CARTESIAN_DIRECTION_NAMES:()=>hl,DEFAULT_TOOLTIP_CLASS:()=>Ri,DEFAULT_TOOLTIP_DARK_CLASS:()=>vA,DIRECTION:()=>c0,DOMManager:()=>CI,DataController:()=>nA,DataModel:()=>iA,DataModelSeries:()=>Ix,DataService:()=>Sg,Debug:()=>Jt,Default:()=>sl,Deprecated:()=>$9,DeprecatedAndRenamedTo:()=>X9,DragInterpreter:()=>KI,DraggablePopover:()=>rk,DropShadow:()=>Hn,ExtendedPath2D:()=>Wu,FONT_SIZE_RATIO:()=>Bx,FONT_STYLE:()=>to,FONT_WEIGHT:()=>eo,FUNCTION:()=>ts,FloatingToolbar:()=>YP,GREATER_THAN:()=>Au,Gradient:()=>Jp,Group:()=>yt,GroupedCategoryAxis:()=>qc,HdpiCanvas:()=>ix,HierarchyNode:()=>NP,HierarchySeries:()=>OP,HierarchySeriesProperties:()=>xr,HighlightManager:()=>GI,HighlightProperties:()=>Ax,HighlightStyle:()=>Yu,INTERACTION_RANGE:()=>qp,INTERPOLATION_STEP_POSITION:()=>oD,INTERPOLATION_TYPE:()=>aD,Image:()=>dh,InteractionManager:()=>zI,InteractionState:()=>BI,InterpolationProperties:()=>nh,Invalidating:()=>Mc,LABEL_PLACEMENT:()=>dm,LARGEST_KEY_INTERVAL:()=>VA,LESS_THAN:()=>Iu,LINE_CAP:()=>F2,LINE_DASH:()=>ua,LINE_JOIN:()=>j2,LINE_STYLE:()=>V2,Label:()=>ii,LayoutElement:()=>Km,LayoutManager:()=>SI,LegendMarkerLabel:()=>un,Line:()=>Vs,LineSeries:()=>df,LineSeriesModule:()=>wD,LinearGradient:()=>ym,LinearScale:()=>Un,Listeners:()=>oo,LogScale:()=>vx,LonLatBBox:()=>wP,MARKER_SHAPE:()=>wx,MATCHING_CROSSLINE_TYPE:()=>Om,MAX_SPACING:()=>u0,MIN_SPACING:()=>h0,Marker:()=>ai,Menu:()=>jP,MercatorScale:()=>EP,ModuleRegistry:()=>Kr,Motion:()=>jM,NAN:()=>$p,NODE_UPDATE_STATE_TO_PHASE_MAPPING:()=>_n,NUMBER:()=>_t,NUMBER_ARRAY:()=>Zp,NUMBER_OR_NAN:()=>Ic,NativeWidget:()=>Vc,NiceMode:()=>tI,Node:()=>Wo,NumberAxis:()=>or,OBJECT:()=>lt,OBJECT_ARRAY:()=>hm,OR:()=>Ko,OVERFLOW_STRATEGY:()=>W2,ObserveChanges:()=>tl,OrdinalTimeScale:()=>da,PHASE_METADATA:()=>yu,PHASE_ORDER:()=>gc,PLACEMENT:()=>U2,PLAIN_OBJECT:()=>s0,POSITION:()=>um,POSITION_TOP_COORDINATES:()=>cg,POSITIVE_NUMBER:()=>st,PREV_NEXT_KEYS:()=>Fc,Padding:()=>Jo,ParallelStateMachine:()=>fO,Path:()=>ns,PointerEvents:()=>EM,PolarAxis:()=>lh,PolarSeries:()=>gf,PolarZIndexMap:()=>FD,Popover:()=>Ub,PropertiesArray:()=>vu,ProxyInteractionService:()=>wI,ProxyOnWrite:()=>pY,ProxyProperty:()=>ue,ProxyPropertyOnWrite:()=>Di,QUICK_TRANSITION:()=>Bp,RATIO:()=>Ut,REAL_NUMBER:()=>n0,RENDER_TO_OFFSCREEN_CANVAS_THRESHOLD:()=>Og,RadialColumnShape:()=>bn,Range:()=>Bn,Rect:()=>_i,RepeatType:()=>UM,Rotatable:()=>Lu,RotatableGroup:()=>pO,RotatableText:()=>I0,SKIP_JS_BUILTINS:()=>sm,SMALLEST_KEY_INTERVAL:()=>jA,SORT_DOMAIN_GROUPS:()=>GA,STRING:()=>tt,STRING_ARRAY:()=>r0,Scalable:()=>S0,ScalableGroup:()=>dO,Scene:()=>bg,SceneChangeDetection:()=>ct,ScenePathChangeDetection:()=>St,Sector:()=>pi,SectorBox:()=>RD,Selection:()=>Oe,Series:()=>Ag,SeriesContentZIndexMap:()=>pA,SeriesGroupingChangedEvent:()=>gx,SeriesItemHighlightStyle:()=>co,SeriesMarker:()=>Pi,SeriesNodeEvent:()=>Vu,SeriesNodePickMode:()=>gA,SeriesProperties:()=>Ws,SeriesTooltip:()=>Bi,SeriesZIndexMap:()=>dA,Shape:()=>rn,SimpleTextMeasurer:()=>vm,SliderWidget:()=>tx,StateMachine:()=>Cu,StateMachineProperty:()=>dY,StopProperties:()=>mm,SvgPath:()=>Wb,TEXT_ALIGN:()=>l0,TEXT_WRAP:()=>Qp,TICK_INTERVAL:()=>Z0,Text:()=>ei,TextUtils:()=>ge,TextWrapper:()=>Dm,ThemeConstants:()=>M1,ThemeSymbols:()=>eD,TimeScale:()=>_0,Toolbar:()=>WP,ToolbarButtonProperties:()=>vd,ToolbarButtonWidget:()=>lk,ToolbarWidget:()=>xg,Tooltip:()=>Sa,TooltipManager:()=>vg,TooltipPosition:()=>Xc,Transformable:()=>be,TransformableText:()=>kc,Translatable:()=>Dc,TranslatableGroup:()=>is,TranslatableLine:()=>pg,UNION:()=>ie,UpdateService:()=>ZI,VERTICAL_ALIGN:()=>G2,Validate:()=>k,Vec2:()=>uh,Vec4:()=>ax,WIDGET_HTML_EVENTS:()=>Um,Widget:()=>ya,WidgetEventUtil:()=>ao,ZIndexMap:()=>X0,ZoomManager:()=>XI,accumulateGroup:()=>a1,accumulateStack:()=>o1,accumulatedValue:()=>qR,accumulativeValueProperty:()=>Eg,addHitTestersToQuadtree:()=>MD,adjustLabelPlacement:()=>i_,angleBetween:()=>fm,animationValidation:()=>Xu,applyShapeStyle:()=>jg,areScalingEqual:()=>bd,area:()=>PA,buildFormatter:()=>Gp,buildResetPathFn:()=>SD,calculateDefaultTimeTickFormat:()=>E2,calculateDerivativeExtrema:()=>fA,calculateDerivativeExtremaXY:()=>pR,calculateLabelChartPadding:()=>VO,calculateLabelTranslation:()=>j0,calculatePlacement:()=>mA,checkCrisp:()=>t_,clamp:()=>It,clampArray:()=>OM,clippedRoundRect:()=>Bg,collapsedStartingBarPosition:()=>lf,compareDates:()=>mO,computeBarFocusBounds:()=>LD,computeMarkerFocusBounds:()=>of,countExpandingSearch:()=>LE,countFractionDigits:()=>Qy,createButton:()=>_8,createCheckbox:()=>P8,createDatumId:()=>Ve,createDeprecationWarning:()=>JD,createElement:()=>Ot,createElementId:()=>ZY,createIcon:()=>_P,createId:()=>En,createSelect:()=>B8,createSvgElement:()=>wn,createTextArea:()=>z8,dateToNumber:()=>Ji,datesSortOrder:()=>C0,datumKeys:()=>rx,datumStylerProperties:()=>ol,deconstructSelectionsOrNodes:()=>nm,deepClone:()=>ni,deepFreeze:()=>Pp,defaultTimeTickFormat:()=>t0,diff:()=>Zu,downloadUrl:()=>i2,drawCorner:()=>qu,drawMarkerUnitPolygon:()=>kg,easing:()=>jM,enterpriseModule:()=>yo,evaluateBezier:()=>fx,extent:()=>ar,extractDecoratedProperties:()=>c2,findMinMax:()=>Si,findQuadtreeMatch:()=>ID,findRangeExtent:()=>du,fixNumericExtent:()=>Gs,focusCursorAtEnd:()=>XY,formatNumber:()=>RO,formatPercent:()=>EO,formatValue:()=>Zo,fromToMotion:()=>De,generateUUID:()=>$3,getAngleRatioRadians:()=>tO,getColorStops:()=>sO,getDateTicksForInterval:()=>R0,getDatumRefPoint:()=>WI,getDocument:()=>Go,getElementBBox:()=>aw,getIconClassNames:()=>Fm,getLastFocus:()=>kI,getMissCount:()=>JI,getPath:()=>BM,getPathComponents:()=>ZE,getRadialColumnWidth:()=>kP,getWindow:()=>ae,groupAccumulativeValueProperty:()=>ul,groupAverage:()=>QR,groupCount:()=>_A,groupStackValueProperty:()=>n1,groupSum:()=>ZR,hasNoModifiers:()=>Xm,inRange:()=>s2,initMenuKeyNav:()=>jw,initRovingTabIndex:()=>Fw,interpolatePoints:()=>Kx,isAgFlowProportionChartOptions:()=>S$,isAgGaugeChartOptions:()=>oR,isAgHierarchyChartOptions:()=>x$,isAgStandaloneChartOptions:()=>aR,isAgTopologyChartOptions:()=>b$,isBetweenAngles:()=>Qr,isButtonClickEvent:()=>DI,isContinuous:()=>Nm,isDecoratedObject:()=>em,isDenseInterval:()=>ag,isInputPending:()=>ow,isInteger:()=>n2,isNegative:()=>Zy,isNumberEqual:()=>ca,isProperties:()=>qa,isScaleValid:()=>ef,jsonApply:()=>yg,jsonDiff:()=>Qo,jsonPropertyCompare:()=>lw,jsonResolveOperations:()=>cw,jsonWalk:()=>qo,keyProperty:()=>va,labelDirectionHandling:()=>$0,legendSymbolSvg:()=>vR,lineDistanceSquared:()=>rg,listDecoratedProperties:()=>uc,makeAccessibleClickListener:()=>S5,mapValues:()=>hH,markerFadeInAnimation:()=>sf,markerPaletteFactory:()=>iD,markerScaleInAnimation:()=>mD,markerSwipeScaleInAnimation:()=>xD,mergeArrayDefaults:()=>im,mergeDefaults:()=>Tt,midpointStartingBarPosition:()=>aX,mod:()=>wM,moduleRegistry:()=>pa,motion:()=>XP,nearestSquared:()=>$y,nearestSquaredInContainer:()=>J3,normaliseGroupTo:()=>Cx,normalisePropertyTo:()=>Qc,normalisedExtentWithMetadata:()=>LA,normalizeAngle180:()=>tg,normalizeAngle360:()=>re,normalizeAngle360Inclusive:()=>oY,objectsEqual:()=>pc,objectsEqualWith:()=>_M,pairUpSpans:()=>tf,partialAssign:()=>FM,pathFadeInAnimation:()=>Qx,pathMotion:()=>Hx,pathSwipeInAnimation:()=>bD,pickByMatchingAngle:()=>BD,plotAreaPathFill:()=>K1,plotInterpolatedAreaSeriesFillSpans:()=>Zx,plotInterpolatedLinePathStroke:()=>$x,plotLinePathStroke:()=>gD,predicateWithMessage:()=>qt,prepareAreaFillAnimationFns:()=>$1,prepareAreaPathAnimation:()=>X1,prepareAxisAnimationContext:()=>Em,prepareAxisAnimationFunctions:()=>ZO,prepareBarAnimationFunctions:()=>cf,prepareLinePathAnimation:()=>Y1,prepareLinePathPropertyAnimation:()=>yD,prepareLinePathStrokeAnimationFns:()=>fD,preparePieSeriesAnimationFunctions:()=>oh,range:()=>ng,rangedValueProperty:()=>zA,resetAxisGroupFn:()=>QO,resetAxisLabelSelectionFn:()=>J0,resetAxisLineSelectionFn:()=>qO,resetAxisSelectionFn:()=>q0,resetBarSelectionsFn:()=>hf,resetIds:()=>K3,resetLabelFn:()=>pr,resetMarkerFn:()=>nf,resetMarkerPositionFn:()=>af,resetMotion:()=>Mi,resetPieSelectionsFn:()=>PD,round:()=>tH,rowCountProperty:()=>s1,sanitizeHtml:()=>Uu,scale:()=>as,sectorBox:()=>S_,seriesLabelFadeInAnimation:()=>Ht,seriesLabelFadeOutAnimation:()=>gl,setAttribute:()=>ee,setAttributes:()=>Bc,setDocument:()=>JN,setElementBBox:()=>zm,setElementStyle:()=>fa,setPath:()=>zM,setWindow:()=>t2,shallowClone:()=>lI,singleSeriesPaletteFactory:()=>Qg,solveBezier:()=>yx,sortAndUniqueDates:()=>T0,splitBezier:()=>mx,staticFromToMotion:()=>Ho,stopPageScrolling:()=>Vw,sum:()=>l6,sumValues:()=>Tx,swapAxisCondition:()=>A1,toDegrees:()=>rY,toRadians:()=>ti,tooltipContentAriaLabel:()=>DR,trailingAccumulatedValue:()=>JR,trailingAccumulatedValueProperty:()=>u6,updateClipPath:()=>qx,updateLabelNode:()=>e_,validateCrossLineValues:()=>F0,valueProperty:()=>Ct,visibleRangeIndices:()=>kE,without:()=>PM});var XP,K8=I({"packages/ag-charts-community/src/module-support.ts"(){"use strict";wi(),Ac(),Sx(),Mx(),ju(),ot(),Lt(),Ii(),xO(),ug(),Xr(),_c(),Z9(),lo(),il(),jn(),Ru(),er(),Xy(),At(),oe(),mR(),Qt(),Is(),ig(),rm(),ln(),k0(),om(),mt(),CP(),EE(),g8(),f8(),y8(),m8(),MP(),x8(),no(),b8(),S8(),Ib(),f1(),y1(),v8(),yO(),eI(),sw(),Vn(),QE(),xE(),uo(),BA(),HE(),Lw(),vE(),ME(),IE(),NE(),AE(),bE(),UI(),jE(),NY(),$c(),M8(),gr(),Ng(),Ju(),fr(),I8(),T$(),Gc(),h_(),u_(),Yx(),kD(),Us(),y_(),m_(),Xx(),pD(),TD(),Z1(),rf(),n_(),vD(),AD(),rD(),CA(),xb(),zD(),xX(),A8(),D8(),k8(),L8(),T8(),C8(),N8(),O8(),Ex(),sI(),Q0(),wm(),XO(),E_(),wu(),UA(),gg(),w8(),E8(),jO(),HO(),R8(),MR(),Lg(),fc(),fu(),Ac(),wi(),sD(),Xw(),F8(),sE(),Rn(),I1(),UE(),Cc(),hc(),ss(),di(),xR(),lg(),Ky(),fI(),B0(),P0(),kA(),Hp(),Yp(),Qi(),Nc(),Du(),Zc(),j8(),e0(),xd(),XA(),pe(),nn(),Ai(),el(),gm(),nO(),eO(),V8(),Gn(),ub(),g1(),G8(),Fs(),Qi(),Nc(),zn(),ba(),SR(),S1(),Lg(),b_(),lE(),W8(),yA(),xx(),fu(),Lc(),Rt(),pe(),_I(),DP(),Oc(),BO(),Gn(),LP(),zg(),pb(),qr(),md(),ke(),I1(),zP(),U8(),FP(),VP(),ak(),H8(),GP(),UP(),Y8(),XP={...f2,...H2}}}),w={};sn(w,{AG_CHARTS_LOCALE_EN_US:()=>EI,AgCharts:()=>mr,AgChartsCommunityModule:()=>ZP,AgErrorBarSupportedSeriesTypes:()=>__,AgTooltipPositionType:()=>Ab,VERSION:()=>zc,_ModuleSupport:()=>$P,_Scene:()=>ZD,_Theme:()=>QD,_Util:()=>qD,_Widget:()=>BP,setupCommunityModules:()=>GD,time:()=>L2});var ZP,R=I({"packages/ag-charts-community/src/main.ts"(){"use strict";U9(),w_(),H9(),Y9(),K9(),$m(),nE(),Db(),Vp(),K8(),zP(),ZP={VERSION:zc,_Scene:ZD,_Theme:QD,_Util:qD,create:mr.create.bind(mr),createSparkline:mr.__createSparkline.bind(mr),setup:GD,isEnterprise:!1}}}),Yb=Object.defineProperty,QP=Object.getOwnPropertyDescriptor,$8=Object.getOwnPropertyNames,X8=Object.prototype.hasOwnProperty,qP=(t,e)=>{for(var i in e)Yb(t,i,{get:e[i],enumerable:!0})},hk=(t,e,i,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of $8(e))!X8.call(t,n)&&n!==i&&Yb(t,n,{get:()=>e[n],enumerable:!(s=QP(e,n))||s.enumerable});return t},Z8=(t,e,i)=>(hk(t,e,"default"),i&&hk(i,e,"default")),Q8=t=>hk(Yb({},"__esModule",{value:!0}),t),y=(t,e,i,s)=>{for(var n=s>1?void 0:s?QP(e,i):e,a=t.length-1,o;a>=0;a--)(o=t[a])&&(n=(s?o(e,i,n):o(n))||n);return s&&n&&Yb(e,i,n),n},uk={};qP(uk,{AgChartsEnterpriseModule:()=>dbt,LicenseManager:()=>ubt,setupEnterpriseModules:()=>UU}),ra.exports=Q8(uk);var br=(R(),E(w)),q8=class{constructor(){this.ieCompatibility=!1}init(){this.ieCompatibility=this.md5("hello")!="5d41402abc4b2a76b9719d911017c592"}md5cycle(t,e){let i=t[0],s=t[1],n=t[2],a=t[3];i=this.ff(i,s,n,a,e[0],7,-680876936),a=this.ff(a,i,s,n,e[1],12,-389564586),n=this.ff(n,a,i,s,e[2],17,606105819),s=this.ff(s,n,a,i,e[3],22,-1044525330),i=this.ff(i,s,n,a,e[4],7,-176418897),a=this.ff(a,i,s,n,e[5],12,1200080426),n=this.ff(n,a,i,s,e[6],17,-1473231341),s=this.ff(s,n,a,i,e[7],22,-45705983),i=this.ff(i,s,n,a,e[8],7,1770035416),a=this.ff(a,i,s,n,e[9],12,-1958414417),n=this.ff(n,a,i,s,e[10],17,-42063),s=this.ff(s,n,a,i,e[11],22,-1990404162),i=this.ff(i,s,n,a,e[12],7,1804603682),a=this.ff(a,i,s,n,e[13],12,-40341101),n=this.ff(n,a,i,s,e[14],17,-1502002290),s=this.ff(s,n,a,i,e[15],22,1236535329),i=this.gg(i,s,n,a,e[1],5,-165796510),a=this.gg(a,i,s,n,e[6],9,-1069501632),n=this.gg(n,a,i,s,e[11],14,643717713),s=this.gg(s,n,a,i,e[0],20,-373897302),i=this.gg(i,s,n,a,e[5],5,-701558691),a=this.gg(a,i,s,n,e[10],9,38016083),n=this.gg(n,a,i,s,e[15],14,-660478335),s=this.gg(s,n,a,i,e[4],20,-405537848),i=this.gg(i,s,n,a,e[9],5,568446438),a=this.gg(a,i,s,n,e[14],9,-1019803690),n=this.gg(n,a,i,s,e[3],14,-187363961),s=this.gg(s,n,a,i,e[8],20,1163531501),i=this.gg(i,s,n,a,e[13],5,-1444681467),a=this.gg(a,i,s,n,e[2],9,-51403784),n=this.gg(n,a,i,s,e[7],14,1735328473),s=this.gg(s,n,a,i,e[12],20,-1926607734),i=this.hh(i,s,n,a,e[5],4,-378558),a=this.hh(a,i,s,n,e[8],11,-2022574463),n=this.hh(n,a,i,s,e[11],16,1839030562),s=this.hh(s,n,a,i,e[14],23,-35309556),i=this.hh(i,s,n,a,e[1],4,-1530992060),a=this.hh(a,i,s,n,e[4],11,1272893353),n=this.hh(n,a,i,s,e[7],16,-155497632),s=this.hh(s,n,a,i,e[10],23,-1094730640),i=this.hh(i,s,n,a,e[13],4,681279174),a=this.hh(a,i,s,n,e[0],11,-358537222),n=this.hh(n,a,i,s,e[3],16,-722521979),s=this.hh(s,n,a,i,e[6],23,76029189),i=this.hh(i,s,n,a,e[9],4,-640364487),a=this.hh(a,i,s,n,e[12],11,-421815835),n=this.hh(n,a,i,s,e[15],16,530742520),s=this.hh(s,n,a,i,e[2],23,-995338651),i=this.ii(i,s,n,a,e[0],6,-198630844),a=this.ii(a,i,s,n,e[7],10,1126891415),n=this.ii(n,a,i,s,e[14],15,-1416354905),s=this.ii(s,n,a,i,e[5],21,-57434055),i=this.ii(i,s,n,a,e[12],6,1700485571),a=this.ii(a,i,s,n,e[3],10,-1894986606),n=this.ii(n,a,i,s,e[10],15,-1051523),s=this.ii(s,n,a,i,e[1],21,-2054922799),i=this.ii(i,s,n,a,e[8],6,1873313359),a=this.ii(a,i,s,n,e[15],10,-30611744),n=this.ii(n,a,i,s,e[6],15,-1560198380),s=this.ii(s,n,a,i,e[13],21,1309151649),i=this.ii(i,s,n,a,e[4],6,-145523070),a=this.ii(a,i,s,n,e[11],10,-1120210379),n=this.ii(n,a,i,s,e[2],15,718787259),s=this.ii(s,n,a,i,e[9],21,-343485551),t[0]=this.add32(i,t[0]),t[1]=this.add32(s,t[1]),t[2]=this.add32(n,t[2]),t[3]=this.add32(a,t[3])}cmn(t,e,i,s,n,a){return e=this.add32(this.add32(e,t),this.add32(s,a)),this.add32(e<>>32-n,i)}ff(t,e,i,s,n,a,o){return this.cmn(e&i|~e&s,t,e,n,a,o)}gg(t,e,i,s,n,a,o){return this.cmn(e&s|i&~s,t,e,n,a,o)}hh(t,e,i,s,n,a,o){return this.cmn(e^i^s,t,e,n,a,o)}ii(t,e,i,s,n,a,o){return this.cmn(i^(e|~s),t,e,n,a,o)}md51(t){const e=t.length,i=[1732584193,-271733879,-1732584194,271733878];let s;for(s=64;s<=t.length;s+=64)this.md5cycle(i,this.md5blk(t.substring(s-64,s)));t=t.substring(s-64);const n=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];for(s=0;s>2]|=t.charCodeAt(s)<<(s%4<<3);if(n[s>>2]|=128<<(s%4<<3),s>55)for(this.md5cycle(i,n),s=0;s<16;s++)n[s]=0;return n[14]=e*8,this.md5cycle(i,n),i}md5blk(t){const e=[];for(let i=0;i<64;i+=4)e[i>>2]=t.charCodeAt(i)+(t.charCodeAt(i+1)<<8)+(t.charCodeAt(i+2)<<16)+(t.charCodeAt(i+3)<<24);return e}rhex(t){const e="0123456789abcdef".split("");let i="",s=0;for(;s<4;s++)i+=e[t>>s*8+4&15]+e[t>>s*8&15];return i}hex(t){for(let e=0;e>16)+(e>>16)+(i>>16)<<16|i&65535}};function dk(t){return t==null||t.length===0}var Kb={"01":"GRID","02":"CHARTS","0102":"BOTH"},JP="https://www.ag-grid.com/charts/licensing/",pk=class ui{constructor(e){this.watermarkMessage=void 0,this.totalMessageLength=124,this.document=e,this.md5=new q8,this.md5.init()}validateLicense(){const e=this.getLicenseDetails(ui.licenseKey,ui.gridContext),i=`AG ${e.currentLicenseType==="BOTH"?"Grid and ":""}Charts Enterprise`;let s="";if(e.suppliedLicenseType==="BOTH"?s="AG Grid and AG Charts Enterprise":e.suppliedLicenseType==="GRID"?s="AG Grid Enterprise":e.suppliedLicenseType!==void 0&&(s="AG Charts Enterprise"),e.missing)(!this.isWebsiteUrl()||this.isForceWatermark())&&this.outputMissingLicenseKey(i);else if(e.expired){const n=ui.getChartsReleaseDate(),a=ui.formatDate(n);this.outputExpiredKey(e.expiry,a,s)}else e.valid?e.isTrial&&e.trialExpired&&this.outputExpiredTrialKey(e.expiry,i,s):this.outputInvalidLicenseKey(!!e.incorrectLicenseType,i,s)}static extractExpiry(e){const i=e.substring(e.lastIndexOf("_")+1,e.length);return new Date(parseInt(ui.decode(i),10))}static extractLicenseComponents(e){let i=e.replace(/[\u200B-\u200D\uFEFF]/g,"");if(i=i.replace(/\r?\n|\r/g,""),e.length<=32)return{md5:null,license:e,version:null,isTrial:null};const s=i.length-32,n=i.substring(s),a=i.substring(0,s),[o,r,l]=ui.extractBracketedInformation(i);return{md5:n,license:a,version:o,isTrial:r,type:l}}getLicenseDetails(e,i=!1){const s="CHARTS";if(dk(e))return{licenseKey:e,valid:!1,missing:!0,currentLicenseType:s};const n=ui.getChartsReleaseDate(),{md5:a,license:o,version:r,isTrial:l,type:c}=ui.extractLicenseComponents(e);let h=a===this.md5.md5(o)&&e.indexOf("For_Trialing_ag-Grid_Only")===-1,u,d,p=null,g=!1,f;function x(){u=pp,r){case"legacy":case"2":{h=!1;break}case"3":dk(c)?h=!1:(f=c,c!==Kb["02"]&&c!==Kb["0102"]?(h=!1,g=!0):l&&x())}return h?{licenseKey:e,valid:h,expiry:ui.formatDate(p),expired:d,version:r,isTrial:l,trialExpired:u,invalidLicenseTypeForCombo:i?f!=="BOTH":void 0,incorrectLicenseType:g,currentLicenseType:s,suppliedLicenseType:f}:{licenseKey:e,valid:h,incorrectLicenseType:g,currentLicenseType:s,suppliedLicenseType:f}}isDisplayWatermark(){return this.isForceWatermark()||!this.isLocalhost()&&!this.isWebsiteUrl()&&!dk(this.watermarkMessage)}getWatermarkMessage(){return this.watermarkMessage??""}getHostname(){if(!this.document)return"localhost";const e=this.document.defaultView??window;if(!e)return"localhost";const i=e.location,{hostname:s=""}=i;return s}isForceWatermark(){if(!this.document)return!1;const e=this.document?.defaultView??typeof window<"u"?window:void 0;if(!e)return!1;const{pathname:i}=e.location;return i?i.indexOf("forceWatermark")!==-1:!1}isWebsiteUrl(){const e=this.getHostname();return/^((?:[\w-]+\.)?ag-grid\.com)$/.exec(e)!==null}isLocalhost(){const e=this.getHostname();return/^(?:127\.0\.0\.1|localhost)$/.exec(e)!==null}static formatDate(e){const i=["January","February","March","April","May","June","July","August","September","October","November","December"],s=e.getDate(),n=e.getMonth(),a=e.getFullYear();return s+" "+i[n]+" "+a}static getChartsReleaseDate(){return new Date(parseInt(ui.decode(ui.RELEASE_INFORMATION),10))}static decode(e){const i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";let s="",n,a,o,r,l,c,h,u=0;const d=e.replace(/[^A-Za-z0-9+/=]/g,"");for(;u>4,a=(l&15)<<4|c>>2,o=(c&3)<<6|h,s=s+String.fromCharCode(n),c!=64&&(s=s+String.fromCharCode(a)),h!=64&&(s=s+String.fromCharCode(o));return s=ui.utf8_decode(s),s}static utf8_decode(e){e=e.replace(/rn/g,"n");let i="";for(let s=0;s127&&n<2048?(i+=String.fromCharCode(n>>6|192),i+=String.fromCharCode(n&63|128)):(i+=String.fromCharCode(n>>12|224),i+=String.fromCharCode(n>>6&63|128),i+=String.fromCharCode(n&63|128))}return i}static setGridContext(e=!1){ui.gridContext=e}static setLicenseKey(e){ui.licenseKey=e}static extractBracketedInformation(e){if(!e.includes("["))return["legacy",!1,void 0];const i=e.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,n=i.filter(r=>r.startsWith("v"))[0],a=n?n.replace("v",""):"legacy",o=Kb[i.filter(r=>Kb[r])[0]];return[a,s,o]}centerPadAndOutput(e){const i=this.totalMessageLength-e.length;console.error(e.padStart(i/2+e.length,"*").padEnd(this.totalMessageLength,"*"))}padAndOutput(e,i="*",s=""){console.error(e.padEnd(this.totalMessageLength-s.length,i)+s)}outputInvalidLicenseKey(e,i,s){ui.gridContext||(e?(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 ${JP}.`," ","*"),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 ${JP}.`," ","*"),this.centerPadAndOutput(""),this.centerPadAndOutput(""))),this.watermarkMessage="Invalid License"}outputExpiredTrialKey(e,i,s){ui.gridContext||(this.centerPadAndOutput(""),this.centerPadAndOutput(` ${i} License `),this.centerPadAndOutput(" Trial Period Expired. "),this.padAndOutput(`* Your trial only license for ${s} expired on ${e}.`," ","*"),this.padAndOutput("* Please email info@ag-grid.com to purchase a license."," ","*"),this.centerPadAndOutput(""),this.centerPadAndOutput("")),this.watermarkMessage="Trial Period Expired"}outputMissingLicenseKey(e){ui.gridContext||(this.centerPadAndOutput(""),this.centerPadAndOutput(` ${e} License `),this.centerPadAndOutput(" License Key Not Found "),this.padAndOutput(`* All ${e} 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(e,i,s){ui.gridContext||(this.centerPadAndOutput(""),this.centerPadAndOutput(` ${s} License `),this.centerPadAndOutput(" Incompatible Software Version "),this.padAndOutput(`* Your license key works with versions of ${s} released before ${e}.`," ","*"),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"}};pk.RELEASE_INFORMATION="MTc0MDAzOTI3Mjg4Mg==",pk.gridContext=!1;var Md=pk,Id=(R(),E(w)),J8=(R(),E(w));function gk(t,e,i){const s=(a,o,r,l)=>{let c=t[0];for(let h=a;r>0?h<=o:h>o;h+=r){const u=t[h];if(l(c,u))return!0;c=u}return!1},n=Math.floor(t.length/2);return s(e,n,e,i)?!0:s(t.length-e,n,-e,i)}var t7=(R(),E(w)),{OR:e7,POSITIVE_NUMBER:i7,NAN:s7,AxisInterval:n7,Validate:a7}=t7._ModuleSupport,fk=class extends n7{constructor(){super(...arguments),this.minSpacing=NaN}};y([a7(e7(i7,s7))],fk.prototype,"minSpacing",2);var yk=(R(),E(w)),tB=(R(),E(w)),o7=(R(),E(w)),{BaseProperties:eB,ChartAxisDirection:r7,ARRAY:l7,BOOLEAN:mk,COLOR_STRING:xk,FONT_STYLE:c7,FONT_WEIGHT:h7,LINE_DASH:u7,NUMBER:iB,OBJECT:d7,POSITIVE_NUMBER:p7,RATIO:sB,STRING:nB,UNION:aB,AND:g7,Validate:He,MATCHING_CROSSLINE_TYPE:oB,createId:f7,Group:bk}=o7._ModuleSupport,La=class extends eB{constructor(){super(...arguments),this.fontSize=14,this.fontFamily="Verdana, sans-serif",this.padding=5,this.color="rgba(87, 87, 87, 1)"}};y([He(mk,{optional:!0})],La.prototype,"enabled",2),y([He(nB,{optional:!0})],La.prototype,"text",2),y([He(c7,{optional:!0})],La.prototype,"fontStyle",2),y([He(h7,{optional:!0})],La.prototype,"fontWeight",2),y([He(p7)],La.prototype,"fontSize",2),y([He(nB)],La.prototype,"fontFamily",2),y([He(iB)],La.prototype,"padding",2),y([He(xk,{optional:!0})],La.prototype,"color",2),y([He(mk,{optional:!0})],La.prototype,"parallel",2);var Hs=class extends eB{constructor(){super(...arguments),this.id=f7(this),this.shape="polygon",this.label=new La,this.scale=void 0,this.clippedRange=[-1/0,1/0],this.gridLength=0,this.sideFlag=-1,this.parallelFlipRotation=0,this.regularFlipRotation=0,this.direction=r7.X,this.axisInnerRadius=0,this.axisOuterRadius=0,this.lineGroup=new bk({name:this.id}),this.rangeGroup=new bk({name:this.id}),this.labelGroup=new bk({name:this.id}),this._isRange=void 0}assignCrossLineGroup(t,e){t!==this._isRange&&(t?this.rangeGroup.appendChild(e):this.lineGroup.appendChild(e)),this._isRange=t}setSectorNodeProps(t){t.fill=this.fill,t.fillOpacity=this.fillOpacity??1,t.stroke=this.stroke,t.strokeOpacity=this.strokeOpacity??1,t.strokeWidth=this.strokeWidth??1,t.lineDash=this.lineDash}setLabelNodeProps(t,e,i,s,n){const{label:a}=this;t.x=e,t.y=i,t.text=a.text,t.textAlign="center",t.textBaseline=s,t.rotation=n,t.rotationCenterX=e,t.rotationCenterY=i,t.fill=a.color,t.fontFamily=a.fontFamily,t.fontSize=a.fontSize,t.fontStyle=a.fontStyle,t.visible=!0}};y([He(mk,{optional:!0})],Hs.prototype,"enabled",2),y([He(aB(["range","line"],"a crossLine type"),{optional:!0})],Hs.prototype,"type",2),y([He(g7(oB("range"),l7.restrict({length:2})),{optional:!0})],Hs.prototype,"range",2),y([He(oB("value"),{optional:!0})],Hs.prototype,"value",2),y([He(xk,{optional:!0})],Hs.prototype,"fill",2),y([He(sB,{optional:!0})],Hs.prototype,"fillOpacity",2),y([He(xk,{optional:!0})],Hs.prototype,"stroke",2),y([He(iB,{optional:!0})],Hs.prototype,"strokeWidth",2),y([He(sB,{optional:!0})],Hs.prototype,"strokeOpacity",2),y([He(u7,{optional:!0})],Hs.prototype,"lineDash",2),y([He(aB(["polygon","circle"],"a shape"))],Hs.prototype,"shape",2),y([He(d7)],Hs.prototype,"label",2);var{ChartAxisDirection:y7,validateCrossLineValues:m7,normalizeAngle360:Sk,isNumberEqual:rB,Group:x7,Path:lB,Sector:b7,RotatableText:S7,ContinuousScale:v7,BandScale:M7}=tB._ModuleSupport,vk=class extends Hs{constructor(){super(),this.direction=y7.X,this.polygonNode=new lB,this.sectorNode=new b7,this.lineNode=new lB,this.crossLineRange=new x7,this.labelNode=new S7,this.ticks=[],this.crossLineRange.append(this.polygonNode),this.crossLineRange.append(this.sectorNode),this.crossLineRange.append(this.lineNode),this.labelGroup.append(this.labelNode)}update(t){const{scale:e,shape:i,type:s,value:n,range:a}=this;if(!e||!s||!m7(s,n,a,e,()=>{if(!v7.is(e))return!0;const[r,l]=a??[n,void 0],{domain:c}=e;return r>=c[0]&&r<=c[1]&&(s==="line"||l>=r&&l<=c[1])})){this.rangeGroup.visible=!1,this.lineGroup.visible=!1,this.labelGroup.visible=!1;return}this.rangeGroup.visible=t,this.lineGroup.visible=t,this.labelGroup.visible=t,s==="line"&&i==="circle"&&M7.is(e)&&(this.type="range",this.range=[n,n]),this.updateLineNode(t),this.updatePolygonNode(t),this.updateSectorNode(t),this.updateLabelNode(t)}updateLineNode(t){const{scale:e,type:i,value:s,lineNode:n}=this;if(!t||i!=="line"||!e){n.visible=!1;return}const a=e.convert(s);if(isNaN(a)){n.visible=!1;return}const{axisInnerRadius:o,axisOuterRadius:r}=this;n.visible=!0,n.stroke=this.stroke,n.strokeOpacity=this.strokeOpacity??1,n.strokeWidth=this.strokeWidth??1,n.fill=void 0,n.lineDash=this.lineDash;const l=r*Math.cos(a),c=r*Math.sin(a),h=o*Math.cos(a),u=o*Math.sin(a);n.path.clear(!0),n.path.moveTo(h,u),n.path.lineTo(l,c),this.assignCrossLineGroup(!1,this.crossLineRange)}updatePolygonNode(t){const{polygonNode:e,range:i,scale:s,shape:n,type:a,ticks:o}=this;if(!t||a!=="range"||n!=="polygon"||!s||!i){e.visible=!1;return}const{axisInnerRadius:r,axisOuterRadius:l}=this,c=o.indexOf(i[0]),h=o.indexOf(i[1]),d=(c<=h?o.slice(c,h+1):o.slice(c).concat(o.slice(0,h+1))).map(g=>s.convert(g));e.visible=!0,this.setSectorNodeProps(e);const{path:p}=e;p.clear(!0),d.forEach((g,f)=>{const x=l*Math.cos(g),m=l*Math.sin(g);f===0?p.moveTo(x,m):p.lineTo(x,m)}),r===0?p.lineTo(0,0):d.slice().reverse().forEach(g=>{const f=r*Math.cos(g),x=r*Math.sin(g);p.lineTo(f,x)}),e.path.closePath(),this.assignCrossLineGroup(!0,this.crossLineRange)}updateSectorNode(t){const{sectorNode:e,range:i,scale:s,shape:n,type:a}=this;if(!t||a!=="range"||n!=="circle"||!s||!i){e.visible=!1;return}const{axisInnerRadius:o,axisOuterRadius:r}=this,l=i.map(u=>s.convert(u)),c=s.step??0,h=s instanceof tB._ModuleSupport.BandScale?c/2:0;e.visible=!0,this.setSectorNodeProps(e),e.centerX=0,e.centerY=0,e.innerRadius=o,e.outerRadius=r,e.startAngle=l[0]-h,e.endAngle=l[1]+h,this.assignCrossLineGroup(!0,this.crossLineRange)}updateLabelNode(t){const{label:e,labelNode:i,range:s,scale:n,type:a,ticks:o}=this;if(!t||e.enabled===!1||!e.text||!n||a==="range"&&!s){i.visible=!1;return}i.visible=!0;const{axisInnerRadius:r,axisOuterRadius:l}=this;let c,h,u,d;if(a==="line"){const p=Sk(n.convert(this.value)),g=1.5*Math.PI,f=rB(p,g)||p>g||pSk(n.convert(b)));let f=(p+g)/2;p>g&&(f-=Math.PI),f=Sk(f);const x=(rB(f,0)||f>0)&&fr.value);return{niceDomain:n,primaryTickCount:void 0,tickDomain:n,ticks:o,fractionDigits:0,bbox:this.getBBox()}}update(){super.update(),this.updateRadiusLine()}normalizedAngles(){const t=Dd(-Math.PI/2+$b(this.startAngle)),e=this.endAngle!=null?T7($b(this.endAngle)-$b(this.startAngle)):2*Math.PI,i=t+e;return[t,i]}computeRange(){this.range=this.normalizedAngles()}updateSelections(){const t=this.tickData;this.gridLineGroupSelection.update(this.gridLength&&this.gridLine.enabled?t:[]),this.tickLineGroupSelection.update(this.tick.enabled?t:[]),this.tickLabelGroupSelection.update(this.label.enabled?t:[]),this.gridLineGroupSelection.cleanup(),this.tickLineGroupSelection.cleanup(),this.tickLabelGroupSelection.cleanup()}updatePosition(){const{translation:t,axisGroup:e,gridGroup:i,crossLineRangeGroup:s,crossLineLineGroup:n,crossLineLabelGroup:a}=this,o=Math.floor(t.x),r=Math.floor(t.y);e.translationX=o,e.translationY=r,i.translationX=o,i.translationY=r,s.translationX=o,s.translationY=r,n.translationX=o,n.translationY=r,a.translationX=o,a.translationY=r}updateRadiusLine(){const t=this.radiusLine,{path:e}=t;e.clear(!0);const{points:i,closePath:s}=this.getAxisLinePoints();i.forEach(({x:n,y:a,moveTo:o,arc:r,radius:l=0,startAngle:c=0,endAngle:h=0})=>{r?e.arc(n,a,l,c,h):o?e.moveTo(n,a):e.lineTo(n,a)}),s&&e.closePath(),t.visible=this.line.enabled,t.stroke=this.line.stroke,t.strokeWidth=this.line.width,t.fill=void 0}getAxisLinePoints(){const{scale:t,shape:e,gridLength:i}=this,[s,n]=this.range,a=Ad(n-s,2*Math.PI),o=[];if(e==="circle")a?o.push({x:i,y:0,moveTo:!0},{x:0,y:0,radius:i,startAngle:0,endAngle:2*Math.PI,arc:!0,moveTo:!1}):o.push({x:i*Math.cos(s),y:i*Math.sin(s),moveTo:!0},{x:0,y:0,radius:i,startAngle:Dd(s),endAngle:Dd(n),arc:!0,moveTo:!1});else if(e==="polygon"){const r=t.ticks({nice:this.nice,interval:void 0,tickCount:void 0,minTickCount:0,maxTickCount:1/0})?.map(l=>t.convert(l));r&&r.length>2&&r.forEach((l,c)=>{const h=i*Math.cos(l),u=i*Math.sin(l),d=c===0;o.push({x:h,y:u,moveTo:d})})}return{points:o,closePath:a}}updateGridLines(){const{scale:t,gridLength:e,gridLine:{style:i,width:s},innerRadiusRatio:n}=this;if(!(i&&e>0))return;const a=e*n,o=i.length;this.gridLineGroupSelection.each((r,l,c)=>{const{value:h}=l,{stroke:u,lineDash:d}=i[c%o],p=t.convert(h);r.x1=a*Math.cos(p),r.y1=a*Math.sin(p),r.x2=e*Math.cos(p),r.y2=e*Math.sin(p),r.stroke=u,r.strokeWidth=s,r.lineDash=d,r.fill=void 0}),this.gridLineGroupSelection.cleanup()}updateLabels(){const{label:t,tickLabelGroupSelection:e}=this;e.each((i,s,n)=>{const a=this.labelData[n];if(!a||a.hidden){i.visible=!1;return}i.text=a.text,i.setFont(t),i.fill=t.color,i.x=a.x,i.y=a.y,i.textAlign=a.textAlign,i.textBaseline=a.textBaseline,i.visible=!0,a.rotation?(i.rotation=a.rotation,i.rotationCenterX=a.x,i.rotationCenterY=a.y):i.rotation=0})}updateTickLines(){const{scale:t,gridLength:e,tick:i,tickLineGroupSelection:s}=this;s.each((n,a)=>{const{value:o}=a,r=t.convert(o),l=Math.cos(r),c=Math.sin(r);n.x1=e*l,n.y1=e*c,n.x2=(e+i.size)*l,n.y2=(e+i.size)*c,n.stroke=i.stroke,n.strokeWidth=i.width})}createLabelNodeData(t,e,i){const{label:s,gridLength:n,scale:a,tick:o}=this;if(!s.enabled)return[];const r=new N7,l=i.x-this.translation.x,c=i.x+i.width-this.translation.x,h=t.map((u,d)=>{const{value:p}=u,g=n+s.spacing+o.size,f=a.convert(p),x=Math.cos(f),m=Math.sin(f),b=g*x,v=g*m,{textAlign:S,textBaseline:A}=this.getLabelAlign(f),T=d===t.length-1&&p!==t[0]&&Ad(Dd(f),Dd(a.convert(t[0]))),D=this.getLabelRotation(f);let L=String(p);if(s.formatter){const{callbackCache:O}=this.moduleCtx;L=O.call(s.formatter,{value:p,index:d})??""}r.text=L,r.x=b,r.y=v,r.setFont(s),r.textAlign=S,r.textBaseline=A,r.rotation=D,D&&(r.rotationCenterX=b,r.rotationCenterY=v);let C=D?O7.toCanvas(r):r.getBBox();if(C&&e.hideWhenNecessary&&!D){const O=l-C.x,_=C.x+C.width-c,N=1;if(O>N||_>N){const P=C.width-Math.max(O,_);L=k7.wrapText(L,{maxWidth:P,font:s,textWrap:"never"}),L===L7.EllipsisChar&&(L=""),r.text=L,C=r.getBBox()}}return{text:L,x:b,y:v,textAlign:S,textBaseline:A,hidden:L===""||u.hidden||T,rotation:D,box:C}});return s.avoidCollisions&&this.avoidLabelCollisions(h),h}computeLabelsBBox(t,e){this.labelData=this.createLabelNodeData(this.tickData,t,e);const i=this.labelData.map(({box:s})=>s).filter(s=>s!=null);return!this.label.enabled||i.length===0?null:w7.merge(i)}getLabelOrientation(){const{label:t}=this;return t instanceof Ik?t.orientation:"fixed"}getLabelRotation(t){let e=$b(this.label.rotation??0);t=Dd(t);const i=this.getLabelOrientation();return i==="parallel"?(e+=t,t>=0&&t=Math.PI/2&&t<1.5*Math.PI&&(e+=Math.PI)),e}getLabelAlign(t){const e=Math.cos(t),i=Math.sin(t);let s,n;const a=this.getLabelOrientation(),o=Ad(e,0),r=Ad(i,0),l=Ad(e,1),c=Ad(i,-1),h=e>0&&!o,u=i>0&&!r;return a==="parallel"?(s="center",n=l&&r||u?"top":"bottom"):a==="perpendicular"?(s=c||h?"left":"right",n="middle"):(s="right",o?s="center":h&&(s="left"),n="bottom",r?n="middle":u&&(n="top")),{textAlign:s,textBaseline:n}}updateCrossLines(){const{shape:t,gridLength:e,innerRadiusRatio:i}=this;this.crossLines.forEach(s=>{s instanceof vk&&(s.ticks=this.tickData.map(n=>n.value),s.shape=t,s.axisOuterRadius=e,s.axisInnerRadius=e*i)}),super.updateCrossLines()}};Mf.CrossLineConstructor=vk,y([D7("rotation"),Mk(cB)],Mf.prototype,"startAngle",2),y([Mk(cB,{optional:!0})],Mf.prototype,"endAngle",2);var{RATIO:hB,OBJECT:E7,Validate:Ak,isNumberEqual:uB,CategoryScale:R7}=J8._ModuleSupport,ph=class extends Mf{constructor(t){super(t,new R7),this.groupPaddingInner=0,this.paddingInner=0,this.interval=new fk}generateAngleTicks(){const{scale:t,gridLength:e}=this,{values:i,minSpacing:s}=this.interval,n=i??t.ticks({nice:this.nice,interval:void 0,tickCount:void 0,minTickCount:0,maxTickCount:1/0})??[];if(n.length<2||isNaN(s))return n.map(c=>({value:c,visible:!0}));const a=n[0],o=t.convert(a),r=e*Math.cos(o),l=e*Math.sin(o);for(let c=1;cMath.PI)break;const d=e*Math.cos(u),p=e*Math.sin(u);if(Math.sqrt((d-r)**2+(p-l)**2)>s){const f=new Set([a]);return gk(n,c,(x,m)=>{f.add(m)}),n.map(x=>{const m=f.has(x);return{value:x,visible:m}})}}return[{value:a,visible:!0}]}avoidLabelCollisions(t){let{minSpacing:e}=this.label;if(Number.isFinite(e)||(e=0),t.length<3)return;const i=(l,c)=>{if(l.hidden||c.hidden)return!1;const h=l.box.clone().grow(e/2),u=c.box.clone().grow(e/2);return h.collidesBBox(u)},s=t[0],n=t.at(-1),a=new Set([s]),o=uB(s.x,n.x)&&uB(s.y,n.y),r=Math.floor(t.length/2);for(let l=1;l<=r;l++){const c=o?t.slice(0,-1):t;if(!gk(c,l,i)){gk(c,l,(u,d)=>{a.add(d)});break}}t.forEach(l=>{a.has(l)||(l.hidden=!0,l.box=void 0)})}};ph.className="AngleCategoryAxis",ph.type="angle-category",y([Ak(hB)],ph.prototype,"groupPaddingInner",2),y([Ak(hB)],ph.prototype,"paddingInner",2),y([Ak(E7)],ph.prototype,"interval",2);var _7={type:"axis",optionsKey:"axes[]",packageType:"enterprise",chartTypes:["polar"],identifier:"angle-category",moduleFactory:t=>new ph(t)},P7=(R(),E(w)),B7=(R(),E(w)),{range:dB,isDenseInterval:z7,isNumberEqual:F7,LinearScale:Dk}=B7._ModuleSupport,j7=class PN extends Dk{constructor(){super(...arguments),this.arcLength=0}static getNiceStepAndTickCount(e,i){const[s,n]=i;let a=Dk.getTickStep(s,n,e);const o=isNaN(e.maxTickCount)?1/0:e.maxTickCount,r=Math.abs(n-s)/a;let l=Math.pow(2,Math.ceil(Math.log(r)/Math.log(2)));return l>o&&(l/=2,a*=2),{count:l,step:a}}ticks(e,i=this.domain){const{arcLength:s}=this;if(!i||i.length<2||i.some(c=>!isFinite(c))||s<=0)return[];const{nice:n,interval:a}=e,[o,r]=i;if(a){const c=Math.abs(a),h=this.getPixelRange();if(!z7((r-o)/c,h))return dB(o,r,c)}let l;if(n&&this.hasNiceRange()){const c=super.niceDomain(e,i);l=PN.getNiceStepAndTickCount(e,c).step}else l=Dk.getTickStep(o,r,e);return dB(o,r,l)}hasNiceRange(){const e=this.range.slice().sort((s,n)=>s-n);return[Math.PI,2*Math.PI].some(s=>F7(s,e[1]-e[0]))}niceDomain(e,i=this.domain){const s=super.niceDomain(e,i);if(!this.hasNiceRange())return s;const n=s[0]>s[1],a=n?s[1]:s[0],{step:o,count:r}=PN.getNiceStepAndTickCount(e,s),l=1/o,c=o>=1?Math.ceil(a/o+r)*o:Math.ceil((a+r*o)*l)/l;return n?[c,a]:[a,c]}getPixelRange(){return this.arcLength}},{AND:pB,Default:gB,GREATER_THAN:V7,LESS_THAN:G7,NUMBER_OR_NAN:fB,OBJECT:W7,Validate:kk,angleBetween:U7,isNumberEqual:yB,normalisedExtentWithMetadata:H7,findMinMax:Y7}=P7._ModuleSupport,kd=class extends Mf{constructor(t){super(t,new j7),this.shape="circle",this.min=NaN,this.max=NaN,this.interval=new fk}normaliseDataDomain(t){const{min:e,max:i}=this,{extent:s,clipped:n}=H7(t,e,i);return{domain:s,clipped:n}}updateScale(){super.updateScale(),this.scale.arcLength=this.getRangeArcLength()}getRangeArcLength(){const{range:t}=this,e=Math.min(...t),i=Math.max(...t),s=U7(e,i)||2*Math.PI,n=this.gridLength;return s*n}generateAngleTicks(t){const{scale:e,range:i,nice:s}=this,{values:n,step:a,minSpacing:o,maxSpacing:r}=this.interval;let l;if(n==null){const{arcLength:c}=e,h=r?Math.floor(c/r):1,u=o?Math.floor(c/o):1/0,d=Math.floor(4/Math.PI*Math.abs(i[0]-i[1])),p=Math.max(h,Math.min(u,d)),g={nice:s,interval:a,tickCount:p,minTickCount:h,maxTickCount:u};l=e.ticks(g,t)}else{const[c,h]=Y7(t.map(Number));l=n.filter(u=>u>=c&&u<=h).sort((u,d)=>u-d)}return l.map(c=>({value:c,visible:!0}))}avoidLabelCollisions(t){let{minSpacing:e}=this.label;Number.isFinite(e)||(e=0);const i=(a,o)=>{if(a.hidden||o.hidden)return!1;const r=a.box.clone().grow(e/2),l=o.box.clone().grow(e/2);return r.collidesBBox(l)},s=t[0],n=t.at(-1);s!==n&&yB(s.x,n.x)&&yB(s.y,n.y)&&(n.hidden=!0);for(let a=1;a{l%a>0&&(r.hidden=!0,r.box=void 0)});return}}t.forEach((a,o)=>{o>0&&(a.hidden=!0,a.box=void 0)})}};kd.className="AngleNumberAxis",kd.type="angle-number",y([kk(pB(fB,G7("max"))),gB(NaN)],kd.prototype,"min",2),y([kk(pB(fB,V7("min"))),gB(NaN)],kd.prototype,"max",2),y([kk(W7)],kd.prototype,"interval",2);var K7={type:"axis",optionsKey:"axes[]",packageType:"enterprise",chartTypes:["polar"],identifier:"angle-number",moduleFactory:t=>new kd(t)},mB=(R(),E(w)),{OrdinalTimeScale:$7}=mB._ModuleSupport,Lk=class extends mB._ModuleSupport.CategoryAxis{constructor(t){super(t,new $7)}};Lk.className="OrdinalTimeAxis",Lk.type="ordinal-time";var X7={type:"axis",optionsKey:"axes[]",packageType:"enterprise",chartTypes:["cartesian"],identifier:"ordinal-time",moduleFactory:t=>new Lk(t)},Z7=(R(),E(w)),Xb=(R(),E(w)),Tk=(R(),E(w)),{ChartAxisDirection:Q7,Validate:q7,NUMBER:J7,validateCrossLineValues:tQ,clamp:xB,normalizeAngle360:eQ,toRadians:iQ,isNumberEqual:sQ,Group:nQ,Path:aQ,Sector:oQ,RotatableText:rQ}=Tk._ModuleSupport,bB=class extends La{constructor(){super(...arguments),this.positionAngle=void 0}};y([q7(J7,{optional:!0})],bB.prototype,"positionAngle",2);var Ck=class extends Hs{constructor(){super(),this.direction=Q7.Y,this.label=new bB,this.polygonNode=new aQ,this.sectorNode=new oQ,this.crossLineRange=new nQ,this.labelNode=new rQ,this.outerRadius=0,this.innerRadius=0,this.crossLineRange.append(this.polygonNode),this.crossLineRange.append(this.sectorNode),this.labelGroup.append(this.labelNode)}update(t){const{scale:e,type:i,value:s,range:n}=this;if(!e||!i||!tQ(i,s,n,e)){this.rangeGroup.visible=!1,this.lineGroup.visible=!1,this.labelGroup.visible=!1;return}i==="line"&&e instanceof Tk._ModuleSupport.BandScale&&(this.type="range",this.range=[s,s]),this.updateRadii();const{innerRadius:a,outerRadius:o}=this;t&&(t=a>=this.axisInnerRadius&&o<=this.axisOuterRadius),this.rangeGroup.visible=t,this.lineGroup.visible=t,this.labelGroup.visible=t,this.updatePolygonNode(t),this.updateSectorNode(t),this.updateLabelNode(t),this.assignCrossLineGroup(this.type==="range",this.crossLineRange)}updateRadii(){const{range:t,scale:e,type:i,axisInnerRadius:s,axisOuterRadius:n}=this;if(!e)return{innerRadius:0,outerRadius:0};const a=l=>n+s-l;let o,r;if(i==="line")o=a(e.convert(this.value)),r=o;else{const l=Math.abs(e?.bandwidth??0),c=t.map(h=>e.convert(h));o=a(Math.max(...c)),r=a(Math.min(...c))+l}this.outerRadius=o,this.innerRadius=r}drawPolygon(t,e,i){e.forEach((s,n)=>{const a=t*Math.cos(s),o=t*Math.sin(s);n===0?i.path.moveTo(a,o):i.path.lineTo(a,o)}),i.path.closePath()}updatePolygonNode(t){const{gridAngles:e,polygonNode:i,scale:s,shape:n,type:a,innerRadius:o,outerRadius:r}=this;if(!t||n!=="polygon"||!s||!e){i.visible=!1;return}i.visible=!0;const l=this.getPadding();i.path.clear(!0),this.drawPolygon(r-l,e,i);const c=e.slice().reverse(),h=a==="line"?r-l:o+l;this.drawPolygon(h,c,i),this.setSectorNodeProps(i)}updateSectorNode(t){const{axisInnerRadius:e,axisOuterRadius:i,scale:s,sectorNode:n,shape:a,innerRadius:o,outerRadius:r}=this;if(!t||a!=="circle"||!s){n.visible=!1;return}n.visible=!0,n.startAngle=0,n.endAngle=2*Math.PI;const l=this.getPadding(),c=xB(e,o+l,i),h=xB(e,r-l,i);n.innerRadius=Math.min(c,h),n.outerRadius=Math.max(c,h),this.setSectorNodeProps(n)}updateLabelNode(t){const{innerRadius:e,label:i,labelNode:s,scale:n,shape:a,type:o}=this;if(!t||i.enabled===!1||!i.text||!n){s.visible=!1;return}const r=eQ(iQ((i.positionAngle??0)-90)),l=(sQ(r,0)||r>0)&&rthis.getTickLabelProps(b,c));return this.generatedTicks={ticks:d,labels:m},{ticks:p,tickDomain:g,niceDomain:x,primaryTickCount:u,fractionDigits:f,bbox:void 0}}updateSelections(){const{generatedTicks:t}=this;if(!t)return;const{ticks:e,labels:i}=t;this.gridLineGroupSelection.update(this.gridLength?e:[]),this.tickLineGroupSelection.update(e),this.tickLabelGroupSelection.update(i),this.gridPathSelection.update(this.gridLine.enabled?this.prepareGridPathTickData(e):[]),this.gridLineGroupSelection.cleanup(),this.tickLineGroupSelection.cleanup(),this.tickLabelGroupSelection.cleanup(),this.gridPathSelection.cleanup()}updateLabels(){if(!this.label.enabled)return;const t=Xb._ModuleSupport.resetAxisLabelSelectionFn();this.tickLabelGroupSelection.each((e,i)=>{e.fill=i.fill,e.fontFamily=i.fontFamily,e.fontSize=i.fontSize,e.fontStyle=i.fontStyle,e.fontWeight=i.fontWeight,e.text=i.text,e.textBaseline=i.textBaseline,e.textAlign=i.textAlign??"center",e.setProperties(t(e,i))})}updateGridLines(){super.updateGridLines();const{gridLine:{style:t,width:e},shape:i,generatedTicks:s}=this;if(!t||!s)return;const n=t.length,a=(d,p)=>{const{stroke:g,lineDash:f}=t[p%n];d.stroke=g,d.strokeWidth=e,d.lineDash=f,d.fill=void 0},[o,r]=this.gridRange??[0,2*Math.PI],l=dQ(r-o,2*Math.PI),u=i==="circle"?(d,p)=>{const{path:g}=d;g.clear(!0);const f=this.getTickRadius(p);l?(g.moveTo(f,0),g.arc(0,0,f,0,2*Math.PI)):(g.moveTo(f*Math.cos(o),f*Math.sin(o)),g.arc(0,0,f,vB(o),vB(r))),l&&g.closePath()}:(d,p)=>{const{path:g}=d,f=this.gridAngles;if(g.clear(!0),!f||f.length<3)return;const x=this.getTickRadius(p);f.forEach((m,b)=>{const v=x*Math.cos(m),S=x*Math.sin(m);b===0?g.moveTo(v,S):g.lineTo(v,S),f.forEach((A,T)=>{const D=x*Math.cos(A),L=x*Math.sin(A);T===0?g.moveTo(D,L):g.lineTo(D,L)}),g.closePath()}),g.closePath()};this.gridPathSelection.each((d,p,g)=>{a(d,g),u(d,p)})}updateTitle(){const t=r=>r.defaultValue,{title:e,range:i,moduleCtx:{callbackCache:s}}=this,{formatter:n=t}=this.title;e.caption.enabled=e.enabled,e.caption.fontFamily=e.fontFamily,e.caption.fontSize=e.fontSize,e.caption.fontStyle=e.fontStyle,e.caption.fontWeight=e.fontWeight,e.caption.color=e.color,e.caption.wrapping=e.wrapping;let a=!1;const o=e.caption.node;e.enabled&&(a=!0,o.rotation=Math.PI/2,o.x=Math.floor((i[0]+i[1])/2),o.y=-gQ.SMALL_PADDING,o.textAlign="center",o.textBaseline="bottom",o.text=s.call(n,this.getTitleFormatterParams())),o.visible=a}updateCrossLines(){this.crossLines.forEach(t=>{if(t instanceof Ck){const{shape:e,gridAngles:i,range:s,innerRadiusRatio:n}=this,a=s[0];t.shape=e,t.gridAngles=i,t.axisOuterRadius=a,t.axisInnerRadius=a*n}}),super.updateCrossLines()}createLabel(){return new Ok}getTickLabelProps(t,e){const{label:i}=this,{combinedRotation:s,textBaseline:n,textAlign:a}=e,o=this.scale.range,r=t.tickLabel,c=i.getSideFlag()*(this.getTickSize()+i.spacing+this.seriesAreaPadding),h=r!==""&&r!=null;return{...this.getLabelStyles({value:t.tickLabel}),tickId:t.tickId,rotation:s,rotationCenterX:c,translationY:t.translationY,text:r,textAlign:a,textBaseline:n,visible:h,x:c,y:0,range:o}}};Zb.CrossLineConstructor=Ck,y([Nk(SB),cQ(0)],Zb.prototype,"positionAngle",2);var{RATIO:wk,ProxyPropertyOnWrite:MB,Validate:Ek,CategoryScale:IB}=Z7._ModuleSupport,gh=class extends Zb{constructor(t){super(t,new IB),this.shape="circle",this.groupPaddingInner=0,this.paddingInner=0,this.paddingOuter=0}normaliseDataDomain(t){return{domain:t,clipped:!1}}prepareGridPathTickData(t){return t.slice().reverse()}getTickRadius(t){const{scale:e,innerRadiusRatio:i}=this,s=e.range[0],n=s*i;if(IB.is(e)){const a=e.domain,o=a.length-1-a.indexOf(t.tick);return o===0?n:e.inset+e.step*(o-.5)+e.bandwidth/2}else{const a=(s-n)/e.domain.length;return s-t.translationY+n-a/2}}};gh.className="RadiusCategoryAxis",gh.type="radius-category",y([Ek(wk)],gh.prototype,"groupPaddingInner",2),y([MB("scale","paddingInner"),Ek(wk)],gh.prototype,"paddingInner",2),y([MB("scale","paddingOuter"),Ek(wk)],gh.prototype,"paddingOuter",2);var vQ={type:"axis",optionsKey:"axes[]",packageType:"enterprise",chartTypes:["polar"],identifier:"radius-category",moduleFactory:t=>new gh(t)},MQ=(R(),E(w)),{AND:AB,Default:DB,GREATER_THAN:IQ,LESS_THAN:AQ,NUMBER_OR_NAN:kB,Validate:LB,normalisedExtentWithMetadata:DQ,LinearScale:kQ}=MQ._ModuleSupport,If=class extends Zb{constructor(t){super(t,new kQ),this.shape="polygon",this.min=NaN,this.max=NaN}prepareGridPathTickData(t){const{scale:e}=this,i=e.domain[1];return t.filter(({tick:s})=>s!==i).sort((s,n)=>n.tick-s.tick)}getTickRadius(t){const{scale:e}=this,i=e.range[0],s=i*this.innerRadiusRatio;return i-t.translationY+s}normaliseDataDomain(t){const{min:e,max:i}=this,{extent:s,clipped:n}=DQ(t,e,i);return{domain:s,clipped:n}}};If.className="RadiusNumberAxis",If.type="radius-number",y([LB(AB(kB,AQ("max"))),DB(NaN)],If.prototype,"min",2),y([LB(AB(kB,IQ("min"))),DB(NaN)],If.prototype,"max",2);var LQ={type:"axis",optionsKey:"axes[]",packageType:"enterprise",chartTypes:["polar"],identifier:"radius-number",moduleFactory:t=>new If(t)},TQ=(R(),E(w)),CQ=(R(),E(w)),{Chart:NQ}=CQ._ModuleSupport;function OQ(t){return t.type==="sankey"||t.type==="chord"}var Rk=class extends NQ{getChartType(){return"flow-proportion"}async updateData(){await super.updateData();const{nodes:t}=this.getOptions();this.series.forEach(e=>{OQ(e)&&e.setChartNodes(t)})}performLayout(t){const{seriesRoot:e,annotationRoot:i}=this,{layoutBox:s}=t;s.shrink(this.seriesArea.padding.toJson());const n=s.clone();this.seriesRect=n,this.animationRect=n,e.visible=this.series.some(a=>a.visible);for(const a of[e,i])a.translationX=Math.floor(n.x),a.translationY=Math.floor(n.y);this.ctx.layoutManager.emitLayoutComplete(t,{series:{visible:e.visible,rect:n,paddedRect:n}})}};Rk.className="FlowProportionChart",Rk.type="flow-proportion";var{isAgFlowProportionChartOptions:wQ}=TQ._ModuleSupport,EQ={type:"chart",name:"flow-proportion",detect:wQ,create(t,e){return new Rk(t,e)}},RQ=(R(),E(w)),_Q=(R(),E(w)),Gt={};qP(Gt,{error:()=>CB,errorOnce:()=>FQ,log:()=>PQ,logGroup:()=>VQ,reset:()=>jQ,table:()=>BQ,warn:()=>TB,warnOnce:()=>zQ});var Af=new Set;function PQ(...t){console.log(...t)}function TB(t,...e){console.warn(`AG Charts - ${t}`,...e)}function CB(t,...e){typeof t=="object"?console.error("AG Charts error",t,...e):console.error(`AG Charts - ${t}`,...e)}function BQ(...t){console.table(...t)}function zQ(t,...e){const i=`Logger.warn: ${t}`;Af.has(i)||(TB(t,...e),Af.add(i))}function FQ(t,...e){const i=`Logger.error: ${t}`;Af.has(i)||(CB(t,...e),Af.add(i))}function jQ(){Af.clear()}function VQ(t,e){console.groupCollapsed(t);try{return e()}finally{console.groupEnd()}}function GQ(t){return Array.from(new Set(t))}function NB(t,e,i){if(t>e)return;let s;for(;e>=t;){const n=Math.floor((e+t)/2),a=i(n);a==null?e=n-1:(s=a,t=n+1)}return s}function WQ(t,e=0,i){const{leading:s=!1,trailing:n=!0,maxWait:a=1/0}=i??{};let o,r;if(ar=null,e),t(...c);return}let h=e;if(a!==1/0&&r){const u=Date.now()-r;e>a-u&&(h=a-u)}clearTimeout(o),r??(r=Date.now()),o=setTimeout(()=>{r=null,n&&t(...c)},h)}return Object.assign(l,{cancel(){clearTimeout(o),r=null}})}function*UQ(...t){for(const e of t)yield*e}function Fi(t){return t!=null}function HQ(t){return Array.isArray(t)}function Df(t){return t instanceof Date}function _k(t){return Df(t)&&!isNaN(Number(t))}function Ye(t){return typeof t=="object"&&t!==null&&!HQ(t)}function YQ(t){return typeof t=="string"}function Ke(t){return typeof t=="number"}function kl(t){return Number.isFinite(t)}var{CartesianAxis:OB,Chart:KQ,ChartAxisDirection:kf,LinearScale:$Q,PolarAxis:XQ,isBetweenAngles:Qb,normalizeAngle360Inclusive:ZQ,sectorBox:QQ}=_Q._ModuleSupport;function qQ(t){return t.type==="radial-gauge"}function JQ(t){return t.type==="linear-gauge"}var Pk=class extends KQ{getChartType(){return"gauge"}updateRadialGauge(t,e){const i=this.axes.find(C=>C.direction===kf.X);if(!(i instanceof XQ))return;i.computeRange();const s=t.x,n=s+t.width,a=t.y,o=a+t.height,[r,l]=i.range,h=ZQ(l-r)>Math.PI,u=h||Qb(1.5*Math.PI,r,l),d=h||Qb(0*Math.PI,r,l),p=h||Qb(.5*Math.PI,r,l),g=h||Qb(1*Math.PI,r,l);let f;g&&!d?f="right":!g&&d?f="left":f="center";let x;u&&!p?x="bottom":!u&&p?x="top":x="middle";const m=QQ({startAngle:r,endAngle:l,innerRadius:0,outerRadius:.5}),b=-(m.x+m.width/2)*2,v=-(m.y+m.height/2)*2,{minimumRadius:S=0,maximumRadius:A}=e,T=Math.max(.5*Math.min(t.width/m.width,t.height/m.height),0);let D=Math.min(A??1/0,Math.max(T,S??0));const L=8;for(let C=0;C0)D=Math.max(D-j,S);else break}i.translation.x=t.x+t.width/2+b*D,i.translation.y=t.y+t.height/2+v*D,e.centerX=t.width/2+b*D,e.centerY=t.height/2+v*D,e.radius=D,e.textAlign=f,e.verticalAlign=x,(D===0||D>T)&&Gt.warnOnce("There was insufficient space to display the Radial Gauge.")}updateLinearGauge(t,e){const i=this.axes.find(m=>m.direction===kf.X),s=this.axes.find(m=>m.direction===kf.Y);if(!(i instanceof OB)||!(s instanceof OB))return t;const{horizontal:n,thickness:a}=e;let o=0,r=0;const l=new $Q,c=n?i:s;l.domain=[0,100],l.range=c.range;const h=l.ticks({nice:c.nice,interval:void 0,tickCount:void 0,minTickCount:0,maxTickCount:1/0});n?o=e.computeInset(kf.X,h):r=e.computeInset(kf.Y,h);const u=t.width-Math.abs(o),d=t.height-Math.abs(r),{width:p,height:g}=n?{width:Math.max(u,0),height:Math.max(Math.min(d,a),0)}:{width:Math.max(Math.min(u,a),0),height:Math.max(d,0)},f=t.x+(u-p)/2+Math.max(o,0),x=t.y+(d-g)/2-Math.min(r,0);i.range=[0,p],i.gridLength=p,i.calculateLayout(),i.translation.x=f,i.translation.y=x+(i.position==="bottom"?a:0),s.range=[0,g],s.gridLength=g,s.calculateLayout(),s.translation.x=f+(s.position==="right"?a:0),s.translation.y=x,e.originX=f-t.x,e.originY=x-t.y,(p===0||g===0)&&Gt.warnOnce("There was insufficient space to display the Linear Gauge.")}performLayout(t){const{seriesRoot:e,annotationRoot:i,series:s,seriesArea:n}=this,{layoutBox:a}=t,o=a.clone();a.shrink(n.padding.toJson());const r=this.series[0];qQ(r)?this.updateRadialGauge(a,r):JQ(r)&&this.updateLinearGauge(a,r),this.axes.forEach(l=>l.update()),this.seriesRect=o.clone().translate(o.x-a.x,o.y-a.y),this.animationRect=a,e.visible=s.some(l=>l.visible);for(const l of[e,i])l.translationX=Math.floor(a.x),l.translationY=Math.floor(a.y);this.ctx.layoutManager.emitLayoutComplete(t,{series:{visible:e.visible,rect:o,paddedRect:a}})}getAriaLabel(){const t=[],e=this.getCaptionText();e.length!==0&&t.push(e);for(const s of this.series)t.push(s.getCaptionText());const i=t.join(". ");return this.ctx.localeManager.t("ariaAnnounceGaugeChart",{caption:i})}};Pk.className="GaugeChart",Pk.type="gauge";var{isAgGaugeChartOptions:tq}=RQ._ModuleSupport,eq={type:"chart",name:"gauge",detect:tq,create(t,e){return new Pk(t,e)}},iq=(R(),E(w)),sq=(R(),E(w)),{Chart:nq}=sq._ModuleSupport,Bk=class extends nq{getChartType(){return"hierarchy"}performLayout(t){const{seriesRoot:e,annotationRoot:i}=this,{layoutBox:s}=t;s.shrink(this.seriesArea.padding.toJson());const n=s.clone();this.seriesRect=n,this.animationRect=n;for(const a of[e,i])a.translationX=Math.floor(n.x),a.translationY=Math.floor(n.y);e.visible=this.series[0].visible,e.setClipRect(n.clone()),this.ctx.layoutManager.emitLayoutComplete(t,{series:{visible:!0,rect:n,paddedRect:n}})}getAriaLabel(){const t=this.getCaptionText();return this.ctx.localeManager.t("ariaAnnounceHierarchyChart",{caption:t})}};Bk.className="HierarchyChart",Bk.type="hierarchy";var{isAgHierarchyChartOptions:aq}=iq._ModuleSupport,oq={type:"chart",name:"hierarchy",detect:aq,create(t,e){return new Bk(t,e)}},rq=(R(),E(w)),lq=(R(),E(w)),{Chart:cq}=lq._ModuleSupport,zk=class extends cq{getChartType(){return"standalone"}performLayout(t){const{seriesRoot:e,annotationRoot:i}=this,{layoutBox:s}=t;s.shrink(this.seriesArea.padding.toJson());const n=s.clone();this.seriesRect=n,this.animationRect=n;for(const a of[e,i])a.translationX=Math.floor(s.x),a.translationY=Math.floor(s.y);e.visible=this.series[0].visible,this.ctx.layoutManager.emitLayoutComplete(t,{series:{visible:!0,rect:n,paddedRect:s}})}getAriaLabel(){const t=this.getCaptionText();return this.ctx.localeManager.t("ariaAnnounceHierarchyChart",{caption:t})}};zk.className="StandaloneChart",zk.type="standalone";var{isAgStandaloneChartOptions:hq}=rq._ModuleSupport,uq={type:"chart",name:"standalone",detect:hq,create(t,e){return new zk(t,e)}},dq=(R(),E(w)),pq=(R(),E(w)),{Chart:gq,MercatorScale:wB,NumberAxis:EB}=pq._ModuleSupport;function RB(t){return t.type==="map-shape"||t.type==="map-line"||t.type==="map-marker"||t.type==="map-shape-background"||t.type==="map-line-background"}var Fk=class extends gq{constructor(t,e){super(t,e),this.xAxis=new EB(this.getModuleContext()),this.xAxis.position="bottom",this.yAxis=new EB(this.getModuleContext()),this.yAxis.position="left",this.ctx.zoomManager.updateAxes([this.xAxis,this.yAxis])}getChartType(){return"topology"}async updateData(){await super.updateData();const{topology:t}=this.getOptions();this.series.forEach(e=>{RB(e)&&e.setChartTopology(t)})}performLayout(t){const{seriesRoot:e,annotationRoot:i}=this,{layoutBox:s}=t;s.shrink(this.seriesArea.padding.toJson());const n=s.clone();this.seriesRect=n,this.animationRect=n;const a=this.series.filter(RB),o=a.reduce((c,h)=>{if(!h.visible)return c;const u=h.topologyBounds;return u==null?c:c==null?u:(c.merge(u),c)},void 0);let r;if(o!=null){const{lon0:c,lat0:h,lon1:u,lat1:d}=o,p=[[c,h],[u,d]],g=wB.bounds(p),{width:f,height:x}=n,m=Math.min(f/g.width,x/g.height),b=g.width*m,v=g.height*m,S=(f-b)/2,A=(x-v)/2,T=S,D=A,L=S+b,C=A+v,O=this.ctx.zoomManager.getAxisZoom(this.xAxis.id),_=this.ctx.zoomManager.getAxisZoom(this.yAxis.id),N=(L-T)/(O.max-O.min),P=T-N*O.min,j=(C-D)/(1-_.min-(1-_.max)),F=D-j*(1-_.max);r=new wB(p,[[P,F],[P+N,F+j]])}a.forEach(c=>{c.scale=r});const l=this.series.some(c=>c.visible);e.visible=l;for(const c of[e,i])c.translationX=Math.floor(n.x),c.translationY=Math.floor(n.y),c.setClipRect(n.clone());this.ctx.layoutManager.emitLayoutComplete(t,{series:{visible:l,rect:n,paddedRect:n}})}};Fk.className="TopologyChart",Fk.type="topology";var{isAgTopologyChartOptions:fq}=dq._ModuleSupport,yq={type:"chart",name:"topology",detect:fq,create(t,e){return new Fk(t,e)}},_B=(R(),E(w)),{BOOLEAN:mq,POSITIVE_NUMBER:xq,ObserveChanges:PB,Validate:BB}=_B._ModuleSupport,jk=class extends _B._ModuleSupport.BaseModuleInstance{constructor(t){super(),this.ctx=t,this.enabled=!0,t.animationManager.skip(!1)}};y([PB((t,e)=>{t.ctx.animationManager.skip(!e)}),BB(mq)],jk.prototype,"enabled",2),y([PB((t,e)=>{t.ctx.animationManager.defaultDuration=e}),BB(xq,{optional:!0})],jk.prototype,"duration",2);var bq={type:"root",optionsKey:"animation",packageType:"enterprise",chartTypes:["cartesian","polar","hierarchy","topology","flow-proportion","standalone","gauge"],moduleFactory:t=>new jk(t),themeTemplate:{animation:{enabled:!0}}},qb=(R(),E(w)),Jb=(R(),E(w)),Sq='
',{focusCursorAtEnd:vq}=Jb._ModuleSupport,zB="text-input",FB="canvas-overlay",Mq=class extends Jb._ModuleSupport.BaseModuleInstance{constructor(t){super(),this.ctx=t,this.layout={getTextInputCoords:()=>({x:0,y:0}),getTextPosition:()=>"center",alignment:"center",textAlign:"center"},this.visible=!1,this.element=t.domManager.addChild(FB,zB),this.element.classList.add("ag-charts-text-input"),this.destroyFns.push(()=>t.domManager.removeChild(FB,zB))}setKeyDownHandler(t){this.element.addEventListener("keydown",t),this.destroyFns.push(()=>this.element.removeEventListener("keydown",t))}show(t){this.element.innerHTML=Sq;const e=this.element.firstElementChild;Jb._ModuleSupport.setAttribute(e,"data-preventdefault",!1),e.isContentEditable||(e.contentEditable="true"),e.setAttribute("placeholder",this.ctx.localeManager.t(t.placeholderText??"inputTextareaPlaceholder")),t.styles?.placeholderColor&&e.style.setProperty("--placeholder-text-color",t.styles?.placeholderColor),e.innerText=t.text??"",e.style.color=t.styles?.color??"inherit",e.style.fontFamily=t.styles?.fontFamily??"inherit",e.style.fontSize=t.styles?.fontSize?`${t.styles.fontSize}px`:"inherit",e.style.fontStyle=t.styles?.fontStyle??"inherit",e.style.fontWeight=typeof t.styles?.fontWeight=="number"?`${t.styles.fontWeight}`:t.styles?.fontWeight??"inherit",vq(e),e.addEventListener("input",()=>{this.updatePosition(),t.onChange?.(this.getValue(),this.getBBox())}),e.addEventListener("click",i=>{i.stopPropagation()}),t.layout&&(this.layout=t.layout,this.updatePosition()),t.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(t){this.element.firstElementChild&&(this.element.firstElementChild.style.color=t)}updateFontSize(t){if(this.element.firstElementChild)return this.element.firstElementChild.style.fontSize=`${t}px`,this.updatePosition(),this.getBBox()}getValue(){if(this.element.firstElementChild)return this.element.firstElementChild.innerText.trim()}updatePosition(){const{element:t}=this,e=t.firstElementChild;if(!e)return;const i=this.ctx.domManager.getBoundingClientRect(),{width:s,getTextInputCoords:n,getTextPosition:a,alignment:o,textAlign:r}=this.layout;t.style.setProperty("width",s?`${s}px`:"unset");const l=e.getBoundingClientRect(),c=n(l.height);let h=c.x;o==="center"?h-=(s??l.width)/2:o==="right"&&(h-=s??l.width);const u=a();let d=c.y;u==="center"?d-=l.height/2:u==="bottom"&&(d-=l.height),t.style.setProperty("top",`${d}px`),t.style.setProperty("left",`${h}px`),t.style.setProperty("max-width",`${i.width-h}px`),t.style.setProperty("text-align",o),e.style.setProperty("text-align",r)}getBBox(){const{left:t,top:e,width:i,height:s}=this.element.getBoundingClientRect();return new Jb._ModuleSupport.BBox(t,e,i,s)}},Iq=(R(),E(w)),{BOOLEAN:Aq,BaseProperties:Dq,Validate:jB,UNION:kq}=Iq._ModuleSupport,Lq=kq(["x","y","xy"],"an axis type"),Vk=class extends Dq{constructor(){super(...arguments),this.enabled=!1,this.axes="y"}};y([jB(Aq)],Vk.prototype,"enabled",2),y([jB(Lq,{optional:!0})],Vk.prototype,"axes",2);var Tq=(R(),E(w)),Gk=(t=>(t.Line="line",t.HorizontalLine="horizontal-line",t.VerticalLine="vertical-line",t.DisjointChannel="disjoint-channel",t.ParallelChannel="parallel-channel",t.FibonacciRetracement="fibonacci-retracement",t.FibonacciRetracementTrendBased="fibonacci-retracement-trend-based",t.Callout="callout",t.Comment="comment",t.Note="note",t.Text="text",t.Arrow="arrow",t.ArrowUp="arrow-up",t.ArrowDown="arrow-down",t.DateRange="date-range",t.PriceRange="price-range",t.DatePriceRange="date-price-range",t.QuickDatePriceRange="quick-date-price-range",t))(Gk||{}),Cq=Object.values(Gk);function Nq(t){for(const e of Cq)if(e===t)return e}var Oq=(R(),E(w)),wq=(R(),E(w)),{BOOLEAN:Lf,COLOR_STRING:Wk,DATE:Tf,FONT_STYLE:Eq,FONT_WEIGHT:Rq,FUNCTION:_q,LINE_DASH:Pq,LINE_STYLE:Bq,NUMBER:fh,OBJECT:Cf,OR:Nf,POSITIVE_NUMBER:Uk,RATIO:VB,STRING:Ll,TEXT_ALIGN:zq,UNION:tS,BaseProperties:Tl,Validate:Et,predicateWithMessage:Fq,generateUUID:jq}=wq._ModuleSupport,Vq=["value","groupPercentage"],Of=Fq(t=>Ye(t)&&Object.keys(t).every(e=>Vq.includes(e)),"objects with grouping value properties such as 'value' or 'groupPercentage'"),wf=class extends Tl{};y([Et(Nf(Ll,fh,Tf,Of))],wf.prototype,"x",2),y([Et(Nf(Ll,fh,Tf,Of))],wf.prototype,"y",2);var Gq=class extends ds(Sr(HB(Tl))){},Hk=class extends ds(Sr(vo($k(xh(Tl))))){constructor(){super(...arguments),this.cornerRadius=2}};y([Et(Lf)],Hk.prototype,"enabled",2),y([Et(Uk)],Hk.prototype,"cornerRadius",2);var Wq=class extends vo(Tl){},Uq=class extends ds(Sr(vo(Tl))){},yh=class extends xh(Tl){constructor(){super(...arguments),this.label="",this.position="top",this.alignment="left"}};y([Et(Ll)],yh.prototype,"label",2),y([Et(tS(["top","center","bottom"]),{optional:!0})],yh.prototype,"position",2),y([Et(tS(["left","center","right"]),{optional:!0})],yh.prototype,"alignment",2);var Hq=class extends xh(Tl){},Ef=class extends xh(Tl){constructor(){super(...arguments),this.label=""}};y([Et(Ll)],Ef.prototype,"label",2),y([Et(tS(["top","inside","bottom"]),{optional:!0})],Ef.prototype,"position",2),y([Et(tS(["left","center","right"]),{optional:!0})],Ef.prototype,"alignment",2);function mh(t){class e extends Kq(HB(t)){constructor(){super(...arguments),this.id=jq()}isValidWithContext(s,n){return super.isValid(n)}}return e}function Yk(t){class e extends t{constructor(){super(...arguments),this.start=new wf,this.end=new wf}}return y([Et(Cf)],e.prototype,"start",2),y([Et(Cf)],e.prototype,"end",2),e}function GB(t){class e extends t{}return y([Et(Nf(Ll,fh,Tf,Of))],e.prototype,"x",2),y([Et(Nf(Ll,fh,Tf,Of))],e.prototype,"y",2),e}function WB(t){class e extends t{}return y([Et(Nf(Ll,fh,Tf,Of))],e.prototype,"value",2),e}function Kk(t){class e extends t{constructor(){super(...arguments),this.background=new Wq}}return y([Et(Cf,{optional:!0})],e.prototype,"background",2),e}function Cl(t){class e extends t{constructor(){super(...arguments),this.handle=new Uq}}return y([Et(Cf,{optional:!0})],e.prototype,"handle",2),e}function UB(t){class e extends t{constructor(){super(...arguments),this.axisLabel=new Hk}}return y([Et(Cf,{optional:!0})],e.prototype,"axisLabel",2),e}function $k(t){class e extends t{constructor(){super(...arguments),this.padding=void 0,this.textAlign="center",this.formatter=void 0}}return y([Et(Uk,{optional:!0})],e.prototype,"padding",2),y([Et(zq,{optional:!0})],e.prototype,"textAlign",2),y([Et(_q,{optional:!0})],e.prototype,"formatter",2),e}function Yq(t){class e extends t{}return e}function Xk(t){class e extends t{}return y([Et(Lf,{optional:!0})],e.prototype,"extendStart",2),y([Et(Lf,{optional:!0})],e.prototype,"extendEnd",2),e}function Kq(t){class e extends t{}return y([Et(Lf,{optional:!0})],e.prototype,"locked",2),e}function Zk(t){class e extends t{setLocaleManager(s){this.localeManager??(this.localeManager=s)}}return e}function HB(t){class e extends t{}return y([Et(Lf,{optional:!0})],e.prototype,"visible",2),e}function vo(t){class e extends t{}return y([Et(Wk,{optional:!0})],e.prototype,"fill",2),y([Et(VB,{optional:!0})],e.prototype,"fillOpacity",2),e}function ds(t){class e extends t{}return y([Et(Wk,{optional:!0})],e.prototype,"stroke",2),y([Et(VB,{optional:!0})],e.prototype,"strokeOpacity",2),y([Et(fh,{optional:!0})],e.prototype,"strokeWidth",2),e}function Sr(t){class e extends t{constructor(){super(...arguments),this.lineCap=void 0,this.computedLineDash=void 0}}return y([Et(Pq,{optional:!0})],e.prototype,"lineDash",2),y([Et(fh,{optional:!0})],e.prototype,"lineDashOffset",2),y([Et(Bq,{optional:!0})],e.prototype,"lineStyle",2),e}function xh(t){class e extends t{constructor(){super(...arguments),this.fontSize=12,this.fontFamily="Verdana, sans-serif"}}return y([Et(Eq,{optional:!0})],e.prototype,"fontStyle",2),y([Et(Rq,{optional:!0})],e.prototype,"fontWeight",2),y([Et(Uk)],e.prototype,"fontSize",2),y([Et(Ll)],e.prototype,"fontFamily",2),y([Et(Wk,{optional:!0})],e.prototype,"color",2),e}var $q=(R(),E(w)),Xq=(R(),E(w));function fe(t){return Ke(t)||YQ(t)||Df(t)?{value:t,groupPercentage:0}:t??{value:void 0,groupPercentage:0}}var{clampArray:Zq}=Xq._ModuleSupport;function Ta(t,e){if(t.start==null||t.end==null)return;const i=Le(t.start,e),s=Le(t.end,e);if(!(i==null||s==null))return{x1:i.x,y1:i.y,x2:s.x,y2:s.y}}function Le(t,e){const i=Nl(t.x,e.xAxis),s=Nl(t.y,e.yAxis);return{x:i,y:s}}function Nl(t,e){if(t==null)return 0;const{value:i,groupPercentage:s}=fe(t),{scale:n,snapToGroup:a}=e,o=n.bandwidth===0?n.step??0:n.bandwidth??0,r=a?o/2:o*s;return n.convert(i)+r}function ye(t,e){const i=Rf(t.x,e.xAxis),s=Rf(t.y,e.yAxis);return{x:i,y:s}}function Rf(t,e){const{scale:i}=e;if(e.continuous&&i.step==null)return e.scaleInvert(t);const s=e.scaleInvertNearest(t),n=i.bandwidth===0?i.step:i.bandwidth??0,a=i.convert(s),o=a+n,r=Zq(t,i.range),l=a===o?0:(r-a)/(o-a);return{value:s,groupPercentage:l}}var Qq=(R(),E(w)),{BaseProperties:qq}=Qq._ModuleSupport,Qk=class extends mh(Yk(Cl(qq))){constructor(){super(...arguments),this.snapToAngle=45}isValidWithContext(t,e){return super.isValid(e)}getDefaultColor(t){}getDefaultOpacity(t){}},{STRING:Jq,Validate:tJ}=$q._ModuleSupport,YB=class extends Zk($k(xh(Qk))){constructor(){super(...arguments),this.text="",this.position="top",this.alignment="left",this.placement="inside",this.placeholderText="inputTextareaPlaceholder"}isValidWithContext(t,e){return super.isValid(e)}getDefaultColor(t){return this.color}getDefaultOpacity(t){}getPlaceholderColor(){}getPadding(){const{padding:t=0}=this;return{top:t,right:t,bottom:t,left:t}}getText(){const t=this.text.length==0;let e=this.text;return t&&(e=this.placeholderText??"",this.localeManager&&(e=this.localeManager.t(e))),{text:e,isPlaceholder:t}}getTextInputCoords(t,e){return Le(this.end,t)}getTextPosition(){return this.position}};y([tJ(Jq)],YB.prototype,"text",2);var{STRING:eJ,Validate:iJ,Color:KB}=Oq._ModuleSupport,sJ={top:6,right:12,bottom:9,left:12},Ca=class extends vo(ds(YB)){constructor(){super(...arguments),this.type="callout",this.position="bottom",this.alignment="left"}static is(t){return Ye(t)&&t.type==="callout"}getDefaultColor(t){switch(t){case"fill-color":return this.fill;case"line-color":return this.stroke;case"text-color":default:return this.color}}getDefaultOpacity(t){switch(t){case"fill-color":return this.fillOpacity;case"line-color":return this.strokeOpacity;case"text-color":default:return}}getPlaceholderColor(){const{r:t,g:e,b:i}=KB.fromString(this.color??"#888888");return new KB(t,e,i,.66).toString()}getPadding(){const{padding:t}=this;return t==null?{...sJ}:{top:t,right:t,bottom:t,left:t}}getTextInputCoords(t,e){const i=super.getTextInputCoords(t,e),s=this.getPadding(),n=s.left??0,a=s.bottom??0;return{x:i.x+n,y:i.y-a}}};y([iJ(eJ)],Ca.prototype,"type",2);var nJ=(R(),E(w)),aJ=(R(),E(w)),{STRING:oJ,BaseProperties:rJ,Validate:lJ}=aJ._ModuleSupport,eS=class extends mh(GB(Cl($k(xh(rJ))))){constructor(){super(...arguments),this.text="",this.position="top",this.alignment="left",this.placement="inside",this.placeholderText="inputTextareaPlaceholder"}isValidWithContext(t,e){return super.isValid(e)}getDefaultColor(t){return this.color}getDefaultOpacity(t){}getPlaceholderColor(){}getPadding(){const{padding:t=0}=this;return{top:t,right:t,bottom:t,left:t}}getText(){const t=this.text.length==0;return{text:t?this.placeholderText??"":this.text,isPlaceholder:t}}getTextInputCoords(t,e){return Le(this,t)}getTextPosition(){return this.position}};y([lJ(oJ)],eS.prototype,"text",2);var{STRING:cJ,Validate:hJ,Color:$B}=nJ._ModuleSupport,iS={top:8,right:14,bottom:8,left:14},Mo=class extends vo(ds(eS)){constructor(){super(...arguments),this.type="comment",this.position="bottom",this.alignment="left"}static is(t){return Ye(t)&&t.type==="comment"}getDefaultColor(t){switch(t){case"fill-color":return this.fill;case"line-color":return this.stroke;case"text-color":default:return this.color}}getDefaultOpacity(t){switch(t){case"fill-color":return this.fillOpacity;case"line-color":return this.strokeOpacity;case"text-color":default:return}}getPlaceholderColor(){const{r:t,g:e,b:i}=$B.fromString(this.color??"#888888");return new $B(t,e,i,.66).toString()}getPadding(){const{padding:t,fontSize:e}=this;return t==null?{top:Math.max(e*.4,iS.top),bottom:Math.max(e*.4,iS.bottom),left:Math.max(e*.8,iS.left),right:Math.max(e*.8,iS.right)}:{top:t,right:t,bottom:t,left:t}}getTextInputCoords(t,e){const i=super.getTextInputCoords(t,e),s=this.getPadding();return{x:i.x+s.left,y:i.y-s.bottom}}};y([hJ(cJ)],Mo.prototype,"type",2);var uJ=(R(),E(w)),dJ=(R(),E(w)),{Vec2:bh}=dJ._ModuleSupport;function _f(t,e){return t?"dashed":e??"solid"}function XB(t,e){switch(e){case"solid":return[];case"dashed":return[t*4,t*2];case"dotted":return[0,t*2]}}function Ld(t,e,i,s){const n=_f(t,i);return e??t??XB(s??1,n)}function Td(t,e,i){const s=_f(e,i);return t??s==="dotted"?"round":void 0}function pJ(t,e){const[i,s]=bh.from(t),n=e.height,a=bh.gradient(s,i,n),o=bh.intercept(s,a,n),r=[{x:i.x,y:n??0},{x:i.x,y:n==null?e.height:n-e.height}];if(a===1/0)return r;let l=[bh.intersectAtY(a,o,0,n),bh.intersectAtY(a,o,e.height,n),bh.intersectAtX(a,o,0,n),bh.intersectAtX(a,o,e.width,n)];return l=l.filter(c=>c.x>=e.x&&c.x<=e.width&&c.y>=e.y&&c.y<=e.height).sort((c,h)=>c.x===h.x?0:c.x{},this.text=new yh}getDefaultColor(t){switch(t){case"fill-color":return this.background.fill;case"line-color":return this.stroke;case"text-color":return this.text.color}}getDefaultOpacity(t){switch(t){case"fill-color":return this.background.fillOpacity;case"line-color":return this.strokeOpacity}}getLineDash(){return Ld(this.lineDash,this.computedLineDash,this.lineStyle,this.strokeWidth)}getLineCap(){return Td(this.lineCap,this.lineDash,this.lineStyle)}};y([Ys(Cd,{optional:!0})],Nd.prototype,"statistics",2),y([Ys(Cd,{optional:!0})],Nd.prototype,"text",2);function eL(t){class e extends t{constructor(){super(...arguments),this.hasDateRange=!0}}return e}function iL(t){class e extends t{constructor(){super(...arguments),this.hasPriceRange=!0}}return e}var Kn=class extends eL(Nd){constructor(){super(...arguments),this.type="date-range",this.direction="horizontal"}static is(t){return Ye(t)&&t.type==="date-range"}};y([Ys(nS)],Kn.prototype,"type",2),y([Ys(sS,{optional:!0})],Kn.prototype,"extendAbove",2),y([Ys(sS,{optional:!0})],Kn.prototype,"extendBelow",2);var $n=class extends iL(Nd){constructor(){super(...arguments),this.type="price-range",this.direction="vertical"}static is(t){return Ye(t)&&t.type==="price-range"}};y([Ys(nS)],$n.prototype,"type",2),y([Ys(sS,{optional:!0})],$n.prototype,"extendLeft",2),y([Ys(sS,{optional:!0})],$n.prototype,"extendRight",2);var vr=class extends eL(iL(Nd)){constructor(){super(...arguments),this.type="date-price-range",this.direction="both"}static is(t){return Ye(t)&&t.type==="date-price-range"}};y([Ys(nS)],vr.prototype,"type",2);var Sn=class extends eL(iL(Nd)){constructor(){super(...arguments),this.type="quick-date-price-range",this.up=new tL,this.down=new tL,this.direction="both"}static is(t){return Ye(t)&&t.type==="quick-date-price-range"}};y([Ys(nS)],Sn.prototype,"type",2),y([Ys(Cd,{optional:!0})],Sn.prototype,"up",2),y([Ys(Cd,{optional:!0})],Sn.prototype,"down",2);var fJ=(R(),E(w)),yJ=(R(),E(w)),{TextWrapper:mJ,CachedTextMeasurerPool:xJ,BBox:bJ}=yJ._ModuleSupport,aS=1.38;function ZB(t){return{font:{fontFamily:t.fontFamily,fontSize:t.fontSize,fontStyle:t.fontStyle,fontWeight:t.fontWeight},textAlign:t.textAlign,textBaseline:t.position=="center"?"middle":t.position,lineHeight:aS,avoidOrphans:!1,textWrap:"always"}}function oS(t,e,i){return i?mJ.wrapText(e,{...ZB(t),maxWidth:i}):e}function SJ(t,e){const i=ZB(t),{lineMetrics:s,width:n}=xJ.measureLines(e,i),a=s.length*(t.fontSize??14)*aS;return{width:n,height:a}}function sL(t,e,i,s){let n=s?.width??0,a=s?.height??0;if(!s){const o=t.width!=null?oS(t,e,t.width):e;({width:n,height:a}=SJ(t,o))}return new bJ(i.x,i.y,n,a)}function QB(t,e,i,s,{x:n,y:a}){const{visible:o=!0,fontFamily:r,fontSize:l=14,fontStyle:c,fontWeight:h,textAlign:u}=s,d=l*aS,p=s.position=="center"?"middle":s.position,g=i?s.getPlaceholderColor():s.color;t.setProperties({x:n,y:a,visible:o,text:e,fill:g,fontFamily:r,fontSize:l,fontStyle:c,fontWeight:h,textAlign:u,lineHeight:d,textBaseline:p})}var{OBJECT:vJ,STRING:MJ,BaseProperties:IJ,Validate:qB,clamp:AJ}=fJ._ModuleSupport,DJ=10,kJ=11,JB=20,LJ=22,TJ=10,tz=JB+TJ,ez=34,CJ=class extends vo(ds(IJ)){},Ks=class extends vo(ds(eS)){constructor(){super(...arguments),this.type="note",this.background=new CJ,this.position="bottom",this.alignment="center",this.width=200}static is(t){return Ye(t)&&t.type==="note"}getDefaultColor(t){switch(t){case"line-color":return this.fill;case"text-color":return this.color}}getDefaultOpacity(t){switch(t){case"line-color":return this.fillOpacity;case"text-color":return}}getPadding(){const t=this.padding??DJ;return{top:t,right:t,bottom:t,left:t}}getTextInputCoords(t,e){const{width:i,text:s}=this,n=super.getTextInputCoords(t,e),a=this.getPadding().top,o=sL(this,s,n);o.x=AJ(i/2,o.x,t.seriesRect.width-i/2);const r=o.y-tz-a*2,l=o.y+kJ+a*2,c=Math.max(o.height,e);return r-c-ez<0?(o.y=l,this.position="top"):(o.y=r+a,this.position="bottom"),{x:o.x,y:o.y}}};y([qB(MJ)],Ks.prototype,"type",2),y([qB(vJ,{optional:!0})],Ks.prototype,"background",2);var NJ=(R(),E(w)),{BaseProperties:OJ}=NJ._ModuleSupport,wJ=class extends mh(GB(Cl(OJ))){isValidWithContext(t,e){return super.isValid(e)}getDefaultColor(t){}getDefaultOpacity(t){}},nL=class o3 extends vo(wJ){constructor(){super(...arguments),this.size=32}static is(e){return e instanceof o3}getDefaultColor(e){return e==="fill-color"?this.fill:void 0}getDefaultOpacity(e){return e==="fill-color"?this.fillOpacity:void 0}},EJ=(R(),E(w)),fbt=(R(),E(w));function Pf(t,e,i,s){let n=!0;return n&&(n=Na(t,e.start,i,s&&`${s}[start] `)),n&&(n=Na(t,e.end,i,s&&`${s}[end] `)),n}function iz(t,e,i){const s=e.direction==="horizontal"?t.yAxis:t.xAxis,n=aL(e.value,s);if(!n&&i){const{value:a}=fe(e.value);Gt.warnOnce(`${i}is outside the axis domain, ignoring. - value: [${a}]]`)}return n}function Na(t,e,i,s){if(e.x==null||e.y==null)return s&&Gt.warnOnce(`${s}requires both an [x] and [y] property, ignoring.`),!1;const n=i?.x===!1?!0:aL(e.x,t.xAxis),a=i?.y===!1?!0:aL(e.y,t.yAxis);if(!n||!a){let o="x & y domains";if(n&&(o="y domain"),a&&(o="x domain"),s){const{value:r}=fe(e.x),{value:l}=fe(e.y);Gt.warnOnce(`${s}is outside the ${o}, ignoring. - x: [${r}], y: ${l}]`)}return!1}return!0}function aL(t,e){const{domain:i}=e.scale,{value:s}=fe(t);return i&&s!=null&&e.continuous?s>=i[0]&&s<=i.at(-1):!0}function RJ(t){return t?.x!=null&&t?.y!=null}var{OBJECT:sz,STRING:nz,BaseProperties:az,Validate:rS}=EJ._ModuleSupport,ps=class extends mh(WB(Cl(UB(ds(Sr(az)))))){constructor(){super(...arguments),this.direction="horizontal",this.type="horizontal-line",this.text=new yh}static is(t){return Ye(t)&&t.type==="horizontal-line"}isValidWithContext(t,e){return super.isValid(e)&&iz(t,this,e)}getDefaultColor(){return this.stroke}getDefaultOpacity(){return this.strokeOpacity}getLineDash(){return Ld(this.lineDash,this.computedLineDash,this.lineStyle,this.strokeWidth)}getLineCap(){return Td(this.lineCap,this.lineDash,this.lineStyle)}};y([rS(nz)],ps.prototype,"type",2),y([rS(sz,{optional:!0})],ps.prototype,"text",2);var Io=class extends mh(WB(Cl(UB(ds(Sr(az)))))){constructor(){super(...arguments),this.direction="vertical",this.type="vertical-line",this.text=new yh}static is(t){return Ye(t)&&t.type==="vertical-line"}isValidWithContext(t,e){return super.isValid(e)&&iz(t,this,e)}getDefaultColor(){return this.stroke}getDefaultOpacity(){return this.strokeOpacity}getLineDash(){return Ld(this.lineDash,this.computedLineDash,this.lineStyle,this.strokeWidth)}getLineCap(){return Td(this.lineCap,this.lineDash,this.lineStyle)}};y([rS(nz)],Io.prototype,"type",2),y([rS(sz,{optional:!0})],Io.prototype,"text",2);var _J=(R(),E(w)),{NUMBER:oz,OBJECT:PJ,STRING:BJ,BaseProperties:zJ,Validate:lS}=_J._ModuleSupport,Xn=class extends mh(Kk(Yk(Cl(Xk(ds(Sr(zJ))))))){constructor(){super(...arguments),this.type="disjoint-channel",this.text=new Ef,this.snapToAngle=45}static is(t){return Ye(t)&&t.type==="disjoint-channel"}get bottom(){const t={start:{x:this.start.x,y:this.start.y},end:{x:this.end.x,y:this.end.y}};return typeof t.start.y=="number"&&typeof t.end.y=="number"?(t.start.y-=this.startHeight,t.end.y-=this.endHeight):Gt.warnOnce(`Annotation [${this.type}] can only be used with a numeric y-axis.`),t}isValidWithContext(t,e){return super.isValid(e)&&Pf(t,this,{y:!1},e)&&Pf(t,this.bottom,{y:!1},e)}getDefaultColor(t){switch(t){case"fill-color":return this.background.fill;case"line-color":return this.stroke;case"text-color":return this.text.color}}getDefaultOpacity(t){switch(t){case"fill-color":return this.background.fillOpacity;case"line-color":return this.strokeOpacity}}getLineDash(){return Ld(this.lineDash,this.computedLineDash,this.lineStyle,this.strokeWidth)}getLineCap(){return Td(this.lineCap,this.lineDash,this.lineStyle)}};y([lS(BJ)],Xn.prototype,"type",2),y([lS(oz)],Xn.prototype,"startHeight",2),y([lS(oz)],Xn.prototype,"endHeight",2),y([lS(PJ,{optional:!0})],Xn.prototype,"text",2);var FJ=(R(),E(w)),jJ=(R(),E(w)),VJ=(R(),E(w)),{OBJECT:GJ,STRING:rz,Validate:oL}=VJ._ModuleSupport,cS=class extends Zk(Yq(Xk(ds(Sr(Qk))))){constructor(){super(...arguments),this.text=new yh}isValidWithContext(t,e){return super.isValid(e)&&Pf(t,this,void 0,e)}getDefaultColor(t){switch(t){case"line-color":return this.stroke;case"text-color":return this.text.color}}getDefaultOpacity(){return this.strokeOpacity}getLineDash(){return Ld(this.lineDash,this.computedLineDash,this.lineStyle,this.strokeWidth)}getLineCap(){return Td(this.lineCap,this.lineDash,this.lineStyle)}};y([oL(GJ,{optional:!0})],cS.prototype,"text",2);var Mr=class extends cS{constructor(){super(...arguments),this.type="arrow",this.endCap="arrow"}static is(t){return Ye(t)&&t.type==="arrow"}};y([oL(rz)],Mr.prototype,"type",2);var Ir=class extends cS{constructor(){super(...arguments),this.type="line"}static is(t){return Ye(t)&&t.type==="line"}};y([oL(rz)],Ir.prototype,"type",2);var{OBJECT:WJ,BOOLEAN:rL,COLOR_STRING:UJ,COLOR_STRING_ARRAY:HJ,Validate:Sh,predicateWithMessage:YJ}=jJ._ModuleSupport,KJ=[10,6,4],$J=YJ(t=>kl(t)&&KJ.includes(t),"Number of fibonacci ranges, 10, 6 or 4"),Ar=class extends cS{constructor(){super(...arguments),this.label=new Hq,this.reverse=!1,this.showFill=!0,this.isMultiColor=!0,this.strokes=[],this.bands=10}getDefaultColor(t){switch(t){case"line-color":return this.rangeStroke??this.stroke;case"text-color":return this.text.color}}};y([Sh(WJ,{optional:!0})],Ar.prototype,"label",2),y([Sh(rL,{optional:!0})],Ar.prototype,"reverse",2),y([Sh(rL,{optional:!0})],Ar.prototype,"showFill",2),y([Sh(rL,{optional:!0})],Ar.prototype,"isMultiColor",2),y([Sh(HJ,{optional:!0})],Ar.prototype,"strokes",2),y([Sh(UJ,{optional:!0})],Ar.prototype,"rangeStroke",2),y([Sh($J,{optional:!0})],Ar.prototype,"bands",2);var{STRING:XJ,OBJECT:ZJ,Validate:lz}=FJ._ModuleSupport,Ao=class extends Ar{constructor(){super(...arguments),this.type="fibonacci-retracement-trend-based",this.endRetracement=new wf}static is(t){return Ye(t)&&t.type==="fibonacci-retracement-trend-based"}};y([lz(XJ)],Ao.prototype,"type",2),y([lz(ZJ)],Ao.prototype,"endRetracement",2);var QJ=(R(),E(w)),{STRING:qJ,Validate:JJ}=QJ._ModuleSupport,Dr=class extends Ar{constructor(){super(...arguments),this.type="fibonacci-retracement"}static is(t){return Ye(t)&&t.type==="fibonacci-retracement"}};y([JJ(qJ)],Dr.prototype,"type",2);var ttt=(R(),E(w)),{NUMBER:ett,STRING:itt,OBJECT:cz,BaseProperties:stt,Validate:hS}=ttt._ModuleSupport,Zn=class extends mh(Kk(Yk(Cl(Xk(ds(Sr(stt))))))){constructor(){super(...arguments),this.type="parallel-channel",this.middle=new Gq,this.text=new Ef,this.snapToAngle=45}static is(t){return Ye(t)&&t.type==="parallel-channel"}get bottom(){const t={start:{x:this.start.x,y:this.start.y},end:{x:this.end.x,y:this.end.y}};return typeof t.start.y=="number"&&typeof t.end.y=="number"?(t.start.y-=this.height,t.end.y-=this.height):Gt.warnOnce(`Annotation [${this.type}] can only be used with a numeric y-axis.`),t}isValidWithContext(t,e){return super.isValid(e)&&Pf(t,this,{y:!1},e)&&Pf(t,this.bottom,{y:!1},e)}getDefaultColor(t){switch(t){case"fill-color":return this.background.fill;case"line-color":return this.stroke;case"text-color":return this.text.color}}getDefaultOpacity(t){switch(t){case"fill-color":return this.background.fillOpacity;case"line-color":return this.strokeOpacity}}getLineDash(){return Ld(this.lineDash,this.computedLineDash,this.lineStyle,this.strokeWidth)}getLineCap(){return Td(this.lineCap,this.lineDash,this.lineStyle)}};y([hS(itt)],Zn.prototype,"type",2),y([hS(ett)],Zn.prototype,"height",2),y([hS(cz,{optional:!0})],Zn.prototype,"middle",2),y([hS(cz,{optional:!0})],Zn.prototype,"text",2);var ntt=(R(),E(w)),{STRING:att,Validate:ott}=ntt._ModuleSupport,kr=class extends eS{constructor(){super(...arguments),this.type="text",this.position="bottom"}static is(t){return Ye(t)&&t.type==="text"}};y([ott(att)],kr.prototype,"type",2);function Ol(t){return Sn.is(t)}function uS(t){return Ir.is(t)||ps.is(t)||Io.is(t)||Mr.is(t)||hz(t)}function Lr(t){return Xn.is(t)||Zn.is(t)}function hz(t){return Dr.is(t)||Ao.is(t)}function Do(t){return Ca.is(t)||Mo.is(t)||Ks.is(t)||kr.is(t)}function Bf(t){return Kn.is(t)||$n.is(t)||vr.is(t)||Sn.is(t)}function lL(t){return Do(t)&&!Ks.is(t)}function wl(t){return uS(t)||Lr(t)||Bf(t)&&!Sn.is(t)}function rtt(t){return uS(t)||Lr(t)||Bf(t)||Ca.is(t)||Ks.is(t)}function ltt(t){return Ks.is(t)}function ctt(t){return Lr(t)||Bf(t)||Ca.is(t)||Mo.is(t)||nL.is(t)}function htt(t){return Do(t)&&!Ks.is(t)}function Od(t){return(uS(t)||Lr(t)||Bf(t))&&!Ol(t)&&Ye(t.text)}function utt(t,e){"fontSize"in t&&(t.fontSize=e),Od(t)&&(t.text.fontSize=e)}function uz(t,e){const i=e?.strokeWidth??t.strokeWidth??1,s=e?.type??t.lineStyle,n=s??_f(t.lineDash,s),a=XB(i,n);t.strokeWidth=i,t.computedLineDash=a,t.lineStyle=n,t.lineCap=n==="dotted"?"round":void 0}function dS(t,e,i,s,n,a){switch(e){case"fill-color":{"fill"in t&&(t.fill=s),"fillOpacity"in t&&(t.fillOpacity=n),"background"in t&&(t.background.fill=s,t.background.fillOpacity=n);break}case"line-color":{"axisLabel"in t&&(t.axisLabel.fill=s,t.axisLabel.fillOpacity=n,t.axisLabel.stroke=s,t.axisLabel.strokeOpacity=n),"fill"in t&&"fillOpacity"in t&<t(t)?(t.fill=s,t.fillOpacity=n):("strokeOpacity"in t&&(t.strokeOpacity=n),"isMultiColor"in t&&"rangeStroke"in t?(t.isMultiColor=a,t.rangeStroke=s):"stroke"in t&&(t.stroke=s));break}case"text-color":{"color"in t&&(t.color=i),Od(t)&&(t.text.color=s);break}}}var{deepClone:Qn}=Tq._ModuleSupport,dtt=class{constructor(){this.mementoOriginatorKey="annotation-defaults",this.colors=new Map(Object.values(Gk).map(t=>[t,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:Qn(this.colors),fontSizes:Qn(this.fontSizes),lineStyles:Qn(this.lineStyles),lineTextAlignments:Qn(this.lineTextAlignments),lineTextPositions:Qn(this.lineTextPositions),fibonacciOptions:Qn(this.fibonacciOptions)}}guardMemento(t){return!0}restoreMemento(t,e,i){this.colors=Qn(i.colors),this.fontSizes=Qn(i.fontSizes),this.lineStyles=Qn(i.lineStyles),this.lineTextAlignments=Qn(i.lineTextAlignments),this.lineTextPositions=Qn(i.lineTextPositions),this.fibonacciOptions=Qn(i.fibonacciOptions)}setDefaultColor(t,e,i,s,n,a){this.colors.get(t)?.set(e,[i,s,n,a])}setDefaultFontSize(t,e){this.fontSizes.set(t,e)}setDefaultLineStyleType(t,e){const i=this.lineStyles.get(t);i?i.type=e:this.lineStyles.set(t,{type:e})}setDefaultLineStyleWidth(t,e){const i=this.lineStyles.get(t);i?i.strokeWidth=e:this.lineStyles.set(t,{strokeWidth:e})}setDefaultLineTextAlignment(t,e){this.lineTextAlignments.set(t,e)}setDefaultLineTextPosition(t,e){this.lineTextPositions.set(t,e)}setDefaultFibonacciOptions(t,e,i){if(t!="fibonacci-retracement"&&t!="fibonacci-retracement-trend-based")return;const s=this.fibonacciOptions.get(t);s[e]=i,this.fibonacciOptions.set(t,s)}applyDefaults(t){for(const[e,i]of this.colors)if(t.type===e)for(const[s,[n,a,o,r]=[]]of i)n&&a&&o!=null&&r!=null&&dS(t,s,n,a,o,r);for(const[e,i]of this.fontSizes)t.type!==e||i==null||utt(t,i);for(const[e,i]of this.lineStyles)t.type!==e||i==null||uz(t,i);for(const[e,i]of this.lineTextPositions)t.type!==e||i==null||(t.text.position=i);for(const[e,i]of this.lineTextAlignments)t.type!==e||i==null||(t.text.alignment=i);for(const[e,i]of this.fibonacciOptions)t.type!==e||i==null||Object.entries(i).forEach(([s,n])=>{n!=null&&t.set({[s]:n})})}},dz=(R(),E(w)),pz=(R(),E(w)),ptt='
',{Color:cL,clamp:pS,createElement:gtt}=pz._ModuleSupport,gz=t=>{try{const e=cL.fromString(t),[i,s,n]=e.toHSB();return[i,s,n,e.a]}catch{return}},fz=class extends pz._ModuleSupport.AnchoredPopover{constructor(t,e){super(t,"color-picker",e),this.hasChanged=!1,this.hideFns.push(()=>{this.hasChanged&&this.onChangeHide?.()})}show(t){this.hasChanged=!1,this.onChangeHide=t.onChangeHide;const{element:e,initialFocus:i}=this.createColorPicker(t),s=this.showWithChildren([e],{initialFocus:i,...t});s.classList.add("ag-charts-color-picker"),s.setAttribute("role","dialog")}createColorPicker(t){let e=t.isMultiColor??!1,[i,s,n,a]=gz(t.color??"#f00")??[0,1,.5,1];a=t.opacity??a;const o=gtt("div","ag-charts-color-picker__content");o.innerHTML=ptt,o.ariaLabel=this.ctx.localeManager.t("ariaLabelColorPicker");const r=o.querySelector(".ag-charts-color-picker__palette"),l=o.querySelector(".ag-charts-color-picker__hue-input"),c=o.querySelector(".ag-charts-color-picker__multi-color-button"),h=o.querySelector(".ag-charts-color-picker__alpha-input"),u=o.querySelector(".ag-charts-color-picker__color-input"),d=o.querySelector(".ag-charts-color-picker__color-label");c.classList.toggle("ag-charts-color-picker__multi-color-button--hidden",!t.hasMultiColorOption);const p=(m=!0)=>{const v=cL.fromHSB(i,s,n,a).toHexString();if(o.style.setProperty("--h",`${i}`),o.style.setProperty("--s",`${s}`),o.style.setProperty("--v",`${n}`),o.style.setProperty("--a",`${a}`),o.style.setProperty("--color",v.slice(0,7)),o.style.setProperty("--color-a",v),l.value=`${i}`,h.value=`${a}`,h.classList.toggle("ag-charts-color-picker__alpha-input--opaque",a===1),c.classList.toggle("ag-charts-color-picker__multi-color-button--active",e),d.classList.toggle("ag-charts-color-picker__color-label--multi-color",e),document.activeElement!==u&&(u.value=e?"Multi Colour":v.toUpperCase()),m||t.color==null){const S=cL.fromHSB(i,s,n,1).toHexString();t.onChange?.(v,S,a,e)}m&&(this.hasChanged=!0)};p(!1);const g=m=>m.preventDefault(),f=m=>m.stopPropagation(),x=m=>{m.preventDefault();const b=m.currentTarget;b.focus();const v=b.getBoundingClientRect(),S=({pageX:T,pageY:D})=>{e=!1,s=Math.min(Math.max((T-v.left)/v.width,0),1),n=1-Math.min(Math.max((D-v.top)/v.height,0),1),p()},A=()=>{window.removeEventListener("pointermove",S)};S(m),window.addEventListener("pointermove",S),window.addEventListener("pointerup",A,{once:!0})};return o.addEventListener("mousedown",f),o.addEventListener("touchstart",f),o.addEventListener("touchmove",f),o.addEventListener("keydown",m=>{switch(m.stopPropagation(),m.key){case"Enter":case"Escape":this.hide();break;default:return}m.preventDefault()}),r.addEventListener("pointerdown",x),r.addEventListener("touchstart",g,{passive:!1}),r.addEventListener("touchmove",g,{passive:!1}),r.addEventListener("keydown",m=>{if(m.key==="ArrowLeft")s=pS(0,s-.01,1);else if(m.key==="ArrowRight")s=pS(0,s+.01,1);else if(m.key==="ArrowUp")n=pS(0,n+.01,1);else if(m.key==="ArrowDown")n=pS(0,n-.01,1);else return;m.preventDefault(),p()}),c.addEventListener("click",()=>{e=!e,p()}),l.addEventListener("input",m=>{e=!1,i=m.currentTarget.valueAsNumber??0,p()}),h.addEventListener("input",m=>{e=!1,a=m.currentTarget.valueAsNumber??0,p()}),u.addEventListener("input",m=>{e=!1;const b=gz(m.currentTarget.value);b!=null&&([i,s,n,a]=b,p())}),u.addEventListener("blur",()=>p()),u.addEventListener("keydown",m=>{m.key==="Enter"&&(m.currentTarget.blur(),p())}),{element:o,initialFocus:r}}},yz=(R(),E(w));function mz(t){return!(t instanceof yz._ModuleSupport.LogScale)&&!(t instanceof yz._ModuleSupport.BandScale)}var ftt=[{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:mz},{label:"toolbarAnnotationsDisjointChannel",icon:"disjoint-channel-drawing",value:"disjoint-channel",visible:mz}],ytt=[{label:"toolbarAnnotationsFibonacciRetracement",icon:"fibonacci-retracement-drawing",value:"fibonacci-retracement"},{label:"toolbarAnnotationsFibonacciRetracementTrendBased",icon:"fibonacci-retracement-trend-based-drawing",value:"fibonacci-retracement-trend-based"}],mtt=[{label:"Fibonacci - Extended",value:10},{label:"Fibonacci - 6 Band",value:6},{label:"Fibonacci - 4 Band",value:4}],xtt=[{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"}],btt=[{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"}],Stt=[{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"}],xz=[{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}],zf=[{icon:"line-style-solid",altText:"iconAltTextLineStyleSolid",value:"solid"},{icon:"line-style-dashed",altText:"iconAltTextLineStyleDashed",value:"dashed"},{icon:"line-style-dotted",altText:"iconAltTextLineStyleDotted",value:"dotted"}],bz=[{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}],{ARRAY:vtt,BOOLEAN:Mtt,NUMBER:Itt,OBJECT:Att,STRING:Dtt,UNION:ktt,Color:Sz,FloatingToolbar:Ltt,Listeners:Ttt,Menu:hL,PropertiesArray:Ctt,ToolbarButtonProperties:vz,ToolbarButtonWidget:Ntt,Validate:vh}=dz._ModuleSupport,wd=class extends vz{constructor(){super(...arguments),this.checkedOverrides=new vz}};y([vh(ktt(["line-stroke-width","line-style-type","line-color","fill-color","text-color","text-size","delete","settings","lock"]))],wd.prototype,"value",2),y([vh(Att,{optional:!0})],wd.prototype,"checkedOverrides",2),y([vh(Dtt,{optional:!0})],wd.prototype,"color",2),y([vh(Itt,{optional:!0})],wd.prototype,"strokeWidth",2),y([vh(Boolean,{optional:!0})],wd.prototype,"isMultiColor",2);var Ott=class extends Ntt{update(t){super.update(t),t.value==="line-stroke-width"&&this.updateLineStrokeWidth(t),(t.value==="fill-color"||t.value==="line-color"||t.value==="text-color")&&this.updateFillColor(t)}updateFillColor(t){const e=this.getElement();e.classList.add("ag-charts-annotations__color-picker-button"),e.classList.toggle("ag-charts-annotations__color-picker-button--multi-color",t.isMultiColor),e.style.setProperty("--color",t.color??null)}updateLineStrokeWidth(t){const e=this.getElement();e.classList.add("ag-charts-annotations__stroke-width-button"),e.style.setProperty("--stroke-width",`${t.strokeWidth}px`)}},wtt=class extends Ltt{createButtonWidget(){return new Ott(this.localeManager)}},uL=class extends dz._ModuleSupport.BaseProperties{constructor(t,e){super(),this.ctx=t,this.getActiveDatum=e,this.enabled=!0,this.buttons=new Ctt(wd),this.destroyFns=[],this.events=new Ttt,this.visibleButtons=[],this.toolbar=new wtt(this.ctx,"annotation-options"),this.colorPicker=new fz(this.ctx),this.textSizeMenu=new hL(this.ctx,"text-size"),this.lineStyleTypeMenu=new hL(this.ctx,"annotations-line-style-type"),this.lineStrokeWidthMenu=new hL(this.ctx,"annotations-line-stroke-width"),this.destroyFns.push(this.toolbar.addToolbarListener("button-pressed",this.onButtonPress.bind(this)),this.toolbar.addToolbarListener("toolbar-moved",this.onToolbarMoved.bind(this)),t.widgets.seriesWidget.addListener("drag-start",this.onDragStart.bind(this)),t.widgets.seriesWidget.addListener("drag-end",this.onDragEnd.bind(this)),()=>this.colorPicker.destroy())}onDragStart(){this.toolbar.ignorePointerEvents()}onDragEnd(){this.toolbar.capturePointerEvents()}destroy(){for(const t of this.destroyFns)t()}addListener(t,e){return this.events.addListener(t,e)}show(){this.enabled&&this.toolbar.show()}hide(){this.toolbar.hide()}updateButtons(t){if(!this.enabled)return;const e={"line-style-type":wl(t),"line-stroke-width":wl(t),"line-color":rtt(t),"text-color":htt(t),"fill-color":ctt(t),"text-size":lL(t),settings:Od(t),lock:!0,delete:!0};this.visibleButtons=this.buttons.filter(i=>e[i.value]),this.toolbar.clearButtons(),this.toolbar.updateButtons(this.visibleButtons),this.refreshButtons(t)}setAnchorScene(t){this.toolbar.hasBeenDragged()||this.toolbar.setAnchor(t.getAnchor())}hideOverlays(){this.toolbar.clearActiveButton(),this.colorPicker.hide({lastFocus:null}),this.textSizeMenu.hide(),this.lineStyleTypeMenu.hide(),this.lineStrokeWidthMenu.hide(),this.dispatch("hid-overlays")}clearActiveButton(){this.toolbar.clearActiveButton()}updateColors(t){this.updateColorPickerColor("line-color",t.getDefaultColor("line-color"),t.getDefaultOpacity("line-color"),"isMultiColor"in t&&t?.isMultiColor),this.updateColorPickerColor("fill-color",t.getDefaultColor("fill-color"),t.getDefaultOpacity("fill-color"),"isMultiColor"in t&&t?.isMultiColor),this.updateColorPickerColor("text-color",t.getDefaultColor("text-color"),t.getDefaultOpacity("text-color"),"isMultiColor"in t&&t?.isMultiColor)}updateColorPickerColor(t,e,i,s){if(e!=null&&i!=null){const{r:n,g:a,b:o}=Sz.fromString(e);e=Sz.fromArray([n,a,o,i]).toHexString()}this.updateButtonByValue(t,{color:e,isMultiColor:s})}updateFontSize(t){this.updateButtonByValue("text-size",{label:t!=null?String(t):void 0})}updateLineStyleType(t){this.updateButtonByValue("line-style-type",{icon:t.icon})}updateStrokeWidth(t){this.updateButtonByValue("line-stroke-width",{label:t.label,strokeWidth:t.value})}dispatch(t,e){this.events.dispatch(t,e)}onButtonPress({event:t,button:e}){const i=this.getActiveDatum();if(i)switch(this.hideOverlays(),e.value){case"line-style-type":{const s=wl(i)?_f(i.lineDash,i.lineStyle):void 0;this.lineStyleTypeMenu.show({items:zf,ariaLabel:this.ctx.localeManager.t("toolbarAnnotationsLineStyle"),value:s,sourceEvent:t.sourceEvent,onPress:n=>this.onLineStyleTypeMenuPress(n,i),class:"ag-charts-annotations__line-style-type-menu"});break}case"line-stroke-width":{const s=wl(i)?i.strokeWidth:void 0;this.lineStrokeWidthMenu.show({items:xz,ariaLabel:this.ctx.localeManager.t("toolbarAnnotationsLineStrokeWidth"),value:s,sourceEvent:t.sourceEvent,onPress:n=>this.onLineStrokeWidthMenuPress(n,i),class:"ag-charts-annotations__line-stroke-width-menu"});break}case"line-color":case"fill-color":case"text-color":{this.toolbar.toggleActiveButtonByIndex(e.index),this.colorPicker.show({color:i?.getDefaultColor(e.value),opacity:i?.getDefaultOpacity(e.value),sourceEvent:t.sourceEvent,hasMultiColorOption:"isMultiColor"in i,isMultiColor:"isMultiColor"in i&&i?.isMultiColor,onChange:i!=null?this.onColorPickerChange.bind(this,e.value,i):void 0,onChangeHide:(s=>{this.dispatch("saved-color",{type:i.type,colorPickerType:e.value,color:i.getDefaultColor(s)})}).bind(this,e.value)});break}case"text-size":{const s=Do(i)?i.fontSize:void 0;this.textSizeMenu.show({items:bz,ariaLabel:this.ctx.localeManager.t("toolbarAnnotationsTextSize"),value:s,sourceEvent:t.sourceEvent,onPress:n=>this.onTextSizeMenuPress(n,i),class:"ag-charts-annotations__text-size-menu"});break}case"delete":{this.dispatch("pressed-delete");break}case"lock":{i.locked=!i.locked,this.refreshButtons(i),this.dispatch("pressed-lock");break}case"settings":{this.toolbar.toggleActiveButtonByIndex(e.index),this.dispatch("pressed-settings",t);break}}}onToolbarMoved(t){const{buttonBounds:e,popoverBounds:i}=t,s={x:i.x,y:i.y+i.height+4},n={y:i.y-4};this.colorPicker.setAnchor(s,n);for(const[a,o]of e.entries()){const r=this.visibleButtons.at(a);if(!r)continue;const l={x:o.x,y:o.y+o.height-1},c={y:o.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(t,e,i,s,n,a){this.dispatch("updated-color",{type:e.type,colorPickerType:t,colorOpacity:i,color:s,opacity:n,isMultiColor:a}),this.updateColorPickerColor(t,i,n,a)}onTextSizeMenuPress(t,e){if(!lL(e))return;const i=t.value;this.dispatch("updated-font-size",{type:e.type,fontSize:i}),this.textSizeMenu.hide(),this.updateFontSize(i)}onLineStyleTypeMenuPress(t,e){if(!wl(e))return;const i=t.value;this.dispatch("updated-line-style",{type:e.type,lineStyleType:i}),this.lineStyleTypeMenu.hide(),this.updateLineStyleType(t)}onLineStrokeWidthMenuPress(t,e){if(!wl(e))return;const i=t.value;this.dispatch("updated-line-width",{type:e.type,strokeWidth:i}),this.lineStrokeWidthMenu.hide(),this.updateStrokeWidth(t)}refreshButtons(t){const e=t.locked??!1;for(const[i,s]of this.visibleButtons.entries())s&&(s.value==="lock"?(this.toolbar.toggleSwitchCheckedByIndex(i,e),this.updateButtonByIndex(i,e?s.checkedOverrides.toJson():s.toJson())):this.toolbar.toggleButtonEnabledByIndex(i,!e));lL(t)&&this.updateFontSize(t.fontSize),this.updateColors(t),this.updateLineStyles(t)}updateLineStyles(t){if(!wl(t))return;const e=t.strokeWidth??1,i=_f(t.lineDash,t.lineStyle);this.updateStrokeWidth({strokeWidth:e,value:e,label:String(e)}),this.updateLineStyleType(zf.find(s=>s.value===i)??zf[0])}updateButtonByValue(t,e){const i=this.visibleButtons.findIndex(s=>s.value===t);i!==-1&&this.updateButtonByIndex(i,e)}updateButtonByIndex(t,e){const i=this.visibleButtons.at(t);i&&this.toolbar.updateButtonByIndex(t,{...i.toJson(),...e,value:e.value??i.value})}};y([vh(Mtt)],uL.prototype,"enabled",2),y([vh(vtt)],uL.prototype,"buttons",2);var Ett=(R(),E(w)),{StateMachine:Mz,StateMachineProperty:dL,Vec2:Iz,Debug:Rtt}=Ett._ModuleSupport,$e=class extends Mz{constructor(t){const e=({context:i})=>{this.node?.drag(this.datum,this.offset,i,this.snapping),t.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:e,keyUp:e,drag:({offset:i,context:s})=>{this.hasMoved=Iz.lengthSquared(Iz.sub(i,this.dragStart))>0,this.offset=i,this.node?.drag(this.datum,i,s,this.snapping),t.update()},dragEnd:{target:Mz.parent,action:()=>{this.node?.stopDragging(),this.hasMoved&&t.recordAction("Move annotation"),t.update()}}}}),this.debug=Rtt.create(!0,"annotations"),this.hasMoved=!1,this.snapping=!1}};y([dL()],$e.prototype,"snapping",2),y([dL()],$e.prototype,"datum",2),y([dL()],$e.prototype,"node",2);var _tt=(R(),E(w)),{STRING:Ptt,Validate:Btt}=_tt._ModuleSupport,El=class extends nL{constructor(){super(...arguments),this.type="arrow-down"}static is(t){return Ye(t)&&t.type==="arrow-down"}};y([Btt(Ptt)],El.prototype,"type",2);var Az=(R(),E(w)),Dz=(R(),E(w)),gS=(R(),E(w)),Mh=(R(),E(w)),kz=class r3 extends Mh._ModuleSupport.Group{constructor(){super(...arguments),this.active=!1,this.locked=!1,this.visible=!1,this.zIndex=1}drag(e){const{handle:i,locked:s}=this;return s?{point:{x:i.x,y:i.y},offset:{x:0,y:0}}:{point:e,offset:{x:e.x-i.x,y:e.y-i.y}}}toggleActive(e){this.active=e,e||(this.handle.strokeWidth=r3.INACTIVE_STROKE_WIDTH)}toggleHovered(e){this.glow.visible=!this.locked&&e,this.glow.dirtyPath=!0}toggleDragging(e){this.locked||(this.handle.visible=!e,this.glow.visible=this.glow.visible&&!e,this.handle.dirtyPath=!0,this.glow.dirtyPath=!0)}toggleLocked(e){this.locked=e}getCursor(){}containsPoint(e,i){return this.handle.containsPoint(e,i)}};kz.INACTIVE_STROKE_WIDTH=2;var Rl=kz,pL=class l3 extends Rl{constructor(){super(),this.handle=new Mh._ModuleSupport.Marker({shape:"circle"}),this.glow=new Mh._ModuleSupport.Marker({shape:"circle"}),this.append([this.handle]),this.handle.size=l3.HANDLE_SIZE,this.handle.strokeWidth=Rl.INACTIVE_STROKE_WIDTH,this.handle.zIndex=2}update(e){this.handle.setProperties({...e,strokeWidth:Rl.INACTIVE_STROKE_WIDTH})}drag(e){return{point:e,offset:{x:0,y:0}}}};pL.HANDLE_SIZE=7,pL.GLOW_SIZE=9;var _l=pL,fS=class en extends Rl{constructor(){super(),this.handle=new Mh._ModuleSupport.Rect,this.glow=new Mh._ModuleSupport.Rect,this.gradient="horizontal",this.append([this.glow,this.handle]),this.handle.cornerRadius=en.CORNER_RADIUS,this.handle.width=en.HANDLE_SIZE,this.handle.height=en.HANDLE_SIZE,this.handle.strokeWidth=Rl.INACTIVE_STROKE_WIDTH,this.handle.zIndex=2,this.glow.cornerRadius=en.CORNER_RADIUS,this.glow.width=en.GLOW_SIZE,this.glow.height=en.GLOW_SIZE,this.glow.strokeWidth=0,this.glow.fillOpacity=.2,this.glow.zIndex=1,this.glow.visible=!1}toggleLocked(e){if(super.toggleLocked(e),e){const i=(en.HANDLE_SIZE-_l.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=_l.HANDLE_SIZE,this.handle.height=_l.HANDLE_SIZE,this.glow.width=_l.GLOW_SIZE,this.glow.height=_l.GLOW_SIZE}else this.handle.cornerRadius=en.CORNER_RADIUS,this.handle.width=en.HANDLE_SIZE,this.handle.height=en.HANDLE_SIZE,this.glow.width=en.GLOW_SIZE,this.glow.height=en.GLOW_SIZE,this.cachedStyles&&this.handle.setProperties(this.cachedStyles)}update(e){if(this.cachedStyles={...e},this.active||delete e.strokeWidth,this.locked){delete e.fill,delete e.strokeWidth;const i=(en.HANDLE_SIZE-_l.HANDLE_SIZE)/2;e.x-=i,e.y-=i,this.cachedStyles.x-=i,this.cachedStyles.y-=i}this.handle.setProperties(e),this.glow.setProperties({...e,x:(e.x??this.glow.x)-2,y:(e.y??this.glow.y)-2,strokeWidth:0,fill:e.stroke})}drag(e){return this.locked?{point:e,offset:{x:0,y:0}}:this.gradient==="vertical"?{point:{x:e.x,y:this.handle.y},offset:{x:e.x-this.handle.x,y:0}}:{point:{x:this.handle.x,y:e.y},offset:{x:0,y:e.y-this.handle.y}}}getCursor(){if(!this.locked)return this.gradient==="vertical"?"col-resize":"row-resize"}};fS.HANDLE_SIZE=12,fS.GLOW_SIZE=16,fS.CORNER_RADIUS=4;var Ed=fS,gL=class Py extends Rl{constructor(){super(),this.handle=new Mh._ModuleSupport.Marker({shape:"circle"}),this.glow=new Mh._ModuleSupport.Marker({shape:"circle"}),this.append([this.glow,this.handle]),this.handle.size=Py.HANDLE_SIZE,this.handle.strokeWidth=Rl.INACTIVE_STROKE_WIDTH,this.handle.zIndex=2,this.glow.size=Py.GLOW_SIZE,this.glow.strokeWidth=0,this.glow.fillOpacity=.2,this.glow.zIndex=1,this.glow.visible=!1}toggleLocked(e){super.toggleLocked(e),e?(this.handle.fill=this.handle.stroke,this.handle.strokeWidth=0,this.handle.size=_l.HANDLE_SIZE,this.glow.size=_l.GLOW_SIZE):(this.handle.size=Py.HANDLE_SIZE,this.glow.size=Py.GLOW_SIZE,this.cachedStyles&&this.handle.setProperties(this.cachedStyles))}update(e){this.cachedStyles={...e},this.active||delete e.strokeWidth,this.locked&&(delete e.fill,delete e.strokeWidth),this.handle.setProperties(e),this.glow.setProperties({...e,strokeWidth:0,fill:e.stroke})}getCursor(){return"pointer"}};gL.HANDLE_SIZE=11,gL.GLOW_SIZE=17;var Te=gL,{ZIndexMap:ztt}=gS._ModuleSupport,Li=class extends gS._ModuleSupport.Group{constructor(){super(...arguments),this.name="AnnotationScene",this.zIndex=ztt.CHART_ANNOTATION}static isCheck(t,e){return Ye(t)&&Object.hasOwn(t,"type")&&t.type===e}toggleHovered(t){this.toggleHandles(t)}*nonHandleChildren(){for(const t of this.children())t instanceof Rl||(yield t)}computeBBoxWithoutHandles(){return gS._ModuleSupport.Transformable.toCanvas(this,gS._ModuleSupport.Group.computeChildrenBBox(this.nonHandleChildren()))}updateNode(t,e,i){if(!i&&e){this.removeChild(e);return}return i&&e==null&&(e=new t,this.appendChild(e)),e}},Ftt=(R(),E(w)),jtt=(R(),E(w)),{Vec2:Lz,toRadians:Vtt}=jtt._ModuleSupport;function Ff(t,e,i=!1,s,n=1){if(!i)return ye(t,e);const a=s?Le(s,e):Lz.origin();return ye(jf(t,a,n),e)}function jf({x:t,y:e},i,s,n=1){const{x:a,y:o}=i,r=Math.sqrt(Math.pow(t-a,2)+Math.pow(e-o,2)),l=Math.atan2(e-o,t-a),c=Vtt(s),h=Math.round(l/c)*c;return{x:a+r*Math.cos(h),y:o+r*Math.sin(h)*n}}function yS(t,e){const i={};return Object.entries(t).forEach(([s,n])=>{i[s]=Le(n,e)}),i}function fL(t,e,i){const s=[],n={};Object.entries(t).forEach(([h,u])=>{const d=Lz.add(u,e);s.push(d),n[h]=ye(d,i)});const{xAxis:a,yAxis:o}=i,r=(h,u,d)=>u>=h&&u<=d,l=s.every(h=>r(a.bounds.x,h.x,a.bounds.x+a.bounds.width)),c=s.every(h=>r(o.bounds.y,h.y,o.bounds.y+o.bounds.height));return{vectors:n,translateX:l,translateY:c}}var{Vec2:yL}=Ftt._ModuleSupport,Tz=class extends Li{constructor(){super(...arguments),this.handle=new Te,this.anchor={x:0,y:0,position:"above"}}update(t,e){const i=Le(t,e);this.updateHandle(t,i),this.anchor=this.updateAnchor(t,i,e)}dragStart(t,e,i){this.dragState={offset:e,...yS({handle:t},i)}}drag(t,e,i){const{dragState:s}=this;if(t.locked||!s)return;const n=yL.add(s.handle,yL.sub(e,s.offset)),a=ye(n,i);Na(i,a)&&(t.x=a.x,t.y=a.y)}translate(t,e,i){const s=yL.add(Le(t,i),e),n=ye(s,i);Na(i,n)&&(t.x=n.x,t.y=n.y)}toggleHandles(t){this.handle.visible=!!t,this.handle.toggleHovered(this.activeHandle==="handle")}toggleActive(t){this.toggleHandles(t),this.handle.toggleActive(t)}stopDragging(){this.handle.toggleDragging(!1)}copy(t,e,i){const s=Le(t,i),n=ye({x:s.x-30,y:s.y-30},i);return e.x=n.x,e.y=n.y,e}getAnchor(){return this.anchor}getCursor(){return"pointer"}containsPoint(t,e){const{handle:i}=this;return this.activeHandle=void 0,i.containsPoint(t,e)?(this.activeHandle="handle",!0):!1}getNodeAtCoords(t,e){if(this.handle.containsPoint(t,e))return"handle"}updateHandle(t,e,i){const{x:s,y:n}=this.getHandleCoords(t,e,i),a=this.getHandleStyles(t);this.handle.update({...a,x:s,y:n}),this.handle.toggleLocked(t.locked??!1)}updateAnchor(t,e,i){const s=this.getHandleCoords(t,e);return{x:s.x+i.seriesRect.x,y:s.y+i.seriesRect.y,position:this.anchor.position}}getHandleCoords(t,e,i){return{x:e.x,y:e.y}}getHandleStyles(t){return{fill:t.handle.fill,stroke:t.handle.stroke,strokeOpacity:t.handle.strokeOpacity,strokeWidth:t.handle.strokeWidth}}},Cz=class extends Tz{constructor(){super(),this.append([this.handle])}update(t,e){super.update(t,e);const i=Le(t,e);this.updateShape(t,i)}updateShape(t,e){this.updateShapeStyles(t),this.updateShapePath(t,e)}updateShapeStyles(t){const{shape:e}=this;e.fill=t.fill,e.fillOpacity=t.fillOpacity??1}updateShapePath(t,e){const{shape:i}=this;i.x=e.x,i.y=e.y,i.size=t.size}containsPoint(t,e){return super.containsPoint(t,e)||this.shape.containsPoint(t,e)}getNodeAtCoords(t,e){return this.shape.containsPoint(t,e)?"shape":super.getNodeAtCoords(t,e)}},Nz=[[.5,0],[1,.5],[.75,.5],[.75,1],[.25,1],[.25,.5],[0,.5]];function Oz(t){Dz._ModuleSupport.drawMarkerUnitPolygon(t,Nz)}Oz.anchor={x:.5,y:0};var mS=class extends Cz{constructor(){super(),this.type="arrow-up",this.shape=new Dz._ModuleSupport.Marker({shape:Oz}),this.append([this.shape])}static is(t){return Li.isCheck(t,"arrow-up")}getHandleCoords(t,e){const i=Te.HANDLE_SIZE/2,s=super.getHandleCoords(t,e);return s.y-=i,s}},Gtt=Nz.map(([t,e])=>[t,1-e]);function wz(t){Az._ModuleSupport.drawMarkerUnitPolygon(t,Gtt)}wz.anchor={x:.5,y:1};var xS=class extends Cz{constructor(){super(),this.type="arrow-down",this.shape=new Az._ModuleSupport.Marker({shape:wz}),this.append([this.shape])}static is(t){return Li.isCheck(t,"arrow-down")}updateAnchor(t,e,i){const s=super.updateAnchor(t,e,i);return s.y-=t.size,s}getHandleCoords(t,e){const i=Te.HANDLE_SIZE/2,s=super.getHandleCoords(t,e);return s.y+=i,s}},Wtt=(R(),E(w)),{StateMachine:bS,StateMachineProperty:Utt,Debug:Htt}=Wtt._ModuleSupport,mL=class extends bS{constructor(t){const e=({point:s})=>{const n=this.createDatum();n.set({x:s.x,y:s.y}),t.create(n)},i=()=>{this.node?.toggleActive(!0),t.showAnnotationOptions(),t.update()};super("start",{start:{click:{target:"waiting-first-render",action:e},drag:{target:"waiting-first-render",action:e},cancel:bS.parent,reset:bS.parent},"waiting-first-render":{render:{target:bS.parent,action:i}}}),this.debug=Htt.create(!0,"annotations")}};y([Utt()],mL.prototype,"node",2);var Ytt=class extends mL{createDatum(){return new El}},Ez={type:"arrow-down",datum:El,scene:xS,isDatum:El.is,translate:(t,e,i,s)=>{El.is(e)&&xS.is(t)&&t.translate(e,i,s)},copy:(t,e,i,s)=>{if(El.is(e)&&El.is(i)&&xS.is(t))return t.copy(e,i,s)},update:(t,e,i)=>{El.is(e)&&xS.is(t)&&t.update(e,i)},createState:(t,{createDatum:e})=>new Ytt({...t,create:e("arrow-down")}),dragState:t=>new $e(t)},Ktt=(R(),E(w)),{STRING:$tt,Validate:Xtt}=Ktt._ModuleSupport,Pl=class extends nL{constructor(){super(...arguments),this.type="arrow-up"}static is(t){return Ye(t)&&t.type==="arrow-up"}};y([Xtt($tt)],Pl.prototype,"type",2);var Ztt=class extends mL{createDatum(){return new Pl}},Rz={type:"arrow-up",datum:Pl,scene:mS,isDatum:Pl.is,translate:(t,e,i,s)=>{Pl.is(e)&&mS.is(t)&&t.translate(e,i,s)},copy:(t,e,i,s)=>{if(Pl.is(e)&&Pl.is(i)&&mS.is(t))return t.copy(e,i,s)},update:(t,e,i)=>{Pl.is(e)&&mS.is(t)&&t.update(e,i)},createState:(t,{createDatum:e})=>new Ztt({...t,create:e("arrow-up")}),dragState:t=>new $e(t)},Qtt=(R(),E(w)),_z=(R(),E(w)),qtt=(R(),E(w)),Jtt=(R(),E(w)),{Vec2:tet,Vec4:Pz}=Jtt._ModuleSupport,Bz=class extends Li{extendLine({x1:t,y1:e,x2:i,y2:s},n,a){const o={x1:t,y1:e,x2:i,y2:s};if(!n.extendStart&&!n.extendEnd)return o;const[r,l]=pJ(o,a.yAxis.bounds),c=o.x2=o.y2,u=o.x2===o.x1;return n.extendEnd&&(u?o.y2=h?l.y:r.y:(o.x2=c?r.x:l.x,o.y2=c?r.y:l.y)),n.extendStart&&(u?o.y1=h?r.y:l.y:(o.x1=c?l.x:r.x,o.y1=c?l.y:r.y)),o}dragStart(t,e,i){this.dragState={offset:e,...yS({start:t.start,end:t.end},i)}}drag(t,e,i,s){t.locked||(this.activeHandle?this.dragHandle(t,e,i,s):this.dragAll(t,e,i))}dragAll(t,e,i){const{dragState:s}=this;s&&this.translatePoints(t,s.start,s.end,tet.sub(e,s.offset),i)}translatePoints(t,e,i,s,n){const{vectors:a,translateX:o,translateY:r}=fL({start:e,end:i},s,n);o&&(t.start.x=a.start?.x,t.end.x=a.end?.x),(this.ignoreYBounds||r)&&(t.start.y=a.start?.y,t.end.y=a.end?.y)}translate(t,e,i){this.translatePoints(t,Le(t.start,i),Le(t.end,i),e,i)}copy(t,e,i){const s=Ta(t,i);if(!s)return;const n=this.computeBBoxWithoutHandles(),a={x:-n.width/2,y:-n.height/2};return this.translatePoints(e,Pz.start(s),Pz.end(s),a,i),e}},{Vec4:zz}=qtt._ModuleSupport,xL=class extends Bz{constructor(){super(...arguments),this.start=new Te,this.end=new Te,this.anchor={x:0,y:0,position:"above"}}update(t,e){const i=Ta(t,e);i!=null&&(this.updateHandles(t,i),this.updateAnchor(t,i,e))}toggleHandles(t){if(typeof t=="boolean")this.start.visible=t,this.end.visible=t;else for(const[e,i]of Object.entries(t))this[e].visible=i;this.start.toggleHovered(this.activeHandle==="start"),this.end.toggleHovered(this.activeHandle==="end")}toggleActive(t){this.toggleHandles(t),this.start.toggleActive(t),this.end.toggleActive(t)}dragHandle(t,e,i,s){const{activeHandle:n,dragState:a}=this;if(!n||!a)return;this[n].toggleDragging(!0);const o=s?this.snapToAngle(t,e,i):ye(this[n].drag(e).point,i);!o||!Na(i,o)||(t[n].x=o.x,t[n].y=o.y)}snapToAngle(t,e,i){const{activeHandle:s}=this,a=["start","end"].find(r=>r!==s);if(!s||!a)return;this[s].toggleDragging(!0);const o=Le(t[a],i);return ye(jf(e,o,t.snapToAngle),i)}stopDragging(){this.start.toggleDragging(!1),this.end.toggleDragging(!1)}getAnchor(){return this.anchor}getCursor(){return"pointer"}containsPoint(t,e){const{start:i,end:s}=this;return this.activeHandle=void 0,i.containsPoint(t,e)?(this.activeHandle="start",!0):s.containsPoint(t,e)?(this.activeHandle="end",!0):!1}getNodeAtCoords(t,e){if(this.start.containsPoint(t,e)||this.end.containsPoint(t,e))return"handle"}updateHandles(t,e,i){this.start.update({...this.getHandleStyles(t,"start"),...this.getHandleCoords(t,e,"start")}),this.end.update({...this.getHandleStyles(t,"end"),...this.getHandleCoords(t,e,"end",i)}),this.start.toggleLocked(t.locked??!1),this.end.toggleLocked(t.locked??!1)}updateAnchor(t,e,i,s){this.anchor={x:e.x1+i.seriesRect.x,y:e.y1+i.seriesRect.y,position:this.anchor.position}}getHandleCoords(t,e,i,s){return i==="start"?zz.start(e):zz.end(e)}getHandleStyles(t,e){return{fill:t.handle.fill,stroke:t.handle.stroke,strokeOpacity:t.handle.strokeOpacity,strokeWidth:t.handle.strokeWidth}}},{Vec2:Fz,Vec4:jz}=_z._ModuleSupport,eet=class extends xL{constructor(){super(...arguments),this.label=new _z._ModuleSupport.Text({zIndex:1}),this.anchor={x:0,y:0,position:"above-left"}}setTextInputBBox(t){this.textInputBBox=t,this.markDirty()}update(t,e){const i=Ta(t,e);if(i==null)return;const s=this.getTextBBox(t,i);this.updateLabel(t,s,i),this.updateHandles(t,i,s),this.updateShape(t,s,i),this.updateAnchor(t,i,e,s)}dragHandle(t,e,i,s){const{activeHandle:n,dragState:a}=this;if(!n||!a)return;this[n].toggleDragging(!0);const o=Fz.add(a.end,Fz.sub(e,a.offset)),r=s?this.snapToAngle(t,o,i):ye(o,i);!r||!Na(i,r)||(t[n].x=r.x,t[n].y=r.y)}containsPoint(t,e){const{label:i}=this;return super.containsPoint(t,e)||i.containsPoint(t,e)}getNodeAtCoords(t,e){return this.label.containsPoint(t,e)?"text":super.getNodeAtCoords(t,e)}getTextBBox(t,e){const{text:i}=t.getText();return sL(t,i,jz.end(e),this.textInputBBox)}updateLabel(t,e,i){const{text:s,isPlaceholder:n}=t.getText();QB(this.label,s,n,t,this.getLabelCoords(t,e,i))}updateShape(t,e,i){}getLabelCoords(t,e,i){return jz.end(i)}getHandleStyles(t,e){return{...super.getHandleStyles(t,e),stroke:t.handle.stroke??t.color}}},{drawCorner:iet,Path:set}=Qtt._ModuleSupport,SS=class extends eet{constructor(){super(),this.type="callout",this.shape=new set,this.append([this.shape,this.label,this.start,this.end])}static is(t){return Li.isCheck(t,"callout")}drag(t,e,i,s){t.locked||(this.activeHandle==="end"?this.dragHandle(t,e,i,s):this.dragAll(t,e,i))}getLabelCoords(t,e,i){const s=t.getPadding(),{bodyBounds:n={x:0,y:0,width:0,height:0}}=this.getDimensions(t,e,i)??{};return{x:n.x+s.left,y:n.y-s.bottom}}getHandleStyles(t,e){return e==="start"?{fill:t.handle.fill,stroke:t.handle.stroke??t.stroke,strokeOpacity:t.handle.strokeOpacity,strokeWidth:t.handle.strokeWidth}:{fill:void 0,strokeWidth:0}}updateAnchor(t,e,i,s){const{bodyBounds:n}=this.getDimensions(t,s,e)??{},a=n??s;this.anchor={x:a.x+i.seriesRect.x,y:a.y+i.seriesRect.y-a.height,position:this.anchor.position}}updateShape(t,e,i){const{shape:s}=this;s.fill=t.fill,s.fillOpacity=t.fillOpacity??1,s.stroke=t.stroke,s.strokeWidth=t.strokeWidth??1,s.strokeOpacity=t.strokeOpacity??1;const{tailPoint:n,bodyBounds:a}=this.getDimensions(t,e,i)??{};!n||!a||this.updatePath(n,a)}updatePath(t,e){const{x:i,y:s}=t,{x:n,y:a,width:o,height:r}=e,l=a-r,c=n+o,h=this.calculateCalloutPlacement({x:i,y:s},e),u=8,d=[{coordinates:{x0:n,x1:n+u,y0:l+u,y1:l,cx:h==="topLeft"?i:n+u,cy:h==="topLeft"?s:l+u},type:h==="topLeft"?"calloutCorner":"corner"},{coordinates:{x0:n+u,x1:c-u,y0:l,y1:l,cx:i,cy:s},type:h==="top"?"calloutSide":"side"},{coordinates:{x0:c-u,x1:c,y0:l,y1:l+u,cx:h==="topRight"?i:c-u,cy:h==="topRight"?s:l+u},type:h==="topRight"?"calloutCorner":"corner"},{coordinates:{x0:c,x1:c,y0:l+u,y1:a-u,cx:i,cy:s},type:h==="right"?"calloutSide":"side"},{coordinates:{x0:c,x1:c-u,y0:a-u,y1:a,cx:h==="bottomRight"?i:c-u,cy:h==="bottomRight"?s:a-u},type:h==="bottomRight"?"calloutCorner":"corner"},{coordinates:{x0:c-u,x1:n+u,y0:a,y1:a,cx:i,cy:s},type:h==="bottom"?"calloutSide":"side"},{coordinates:{x0:n+u,x1:n,y0:a,y1:a-u,cx:h==="bottomLeft"?i:n+u,cy:h==="bottomLeft"?s:a-u},type:h==="bottomLeft"?"calloutCorner":"corner"},{coordinates:{x0:n,x1:n,y0:a-u,y1:l+u,cx:i,cy:s},type:h==="left"?"calloutSide":"side"}],{path:p}=this.shape;p.clear(),p.moveTo(n,l+u),d.forEach(({coordinates:g,type:f})=>{this.drawPath(p,g,u,f)}),p.closePath()}drawPath(t,{x0:e,y0:i,x1:s,y1:n,cx:a,cy:o},r,l){switch(l){case"calloutCorner":{t.lineTo(a,o),t.lineTo(s,n);break}case"corner":{iet(t,{x0:e,x1:s,y0:i,y1:n,cx:a,cy:o},r,!1);break}case"calloutSide":{if(e!==s){const h=e>s?-1:1,u=Math.min(e,s)+Math.abs(s-e)/2;t.lineTo(u-6*h,i),t.lineTo(a,o),t.lineTo(u+6*h,i),t.lineTo(s,n)}else{const h=i>n?-1:1,u=Math.min(i,n)+Math.abs(i-n)/2;t.lineTo(e,u-6*h),t.lineTo(a,o),t.lineTo(e,u+6*h),t.lineTo(s,n)}break}case"side":default:{t.lineTo(s,n);break}}}calculateCalloutPlacement(t,e){const i=e.x+e.width,s=e.y-e.height;let n,a;return t.x>i?n="right":t.xe.y?a="bottom":t.y{const p=this.createDatum();p.set({start:d,end:d,visible:!0}),t.create(p)},i=()=>{const{node:d}=this;d?.toggleActive(!0),d?.toggleHandles({start:!0})},s=()=>{t.showTextInput(),this.datum&&(this.datum.visible=!1)},n=()=>{t.hideTextInput(),this.datum&&(this.datum.visible=!0),t.deselect()},a=d=>{this.node?.setTextInputBBox(d),t.update()},o=({point:d})=>{const{datum:p,node:g}=this;p?.set({end:d}),g?.toggleActive(!0),g?.toggleHandles({end:!1}),t.update()},r=()=>{t.showAnnotationOptions(),this.node?.toggleHandles({end:!0})},l=({colorPickerType:d,colorOpacity:p,color:g,opacity:f,isMultiColor:x})=>{const{datum:m}=this;m&&(d==="text-color"&&t.updateTextInputColor(g),dS(m,d,p,g,f,x),t.update())},c=d=>{const{datum:p,node:g}=this;!p||!g||!Do(p)||(p.fontSize=d,t.updateTextInputFontSize(d),t.update())},h=()=>{t.delete()},u=({textInputValue:d,bbox:p})=>{const{datum:g}=this;if(p!=null&&d!=null&&d.length>0){if(!Do(g))return;const f=oS(g,d,p.width);g?.set({text:f}),t.update(),t.recordAction(`Create ${g?.type} annotation`)}else t.delete()};super("start",{start:{click:{target:"waiting-first-render",action:e},dragStart:{target:"waiting-first-render",action:e},cancel:Oa.parent,reset:Oa.parent},"waiting-first-render":{render:{target:"end",action:i}},end:{hover:o,drag:o,click:{target:"edit",action:r},dragEnd:{target:"edit",action:r},reset:{target:Oa.parent,action:h},cancel:{target:Oa.parent,action:h}},edit:{onEnter:s,updateTextInputBBox:a,color:l,fontSize:c,textInput:[{guard:bL,target:Oa.parent,action:h},{guard:SL,target:Oa.parent,action:u}],click:{target:Oa.parent,action:u},dragStart:{target:Oa.parent,action:u},resize:{target:Oa.parent,action:u},onExit:n,cancel:{target:Oa.parent,action:h}}}),this.debug=aet.create(!0,"annotations")}};y([Vz()],vL.prototype,"datum",2),y([Vz()],vL.prototype,"node",2);var oet=class extends vL{createDatum(){return new Ca}},Gz={type:"callout",datum:Ca,scene:SS,isDatum:Ca.is,translate:(t,e,i,s)=>{if(Ca.is(e)&&SS.is(t))return t.translate(e,i,s)},copy:(t,e,i,s)=>{if(Ca.is(e)&&Ca.is(i)&&SS.is(t))return t.copy(e,i,s)},update:(t,e,i)=>{Ca.is(e)&&SS.is(t)&&t.update(e,i)},createState:(t,{createDatum:e})=>new oet({...t,create:e("callout")}),dragState:t=>new $e(t)},Wz=(R(),E(w)),ret=(R(),E(w)),ML=class extends Tz{constructor(){super(...arguments),this.label=new ret._ModuleSupport.Text({zIndex:1}),this.anchor={x:0,y:0,position:"above-left"}}setTextInputBBox(t){this.textInputBBox=t,this.markDirty()}update(t,e){const i=Le(t,e),s=this.getTextBBox(t,i,e);this.updateLabel(t,s),this.updateHandle(t,i,s),this.updateShape(t,s),this.anchor=this.updateAnchor(t,s,e)}copy(t,e,i){const s=Le(t,i),n=this.getTextBBox(t,s,i),a=t.getPadding(),o=a.left+a.right,r=a.top+a.bottom,l=(n.width+o)/2,c=n.height+r,h=ye({x:s.x-l,y:s.y-c},i);return e.x=h.x,e.y=h.y,e}containsPoint(t,e){const{label:i}=this;return super.containsPoint(t,e)||i.visible&&i.containsPoint(t,e)}getNodeAtCoords(t,e){return this.label.visible&&this.label.containsPoint(t,e)?"text":super.getNodeAtCoords(t,e)}getTextBBox(t,e,i){const{text:s}=t.getText();return sL(t,s,{x:e.x,y:e.y},this.textInputBBox)}updateLabel(t,e){const{text:i,isPlaceholder:s}=t.getText();QB(this.label,i,s,t,this.getLabelCoords(t,e))}updateShape(t,e){}updateAnchor(t,e,i){return{x:e.x+i.seriesRect.x,y:e.y+i.seriesRect.y-e.height,position:this.anchor.position}}getLabelCoords(t,e){return e}getHandleCoords(t,e,i){return i}getHandleStyles(t){const e=super.getHandleStyles(t);return e.stroke=t.handle.stroke??t.color,e}},{drawCorner:IL}=Wz._ModuleSupport,vS=class extends ML{constructor(){super(),this.type="comment",this.shape=new Wz._ModuleSupport.Path,this.append([this.shape,this.label,this.handle])}static is(t){return Li.isCheck(t,"comment")}updateShape(t,e){const{shape:i}=this;i.fill=t.fill,i.fillOpacity=t.fillOpacity??1,i.stroke=t.stroke??"transparent",i.strokeWidth=t.strokeWidth??1,i.strokeOpacity=t.strokeOpacity??1,this.updatePath(t,e)}getLabelCoords(t,e){const i=t.getPadding();return{x:e.x+i.left,y:e.y-i.bottom}}getHandleStyles(t){return{fill:t.handle.fill,stroke:t.handle.stroke??t.stroke??t.fill,strokeOpacity:t.handle.strokeOpacity,strokeWidth:t.handle.strokeWidth}}updateAnchor(t,e,i){const s=super.updateAnchor(t,e,i),n=t.getPadding();return s.y-=n.bottom+n.top,s}updatePath(t,e){const i=t.getPadding(),{x:s,y:n}=e;let{width:a,height:o}=e;const{fontSize:r}=t,l=i.left+i.right,c=i.top+i.bottom;a=a+l,o=Math.max(o+c,r+c);const h=n-o,u=s+a,d=(r*aS+c)/2,{path:p}=this.shape;p.clear(),p.moveTo(s,n),p.lineTo(s,h+d),IL(p,{x0:s,x1:s+d,y0:h+d,y1:h,cx:s+d,cy:h+d},d,!1),p.lineTo(u-d,h),IL(p,{x0:u-d,x1:u,y0:h,y1:h+d,cx:u-d,cy:h+d},d,!1),p.lineTo(u,n-d),IL(p,{x0:u,x1:u-d,y0:n-d,y1:n,cx:u-d,cy:n-d},d,!1),p.closePath()}containsPoint(t,e){return super.containsPoint(t,e)||this.shape.containsPoint(t,e)}},cet=(R(),E(w)),{StateMachine:Tr,StateMachineProperty:Uz,Debug:het}=cet._ModuleSupport,Vf=class extends Tr{constructor(t){const e=({point:h})=>{const u=this.createDatum();u.set({x:h.x,y:h.y}),t.create(u)},i=()=>{this.node?.toggleActive(!0),t.showAnnotationOptions(),t.update()},s=()=>{t.showTextInput(),this.datum&&(this.datum.visible=!1)},n=()=>{t.hideTextInput(),this.datum&&(this.datum.visible=!0),t.deselect()},a=h=>{this.node?.setTextInputBBox(h),t.update()},o=({colorPickerType:h,colorOpacity:u,color:d,opacity:p,isMultiColor:g})=>{this.datum&&(h==="text-color"&&t.updateTextInputColor(d),dS(this.datum,h,u,d,p,g),t.update())},r=h=>{const{datum:u,node:d}=this;!u||!d||!Do(u)||(u.fontSize=h,t.updateTextInputFontSize(h),t.update())},l=()=>{t.delete()},c=({textInputValue:h,bbox:u})=>{if(u!=null&&h!=null&&h.length>0){const{datum:d}=this;if(!Do(d))return;const p=oS(d,h,u.width);d?.set({text:p}),t.update(),t.recordAction(`Create ${d?.type} annotation`)}else t.delete()};super("start",{start:{click:{target:"waiting-first-render",action:e},dragStart:{target:"waiting-first-render",action:e},cancel:Tr.parent,reset:Tr.parent},"waiting-first-render":{render:{target:"edit",action:i}},edit:{onEnter:s,updateTextInputBBox:a,color:o,fontSize:r,textInput:[{guard:bL,target:Tr.parent,action:l},{guard:SL,target:Tr.parent,action:c}],click:{target:Tr.parent,action:c},dragStart:{target:Tr.parent,action:c},resize:{target:Tr.parent,action:c},onExit:n,cancel:{target:Tr.parent,action:l}}}),this.debug=het.create(!0,"annotations")}};y([Uz()],Vf.prototype,"datum",2),y([Uz()],Vf.prototype,"node",2);var uet=class extends Vf{createDatum(){return new Mo}},Hz={type:"comment",datum:Mo,scene:vS,isDatum:Mo.is,translate:(t,e,i,s)=>{Mo.is(e)&&vS.is(t)&&t.translate(e,i,s)},copy:(t,e,i,s)=>{if(Mo.is(e)&&Mo.is(i)&&vS.is(t))return t.copy(e,i,s)},update:(t,e,i)=>{Mo.is(e)&&vS.is(t)&&t.update(e,i)},createState:(t,{createDatum:e})=>new uet({...t,create:e("comment")}),dragState:t=>new $e(t)},det=(R(),E(w)),MS=(R(),E(w)),{calculateLabelTranslation:pet,ChartAxisDirection:get}=MS._ModuleSupport,Yz=class extends MS._ModuleSupport.Group{constructor(){super({name:"AnnotationAxisLabelGroup"}),this.label=new MS._ModuleSupport.Text({zIndex:1}),this.rect=new MS._ModuleSupport.Rect;const{label:t}=this;t.fontSize=12,t.fontFamily="Verdana, sans-serif",t.fill="black",t.textBaseline="middle",t.textAlign="center",this.append([this.rect,this.label])}update(t){this.updateLabel(t),this.updateRect(t),this.updatePosition(t)}updateLabel({value:t,styles:e,context:i}){const{fontWeight:s,fontSize:n,fontStyle:a,fontFamily:o,textAlign:r,color:l="white",formatter:c}=e,h=c?c({value:t}):i.scaleValueFormatter()(t);this.label.setProperties({fontWeight:s,fontSize:n,fontStyle:a,fontFamily:o,textAlign:r,fill:l,text:h})}updateRect({styles:t}){const{rect:e}=this,{cornerRadius:i,fill:s,fillOpacity:n,stroke:a,strokeOpacity:o}=t;e.setProperties({cornerRadius:i,fill:s,fillOpacity:n,stroke:a,strokeOpacity:o})}updatePosition({x:t,y:e,context:i,styles:{padding:s}}){const{label:n,rect:a}=this,o=n.getBBox()?.clone(),r=s??8,l=s??5;o.grow(r,"horizontal"),o.grow(l,"vertical");const c=i.direction===get.X?Math.round(l/2):r,{xTranslation:h,yTranslation:u}=pet({yDirection:!0,padding:i.labelPadding-c,position:i.position??"left",bbox:o}),d=t+h,p=e+u;n.x=d,n.y=p,a.y=p-Math.round(o.height/2),a.x=d-Math.round(o.width/2),a.height=o.height,a.width=o.width}};Yz.className="AxisLabel";var IS=(R(),E(w)),{Vec2:ko}=IS._ModuleSupport,$s=class extends IS._ModuleSupport.Line{constructor(){super(...arguments),this.growCollisionBox=9,this.clipMask=new Map}setProperties(t,e){return super.setProperties(t,e),this.updateCollisionBBox(),this}updateCollisionBBox(){const{growCollisionBox:t,strokeWidth:e,x1:i,y1:s,x2:n,y2:a}=this;let o=e+t;o%2===0&&(o+=1);const r=ko.from(i,s-Math.floor(o/2)),l=ko.from(n,a),c=ko.distance(r,l);this.collisionBBox=new IS._ModuleSupport.BBox(r.x,r.y,c,o)}isPointInPath(t,e){const{collisionBBox:i,x1:s,y1:n,x2:a,y2:o}=this;if(!i)return!1;const r=ko.from(s,n),l=ko.from(a,o),c=ko.sub(ko.from(t,e),r),h=ko.sub(l,r),u=ko.rotate(c,ko.angle(c,h),r);return i.containsPoint(u.x,u.y)??!1}render(t){this.applyClipMask(t.ctx),super.render(t),this.closeClipMask(t.ctx)}setClipMask(t,e){const i=this.clipMask.get(t);IS._ModuleSupport.jsonDiff(i,e)!=null&&this.markDirty(),e?this.clipMask.set(t,e):this.clipMask.delete(t)}applyClipMask(t){const{clipMask:e}=this;e.size!==0&&this.clipMask.forEach(i=>{const{x:s,y:n,radius:a}=i;t.save(),t.beginPath(),t.rect(0,0,t.canvas.width,t.canvas.height),t.ellipse(s,n,a,a,0,Math.PI*2,0,!0),t.clip()})}closeClipMask(t){this.clipMask.size!==0&&t.restore()}},fet=(R(),E(w)),Ih=class extends fet._ModuleSupport.TransformableText{constructor(){super(...arguments),this.growCollisionBox={top:4,right:4,bottom:4,left:4}}isPointInPath(t,e){const i=this.fromParentPoint(t,e),s=this.computeBBoxWithoutTransforms();return s?s.grow(this.growCollisionBox).containsPoint(i.x,i.y):!1}},yet=(R(),E(w)),{Vec2:gs}=yet._ModuleSupport;function Rd(t,e,i,s,n,a,o){if(!a||!n||!s){e.setClipMask(t);return}const{alignment:r,position:l}=s,c=$z(i,s.fontSize,o),{point:h,textBaseline:u}=Xz(c,l,r);Zz(n,a,s,h,c.angle,u);const{x:d,y:p,width:g,height:f}=n.getBBox(),x=gs.length(gs.from(g,f)),m={x:d+g/2,y:p+f/2,radius:x/2+gs.length(c.offset)};return l==="center"?e.setClipMask(t,m):e.setClipMask(t),{clipMask:m,numbers:c}}function Kz(t,e,i,s,n,a,o){if(!o||!a)return;const{alignment:r,position:l}=s,[c,h]=e.y1<=i.y1?[e,i]:[i,e];let u=c;l==="bottom"?u=h:l==="inside"&&(u={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 d=$z(u,s.fontSize,n),{point:p,textBaseline:g}=Xz(d,l==="inside"?"center":l,r,t);Zz(a,o,s,p,d.angle,g)}function $z(t,e,i){let[s,n]=gs.from(t);s.x>n.x&&([s,n]=[n,s]);const a=gs.normalized(gs.sub(n,s)),o=gs.angle(a),r=gs.multiply(a,Te.HANDLE_SIZE/2+(e??14)/2),l=gs.multiply(a,(i??2)/2+(e??14)/3);return{left:s,right:n,normal:a,angle:o,inset:r,offset:l}}function Xz({left:t,right:e,normal:i,angle:s,inset:n,offset:a},o,r,l){let c;r==="right"?c=gs.sub(e,n):r==="center"?c=gs.add(t,gs.multiply(i,gs.distance(t,e)/2)):c=gs.add(t,n);let h="bottom";return o==="bottom"?(c=gs.rotate(a,s+Math.PI/2,c),h="top"):o==="center"&&!l?h="middle":c=gs.rotate(a,s-Math.PI/2,c),{point:c,textBaseline:h}}function Zz(t,e,i,s,n,a){t.setProperties({text:e,x:s.x,y:s.y,rotation:n,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{ChartAxisDirection:met,Vec2:_d,Vec4:AL}=det._ModuleSupport,Bl=class extends Li{constructor(){super(),this.type="cross-line",this.line=new $s,this.middle=new Ed,this.isHorizontal=!1,this.append([this.line,this.middle])}static is(t){return Li.isCheck(t,"cross-line")}update(t,e){const{seriesRect:i}=e;this.seriesRect=i,this.isHorizontal=ps.is(t);const s=this.isHorizontal?e.yAxis:e.xAxis,n=this.convertCrossLine(t,s);if(n==null){this.visible=!1;return}this.visible=t.visible??!0,this.visible&&(this.updateLine(t,n),this.updateHandle(t,n),this.updateText(t,n),this.updateAxisLabel(t,s,n))}updateLine(t,e){const{line:i}=this,{lineDashOffset:s,stroke:n,strokeWidth:a,strokeOpacity:o}=t,{x1:r,y1:l,x2:c,y2:h}=e;i.setProperties({x1:r,y1:l,x2:c,y2:h,lineCap:t.getLineCap(),lineDash:t.getLineDash(),lineDashOffset:s,stroke:n,strokeWidth:a,strokeOpacity:o,fillOpacity:0})}updateHandle(t,e){const{middle:i}=this,{locked:s,stroke:n,strokeWidth:a,strokeOpacity:o}=t,r={fill:t.handle.fill,stroke:t.handle.stroke??n,strokeOpacity:t.handle.strokeOpacity??o,strokeWidth:t.handle.strokeWidth??a},l=_d.sub(AL.center(e),_d.from(i.handle.width/2,i.handle.height/2));i.gradient=this.isHorizontal?"horizontal":"vertical",i.update({...r,...l}),i.toggleLocked(s??!1)}updateText(t,e){this.text=this.updateNode(Ih,this.text,!!t.text.label),Rd(this.line.id,this.line,e,t.text,this.text,t.text.label,t.strokeWidth)}createAxisLabel(t){const e=new Yz;return t.attachLabel(e),e}updateAxisLabel(t,e,i){this.axisLabel||(this.axisLabel=this.createAxisLabel(e));const{axisLabel:s,seriesRect:n}=this,{direction:a,position:o}=e;if(t.axisLabel.enabled){s.visible=this.visible;const r=o==="left"||o==="top"?AL.start(i):AL.end(i),l=a===met.X?r.x:r.y;if(!e.inRange(l)){s.visible=!1;return}const{value:c}=fe(t.value);s.update({..._d.add(r,_d.required(n)),value:c,styles:t.axisLabel,context:e})}else s.visible=!1}setAxisLabelOpacity(t){this.axisLabel&&(this.axisLabel.opacity=t)}setAxisLabelVisible(t){this.axisLabel&&(this.axisLabel.visible=t)}toggleHandles(t){this.middle.visible=t,this.middle.toggleHovered(this.activeHandle==="middle")}destroy(){super.destroy(),this.axisLabel?.destroy()}toggleActive(t){this.toggleHandles(t),this.middle.toggleActive(t)}dragStart(t,e,i){const s=ps.is(t)?{x:e.x,y:Nl(t.value,i.yAxis)}:{x:Nl(t.value,i.xAxis),y:e.y};this.dragState={offset:e,middle:s}}drag(t,e,i){const{activeHandle:s,dragState:n}=this;if(t.locked)return;let a;if(s)this[s].toggleDragging(!0),a=this[s].drag(e).point;else if(n)a=_d.add(n.middle,_d.sub(e,n.offset));else return;const o=ye(a,i),r=ps.is(t);t.set({value:r?o.y:o.x})}translate(t,{x:e,y:i},s){if(t.locked)return;const{axisContext:n,translation:a}=ps.is(t)?{axisContext:s.yAxis,translation:i}:{axisContext:s.xAxis,translation:e},o=Nl(t.value,n)+a,r=Rf(o,n);isNaN(r)||t.set({value:r})}stopDragging(){this.middle.toggleDragging(!1)}copy(t,e,i){const s=ps.is(t),n=this.isHorizontal?i.yAxis:i.xAxis,a=this.convertCrossLine(t,n);if(!a)return;const o=s?-30:0,r=s?0:-30,l=ye({x:a.x1+r,y:a.y1+o},i);return e.set({value:s?l.y:l.x}),e}getCursor(){return this.activeHandle==null?"pointer":this[this.activeHandle].getCursor()}containsPoint(t,e){const{middle:i,line:s,text:n}=this;return this.activeHandle=void 0,i.containsPoint(t,e)?(this.activeHandle="middle",!0):s.isPointInPath(t,e)||!!n?.containsPoint(t,e)}getNodeAtCoords(t,e){if(this.text?.containsPoint(t,e))return"text";if(this.line.isPointInPath(t,e))return"line";if(this.middle.containsPoint(t,e))return"handle"}getAnchor(){const t=this.computeBBoxWithoutHandles();return this.isHorizontal?{x:t.x+t.width/2,y:t.y}:{x:t.x+t.width,y:t.y+t.height/2,position:"right"}}convertCrossLine(t,e){if(t.value==null)return;let i=0,s=0,n,a;const{bounds:o}=e,r=Nl(t.value,e);return ps.is(t)?(n=o.width,s=r,a=r):(i=r,n=r,a=o.height),{x1:i,y1:s,x2:n,y2:a}}},xet=(R(),E(w)),{StateMachine:AS,StateMachineProperty:bet,Debug:vet}=xet._ModuleSupport,DL=class extends AS{constructor(t,e){const i=({point:n})=>{const a=t==="horizontal",o=a?new ps:new Io;o.set({value:a?n.y:n.x}),e.create(o),e.recordAction(`Create ${a?"horizontal-line":"vertical-line"} annotation`)},s=()=>{this.node?.toggleActive(!0),e.showAnnotationOptions(),e.update()};super("start",{start:{click:{target:"waiting-first-render",action:i},drag:{target:"waiting-first-render",action:i},reset:AS.parent,cancel:AS.parent},"waiting-first-render":{render:{target:AS.parent,action:s}}}),this.debug=vet.create(!0,"annotations")}};y([bet()],DL.prototype,"node",2);var Qz={type:"horizontal-line",datum:ps,scene:Bl,isDatum:ps.is,translate:(t,e,i,s)=>{ps.is(e)&&Bl.is(t)&&t.translate(e,i,s)},copy:(t,e,i,s)=>{if(ps.is(e)&&ps.is(i)&&Bl.is(t))return t.copy(e,i,s)},update:(t,e,i)=>{ps.is(e)&&Bl.is(t)&&t.update(e,i)},createState:(t,{createDatum:e})=>new DL("horizontal",{...t,create:e("horizontal-line")}),dragState:t=>new $e(t)},qz={type:"vertical-line",datum:Io,scene:Bl,isDatum:Io.is,translate:(t,e,i,s)=>{Io.is(e)&&Bl.is(t)&&t.translate(e,i,s)},copy:(t,e,i,s)=>{if(Io.is(e)&&Io.is(i)&&Bl.is(t))return t.copy(e,i,s)},update:(t,e,i)=>{Io.is(e)&&Bl.is(t)&&t.update(e,i)},createState:(t,{createDatum:e})=>new DL("vertical",{...t,create:e("vertical-line")}),dragState:t=>new $e(t)},Met=(R(),E(w)),Jz=(R(),E(w)),Iet=(R(),E(w)),{Vec4:Aet}=Iet._ModuleSupport,tF=class{static updateBackground(t,e,i,s){const{background:n}=this,{seriesRect:a}=s;n.path.clear(!0);const o=Aet.from(0,0,a.width,a.height),r=this.getBackgroundPoints(t,e,i,o);for(let c=0;cye(d,i),l=t.toJson(),c=t.snapToAngle,{value:h}=fe(t.end.y),{value:u}=fe(t.start.y);switch(n){case"topLeft":case"bottomLeft":{const d=n==="topLeft"?1:-1,p=s?this.snapToAngle(e,i,"topLeft","topRight",c,d):r({x:a.topLeft.handle.x+o.x,y:a.topLeft.handle.y+o.y*d}),g=s?this.snapToAngle(e,i,"bottomLeft","bottomRight",c,-d):r({x:a.bottomLeft.handle.x+o.x,y:a.bottomLeft.handle.y+o.y*-d});if(p?.y==null||g?.y==null||u==null||!Ke(u))return;const f=t.startHeight+(p.y-u)*2;t.start.x=p.x,t.start.y=p.y,t.startHeight=f;break}case"topRight":{const d=s?this.snapToAngle(e,i,"topRight","topLeft",c):r({x:a.topRight.handle.x+o.x,y:a.topRight.handle.y+o.y});if(d?.y==null||h==null||!Ke(h))return;const p=t.endHeight+(d.y-h)*2;t.end.x=d.x,t.end.y=d.y,t.endHeight=p;break}case"bottomRight":{const d=r({x:a.bottomLeft.handle.x+o.x,y:a.bottomLeft.handle.y+o.y}),p=r({x:a.bottomRight.handle.x+o.x,y:a.bottomRight.handle.y+o.y});if(!d||!p||t.start.y==null||h==null||!Ke(h))return;const g=h-p.y,f=t.startHeight-(t.endHeight-g);t.startHeight=f,t.endHeight=g}}t.isValidWithContext(i)||t.set(l)}updateLines(t,e,i){const{topLine:s,bottomLine:n}=this,{lineDashOffset:a,stroke:o,strokeOpacity:r,strokeWidth:l}=t,c={lineCap:t.getLineCap(),lineDash:t.getLineDash(),lineDashOffset:a,stroke:o,strokeOpacity:r,strokeWidth:l};s.setProperties({...e,...c}),n.setProperties({...i,...c})}updateHandles(t,e,i){const{handles:{topLeft:s,topRight:n,bottomLeft:a,bottomRight:o}}=this,r={fill:t.handle.fill,stroke:t.handle.stroke??t.stroke,strokeOpacity:t.handle.strokeOpacity??t.strokeOpacity,strokeWidth:t.handle.strokeWidth??t.strokeWidth};s.update({...r,...DS.start(e)}),n.update({...r,...DS.end(e)}),a.update({...r,...DS.start(i)}),o.update({...r,...zl.sub(DS.end(i),zl.from(o.handle.width/2,o.handle.height/2))})}updateText(t,e,i){this.text=this.updateNode(Ih,this.text,!!t.text.label),Kz(!1,e,i,t.text,t.strokeWidth,this.text,t.text.label)}getBackgroundPoints(t,e,i,s){const n=e.x1>e.x2,a=e.y1>e.y2,o=a?s.y2:s.y1,r=a?s.y1:s.y2,l=zl.from(e);return t.extendEnd&&e.y2===r&&l.push(zl.from(n?s.x1:s.x2,a?s.y1:s.y2)),t.extendEnd&&i.y2===o&&l.push(zl.from(n?s.x1:s.x2,a?s.y2:s.y1)),l.push(...zl.from(i).reverse()),t.extendStart&&i.y1===r&&l.push(zl.from(n?s.x2:s.x1,a?s.y1:s.y2)),t.extendStart&&e.y1===o&&l.push(zl.from(n?s.x2:s.x1,a?s.y2:s.y1)),l}},Det=(R(),E(w)),{StateMachine:Fl,StateMachineProperty:kL,Debug:ket}=Det._ModuleSupport,LS=class extends Fl{constructor(t){const e=({point:l})=>{const c=new Xn;c.set({start:l,end:l,startHeight:0,endHeight:0}),t.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:u}=this;h&&(h.set({end:Ff(l,c,u,h.start,h.snapToAngle)}),t.update())},n=()=>{this.node?.toggleHandles({topRight:!0}),t.update()},a=({point:l})=>{const{datum:c,node:h}=this,{value:u}=fe(c?.end.y),{value:d}=fe(c?.start.y),{y:p}=l;if(c==null||!Ke(d)||!Ke(u)||!Ke(p))return;const g=u-(p??0),f=(d-u)*2+g,x={x:c?.start.x,y:d-f},m={x:c?.end.x,y:l.y};h?.toggleHandles({bottomLeft:!0,bottomRight:!0}),!(!t.validatePoint(x)||!t.validatePoint(m))&&(c.set({startHeight:f,endHeight:g}),t.update())},o=({point:l})=>{const{datum:c,node:h}=this,{value:u}=fe(c?.end.y),{value:d}=fe(c?.start.y),{y:p}=l;if(c==null||!Ke(d)||!Ke(u)||!Ke(p))return;const g=u-(p??0),f=(d-u)*2+g,x={x:c.start.x,y:d-g},m={x:c.end.x,y:l.y};h?.toggleHandles(!0),!(!t.validatePoint(x)||!t.validatePoint(m))&&(c.set({startHeight:f,endHeight:g}),t.recordAction("Create disjoint-channel annotation"),t.showAnnotationOptions(),t.update())},r=()=>t.delete();super("start",{start:{click:{target:"waiting-first-render",action:e},drag:{target:"waiting-first-render",action:e},reset:Fl.parent},"waiting-first-render":{render:{target:"end",action:i}},end:{hover:s,drag:s,click:{target:"height",action:n},dragEnd:{target:"height",action:n},reset:{target:Fl.parent,action:r},cancel:{target:Fl.parent,action:r}},height:{hover:a,click:{target:Fl.parent,action:o},drag:{target:Fl.parent,action:o},reset:{target:Fl.parent,action:r},cancel:{target:Fl.parent,action:r}}}),this.debug=ket.create(!0,"annotations"),this.snapping=!1}};y([kL()],LS.prototype,"datum",2),y([kL()],LS.prototype,"node",2),y([kL()],LS.prototype,"snapping",2);var iF={type:"disjoint-channel",datum:Xn,scene:kS,isDatum:Xn.is,translate:(t,e,i,s)=>{Xn.is(e)&&kS.is(t)&&t.translate(e,i,s)},copy:(t,e,i,s)=>{if(Xn.is(e)&&Xn.is(i)&&kS.is(t))return t.copy(e,i,s)},update:(t,e,i)=>{Xn.is(e)&&kS.is(t)&&t.update(e,i)},createState:(t,{createDatum:e})=>new LS({...t,create:e("disjoint-channel")}),dragState:t=>new $e(t)},Let=(R(),E(w)),Cr=(R(),E(w)),LL=[0,23.6,38.2,50,61.8,78.6,100],Tet=[161.8,261.8,361.8,423.6],Cet=[...LL,...Tet],Net={10:Cet,6:LL,4:LL.filter(t=>t!==78.6&&t!==23.6)},Oet=10;function wet(t,e){const{x2:i,y1:s,y2:n}=t,a=s-n;return e==null?{x1:i,x2:i,y1:n-a,y2:n}:{x1:e.x1,x2:e.x2,y1:e.y2-a,y2:e.y2}}function sF({x1:t,y1:e,x2:i,y2:s},n,a,o,r=10){const l=e-s,c=a?-1:1;let h=o;const u=[];return Net[r].forEach((d,p)=>{const g=o+l*(d/100)*c,f=n.yAxis.scaleInvert(g);u.push({id:p,x1:t,x2:i,y1:h,y2:g,tag:d==100?0:1,label:{x1:Math.min(t,i)-Oet,x2:i,y1:g,y2:g,text:`${(d/100).toFixed(3)} (${f.toFixed(2)})`}}),h=g}),u}var{Vec2:Eet,Vec4:nF}=Cr._ModuleSupport,aF=class extends Li{constructor(){super(),this.trendLine=new $s,this.rangeFillsGroup=new Cr._ModuleSupport.Group({name:`${this.id}-range-fills`}),this.rangeFillsGroupSelection=Cr._ModuleSupport.Selection.select(this.rangeFillsGroup,Cr._ModuleSupport.Range),this.rangeStrokesGroup=new Cr._ModuleSupport.Group({name:`${this.id}-range-strokes`}),this.rangeStrokesGroupSelection=Cr._ModuleSupport.Selection.select(this.rangeStrokesGroup,$s),this.labelsGroup=new Cr._ModuleSupport.Group({name:`${this.id}-ranges-labels`}),this.labelsGroupSelection=Cr._ModuleSupport.Selection.select(this.labelsGroup,Ih),this.anchor={x:0,y:0,position:"above"},this.append([this.trendLine,this.rangeFillsGroup,this.rangeStrokesGroup,this.labelsGroup])}update(t,e){let i=Ta(t,e);if(i==null){this.visible=!1;return}if(i=nF.round(i),this.visible=t.visible??!0,!this.visible)return;this.updateLine(t,i,this.trendLine),this.updateHandles(t,i),this.updateAnchor(t,i,e);const{reverse:s}=t,n=this.extendLine(i,t,e),a=s?n.y1:n.y2,o=s?n.y2:n.y1,r=sF(n,e,t.reverse,a,t.bands);this.updateRanges(t,r,e);const l={...n,y1:o,y2:o};this.updateText(t,l)}extendLine({x1:t,y1:e,x2:i,y2:s},n,a){const o={x1:t,y1:e,x2:i,y2:s};if(!n.extendStart&&!n.extendEnd)return o;const{x:r,width:l}=a.xAxis.bounds;return n.extendEnd&&(o[t>i?"x1":"x2"]=r+l),n.extendStart&&(o[t>i?"x2":"x1"]=r),o}updateLine(t,e,i){if(!e||!i)return;const{lineDashOffset:s,strokeWidth:n,strokeOpacity:a,stroke:o}=t;i.setProperties({...e,lineCap:t.getLineCap(),lineDash:[3,4],lineDashOffset:s,strokeWidth:n,strokeOpacity:a,fillOpacity:0,stroke:o})}updateRangeStrokes(t){const{lineDashOffset:e,strokeWidth:i,strokeOpacity:s,strokes:n,rangeStroke:a,isMultiColor:o}=t;this.rangeStrokesGroupSelection.each((r,{x1:l,x2:c,y2:h,tag:u},d)=>{const p=h,g=o?n[d%n.length]:a;r.setProperties({x1:l,x2:c,y1:p,y2:p,stroke:g,strokeOpacity:s,strokeWidth:i,lineCap:t.getLineCap(),lineDash:t.getLineDash(),lineDashOffset:e,tag:u})})}updateRanges(t,e,i){const s=n=>n.id;this.rangeFillsGroupSelection.update(e,void 0,s),this.rangeStrokesGroupSelection.update(e,void 0,s),this.labelsGroupSelection.update(e,void 0,s),this.updateRangeFills(t),this.updateRangeStrokes(t),this.updateRangeLabels(t,i)}updateRangeFills(t){const{lineDashOffset:e,strokeWidth:i,strokeOpacity:s,strokes:n,rangeStroke:a,showFill:o,isMultiColor:r}=t;this.rangeFillsGroupSelection.each((l,{x1:c,x2:h,y1:u,y2:d},p)=>{const g=r?n[p%n.length]:a;if(!o){l.visible=!1;return}l.setProperties({x1:c,x2:h,y1:u,y2:d,startLine:!1,endLine:!1,isRange:!0,stroke:g,strokeOpacity:s,fill:g,fillOpacity:(s??1)*.15,strokeWidth:i,lineCap:t.getLineCap(),lineDash:t.getLineDash(),lineDashOffset:e,visible:!0})})}updateRangeLabels(t,{xAxis:e}){const{rangeStrokesGroupSelection:i}=this,{strokes:s,strokeWidth:n,rangeStroke:a,isMultiColor:o,label:{fontFamily:r,fontSize:l,fontStyle:c,fontWeight:h,color:u}}=t,d={fontFamily:r,fontSize:l,fontStyle:c,fontWeight:h},p=this.checkWithinBounds(e,d,this.labelsGroupSelection.at(0));this.labelsGroupSelection.each((g,f,x)=>{const m=u??(o?s[x%s.length]:a),b=i.at(x);if(!b)return;const{text:v,...S}=f.label;if(p)g.setProperties({...d,text:v,x:S.x1,y:S.y1,textBaseline:"middle",textAlign:"end",fill:m}),Rd(g.id,b,S);else{const A={...d,label:v,position:"center",alignment:"left",color:m};Rd(g.id,b,S,A,g,v,n)}})}checkWithinBounds(t,e,i){if(!i)return!1;const{text:s,...n}=i.datum.label;i.setProperties({...e,text:s,x:n.x1,y:n.y1,textBaseline:"middle",textAlign:"end"});const{x:a}=i.getBBox();return a>=t.bounds.x&&a<=t.bounds.x+t.bounds.width}updateText(t,e){const i=this.rangeStrokesGroupSelection.selectByTag(0)[0];if(!i)return;const{text:s,strokeWidth:n}=t;this.text=this.updateNode(Ih,this.text,!!s.label),Rd(i.id,i,e,s,this.text,s.label,n)}updateAnchor(t,e,i,s){const n=nF.topCenter(e);Eet.apply(this.anchor,Cr._ModuleSupport.Transformable.toCanvasPoint(this.trendLine,n.x,n.y))}containsPoint(t,e){const{trendLine:i,rangeStrokesGroupSelection:s,text:n}=this;let a=!1;return s.each(o=>a||(a=o.isPointInPath(t,e))),a||i.isPointInPath(t,e)||!!n?.containsPoint(t,e)}getNodeAtCoords(t,e){if(this.text?.containsPoint(t,e))return"text";if(this.trendLine.isPointInPath(t,e))return"line"}getHandleStyles(t){return{fill:t.handle.fill,stroke:t.handle.stroke??t.stroke,strokeOpacity:t.handle.strokeOpacity??t.strokeOpacity,strokeWidth:t.handle.strokeWidth??t.strokeWidth}}drag(t,e,i,s){t.locked||(this.activeHandle?this.dragHandle(t,e,i,s):this.dragAll(t,e,i))}getAnchor(){return this.anchor}getCursor(){return"pointer"}},{Vec2:Ret,Vec4:Ah}=Let._ModuleSupport,TS=class extends aF{constructor(){super(),this.type="fibonacci-retracement-trend-based",this.endRetracementLine=new $s,this.start=new Te,this.end=new Te,this.endRetracement=new Te,this.append([this.endRetracementLine,this.start,this.end,this.endRetracement])}static is(t){return Li.isCheck(t,"fibonacci-retracement-trend-based")}update(t,e){let{coords1:i,coords2:s}=this.getCoords(t,e);if(i==null||s==null){this.visible=!1;return}if(i=Ah.round(i),s=Ah.round(s),this.visible=t.visible??!0,!this.visible)return;(t.endRetracement.x==null||t.endRetracement.y==null)&&(s=void 0),this.updateLine(t,i,this.trendLine),this.updateLine(t,s,this.endRetracementLine),this.updateHandles(t,i,s),this.updateAnchor(t,s??i,e);const{reverse:n,bands:a}=t,o=wet(i,s),r=this.extendLine(o,t,e),l=r.y2,c=r.y1,h=s?sF(r,e,n,l,a):[];this.updateRanges(t,h,e);const u={...r,y1:c,y2:c};this.updateText(t,u)}containsPoint(t,e){const{start:i,end:s,endRetracement:n,endRetracementLine:a}=this;return this.activeHandle=void 0,i.containsPoint(t,e)?(this.activeHandle="start",!0):s.containsPoint(t,e)?(this.activeHandle="end",!0):n.containsPoint(t,e)?(this.activeHandle="endRetracement",!0):a.isPointInPath(t,e)||super.containsPoint(t,e)}getNodeAtCoords(t,e){return this.start.containsPoint(t,e)||this.end.containsPoint(t,e)||this.endRetracement.containsPoint(t,e)?"handle":this.endRetracementLine.isPointInPath(t,e)?"line":super.getNodeAtCoords(t,e)}dragStart(t,e,i){this.dragState={offset:e,...yS({start:t.start,end:t.end,endRetracement:t.endRetracement},i)}}stopDragging(){this.start.toggleDragging(!1),this.end.toggleDragging(!1),this.endRetracement.toggleDragging(!1)}dragAll(t,e,i){const{dragState:s}=this;s&&this.translatePoints({datum:t,start:s.start,end:s.end,endRetracement:s.endRetracement,translation:Ret.sub(e,s.offset),context:i})}dragHandle(t,e,i,s){const{activeHandle:n,dragState:a}=this;if(!n||!a)return;this[n].toggleDragging(!0);const o=s?this.snapToAngle(t,e,i):ye(this[n].drag(e).point,i);!o||!Na(i,o)||(t[n].x=o.x,t[n].y=o.y)}snapToAngle(t,e,i){const{activeHandle:s}=this,n=["start","end","endRetracement"];if(!s)return;const a=(n.indexOf(s)+1)%n.length,o=n[a];this[s].toggleDragging(!0);const r=Le(t[o],i);return ye(jf(e,r,t.snapToAngle),i)}translatePoints({datum:t,start:e,end:i,endRetracement:s,translation:n,context:a}){const{vectors:o,translateX:r,translateY:l}=fL({start:e,end:i,endRetracement:s},n,a);r&&(t.start.x=o.start?.x,t.end.x=o.end?.x,t.endRetracement.x=o.endRetracement?.x),(this.ignoreYBounds||l)&&(t.start.y=o.start?.y,t.end.y=o.end?.y,t.endRetracement.y=o.endRetracement?.y)}translate(t,e,i){this.translatePoints({datum:t,start:Le(t.start,i),end:Le(t.end,i),endRetracement:Le(t.endRetracement,i),translation:e,context:i})}copy(t,e,i){const{coords1:s,coords2:n}=this.getCoords(t,i);if(!s||!n)return;const a=this.computeBBoxWithoutHandles();return this.translatePoints({datum:e,start:Ah.start(s),end:Ah.end(s),endRetracement:Ah.end(n),translation:{x:-a.width/2,y:-a.height/2},context:i}),e}getCoords(t,e){return{coords1:Ta(t,e),coords2:Ta({start:t.end,end:t.endRetracement},e)}}toggleHandles(t){if(typeof t=="boolean")this.start.visible=t,this.end.visible=t,this.endRetracement.visible=t;else for(const[e,i]of Object.entries(t))this[e].visible=i;this.start.toggleHovered(this.activeHandle==="start"),this.end.toggleHovered(this.activeHandle==="end"),this.endRetracement.toggleHovered(this.activeHandle==="endRetracement")}toggleActive(t){this.toggleHandles(t),this.start.toggleActive(t),this.end.toggleActive(t),this.endRetracement.toggleActive(t)}updateHandles(t,e,i,s){this.start.update({...this.getHandleStyles(t),...this.getHandleCoords(t,e,"start")}),this.end.update({...this.getHandleStyles(t),...this.getHandleCoords(t,e,"end",s)}),i&&this.endRetracement.update({...this.getHandleStyles(t),...this.getHandleCoords(t,i,"endRetracement",s)}),this.start.toggleLocked(t.locked??!1),this.end.toggleLocked(t.locked??!1),this.endRetracement.toggleLocked(t.locked??!1)}getHandleCoords(t,e,i,s){return i==="start"?Ah.start(e):Ah.end(e)}},_et=(R(),E(w)),{StateMachine:jl,StateMachineProperty:TL,Debug:Pet}=_et._ModuleSupport,CS=class extends jl{constructor(t){const e=({point:c})=>{const h=this.createDatum();h.set({start:c,end:c}),t.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:u,snapping:d}=this;u&&(u.set({end:Ff(c,h,d,u.start,u.snapToAngle)}),t.update())},n=()=>{const{datum:c}=this;c&&(c.endRetracement.x=c.end.x,c.endRetracement.y=c.end.y,this.node?.toggleHandles({end:!0}),t.update())},a=({offset:c,context:h})=>{const{datum:u,snapping:d}=this;u&&(u.set({endRetracement:Ff(c,h,d,u.end,u.snapToAngle)}),t.update())},o=()=>{this.node?.toggleHandles({endRetracement:!0}),t.update()},r=()=>t.delete(),l=()=>{t.showAnnotationOptions(),t.recordAction(`Create ${this.datum?.type} annotation`)};super("start",{start:{click:{target:"waiting-first-render",action:e},drag:{target:"waiting-first-render",action:e},reset:jl.parent},"waiting-first-render":{render:{target:"end",action:i}},end:{hover:s,click:{target:"endRetracement",action:n},drag:s,dragEnd:{target:"endRetracement",action:n},reset:{target:jl.parent,action:r},cancel:{target:jl.parent,action:r},onExit:l},endRetracement:{hover:a,click:{target:jl.parent,action:o},drag:{target:jl.parent,action:o},reset:{target:jl.parent,action:r},cancel:{target:jl.parent,action:r}}}),this.debug=Pet.create(!0,"annotations"),this.snapping=!1}createDatum(){return new Ao}};y([TL()],CS.prototype,"datum",2),y([TL()],CS.prototype,"node",2),y([TL()],CS.prototype,"snapping",2);var oF={type:"fibonacci-retracement-trend-based",datum:Ao,scene:TS,isDatum:Ao.is,translate:(t,e,i,s)=>{Ao.is(e)&&TS.is(t)&&t.translate(e,i,s)},copy:(t,e,i,s)=>{if(Ao.is(e)&&Ao.is(i)&&TS.is(t))return t.copy(e,i,s)},update:(t,e,i)=>{Ao.is(e)&&TS.is(t)&&t.update(e,i)},createState:(t,{createDatum:e})=>new CS({...t,create:e("fibonacci-retracement-trend-based")}),dragState:t=>new $e(t)},Bet=(R(),E(w)),{Vec2:zet,Vec4:rF}=Bet._ModuleSupport,NS=class extends aF{constructor(){super(),this.type="fibonacci-retracement",this.start=new Te,this.end=new Te,this.append([this.start,this.end])}static is(t){return Li.isCheck(t,"fibonacci-retracement")}containsPoint(t,e){const{start:i,end:s}=this;return this.activeHandle=void 0,i.containsPoint(t,e)?(this.activeHandle="start",!0):s.containsPoint(t,e)?(this.activeHandle="end",!0):super.containsPoint(t,e)}getNodeAtCoords(t,e){return this.start.containsPoint(t,e)||this.end.containsPoint(t,e)?"handle":super.getNodeAtCoords(t,e)}dragStart(t,e,i){this.dragState={offset:e,...yS({start:t.start,end:t.end},i)}}stopDragging(){this.start.toggleDragging(!1),this.end.toggleDragging(!1)}dragAll(t,e,i){const{dragState:s}=this;s&&this.translatePoints({datum:t,start:s.start,end:s.end,translation:zet.sub(e,s.offset),context:i})}dragHandle(t,e,i,s){const{activeHandle:n,dragState:a}=this;if(!n||!a)return;this[n].toggleDragging(!0);const o=s?this.snapToAngle(t,e,i):ye(this[n].drag(e).point,i);!o||!Na(i,o)||(t[n].x=o.x,t[n].y=o.y)}snapToAngle(t,e,i){const{activeHandle:s}=this,a=["start","end"].find(r=>r!==s);if(!s||!a)return;this[s].toggleDragging(!0);const o=Le(t[a],i);return ye(jf(e,o,t.snapToAngle),i)}translatePoints({datum:t,start:e,end:i,translation:s,context:n}){const{vectors:a,translateX:o,translateY:r}=fL({start:e,end:i},s,n);o&&(t.start.x=a.start?.x,t.end.x=a.end?.x),(this.ignoreYBounds||r)&&(t.start.y=a.start?.y,t.end.y=a.end?.y)}translate(t,e,i){this.translatePoints({datum:t,start:Le(t.start,i),end:Le(t.end,i),translation:e,context:i})}copy(t,e,i){const s=Ta(t,i);if(!s)return;const n=this.computeBBoxWithoutHandles();return this.translatePoints({datum:e,start:{x:s.x1,y:s.y1},end:{x:s.x2,y:s.y2},translation:{x:-n.width/2,y:-n.height/2},context:i}),e}toggleHandles(t){if(typeof t=="boolean")this.start.visible=t,this.end.visible=t;else for(const[e,i]of Object.entries(t))this[e].visible=i;this.start.toggleHovered(this.activeHandle==="start"),this.end.toggleHovered(this.activeHandle==="end")}toggleActive(t){this.toggleHandles(t),this.start.toggleActive(t),this.end.toggleActive(t)}updateHandles(t,e,i,s){this.start.update({...this.getHandleStyles(t),...this.getHandleCoords(t,e,"start")}),this.end.update({...this.getHandleStyles(t),...this.getHandleCoords(t,e,"end",s)}),this.start.toggleLocked(t.locked??!1),this.end.toggleLocked(t.locked??!1)}getHandleCoords(t,e,i,s){return i==="start"?rF.start(e):rF.end(e)}},Fet=(R(),E(w)),{StateMachine:Pd,StateMachineProperty:CL,Debug:jet}=Fet._ModuleSupport,Bd=class extends Pd{constructor(t){const e=({point:r})=>{const l=this.createDatum();l.set({start:r,end:r}),t.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:Ff(r,l,h,c.start,c.snapToAngle)}),t.update())},n=()=>{this.node?.toggleHandles({end:!0}),t.update()},a=()=>t.delete(),o=()=>{t.showAnnotationOptions(),t.recordAction(`Create ${this.datum?.type} annotation`)};super("start",{start:{click:{target:"waiting-first-render",action:e},drag:{target:"waiting-first-render",action:e},reset:Pd.parent},"waiting-first-render":{render:{target:"end",action:i}},end:{hover:s,click:{target:Pd.parent,action:n},drag:s,dragEnd:{target:Pd.parent,action:n},reset:{target:Pd.parent,action:a},cancel:{target:Pd.parent,action:a},onExit:o}}),this.debug=jet.create(!0,"annotations"),this.snapping=!1}};y([CL()],Bd.prototype,"datum",2),y([CL()],Bd.prototype,"node",2),y([CL()],Bd.prototype,"snapping",2);var Vet=class extends Bd{createDatum(){return new Mr}},Get=class extends Bd{createDatum(){return new Ir}},Wet=class extends Bd{createDatum(){return new Dr}},lF={type:"fibonacci-retracement",datum:Dr,scene:NS,isDatum:Dr.is,translate:(t,e,i,s)=>{Dr.is(e)&&NS.is(t)&&t.translate(e,i,s)},copy:(t,e,i,s)=>{if(Dr.is(e)&&Dr.is(i)&&NS.is(t))return t.copy(e,i,s)},update:(t,e,i)=>{Dr.is(e)&&NS.is(t)&&t.update(e,i)},createState:(t,{createDatum:e})=>new Wet({...t,create:e("fibonacci-retracement")}),dragState:t=>new $e(t)},cF=(R(),E(w)),NL=(R(),E(w)),{Vec2:Gf}=NL._ModuleSupport,Uet=class extends NL._ModuleSupport.Group{},OS=class extends Uet{constructor(){super(),this.type="arrow",this.path=new NL._ModuleSupport.Path,this.armLength=6,this.append([this.path])}update(t){const{path:e}=this,{x:i,y:s,angle:n,...a}=t,o=Gf.from(i,s),r=3*Math.PI/4,l=this.armLength+(t.strokeWidth??0)*2,c=Gf.rotate(Gf.from(0,l),n+r,o),h=Gf.rotate(Gf.from(l,0),n-r,o);e.setProperties(a),e.fillOpacity=0,e.path.clear(),e.path.moveTo(c.x,c.y),e.path.lineTo(o.x,o.y),e.path.lineTo(h.x,h.y)}},{Vec2:wa,Vec4:hF}=cF._ModuleSupport,Vl=class extends xL{constructor(){super(),this.type="line",this.line=new $s,this.append([this.line,this.start,this.end])}static is(t){return Li.isCheck(t,"line")}update(t,e){let i=Ta(t,e);if(i==null){this.visible=!1;return}i=hF.round(i),this.visible=t.visible??!0,this.visible&&(this.updateLine(t,i,e),this.updateHandles(t,i),this.updateText(t,i),this.updateCaps(t,i),this.updateAnchor(t,i,e))}updateLine(t,e,i){const{line:s}=this,{lineDashOffset:n,stroke:a,strokeWidth:o,strokeOpacity:r}=t,l=this.extendLine(e,t,i);s.setProperties({...l,lineCap:t.getLineCap(),lineDash:t.getLineDash(),lineDashOffset:n,stroke:a,strokeWidth:o,strokeOpacity:r,fillOpacity:0})}updateText(t,e){this.text=this.updateNode(Ih,this.text,!!t.text.label),Rd(this.line.id,this.line,e,t.text,this.text,t.text.label,t.strokeWidth)}updateCaps(t,e){if(!t.startCap&&this.startCap&&(this.removeChild(this.startCap),this.startCap=void 0),!t.endCap&&this.endCap&&(this.removeChild(this.endCap),this.endCap=void 0),!t.startCap&&!t.endCap)return;const{stroke:i,strokeWidth:s,strokeOpacity:n}=t,[a,o]=wa.from(e),r=wa.angle(wa.sub(o,a));t.startCap&&(this.startCap&&this.startCap.type!==t.startCap&&(this.removeChild(this.startCap),this.startCap=void 0),this.startCap==null&&(this.startCap=new OS,this.append([this.startCap])),this.startCap.update({x:a.x,y:a.y,angle:r-Math.PI,stroke:i,strokeWidth:s,strokeOpacity:n})),t.endCap&&(this.endCap&&this.endCap.type!==t.endCap&&(this.removeChild(this.endCap),this.endCap=void 0),this.endCap==null&&(this.endCap=new OS,this.append([this.endCap])),this.endCap.update({x:o.x,y:o.y,angle:r,stroke:i,strokeWidth:s,strokeOpacity:n}))}updateAnchor(t,e,i,s){const n=hF.topCenter(e);wa.apply(this.anchor,cF._ModuleSupport.Transformable.toCanvasPoint(this.line,n.x,n.y))}containsPoint(t,e){const{line:i,text:s}=this;return super.containsPoint(t,e)||i.isPointInPath(t,e)||!!s?.containsPoint(t,e)}getNodeAtCoords(t,e){return this.text?.containsPoint(t,e)?"text":this.line.isPointInPath(t,e)?"line":super.getNodeAtCoords(t,e)}getHandleCoords(t,e,i,s){const{startCap:n,endCap:a}=this;let[o,r]=wa.from(e);const l=wa.angle(wa.sub(r,o));return n&&(o=wa.rotate(wa.from(0,-Te.HANDLE_SIZE/2),l,o)),a&&(r=wa.rotate(wa.from(0,Te.HANDLE_SIZE/2),l,r)),i==="start"?o:r}getHandleStyles(t){return{fill:t.handle.fill,stroke:t.handle.stroke??t.stroke,strokeOpacity:t.handle.strokeOpacity??t.strokeOpacity,strokeWidth:t.handle.strokeWidth??t.strokeWidth}}},uF={type:"line",datum:Ir,scene:Vl,isDatum:Ir.is,translate:(t,e,i,s)=>{Ir.is(e)&&Vl.is(t)&&t.translate(e,i,s)},copy:(t,e,i,s)=>{if(Ir.is(e)&&Ir.is(i)&&Vl.is(t))return t.copy(e,i,s)},update:(t,e,i)=>{Ir.is(e)&&Vl.is(t)&&t.update(e,i)},createState:(t,{createDatum:e})=>new Get({...t,create:e("line")}),dragState:t=>new $e(t)},dF={type:"arrow",datum:Mr,scene:Vl,isDatum:Mr.is,translate:(t,e,i,s)=>{Mr.is(e)&&Vl.is(t)&&t.translate(e,i,s)},copy:(t,e,i,s)=>{if(Mr.is(e)&&Mr.is(i)&&Vl.is(t))return t.copy(e,i,s)},update:(t,e,i)=>{Mr.is(e)&&Vl.is(t)&&t.update(e,i)},createState:(t,{createDatum:e})=>new Vet({...t,create:e("arrow")}),dragState:t=>new $e(t)},OL=(R(),E(w)),vn=(R(),E(w)),pF=(R(),E(w));function gF(t,e=0,i=0){let s=e;for(const n of t)if(Array.isArray(n)){for(const a of n)fF(a,s);s+=pF._ModuleSupport.Group.computeChildrenBBox(n).width+i}else fF(n,s),s+=n.getBBox().width+i}function Het(t,e=0,i=0){let s=e;for(const n of t)if(Array.isArray(n)){for(const a of n)yF(a,s);s+=pF._ModuleSupport.Group.computeChildrenBBox(n).height+i}else yF(n,s),s+=n.getBBox().height+i}function fF(t,e){"x1"in t?(t.x2=e+(t.x2-t.x1),t.x1=e):t.x=e}function yF(t,e){"y1"in t?(t.y2=e+(t.y2-t.y1),t.y1=e):t.y=e}function mF(t,e){"x1"in t?(t.x1+=e,t.x2+=e):t.x+=e}function xF(t,e){"y1"in t?(t.y1+=e,t.y2+=e):t.y+=e}var{Vec4:wL}=vn._ModuleSupport,bF=class extends vn._ModuleSupport.Group{constructor(){super(),this.name="MeasurerStatisticsScene",this.background=new vn._ModuleSupport.Rect,this.dateRangeBarsText=new vn._ModuleSupport.Text,this.dateRangeDivider=new vn._ModuleSupport.Line,this.dateRangeValueText=new vn._ModuleSupport.Text,this.priceRangeValueText=new vn._ModuleSupport.Text,this.priceRangeDivider=new vn._ModuleSupport.Line,this.priceRangePercentageText=new vn._ModuleSupport.Text,this.volumeText=new vn._ModuleSupport.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(t,e,i,s,n,a,o){this.verticalDirection=a;const r=this.updateStatistics(t,e,i,o),l=vn._ModuleSupport.Group.computeChildrenBBox(r.flat()),c=10;l.grow(c),this.updateBackground(t,l,c),this.reposition(r,c,n),this.checkVisibility(t,n,s)}checkVisibility(t,e,i){const s=wL.from(new vn._ModuleSupport.BBox(0,0,e.seriesRect.width,e.seriesRect.height));wL.collides(i,s)?this.visible=t.visible??!0:this.visible=!1}updateStatistics(t,e,i,s){const{dateRangeBarsText:n,dateRangeDivider:a,dateRangeValueText:o,priceRangeValueText:r,priceRangeDivider:l,priceRangePercentageText:c,volumeText:h}=this,u=8,d=6,p=t.statistics.fontSize+3,g=-2,f=this.getTextStyles(t),x={...this.getDividerStyles(t),x1:0,y1:0,x2:0,y2:p},m=[n,a,o],b=[r,l,c],v=[];return e.priceRange&&(r.setProperties({...f,text:this.formatPriceRangeValue(e.priceRange.value,s)}),l.setProperties(x),c.setProperties({...f,text:this.formatPriceRangePercentage(e.priceRange.percentage,s)}),gF(b,i.x,u),v.push(b)),e.dateRange&&(n.setProperties({...f,text:this.formatDateRangeBars(e.dateRange.bars,s)}),a.setProperties(x),o.setProperties({...f,text:this.formatDateRangeValue(e.dateRange.value)}),gF(m,i.x,u),v.push(m)),e.volume!=null?(h.setProperties({...f,x:i.x,text:this.formatVolume(e.volume,s),visible:!0}),v.push(h)):h.visible=!1,Het(v,i.y,d),l.y1+=g,l.y2+=g,a.y1+=g,a.y2+=g,v}updateBackground(t,e,i){const s=this.getBackgroundStyles(t);this.background.setProperties({...s,...e,x:e.x-e.width/2+i,y:e.y})}reposition(t,e,i){const{width:s,height:n}=i.seriesRect,a=wL.from(this.background.getBBox());let o=0;a.x1<0&&(o=-a.x1),a.x2>s&&(o=s-a.x2);const r=Math.min(e,n-a.y2);for(const l of t)if(Array.isArray(l)){const c=vn._ModuleSupport.Group.computeChildrenBBox(l).width;for(const h of l)mF(h,o-c/2),xF(h,r)}else mF(l,o-l.getBBox().width/2),xF(l,r);this.background.x+=o,this.background.y+=r}getTextStyles(t){return{fill:t.statistics.color,fontFamily:t.statistics.fontFamily,fontSize:t.statistics.fontSize,fontStyle:t.statistics.fontStyle,fontWeight:t.statistics.fontWeight,textBaseline:"top"}}getDividerStyles(t){return{stroke:t.statistics.divider.stroke,strokeOpacity:t.statistics.divider.strokeOpacity,strokeWidth:t.statistics.divider.strokeWidth}}getBackgroundStyles(t){return{fill:t.statistics.fill,stroke:t.statistics.stroke,strokeOpacity:t.statistics.strokeOpacity,strokeWidth:t.statistics.strokeWidth,cornerRadius:4}}formatDateRangeBars(t,e){return e?.t("measurerDateRangeBars",{value:t})??`${t}`}formatDateRangeValue(t){const e=[],i=t>=0?"":"-";t=Math.abs(t);const s=1e3*60,n=s*60,a=n*24,o=Math.floor(t/s),r=Math.floor(t/n),l=Math.floor(t/a),c=r%(a/n),h=o%(n/s);return l>=1&&e.push(`${l}d`),r>=1&&(t=s.x-h.x&&(l={x:s.x,y:r.clipMask.y,radius:this.text.getBBox().height/2+Lo.length(h)})}this.verticalLine.setClipMask(o,l)}updateCaps(t,e){const{horizontalEndCap:i,verticalEndCap:s}=this,{direction:n}=t,{x1:a,y1:o,x2:r,y2:l}=e,c=Lo.round(Dh.center(e)),{stroke:h,strokeWidth:u,strokeOpacity:d}=this.getLineStyles(t),p={stroke:h,strokeWidth:u,strokeOpacity:d};if(n!=="vertical"){const g=a<=r?0:Math.PI;let f=r;n==="horizontal"&&(f+=a<=r?-2:2),i.update({...p,x:f,y:c.y,angle:g})}if(n!=="horizontal"){const g=o<=l?Math.PI/2:Math.PI/-2;let f=l;n==="vertical"&&(f+=o<=l?-2:2),s.update({...p,x:c.x,y:f,angle:g})}}updateBoundingLines(t,e){const{verticalStartLine:i,verticalEndLine:s,horizontalStartLine:n,horizontalEndLine:a}=this,{direction:o}=t,{x1:r,y1:l,x2:c,y2:h}=e,u=this.getLineStyles(t);o==="horizontal"&&(i.setProperties({...u,x1:r,y1:l,x2:r,y2:h}),s.setProperties({...u,x1:c,y1:l,x2:c,y2:h})),o==="vertical"&&(n.setProperties({...u,x1:r,y1:l,x2:c,y2:l}),a.setProperties({...u,x1:r,y1:h,x2:c,y2:h}))}updateStatistics(t,e,i){const s=Lo.add(Dh.bottomCenter(e),Lo.from(0,10)),n={volume:this.getVolume(t)};t.hasPriceRange&&(n.priceRange={percentage:this.getPriceRangePercentage(t),value:this.getPriceRangeValue(t)}),t.hasDateRange&&(n.dateRange={bars:this.getDateRangeBars(e,i),value:this.getDateRangeValue(t)}),this.statistics.update(t,n,s,e,i,this.verticalDirection,t.localeManager)}updateAnchor(t,e,i,s){const n=Dh.topCenter(e);Lo.apply(this.anchor,OL._ModuleSupport.Transformable.toCanvasPoint(this.horizontalLine,n.x,n.y))}getBackgroundPoints(t,e,i,s){const[n,a]=Lo.from(e),[o,r]=Lo.from(i);return[n,a,r,o]}getLineStyles(t){const{lineDashOffset:e,stroke:i,strokeWidth:s,strokeOpacity:n}=t;return{lineCap:t.getLineCap(),lineDash:t.getLineDash(),lineDashOffset:e,stroke:i,strokeWidth:s,strokeOpacity:n,fillOpacity:0}}getBackgroundStyles(t){const{background:e}=t;return{fill:e.fill,fillOpacity:e.fillOpacity}}getHandleStyles(t){return{fill:t.handle.fill,stroke:t.handle.stroke??t.stroke,strokeOpacity:t.handle.strokeOpacity??t.strokeOpacity,strokeWidth:t.handle.strokeWidth??t.strokeWidth}}containsPoint(t,e){const{horizontalLine:i,text:s,verticalLine:n,horizontalStartLine:a,horizontalEndLine:o,verticalStartLine:r,verticalEndLine:l}=this;return super.containsPoint(t,e)||i.isPointInPath(t,e)||n.isPointInPath(t,e)||a.visible&&a.isPointInPath(t,e)||o.visible&&o.isPointInPath(t,e)||r.visible&&r.isPointInPath(t,e)||l.visible&&l.isPointInPath(t,e)||!!s?.containsPoint(t,e)}getNodeAtCoords(t,e){return this.text?.containsPoint(t,e)?"text":this.start.containsPoint(t,e)||this.end.containsPoint(t,e)?"handle":"line"}getDateRangeBars(t,e){const{step:i}=e.xAxis.scale,s=t.x1<=t.x2?1:-1;return i?Math.round(Dh.width(t)/i)*s:0}getDateRangeValue(t){const{value:e}=fe(t.start.x),{value:i}=fe(t.end.x);if(!Df(e)||!Df(i))throw new Error("Can not create a date range measurement of non-date x-axis.");return i.getTime()-e.getTime()}getPriceRangePercentage(t){if(t.start.y==null||t.end.y==null)throw new Error("Can not create a price range measurement of a non-numeric y-axis");const{value:e}=fe(t.end.y),{value:i}=fe(t.start.y);if(!Ke(e)||!Ke(i))throw new Error("Can not create a price range measurement of a non-numeric y-axis");return(e-i)/i}getPriceRangeValue(t){if(t.start.y==null||t.end.y==null)throw new Error("Can not create a price range measurement of a non-numeric y-axis");const{value:e}=fe(t.end.y),{value:i}=fe(t.start.y);if(!Ke(e)||!Ke(i))throw new Error("Can not create a price range measurement of a non-numeric y-axis");return e-i}getVolume(t){return t.getVolume(t.start.x,t.end.x)}},wS=class extends Mn{constructor(){super(...arguments),this.type="quick-measurer"}static is(t){return Li.isCheck(t,"quick-measurer")}createStatisticsScene(){return new Yet}getDirectionStyles(t){return this.verticalDirection==="down"?t.down:t.up}getLineStyles(t){const e=this.getDirectionStyles(t);return{...super.getLineStyles(t),stroke:e.stroke,strokeWidth:e.strokeWidth,strokeOpacity:e.strokeOpacity}}getBackgroundStyles(t){const e=this.getDirectionStyles(t);return{fill:e.fill,fillOpacity:e.fillOpacity}}getHandleStyles(t){const e=this.getDirectionStyles(t);return{fill:e.handle.fill,stroke:e.handle.stroke??e.stroke,strokeOpacity:e.handle.strokeOpacity??e.strokeOpacity,strokeWidth:e.handle.strokeWidth??e.strokeWidth}}},Ket=(R(),E(w)),{StateMachine:zd,StateMachineProperty:SF,Debug:$et}=Ket._ModuleSupport,Fd=class extends zd{constructor(t){const e=({point:o})=>{const r=this.createDatum();r.set({start:o,end:o}),t.create(r)},i=({point:o})=>{const{datum:r,node:l}=this;r?.set({end:o}),l?.toggleActive(!0),l?.toggleHandles({end:!1}),t.update()},s=()=>{this.node?.toggleHandles({end:!0})},n=()=>t.delete(),a=()=>{t.showAnnotationOptions(),!Ol(this.datum)&&t.recordAction(`Create ${this.node?.type} annotation`)};super("start",{start:{reset:zd.parent,click:{target:"end",action:e},drag:{target:"end",action:e}},end:{hover:i,drag:i,click:{target:zd.parent,action:s},dragEnd:{target:zd.parent,action:s},reset:{target:zd.parent,action:n},cancel:{target:zd.parent,action:n},onExit:a}}),this.debug=$et.create(!0,"annotations")}};y([SF()],Fd.prototype,"datum",2),y([SF()],Fd.prototype,"node",2);var Xet=class extends Fd{createDatum(){return new Kn}},Zet=class extends Fd{createDatum(){return new $n}},Qet=class extends Fd{createDatum(){return new vr}},qet=class extends Fd{createDatum(){return new Sn}},vF={type:"date-range",datum:Kn,scene:Mn,isDatum:Kn.is,translate:(t,e,i,s)=>{Kn.is(e)&&Mn.is(t)&&t.translate(e,i,s)},copy:(t,e,i,s)=>{if(Kn.is(e)&&Kn.is(i)&&Mn.is(t))return t.copy(e,i,s)},update:(t,e,i)=>{Kn.is(e)&&Mn.is(t)&&t.update(e,i)},createState:(t,{createDatum:e})=>new Xet({...t,create:e("date-range")}),dragState:t=>new $e(t)},MF={type:"price-range",datum:$n,scene:Mn,isDatum:$n.is,translate:(t,e,i,s)=>{$n.is(e)&&Mn.is(t)&&t.translate(e,i,s)},copy:(t,e,i,s)=>{if($n.is(e)&&$n.is(i)&&Mn.is(t))return t.copy(e,i,s)},update:(t,e,i)=>{$n.is(e)&&Mn.is(t)&&t.update(e,i)},createState:(t,{createDatum:e})=>new Zet({...t,create:e("date-range")}),dragState:t=>new $e(t)},IF={type:"date-price-range",datum:vr,scene:Mn,isDatum:vr.is,translate:(t,e,i,s)=>{vr.is(e)&&Mn.is(t)&&t.translate(e,i,s)},copy:(t,e,i,s)=>{if(vr.is(e)&&vr.is(i)&&Mn.is(t))return t.copy(e,i,s)},update:(t,e,i)=>{vr.is(e)&&Mn.is(t)&&t.update(e,i)},createState:(t,{createDatum:e})=>new Qet({...t,create:e("date-range")}),dragState:t=>new $e(t)},AF={type:"quick-date-price-range",datum:Sn,scene:wS,isDatum:Sn.is,translate:(t,e,i,s)=>{Sn.is(e)&&wS.is(t)&&t.translate(e,i,s)},copy:(t,e,i,s)=>{if(Sn.is(e)&&Sn.is(i)&&wS.is(t))return t.copy(e,i,s)},update:(t,e,i)=>{Sn.is(e)&&wS.is(t)&&t.update(e,i)},createState:(t,{createDatum:e})=>new qet({...t,create:e("quick-date-price-range")}),dragState:t=>new $e(t)},Wf=(R(),E(w)),{ZIndexMap:DF,TextWrapper:Jet,clamp:tit}=Wf._ModuleSupport,ES=class extends ML{constructor(){super(),this.type="note",this.shape=new Wf._ModuleSupport.Rect,this.iconBackground=new Wf._ModuleSupport.SvgPath("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 Wf._ModuleSupport.SvgPath("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 Wf._ModuleSupport.DropShadow,this.append([this.shape,this.label,this.iconBackground,this.iconLines,this.handle])}static is(t){return Li.isCheck(t,"note")}update(t,e){this.updateIcon(t,e),super.update(t,e)}getTextBBox(t,e,i){const s=super.getTextBBox(t,e,i);s.x-=t.width/2,s.x=tit(0,s.x,i.seriesRect.width-t.width);const n=t.getPadding().top,a=s.y-tz-n*2,o=s.y+Te.HANDLE_SIZE+n*2;return a-s.height-ez<0?(s.y=o,t.position="top"):(s.y=a+n,t.position="bottom"),s}updateLabel(t,e){const i=t.visible===!1?!1:this.label.visible;super.updateLabel(t,e),this.label.visible=i,this.label.text=Jet.wrapText(t.text,{font:{fontFamily:t.fontFamily,fontSize:t.fontSize,fontStyle:t.fontStyle,fontWeight:t.fontWeight},avoidOrphans:!1,textAlign:t.textAlign,textBaseline:"hanging",textWrap:"always",maxWidth:200})}updateShape(t,e){const{shape:i}=this;i.fill=t.background.fill,i.fillOpacity=t.background.fillOpacity??1,i.stroke=t.background.stroke,i.strokeOpacity=t.background.strokeOpacity??1,i.strokeWidth=t.background.strokeWidth??1,i.cornerRadius=4;const s=t.getPadding().top,n=t.position==="top";i.x=e.x-s,i.width=t.width+s*2,i.height=e.height+s*2,i.y=e.y+(n?0:-e.height)-s}updateIcon(t,e){const{active:i,iconBackground:s,iconLines:n}=this,{x:a,y:o}=Le(t,e);s.x=a-LJ/2,s.y=o-JB,n.x=s.x,n.y=s.y,s.fill=t.fill,s.fillOpacity=t.fillOpacity??1,s.stroke=t.stroke,s.strokeOpacity=t.strokeOpacity??1,s.strokeWidth=t.strokeWidth??1,n.fill=t.stroke,i?s.fillShadow.color=t.fill??"rgba(0, 0, 0, 0.22)":s.fillShadow.color="rgba(0, 0, 0, 0.22)"}updateAnchor(t,e,i){const s=t.getPadding().top,n=t.position==="top",a=n?1:-1;return{x:e.x+i.seriesRect.x+t.width/2,y:e.y+i.seriesRect.y+a*(e.height+s),position:n?"below":"above"}}getLabelCoords(t,e){const i=t.position==="top",s=t.getPadding().top;return{x:e.x,y:e.y+(i?s/2:0)}}getHandleCoords(t,e,i){return{x:e.x,y:e.y+Te.HANDLE_SIZE/2+4}}getHandleStyles(t){return{fill:t.handle.fill,stroke:t.handle.stroke??t.fill,strokeOpacity:t.handle.strokeOpacity,strokeWidth:t.handle.strokeWidth}}toggleHovered(t){super.toggleHovered(t),this.label.visible=t,this.shape.visible=t,this.zIndex=t?DF.CHART_ANNOTATION_FOCUSED:DF.CHART_ANNOTATION}toggleActive(t){super.toggleActive(t),this.label.visible=t,this.shape.visible=t,this.active=t}containsPoint(t,e){return this.shape.visible&&this.shape.containsPoint(t,e)||this.iconBackground.containsPoint(t,e)?!0:super.containsPoint(t,e)}},eit=class extends Vf{createDatum(){return new Ks}},kF={type:"note",datum:Ks,scene:ES,isDatum:Ks.is,translate:(t,e,i,s)=>{Ks.is(e)&&ES.is(t)&&t.translate(e,i,s)},copy:(t,e,i,s)=>{if(Ks.is(e)&&Ks.is(i)&&ES.is(t))return t.copy(e,i,s)},update:(t,e,i)=>{Ks.is(e)&&ES.is(t)&&t.update(e,i)},createState:(t,{createDatum:e})=>new eit({...t,create:e("note")}),dragState:t=>new $e(t)},iit=(R(),E(w)),{Vec2:To,Vec4:jd}=iit._ModuleSupport,RS=class extends eF{constructor(){super(),this.type="parallel-channel",this.ignoreYBounds=!0,this.handles={topLeft:new Te,topMiddle:new Ed,topRight:new Te,bottomLeft:new Te,bottomMiddle:new Ed,bottomRight:new Te},this.middleLine=new $s,this.append([this.background,this.topLine,this.middleLine,this.bottomLine,...Object.values(this.handles)])}static is(t){return Li.isCheck(t,"parallel-channel")}dragHandle(t,e,i,s){const{activeHandle:n,handles:a}=this;if(n==null)return;const{offset:o}=a[n].drag(e);a[n].toggleDragging(!0);const r=t.toJson();let l=[],c=[];switch(n){case"topLeft":case"bottomLeft":l=["topLeft","bottomLeft"],c=["topRight","bottomRight"];break;case"topMiddle":l=["topLeft","topRight"],o.y-=Ed.HANDLE_SIZE/2;break;case"topRight":case"bottomRight":l=["topRight","bottomRight"],c=["topLeft","bottomLeft"];break;case"bottomMiddle":l=["bottomLeft","bottomRight"],o.y-=Ed.HANDLE_SIZE/2;break}const h=t.snapToAngle,u=l.map((p,g)=>s&&c[g]?this.snapToAngle(e,i,p,c[g],h):ye(To.add(a[p].handle,o),i)).filter(RJ);if(u.some(p=>!Na(i,p,{y:!1})))return;const{value:d}=fe(t.start.y);if((n==="topMiddle"||n==="bottomMiddle")&&d!=null&&Ke(d)){const p=ye(To.add(a.topLeft.handle,o),i);n==="topMiddle"?t.height+=p.y-d:t.height-=p.y-d}for(const[p,g]of u.entries())switch(l[p]){case"topLeft":t.start.x=g.x,t.start.y=g.y;break;case"topRight":t.end.x=g.x,t.end.y=g.y;break}t.isValidWithContext(i)||t.set(r)}containsPoint(t,e){return super.containsPoint(t,e)||this.middleLine.visible&&this.middleLine.strokeWidth>0&&this.middleLine.containsPoint(t,e)}getNodeAtCoords(t,e){return this.middleLine.visible&&this.middleLine.strokeWidth>0&&this.middleLine.containsPoint(t,e)?"line":super.getNodeAtCoords(t,e)}updateLines(t,e,i,s,n,a){const{topLine:o,middleLine:r,bottomLine:l}=this,{lineDashOffset:c,stroke:h,strokeOpacity:u,strokeWidth:d}=t,p=t.getLineDash(),g={lineCap:t.getLineCap(),lineDash:p,lineDashOffset:c,stroke:h,strokeOpacity:u,strokeWidth:d};o.setProperties({...e,...g}),l.setProperties({...i,...g});const f=this.extendLine({x1:n.x1,y1:a.y1+(n.y1-a.y1)/2,x2:n.x2,y2:a.y2+(n.y2-a.y2)/2},t,s);r.setProperties({...f,lineDash:t.middle.lineDash??p,lineDashOffset:t.middle.lineDashOffset??c,stroke:t.middle.stroke??h,strokeOpacity:t.middle.strokeOpacity??u,strokeWidth:t.middle.strokeWidth??d,visible:t.middle.visible??!0})}updateHandles(t,e,i){const{handles:{topLeft:s,topMiddle:n,topRight:a,bottomLeft:o,bottomMiddle:r,bottomRight:l}}=this,c={fill:t.handle.fill,stroke:t.handle.stroke??t.stroke,strokeOpacity:t.handle.strokeOpacity??t.strokeOpacity,strokeWidth:t.handle.strokeWidth??t.strokeWidth};s.update({...c,...jd.start(e)}),a.update({...c,...jd.end(e)}),o.update({...c,...jd.start(i)}),l.update({...c,...jd.end(i)}),n.update({...c,...To.sub(jd.center(e),To.from(n.handle.width/2,n.handle.height/2))}),r.update({...c,...To.sub(jd.center(i),To.from(r.handle.width/2,r.handle.height/2))})}updateText(t,e,i){this.text=this.updateNode(Ih,this.text,!!t.text.label),Kz(!0,e,i,t.text,t.strokeWidth,this.text,t.text.label)}getBackgroundPoints(t,e,i,s){const n=e.x1>e.x2,a=e.y1>e.y2,o=e.x1!==i.x1&&e.y1!==i.y1,r=e.x2!==i.x2&&e.y2!==i.y2,l=To.from(e);return t.extendEnd&&r&&l.push(To.from(n?s.x1:s.x2,a?s.y1:s.y2)),l.push(...To.from(i).reverse()),t.extendStart&&o&&l.push(To.from(n?s.x2:s.x1,a?s.y2:s.y1)),l}},sit=(R(),E(w)),{StateMachine:Gl,StateMachineProperty:EL,Debug:nit}=sit._ModuleSupport,_S=class extends Gl{constructor(t){const e=({point:l})=>{const c=new Zn;c.set({start:l,end:l,height:0}),t.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:u}=this;h&&(h.set({end:Ff(l,c,u,h.start,h.snapToAngle)}),t.update())},n=()=>{this.node?.toggleHandles({topRight:!0}),t.update()},a=({point:l})=>{const{datum:c,node:h}=this,{value:u}=fe(c?.end.y),{value:d}=fe(c?.start.y),{y:p}=l;if(c==null||!Ke(d)||!Ke(u)||!Ke(p))return;const g=u-(p??0),f=d-g;h?.toggleHandles({bottomLeft:!0,bottomRight:!0}),!(!t.validatePoint({x:c.start.x,y:f})||!t.validatePoint({x:c.end.x,y:l.y}))&&(c.set({height:g}),t.update())},o=({point:l})=>{const{datum:c,node:h}=this,{value:u}=fe(c?.end.y),{value:d}=fe(c?.start.y),{y:p}=l;if(c==null||!Ke(d)||!Ke(u)||!Ke(p))return;const g=u-(p??0),f=d-g;h?.toggleHandles(!0),!(!t.validatePoint({x:c.start.x,y:f})||!t.validatePoint({x:c.end.x,y:l.y}))&&(c.set({height:g}),t.recordAction("Create parallel-channel annotation"),t.showAnnotationOptions(),t.update())},r=()=>t.delete();super("start",{start:{click:{target:"waiting-first-render",action:e},drag:{target:"waiting-first-render",action:e},reset:Gl.parent},"waiting-first-render":{render:{target:"end",action:i}},end:{hover:s,drag:s,click:{target:"height",action:n},dragEnd:{target:"height",action:n},reset:{target:Gl.parent,action:r},cancel:{target:Gl.parent,action:r}},height:{hover:a,click:{target:Gl.parent,action:o},drag:{target:Gl.parent,action:o},reset:{target:Gl.parent,action:r},cancel:{target:Gl.parent,action:r}}}),this.debug=nit.create(!0,"annotations"),this.snapping=!1}};y([EL()],_S.prototype,"datum",2),y([EL()],_S.prototype,"node",2),y([EL()],_S.prototype,"snapping",2);var LF={type:"parallel-channel",datum:Zn,scene:RS,isDatum:Zn.is,translate:(t,e,i,s)=>{Zn.is(e)&&RS.is(t)&&t.translate(e,i,s)},copy:(t,e,i,s)=>{if(Zn.is(e)&&Zn.is(i)&&RS.is(t))return t.copy(e,i,s)},update:(t,e,i)=>{Zn.is(e)&&RS.is(t)&&t.update(e,i)},createState:(t,{createDatum:e})=>new _S({...t,create:e("parallel-channel")}),dragState:t=>new $e(t)},PS=class extends ML{constructor(){super(),this.type="text",this.append([this.label,this.handle])}static is(t){return Li.isCheck(t,"text")}getHandleCoords(t,e){const i=Te.HANDLE_SIZE/2;return{x:e.x+i,y:e.y+2+i}}},ait=class extends Vf{createDatum(){return new kr}},TF={type:"text",datum:kr,scene:PS,isDatum:kr.is,translate:(t,e,i,s)=>{kr.is(e)&&PS.is(t)&&t.translate(e,i,s)},copy:(t,e,i,s)=>{if(kr.is(e)&&kr.is(i)&&PS.is(t))return t.copy(e,i,s)},update:(t,e,i)=>{kr.is(e)&&PS.is(t)&&t.update(e,i)},createState:(t,{createDatum:e})=>new ait({...t,create:e("text")}),dragState:t=>new $e(t)},In={[uF.type]:uF,[Qz.type]:Qz,[qz.type]:qz,[LF.type]:LF,[iF.type]:iF,[lF.type]:lF,[oF.type]:oF,[Gz.type]:Gz,[Hz.type]:Hz,[kF.type]:kF,[TF.type]:TF,[dF.type]:dF,[Rz.type]:Rz,[Ez.type]:Ez,[vF.type]:vF,[MF.type]:MF,[IF.type]:IF,[AF.type]:AF};function kh(t){for(const{isDatum:e}of Object.values(In))if(e(t))return t}var oit=(R(),E(w)),{ActionOnSet:rit,ParallelStateMachine:lit,StateMachine:RL,StateMachineProperty:Co,Debug:cit}=oit._ModuleSupport,BS=class extends lit{constructor(t){super(new hit(e=>{this.snapping=e}),new uit(()=>{this.node=this.active==null?void 0:t.node(this.active)}),new Wl(t,e=>{this.active=e,this.datum=this.active==null?void 0:t.datum(this.active),this.node=this.active==null?void 0:t.node(this.active)})),this.snapping=!1}getActive(){return this.active}isActive(t){return t===this.active}};y([Co()],BS.prototype,"snapping",2),y([Co()],BS.prototype,"datum",2),y([Co()],BS.prototype,"node",2);var hit=class extends RL{constructor(t){super("idle",{idle:{hover:({shiftKey:e})=>t(e),keyDown:({shiftKey:e})=>t(e),keyUp:({shiftKey:e})=>t(e),click:({shiftKey:e})=>t(e),drag:({shiftKey:e})=>t(e)},dragging:{},"text-input":{}})}},uit=class extends RL{constructor(t){super("idle",{idle:{onEnter:t,render:t},dragging:{onEnter:t,render:t},"text-input":{render:t}})}},Wl=class extends RL{constructor(t,e){const i=v=>S=>{t.create(v,S),this.active=t.selectLast()},s=()=>{this.active!=null&&t.delete(this.active),this.active=void 0,t.select()},n={createDatum:i},a={...t,delete:s,showTextInput:()=>{this.active!=null&&t.showTextInput(this.active)},deselect:()=>{const v=this.active;this.active=void 0,this.hovered=void 0,t.select(this.active,v)},showAnnotationOptions:()=>{this.active!=null&&t.showAnnotationOptions(this.active)}},o=Object.fromEntries(Object.entries(In).map(([v,S])=>[v,S.createState(a,n)])),r=Object.fromEntries(Object.entries(In).map(([v,S])=>[v,S.dragState(t,n)])),l=({colorPickerType:v,colorOpacity:S,color:A,opacity:T,isMultiColor:D})=>{this.datum&&(v==="text-color"&&t.updateTextInputColor(A),dS(this.datum,v,S,A,T,D),t.update())},c=v=>{const{datum:S,node:A}=this;!S||!A||(Do(S)?(S.fontSize=v,t.updateTextInputFontSize(v)):Od(S)&&(S.text.fontSize=v),t.update())},h=v=>{const{datum:S,node:A}=this;!S||!A||!wl(S)||(uz(S,v),t.update())},u=v=>{const{node:S}=this;!S||!("setTextInputBBox"in S)||(S.setTextInputBBox(v),t.update())},d=({textInputValue:v,bbox:S})=>{const{datum:A}=this;if(S!=null&&v!=null&&v.length>0){if(!Do(A))return;const T=oS(A,v,S.width);A.set({text:T}),t.update(),t.recordAction(`Change ${A.type} annotation text`)}else t.delete(this.active),t.recordAction(`Delete ${A?.type} annotation`)},p=()=>{t.updateTextInputBBox(void 0)},g=()=>this.active!=null,f=()=>this.copied!=null,x=()=>{const{active:v,datum:S}=this;return v==null||!S?!1:Od(S)&&!S.locked},m=()=>this.active!=null&&!Ol(this.datum),b=()=>this.hovered!=null;super("idle",{idle:{onEnter:()=>{t.select(this.active,this.active),this.hoverCoords&&(this.hovered=t.hoverAtCoords(this.hoverCoords,this.active,this.hovered))},hover:({offset:v})=>{this.hovered=t.hoverAtCoords(v,this.active,this.hovered),this.hoverCoords=v},translate:{guard:g,action:({translation:v})=>{t.startInteracting(),t.translate(this.active,v),t.update()}},translateEnd:{guard:g,action:()=>{t.stopInteracting()}},copy:{guard:m,action:()=>{this.copied=t.copy(this.active)}},cut:{guard:m,action:()=>{this.copied=t.copy(this.active),s()}},paste:{guard:f,action:()=>{t.paste(this.copied)}},selectLast:()=>{const v=this.active;this.active=t.selectLast(),t.select(this.active,v)},click:[{guard:()=>{const{active:v,hovered:S,datum:A}=this;return v==null||S!==v||!A?!1:Do(A)&&!A.locked},target:"text-input"},{action:()=>{const v=this.active;this.active=this.hovered,t.select(this.active,v)}}],dblclick:{guard:x,action:({offset:v})=>{const S=t.getNodeAtCoords(v,this.active)==="text"?"text":"line";t.showAnnotationSettings(this.active,void 0,S)}},dragStart:[{guard:b,target:"dragging",action:()=>{const v=this.active;this.active=this.hovered,t.select(this.active,v),t.startInteracting()}},{action:()=>{const v=this.active;this.active=this.hovered,t.select(this.active,v)}}],color:{guard:g,action:l},fontSize:{guard:g,action:c},lineProps:{guard:g,action:v=>{const S=kh(this.datum);S?.set(v),t.update(),t.recordAction(`Change ${S?.type} ${Object.entries(v).map(([A,T])=>`${A} to ${T}`).join(", ")}`)}},lineStyle:{guard:g,action:h},lineText:{guard:g,action:v=>{const S=kh(this.datum);Od(S)&&(Lr(S)&&v.position==="center"&&(v.position="inside"),S.text.set(v),t.update())}},updateTextInputBBox:{guard:g,action:u},toolbarPressSettings:{guard:x,action:v=>{t.showAnnotationSettings(this.active,v)}},reset:()=>{this.active!=null&&this.node?.toggleActive(!1),this.hovered=void 0,this.active=void 0,t.select(this.active,this.active),t.resetToIdle()},delete:()=>{this.active!=null&&(t.delete(this.active),!Ol(this.datum)&&t.recordAction(`Delete ${this.datum?.type} annotation`))},deleteAll:()=>{t.deleteAll()},...o},dragging:{onEnter:(v,S)=>{if(this.active==null)return;const A=t.getAnnotationType(this.active);A&&(this.transitionRoot(A),this.transitionRoot("dragStart",S))},...r},"text-input":{onEnter:()=>{if(this.active==null)return;const v=kh(this.datum);!v||!("getTextInputCoords"in v)||(t.startInteracting(),t.showTextInput(this.active),v.visible=!1,t.update())},updateTextInputBBox:{guard:g,action:u},resize:{target:"idle",action:d},click:{target:"idle",action:d},drag:{target:"idle",action:d},textInput:[{guard:bL,target:"idle",action:p},{guard:SL,target:"idle",action:d}],color:{guard:g,action:l},fontSize:{guard:g,action:c},cancel:{target:"idle",action:p},onExit:()=>{t.stopInteracting(),t.hideTextInput();const v=this.active;if(this.active=this.hovered=void 0,t.select(this.active,v),v==null)return;const S=t.datum(v),A=t.node(v);!S||!A||(S.visible=!0)}}}),this.setActive=e,this.debug=cit.create(!0,"annotations"),this.snapping=!1}};y([rit({changeValue(t){this.setActive(t)}}),Co()],Wl.prototype,"active",2),y([Co()],Wl.prototype,"hovered",2),y([Co()],Wl.prototype,"hoverCoords",2),y([Co()],Wl.prototype,"copied",2),y([Co()],Wl.prototype,"snapping",2),y([Co()],Wl.prototype,"datum",2),y([Co()],Wl.prototype,"node",2);var _L=(R(),E(w)),{ARRAY:dit,BOOLEAN:pit,UNION:git,POSITIVE_NUMBER:fit,ActionOnSet:yit,LayoutElement:mit,Menu:xit,PropertiesArray:bit,ToolbarButtonProperties:Sit,Validate:zS,ChartAxisDirection:vit}=_L._ModuleSupport,CF=class extends Sit{};y([zS(git(["line-menu","fibonacci-menu","text-menu","shape-menu","measurer-menu","clear"]))],CF.prototype,"value",2);var FS=class extends _L._ModuleSupport.BaseProperties{constructor(t){super(),this.ctx=t,this.enabled=!0,this.padding=20,this.buttons=new bit(CF),this.events=new _L._ModuleSupport.Listeners,this.annotationMenu=new xit(this.ctx,"annotations"),this.destroyFns=[],this.toolbar=t.sharedToolbar.getSharedToolbar("annotations");const e=this.onKeyDown.bind(this);this.toolbar.addListener("keydown",e),this.destroyFns.push(this.toolbar.addToolbarListener("button-pressed",this.onToolbarButtonPress.bind(this)),t.layoutManager.registerElement(mit.ToolbarLeft,this.onLayoutStart.bind(this)),()=>{this.toolbar.removeListener("keydown",e),this.toolbar.destroy()})}destroy(){for(const t of this.destroyFns)t()}addListener(t,e){return this.events.addListener(t,e)}toggleVisibility(t){this.toolbar.setHidden(!t)}toggleClearButtonEnabled(t){const e=this.buttons.findIndex(i=>i.value==="clear");this.toolbar.toggleButtonEnabledByIndex(e,t)}resetButtonIcons(){for(const[t,e]of this.buttons.entries())switch(e.value){case"line-menu":this.updateButtonByIndex(t,{icon:"trend-line-drawing",value:"line-menu"});break;case"fibonacci-menu":this.updateButtonByIndex(t,{icon:"fibonacci-retracement-drawing",value:"fibonacci-menu"});break;case"text-menu":this.updateButtonByIndex(t,{icon:"text-annotation",value:"text-menu"});break;case"shape-menu":this.updateButtonByIndex(t,{icon:"arrow-drawing",value:"shape-menu"});break;case"measurer-menu":this.updateButtonByIndex(t,{icon:"measurer-drawing",value:"measurer-menu"});break}}hideOverlays(){this.annotationMenu.hide()}clearActiveButton(){this.toolbar.clearActiveButton()}dispatch(t,e){this.events.dispatch(t,e)}onLayoutStart(t){this.enabled&&(this.toolbar.updateButtons(this.buttons),this.toolbar.layout(t.layoutBox,this.padding))}refreshButtonsEnabled(t){for(const[e,i]of this.buttons.entries())i&&this.toolbar.toggleButtonEnabledByIndex(e,t)}onToolbarButtonPress({event:t,button:e,buttonBounds:i}){const s=this.ctx.axisManager.getAxisContext(vit.Y)[0].scale;switch(e.value){case"clear":this.dispatch("pressed-clear");break;case"line-menu":this.onToolbarButtonPressShowMenu(t,i,e.value,"toolbarAnnotationsLineAnnotations",ftt.filter(n=>n.visible?n.visible(s):!0));break;case"fibonacci-menu":this.onToolbarButtonPressShowMenu(t,i,e.value,"toolbarAnnotationsFibonacciAnnotations",ytt);break;case"text-menu":this.onToolbarButtonPressShowMenu(t,i,e.value,"toolbarAnnotationsTextAnnotations",xtt);break;case"shape-menu":this.onToolbarButtonPressShowMenu(t,i,e.value,"toolbarAnnotationsShapeAnnotations",btt);break;case"measurer-menu":this.onToolbarButtonPressShowMenu(t,i,e.value,"toolbarAnnotationsMeasurerAnnotations",Stt);break}}onToolbarButtonPressShowMenu(t,e,i,s,n){this.dispatch("pressed-show-menu");const a=this.buttons.findIndex(o=>o.value===i);this.toolbar.toggleActiveButtonByIndex(a),this.annotationMenu.setAnchor({x:e.x+e.width+6,y:e.y}),this.annotationMenu.show({items:n,ariaLabel:this.ctx.localeManager.t(s),class:"ag-charts-annotations__toolbar-menu",sourceEvent:t.sourceEvent,onPress:this.onButtonPressMenuCreateAnnotation.bind(this,i)})}onButtonPressMenuCreateAnnotation(t,e){const i=this.buttons.findIndex(s=>s.value===t);this.updateButtonByIndex(i,{icon:e.icon}),this.dispatch("pressed-create-annotation",{annotation:e.value}),this.annotationMenu.hide()}onKeyDown({sourceEvent:t}){t.key==="Escape"&&this.dispatch("cancel-create-annotation")}updateButtonByIndex(t,e){const i=this.buttons.at(t);i&&(i.set({...i.toJson(),...e,value:e.value??i.value}),this.toolbar.updateButtonByIndex(t,{...i.toJson()}))}};y([zS(pit),yit({changeValue(t){this.toolbar?.setHidden(!t)}})],FS.prototype,"enabled",2),y([zS(fit)],FS.prototype,"padding",2),y([zS(dit)],FS.prototype,"buttons",2);var NF=(R(),E(w)),{BaseModuleInstance:Mit,InteractionState:Uf,Validate:Iit,BOOLEAN:Ait,ChartAxisDirection:Dit,getIconClassNames:kit}=NF._ModuleSupport,Hf="ag-charts-annotations__axis-button",OF=class extends Mit{constructor(t,e,i,s){super(),this.ctx=t,this.axisCtx=e,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=!!e.scale.bandwidth,t.domManager.addEventListener("focusin",({target:n})=>{const a=n instanceof HTMLElement?n:void 0;!(a&&t.domManager.contains(a,"series-area"))&&a!==this.button.getElement()&&this.hide()}),this.destroyFns.push(t.widgets.seriesWidget.addListener("drag-move",n=>this.onMouseDrag(n)),t.widgets.seriesWidget.addListener("mousemove",n=>this.onMouseMove(n)),t.widgets.seriesWidget.addListener("mouseleave",()=>this.onMouseLeave()),t.widgets.seriesDragInterpreter.addListener("click",n=>this.onClick(n)),t.chartEventManager.addListener("series-focus-change",()=>this.onKeyPress()),t.zoomManager.addListener("zoom-pan-start",()=>this.hide()),t.zoomManager.addListener("zoom-change",()=>this.hide()),()=>this.destroyElements(),()=>this.button.destroy())}update(t,e){this.seriesRect=t,this.padding=e}setup(){const t=new NF._Widget.ButtonWidget;return t.addClass(Hf),t.setTabIndex(-1),t.setAriaLabel(this.ctx.localeManager.t("ariaLabelAddHorizontalLine")),this.ctx.widgets.seriesWidget.getElement().appendChild(t.getElement()),t}destroyElements(){this.ctx.domManager.removeChild("canvas-overlay",Hf)}onMouseMove(t){this.ctx.interactionManager.isState(Uf.Clickable)&&this.show(t)}onMouseDrag(t){this.ctx.interactionManager.isState(Uf.AnnotationsMoveable)&&this.show(t)}onMouseLeave(){this.ctx.interactionManager.isState(Uf.Clickable)&&this.hide()}onClick(t){this.ctx.interactionManager.isState(Uf.Clickable)&&t.device==="touch"&&this.show(t)}show(t){const{sourceEvent:e,currentX:i,currentY:s}=t;if(!(this.enabled&&this.ctx.widgets.seriesWidget.getElement().contains(e.target))){this.hide();return}this.toggleVisibility(!0);const n=this.getButtonCoordinates({x:i,y:s});this.coords={x:n.x+this.button.clientWidth/2,y:n.y+this.button.clientHeight/2},this.updatePosition(n)}hide(){this.toggleVisibility(!1)}onKeyPress(){this.snap&&this.ctx.interactionManager.isState(Uf.Default)||this.hide()}getButtonCoordinates({x:t,y:e}){const{axisCtx:{direction:i,position:s},seriesRect:n,snap:a,axisCtx:o,padding:r}=this,{clientWidth:l,clientHeight:c}=this.button,[h,u]=[0,n.height],[d,p]=[0,n.width];if(a&&(t=Nl(Rf(t-n.x,o),o)+n.x,e=Nl(Rf(e-n.y,o),o)+n.y),i===Dit.X){const f=c-Math.max(0,r-5);t=t-l/2,e=s==="top"?h-c+f:u-f}else{const f=l-Math.max(0,r-9);t=s==="left"?d-l+f:p-f,e=e-c/2}return{x:t,y:e}}toggleVisibility(t){const{button:e}=this;if(e==null)return;const i=this.enabled&&t;this.toggleClass("-hidden",!i)}toggleClass(t,e){this.button.toggleClass(`${Hf}-${t}`,e)}updatePosition({x:t,y:e}){this.button.getElement().style.transform=`translate(${Math.round(t)}px, ${Math.round(e)}px)`}updateButtonElement(){const{button:t}=this;t.addListener("click",()=>this.onButtonClick(this.coords)),t.addListener("touchend",()=>this.onButtonClick(this.coords)),t.addListener("drag-start",()=>{}),t.setInnerHTML(``)}};y([Iit(Ait)],OF.prototype,"enabled",2);var Lit=(R(),E(w)),Tit=(R(),E(w)),{Color:wF,DraggablePopover:Cit,NativeWidget:PL,Vec2:ri,createButton:jS,createCheckbox:Nit,createElementId:EF,createSelect:Oit,createTextArea:wit,initRovingTabIndex:RF,getIconClassNames:Eit,mapValues:BL,setAttribute:Rit,setAttributes:zL,createElement:Nr,getWindow:_it}=Tit._ModuleSupport,_F=class BN extends Cit{constructor(e,i){super(e,i),this.dragHandleDraggingClass="ag-charts-dialog__drag-handle--dragging",this.colorPicker=new fz(this.ctx,{detached:!0}),this.destroyFns.push(e.layoutManager.addListener("layout:complete",this.onLayoutComplete.bind(this)))}showWithChildren(e,i){const s=super.showWithChildren(e,i);return s.classList.add("ag-charts-dialog"),s.setAttribute("role","dialog"),s.addEventListener("mousedown",n=>{n.target.classList?.contains("ag-charts-dialog__color-picker-button")||this.colorPicker.hide()}),s.addEventListener("keydown",this.onKeyDown.bind(this)),_it().requestAnimationFrame(()=>this.reposition()),this.colorPicker.attachTo(this),s}updatePosition(e){super.updatePosition(e);const{anchor:i,fallbackAnchor:s}=this.getColorPickerAnchors()??{};i&&this.colorPicker.setAnchor(i,s)}createTabs(e,i,s){const n=Nr("div","ag-charts-dialog__tabs"),a=BL(s,()=>EF("ag-charts-dialog__tab")),o=BL(s,()=>EF("ag-charts-dialog__tab-panel"));for(const[p,g]of Object.entries(s))zL(g.panel,{id:o[p],role:"tabpanel","aria-labelledby":a[p]});const r=p=>{for(const[g,f]of Object.entries(s))f.panel.classList.toggle("ag-charts-dialog__tab-panel--active",g===p),h[g].classList.toggle("ag-charts-dialog__tab-button--active",g===p),Rit(h[g],"aria-selected",g===p),g===p&&f.onShow?.()},l=new PL(Nr("div","ag-charts-dialog__header"));l.addListener("drag-start",p=>{const{sourceEvent:g}=p;g.target instanceof Element&&g.target.classList.contains("ag-charts-dialog__header")&&this.onDragStart(p)}),l.addListener("drag-move",p=>this.onDragMove(p)),l.addListener("drag-end",()=>this.onDragEnd());const c=new Bit;this.setDragHandle(c);const h=BL(s,(p,g)=>jS({label:this.ctx.localeManager.t(p.label),onPress:()=>r(g)},{id:a[g],class:"ag-charts-dialog__tab-button",role:"tab","aria-controls":o[g]})),u=Nr("div","ag-charts-dialog__tab-list");zL(u,{role:"tablist","aria-label":this.ctx.localeManager.t(e)}),u.append(...Object.values(h));const d=this.createHeaderCloseButton();return l.getElement().append(c.getElement(),u,d),n.append(l.getElement(),...Object.values(s).map(p=>p.panel)),r(i),RF({orientation:"horizontal",buttons:Object.values(h)}),{tabs:n,initialFocus:h[i]}}createTabPanel(){return Nr("div","ag-charts-dialog__tab-panel")}createInputGroupLine(){return Nr("div","ag-charts-dialog__input-group-line")}createRadioGroup({label:e,options:i,value:s,onChange:n}){const a=this.createInputGroup(e);zL(a,{role:"radiogroup",tabindex:-1,"aria-label":this.ctx.localeManager.t(e)});const o="ag-charts-dialog__button--active",r=[];for(const l of i){const{icon:c,altText:h}=l,u=this.ctx.localeManager.t(h),d=jS({icon:c,altText:u,onPress:()=>{for(const p of Array.from(a.children))p.classList.remove(o),p.ariaChecked="false";d.classList.add(o),d.ariaChecked="true",n(l.value)}},{"aria-checked":l.value===s,class:"ag-charts-dialog__button",role:"radio",title:u});l.value===s&&d.classList.add(o),a.appendChild(d),r.push(d)}return RF({orientation:"horizontal",buttons:r}),a}createSelect({altText:e,label:i,options:s,value:n,onChange:a}){const o=this.createInputGroup(i),r=this.ctx.localeManager.t(e),l=Oit({value:n,options:s,onChange:a},{class:"ag-charts-dialog__select","aria-label":r,title:r});return o.append(l),o}createTextArea({placeholder:e,value:i,onChange:s}){const n=e?this.ctx.localeManager.t(e):void 0;return wit({value:i,onChange:s},{placeholder:n})}createCheckbox({label:e,checked:i,onChange:s}){const n=`ag-charts__${e}`,a=this.createInputGroup(e,{for:n}),o=Nit({checked:i,onChange:s},{class:"ag-charts-dialog__checkbox",role:"switch",id:n});return a.append(o),a}createColorPicker({color:e,opacity:i,label:s,altText:n,onChange:a,onChangeHide:o,isMultiColor:r,hasMultiColorOption:l}){const c=this.createInputGroup(s),h=this.ctx.localeManager.t(n),u=jS({label:h,onPress:d=>{const{anchor:p,fallbackAnchor:g}=this.getColorPickerAnchors(u)??{};this.colorPicker.show({anchor:p,fallbackAnchor:g,color:e,opacity:i,isMultiColor:r,hasMultiColorOption:l,sourceEvent:d,onChange:(f,x,m,b)=>{u.style.setProperty("--color",f),u.classList.toggle("ag-charts-dialog__color-picker-button--multi-color",b),a(f,x,m,b)},onChangeHide:o})}},{"aria-label":h,tabindex:0,class:"ag-charts-dialog__color-picker-button",title:h});if(r)u.classList.toggle("ag-charts-dialog__color-picker-button--multi-color");else if(e){const d=wF.fromString(e),p=new wF(d.r,d.g,d.b,i);u.style.setProperty("--color",p.toHexString())}return c.append(u),this.hideFns.push(()=>{this.colorPicker.hide()}),c}createHeaderCloseButton(){return jS({icon:"close",altText:this.ctx.localeManager.t("iconAltTextClose"),onPress:()=>this.hide()},{class:"ag-charts-dialog__close-button"})}createInputGroup(e,i){const s=Nr("div","ag-charts-dialog__input-group"),n=Nr("label","ag-charts-dialog__input-group-label");return n.innerText=this.ctx.localeManager.t(e),i?.for&&n.setAttribute("for",i.for),s.appendChild(n),s}onLayoutComplete(e){this.seriesRect=e.series.paddedRect,this.reposition()}onKeyDown(e){e.altKey||e.ctrlKey||e.metaKey||e.isComposing||e.key!=="Escape"||this.hide()}reposition(){const{seriesRect:e,ctx:i}=this,s=i.domManager.getBoundingClientRect(),n=this.getPopoverElement();if(!e||!n)return;const a=ri.from(0,e.y),o=ri.from(s.width,e.height),r=ri.from(n),l=ri.from(.5,1);let c;if(e.width>1e3){const h=ri.sub(ri.add(a,ri.multiply(o,l)),ri.multiply(r,l));c=ri.sub(h,ri.from(0,BN.offset))}else{const h=ri.sub(ri.add(a,o),r);c=ri.sub(h,BN.offset)}this.updatePosition(c)}getColorPickerAnchors(e){if(e&&(this.colorPickerAnchorElement=e),!this.colorPickerAnchorElement)return;const i=this.colorPickerAnchorElement.getBoundingClientRect(),s=this.ctx.domManager.getBoundingClientRect(),n=ri.sub(ri.from(i.x,i.y),ri.from(s.left,s.top)),a=ri.add(n,ri.from(0,i.height+5)),o=ri.sub(n,ri.from(0,5));return{anchor:a,fallbackAnchor:o}}};_F.offset=60;var Pit=_F,Bit=class extends PL{constructor(){super(Nr("div","ag-charts-dialog__drag-handle"));const t=new PL(Nr("span",Eit("drag-handle")));t.setAriaHidden(!0),this.addChild(t)}},{Listeners:zit,focusCursorAtEnd:Fit}=Lit._ModuleSupport,jit=class extends Pit{constructor(t){super(t,"settings"),this.events=new zit,this.hideFns.push(()=>this.events.dispatch("hidden"))}addListener(t,e){return this.events.addListener(t,e)}show(t,e){const i=this.createLinearLineTab(t,e),s=this.createLinearTextTab(t,e);let n="dialogHeaderLine";Lr(t)?n="dialogHeaderChannel":hz(t)?n="dialogHeaderFibonacciRange":t.type==="date-range"?n="dialogHeaderDateRange":t.type==="price-range"?n="dialogHeaderPriceRange":t.type==="date-price-range"&&(n="dialogHeaderDatePriceRange");const{tabs:a,initialFocus:o}=this.createTabs("ariaLabelSettingsTabBar",e.initialSelectedTab,{line:{label:n,panel:i},text:{label:"dialogHeaderText",panel:s.panel,onShow:s.onShow}});e.initialFocus=o,this.showWithChildren([a],e).classList.add("ag-charts-dialog--annotation-settings")}createLinearLineTab(t,e){const i=this.createTabPanel(),s=this.createInputGroupLine(),n=this.createInputGroupLine(),a="isMultiColor"in t,o=this.createColorPickerInput("line-color",t.getDefaultColor("line-color"),t.getDefaultOpacity("line-color"),a?t.isMultiColor:!1,a,e.onChangeLineColor,e.onChangeHideLineColor),r=this.createStrokeWidthSelect(t.strokeWidth??2,e.onChangeLineStyleWidth),l=this.createLineStyleRadioGroup(t.lineStyle??"solid",e.onChangeLineStyleType);if(s.append(o),"background"in t){const c=this.createColorPickerInput("fill-color",t.getDefaultColor("fill-color"),t.getDefaultOpacity("fill-color"),!1,!1,e.onChangeFillColor,e.onChangeHideFillColor);s.append(c),n.append(r)}else"showFill"in t?(s.append(this.createCheckbox({label:"dialogInputShowFill",checked:t.showFill??!0,onChange:c=>e.onChangeLine({showFill:c})})),n.append(r)):s.append(r);return n.append(l),i.append(s,n),"bands"in t&&i.append(this.createFibonacciRatioSelect(t.bands??10,c=>e.onChangeLine({bands:c}))),"extendStart"in t&&"extendEnd"in t&&i.append(this.createCheckbox({label:Lr(t)?"dialogInputExtendChannelStart":"dialogInputExtendLineStart",checked:t.extendStart??!1,onChange:c=>e.onChangeLine({extendStart:c})}),this.createCheckbox({label:Lr(t)?"dialogInputExtendChannelEnd":"dialogInputExtendLineEnd",checked:t.extendEnd??!1,onChange:c=>e.onChangeLine({extendEnd:c})})),"extendAbove"in t&&"extendBelow"in t&&i.append(this.createCheckbox({label:"dialogInputExtendAbove",checked:t.extendAbove??!1,onChange:c=>e.onChangeLine({extendAbove:c})}),this.createCheckbox({label:"dialogInputExtendBelow",checked:t.extendBelow??!1,onChange:c=>e.onChangeLine({extendBelow:c})})),"extendLeft"in t&&"extendRight"in t&&i.append(this.createCheckbox({label:"dialogInputExtendLeft",checked:t.extendLeft??!1,onChange:c=>e.onChangeLine({extendLeft:c})}),this.createCheckbox({label:"dialogInputExtendRight",checked:t.extendRight??!1,onChange:c=>e.onChangeLine({extendRight:c})})),"reverse"in t&&"showFill"in t&&i.append(this.createCheckbox({label:"dialogInputReverse",checked:t.reverse??!1,onChange:c=>e.onChangeLine({reverse:c})})),i}createLinearTextTab(t,e){const i=this.createTabPanel(),s=this.createTextArea({placeholder:"inputTextareaPlaceholder",value:t.text.label,onChange:h=>e.onChangeText({label:h})}),n=this.createFontSizeSelect(t.text.fontSize,e.onChangeTextFontSize),a=this.createColorPickerInput("text-color",t.text.color,1,!1,!1,e.onChangeTextColor,e.onChangeHideTextColor),o=t.text.position==="inside"?"center":t.text.position,r=this.createPositionRadioGroup(o??"top",h=>e.onChangeText({position:h})),l=this.createAlignmentRadioGroup(t.text.alignment??"center",h=>e.onChangeText({alignment:h})),c=this.createInputGroupLine();return c.append(n,a,r,l),i.append(s,c),{panel:i,onShow:()=>Fit(s)}}createColorPickerInput(t,e,i,s,n,a,o){const r=t==="fill-color"?"dialogInputFillColorPicker":"dialogInputColorPicker",l=t==="fill-color"?"dialogInputFillColorPickerAltText":"dialogInputColorPickerAltText";return this.createColorPicker({label:r,altText:l,color:e,opacity:i,isMultiColor:s,hasMultiColorOption:n,onChange:a,onChangeHide:o})}createStrokeWidthSelect(t,e){return this.createSelect({label:"dialogInputStrokeWidth",altText:"dialogInputStrokeWidthAltText",options:xz.map(({label:i,value:s})=>({label:i,value:`${s}`})),value:String(t),onChange:i=>e(Number(i))})}createFibonacciRatioSelect(t,e){return this.createSelect({label:"dialogInputFibonacciBands",altText:"dialogInputFibonacciBandsAltText",options:mtt.map(({label:i,value:s})=>({label:i,value:`${s}`})),value:String(t),onChange:i=>e(Number(i))})}createLineStyleRadioGroup(t,e){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:t,onChange:e})}createFontSizeSelect(t,e){return this.createSelect({label:"dialogInputFontSize",altText:"dialogInputFontSizeAltText",options:bz.map(({label:i,value:s})=>({label:i,value:String(s)})),value:String(t),onChange:i=>e(Number(i))})}createPositionRadioGroup(t,e){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:t,onChange:e})}createAlignmentRadioGroup(t,e){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:t,onChange:e})}};function FL(t){return t.gridPadding+t.seriesAreaPadding+t.tickSize+t.label.spacing}function Vit(t,e,i){for(const{update:s}of Object.values(In))s(t,e,i)}var{BOOLEAN:PF,OBJECT:jL,ChartUpdateType:Git,InteractionState:Xs,ObserveChanges:Wit,PropertiesArray:Uit,Validate:Yf,ChartAxisDirection:Hit,Vec2:Lh,keyProperty:Yit,valueProperty:Kit,Selection:$it,BBox:Xit}=qb._ModuleSupport,Vd=class c3 extends qb._ModuleSupport.BaseModuleInstance{constructor(e){super(),this.ctx=e,this.enabled=!0,this.toolbar=new FS(this.ctx),this.optionsToolbar=new uL(this.ctx,()=>{const i=this.state.getActive();if(i!=null)return kh(this.annotationData.at(i))}),this.axesButtons=new Vk,this.snap=!1,this.data=void 0,this.xKey=void 0,this.volumeKey=void 0,this.annotationData=new Uit(c3.createAnnotationDatum),this.defaults=new dtt,this.container=new qb._ModuleSupport.Group({name:"static-annotations"}),this.annotations=new $it(this.container,this.createAnnotationScene.bind(this)),this.settingsDialog=new jit(this.ctx),this.textInput=new Mq(this.ctx),this.restoreAnnotations=!0,this.postUpdateFns=[],this.state=this.setupStateMachine(),this.setupListeners(),this.setupDOM(),this.ctx.historyManager.addMementoOriginator(e.annotationManager),this.ctx.historyManager.addMementoOriginator(this.defaults),this.textInput.setKeyDownHandler(this.onTextInput.bind(this))}setupStateMachine(){const{ctx:e}=this;return new BS({resetToIdle:()=>{e.domManager.updateCursor("annotations"),this.popAnnotationState(Xs.Annotations),this.hideOverlays(),this.optionsToolbar.hide(),this.deleteEphemeralAnnotations(),this.update()},hoverAtCoords:(i,s,n)=>{let a;return this.annotations.each((o,r,l)=>{const c=o.containsPoint(i.x,i.y);c&&(a??(a=l)),o.toggleHovered(c||s===l)}),a!=null?e.tooltipManager.suppressTooltip("annotations"):this.isAnnotationState()||e.tooltipManager.unsuppressTooltip("annotations"),this.ctx.domManager.updateCursor("annotations",a==null?void 0:this.annotations.at(a)?.getCursor()),a!==n&&this.update(),a},getNodeAtCoords:(i,s)=>{const n=this.annotations.at(s);if(n)return n.getNodeAtCoords(i.x,i.y)},translate:(i,s)=>{const n=this.annotations.at(i),a=kh(this.annotationData.at(i));if(!(!n||!a))return this.translateNode(n,a,s)},copy:i=>{const s=this.annotations.at(i),n=kh(this.annotationData.at(i));if(!(!s||!n))return this.createAnnotationDatumCopy(s,n)},paste:i=>{this.createAnnotation(i.type,i,!1),this.postUpdateFns.push(()=>{this.state.transitionAsync("selectLast"),this.state.transitionAsync("copy")})},select:(i,s)=>{const{annotations:n,optionsToolbar:a,toolbar:o}=this;this.hideOverlays(),o.clearActiveButton(),o.resetButtonIcons();const r=i!=null?n.at(i):null,l=s!=null?n.at(s):null;l===r&&r!=null||(l?.toggleActive(!1),a.hide(),r?(this.pushAnnotationState(Xs.AnnotationsSelected),r.toggleActive(!0),a.updateButtons(this.annotationData.at(i)),this.postUpdateFns.push(()=>{a.show(),a.setAnchorScene(r)})):(this.popAnnotationState(Xs.AnnotationsSelected),this.popAnnotationState(Xs.Annotations)),this.deleteEphemeralAnnotations(),this.update())},selectLast:()=>(this.pushAnnotationState(Xs.AnnotationsSelected),this.annotationData.length-1),startInteracting:()=>{this.pushAnnotationState(Xs.Annotations)},stopInteracting:()=>{this.popAnnotationState(Xs.Annotations)},create:(i,s)=>{this.createAnnotation(i,s)},delete:i=>{this.annotationData.splice(i,1)},deleteAll:()=>{this.annotationData.splice(0,this.annotationData.length)},validatePoint:i=>{const s=this.getAnnotationContext();return s?Na(s,i):!0},getAnnotationType:i=>Nq(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?this.annotations.at(i):null;s!=null&&this.optionsToolbar.setAnchorScene(s)}),this.update()},showTextInput:i=>{const s=kh(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()},o=this.getAnnotationContext(),r=c=>Lh.add(s.getTextInputCoords(o,c),Lh.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||Ol(this.annotationData.at(i))||(this.optionsToolbar.updateButtons(this.annotationData.at(i)),this.optionsToolbar.show(),this.optionsToolbar.setAnchorScene(s))},showAnnotationSettings:(i,s,n="line")=>{const a=this.annotationData.at(i);if(!uS(a)&&!Lr(a)&&!Bf(a)||Ol(a))return;const o=c=>(h,u,d,p)=>{this.setColorAndDefault(a.type,c,h,u,d,p),this.optionsToolbar.updateColorPickerColor(c,u,d,p)},r=c=>()=>{this.recordActionAfterNextUpdate(`Change ${a.type} ${c} to ${a.getDefaultColor(c)}`,["annotations","defaults"]),this.update()},l={initialSelectedTab:n,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.entries(c).map(([h,u])=>`${h} to ${u}`).join(", ")}`)},onChangeFillColor:o("fill-color"),onChangeHideFillColor:r("fill-color"),onChangeLineColor:o("line-color"),onChangeHideLineColor:r("line-color"),onChangeLineStyleType:c=>{this.setLineStyleTypeAndDefault(a.type,c),this.optionsToolbar.updateLineStyleType(zf.find(h=>h.value===c)??zf[0])},onChangeLineStyleWidth:c=>{this.setLineStyleWidthAndDefault(a.type,c),this.optionsToolbar.updateStrokeWidth({strokeWidth:c,value:c,label:String(c)})},onChangeTextColor:o("text-color"),onChangeHideTextColor:r("text-color"),onChangeTextFontSize:c=>{this.setFontSizeAndDefault(a.type,c)}};this.settingsDialog.show(a,l)}})}setupListeners(){const{ctx:e,optionsToolbar:i,settingsDialog:s,toolbar:n}=this,{seriesWidget:a,seriesDragInterpreter:o,chartWidget:r}=e.widgets;this.destroyFns.push(o.addListener("click",this.hoverTouchPreHandler.bind(this)),o.addListener("drag-start",this.hoverTouchPreHandler.bind(this)),o.addListener("drag-move",this.dragMoveTouchPreHandler.bind(this)),o.addListener("mousemove",this.onHover.bind(this)),o.addListener("click",this.onClick.bind(this)),o.addListener("dblclick",this.onDoubleClick.bind(this)),o.addListener("drag-start",this.onDragStart.bind(this)),o.addListener("drag-move",this.onDrag.bind(this)),o.addListener("drag-end",this.onDragEnd.bind(this)),a.addListener("keydown",this.onKeyDown.bind(this)),a.addListener("keyup",this.onKeyUp.bind(this)),r.addListener("click",this.onCancel.bind(this)),e.annotationManager.addListener("restore-annotations",this.onRestoreAnnotations.bind(this)),e.layoutManager.addListener("layout:complete",this.onLayoutComplete.bind(this)),e.updateService.addListener("pre-scene-render",this.onPreRender.bind(this)),e.zoomManager.addListener("zoom-change",()=>this.onResize()),e.domManager.addListener("resize",()=>this.onResize()),n.addListener("cancel-create-annotation",()=>{this.cancel(),this.reset(),this.update()}),n.addListener("pressed-create-annotation",({annotation:l})=>{this.cancel(),this.pushAnnotationState(Xs.Annotations),this.state.transition(l),this.update()}),n.addListener("pressed-clear",()=>{this.clear(),this.recordActionAfterNextUpdate("Clear all")}),n.addListener("pressed-show-menu",()=>{this.cancel(),this.reset()}),n.addListener("pressed-unrelated",()=>{this.reset()}),i.addListener("pressed-delete",()=>{this.cancel(),this.delete(),this.reset()}),i.addListener("pressed-settings",({sourceEvent:l})=>{this.state.transition("toolbarPressSettings",l)}),i.addListener("pressed-lock",()=>{this.update()}),i.addListener("hid-overlays",()=>{this.settingsDialog.hide()}),i.addListener("saved-color",({type:l,colorPickerType:c,color:h})=>{this.recordActionAfterNextUpdate(`Change ${l} ${c} to ${h}`,["annotations","defaults"])}),i.addListener("updated-color",({type:l,colorPickerType:c,colorOpacity:h,color:u,opacity:d,isMultiColor:p})=>{this.setColorAndDefault(l,c,h,u,d,p)}),i.addListener("updated-font-size",({type:l,fontSize:c})=>{this.setFontSizeAndDefault(l,c)}),i.addListener("updated-line-style",({type:l,lineStyleType:c})=>{this.setLineStyleTypeAndDefault(l,c)}),i.addListener("updated-line-width",({type:l,strokeWidth:c})=>{this.setLineStyleWidthAndDefault(l,c)}),s.addListener("hidden",()=>{this.optionsToolbar.clearActiveButton()}))}setupDOM(){const{ctx:e,toolbar:i}=this;this.destroyFns.push(e.annotationManager.attachNode(this.container),()=>e.domManager.removeStyles(Hf),()=>i.destroy())}async processData(e){if(!this.enabled||this.data==null||this.xKey==null||this.volumeKey==null)return;const i=[Yit(this.xKey,void 0,{id:"date"}),Kit(this.volumeKey,"number",{id:"volume"})],{dataModel:s,processedData:n}=await e.request("annotations",this.data,{props:i});this.dataModel=s,this.processedData=n}createAnnotationScene(e){if(e.type in In)return new In[e.type].scene;throw new Error(`AG Charts - Cannot create annotation scene of type [${e.type}], expected one of [${Object.keys(In)}], ignoring.`)}static createAnnotationDatum(e){if(e.type in In)return new In[e.type].datum().set(e);throw new Error(`AG Charts - Cannot create annotation datum of unknown type [${e.type}], expected one of [${Object.keys(In)}], ignoring.`)}createAnnotation(e,i,s=!0){if(this.annotationData.push(i),s){const n=this.ctx.annotationManager.getAnnotationTypeStyles(e);n&&i.set(n),this.defaults.applyDefaults(i)}this.injectDatumDependencies(i),this.update()}injectDatumDependencies(e){"setLocaleManager"in e&&e.setLocaleManager(this.ctx.localeManager),"getVolume"in e&&(e.getVolume=this.getDatumRangeVolume.bind(this))}getDatumRangeVolume(e,i){const{dataModel:s,processedData:n}=this;let a=fe(e).value,o=fe(i).value;if(!_k(a)||!_k(o)||!s||!n||this.volumeKey==null)return;a>o&&([a,o]=[o,a]);const r=s.resolveKeysById({id:"annotations"},"date",n),l=s.resolveColumnById({id:"annotations"},"volume",n);let c=0;for(let h=0;h=a&&u<=o&&(c+=l[h])}return c}translateNode(e,i,s){const n=this.getAnnotationConfig(i),a=this.getAnnotationContext();a&&n.translate(e,i,s,a)}createAnnotationDatumCopy(e,i){const s=this.getAnnotationConfig(i),n=new s.datum;n.set(i.toJson());const a=this.getAnnotationContext();if(a)return s.copy(e,i,n,a)}getAnnotationConfig(e){if(e.type in In)return In[e.type];throw new Error(`AG Charts - Cannot get annotation config of unknown type [${e.type}], expected one of [${Object.keys(In)}], ignoring.`)}onRestoreAnnotations(e){this.enabled&&(this.clear(),this.annotationData.set(e.annotations),this.restoreAnnotations=!0,this.update())}onLayoutComplete(e){const i=e.series.paddedRect;this.seriesRect=i,this.container.setClipRect(i);for(const s of e.axes??[])s.direction===qb._ModuleSupport.ChartAxisDirection.X?this.xAxis=this.getAxis(s,i,this.xAxis?.button):this.yAxis=this.getAxis(s,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 e=this.ctx.chartService.series.some(n=>n.hasData),s=this.yAxis.context.seriesIds().some(n=>this.ctx.chartService.series.find(o=>o.id===n)?.visible);return e&&s}animateAnnotations({from:e,to:i,phase:s}){const{annotations:n}=this;this.ctx.animationManager?.animate({from:e,to:i,id:"chart-annotations",phase:s,groupId:"opacity",onUpdate(a){n.each(o=>{o.opacity=a,"setAxisLabelOpacity"in o&&o.setAxisLabelOpacity(a)})},onStop(){n.each(a=>{a.opacity=i,"setAxisLabelOpacity"in a&&a.setAxisLabelOpacity(i)})}})}onPreRender(){this.updateAnnotations(),this.state.transition("render")}getAxis(e,i,s){const n=this.ctx.axisManager.getAxisContext(e.direction)[0],{position:a="bottom",direction:o}=n,r=e.gridPadding+e.seriesAreaPadding,l=new Xit(0,0,i.width,i.height).grow(r,a),c=n.direction===Hit.X?"vertical":"horizontal",{axesButtons:h,snap:u}=this;if(this.enabled&&h.enabled&&(h.axes==="xy"||h.axes===o)){s??(s=new OF(this.ctx,{...n,snapToGroup:u},g=>this.onAxisButtonClick(g,c),i));const p=FL(e);s.update(i,p)}else s?.destroy(),s=void 0;return{layout:e,context:n,bounds:l,button:s}}recordActionAfterNextUpdate(e,i=["annotations"]){const{defaults:s,ctx:{annotationManager:n,historyManager:a}}=this,o=i.map(r=>r==="defaults"?s:n);this.postUpdateFns.push(()=>{a.record(e,...o)})}setColorAndDefault(e,i,s,n,a,o){this.state.transition("color",{colorPickerType:i,colorOpacity:s,color:n,opacity:a,isMultiColor:o}),this.defaults.setDefaultColor(e,i,s,n,a,o)}setFontSizeAndDefault(e,i){this.state.transition("fontSize",i),this.defaults.setDefaultFontSize(e,i),this.recordActionAfterNextUpdate(`Change ${e} font size to ${i}`,["annotations","defaults"])}setLineStyleTypeAndDefault(e,i){this.state.transition("lineStyle",{type:i}),this.defaults.setDefaultLineStyleType(e,i),this.recordActionAfterNextUpdate(`Change ${e} line style to ${i}`,["annotations","defaults"])}setLineStyleWidthAndDefault(e,i){this.state.transition("lineStyle",{strokeWidth:i}),this.defaults.setDefaultLineStyleWidth(e,i),this.recordActionAfterNextUpdate(`Change ${e} stroke width to ${i}`,["annotations","defaults"])}updateAnnotations(){const{annotationData:e,annotations:i,seriesRect:s,ctx:{annotationManager:n}}=this,a=this.getAnnotationContext();if(!s||!a)return;n.updateData(e.toJson().filter(l=>!Ol(l)));const o=this.showAnnotations();this.toolbar.refreshButtonsEnabled(o),this.toolbar.toggleClearButtonEnabled(e.length>0&&o);const r=this.restoreAnnotations;i.update(e??[],void 0,l=>l.id).each((l,c)=>{if(!o||!this.validateDatum(c,r)){l.visible=!1,"setAxisLabelVisible"in l&&l.setAxisLabelVisible(!1);return}"setAxisLabelVisible"in l&&l.setAxisLabelVisible(!0),this.injectDatumDependencies(c),Vit(l,c,a)}),this.postUpdateFns.forEach(l=>l()),this.postUpdateFns=[],this.restoreAnnotations=!1}validateDatum(e,i){const s=this.getAnnotationContext(),n=i?`Annotation [${e.type}] `:void 0;return s?e.isValidWithContext(s,n):!0}getAnnotationContext(){const{seriesRect:e,xAxis:i,yAxis:s,snap:n}=this;if(e&&i&&s)return{seriesRect:e,xAxis:{...i.context,bounds:i.bounds,labelPadding:FL(i.layout),snapToGroup:n},yAxis:{...s.context,bounds:s.bounds,labelPadding:FL(i.layout),snapToGroup:n}}}onHover(e){const{state:i}=this,s=this.getAnnotationContext();if(!s)return;const n=e.sourceEvent.shiftKey,a=Lh.from(e),o=ye(a,s);i.transition("hover",{offset:a,point:o,shiftKey:n,context:s})}onClick(e){const{state:i}=this,s=this.getAnnotationContext();if(!s)return;const n=e.sourceEvent.shiftKey,a=ye(Lh.from(e),s),o=this.textInput.getValue(),r=this.textInput.getBBox();i.transition("click",{point:a,shiftKey:n,textInputValue:o,bbox:r})}onDoubleClick(e){const{state:i}=this;if(!this.getAnnotationContext())return;const n=Lh.from(e);i.transition("dblclick",{offset:n})}onAxisButtonClick(e,i){this.cancel(),this.reset();const s=this.getAnnotationContext();if(!this.annotationData||!s)return;const{state:n}=this;this.pushAnnotationState(Xs.Annotations);const a=i==="horizontal";if(n.transition(a?"horizontal-line":"vertical-line"),this.optionsToolbar.hide(),!e)return;const o=ye(e,s);Na(s,o)&&(n.transition("click",{point:o,shiftKey:!1}),this.update())}onResize(){const e=this.textInput.getValue(),i=this.textInput.getBBox();this.state.transition("resize",{textInputValue:e,bbox:i})}hoverTouchPreHandler(e){e.device==="touch"&&this.onHover(e)}dragMoveTouchPreHandler(e){e.device==="touch"&&this.ctx.interactionManager.isState(Xs.AnnotationsSelected)&&e.sourceEvent.preventDefault()}onDragStart(e){if(!this.ctx.interactionManager.isState(Xs.AnnotationsDraggable))return;const i=this.getAnnotationContext();if(!i)return;const s=Lh.from(e),n=ye(s,i),a=this.textInput.getValue(),o=this.textInput.getBBox();this.state.transition("dragStart",{context:i,offset:s,point:n,textInputValue:a,bbox:o})}onDrag(e){if(!this.ctx.interactionManager.isState(Xs.AnnotationsDraggable))return;const i=this.getAnnotationContext();if(!i)return;const s=Lh.from(e),n=ye(s,i),a=e.sourceEvent.shiftKey,o=this.textInput.getValue(),r=this.textInput.getBBox();this.state.transition("drag",{context:i,offset:s,point:n,shiftKey:a,textInputValue:o,bbox:r})}onDragEnd(){this.state.transition("dragEnd")}onCancel(e){const{sourceEvent:i}=e??{};i?.currentTarget===i?.target&&(this.cancel(),this.reset())}onDelete(){this.textInput.isVisible()||(this.cancel(),this.delete(),this.reset(),this.update())}onTextInput(e){const{state:i}=this,s=this.getAnnotationContext();if(!s)return;const{key:n,shiftKey:a}=e,o=this.textInput.getValue(),r=this.textInput.getBBox();i.transition("textInput",{key:n,shiftKey:a,textInputValue:o,bbox:r,context:s})}onKeyDown(e){const{state:i}=this,s=this.getAnnotationContext();if(!s)return;const{sourceEvent:n}=e,{shiftKey:a,ctrlKey:o,metaKey:r}=n,l=o||r,c=o||a;this.state.transition("keyDown",{shiftKey:a,context:s});const h={x:0,y:0},u=Math.max(s?.xAxis.scale.bandwidth??0,c?10:1),d=Math.max(s?.yAxis.scale.bandwidth??0,c?10:1);switch(n.key){case"ArrowDown":h.y=d;break;case"ArrowUp":h.y=-d;break;case"ArrowLeft":h.x=-u;break;case"ArrowRight":h.x=u;break;case"Escape":this.onCancel();return;case"Backspace":case"Delete":this.onDelete();return}if((h.x||h.y)&&(i.transition("translate",{translation:h}),n.stopPropagation(),n.preventDefault()),!!l)switch(n.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(e){const{shiftKey:i}=e.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(){for(const[e,i]of this.annotationData.entries())Ol(i)&&this.annotationData.splice(e,1)}hideOverlays(){this.settingsDialog.hide(),this.toolbar.hideOverlays(),this.optionsToolbar.hideOverlays()}pushAnnotationState(e){this.ctx.interactionManager.pushState(e),this.ctx.tooltipManager.suppressTooltip("annotations")}popAnnotationState(e){this.ctx.interactionManager.popState(e),this.ctx.tooltipManager.unsuppressTooltip("annotations")}isAnnotationState(){return this.ctx.interactionManager.isState(Xs.Annotations)||this.ctx.interactionManager.isState(Xs.AnnotationsSelected)}update(e=Git.PRE_SCENE_RENDER){this.ctx.updateService.update(e)}};y([Wit((t,e,i)=>{const{ctx:{annotationManager:s,stateManager:n}}=t;e!==i&&(t.toolbar?.toggleVisibility(!!e),i===!1&&e===!0?n.restoreState(s):e===!1&&t.clear())}),Yf(PF)],Vd.prototype,"enabled",2),y([Yf(jL)],Vd.prototype,"toolbar",2),y([Yf(jL)],Vd.prototype,"optionsToolbar",2),y([Yf(jL)],Vd.prototype,"axesButtons",2),y([Yf(PF)],Vd.prototype,"snap",2);var Zit=Vd,Qit=(R(),E(w)),{FONT_SIZE_RATIO:qit,ThemeSymbols:fi}=Qit._ModuleSupport,qn={stroke:{$ref:"foregroundColor"},strokeOpacity:1,strokeWidth:2},ji={fill:fi.DEFAULT_ANNOTATION_HANDLE_FILL,strokeOpacity:1,strokeWidth:2},Th={color:{$ref:"backgroundColor"},fontSize:{$rem:[qit.LARGE]},fontFamily:{$ref:"fontFamily"}},BF={...Th,enabled:!0,fill:{$ref:"foregroundColor"},fontSize:{$ref:"fontSize"}},VS={...Th,textAlign:"left"},Ch={...Th,position:"top",alignment:"center",color:{$ref:"textColor"}},zF={...Th,position:"top",alignment:"center",color:{$ref:"textColor"}},VL={...Th,fontSize:{$ref:"fontSize"},color:fi.DEFAULT_ANNOTATION_STATISTICS_COLOR,fill:fi.DEFAULT_ANNOTATION_STATISTICS_FILL,stroke:fi.DEFAULT_ANNOTATION_STATISTICS_STROKE,strokeWidth:1,divider:{stroke:fi.DEFAULT_ANNOTATION_STATISTICS_DIVIDER_STROKE,strokeWidth:1,strokeOpacity:.5}},GL={...qn,background:{fill:{$ref:"foregroundColor"},fillOpacity:.075},handle:{...ji},text:{...Ch},statistics:{...VL}},Jit={buttons:[{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:"padding"}},tst={buttons:[{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"}]},est={enabled:!1,line:{...qn,handle:{...ji},text:{...Ch}},"horizontal-line":{...qn,handle:{...ji},axisLabel:{...BF},text:{...Ch}},"vertical-line":{...qn,handle:{...ji},axisLabel:{...BF},text:{...Ch}},"disjoint-channel":{...qn,background:{fill:{$ref:"foregroundColor"},fillOpacity:.075},handle:{...ji},text:{...zF}},"parallel-channel":{...qn,middle:{lineDash:[6,5],strokeWidth:1},background:{fill:{$ref:"foregroundColor"},fillOpacity:.075},handle:{...ji},text:{...zF}},"fibonacci-retracement":{...qn,strokes:fi.DEFAULT_FIBONACCI_STROKES,rangeStroke:{$ref:"foregroundColor"},handle:{...ji},text:{...Ch,position:"center"},label:{...Th,color:void 0,fontSize:{$round:[{$mul:[{$ref:"fontSize"},10/12]}]}}},"fibonacci-retracement-trend-based":{...qn,strokes:fi.DEFAULT_FIBONACCI_STROKES,rangeStroke:{$ref:"foregroundColor"},handle:{...ji},text:{...Ch,position:"center"},label:{...Th,color:void 0,fontSize:{$round:[{$mul:[{$ref:"fontSize"},10/12]}]}}},callout:{...qn,...VS,color:{$ref:"textColor"},handle:{...ji},fill:{$ref:"foregroundColor"},fillOpacity:.075},comment:{...VS,fontWeight:700,handle:{...ji},fill:{$ref:"foregroundColor"}},note:{...VS,color:fi.DEFAULT_TEXTBOX_COLOR,fill:fi.DEFAULT_FINANCIAL_CHARTS_ANNOTATION_COLOR,stroke:{$ref:"backgroundColor"},strokeWidth:1,strokeOpacity:1,handle:{...ji},background:{fill:fi.DEFAULT_TEXTBOX_FILL,stroke:fi.DEFAULT_TEXTBOX_STROKE,strokeWidth:1}},text:{...VS,color:{$ref:"textColor"},handle:{...ji}},arrow:{...qn,handle:{...ji},text:{...Ch}},"arrow-up":{fill:fi.PALETTE_UP_FILL,handle:{...ji,stroke:{$ref:"foregroundColor"}}},"arrow-down":{fill:fi.PALETTE_DOWN_FILL,handle:{...ji,stroke:{$ref:"foregroundColor"}}},"date-range":{...GL},"price-range":{...GL},"date-price-range":{...GL},"quick-date-price-range":{up:{...qn,fill:fi.DEFAULT_FINANCIAL_CHARTS_ANNOTATION_BACKGROUND_FILL,fillOpacity:.2,handle:{...ji},statistics:{...VL,color:"#fff",fill:fi.DEFAULT_FINANCIAL_CHARTS_ANNOTATION_BACKGROUND_FILL,strokeWidth:0,divider:{stroke:"#fff",strokeWidth:1,strokeOpacity:.5}}},down:{...qn,stroke:fi.DEFAULT_ANNOTATION_STATISTICS_DOWN_STROKE,fill:fi.DEFAULT_ANNOTATION_STATISTICS_DOWN_FILL,fillOpacity:.2,handle:{...ji,stroke:fi.DEFAULT_ANNOTATION_STATISTICS_DOWN_STROKE},statistics:{...VL,color:"#fff",fill:fi.DEFAULT_ANNOTATION_STATISTICS_DOWN_FILL,strokeWidth:0,divider:{stroke:"#fff",strokeWidth:1,strokeOpacity:.5}}}},axesButtons:{},toolbar:Jit,optionsToolbar:tst},ist={type:"root",optionsKey:"annotations",packageType:"enterprise",chartTypes:["cartesian"],moduleFactory:t=>new Zit(t),themeTemplate:{annotations:est}},WL=(R(),E(w)),FF=(R(),E(w)),{BaseProperties:sst,ObserveChanges:nst,ProxyProperty:ast,Validate:Nh,NUMBER:GS,POSITIVE_NUMBER:jF,RATIO:ost,calculatePlacement:rst,createElement:lst}=FF._ModuleSupport,No=class extends sst{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=lst("img"),this.imageElement.onload=this.onImageLoad,this.node=new FF._ModuleSupport.Image(this.imageElement)}get complete(){return this.imageElement.width>0&&this.imageElement.height>0}performLayout(t,e){this.containerWidth=t,this.containerHeight=e;const i={width:t,height:e},s=rst(this.imageElement.width,this.imageElement.height,i,this);return this.node.setProperties(this.complete?{visible:!0,opacity:this.opacity,...s}:{visible:!1}),s}};y([Nh(GS,{optional:!0})],No.prototype,"top",2),y([Nh(GS,{optional:!0})],No.prototype,"right",2),y([Nh(GS,{optional:!0})],No.prototype,"bottom",2),y([Nh(GS,{optional:!0})],No.prototype,"left",2),y([Nh(jF,{optional:!0})],No.prototype,"width",2),y([Nh(jF,{optional:!0})],No.prototype,"height",2),y([Nh(ost)],No.prototype,"opacity",2),y([ast("imageElement.src"),nst(t=>t.loadedSynchronously=t.complete)],No.prototype,"url",2);var{ActionOnSet:cst,OBJECT:hst,Validate:ust}=WL._ModuleSupport,VF=class extends WL._ModuleSupport.Background{constructor(){super(...arguments),this.image=new No}onLayoutComplete(t){if(super.onLayoutComplete(t),this.image){const{width:e,height:i}=t.chart;this.image.performLayout(e,i)}}onImageLoad(){this.ctx.updateService.update(WL._ModuleSupport.ChartUpdateType.SCENE_RENDER)}};y([ust(hst,{optional:!0}),cst({newValue(t){this.node.appendChild(t.node),t.onLoad=()=>this.onImageLoad()},oldValue(t){this.node.removeChild(t.node),t.onLoad=void 0}})],VF.prototype,"image",2);var dst={type:"root",optionsKey:"background",packageType:"enterprise",chartTypes:["cartesian","polar","hierarchy","topology","flow-proportion","standalone","gauge"],moduleFactory:t=>new VF(t)},ybt=(R(),E(w)),GF=(R(),E(w)),{BOOLEAN:pst,ActionOnSet:gst,LayoutElement:fst,Menu:yst,Validate:mst}=GF._ModuleSupport,UL=[{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"}],WF=class extends GF._ModuleSupport.BaseModuleInstance{constructor(t){super(),this.ctx=t,this.enabled=!1,this.menu=new yst(this.ctx,"chart-toolbar"),this.toolbar=t.sharedToolbar.getSharedToolbar("chartToolbar"),this.destroyFns.push(this.toolbar.addToolbarListener("button-pressed",this.onButtonPressed.bind(this)),t.layoutManager.registerElement(fst.ToolbarLeft,this.onLayoutStart.bind(this)),()=>this.toolbar.destroy())}onLayoutStart(t){this.enabled&&(this.updateButton(),this.toolbar.layout(t.layoutBox))}onButtonPressed({event:t,buttonBounds:e}){this.menu.setAnchor({x:e.x+e.width+6,y:e.y}),this.menu.show({items:UL,menuItemRole:"menuitemradio",ariaLabel:this.ctx.localeManager.t("toolbarSeriesTypeDropdown"),class:"ag-charts-chart-toolbar__menu",value:this.getChartType(),sourceEvent:t.sourceEvent,onPress:i=>{this.setChartType(i.value),this.hidePopover()},onHide:()=>{this.toolbar.clearActiveButton()}}),this.toolbar.toggleActiveButtonByIndex(0)}updateButton(){const t=this.getChartType(),e=UL.find(i=>i.value===t)?.icon;e!=null&&this.toolbar.updateButtons([{icon:e,tooltip:"toolbarSeriesTypeDropdown"}])}hidePopover(){this.toolbar.clearActiveButton(),this.menu.hide()}setChartType(t){const e={chartType:t};this.ctx.chartService.publicApi?.updateDelta(e).catch(i=>Gt.error(i))}getChartType(){const t=this.ctx.chartService.publicApi?.getOptions()?.chartType;return t==null||!UL.some(e=>e.value===t)?"candlestick":t}};y([mst(pst),gst({changeValue(t){this.toolbar?.setHidden(!t)}})],WF.prototype,"enabled",2);var xst={type:"root",optionsKey:"chartToolbar",packageType:"enterprise",chartTypes:["cartesian"],moduleFactory:t=>new WF(t)},bst=(R(),E(w)),Gd=(R(),E(w)),WS="ag-charts-context-menu",US="ag-charts-dark-context-menu",{BOOLEAN:UF,Validate:HF,initMenuKeyNav:Sst,makeAccessibleClickListener:vst,ContextMenuRegistry:Kf,createElement:HL}=Gd._ModuleSupport,YL="context-menu";function Mst(t,e){const{children:i}=t??{};if(!i)return[];const s=[];for(const n of Array.from(i))n instanceof e&&s.push(n);return s}var KL=class extends Gd._ModuleSupport.BaseModuleInstance{constructor(t){if(super(),this.ctx=t,this.enabled=!0,this.darkTheme=!1,this.extraActions=[],this.extraNodeActions=[],this.extraSeriesAreaActions=[],this.extraLegendItemActions=[],this.pickedNode=void 0,this.showEvent=void 0,this.x=0,this.y=0,this.interactionManager=t.interactionManager,this.registry=t.contextMenuRegistry,this.groups={default:[],extra:[],extraSeriesArea:[],extraNode:[],extraLegendItem:[]},this.element=t.domManager.addChild("canvas-overlay",YL),this.element.classList.add(WS),this.element.addEventListener("contextmenu",e=>e.preventDefault()),this.destroyFns.push(()=>this.element.parentNode?.removeChild(this.element)),this.doClose(),this.destroyFns.push(t.domManager.addListener("hidden",()=>this.hide())),typeof MutationObserver<"u"){const e=new MutationObserver(()=>{this.menuElement&&this.element.contains(this.menuElement)&&this.reposition()});e.observe(this.element,{childList:!0}),this.mutationObserver=e,this.destroyFns.push(()=>e.disconnect())}this.destroyFns.push(this.registry.registerDefaultAction({id:"download",type:"all",label:"contextMenuDownload",action:()=>{const e=t.chartService.title;let i="image";e?.enabled&&e?.text!==void 0&&(i=e.text.replace(/\.+/,"")),this.ctx.chartService.publicApi?.download({fileName:i}).catch(s=>{Gt.error("Unable to download chart",s)})}})),this.destroyFns.push(this.registry.addListener(e=>this.onContext(e)))}onContext(t){if(!this.enabled)return;t.sourceEvent.preventDefault(),this.showEvent=t.sourceEvent,this.x=t.x,this.y=t.y,this.groups.default=this.registry.filterActions(t.type);for(const r of this.groups.default)r.id==null||r.toggleEnabledOnShow==null||(r.toggleEnabledOnShow(t)?this.registry.enableAction(r.id):this.registry.disableAction(r.id));this.pickedNode=void 0,this.pickedLegendItem=void 0,this.groups.extra=this.extraActions.map(({label:r,action:l})=>({type:"all",label:r,action:l})),this.groups.extraSeriesArea=[],this.groups.extraNode=[],Kf.check("series-area",t)&&(this.pickedNode=t.context.pickedNode,this.groups.extraSeriesArea=this.extraSeriesAreaActions.map(({label:r,action:l})=>({type:"series-area",label:r,action:l})),this.pickedNode&&(this.groups.extraNode=this.extraNodeActions.map(({label:r,action:l})=>({type:"node",label:r,action:l})))),this.groups.extraLegendItem=[],Kf.check("legend",t)&&(this.pickedLegendItem=t.context.legendItem,this.pickedLegendItem&&(this.groups.extraLegendItem=this.extraLegendItemActions.map(({label:r,action:l})=>({type:"legend",label:r,action:l}))));const{default:e,extra:i,extraSeriesArea:s,extraNode:n,extraLegendItem:a}=this.groups;[e,i,s,n,a].reduce((r,l)=>l.length+r,0)!==0&&this.show(t.sourceEvent)}show(t){this.interactionManager.pushState(Gd._ModuleSupport.InteractionState.ContextMenu),this.element.classList.toggle(US,this.darkTheme);const e=this.renderMenu();this.menuCloser?.close(),this.menuElement?this.element.replaceChild(e,this.menuElement):this.element.appendChild(e),this.menuElement=e,this.element.style.display="block";const i=t.pointerType==="touch"?!1:void 0,s=Mst(e,HTMLButtonElement);this.menuCloser=Sst({menu:e,buttons:s,orientation:"vertical",sourceEvent:t,overrideFocusVisible:i,autoCloseOnBlur:!0,closeCallback:()=>this.doClose()}),t.pointerType==="touch"&&this.ctx.chartService.overrideFocusVisible(!1)}hide(){this.menuCloser?.close()}doClose(){this.interactionManager.popState(Gd._ModuleSupport.InteractionState.ContextMenu),this.menuElement&&(this.element.removeChild(this.menuElement),this.menuElement=void 0,this.menuCloser=void 0),this.element.style.display="none"}renderMenu(){const t=HL("div");return t.classList.add(`${WS}__menu`),t.classList.toggle(US,this.darkTheme),t.role="menu",this.appendMenuGroup(t,this.groups.default,!1),this.appendMenuGroup(t,this.groups.extra),this.appendMenuGroup(t,this.groups.extraSeriesArea),this.pickedNode&&this.appendMenuGroup(t,this.groups.extraNode),this.pickedLegendItem&&this.appendMenuGroup(t,this.groups.extraLegendItem),t}appendMenuGroup(t,e,i=!0){e.length!==0&&(i&&t.appendChild(this.createDividerElement()),e.forEach(s=>{const n=this.renderItem(s);n&&t.appendChild(n)}))}renderItem(t){if(t&&typeof t=="object"&&t.constructor===Object)return this.createActionElement(t)}createDividerElement(){const t=HL("div");return t.classList.add(`${WS}__divider`),t.classList.toggle(US,this.darkTheme),t.role="separator",t}createActionElement({id:t,label:e,type:i,action:s}){const n=!!(t&&this.registry.isDisabled(t));return this.createButtonElement(i,e,s,n)}createButtonOnClick(t,e){return Kf.checkCallback("legend",t,e)?i=>{if(this.pickedLegendItem){const{seriesId:s,itemId:n}=this.pickedLegendItem;e({type:"contextmenu",seriesId:s,itemId:n,event:i}),this.hide()}}:Kf.checkCallback("series-area",t,e)?()=>{e({type:"seriesContextMenuAction",event:this.showEvent}),this.hide()}:Kf.checkCallback("node",t,e)?()=>{const{pickedNode:i,showEvent:s}=this,n=i?.series.createNodeContextMenuActionEvent(s,i);n?e(n):Gt.error("series node not found"),this.hide()}:()=>{e({type:"contextMenuEvent",event:this.showEvent}),this.hide()}}createButtonElement(t,e,i,s){const n=HL("button");return n.classList.add(`${WS}__item`),n.classList.toggle(US,this.darkTheme),n.ariaDisabled=s.toString(),n.textContent=this.ctx.localeManager.t(e),n.role="menuitem",n.onclick=vst(n,this.createButtonOnClick(t,i)),n.addEventListener("mouseover",()=>n.focus({preventScroll:!0})),n}reposition(){let{x:t,y:e}=this;this.element.style.top="unset",this.element.style.bottom="unset";const i=this.ctx.domManager.getBoundingClientRect(),{offsetWidth:s,offsetHeight:n}=this.element;t=Gd._ModuleSupport.clamp(0,t,i.width-s),e=Gd._ModuleSupport.clamp(0,e,i.height-n),this.element.style.left=`${t}px`,this.element.style.top=`calc(${e}px - 0.5em)`}destroy(){super.destroy(),this.mutationObserver?.disconnect(),this.ctx.domManager.removeStyles(YL),this.ctx.domManager.removeChild("canvas-overlay",YL)}};y([HF(UF)],KL.prototype,"enabled",2),y([HF(UF)],KL.prototype,"darkTheme",2);var Ist={type:"root",packageType:"enterprise",chartTypes:["cartesian","polar","hierarchy","topology","flow-proportion","standalone","gauge"],optionsKey:"contextMenu",moduleFactory:t=>new KL(t),themeTemplate:{contextMenu:{enabled:!0,darkTheme:bst._ModuleSupport.ThemeSymbols.IS_DARK_THEME}}},mbt=(R(),E(w)),Wd=(R(),E(w)),$L=(R(),E(w)),{BaseProperties:Ast,BOOLEAN:YF,FUNCTION:KF,NUMBER:HS,STRING:$F,Validate:Oo,createId:Dst,setAttribute:kst}=$L._ModuleSupport,Lst="ag-charts-crosshair-label",Ud=class extends $L._ModuleSupport.ChangeDetectableProperties{constructor(){super(...arguments),this.enabled=!0,this.xOffset=0,this.yOffset=0,this.format=void 0,this.renderer=void 0}};y([Oo(YF)],Ud.prototype,"enabled",2),y([Oo(HS)],Ud.prototype,"xOffset",2),y([Oo(HS)],Ud.prototype,"yOffset",2),y([Oo($F,{optional:!0})],Ud.prototype,"format",2),y([Oo(KF,{optional:!0})],Ud.prototype,"renderer",2);var Hd=class extends Ast{constructor(t,e,i){super(),this.domManager=t,this.id=Dst(this),this.enabled=!0,this.xOffset=0,this.yOffset=0,this.renderer=void 0,this.element=t.addChild("canvas-overlay",`crosshair-label-${this.id}`),this.element.classList.add(Lst),kst(this.element,"aria-hidden",!0),this.element.setAttribute("data-key",e),this.element.setAttribute("data-axis-id",i)}show(t){const{element:e}=this,i=t.x+this.xOffset,s=t.y+this.yOffset;e.style.top=`${Math.round(s)}px`,e.style.left=`${Math.round(i)}px`,this.toggle(!0)}setLabelHtml(t){t!==void 0&&(this.element.innerHTML=t)}getBBox(){const{element:t}=this;return new $L._ModuleSupport.BBox(t.clientLeft,t.clientTop,t.clientWidth,t.clientHeight)}toggle(t){this.element.classList.toggle("ag-charts-crosshair-label--hidden",!t)}destroy(){this.domManager.removeChild("canvas-overlay",`crosshair-label-${this.id}`)}toLabelHtml(t,e){if(typeof t=="string")return t;e=e??{};const{text:i=e.text??"",color:s=e.color,backgroundColor:n=e.backgroundColor,opacity:a=e.opacity??1}=t;return`
${i}
`}};y([Oo(YF)],Hd.prototype,"enabled",2),y([Oo(HS)],Hd.prototype,"xOffset",2),y([Oo(HS)],Hd.prototype,"yOffset",2),y([Oo($F,{optional:!0})],Hd.prototype,"format",2),y([Oo(KF,{optional:!0})],Hd.prototype,"renderer",2);var{Group:Tst,TranslatableGroup:Cst,Line:XF,BBox:ZF,createId:Nst,POSITIVE_NUMBER:QF,RATIO:Ost,BOOLEAN:qF,COLOR_STRING:wst,LINE_DASH:Est,OBJECT:Rst,InteractionState:YS,Validate:Ul,ZIndexMap:JF,formatNumber:_st,isInteger:Pst,ChartAxisDirection:t4}=Wd._ModuleSupport,Or=class extends Wd._ModuleSupport.BaseModuleInstance{constructor(t){super(),this.ctx=t,this.id=Nst(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 Ud,this.seriesRect=new ZF(0,0,0,0),this.bounds=new ZF(0,0,0,0),this.crosshairGroup=new Cst({name:"crosshairs",zIndex:JF.SERIES_CROSSHAIR}),this.lineGroup=this.crosshairGroup.appendChild(new Tst({name:`${this.id}-crosshair-lines`,zIndex:JF.SERIES_CROSSHAIR})),this.lineGroupSelection=Wd._ModuleSupport.Selection.select(this.lineGroup,XF,!1),this.activeHighlight=void 0,this.axisCtx=t.parent,this.labels={},this.hideCrosshairs(),t.domManager.addEventListener("focusin",({target:e})=>{const i=e instanceof HTMLElement&&t.domManager.contains(e,"series-area");this.crosshairGroup.visible&&!i&&(this.hideCrosshairs(),this.ctx.updateService.update(Wd._ModuleSupport.ChartUpdateType.PERFORM_LAYOUT))}),this.destroyFns.push(t.scene.attachNode(this.crosshairGroup),t.widgets.seriesWidget.addListener("mousemove",e=>this.onMouseHoverLike(e)),t.widgets.seriesWidget.addListener("drag-move",e=>this.onMouseHoverLike(e)),t.widgets.seriesWidget.addListener("mouseleave",()=>this.onMouseOut()),t.widgets.seriesDragInterpreter.addListener("click",e=>this.onClick(e)),t.chartEventManager.addListener("series-focus-change",()=>this.onKeyPress()),t.zoomManager.addListener("zoom-pan-start",()=>this.onMouseOut()),t.zoomManager.addListener("zoom-change",()=>this.onMouseOut()),t.highlightManager.addListener("highlight-change",e=>this.onHighlightChange(e)),t.layoutManager.addListener("layout:complete",e=>this.layout(e)),()=>Object.entries(this.labels).forEach(([e,i])=>i.destroy()))}layout({series:{rect:t,visible:e},axes:i}){if(!e||!i||!this.enabled)return;this.seriesRect=t;const{position:s="left",axisId:n}=this.axisCtx,a=i.find(c=>c.id===n);if(!a)return;this.axisLayout=a,this.bounds=t.clone().grow(a.gridPadding+a.seriesAreaPadding,s);const{crosshairGroup:o,bounds:r}=this;o.translationX=Math.round(r.x),o.translationY=Math.round(r.y);const l=["pointer",...this.axisCtx.seriesKeyProperties()];this.updateSelections(l),this.updateLines(),this.updateLabels(l)}updateSelections(t){this.lineGroupSelection.update(t,e=>e.append(new XF),e=>e)}updateLabels(t){const{labels:e,ctx:i}=this;for(const s of t)this.label.enabled&&(e[s]??(e[s]=new Hd(i.domManager,s,this.axisCtx.axisId))),e[s]&&this.updateLabel(e[s]);this.labelFormatter=this.axisCtx.scaleValueFormatter(this.label.format)}updateLabel(t){const{enabled:e,xOffset:i,yOffset:s,format:n,renderer:a}=this.label;t.enabled=e,t.xOffset=i,t.yOffset=s,t.format=n,t.renderer=a}updateLines(){const{lineGroupSelection:t,bounds:e,stroke:i,strokeWidth:s,strokeOpacity:n,lineDash:a,lineDashOffset:o,axisLayout:r}=this;if(!r)return;const l=this.isVertical();t.each(c=>{c.stroke=i,c.strokeWidth=s,c.strokeOpacity=n,c.lineDash=a,c.lineDashOffset=o,c.y1=0,c.y2=l?e.height:0,c.x1=0,c.x2=l?0:e.width})}isVertical(){return this.axisCtx.direction===t4.X}isHover(t){return t.type==="mousemove"||t.type==="click"||t.device==="touch"&&this.ctx.chartService.touch.dragAction==="hover"}formatValue(t){const{labelFormatter:e,axisLayout:i,ctx:{callbackCache:s}}=this;if(e){const n=s.call(e,t);if(n!=null)return n}if(typeof t=="number"){const n=(i?.label.fractionDigits??0)+(Pst(t)?0:1);return _st(t,n)}return String(t??"")}onClick(t){t.device==="touch"&&this.onMouseHoverLike(t)}onMouseHoverLike(t){if(!this.enabled||this.snap)return;const e=this.isHover(t)?YS.Clickable:YS.AnnotationsMoveable;this.ctx.interactionManager.isState(e)&&(this.updatePositions(this.getData(t)),this.crosshairGroup.visible=!0,this.ctx.updateService.update(Wd._ModuleSupport.ChartUpdateType.SCENE_RENDER))}onMouseOut(){this.ctx.interactionManager.isState(YS.Clickable)&&(this.hideCrosshairs(),this.ctx.updateService.update(Wd._ModuleSupport.ChartUpdateType.SCENE_RENDER))}onKeyPress(){this.enabled&&!this.snap&&this.ctx.interactionManager.isState(YS.Default)&&this.hideCrosshairs()}onHighlightChange(t){if(!this.enabled)return;const{crosshairGroup:e,axisCtx:i}=this,{datum:s,series:n}=t.currentHighlight??{},a=s&&(n?.axes.x?.id===i.axisId||n?.axes.y?.id===i.axisId);if(this.activeHighlight=a?t.currentHighlight:void 0,!this.activeHighlight)this.hideCrosshairs();else if(this.snap){const o=this.getActiveHighlightData(this.activeHighlight);this.updatePositions(o),e.visible=!0}}isInRange(t){return this.axisCtx.inRange(t)}updatePositions(t){const{seriesRect:e,lineGroupSelection:i}=this;i.each((s,n)=>{const a=t[n];if(!a){s.visible=!1,this.hideLabel(n);return}s.visible=!0;const{value:o,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+e.x,c+e.y,o,n):this.hideLabel(n)})}getData(t){const{axisCtx:e}=this,i="pointer",{datum:s,xKey:n="",yKey:a=""}=this.activeHighlight??{},{currentX:o,currentY:r}=t,l=this.isVertical(),c=l?o:r;let h=s?.[l?n:a]??"";return e.continuous&&(h=e.scaleInvert(c)),{[i]:{position:c,value:h}}}getActiveHighlightData(t){const{axisCtx:e}=this,{datum:i,series:s,xKey:n="",aggregatedValue:a,cumulativeValue:o,midPoint:r}=t,l=s.getKeyProperties(e.direction),c=(e.scale.bandwidth??0)/2,h=s.axes[e.direction]?.id===e.axisId,u=l.indexOf("yKey")>-1&&h,d=l.indexOf("xKey")>-1&&h,p=a??o;if(u&&p!==void 0){const f=e.scale.convert(p)+c;return this.isInRange(f)?{yKey:{value:p,position:f}}:{}}if(d){const f=(this.isVertical()?r?.x:r?.y)??0,x=e.continuous?e.scaleInvert(f):i[n];return this.isInRange(f)?{xKey:{value:x,position:f}}:{}}const g={};return l.forEach(f=>{const x=s.properties[f],m=i[x],b=e.scale.convert(m)+c;this.isInRange(b)&&(g[f]={value:m,position:b})}),g}getLabelHtml(t,e){const i=this.axisLayout?.label?.fractionDigits??0,s={text:this.formatValue(t)};return this.label.renderer?e.toLabelHtml(this.label.renderer({value:t,fractionDigits:i}),s):e.toLabelHtml(s)}showLabel(t,e,i,s){if(!this.axisLayout)return;const{bounds:n}=this,a=this.labels[s],o=this.getLabelHtml(i,a);a.setLabelHtml(o);const{width:r,height:l}=a.getBBox(),c=this.axisCtx.position;let h=this.axisLayout.label.spacing+this.axisLayout.tickSize;this.axisCtx.direction===t4.X?(h-=4,a.show({x:t-r/2,y:c==="bottom"?n.y+n.height+h:n.y-l-h})):(h-=8,a.show({x:c==="right"?n.x+n.width+h:n.x-r-h,y:e-l/2}))}hideCrosshairs(){this.crosshairGroup.visible=!1;for(const t of Object.keys(this.labels))this.hideLabel(t)}hideLabel(t){this.labels[t]?.toggle(!1)}};y([Ul(qF)],Or.prototype,"enabled",2),y([Ul(wst,{optional:!0})],Or.prototype,"stroke",2),y([Ul(Est,{optional:!0})],Or.prototype,"lineDash",2),y([Ul(QF)],Or.prototype,"lineDashOffset",2),y([Ul(QF)],Or.prototype,"strokeWidth",2),y([Ul(Ost)],Or.prototype,"strokeOpacity",2),y([Ul(qF)],Or.prototype,"snap",2),y([Ul(Rst)],Or.prototype,"label",2);var Bst={type:"axis-option",optionsKey:"crosshair",packageType:"enterprise",chartTypes:["cartesian"],axisTypes:["category","ordinal-time","number","log","time"],moduleFactory:t=>new Or(t),themeTemplate:{crosshair:{snap:!0,stroke:{$ref:"subtleTextColor"},strokeWidth:1,strokeOpacity:1,lineDash:[5,6],lineDashOffset:0,label:{enabled:!0}}}},e4=(R(),E(w)),{BOOLEAN:zst,FUNCTION:Fst,ActionOnSet:$f,Validate:i4}=e4._ModuleSupport,Yd=class extends e4._ModuleSupport.BaseModuleInstance{constructor(t){super(),this.enabled=!1,this.getData=()=>Promise.resolve(),this.dataService=t.dataService}updateCallback(t,e){this.dataService&&(t&&e!=null?this.dataService.updateCallback(e):this.dataService.clearCallback())}};y([$f({newValue(t){this.updateCallback(t,this.getData)}}),i4(zst)],Yd.prototype,"enabled",2),y([$f({newValue(t){this.updateCallback(this.enabled,t)}}),i4(Fst)],Yd.prototype,"getData",2),y([$f({newValue(t){this.dataService.requestThrottle=t}})],Yd.prototype,"requestThrottle",2),y([$f({newValue(t){this.dataService.dispatchThrottle=t}})],Yd.prototype,"updateThrottle",2),y([$f({newValue(t){this.dataService.dispatchOnlyLatest=!t}})],Yd.prototype,"updateDuringInteraction",2);var jst={type:"root",optionsKey:"dataSource",packageType:"enterprise",chartTypes:["cartesian","hierarchy","polar","topology","flow-proportion","standalone","gauge"],moduleFactory:t=>new Yd(t),themeTemplate:{dataSource:{enabled:!1}}},Vst=(R(),E(w)),Xf=(R(),E(w)),Zf=(R(),E(w)),{nearestSquaredInContainer:Gst,partialAssign:Wst,mergeDefaults:s4,BBox:wr}=Zf._ModuleSupport,Ust=class{constructor(t){this.components=t,this.union=wr.merge(t)}containsPoint(t,e){if(!this.union.containsPoint(t,e))return!1;for(const i of this.components)if(i.containsPoint(t,e))return!0;return!1}},Hst=class extends Zf._ModuleSupport.Group{constructor(){super(),this.capLength=NaN,this._datum=void 0,this.whiskerPath=new Zf._ModuleSupport.Path,this.capsPath=new Zf._ModuleSupport.Path,this.bboxes=new Ust([]),this.append([this.whiskerPath,this.capsPath])}get datum(){return this._datum}set datum(t){this._datum=t}calculateCapLength(t,e){const{lengthRatio:i=1,length:s}=t,{lengthRatioMultiplier:n,lengthMax:a}=e,o=s??i*n;return Math.min(o,a)}getItemStylerParams(t,e,i){const{datum:s}=this;if(s==null||t.itemStyler==null)return;const{xLowerKey:n,xUpperKey:a,yLowerKey:o,yUpperKey:r}=t;return{...e,datum:s.datum,seriesId:s.datum.seriesId,xKey:s.xKey,yKey:s.yKey,xLowerKey:n,xUpperKey:a,yLowerKey:o,yUpperKey:r,highlighted:i}}formatStyles(t,e,i){let{cap:s,...n}=t;const a=this.getItemStylerParams(e,t,i);if(a!=null&&e.itemStyler!=null){const o=e.itemStyler(a);n=s4(o,n),s=s4(o?.cap,o,s)}return{whiskerStyle:n,capsStyle:s}}applyStyling(t,e){Wst(["visible","stroke","strokeWidth","strokeOpacity","lineDash","lineDashOffset"],t,e)}update(t,e,i){if(this.datum===void 0)return;const{whiskerStyle:s,capsStyle:n}=this.formatStyles(t,e,i),{xBar:a,yBar:o,capDefaults:r}=this.datum,l=this.whiskerPath;this.applyStyling(l,s),l.path.clear(!0),o!==void 0&&(l.path.moveTo(o.lowerPoint.x,o.lowerPoint.y),l.path.lineTo(o.upperPoint.x,o.upperPoint.y)),a!==void 0&&(l.path.moveTo(a.lowerPoint.x,a.lowerPoint.y),l.path.lineTo(a.upperPoint.x,a.upperPoint.y)),l.path.closePath(),this.capLength=this.calculateCapLength(n??{},r);const c=this.capLength/2,h=this.capsPath;this.applyStyling(h,n),h.path.clear(!0),o!==void 0&&(h.path.moveTo(o.lowerPoint.x-c,o.lowerPoint.y),h.path.lineTo(o.lowerPoint.x+c,o.lowerPoint.y),h.path.moveTo(o.upperPoint.x-c,o.upperPoint.y),h.path.lineTo(o.upperPoint.x+c,o.upperPoint.y)),a!==void 0&&(h.path.moveTo(a.lowerPoint.x,a.lowerPoint.y-c),h.path.lineTo(a.lowerPoint.x,a.lowerPoint.y+c),h.path.moveTo(a.upperPoint.x,a.upperPoint.y-c),h.path.lineTo(a.upperPoint.x,a.upperPoint.y+c)),h.path.closePath()}updateBBoxes(){const{capLength:t,whiskerPath:e,capsPath:i}=this,{yBar:s,xBar:n}=this.datum??{},a=t/2,o=[];if(s!==void 0){const r=s.lowerPoint.y-s.upperPoint.y;o.push(new wr(s.lowerPoint.x,s.upperPoint.y,e.strokeWidth,r),new wr(s.lowerPoint.x-a,s.lowerPoint.y,t,i.strokeWidth),new wr(s.upperPoint.x-a,s.upperPoint.y,t,i.strokeWidth))}if(n!==void 0){const r=n.upperPoint.x-n.lowerPoint.x;o.push(new wr(n.lowerPoint.x,n.upperPoint.y,r,e.strokeWidth),new wr(n.lowerPoint.x,n.lowerPoint.y-a,i.strokeWidth,t),new wr(n.upperPoint.x,n.upperPoint.y-a,i.strokeWidth,t))}this.bboxes.components=o,this.bboxes.union=wr.merge(o)}containsPoint(t,e){return this.bboxes.containsPoint(t,e)}pickNode(t,e){return this.containsPoint(t,e)?this:void 0}nearestSquared(t,e,i){const{bboxes:s}=this;if(s.union.distanceSquared(t,e)>i)return{nearest:void 0,distanceSquared:1/0};const{distanceSquared:n}=wr.nearestBox(t,e,s.components);return{nearest:this,distanceSquared:n}}},Yst=class extends Zf._ModuleSupport.Group{nearestSquared(t,e){const{nearest:i,distanceSquared:s}=Gst(t,e,{children:this.children()});if(i!==void 0&&!isNaN(s))return{datum:i.datum,distanceSquared:s}}},Kst=(R(),E(w)),{BaseProperties:n4,Validate:Ie,BOOLEAN:a4,COLOR_STRING:o4,FUNCTION:$st,LINE_DASH:r4,NUMBER:Xst,OBJECT:Zst,POSITIVE_NUMBER:KS,RATIO:XL,STRING:Hl}=Kst._ModuleSupport,Er=class extends n4{};y([Ie(a4,{optional:!0})],Er.prototype,"visible",2),y([Ie(o4,{optional:!0})],Er.prototype,"stroke",2),y([Ie(KS,{optional:!0})],Er.prototype,"strokeWidth",2),y([Ie(XL,{optional:!0})],Er.prototype,"strokeOpacity",2),y([Ie(r4,{optional:!0})],Er.prototype,"lineDash",2),y([Ie(KS,{optional:!0})],Er.prototype,"lineDashOffset",2),y([Ie(Xst,{optional:!0})],Er.prototype,"length",2),y([Ie(XL,{optional:!0})],Er.prototype,"lengthRatio",2);var Vi=class extends n4{constructor(){super(...arguments),this.visible=!0,this.stroke="black",this.strokeWidth=1,this.strokeOpacity=1,this.cap=new Er}};y([Ie(Hl,{optional:!0})],Vi.prototype,"yLowerKey",2),y([Ie(Hl,{optional:!0})],Vi.prototype,"yLowerName",2),y([Ie(Hl,{optional:!0})],Vi.prototype,"yUpperKey",2),y([Ie(Hl,{optional:!0})],Vi.prototype,"yUpperName",2),y([Ie(Hl,{optional:!0})],Vi.prototype,"xLowerKey",2),y([Ie(Hl,{optional:!0})],Vi.prototype,"xLowerName",2),y([Ie(Hl,{optional:!0})],Vi.prototype,"xUpperKey",2),y([Ie(Hl,{optional:!0})],Vi.prototype,"xUpperName",2),y([Ie(a4,{optional:!0})],Vi.prototype,"visible",2),y([Ie(o4,{optional:!0})],Vi.prototype,"stroke",2),y([Ie(KS,{optional:!0})],Vi.prototype,"strokeWidth",2),y([Ie(XL,{optional:!0})],Vi.prototype,"strokeOpacity",2),y([Ie(r4,{optional:!0})],Vi.prototype,"lineDash",2),y([Ie(KS,{optional:!0})],Vi.prototype,"lineDashOffset",2),y([Ie($st,{optional:!0})],Vi.prototype,"itemStyler",2),y([Ie(Zst)],Vi.prototype,"cap",2);var{fixNumericExtent:Qst,groupAccumulativeValueProperty:qst,mergeDefaults:Jst,valueProperty:$S,ChartAxisDirection:ZL}=Xf._ModuleSupport;function tnt(t){for(const e of Xf.AgErrorBarSupportedSeriesTypes)if(e===t.series.type)return t.series;throw new Error(`AG Charts - unsupported series type '${t.series.type}', error bars supported series types: ${Xf.AgErrorBarSupportedSeriesTypes.join(", ")}`)}var ent=class By extends Xf._ModuleSupport.BaseModuleInstance{constructor(e){super(),this.properties=new Vi;const i=tnt(e),{annotationGroup:s,annotationSelections:n}=i;this.cartesianSeries=i,this.groupNode=new Yst({name:`${s.id}-errorBars`}),s.appendChild(this.groupNode),this.selection=Xf._ModuleSupport.Selection.select(this.groupNode,()=>this.errorBarFactory()),n.add(this.selection),i.addEventListener("seriesVisibilityChange",a=>this.onToggleSeriesItem(a)),this.destroyFns.push(i.addListener("data-processed",a=>this.onDataProcessed(a)),i.addListener("data-update",a=>this.onDataUpdate(a)),e.highlightManager.addListener("highlight-change",a=>this.onHighlightChange(a)),()=>s.removeChild(this.groupNode),()=>n.delete(this.selection))}hasErrorBars(){const{xLowerKey:e,xUpperKey:i,yLowerKey:s,yUpperKey:n}=this.properties;return Fi(e)&&Fi(i)||Fi(s)&&Fi(n)}isStacked(){const e=this.cartesianSeries.seriesGrouping?.stackCount;return e==null?!1:e>0}getUnstackPropertyDefinition(e){const i=[],{xLowerKey:s,xUpperKey:n,yLowerKey:a,yUpperKey:o,xErrorsID:r,yErrorsID:l}=this.getMaybeFlippedKeys(),{xScaleType:c,yScaleType:h}=e;return a!=null&&o!=null&&i.push($S(a,h,{id:`${l}-lower`}),$S(o,h,{id:`${l}-upper`})),s!=null&&n!=null&&i.push($S(s,c,{id:`${r}-lower`}),$S(n,c,{id:`${r}-upper`})),i}getStackPropertyDefinition(e){const i=[],{cartesianSeries:s}=this,{xLowerKey:n,xUpperKey:a,yLowerKey:o,yUpperKey:r,xErrorsID:l,yErrorsID:c}=this.getMaybeFlippedKeys(),{xScaleType:h,yScaleType:u}=e,d=s.seriesGrouping?.groupIndex??s.id,p={invalidValue:null,missingValue:0,separateNegative:!0,...s.visible?{}:{forceValue:0}},g=(x,m,b,v)=>qst(x,"normal","current",{id:`${m}-${b}`,groupId:`errorGroup-${d}-${b}`,...p},v),f=(x,m,b,v)=>{i.push(...g(x,b,"lower",v),...g(m,b,"upper",v))};return o!=null&&r!=null&&f(o,r,c,u),n!=null&&a!=null&&f(n,a,l,h),i}getPropertyDefinitions(e){return this.isStacked()?this.getStackPropertyDefinition(e):this.getUnstackPropertyDefinition(e)}onDataProcessed(e){this.dataModel=e.dataModel,this.processedData=e.processedData}getDomain(e){const{xLowerKey:i,xUpperKey:s,xErrorsID:n,yLowerKey:a,yUpperKey:o,yErrorsID:r}=this.getMaybeFlippedKeys();if(e===ZL.X?Fi(i)&&Fi(s):Fi(a)&&Fi(o)){const{dataModel:c,processedData:h,cartesianSeries:u}=this;if(c!=null&&h!=null){const d={x:n,y:r}[e],p=c.getDomain(u,`${d}-lower`,"value",h),g=c.getDomain(u,`${d}-upper`,"value",h),f=[Math.min(...p,...g),Math.max(...p,...g)];return Qst(f)}}return[]}onDataUpdate(e){this.dataModel=e.dataModel,this.processedData=e.processedData,Fi(e.dataModel)&&Fi(e.processedData)&&(this.createNodeData(),this.update())}getNodeData(){return this.hasErrorBars()?this.cartesianSeries.contextNodeData?.nodeData:void 0}createNodeData(){const e=this.getNodeData(),i=this.cartesianSeries.axes[ZL.X]?.scale,s=this.cartesianSeries.axes[ZL.Y]?.scale;if(!(!i||!s||!e))for(let n=0;nthis.updateNode(i,s,n)))}updateNode(e,i,s){e.datum=i,e.update(this.getDefaultStyle(),this.properties,!1),e.updateBBoxes()}pickNodeExact(e){const{x:i,y:s}=e,n=this.groupNode.pickNode(i,s);if(n!=null)return{datum:n.datum,distanceSquared:0}}pickNodeNearest(e){return this.groupNode.nearestSquared(e.x,e.y)}pickNodeMainAxisFirst(e){return this.groupNode.nearestSquared(e.x,e.y)}getTooltipParams(){const{xLowerKey:e,xUpperKey:i,yLowerKey:s,yUpperKey:n,xLowerName:a=e,xUpperName:o=i,yLowerName:r=s,yUpperName:l=n}=this.properties;return{xLowerKey:e,xLowerName:a,xUpperKey:i,xUpperName:o,yLowerKey:s,yLowerName:r,yUpperKey:n,yUpperName:l}}onToggleSeriesItem(e){this.groupNode.visible=e.visible}makeStyle(e){return{visible:e.visible,lineDash:e.lineDash,lineDashOffset:e.lineDashOffset,stroke:e.stroke,strokeWidth:e.strokeWidth,strokeOpacity:e.strokeOpacity,cap:Jst(this.properties.cap,e)}}getDefaultStyle(){return this.makeStyle(this.getWhiskerProperties())}getHighlightStyle(){return this.makeStyle(this.getWhiskerProperties())}restyleHighlightChange(e,i,s){const n=this.getNodeData();if(n!=null){for(let a=0;anew ent(t),themeTemplate:int},XS=(R(),E(w)),{ZIndexMap:nnt,ActionOnSet:ant,Validate:QL,ProxyPropertyOnWrite:l4,OBJECT:ont,RATIO:rnt,COLOR_STRING:lnt}=XS._ModuleSupport,ZS=class extends XS._ModuleSupport.Background{constructor(){super(...arguments),this.image=new No,this.fill="transparent",this.fillOpacity=void 0}createNode(){return new XS._ModuleSupport.Group({name:"foreground",zIndex:nnt.FOREGROUND})}onLayoutComplete(t){super.onLayoutComplete(t);const{width:e,height:i}=t.chart;let s={x:0,y:0,width:e,height:i};this.image&&(s=this.image.performLayout(e,i)),this.text&&this.updateTextNode(s)}onImageLoad(){this.ctx.updateService.update(XS._ModuleSupport.ChartUpdateType.SCENE_RENDER)}updateTextNode(t){const{textNode:e}=this;e.fontWeight="bold",e.fontFamily="Impact, sans-serif",e.fontSize=19,e.opacity=.7,e.fill="#9b9b9b",e.textBaseline="top";const i=this.textNode.getBBox(),s=10;e.x=t.x+t.width/2-i.width/2,e.y=t.y+t.height+s}};y([QL(ont,{optional:!0}),ant({newValue(t){this.node.appendChild(t.node),t.onLoad=()=>this.onImageLoad()},oldValue(t){this.node.removeChild(t.node),t.onLoad=void 0}})],ZS.prototype,"image",2),y([QL(lnt,{optional:!0}),l4("rectNode","fill")],ZS.prototype,"fill",2),y([QL(rnt,{optional:!0}),l4("rectNode","fillOpacity")],ZS.prototype,"fillOpacity",2);var cnt={type:"root",optionsKey:"foreground",packageType:"enterprise",chartTypes:["cartesian","polar","hierarchy","topology","flow-proportion","standalone","gauge"],moduleFactory:t=>new ZS(t)},hnt=(R(),E(w)),qL=(R(),E(w)),c4=(R(),E(w)),unt=(R(),E(w)),{TranslatableGroup:dnt,ScenePathChangeDetection:h4}=unt._ModuleSupport,JL=class extends dnt{constructor(){super(...arguments),this.inset=0,this.cornerRadius=0}applyClip(t,e){const{cornerRadius:i,inset:s}=this,{x:n,y:a,width:o,height:r}=e;t.beginPath(),t.roundRect(n+s,a+s,o-2*s,r-2*s,i),t.clip()}};y([h4()],JL.prototype,"inset",2),y([h4()],JL.prototype,"cornerRadius",2);var{Validate:tT,BOOLEAN:pnt,POSITIVE_NUMBER:u4,ZIndexMap:Oh,ActionOnSet:d4,CategoryAxis:gnt,TextUtils:fnt,Padding:ynt,Group:wh,BBox:p4,ProxyProperty:g4}=c4._ModuleSupport,eT=class{constructor(){this.top=0,this.bottom=0}};y([tT(u4)],eT.prototype,"top",2),y([tT(u4)],eT.prototype,"bottom",2);var Kd=class extends c4._ModuleSupport.BaseModuleInstance{constructor(t){super(),this.ctx=t,this.enabled=!1,this.padding=new eT,this.root=new wh({name:"root"}),this.seriesRoot=this.root.appendChild(new JL({name:"Series-root",zIndex:Oh.SERIES_LAYER,renderToOffscreenCanvas:!0})),this.axisGridGroup=this.root.appendChild(new wh({name:"Axes-Grids",zIndex:Oh.AXIS_GRID})),this.axisGroup=this.root.appendChild(new wh({name:"Axes-Grids",zIndex:Oh.AXIS_GRID})),this.axisLabelGroup=this.root.appendChild(new wh({name:"Axes-Labels",zIndex:Oh.SERIES_LABEL})),this.axisCrosslineRangeGroup=this.root.appendChild(new wh({name:"Axes-Crosslines-Range",zIndex:Oh.SERIES_CROSSLINE_RANGE})),this.axisCrosslineLineGroup=this.root.appendChild(new wh({name:"Axes-Crosslines-Line",zIndex:Oh.SERIES_CROSSLINE_LINE})),this.axisCrosslineLabelGroup=this.root.appendChild(new wh({name:"Axes-Crosslines-Label",zIndex:Oh.SERIES_LABEL})),this.data=[],this._destroyed=!1,this.miniChartAnimationPhase="initial",this.axes=[],this.series=[]}destroy(){this._destroyed||(this.destroySeries(this.series),this.axes.forEach(t=>t.destroy()),this.axes=[],this._destroyed=!0)}onSeriesChange(t,e){const i=e?.filter(s=>!t.includes(s))??[];this.destroySeries(i);for(const s of t){if(e?.includes(s))continue;s.attachSeries(this.seriesRoot,this.seriesRoot,void 0);const n=this;s.chart={get mode(){return"standalone"},get isMiniChart(){return!0},get seriesRect(){return n.seriesRect}},s.resetAnimation(this.miniChartAnimationPhase==="initial"?"initial":"disabled")}}destroySeries(t){t?.forEach(e=>{e.destroy(),e.detachSeries(this.seriesRoot,this.seriesRoot,void 0),e.chart=void 0})}assignSeriesToAxes(){this.axes.forEach(t=>{t.boundSeries=this.series.filter(e=>e.axes[t.direction]===t)})}assignAxesToSeries(){const t={};this.axes.forEach(e=>{const i=e.direction;(t[i]??(t[i]=[])).push(e)}),this.series.forEach(e=>{e.directions.forEach(i=>{const s=t[i];if(!s){Gt.warnOnce(`no available axis for direction [${i}]; check series and axes configuration.`);return}const n=e.getKeys(i),a=this.findMatchingAxis(s,n);if(!a){Gt.warnOnce(`no matching axis for direction [${i}] and keys [${n}]; check series and axes configuration.`);return}e.axes[i]=a})})}findMatchingAxis(t,e){for(const i of t){if(!i.keys.length)return i;if(e){for(const s of e)if(i.keys.includes(s))return i}}}updateData(t){this.series.forEach(e=>e.setChartData(t)),this.miniChartAnimationPhase==="initial"&&this.ctx.animationManager.onBatchStop(()=>{this.miniChartAnimationPhase="ready",this.series.forEach(e=>e.resetAnimation("disabled"))})}async processData(t){this.series.some(e=>e.canHaveAxes)&&(this.assignAxesToSeries(),this.assignSeriesToAxes()),await Promise.all(this.series.map(e=>(e.resetDatumCallbackCache(),e.processData(t))));for(const e of this.axes)e.processData()}computeAxisPadding(){const t=new ynt;return this.enabled&&this.axes.forEach(({position:e,thickness:i,line:s,label:n})=>{if(e==null)return;let a;i?a=i:a=(s.enabled?s.width:0)+(n.enabled?fnt.getLineHeight(n.fontSize??0)+n.spacing:0),t[e]=Math.ceil(a)}),t}async layout(t,e){const{padding:i}=this,s=this.seriesRect!=null,n=new p4(0,0,t,e-(i.top+i.bottom));this.seriesRect=n,this.seriesRoot.translationY=i.top,this.seriesRoot.setClipRectCanvasSpace(new p4(0,-i.top,t,e)),this.axes.forEach(a=>{const{position:o="left"}=a;switch(o){case"top":case"bottom":a.range=[0,n.width],a.gridLength=n.height;break;case"right":case"left":{const r=a instanceof gnt;a.range=r?[0,n.height]:[n.height,0],a.gridLength=n.width;break}}a.gridPadding=0,a.translation.x=0,a.translation.y=0,o==="right"?a.translation.x=t:o==="bottom"&&(a.translation.y=e),s||a.resetAnimation("initial"),a.calculateLayout(),a.update()}),await Promise.all(this.series.map(a=>a.update({seriesRect:n})))}};y([tT(pnt)],Kd.prototype,"enabled",2),y([g4(["seriesRoot","inset"])],Kd.prototype,"inset",2),y([g4(["seriesRoot","cornerRadius"])],Kd.prototype,"cornerRadius",2),y([d4({changeValue(t,e=[]){const i={axisNode:this.axisGroup,gridNode:this.axisGridGroup,labelNode:this.axisLabelGroup,crossLineLineNode:this.axisCrosslineLineGroup,crossLineRangeNode:this.axisCrosslineRangeGroup,crossLineLabelNode:this.axisCrosslineLabelGroup};for(const s of e)t.includes(s)||(s.detachAxis(i),s.destroy());for(const s of t)e?.includes(s)||s.attachAxis(i)}})],Kd.prototype,"axes",2),y([d4({changeValue(t,e){this.onSeriesChange(t,e)}})],Kd.prototype,"series",2);var mnt=(R(),E(w)),{clamp:xnt,SliderWidget:f4}=mnt._ModuleSupport,bnt=class{constructor(t,e){this.ctx=t,this.sliderHandlers=e,this._min=0,this._max=1,this.minRange=.001,this.dragStartX=0,this.ctx=t,this.toolbar=t.proxyInteractionService.createProxyContainer({type:"toolbar",domManagerId:"navigator-toolbar",classList:["ag-charts-proxy-navigator-toolbar"],orientation:"vertical",ariaLabel:{id:"ariaLabelNavigator"}}),this.sliders=[t.proxyInteractionService.createProxyElement({type:"slider",domIndex:1,ariaLabel:{id:"ariaLabelNavigatorMinimum"},parent:this.toolbar,cursor:"ew-resize"}),t.proxyInteractionService.createProxyElement({type:"slider",domIndex:-1/0,ariaLabel:{id:"ariaLabelNavigatorRange"},parent:this.toolbar,cursor:"grab"}),t.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 n=this.sliders[i];n.step=f4.STEP_HUNDRETH,n.keyboardStep=f4.STEP_ONE,n.orientation="horizontal",n.setPreventsDefault(!1),n.addListener("drag-start",a=>this.onDragStart(i,a,s)),n.addListener("drag-move",a=>this.onDrag(n,a,s)),n.addListener("drag-end",()=>this.updateSliderRatios()),n.addListener("contextmenu",a=>this.onContextMenu(n,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(t){this.toolbar.setHidden(!t)}updateZoom(){const{_min:t,_max:e}=this;if(!(t==null||e==null))return this.ctx.zoomManager.updateZoom("navigator",{x:{min:t,max:e}})}updateBounds(t){this.toolbar.setBounds(t)}updateSliderBounds(t,e){this.sliders[t].setBounds(e)}updateMinMax(t,e){this._min=t,this._max=e,this.updateSliderRatios()}updateSliderRatios(){const{_min:t,_max:e}=this,i=this.ctx.localeManager.t("ariaValuePanRange",{min:t,max:e});this.sliders[0].setValueRatio(t),this.sliders[1].setValueRatio(t,{ariaValueText:i}),this.sliders[2].setValueRatio(e)}toCanvasOffsets(t){return{offsetX:this.dragStartX+t.originDeltaX}}moveToFront(t){if(t===1)return;const e=this.sliders[t],i=this.sliders[2-t];this.toolbar.moveChild(i,e.domIndex-1)}onDragStart(t,e,i){const s=this.sliders[t],n=this.toolbar.cssLeft(),a=s.cssLeft();this.dragStartX=n+a+e.offsetX,this.moveToFront(t),e.device==="touch"&&e.sourceEvent.preventDefault(),this.sliderHandlers.onDragStart(i,this.toCanvasOffsets(e))}onDrag(t,e,i){e.device==="touch"&&e.sourceEvent.preventDefault(),this.sliderHandlers.onDrag(i,this.toCanvasOffsets(e))}onContextMenu(t,{sourceEvent:e,offsetX:i,offsetY:s}){const{x:n,y:a}=this.toolbar.getBounds(),{x:o,y:r}=t.getBounds(),l=i+n+o,c=s+a+r;this.ctx.contextMenuRegistry.dispatchContext("all",{sourceEvent:e,canvasX:l,canvasY:c},{})}onPanSliderChange(){const t=this.sliders[1].getValueRatio(),e=this._max-this._min;this._min=xnt(0,t,1-e),this._max=this._min+e,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()}},y4=(R(),E(w)),{Validate:QS,ScenePathChangeDetection:qS,POSITIVE_NUMBER:iT,BOOLEAN:Snt,BBox:vnt,ExtendedPath2D:Mnt}=y4._ModuleSupport,Yl=class extends y4._ModuleSupport.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 Mnt}setCenter(t,e){this.dirtyPath=!0,(this.centerX!==t||this.centerY!==e)&&(this.centerX=t,this.centerY=e,this.markDirty())}static align(t,e,i,s,n,a,o,r,l){const c=t.align(i+n*o)+l,h=c+t.align(i+n*o,n*(r-o))-2*l,u=t.align(s+a/2);t.setCenter(c,u),e.setCenter(h,u)}computeBBox(){const{centerX:t,centerY:e,width:i,height:s}=this,n=t-i/2,a=e-s/2;return new vnt(n,a,i,s)}isPointInPath(t,e){return this.getBBox().containsPoint(t,e)}updatePath(){const{centerX:t,centerY:e,path:i,gripPath:s,strokeWidth:n,cornerRadius:a,grip:o}=this,r=n/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(t-c+r,e-h+r,2*(c-r),2*(h-r),a);const u=3;if(o)for(let d=-.5;d<=.5;d+=1)for(let p=-1;p<=1;p+=1)s.arc(t+d*u,e+p*u,1,0,2*Math.PI),s.closePath()}renderFill(t,e){const{stroke:i}=this;super.renderFill(t,e),t.fillStyle=typeof i=="string"?i:"black",t.fill(this.gripPath.getPath2D())}};Yl.className="RangeHandle",y([QS(iT),qS()],Yl.prototype,"width",2),y([QS(iT),qS()],Yl.prototype,"height",2),y([QS(iT),qS()],Yl.prototype,"cornerRadius",2),y([QS(Snt),qS()],Yl.prototype,"grip",2);var Int=(R(),E(w)),{Path:Ant,BBox:Qf,ExtendedPath2D:Dnt,clippedRoundRect:sT,POSITIVE_NUMBER:knt,Validate:Lnt,ScenePathChangeDetection:Tnt}=Int._ModuleSupport,nT=class extends Ant{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 Dnt}layout(t,e,i,s,n,a){n=isNaN(n)?this.min:n,a=isNaN(a)?this.max:a,(t!==this.x||e!==this.y||i!==this.width||this.height!==s||n!==this.min||a!==this.max)&&(this.x=t,this.y=e,this.width=i,this.height=s,this.min=n,this.max=a,this.dirtyPath=!0,this.markDirty())}computeBBox(){const{x:t,y:e,width:i,height:s}=this;return new Qf(t,e,i,s)}computeVisibleRangeBBox(){const{x:t,y:e,width:i,height:s,min:n,max:a}=this,o=t+i*n,r=t+i*a;return new Qf(o,e,r-o,s)}updatePath(){const{path:t,visiblePath:e,x:i,y:s,width:n,height:a,min:o,max:r,strokeWidth:l,cornerRadius:c}=this,h=l/2;t.clear(),e.clear();const u=this.align(i)+h,d=this.align(s)+h,p=this.align(i,n)-2*h,g=this.align(s,a)-2*h,f=this.align(i+n*o)+h,x=f+this.align(i+n*o,n*(r-o))-2*h,m={topLeft:c,topRight:c,bottomRight:c,bottomLeft:c};sT(t,u,d,p,g,m,new Qf(u,d,f-u,g)),sT(t,u,d,p,g,m,new Qf(x,d,p+u-x,g)),x-f>1&&sT(e,u,d,p,g,m,new Qf(f,d,x-f,g))}renderStroke(t,e){super.renderStroke(t,e),super.renderStroke(t,this.visiblePath.getPath2D())}};nT.className="RangeMask",y([Lnt(knt),Tnt()],nT.prototype,"cornerRadius",2);var JS=(R(),E(w)),Cnt=class extends JS._ModuleSupport.Group{constructor(t){super({name:"rangeSelectorGroup",zIndex:JS._ModuleSupport.ZIndexMap.NAVIGATOR}),this.x=0,this.y=0,this.width=200,this.height=30,this.lOffset=0,this.rOffset=0,this.background=this.appendChild(new JS._ModuleSupport.TranslatableGroup({name:"navigator-background",zIndex:1})),this.append(t)}layout(t,e,i,s,n,a){this.x=t,this.y=e,this.width=i,this.height=s,this.lOffset=n,this.rOffset=a,this.background.translationX=t,this.background.translationY=e,this.markDirty()}updateBackground(t,e){t!=null&&this.background.removeChild(t),e!=null&&this.background.appendChild(e),this.markDirty()}computeBBox(){const{x:t,y:e,width:i,height:s,lOffset:n,rOffset:a}=this;return new JS._ModuleSupport.BBox(t-n,e,i+(n+a),s)}},{clamp:aT,BaseModuleInstance:Nnt,ObserveChanges:oT,Validate:tv,BOOLEAN:Ont,POSITIVE_NUMBER:rT}=qL._ModuleSupport,$d=class extends Nnt{constructor(t){super(),this.ctx=t,this.enabled=!1,this.mask=new nT,this.minHandle=new Yl,this.maxHandle=new Yl,this.maskVisibleRange={id:"navigator-mask-visible-range",getBBox:()=>this.mask.computeVisibleRangeBBox(),toCanvasBBox:()=>this.mask.computeVisibleRangeBBox(),fromCanvasPoint:(e,i)=>({x:e,y:i})},this.height=30,this.cornerRadius=0,this.spacing=10,this.x=0,this.y=0,this.width=0,this.rangeSelector=new Cnt([this.mask,this.minHandle,this.maxHandle]),this.destroyFns.push(t.scene.attachNode(this.rangeSelector),this.ctx.localeManager.addListener("locale-changed",()=>this.updateZoom()),this.ctx.layoutManager.registerElement(qL._ModuleSupport.LayoutElement.Navigator,e=>this.onLayoutStart(e)),this.ctx.layoutManager.addListener("layout:complete",e=>this.onLayoutComplete(e)),t.zoomManager.addListener("zoom-change",e=>this.onZoomChange(e))),this.domProxy=new bnt(t,this),this.updateGroupVisibility(),this.miniChart=new Kd(t)}updateBackground(t,e){this.rangeSelector?.updateBackground(t,e)}updateGroupVisibility(){const{enabled:t}=this;this.rangeSelector==null||t===this.rangeSelector.visible||(this.rangeSelector.visible=t,this.domProxy.updateVisibility(t),t?this.updateZoom():this.ctx.zoomManager.updateZoom("navigator"))}onLayoutStart(t){if(this.enabled){const{layoutBox:e}=t,i=this.height+this.spacing;e.shrink(i,"bottom"),this.y=e.y+e.height+this.spacing}else this.y=0;if(this.enabled&&this.miniChart){const{top:e,bottom:i}=this.miniChart.computeAxisPadding();t.layoutBox.shrink(e+i,"bottom"),this.y-=i,this.miniChart.inset=this.mask.strokeWidth/2,this.miniChart.cornerRadius=this.mask.cornerRadius}}onLayoutComplete(t){const{x:e,width:i}=t.series.rect,{y:s,height:n}=this;if(this.domProxy.updateVisibility(this.enabled),this.enabled){const{_min:a,_max:o}=this.domProxy;this.layoutNodes(e,s,i,n,a,o),this.domProxy.updateBounds({x:e,y:s,width:i,height:n})}this.x=e,this.width=i,this.miniChart?.layout(i,n).catch(a=>Gt.error(a))}canDrag(){return this.enabled&&this.ctx.interactionManager.isState(qL._ModuleSupport.InteractionState.ZoomDraggable)}onDragStart(t,{offsetX:e}){this.canDrag()&&(t==="pan"&&(this.panStart=(e-this.x)/this.width-this.domProxy._min),this.ctx.zoomManager.fireZoomPanStartEvent("navigator"))}onDrag(t,{offsetX:e}){if(!this.canDrag())return;const{panStart:i,x:s,width:n}=this,{minRange:a}=this.domProxy;let{_min:o,_max:r}=this.domProxy;const l=(e-s)/n;if(t==="min")o=aT(0,l,r-a);else if(t==="max")r=aT(o+a,l,1);else if(t==="pan"&&i!=null){const c=r-o;o=aT(0,l-i,1-c),r=o+c}this.domProxy._min=o,this.domProxy._max=r,this.updateZoom()}onZoomChange(t){const{x:e}=t;if(!e)return;const{x:i,y:s,width:n,height:a}=this,{min:o,max:r}=e;this.domProxy.updateMinMax(o,r),this.layoutNodes(i,s,n,a,o,r)}layoutNodes(t,e,i,s,n,a){const{rangeSelector:o,mask:r,minHandle:l,maxHandle:c}=this;r.layout(t,e,i,s,n,a),o.layout(t,e,i,s,l.width/2,c.width/2),Yl.align(l,c,t,e,i,s,n,a,r.strokeWidth/2),n+(a-n)/2<.5?(l.zIndex=3,c.zIndex=4):(l.zIndex=4,c.zIndex=3),[l,this.maskVisibleRange,c].forEach((h,u)=>{const d=h.getBBox(),p={x:d.x-t,y:d.y-e,height:d.height,width:d.width};this.domProxy.updateSliderBounds(u,p)})}updateZoom(){this.enabled&&this.domProxy.updateZoom()}updateData(t){return this.miniChart?.updateData(t)}async processData(t){if(this.miniChart)return this.miniChart?.processData(t)}};y([oT((t,e,i)=>{t.updateBackground(i?.root,e?.root)})],$d.prototype,"miniChart",2),y([tv(Ont),oT((t,e)=>{t.ctx.zoomManager.setNavigatorEnabled(!!e),t.updateGroupVisibility()})],$d.prototype,"enabled",2),y([tv(rT)],$d.prototype,"height",2),y([tv(rT),oT((t,e)=>{t.mask.cornerRadius=e})],$d.prototype,"cornerRadius",2),y([tv(rT)],$d.prototype,"spacing",2);var wnt={type:"root",optionsKey:"navigator",packageType:"enterprise",chartTypes:["cartesian"],moduleFactory:t=>new $d(t),removable:!1,themeTemplate:{navigator:{enabled:!1,height:18,cornerRadius:4,mask:{fill:{$ref:"foregroundColor"},fillOpacity:.1,stroke:{$ref:"borderColor"},strokeWidth:1},minHandle:{fill:{$ref:"backgroundColor"},stroke:{$ref:"borderColor"},strokeWidth:1,width:12,height:24,cornerRadius:4},maxHandle:{fill:{$ref:"backgroundColor"},stroke:{$ref:"borderColor"},strokeWidth:1,width:12,height:24,cornerRadius:4},miniChart:{enabled:!1,label:{color:{$ref:"textColor"},fontSize:{$rem:[hnt._ModuleSupport.FONT_SIZE_RATIO.SMALLER]},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},spacing:5},padding:{top:0,bottom:0}}}}},m4=(R(),E(w)),Ent=(R(),E(w)),{AND:Rnt,ARRAY:x4,FUNCTION:_nt,NUMBER:Pnt,OR:Bnt,ToolbarButtonProperties:znt,Validate:Fnt}=Ent._ModuleSupport,b4=class extends znt{};y([Fnt(Bnt(Pnt,Rnt(x4,x4.restrict({length:2})),_nt))],b4.prototype,"value",2);var{BOOLEAN:jnt,OBJECT:Vnt,ChartAxisDirection:lT,LayoutElement:Gnt,PropertiesArray:Wnt,Toolbar:Unt,Validate:S4}=m4._ModuleSupport,cT=class extends m4._ModuleSupport.BaseModuleInstance{constructor(t){super(),this.ctx=t,this.enabled=!1,this.buttons=new Wnt(b4),this.verticalSpacing=10,this.container=t.domManager.addChild("canvas-overlay","range-buttons"),this.container.role="presentation",this.toolbar=new Unt(this.ctx.localeManager),this.toolbar.addClass("ag-charts-range-buttons"),this.container.append(this.toolbar.getElement()),this.destroyFns.push(this.toolbar.addToolbarListener("button-pressed",this.onButtonPress.bind(this)),t.layoutManager.registerElement(Gnt.ToolbarBottom,this.onLayoutStart.bind(this)),t.zoomManager.addListener("zoom-change",this.onZoomChanged.bind(this)),this.teardown.bind(this))}teardown(){this.container.removeChild(this.toolbar.getElement()),this.toolbar.destroy()}onLayoutStart(t){const{buttons:e,ctx:i,enabled:s,toolbar:n,verticalSpacing:a}=this,{layoutBox:o}=t;if(!s||!i.zoomManager.isZoomEnabled()){n.setHidden(!0);return}n.setHidden(!1),n.updateButtons(e);const r=n.getBounds().height;n.setBounds({x:o.x,y:o.y+o.height-r,width:o.width,height:r}),o.shrink({bottom:r+a})}onZoomChanged(){this.toolbar.clearActiveButton()}onButtonPress({button:{index:t}}){const{zoomManager:e}=this.ctx,i=this.buttons.at(t);if(!i)return;const{value:s}=i;typeof s=="number"?e.extendToEnd("zoom-buttons",lT.X,s):Array.isArray(s)?e.updateWith("zoom-buttons",lT.X,()=>s):typeof s=="function"&&e.updateWith("zoom-buttons",lT.X,s),this.toolbar.toggleActiveButtonByIndex(t)}};y([S4(jnt)],cT.prototype,"enabled",2),y([S4(Vnt)],cT.prototype,"buttons",2);var v4=1e3*60*60*24,hT=v4*30,Hnt=v4*365,Ynt={type:"root",optionsKey:"ranges",packageType:"enterprise",chartTypes:["cartesian"],moduleFactory:t=>new cT(t),themeTemplate:{ranges:{enabled:!1,buttons:[{label:"toolbarRange1Month",ariaLabel:"toolbarRange1MonthAria",value:hT},{label:"toolbarRange3Months",ariaLabel:"toolbarRange3MonthsAria",value:3*hT},{label:"toolbarRange6Months",ariaLabel:"toolbarRange6MonthsAria",value:6*hT},{label:"toolbarRangeYearToDate",ariaLabel:"toolbarRangeYearToDateAria",value:(t,e)=>[new Date(`${new Date(e).getFullYear()}-01-01`).getTime(),e]},{label:"toolbarRange1Year",ariaLabel:"toolbarRange1YearAria",value:Hnt},{label:"toolbarRangeAll",ariaLabel:"toolbarRangeAllAria",value:(t,e)=>[t,e]}]}}},bbt=(R(),E(w)),M4=(R(),E(w)),I4=class zy extends M4._ModuleSupport.BaseModuleInstance{constructor(e){super(),this.ctx=e,this.activeSections=new Set,this.sectionButtons={annotations:[],chartToolbar:[]},this.container=this.ctx.domManager.addChild("canvas-overlay","shared-toolbar"),this.container.role="presentation"}getSharedToolbar(e){return this.sharedToolbar||this.createSharedToolbar(),this.toolbarWithSection(e)}createSharedToolbar(){this.sharedToolbar=new M4._ModuleSupport.Toolbar(this.ctx.localeManager,"vertical"),this.sharedToolbar.addClass("ag-charts-shared-toolbar"),this.container.append(this.sharedToolbar.getElement()),this.destroyFns.push(()=>{this.sharedToolbar&&(this.container.removeChild(this.sharedToolbar.getElement()),this.sharedToolbar.destroy(),this.sharedToolbar=void 0)})}toolbarWithSection(e){const i=this.sharedToolbar,s={layout:(n,a)=>{if(this.firstLayoutSection!=null&&this.firstLayoutSection!==e&&this.activeSections.has(this.firstLayoutSection))return;this.firstLayoutSection=e;const o=i.getBounds().width;i.setBounds({x:n.x,y:n.y,width:o}),n.shrink({left:o+i.horizontalSpacing+(a??0)})},addToolbarListener:(n,a)=>i.addToolbarListener(n,o=>{const r=this.getSectionIndex(e,o.button.index);if(r<0)return;const l={...o,button:this.sectionButtons[e][r]};a(l)}),updateButtons:n=>{this.sectionButtons[e]=n;const a=zy.SECTION_ORDER.flatMap(o=>this.sectionButtons[o]);i.updateButtons(a)},updateButtonByIndex:(n,a)=>{i.updateButtonByIndex(this.getIndex(e,n),a)},toggleActiveButtonByIndex:n=>{i.toggleActiveButtonByIndex(this.getIndex(e,n))},toggleButtonEnabledByIndex:(n,a)=>{i.toggleButtonEnabledByIndex(this.getIndex(e,n),a)},setHidden:n=>{n?this.activeSections.delete(e):this.activeSections.add(e);let a=0;for(const o of zy.SECTION_ORDER){if(o!==e){a+=this.sectionButtons[o].length;continue}for(const r of this.sectionButtons[e].keys())i.setButtonHiddenByIndex(a+r,n)}},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(e,i){let s=0;for(const n of zy.SECTION_ORDER){if(n===e)return s+i;s+=this.sectionButtons[n].length}return-1}getSectionIndex(e,i){let s=0;for(const n of zy.SECTION_ORDER){if(n===e)return i>=s+this.sectionButtons[e].length?-1:i-s;s+=this.sectionButtons[n].length}return-1}};I4.SECTION_ORDER=["chartToolbar","annotations"];var Knt=I4,$nt={type:"context",contextKey:"sharedToolbar",packageType:"enterprise",chartTypes:["cartesian"],moduleFactory:t=>new Knt(t)},ev=(R(),E(w)),uT=(R(),E(w)),{CachedTextMeasurerPool:qf,ZIndexMap:Xnt,LayoutElement:Znt,Validate:Cs,BaseProperties:Qnt,OBJECT:Xd,BOOLEAN:qnt,STRING:Zd,COLOR_STRING:Jnt,RATIO:tat,valueProperty:eat,TextUtils:iat,Group:sat,Label:Jf,Rect:nat,Text:Ti}=uT._ModuleSupport,A4={ohlc:62,candlestick:62,"hollow-candlestick":62,line:96,"step-line":96,hlc:184,"high-low":800},aat={up:"positive",down:"negative"},oat={hlc:"altNeutral"},dT=class extends Qnt{constructor(){super(...arguments),this.fill="black",this.fillOpacity=1}};y([Cs(Jnt)],dT.prototype,"fill",2),y([Cs(tat)],dT.prototype,"fillOpacity",2);var Zs=class extends uT._ModuleSupport.BaseModuleInstance{constructor(t){super(),this.ctx=t,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 Jf,this.positive=new Jf,this.negative=new Jf,this.neutral=new Jf,this.altNeutral=new Jf,this.background=new dT,this.layoutStyle="block",this.id="status-bar",this.data=void 0,this.layer=new sat({name:"StatusBar",zIndex:Xnt.STATUS_BAR}),this.labelGroup=this.layer.appendChild(new uT._ModuleSupport.TranslatableGroup),this.backgroundNode=this.labelGroup.appendChild(new nat),this.labels=[{label:"O",configuration:2,title:this.labelGroup.appendChild(new Ti),value:this.labelGroup.appendChild(new Ti),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 Ti),value:this.labelGroup.appendChild(new Ti),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 Ti),value:this.labelGroup.appendChild(new Ti),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 Ti),value:this.labelGroup.appendChild(new Ti),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 Ti),value:this.labelGroup.appendChild(new Ti),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 Ti),value:this.labelGroup.appendChild(new Ti),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 Ti),value:this.labelGroup.appendChild(new Ti),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 Ti),value:this.labelGroup.appendChild(new Ti),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 Ti),value:this.labelGroup.appendChild(new Ti),id:"volumeValue",key:"volumeKey",domain:void 0,formatter:new Intl.NumberFormat("en-US",{notation:"compact",minimumFractionDigits:2,maximumFractionDigits:2})}],this.highlightManager=t.highlightManager,this.labelGroup.visible=!1,this.destroyFns.push(t.scene.attachNode(this.layer),t.layoutManager.registerElement(Znt.Overlay,e=>this.startPerformLayout(e)),t.layoutManager.addListener("layout:complete",e=>this.onLayoutComplete(e)),t.highlightManager.addListener("highlight-change",()=>this.updateHighlight()))}async processData(t){if(!this.enabled||this.data==null)return;const e=[];for(const n of this.labels){const{id:a,key:o}=n,r=this[o];r==null?n.domain=void 0:e.push(eat(r,"number",{id:a}))}if(e.length===0)return;const{processedData:i,dataModel:s}=await t.request(this.id,this.data,{props:e});for(const n of this.labels){const{id:a,key:o}=n;this[o]!=null&&(n.domain=s.getDomain(this,a,"value",i))}}startPerformLayout(t){if(this.labelGroup.translationX=0,this.labelGroup.translationY=0,!this.enabled)return;const{layoutBox:e}=t,i=4,s=12,n=0,a=8;this.labelGroup.translationY=e.y+n;const o=Math.max(this.title.fontSize,this.positive.fontSize,this.negative.fontSize),r=iat.getLineHeight(o),l=A4[this.getChartType()]??0;let c=0,h,u="alphabetic";if(this.layoutStyle==="block")e.shrink(n+r+a,"top"),h=o+(r-o)/2;else{const{title:d}=this.ctx.chartService;if(u="top",h=n+d.padding,d.enabled){const p=d.node.getBBox();c=p.x+p.width+s}else c=d.padding}for(const{label:d,configuration:p,title:g,value:f,domain:x,formatter:m}of this.labels){if(x==null||!(l&p)){g.visible=!1,f.visible=!1;continue}const b=Math.max(qf.measureText(m.format(x[0]),{font:this.positive.getFont(),textBaseline:u,textAlign:"left"}).width,qf.measureText(m.format(x[1]),{font:this.positive.getFont(),textBaseline:u,textAlign:"left"}).width,qf.measureText(m.format(x[0]),{font:this.negative.getFont(),textBaseline:u,textAlign:"left"}).width,qf.measureText(m.format(x[1]),{font:this.negative.getFont(),textBaseline:u,textAlign:"left"}).width);g.visible=!0,f.visible=!0;const v=qf.measureText(d,{font:this.title.getFont(),textBaseline:u,textAlign:"left"});g.setFont(this.title),g.fill=this.title.color,g.text=d,g.textBaseline=u,g.y=h,g.x=c,c+=v.width+i,f.textBaseline=u,f.y=h,f.x=c,c+=b+s}this.backgroundNode.x=0,this.backgroundNode.y=0,this.backgroundNode.width=c-s,this.backgroundNode.height=r+n+a,this.backgroundNode.fill=this.background.fill,this.backgroundNode.fillOpacity=this.background.fillOpacity}onLayoutComplete(t){this.labelGroup.translationX=t.series.rect.x,this.updateHighlight()}updateHighlight(){if(!this.enabled)return;const t=this.highlightManager.getActiveHighlight(),e=t?.datum??this.data?.at(-1);if(e==null){this.labelGroup.visible=!1;return}this.labelGroup.visible=!0;const i=t?.itemId;let s=i!=null?aat[i]:void 0;s==null&&this.openKey!=null&&this.closeKey!=null&&(e[this.openKey]new Zs(t),themeTemplate:{statusBar:{enabled:!1,layoutStyle:ev._ModuleSupport.ThemeSymbols.DEFAULT_CAPTION_LAYOUT_STYLE,title:{color:{$ref:"textColor"},fontFamily:{$ref:"fontFamily"},fontSize:{$ref:"fontSize"},fontWeight:{$ref:"fontWeight"}},positive:{color:ev._ModuleSupport.ThemeSymbols.PALETTE_UP_STROKE,fontFamily:{$ref:"fontFamily"},fontSize:{$ref:"fontSize"},fontWeight:{$ref:"fontWeight"}},negative:{color:ev._ModuleSupport.ThemeSymbols.PALETTE_DOWN_STROKE,fontFamily:{$ref:"fontFamily"},fontSize:{$ref:"fontSize"},fontWeight:{$ref:"fontWeight"}},neutral:{color:ev._ModuleSupport.ThemeSymbols.PALETTE_NEUTRAL_STROKE,fontFamily:{$ref:"fontFamily"},fontSize:{$ref:"fontSize"},fontWeight:{$ref:"fontWeight"}},background:{fill:{$ref:"backgroundColor"},fillOpacity:.5},altNeutral:{color:"gray"}}}},lat=(R(),E(w)),{BOOLEAN:pT,STRING:cat,UNION:hat,BaseProperties:uat,CartesianAxis:D4,ChartUpdateType:k4,ObserveChanges:ty,TooltipManager:dat,Validate:ey}=lat._ModuleSupport,Eh=class extends uat{constructor(t){super(),this.moduleContext=t,this.enabled=!1,this.axes="x",this.nodeInteraction=!0,this.zoom=!0}updateSiblings(t){const{syncManager:e}=this.moduleContext;for(const i of e.getGroupSiblings(t??this.groupId))this.updateChart(i)}updateChart(t,e=k4.UPDATE_DATA){t.ctx.updateService.update(e,{skipSync:!0})}enabledZoomSync(){const{syncManager:t,zoomManager:e}=this.moduleContext;this.disableZoomSync=e.addListener("zoom-change",()=>{for(const i of t.getGroupSiblings(this.groupId))i.modulesManager.getModule("sync")?.zoom&&i.ctx.zoomManager.updateZoom("sync",this.mergeZoom(i))})}enabledNodeInteractionSync(){const{highlightManager:t,syncManager:e}=this.moduleContext;this.disableNodeInteractionSync=t.addListener("highlight-change",i=>{for(const s of e.getGroupSiblings(this.groupId))if(s.modulesManager.getModule("sync")?.nodeInteraction){if(!i.currentHighlight?.datum){s.ctx.highlightManager.updateHighlight(s.id),s.ctx.tooltipManager.removeTooltip(s.id);continue}for(const n of s.axes){const a=this.axes==="xy"?"x":this.axes;if(!D4.is(n)||n.direction!==a)continue;const o=s.series.map(r=>{const l=r.getKeys(n.direction);if(n.keys.length&&!n.keys.some(g=>l.includes(g)))return;const{nodeData:c}=r.contextNodeData;if(!c?.length)return;const h=c[0][`${n.direction}Key`];let u=i.currentHighlight.datum[h];const d=Df(u);d&&(u=u.getTime());const p=c.find(g=>{const f=g.datum[h];return d?f.getTime()===u:f===u});return p?{series:r,nodeDatum:p}:null}).filter(Fi);if(o.length<2&&o[0]?.nodeDatum!==s.ctx.highlightManager.getActiveHighlight()){const{series:r,nodeDatum:l}=o[0]??{};if(s.ctx.highlightManager.updateHighlight(s.id,l),l){const c=l.midPoint?.x??l.point?.x??0,h=l.midPoint?.y??l.point?.y??0,u=dat.makeTooltipMeta({type:"pointermove",canvasX:c,canvasY:h},r,l);delete u.lastPointerEvent,s.ctx.tooltipManager.updateTooltip(s.id,u,r.getTooltipContent(l))}else s.ctx.tooltipManager.removeTooltip(s.id);this.updateChart(s,k4.SERIES_UPDATE)}}}})}getSyncedDomain(t){if(!D4.is(t)||this.axes!=="xy"&&this.axes!==t.direction)return;const{syncManager:e}=this.moduleContext,i=e.getGroup(this.groupId),[{axes:s}]=i,{direction:n,min:a,max:o,nice:r,reverse:l}=t;for(const c of s)if(n===c.direction&&(r!==c.nice||l!==c.reverse||a!==c.min&&(kl(a)||kl(c.min))||o!==c.max&&(kl(o)||kl(c.max)))){Gt.warnOnce("To allow synchronization, ensure that all charts have matching min, max, nice, and reverse properties on the synchronized axes."),this.enabled=!1;return}return GQ(i.flatMap(c=>c.series).filter(c=>{if(c.visible){const h=c.getKeys(t.direction);return t.keys.length?t.keys.some(u=>h.includes(u)):!0}}).flatMap(c=>c.getDomain(t.direction)))}mergeZoom(t){const{zoomManager:e}=this.moduleContext;if(this.axes==="xy")return e.getZoom();const i=t.ctx.zoomManager.getZoom()??{};return i[this.axes]=e.getZoom()?.[this.axes],i}onEnabledChange(){const{syncManager:t}=this.moduleContext;this.enabled?t.subscribe(this.groupId):t.unsubscribe(this.groupId),this.updateSiblings(),this.onNodeInteractionChange(),this.onZoomChange()}onGroupIdChange(t,e){if(!this.enabled||t===e)return;const{syncManager:i}=this.moduleContext;i.unsubscribe(e),i.subscribe(t),this.updateSiblings(e),this.updateSiblings(t)}onAxesChange(){if(!this.enabled)return;const{syncManager:t}=this.moduleContext;this.updateChart(t.getChart())}onNodeInteractionChange(){this.enabled&&this.nodeInteraction?this.enabledNodeInteractionSync():this.disableNodeInteractionSync?.()}onZoomChange(){this.enabled&&this.zoom?this.enabledZoomSync():this.disableZoomSync?.()}destroy(){const{syncManager:t}=this.moduleContext;t.unsubscribe(this.groupId),this.updateSiblings(),this.disableZoomSync?.()}};Eh.className="Sync",y([ey(pT),ty(t=>t.onEnabledChange())],Eh.prototype,"enabled",2),y([ey(cat,{optional:!0}),ty((t,e,i)=>t.onGroupIdChange(e,i))],Eh.prototype,"groupId",2),y([ey(hat(["x","y","xy"],"an axis")),ty(t=>t.onAxesChange())],Eh.prototype,"axes",2),y([ey(pT),ty(t=>t.onNodeInteractionChange())],Eh.prototype,"nodeInteraction",2),y([ey(pT),ty(t=>t.onZoomChange())],Eh.prototype,"zoom",2);var pat={type:"root",optionsKey:"sync",packageType:"enterprise",chartTypes:["cartesian"],moduleFactory:t=>new Eh(t),themeTemplate:{sync:{enabled:!1}}},Rh=(R(),E(w)),gT=(R(),E(w)),{COLOR_STRING:gat,RATIO:fat,Validate:L4}=gT._ModuleSupport,T4="#2196f3",yat="#8a8a8a",iv=class extends gT._ModuleSupport.Rect{constructor(){super(...arguments),this.fill=T4,this.fillOpacity=.2,this.zIndex=gT._ModuleSupport.ZIndexMap.ZOOM_SELECTION}updateValid(){this.fill=T4}updateInvalid(){this.fill=yat}};iv.className="ZoomRect",y([L4(gat)],iv.prototype,"fill",2),y([L4(fat)],iv.prototype,"fillOpacity",2);var fT=(R(),E(w)),mat=(R(),E(w)),{UNION:xat,clamp:bat,isNumberEqual:C4,round:Sbt}=mat._ModuleSupport,se={min:0,max:1},N4="end",O4="middle",sv=xat(["pointer","start","middle","end"],"an anchor point"),nv=(t,e=se.min,i=se.max)=>bat(e,t,i);function yT(){return{x:{...se},y:{...se}}}function Gi(t){return t.x.max-t.x.min}function Jn(t){return t.y.max-t.y.min}function w4(t,e,i=1e-10){return C4(t.min,e.min,i)&&C4(t.max,e.max,i)}function iy(t,e,i){return w4(t.x,e.x,i)&&w4(t.y,e.y,i)}function fs(t){return{x:{min:t?.x?.min??se.min,max:t?.x?.max??se.max},y:{min:t?.y?.min??se.min,max:t?.y?.max??se.max}}}function Rr(t,e,i){if(!t)return{x:0,y:0};const s=nv(e-t.x,0,t.x+t.width),n=nv(i-t.y,0,t.y+t.height),a=1/t.width*s,o=1-1/t.height*n;return{x:nv(a),y:nv(o)}}function _h(t,e,i){return{x:{min:t.x.min+e,max:t.x.max+e},y:{min:t.y.min+i,max:t.y.max+i}}}function E4(t,e,i){return{x:{min:t.x.min,max:t.x.min+Gi(t)*e},y:{min:t.y.min,max:t.y.min+Jn(t)*i}}}function R4(t,e,i){const s=Gi(t),n=Jn(t),a=t.x.min+s/2,o=t.y.min+n/2;return{x:{min:a-s*e/2,max:a+s*e/2},y:{min:o-n*i/2,max:o+n*i/2}}}function Ea(t,e,i,s){const{min:n,max:a}=e,o=n+(a-n)/2,r=t.max-t.min;switch(i){case"start":return{min:n,max:e.min+r};case"end":return{min:e.max-r,max:a};case"middle":return{min:o-r/2,max:o+r/2};case"pointer":return Sat(t,e,s??o);default:return{min:n,max:a}}}function Sat(t,e,i){const s=t.max-t.min,n=e.max-e.min,a=i*(1-(n-s)),o=i-a,r=t.min+o,l=t.max+o;return{min:r,max:l}}function vat(t,e,i){return{x:{min:t.x.min*e,max:t.x.max*e},y:{min:t.y.min*i,max:t.y.max*i}}}function ta(t){return{x:av(t.x),y:av(t.y)}}function av(t){const e=t.max-t.min;let i=t.max>se.max?se.max-e:t.min,s=t.min{const a=this.getRect();if(!a)return!0;const o=Rr(a,n.x,n.y);return this.iterateFindNextZoomAtPoint(o)!=null}}),s=e.registerDefaultAction({id:Aat,type:"series-area",label:"contextMenuPanToCursor",action:this.onPanToHere.bind(this),toggleEnabledOnShow:()=>!iy(fs(this.zoomManager.getZoom()),yT())});return()=>{i(),s()}}computeOrigin(t){const e=this.getRect(),{enabled:i}=this.getModuleProperties();if(!i||!e||!t?.target||!(t instanceof MouseEvent))return;const s={x:0,y:0,width:e.width,height:e.height};return Rr(s,t.offsetX,t.offsetY)}onZoomToHere({event:t}){const e=this.computeOrigin(t);if(!e)return;const i=this.iterateFindNextZoomAtPoint(e);i!=null&&this.updateZoom(i)}onPanToHere({event:t}){const e=this.computeOrigin(t);if(!e)return;const i=fs(this.zoomManager.getZoom()),s=Gi(i),n=Jn(i),a=e.x*s,o=e.y*n,r=(se.max-se.min)/2;let l={x:{min:e.x-r,max:e.x+r},y:{min:e.y-r,max:e.y+r}};l=R4(l,s,n),l=_h(l,i.x.min-e.x+a,i.y.min-e.y+o),this.updateZoom(ta(l))}iterateFindNextZoomAtPoint(t){const{scrollingStep:e}=this.getModuleProperties();for(let i=e;i<=1-e;i+=e){const s=this.getNextZoomAtPoint(t,i);if(this.isZoomValid(s))return s}}getNextZoomAtPoint(t,e){const{isScalingX:i,isScalingY:s}=this.getModuleProperties(),n=fs(this.zoomManager.getZoom()),a=t.x*Gi(n),o=t.y*Jn(n),r=se.max-se.min,l=r/2;let c={x:{min:t.x-l,max:t.x+l},y:{min:t.y-l,max:t.y+l}};return c=R4(c,i?Gi(n)*e:r,s?Jn(n)*e:r),c=_h(c,n.x.min-t.x+a,n.y.min-t.y+o),ta(c)}},mT=(R(),E(w)),{BBoxValues:kat}=mT._ModuleSupport,Lat=class{constructor(t){this.axesHandlers=t,this.axes=[]}initAxis(t,e,i,s){const{X:n,Y:a}=mT._ModuleSupport.ChartAxisDirection,o={[n]:"ew-resize",[a]:"ns-resize"}[s],r="afterend",l=t.proxyInteractionService.createProxyElement({type:"region",domManagerId:e,where:r});return l.setCursor(o),l.addListener("drag-start",c=>{c.device==="touch"&&c.sourceEvent.preventDefault(),i.onDragStart(e,s)}),l.addListener("drag-move",c=>i.onDrag(c)),l.addListener("drag-end",i.onDragEnd),l.addListener("dblclick",()=>i.onDoubleClick(e,s)),{axisId:e,div:l}}destroy(){this.axes.forEach(t=>t.div.destroy())}update(t,e){if(this.axes.forEach(r=>r.div.setHidden(!t)),!t)return;const{X:i,Y:s}=mT._ModuleSupport.ChartAxisDirection,n=[...e.axisManager.getAxisContext(i),...e.axisManager.getAxisContext(s)],{removed:a,added:o}=this.diffAxisIds(n);a.length>0&&(this.axes=this.axes.filter(r=>a.includes(r.axisId)?(r.div.destroy(),!1):!0));for(const r of o){const{axisId:l,direction:c}=r;this.axes.push(this.initAxis(e,l,this.axesHandlers,c))}for(const r of this.axes){const c=n.filter(h=>h.axisId===r.axisId)[0].getCanvasBounds();r.div.setHidden(kat.isEmpty(c)),c!==void 0&&r.div.setBounds(c)}}diffAxisIds(t){const e=this.axes.map(a=>a.axisId),i=t.map(a=>a.axisId),s=e.filter(a=>!i.includes(a)),n=t.filter(a=>!e.includes(a.axisId));return{removed:s,added:n}}},Tat=(R(),E(w)),_4=16,Cat={off:1,short:.01,long:.002},Nat=class{constructor(){this.deceleration=1,this.zoomCoordsHistoryIndex=0,this.coordsHistory=[]}get decelerationValue(){const{deceleration:t}=this;return Math.max(typeof t=="number"?t:Cat[t]??1,1e-4)}addListener(t,e){return this.onUpdate=e,()=>{this.onUpdate=void 0}}stopInteractions(){this.inertiaHandle!=null&&(cancelAnimationFrame(this.inertiaHandle),this.inertiaHandle=void 0)}update(t){this.updateCoords(t.currentX,t.currentY);const{x1:e=0,y1:i=0,x2:s=0,y2:n=0}=this.coords??{};this.onUpdate?.({type:"update",deltaX:e-s,deltaY:i-n})}start(){this.coordsMonitorTimeout=setInterval(this.recordCurrentZoomCoords.bind(this),16)}stop(){const{coordsHistory:t}=this;let e=0,i=0,s=0;if(t.length>0){const n=this.zoomCoordsHistoryIndex%_4;let a=n-1;a<0&&(a=t.length-1);let o=n;o>=t.length&&(o=0);const r=t[a],l=t[o];e=r.x-l.x,i=r.y-l.y,s=r.t-l.t}if(this.coords=void 0,clearInterval(this.coordsMonitorTimeout),this.coordsMonitorTimeout=void 0,this.zoomCoordsHistoryIndex=0,this.coordsHistory.length=0,s>0&&this.decelerationValue<1){const n=e/s,a=i/s,o=Math.hypot(n,a),r=Math.atan2(a,n),l=performance.now();this.inertiaHandle=Tat._ModuleSupport.getWindow().requestAnimationFrame(c=>{this.animateInertia(c,c,l,o,r)})}}recordCurrentZoomCoords(){const{coords:t,coordsHistory:e,zoomCoordsHistoryIndex:i}=this;if(!t)return;const{x2:s,y2:n}=t,a=Date.now();e[i%_4]={x:s,y:n,t:a},this.zoomCoordsHistoryIndex+=1}animateInertia(t,e,i,s,n){const a=1-this.decelerationValue,o=-s/Math.log(a),r=s*(a**(e-i)-1)/Math.log(a),l=s*(a**(t-i)-1)/Math.log(a);this.onUpdate?.({type:"update",deltaX:-Math.cos(n)*(l-r),deltaY:-Math.sin(n)*(l-r)}),!(l>=o-1)&&(this.inertiaHandle=requestAnimationFrame(c=>{this.animateInertia(c,t,i,s,n)}))}updateCoords(t,e){this.coords?this.coords={x1:this.coords.x2,y1:this.coords.y2,x2:t,y2:e}:this.coords={x1:t,y1:e,x2:t,y2:e}}translateZooms(t,e,i,s){const n=Rr(t,t.x+Math.abs(i),t.y+t.height-Math.abs(s)),a=Math.sign(i)*n.x,o=-Math.sign(s)*n.y,r={};for(const[l,{direction:c,zoom:h}]of Object.entries(e)){if(h&&h.min===se.min&&h.max===se.max)continue;let u=fs({[c]:h});u=ta(_h(u,a*Gi(u),o*Jn(u))),r[l]={direction:c,zoom:u[c]}}return r}},Oat=(R(),E(w)),wat=200,Eat=class{update(t,e,i,s){const n=t.deltaX*e*wat;return this.translateZooms(i,s,n)}translateZooms(t,e,i){const s={},n=Rr(t,t.x+Math.abs(i),0),a=i<0?-n.x:n.x;for(const[o,{direction:r,zoom:l}]of Object.entries(e)){if(r!==Oat._ModuleSupport.ChartAxisDirection.X)continue;let c=fs({x:l});c=ta(_h(c,a*Gi(c),0)),s[o]={direction:r,zoom:c.x}}return s}},P4=(R(),E(w)),Rat=class{updateAxes(t,e,i,s){const n=t.sourceEvent,a={},{anchorPointX:o,anchorPointY:r,isScalingX:l,isScalingY:c,scrollingStep:h}=e,u=Rr(i,n.offsetX??n.clientX,n.offsetY??n.clientY);for(const[d,{direction:p,zoom:g}]of Object.entries(s)){if(g==null)continue;let f={...g};const x=h*t.deltaY*(g.max-g.min);if(p===P4._ModuleSupport.ChartAxisDirection.X&&l)f.max+=x,f=Ea(f,g,o,u.x);else if(p===P4._ModuleSupport.ChartAxisDirection.Y&&c)f.max+=x,f=Ea(f,g,r,u.y);else continue;a[d]={direction:p,zoom:av(f)}}return a}update(t,e,i,s){const{anchorPointX:n,anchorPointY:a,isScalingX:o,isScalingY:r,scrollingStep:l}=e,c=t.offsetX+i.x,h=t.offsetY+i.y,u=Rr(i,c,h),d=t.deltaY;let p=fs(s);return p.x.max+=o?l*d*Gi(s):0,p.y.max+=r?l*d*Jn(s):0,o&&(p.x=Ea(p.x,s.x,n,u.x)),r&&(p.y=Ea(p.y,s.y,a,u.y)),p=ta(p),p}updateDelta(t,e,i){const{anchorPointX:s,anchorPointY:n,isScalingX:a,isScalingY:o,scrollingStep:r}=e;let l=fs(i);return l.x.max+=a?r*-t*Gi(i):0,l.y.max+=o?r*-t*Jn(i):0,a&&(l.x=Ea(l.x,i.x,s)),o&&(l.y=Ea(l.y,i.y,n)),l=ta(l),l}},_at=class{constructor(t,e,i){this.rect=t,this.getZoom=e,this.isZoomValid=i,this.rect.visible=!1}update(t,e,i){const s=t.currentX+(i?.x??0),n=t.currentY+(i?.y??0);this.rect.visible=!0,this.updateCoords(s,n,e,i),this.updateRect(i)}stop(t,e,i){let s=fs();if(!t||!e)return s;this.coords&&(s=this.createZoomFromCoords(e,i));const n=e.width/t.width,a=e.height/t.height;return s=ta(vat(s,n,a)),this.reset(),s}reset(){this.coords=void 0,this.rect.visible=!1}didUpdate(){return this.rect.visible&&this.rect.width>0&&this.rect.height>0}updateCoords(t,e,i,s){if(!this.coords){this.coords={x1:t,y1:e,x2:t,y2:e};return}const{coords:n}=this;if(n.x2=t,n.y2=e,!s)return;const{isScalingX:a,isScalingY:o,keepAspectRatio:r}=i,l=this.getNormalisedDimensions();if(r&&a&&o){const c=s.width/s.height;n.y2r&&nse.min;break;case"pan-end":s=t.x.maxse.min;break;case"pan-right":s=t.x.maxg.identifier=0),this.previous.a1=NaN,this.previous.a2=NaN,this.previous.b1=NaN,this.previous.b2=NaN;for(const g of[0,1]){const f=s[g].clientX,x=a+r-s[g].clientY;this.touchStart.origins[g].identifier=s[g].identifier,this.touchStart.origins[g].normalX=ov(this.initialZoom.x,f,n,o),this.touchStart.origins[g].normalY=ov(this.initialZoom.y,x,a,r)}const[l,c]=s,[h,u]=this.touchStart.origins,d=F4(l.clientX,l.radiusX,c.clientX,c.radiusX);return F4(l.clientY,l.radiusY,c.clientY,c.radiusY)&&(h.normalY=u.normalY=(h.normalY+u.normalY)/2),d&&(h.normalX=u.normalX=(h.normalX+u.normalX)/2),!0}update(t,e){t.sourceEvent.preventDefault();const i=Array.from(t.sourceEvent.targetTouches),{x:s,y:n,width:a,height:o}=e.getBoundingClientRect(),{origins:r}=this.touchStart,l=[0,1].map(m=>i.find(b=>b.identifier===r[m].identifier)),c=r[0].normalX,h=r[1].normalX,u=l[0].clientX,d=l[1].clientX,p=r[0].normalY,g=r[1].normalY,f=n+o-l[0].clientY,x=n+o-l[1].clientY;return this.twitchTolerantZoomPan4(c,h,u,d,p,g,f,x,s,n,a,o)}end(t){const e=Array.from(t.sourceEvent.targetTouches).map(i=>i.identifier);return!e.includes(this.touchStart.origins[0].identifier)||!e.includes(this.touchStart.origins[1].identifier)}twitchTolerantZoomPan4(t,e,i,s,n,a,o,r,l,c,h,u){const{initialZoom:d,previous:p}=this,g=j4(t,e,i,s,p,"a1","a2",l,h,d.x),f=j4(n,a,o,r,p,"b1","b2",c,u,d.y);return{x:g,y:f}}};function j4(t,e,i,s,n,a,o,r,l,c){if(t!=e){const h=n[a],u=n[o];return Math.abs(i-h)+Math.abs(s-u)<=1?(i=h,s=u):(n[a]=i,n[o]=s),Kat(t,e,i,s,r,l)}else{const h=ov(c,i,r,l),u=ov(c,s,r,l),d=(h+u)/2,p=(t-d)/Bh;return{min:c.min+p,max:c.max+p}}}var{BOOLEAN:wo,NUMBER:V4,POSITIVE_NUMBER:Xat,RATIO:bT,UNION:ST,OBJECT:G4,OR:Zat,ActionOnSet:rv,ChartAxisDirection:sy,ChartUpdateType:W4,Deprecated:U4,Validate:Be,InteractionState:lv,ProxyProperty:Qat,round:qat}=Rh._ModuleSupport,cv=t=>qat(t,10),H4="zoom-cursor",vT="zoom-tooltip",MT=class extends Rh._ModuleSupport.BaseProperties{constructor(t){super(),this.onChange=t,this.enabled=!1,this.padding=0}};y([Be(wo),rv({changeValue(t){this.onChange({enabled:t,padding:this.padding})}})],MT.prototype,"enabled",2),y([Be(bT),rv({changeValue(t){this.onChange({enabled:this.enabled,padding:t})}})],MT.prototype,"padding",2);var Xe=class extends Rh._ModuleSupport.BaseModuleInstance{constructor(t){super(),this.ctx=t,this.enabled=!1,this.enableAxisDragging=!0,this.enableDoubleClickToReset=!0,this.enablePanning=!0,this.enableScrolling=!0,this.enableSelecting=!1,this.enableTwoFingerZoom=!0,this.panKey="alt",this.axes="x",this.scrollingStep=(se.max-se.min)/10,this.keepAspectRatio=!1,this.minVisibleItems=2,this.anchorPointX=N4,this.anchorPointY=O4,this.autoScaling=new MT(i=>{this.ctx.zoomManager.setAutoScaleYAxis(i.enabled,i.padding)}),this.buttons=new Qd(this.ctx,this.getModuleProperties.bind(this),this.getResetZoom.bind(this),this.updateZoom.bind(this),this.updateAxisZoom.bind(this),this.resetZoom.bind(this),this.isZoomValid.bind(this)),this.axisDragger=new Mat,this.panner=new Nat,this.scroller=new Rat,this.scrollPanner=new Eat,this.twoFingers=new $at,this.deceleration="short",this.dragState=0,this.isState=i=>this.ctx.interactionManager.isState(i),this.destroyContextMenuActions=void 0,this.isFirstWheelEvent=!0,this.debouncedWheelReset=WQ(()=>{this.isFirstWheelEvent=!0},100);const e=new iv;this.selector=new _at(e,this.getZoom.bind(this),this.isZoomValid.bind(this)),this.contextMenu=new Dat(t.contextMenuRegistry,t.zoomManager,this.getModuleProperties.bind(this),()=>this.paddedRect,this.updateZoom.bind(this),this.isZoomValid.bind(this)),this.domProxy=new Lat({onDragStart:(i,s)=>this.onAxisDragStart(i,s),onDrag:i=>{this.onDragMove({...i,currentX:i.offsetX,currentY:i.offsetY})},onDragEnd:()=>this.onDragEnd(),onDoubleClick:(i,s)=>{this.hoveredAxis={id:i,direction:s},this.onDoubleClick(),this.hoveredAxis=void 0}}),this.destroyFns.push(t.scene.attachNode(e),t.chartEventManager.addListener("series-keynav-zoom",i=>this.onNavZoom(i)),t.widgets.seriesDragInterpreter.addListener("dblclick",i=>this.onDoubleClick(i)),t.widgets.seriesDragInterpreter.addListener("drag-move",i=>this.onDragMove(i)),t.widgets.seriesDragInterpreter.addListener("drag-start",i=>this.onDragStart(i)),t.widgets.seriesDragInterpreter.addListener("drag-end",()=>this.onDragEnd()),t.widgets.seriesWidget.addListener("wheel",i=>this.onWheel(i)),t.widgets.seriesWidget.addListener("touchstart",(i,s)=>this.onTouchStart(i,s)),t.widgets.seriesWidget.addListener("touchmove",(i,s)=>this.onTouchMove(i,s)),t.widgets.seriesWidget.addListener("touchend",i=>this.onTouchEnd(i)),t.widgets.seriesWidget.addListener("touchcancel",i=>this.onTouchEnd(i)),t.updateService.addListener("process-data",i=>this.onProcessData(i)),t.layoutManager.addListener("layout:complete",i=>this.onLayoutComplete(i)),t.zoomManager.addListener("zoom-change",i=>this.onZoomChange(i)),t.zoomManager.addListener("zoom-pan-start",i=>this.onZoomPanStart(i)),this.panner.addListener("update",i=>this.onPanUpdate(i)),()=>this.teardown())}teardown(){this.ctx.zoomManager.setZoomModuleEnabled(!1),this.buttons.destroy(),this.destroyContextMenuActions?.()}onEnabledChange(t){this.ctx.zoomManager.setZoomModuleEnabled(t),this.contextMenu&&(this.destroyContextMenuActions?.(),this.destroyContextMenuActions=this.contextMenu.registerActions(t))}isIgnoredTouch(t){if(t?.device!=="touch")return!1;if(this.ctx.chartService.touch.dragAction!=="drag")return!0;if(this.enableSelecting)return!1;if(!this.enablePanning)return!0;const{x:e,y:i}=this.getZoom();return e.min===0&&e.max===1&&i.min===0&&i.max===1}onDoubleClick(t){const{enabled:e,enableDoubleClickToReset:i,hoveredAxis:s,ctx:{zoomManager:n}}=this;!e||!i||!this.isState(lv.ZoomClickable)||(s?n.resetAxisZoom("zoom",s.id):t?.preventZoomDblClick||this.resetZoom())}onDragStart(t){const{enabled:e,enableAxisDragging:i,enablePanning:s,enableSelecting:n,hoveredAxis:a,ctx:{domManager:o,zoomManager:r}}=this;if(!e||!this.hoveredAxis&&(!this.isState(lv.ZoomDraggable)||this.dragState!==0||this.isIgnoredTouch(t)))return;this.panner.stopInteractions();let l=0;if(i&&a)l=1;else if(t!=null){const c=this.isPanningKeyPressed(t.sourceEvent);s&&(!n||c)?(o.updateCursor(H4,"grabbing"),l=2,this.panner.start()):n&&!c&&(l=3)}(this.dragState=l)!==0&&r.fireZoomPanStartEvent("zoom")}onDragMove(t){const{anchorPointX:e,anchorPointY:i,axisDragger:s,dragState:n,enabled:a,paddedRect:o,panner:r,selector:l,seriesRect:c,shouldFlipXY:h,hoveredAxis:u,ctx:{interactionManager:d,tooltipManager:p,updateService:g,zoomManager:f}}=this;if(!a||!o||!c||!u&&(!this.isState(lv.ZoomDraggable)||this.isIgnoredTouch(t)))return;d.pushState(Rh._ModuleSupport.InteractionState.ZoomDrag),t.device==="touch"&&t.sourceEvent.preventDefault();const x=this.getZoom();switch(n){case 1:{if(!u)break;const{id:m,direction:b}=u;let v=b===sy.X?e:i;h&&(v=b===sy.X?i:e);const S=f.getAxisZoom(m),A=s.update(t,b,v,c,x,S);f.setAxisManuallyAdjusted("zoom",m),this.updateAxisZoom(m,b,A);break}case 2:r.update(t);break;case 3:l.update(t,this.getModuleProperties(),o);break;case 0:return}p.updateTooltip(vT),g.update(W4.PERFORM_LAYOUT,{skipAnimations:!0})}onDragEnd(){const{axisDragger:t,dragState:e,enabled:i,panner:s,selector:n,ctx:{domManager:a,interactionManager:o,tooltipManager:r}}=this;if(o.popState(Rh._ModuleSupport.InteractionState.ZoomDrag),!(!i||e===0)){switch(e){case 1:this.hoveredAxis=void 0,t.stop();break;case 2:s.stop();break;case 3:{if(!n.didUpdate())break;const l=this.getZoom(),c=n.stop(this.seriesRect,this.paddedRect,l);this.updateZoom(c);break}}this.dragState=0,a.updateCursor(H4),r.removeTooltip(vT)}}onNavZoom(t){const{enabled:e,enableScrolling:i,scroller:s}=this;!this.ctx.interactionManager.isState(Rh._ModuleSupport.InteractionState.Default)||!e||!i||(t.widgetEvent.sourceEvent.preventDefault(),this.updateZoom(s.updateDelta(t.delta,this.getModuleProperties(),this.getZoom())))}onWheel(t){const{enabled:e,enablePanning:i,enableScrolling:s,paddedRect:n}=this;if(!e||!s||!n||!this.isState(lv.ZoomWheelable))return;const{deltaX:a,deltaY:o}=t.sourceEvent,r=a!=null&&o!=null&&Math.abs(a)>Math.abs(o);i&&r?this.onWheelPanning(t):this.onWheelScrolling(t)}onWheelPanning(t){const{scrollingStep:e,scrollPanner:i,seriesRect:s,ctx:{zoomManager:n}}=this;if(!s)return;t.sourceEvent.preventDefault();const a=i.update(t,e,s,n.getAxisZooms());for(const[o,{direction:r,zoom:l}]of Object.entries(a))this.updateAxisZoom(o,r,l)}onWheelScrolling(t){const{enableAxisDragging:e,enableIndependentAxes:i,hoveredAxis:s,scroller:n,seriesRect:a,ctx:{zoomManager:o}}=this;if(!a)return;const r=this.getZoom();let l=t.deltaY>0&&this.isMaxZoom(r);const c=e&&s!=null;let h=this.isScalingX(),u=this.isScalingY();c&&(h=s.direction===Rh._ModuleSupport.ChartAxisDirection.X,u=!h);const d=this.getModuleProperties({isScalingX:h,isScalingY:u});let p=!0;if(i===!0){const g=n.updateAxes(t,d,a,o.getAxisZooms());for(const[f,{direction:x,zoom:m}]of Object.entries(g))c&&s.id!==f||p&&(p=this.updateAxisZoom(f,x,m))}else{const g=n.update(t,d,a,this.getZoom());p=this.updateUnifiedZoom(g)}l||(l=t.deltaY<0&&!p),(!this.isFirstWheelEvent||!l)&&t.sourceEvent.preventDefault(),this.isFirstWheelEvent=!1,this.debouncedWheelReset()}onAxisDragStart(t,e){this.hoveredAxis={id:t,direction:e},this.onDragStart(void 0)}onTouchStart(t,e){!this.enableTwoFingerZoom||this.dragState!==0||this.twoFingers.start(t,e,this.getZoom())&&(this.dragState=4)}onTouchMove(t,e){if(!this.enableTwoFingerZoom||this.dragState!==4)return;const i=this.twoFingers.update(t,e);this.updateZoom(ta(i))}onTouchEnd(t){!this.enableTwoFingerZoom||this.dragState!==4||(t.sourceEvent.preventDefault(),this.twoFingers.end(t)&&(this.dragState=0))}onProcessData(t){this.shouldFlipXY=t.series.shouldFlipXY}onLayoutComplete(t){this.domProxy.update(this.enableAxisDragging,this.ctx);const{enabled:e}=this;if(!e)return;const{series:{rect:i,paddedRect:s}}=t;this.seriesRect=i,this.paddedRect=s}onZoomChange(t){t.callerId!=="zoom"&&this.panner.stopInteractions();const e=this.getZoom();this.buttons.toggleVisibleZoomed(this.isMaxZoom(e))}onZoomPanStart(t){t.callerId==="zoom"&&this.panner.stopInteractions()}onPanUpdate(t){const{panner:e,seriesRect:i,ctx:{tooltipManager:s,zoomManager:n}}=this;if(!i)return;const a=e.translateZooms(i,n.getAxisZooms(),t.deltaX,t.deltaY);for(const[o,{direction:r,zoom:l}]of Object.entries(a))this.updateAxisZoom(o,r,l);s.updateTooltip(vT)}isPanningKeyPressed(t){switch(this.panKey){case"alt":return t.altKey;case"ctrl":return t.ctrlKey;case"shift":return t.shiftKey;case"meta":return t.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}isMaxZoom(t){return iy(t,yT())}isZoomValid(t){const{minVisibleItems:e,minVisibleItemsX:i,minVisibleItemsY:s,ctx:{zoomManager:n}}=this;if(e===0)return!0;const a=this.getZoom(),o=cv(Gi(t))=l||a.isVisibleItemsCountAtLeast(c,h??i)}resetZoom(){this.ctx.zoomManager.resetZoom("zoom")}updateZoom(t){this.enableIndependentAxes?this.updatePrimaryAxisZooms(t):this.updateUnifiedZoom(t)}updateUnifiedZoom(t){return this.isZoomValid(t)?(this.ctx.zoomManager.updateZoom("zoom",t),!0):(this.ctx.updateService.update(W4.SCENE_RENDER,{skipAnimations:!0}),!1)}updatePrimaryAxisZooms(t){this.updatePrimaryAxisZoom(t,sy.X),this.updatePrimaryAxisZoom(t,sy.Y)}updatePrimaryAxisZoom(t,e){const i=this.ctx.zoomManager.getPrimaryAxisId(e);i!=null&&this.updateAxisZoom(i,e,t[e])}updateAxisZoom(t,e,i){const{enableIndependentAxes:s,ctx:{zoomManager:n}}=this;if(!i)return!1;const a=this.getZoom();return s!==!0?(a[e]=i,this.updateUnifiedZoom(a)):this.isAxisZoomValid(e,i)?(n.updateAxisZoom("zoom",t,i),!0):!1}getZoom(){return fs(this.ctx.zoomManager.getZoom())}getResetZoom(){return fs(this.ctx.zoomManager.getRestoredZoom())}getModuleProperties(t){return{anchorPointX:t?.anchorPointX??this.getAnchorPointX(),anchorPointY:t?.anchorPointY??this.getAnchorPointY(),enabled:t?.enabled??this.enabled,independentAxes:t?.independentAxes??this.enableIndependentAxes===!0,isScalingX:t?.isScalingX??this.isScalingX(),isScalingY:t?.isScalingY??this.isScalingY(),keepAspectRatio:t?.keepAspectRatio??this.keepAspectRatio,scrollingStep:t?.scrollingStep??this.scrollingStep}}};y([rv({newValue(t){this.onEnabledChange(t)}}),Be(wo)],Xe.prototype,"enabled",2),y([Be(wo)],Xe.prototype,"enableAxisDragging",2),y([Be(wo)],Xe.prototype,"enableDoubleClickToReset",2),y([rv({changeValue(t){this.ctx.zoomManager.setIndependentAxes(!!t)}}),Be(wo,{optional:!0})],Xe.prototype,"enableIndependentAxes",2),y([Be(wo)],Xe.prototype,"enablePanning",2),y([Be(wo)],Xe.prototype,"enableScrolling",2),y([Be(wo)],Xe.prototype,"enableSelecting",2),y([Be(wo)],Xe.prototype,"enableTwoFingerZoom",2),y([Be(ST(["alt","ctrl","meta","shift"],"a pan key"))],Xe.prototype,"panKey",2),y([Be(ST(["x","y","xy"],"an axis"))],Xe.prototype,"axes",2),y([Be(bT)],Xe.prototype,"scrollingStep",2),y([Be(wo)],Xe.prototype,"keepAspectRatio",2),y([Be(Xat)],Xe.prototype,"minVisibleItems",2),y([U4("Use [minVisibleItems] instead."),Be(V4.restrict({min:1}))],Xe.prototype,"minVisibleItemsX",2),y([U4("Use [minVisibleItems] instead."),Be(V4.restrict({min:1}))],Xe.prototype,"minVisibleItemsY",2),y([Be(sv)],Xe.prototype,"anchorPointX",2),y([Be(sv)],Xe.prototype,"anchorPointY",2),y([Be(G4)],Xe.prototype,"autoScaling",2),y([Be(G4)],Xe.prototype,"buttons",2),y([Qat("panner.deceleration"),Be(Zat(bT,ST(["off","short","long"],"a deceleration")))],Xe.prototype,"deceleration",2);var Jat={enabled:!0,visible:"hover",buttons:[{icon:"zoom-out",tooltip:"toolbarZoomZoomOut",value:"zoom-out",section:"scale"},{icon:"zoom-in",tooltip:"toolbarZoomZoomIn",value:"zoom-in",section:"scale"},{icon:"pan-left",tooltip:"toolbarZoomPanLeft",value:"pan-left",section:"pan"},{icon:"pan-right",tooltip:"toolbarZoomPanRight",value:"pan-right",section:"pan"},{icon:"reset",tooltip:"toolbarZoomReset",value:"reset",section:"reset"}]},tot={type:"root",optionsKey:"zoom",packageType:"enterprise",chartTypes:["cartesian","topology"],moduleFactory:t=>new Xe(t),themeTemplate:{zoom:{anchorPointX:"end",anchorPointY:"middle",axes:"x",buttons:Jat,enabled:!1,enableAxisDragging:!0,enableDoubleClickToReset:!0,enablePanning:!0,enableScrolling:!0,enableSelecting:!1,enableTwoFingerZoom:!0,deceleration:"short",minVisibleItems:2,panKey:"alt",scrollingStep:.1,autoScaling:{enabled:!1,padding:.05}}}},Mbt=(R(),E(w)),eot=(R(),E(w)),{BOOLEAN:Y4,OBJECT:iot,POSITION:sot,POSITIVE_NUMBER:IT,BaseProperties:not,AxisTicks:aot,ZIndexMap:oot,ProxyProperty:AT,Validate:zh,LayoutElement:rot,createId:lot,Group:cot,Rect:hot,Marker:uot,TranslatableGroup:dot,LinearGradient:pot}=eot._ModuleSupport,DT=class extends not{constructor(){super(...arguments),this.thickness=16,this.preferredLength=100}};y([zh(IT)],DT.prototype,"thickness",2),y([zh(IT)],DT.prototype,"preferredLength",2);var hv=class{constructor(t){this.axisTicks=t}};y([AT("axisTicks.label")],hv.prototype,"label",2),y([AT("axisTicks.interval")],hv.prototype,"interval",2),y([AT("axisTicks.padding")],hv.prototype,"padding",2);var Fh=class{constructor(t){this.ctx=t,this.id=lot(this),this.legendGroup=new dot({name:"legend",zIndex:oot.LEGEND}),this.gradientRect=new hot,this.arrow=new uot({shape:"triangle"}),this.ticksGroup=new cot({name:"legend-axis-group"}),this.destroyFns=[],this.enabled=!1,this.position="bottom",this.reverseOrder=!1,this.gradient=new DT,this.spacing=20,this.data=[],this.highlightManager=t.highlightManager,this.axisTicks=new aot,this.axisTicks.attachAxis(this.ticksGroup),this.scale=new hv(this.axisTicks),this.legendGroup.append([this.gradientRect,this.arrow,this.ticksGroup]),this.destroyFns.push(t.highlightManager.addListener("highlight-change",()=>this.onChartHoverChange()),t.layoutManager.registerElement(rot.Legend,e=>this.onStartLayout(e)),()=>this.legendGroup.remove())}isVertical(){return this.position==="right"||this.position==="left"}destroy(){this.destroyFns.forEach(t=>t())}attachLegend(t){t.appendChild(this.legendGroup)}onStartLayout(t){const[e]=this.data;if(!this.enabled||!e?.enabled){this.legendGroup.visible=!1;return}const{colorRange:i}=this.normalizeColorArrays(e);this.updateGradientRect(t.layoutBox,i);const s=this.updateAxis(e),{left:n,top:a}=this.getMeasurements(t.layoutBox,s);this.updateArrow(),this.legendGroup.visible=!0,this.legendGroup.translationX=n,this.legendGroup.translationY=a}normalizeColorArrays(t){let e=t.colorDomain.slice();const i=t.colorRange.slice();if(e.length===i.length)return{colorDomain:e,colorRange:i};e.length>i.length&&i.splice(e.length);const[s,n]=e,a=i.length;return e=i.map((o,r)=>r===0?s:r===a-1?n:s+(n-s)*r/(a-1)),{colorDomain:e,colorRange:i}}updateGradientRect(t,e){const{gradientRect:i}=this,{preferredLength:s,thickness:n}=this.gradient;let a;this.isVertical()?(a=0,i.width=n,i.height=Math.min(t.height,s)):(a=90,i.width=Math.min(t.width,s),i.height=n),i.fill=new pot("oklch",e.map((o,r)=>({offset:r/(e.length-1),color:o})),a)}updateAxis(t){const{axisTicks:e}=this,i=this.isVertical(),s=this.reverseOrder!==i;return e.position=this.position,e.translationX=i?this.gradient.thickness:0,e.translationY=i?0:this.gradient.thickness,e.scale.domain=s?t.colorDomain.slice().reverse():t.colorDomain,e.scale.range=i?[0,this.gradientRect.height]:[0,this.gradientRect.width],e.calculateLayout()}updateArrow(){const t=this.highlightManager.getActiveHighlight(),{arrow:e}=this;if(t?.colorValue==null){e.visible=!1;return}const{scale:i,label:s}=this.axisTicks,n=s.fontSize??0,a=i.convert(t.colorValue);let{x:o,y:r}=this.gradientRect,l=Math.PI;this.isVertical()?(o-=n/2,r+=a,l/=2):(o+=a,r-=n/2),e.visible=!0,e.fill=s.color,e.rotation=l,e.size=n,e.translationX=o,e.translationY=r}getMeasurements(t,e){let{x:i,y:s}=t,{width:n,height:a}=this.gradientRect;switch(this.isVertical()?n+=e.width+5:a+=e.height+5,this.position){case"left":s+=t.height/2-a/2,t.shrink(n+this.spacing,"left");break;case"right":i+=t.width-n,s+=t.height/2-a/2,t.shrink(n+this.spacing,"right");break;case"top":i+=t.width/2-n/2,t.shrink(a+this.spacing,"top");break;case"bottom":i+=t.width/2-n/2,s+=t.height-a,t.shrink(a+this.spacing,"bottom")}return{top:s,left:i}}onChartHoverChange(){this.enabled&&this.updateArrow()}};Fh.className="GradientLegend",y([zh(Y4)],Fh.prototype,"enabled",2),y([zh(sot)],Fh.prototype,"position",2),y([zh(Y4)],Fh.prototype,"reverseOrder",2),y([zh(iot)],Fh.prototype,"gradient",2),y([zh(IT)],Fh.prototype,"spacing",2);var got={type:"legend",optionsKey:"gradientLegend",packageType:"enterprise",chartTypes:["cartesian","polar","hierarchy","topology","flow-proportion","standalone","gauge"],identifier:"gradient",moduleFactory:t=>new Fh(t),themeTemplate:{enabled:!1,position:"bottom",spacing:20,scale:{padding:13,label:{color:{$ref:"textColor"},fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"}},interval:{minSpacing:15}},gradient:{preferredLength:100,thickness:16},reverseOrder:!1},removable:"standalone-only"},fot=(R(),E(w));function yot(t,e){const i=t.addChild("canvas-overlay","watermark"),s=fot._ModuleSupport.createElement("span");s.innerText=e,i.addEventListener("animationend",()=>{t.removeChild("canvas-overlay","watermark"),t.removeStyles("watermark")}),i.classList.add("ag-watermark"),i.appendChild(s)}var mot=(R(),E(w)),K4=(R(),E(w)),Ibt=(R(),E(w)),xot=(R(),E(w)),{findMinMax:bot}=xot._ModuleSupport,Wi=0,Ns=1,Qs=2,qs=3,An=4;function ny(t,e=1){let i=Math.ceil(Math.log2(t.length/e))-1;return i=Math.min(Math.max(i,0),16),2**i|0}function ay(t){return bot(t.map(e=>Number(e)))}function uv(t,e,i){return(t.valueOf()-e)/(i-e)}function dv(t,e){return Math.min(Math.floor(t*e),e-1)*An|0}function oy(t,e,i,s,n,a){const o=new Int32Array(a*An).fill(-1),r=new Float64Array(a*An).fill(NaN);for(let l=0;lr[f+Ns])&&(o[f+Ns]=l,r[f+Ns]=d),(x||gr[f+qs])&&(o[f+qs]=l,r[f+qs]=p)}return{indexData:o,valueData:r}}function ry(t,e,i,{inPlace:s=!1}={}){const n=i/2|0,a=s?t:new Int32Array(n*An),o=s?e:new Float64Array(n*An);for(let r=0;re[h+Ns]?c:h;a[l+Ns]=t[p+Ns],o[l+Ns]=e[p+Ns];const g=u||e[c+Qs]e[h+qs]?c:h;a[l+qs]=t[f+qs],o[l+qs]=e[f+qs]}return{maxRange:n,indexData:a,valueData:o}}var $4={xMin:Wi,xMax:Ns,yMin:Qs,yMax:qs,span:An},Sot=1e3,vot=5;function X4(t,e){return Array.from({length:t},(i,s)=>{const n=s*An,a=e[n+Wi],o=e[n+Ns];return(a+o)/2|0})}function Mot(t,e,i){if(t.length64;)({indexData:o,valueData:r,maxRange:a}=ry(o,r,a)),l=X4(a,o),c.push({maxRange:a,indexData:o,indices:l,indexes:$4});return c.reverse(),c}var{ChartAxisDirection:Iot,ContinuousScale:Aot,OrdinalTimeScale:Dot}=K4._ModuleSupport,kot=class extends K4._ModuleSupport.BarSeries{aggregateData(t,e){if(e?.type!=="ungrouped")return;const i=this.axes[Iot.X];if(i==null||!(Aot.is(i.scale)||Dot.is(i.scale)))return;const s=t.resolveKeysById(this,"xValue",e),n=t.resolveColumnById(this,"yValue-raw",e),{index:a}=t.resolveProcessedDataDefById(this,"xValue"),o=e.domain.keys[a];return Mot(s,n,o)}},{BarSeriesModule:Lot}=mot._ModuleSupport,Tot={...Lot,type:"series",optionsKey:"series[]",packageType:"enterprise",chartTypes:["cartesian"],identifier:"bar",moduleFactory:t=>new kot(t)},Cot=(R(),E(w)),kT=(R(),E(w));function Not(t){return{from:t?{scalingX:1,scalingY:0}:{scalingX:0,scalingY:1},to:{scalingX:1,scalingY:1}}}function Oot(t){return(e,i)=>t?{scalingCenterY:i.scaledValues.medianValue}:{scalingCenterX:i.scaledValues.medianValue}}var Z4=(R(),E(w)),{ScalableGroup:wot,Rect:qd,Line:ly,BBox:Eot,Selection:Q4}=Z4._ModuleSupport,Rot=class extends wot{constructor(){super(),this.append([new qd({tag:0}),new qd({tag:0}),new qd({tag:2}),new qd({tag:1}),new ly({tag:3}),new ly({tag:3}),new ly({tag:4}),new ly({tag:4})])}updateDatumStyles(t,e,i,s){const{bandwidth:n,scaledValues:{xValue:a,medianValue:o}}=t;let{minValue:r,q1Value:l,q3Value:c,maxValue:h}=t.scaledValues;(i&&!s||!i&&s)&&([h,c,l,r]=[r,l,c,h]);const u=(B,z,U,Y)=>i?{y:B,x:z,width:Y,height:U}:{x:B,y:z,width:U,height:Y},d=(B,z,U)=>i?{y1:B,y2:z,x:U}:{x1:B,x2:z,y:U},p=(B,z,U)=>i?{x1:z,x2:U,y:B}:{x:B,y1:z,y2:U},g=(B,z,U,Y)=>({x:B,y:z,width:U,height:Y}=u(B,z,U,Y),new Eot(B,z,U,Y)),{fill:f,fillOpacity:x,stroke:m,strokeWidth:b,strokeOpacity:v,lineDash:S,lineDashOffset:A,cornerRadius:T,cap:D,whisker:L}=e,C=Q4.select(this,qd),O=C.selectByTag(0),[_]=C.selectByTag(2),[N]=C.selectByTag(1),P=C.selectByTag(3),j=C.selectByTag(4);L.strokeWidth>n&&(L.strokeWidth=n);const F=u(l,a,c-l,n);_.setProperties(F),O[0].setProperties(F),O[0].setProperties({cornerRadius:T,clipBBox:g(l,a,Math.round(o-l+b/2),n)}),O[1].setProperties(F),O[1].setProperties({cornerRadius:T,clipBBox:g(Math.round(o-b/2),a,Math.floor(c-o+b/2),n)});const V=Math.max(Math.round(o-b/2),l+b),W=Math.min(Math.round(o+b/2),c-b);N.setProperties(F),N.setProperties({visible:V{const F=x[j];if(F==null)return;const V=m[j],W=b[j],H=v[j],G=S[j],B=A[j];if([V,W,H,G,B].some($=>typeof $!="number")||V>W||W>H||H>G||G>B)return;const z={xValue:Math.round(s.scale.convert(F)),minValue:Math.round(n.scale.convert(V)),q1Value:Math.round(n.scale.convert(W)),medianValue:Math.round(n.scale.convert(H)),q3Value:Math.round(n.scale.convert(G)),maxValue:Math.round(n.scale.convert(B))};z.xValue+=Math.round(C.convert(String(D)))+L;const U=Math.round(T),Y=Math.abs(z.q3Value-z.q1Value),K=z.xValue+U/2,Z=Math.min(z.q3Value,z.q1Value)+Y/2,X={x:O?K:Z,y:O?Z:K};let Q;O?Q={x:X.x-U/2,y:z.minValue,width:U,height:z.maxValue-z.minValue}:Q={x:z.minValue,y:X.y-U/2,width:z.maxValue-z.minValue,height:U},f.push({series:this,itemId:F,datum:P,datumIndex:j,xKey:a,bandwidth:U,scaledValues:z,cap:p,whisker:g,fill:o,fillOpacity:r,stroke:l,strokeWidth:c,strokeOpacity:h,lineDash:u,lineDashOffset:d,midPoint:X,focusRect:Q})}),_}legendItemSymbol(){const{fill:t,fillOpacity:e,stroke:i,strokeWidth:s,strokeOpacity:n,lineDash:a,lineDashOffset:o}=this.properties;return{marker:{fill:t,fillOpacity:e,stroke:i,strokeOpacity:n,strokeWidth:s,lineDash:a,lineDashOffset:o}}}getLegendData(t){const{id:e,ctx:{legendManager:i},visible:s}=this,{xKey:n,yName:a,showInLegend:o,legendItemName:r}=this.properties;return!n||t!=="category"?[]:[{legendType:"category",id:e,itemId:e,seriesId:e,enabled:s&&i.getItemEnabled({seriesId:e,itemId:e}),label:{text:r??a??e},symbol:this.legendItemSymbol(),legendItemName:r,hideInLegend:!o}]}getTooltipContent(t){const{id:e,dataModel:i,processedData:s,properties:n}=this,{xKey:a,xName:o,yName:r,medianKey:l,medianName:c,q1Key:h,q1Name:u,q3Key:d,q3Name:p,minKey:g,minName:f,maxKey:x,maxName:m,legendItemName:b,tooltip:v}=n,S=this.getCategoryAxis(),A=this.getValueAxis();if(!i||!s||!S||!A)return;const{datumIndex:T}=t,D=s.dataSources.get(this.id)?.[T],L=i.resolveKeysById(this,"xValue",s)[T],C=i.resolveColumnById(this,"minValue",s)[T],O=i.resolveColumnById(this,"q1Value",s)[T],_=i.resolveColumnById(this,"medianValue",s)[T],N=i.resolveColumnById(this,"q3Value",s)[T],P=i.resolveColumnById(this,"maxValue",s)[T];if(L==null)return;const j=this.getItemBaseStyle(!1);return Object.assign(j,this.getItemStyleOverrides(String(T),D,j,!1)),v.formatTooltip({heading:S.formatDatum(L),title:b??r,symbol:this.legendItemSymbol(),data:[{label:f,fallbackLabel:g,value:A.formatDatum(C)},{label:u,fallbackLabel:h,value:A.formatDatum(O)},{label:c,fallbackLabel:l,value:A.formatDatum(_)},{label:p,fallbackLabel:d,value:A.formatDatum(N)},{label:m,fallbackLabel:x,value:A.formatDatum(P)}]},{seriesId:e,datum:D,title:r,xKey:a,xName:o,yName:r,medianKey:l,medianName:c,q1Key:h,q1Name:u,q3Key:d,q3Name:p,minKey:g,minName:f,maxKey:x,maxName:m,...j})}animateEmptyUpdateReady({datumSelection:t}){const e=this.isVertical(),{from:i,to:s}=Not(e);aj.resetMotion([t],Oot(e)),aj.staticFromToMotion(this.id,"datums",this.ctx.animationManager,[t],i,s,{phase:"initial"})}isLabelEnabled(){return!1}updateDatumSelection(t){const e=t.nodeData??[];return t.datumSelection.update(e)}getItemBaseStyle(t){const{properties:e}=this,{cornerRadius:i,cap:s,whisker:n}=e,a=t?e.highlightStyle.item:void 0,o=this.getStrokeWidth(e.strokeWidth);return{fill:a?.fill??e.fill,fillOpacity:a?.fillOpacity??e.fillOpacity,stroke:a?.stroke??e.stroke,strokeWidth:a?.strokeWidth??o,strokeOpacity:a?.strokeOpacity??e.strokeOpacity,lineDash:a?.lineDash??e.lineDash??[],lineDashOffset:a?.lineDashOffset??e.lineDashOffset,cornerRadius:i,cap:s,whisker:n}}getItemStyleOverrides(t,e,i,s){const{id:n,properties:a}=this,{xKey:o,minKey:r,q1Key:l,medianKey:c,q3Key:h,maxKey:u,itemStyler:d}=a;if(d!=null)return this.cachedDatumCallback(sj(t,s?"highlight":"node"),()=>d({seriesId:n,datum:e,xKey:o,minKey:r,q1Key:l,medianKey:c,q3Key:h,maxKey:u,highlighted:s,...i}))}updateDatumNodes({datumSelection:t,isHighlight:e}){const i=this.isVertical(),s=this.getValueAxis()?.isReversed();t.each((n,a)=>{let o=this.getFormattedStyles(a,e?"highlight":"node");e&&(o=TT(this.properties.highlightStyle.item,o));const{stroke:r,strokeWidth:l,strokeOpacity:c,lineDash:h,lineDashOffset:u}=o;o.whisker=TT(o.whisker,{stroke:r,strokeWidth:l,strokeOpacity:c,lineDash:h,lineDashOffset:u}),n.updateDatumStyles(a,o,i,s)})}updateLabelNodes(){}updateLabelSelection(t){const{labelData:e,labelSelection:i}=t;return i.update(e)}nodeFactory(){return new Rot}getFormattedStyles(t,e){const{id:i,properties:s}=this,{xKey:n,minKey:a,q1Key:o,medianKey:r,q3Key:l,maxKey:c,itemStyler:h,backgroundFill:u,cornerRadius:d}=s,{datum:p,stroke:g,strokeWidth:f,strokeOpacity:x,lineDash:m,lineDashOffset:b,cap:v,whisker:S}=t;let A,T;if(!0)A=t.fill,T=s.fillOpacity;else{try{A=CT.mix(CT.fromString(u),CT.fromString(t.fill),s.fillOpacity).toString()}catch{A=t.fill}T=void 0}const L={fill:A,fillOpacity:T,stroke:g,strokeWidth:f,strokeOpacity:x,lineDash:m,lineDashOffset:b,cornerRadius:d,cap:ej(v),whisker:ej(S)};if(h){const C=this.cachedDatumCallback(sj(p.index,e),()=>h({datum:p,seriesId:i,highlighted:e==="highlight",...L,xKey:n,minKey:a,q1Key:o,medianKey:r,q3Key:l,maxKey:c}));if(C)return TT(C,L)}return L}computeFocusBounds({datumIndex:t}){return Hot(this,this.contextNodeData?.nodeData[t].focusRect)}};NT.className="BoxPlotSeries",NT.type="box-plot";var $ot=(R(),E(w)),{CARTESIAN_AXIS_TYPE:oj}=$ot._ModuleSupport.ThemeConstants,Xot={series:{direction:"vertical",strokeWidth:2},axes:{[oj.NUMBER]:{crosshair:{snap:!1}},[oj.CATEGORY]:{groupPaddingInner:.2,crosshair:{enabled:!1,snap:!1}}}},{Color:OT,swapAxisCondition:Zot,ThemeSymbols:{DEFAULT_BACKGROUND_COLOUR:Qot},ThemeConstants:{CARTESIAN_AXIS_TYPE:rj,CARTESIAN_POSITION:lj}}=Cot._ModuleSupport,qot={type:"series",optionsKey:"series[]",packageType:"enterprise",chartTypes:["cartesian"],identifier:"box-plot",moduleFactory:t=>new NT(t),tooltipDefaults:{range:"exact"},defaultAxes:Zot([{type:rj.NUMBER,position:lj.LEFT},{type:rj.CATEGORY,position:lj.BOTTOM}],t=>t?.direction==="horizontal"),themeTemplate:Xot,groupable:!0,paletteFactory:({takeColors:t,themeTemplateParameters:e})=>{const i=e.get(Qot),s=(Array.isArray(i)?i[0]:i)??"white",{fills:[n],strokes:[a]}=t(1);let o;try{o=OT.mix(OT.fromString(s),OT.fromString(n),.3).toString()}catch{o=n}return{fill:o,stroke:a,backgroundFill:s}}},Jot=(R(),E(w)),wT=(R(),E(w)),ET=(R(),E(w)),trt=1e3,cj=Wi,ert=qs,irt=Qs,hj=Ns;function srt(t,e,i,s){if(t.length64;)({indexData:r,valueData:l,maxRange:o}=ry(r,l,o)),c.push({maxRange:o,indexData:r});return c.reverse(),c}var{fixNumericExtent:nrt,keyProperty:art,createDatumId:uj,SeriesNodePickMode:dj,ChartAxisDirection:RT,SMALLEST_KEY_INTERVAL:ort,valueProperty:fv,diff:rrt,animationValidation:lrt,computeBarFocusBounds:crt,visibleRangeIndices:pj,ContinuousScale:hrt,OrdinalTimeScale:urt,BandScale:drt}=ET._ModuleSupport,prt=class extends ET._ModuleSupport.SeriesNodeEvent{constructor(t,e,i,s){super(t,e,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}},gj=class extends ET._ModuleSupport.AbstractBarSeries{constructor(t){super({moduleCtx:t,pickModes:[dj.AXIS_ALIGNED,dj.EXACT_SHAPE_MATCH],directionKeys:{x:["xKey"],y:["lowKey","highKey","openKey","closeKey"]},directionNames:{x:["xName"],y:["lowName","highName","openName","closeName"]},pathsPerSeries:[]}),this.NodeEvent=prt,this.dataAggregationFilters=void 0}async processData(t){if(!this.properties.isValid()||!this.visible)return;const{xKey:e,openKey:i,closeKey:s,highKey:n,lowKey:a}=this.properties,o=!this.ctx.animationManager.isSkipped(),r=this.getCategoryAxis()?.scale,l=this.getValueAxis()?.scale,{isContinuousX:c,xScaleType:h,yScaleType:u}=this.getScaleInformation({xScale:r,yScale:l}),d=[];o&&(this.processedData&&d.push(rrt(this.id,this.processedData)),d.push(lrt())),i&&d.push(fv(i,u,{id:"openValue",invalidValue:void 0,missingValue:void 0}));const{dataModel:p,processedData:g}=await this.requestDataModel(t,this.data,{props:[art(e,h,{id:"xValue"}),fv(s,u,{id:"closeValue"}),fv(n,u,{id:"highValue"}),fv(a,u,{id:"lowValue"}),...c?[ort]:[],...d]});this.smallestDataInterval=g.reduced?.smallestKeyInterval,this.dataAggregationFilters=this.aggregateData(p,g),this.animationState.transition("updateData")}aggregateData(t,e){const i=this.axes[RT.X];if(i==null||!(hrt.is(i.scale)||urt.is(i.scale)))return;const s=t.resolveKeysById(this,"xValue",e),n=t.resolveColumnById(this,"highValue",e),a=t.resolveColumnById(this,"lowValue",e),{index:o}=t.resolveProcessedDataDefById(this,"xValue"),r=e.domain.keys[o];return srt(s,n,a,r)}getSeriesDomain(t){const{processedData:e,dataModel:i}=this;if(!(e&&i))return[];if(t!==this.getBarDirection()){const{index:n,def:a}=i.resolveProcessedDataDefById(this,"xValue"),o=e.domain.keys[n];return a.type==="key"&&a.valueType==="category"?o:this.padBandExtent(o)}const s=this.domainForClippedRange(RT.Y,["highValue","lowValue"],"xValue",!0);return nrt(s)}getSeriesRange(t,e){return this.domainForVisibleRange(RT.Y,["highValue","lowValue"],"xValue",e,!0)}getVisibleItems(t,e,i){return this.countVisibleItems("xValue",["highValue","lowValue"],t,e,i)}createNodeData(){const{visible:t,dataModel:e,processedData:i}=this,s=this.getCategoryAxis(),n=this.getValueAxis();if(!(e&&i&&s&&n))return;const a=[],{xKey:o,highKey:r,lowKey:l}=this.properties,c=i.dataSources.get(this.id)??[],h=e.resolveKeysById(this,"xValue",i),u=e.resolveColumnById(this,"openValue",i),d=e.resolveColumnById(this,"closeValue",i),p=e.resolveColumnById(this,"highValue",i),g=e.resolveColumnById(this,"lowValue",i),{groupScale:f}=this,{barWidth:x,groupIndex:m}=this.updateGroupScale(s),b=f.convert(String(m)),v=x>=1?x:f.rawBandwidth,S=drt.is(s.scale),A={itemId:o,nodeData:a,labelData:[],scales:this.calculateScaling(),visible:this.visible};if(!t)return A;const T=(j,F,V,W,H,G,B,z)=>{const U=c[j],Y=S?B/2:0,K=s.scale.convert(F)+b+Y,Z=n.scale.convert(V),X=n.scale.convert(W),Q=n.scale.convert(H),$=n.scale.convert(G),q=W>V,J=q?"up":"down",nt=Math.min(Q,$),it=Math.max(Q,$)-nt,rt={x:K,y:nt+it/2};a.push({series:this,itemId:J,datum:U,datumIndex:j,xKey:o,xValue:F,openValue:V,closeValue:W,highValue:H,lowValue:G,midPoint:rt,aggregatedValue:W,isRising:q,centerX:K,width:B,y:nt,height:it,yOpen:Z,yClose:X,crisp:z})},{dataAggregationFilters:D}=this,L=s.scale,[C,O]=L.range,_=O-C,N=j=>L.convert(h[j])+b,P=D?.find(j=>j.maxRange>_);if(P==null){let[j,F]=pj(c.length,s.range,V=>{const W=N(V);return[W,W+v]});i.input.count<1e3&&(j=0,F=i.input.count);for(let V=j;V=H&&B>=G;if(!U){Gt.warnOnce(`invalid low value for key [${l}] in data element, low value cannot be higher than datum open or close values`);continue}if(!Y){Gt.warnOnce(`invalid high value for key [${r}] in data element, high value cannot be lower than datum open or close values.`);continue}T(V,W,H,G,B,z,v,!0)}}else{const{maxRange:j,indexData:F}=P,[V,W]=pj(j,s.range,H=>{const G=H*An,B=F[G+cj],z=F[G+hj];if(B!==-1)return[N(B),N(z)+v]});for(let H=V;Hr({seriesId:a,datum:e,itemId:i,xKey:l,openKey:c,closeKey:h,highKey:u,lowKey:d,highlighted:n,...s}))}getTooltipContent(t){const{id:e,dataModel:i,processedData:s,properties:n}=this,{xKey:a,xName:o,yName:r,openKey:l,openName:c,highKey:h,highName:u,lowKey:d,lowName:p,closeKey:g,closeName:f,legendItemName:x,tooltip:m}=n,b=this.getCategoryAxis(),v=this.getValueAxis();if(!i||!s||!b||!v)return;const{datumIndex:S}=t,A=s.dataSources.get(this.id)?.[S],T=i.resolveKeysById(this,"xValue",s)[S],D=i.resolveColumnById(this,"openValue",s)[S],L=i.resolveColumnById(this,"highValue",s)[S],C=i.resolveColumnById(this,"lowValue",s)[S],O=i.resolveColumnById(this,"closeValue",s)[S];if(T==null)return;const _=O>=D?"up":"down",N=this.properties.item[_],P=this.getItemBaseStyle(_,!1);return Object.assign(P,this.getItemStyleOverrides(String(S),A,_,P,!1)),m.formatTooltip({heading:b.formatDatum(T),title:x,symbol:{marker:{fill:N.fill??N.stroke,fillOpacity:N.fillOpacity??N.strokeOpacity??1,stroke:N.stroke,strokeWidth:N.strokeWidth??1,strokeOpacity:N.strokeOpacity??1,lineDash:N.lineDash??[0],lineDashOffset:N.lineDashOffset??0}},data:[{label:c,fallbackLabel:l,value:v.formatDatum(D)},{label:u,fallbackLabel:h,value:v.formatDatum(L)},{label:p,fallbackLabel:d,value:v.formatDatum(C)},{label:f,fallbackLabel:g,value:v.formatDatum(O)}]},{seriesId:e,datum:A,title:r,itemId:_,xKey:a,xName:o,yName:r,openKey:l,openName:c,highKey:h,highName:u,lowKey:d,lowName:p,closeKey:g,closeName:f,...P})}getDatumId(t){return uj(t.xValue)}computeFocusBounds(t){const e=this.getNodeData()?.at(t.datumIndex);if(e==null)return;const{centerX:i,y:s,width:n,height:a}=e,o={x:i-n/2,y:s,width:n,height:a};return crt(this,o)}},grt=(R(),E(w)),frt=(R(),E(w)),{Path:yrt,ScenePathChangeDetection:Kl,BBox:mrt}=frt._ModuleSupport,Eo=class extends yrt{constructor(){super(...arguments),this.centerX=0,this.y=0,this.width=0,this.height=0,this.yOpen=0,this.yClose=0,this.crisp=!1,this.strokeAlignment=0}computeBBox(){const{centerX:t,y:e,width:i,height:s}=this;return new mrt(t-i/2,e,i,s)}isPointInPath(t,e){return this.getBBox().containsPoint(t,e)}distanceSquared(t,e){return this.getBBox().distanceSquared(t,e)}get midPoint(){return{x:this.centerX,y:this.y+this.height/2}}alignedCoordinates(){const{y:t,width:e,height:i,crisp:s,strokeAlignment:n}=this;let{centerX:a,yOpen:o,yClose:r}=this,l=a-e/2,c=a+e/2,h=t,u=t+i;if(s&&e>1){a=this.align(a),o=this.align(o),r=this.align(r);const p=this.align(e/2);l=a-p,c=a+p,h=this.align(t),u=h+this.align(h,i)}const d=(h+u)/2;return a+=n,l+=n,c+=n,h-=n,u+=n,o+=o1&&(t.moveTo(i,o),t.lineTo(e,o),t.moveTo(e,r),t.lineTo(s,r))}},{ScenePathChangeDetection:uy,ExtendedPath2D:brt}=grt._ModuleSupport,tp=class extends Eo{constructor(){super(...arguments),this.wickPath=new brt,this.wickStroke=void 0,this.wickStrokeWidth=void 0,this.wickStrokeOpacity=void 0}updatePath(){const{path:t,stroke:e,strokeWidth:i,strokeOpacity:s,lineDash:n,lineDashOffset:a,wickStroke:o,wickStrokeWidth:r,wickStrokeOpacity:l,wickLineDash:c,wickLineDashOffset:h,strokeAlignment:u}=this,{centerX:d,x0:p,x1:g,y0:f,y1:x,yOpen:m,yClose:b}=this.alignedCoordinates();this.path.clear(),this.wickPath.clear();const S=o!=null&&o!==e||r!=null&&r!==i||l!=null&&l!==s||c!=null&&c!==n||h!=null&&h!==a?this.wickPath:t;if(Math.abs(g-p)<=3){S.moveTo(d,f),S.lineTo(d,x);return}const A=Math.min(m,b),T=Math.max(m,b);S.moveTo(d,f),S.lineTo(d,A+i/2),S.moveTo(d,x),S.lineTo(d,T-i/2);const D=u+i/2,L=T-A-2*D;if(L>0)t.rect(p+D,A+D,g-p-2*D,L);else{const C=(A+T)/2;t.moveTo(p,C),t.lineTo(g,C)}}drawPath(t){super.drawPath(t);const{wickPath:e}=this;if(e.isEmpty())return;const{stroke:i,strokeWidth:s,strokeOpacity:n,lineDash:a,lineDashOffset:o,wickStroke:r=i,wickStrokeWidth:l=s,wickStrokeOpacity:c=n,wickLineDash:h=a,wickLineDashOffset:u=o}=this;l!==0&&(t.globalAlpha*=c,typeof r=="string"&&(t.strokeStyle=r),t.lineWidth=l,h!=null&&t.setLineDash(h),t.lineDashOffset=u,t.stroke(e.getPath2D()))}};y([uy()],tp.prototype,"wickStroke",2),y([uy()],tp.prototype,"wickStrokeWidth",2),y([uy()],tp.prototype,"wickStrokeOpacity",2),y([uy()],tp.prototype,"wickLineDash",2),y([uy()],tp.prototype,"wickLineDashOffset",2);var Srt=(R(),E(w)),vrt=(R(),E(w)),{BaseProperties:fj,Validate:Ze,AbstractBarSeriesProperties:Mrt,SeriesTooltip:Irt,STRING:Ra,COLOR_STRING:Art,FUNCTION:Drt,LINE_DASH:krt,OBJECT:yv,POSITIVE_NUMBER:yj,RATIO:Lrt}=vrt._ModuleSupport,jh=class extends fj{constructor(){super(...arguments),this.stroke="#333",this.strokeWidth=1,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0}};y([Ze(Art)],jh.prototype,"stroke",2),y([Ze(yj)],jh.prototype,"strokeWidth",2),y([Ze(Lrt)],jh.prototype,"strokeOpacity",2),y([Ze(krt)],jh.prototype,"lineDash",2),y([Ze(yj)],jh.prototype,"lineDashOffset",2);var _T=class extends fj{constructor(){super(...arguments),this.up=new jh,this.down=new jh}};y([Ze(yv)],_T.prototype,"up",2),y([Ze(yv)],_T.prototype,"down",2);var kn=class extends Mrt{};y([Ze(Ra)],kn.prototype,"xKey",2),y([Ze(Ra)],kn.prototype,"openKey",2),y([Ze(Ra)],kn.prototype,"closeKey",2),y([Ze(Ra)],kn.prototype,"highKey",2),y([Ze(Ra)],kn.prototype,"lowKey",2),y([Ze(Ra,{optional:!0})],kn.prototype,"xName",2),y([Ze(Ra,{optional:!0})],kn.prototype,"yName",2),y([Ze(Ra,{optional:!0})],kn.prototype,"openName",2),y([Ze(Ra,{optional:!0})],kn.prototype,"closeName",2),y([Ze(Ra,{optional:!0})],kn.prototype,"highName",2),y([Ze(Ra,{optional:!0})],kn.prototype,"lowName",2);var mv=class extends kn{constructor(){super(...arguments),this.tooltip=new Irt,this.item=new _T}};y([Ze(yv)],mv.prototype,"tooltip",2),y([Ze(yv)],mv.prototype,"item",2),y([Ze(Drt,{optional:!0})],mv.prototype,"itemStyler",2);var{BaseProperties:PT,SeriesTooltip:Trt,Validate:yi,COLOR_STRING:BT,FUNCTION:Crt,LINE_DASH:mj,OBJECT:dy,POSITIVE_NUMBER:py,RATIO:zT}=Srt._ModuleSupport,ep=class extends PT{};y([yi(BT,{optional:!0})],ep.prototype,"stroke",2),y([yi(py)],ep.prototype,"strokeWidth",2),y([yi(zT)],ep.prototype,"strokeOpacity",2),y([yi(mj,{optional:!0})],ep.prototype,"lineDash",2),y([yi(py)],ep.prototype,"lineDashOffset",2);var _a=class extends PT{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 ep}};y([yi(BT,{optional:!0})],_a.prototype,"fill",2),y([yi(zT)],_a.prototype,"fillOpacity",2),y([yi(BT)],_a.prototype,"stroke",2),y([yi(py)],_a.prototype,"strokeWidth",2),y([yi(zT)],_a.prototype,"strokeOpacity",2),y([yi(mj)],_a.prototype,"lineDash",2),y([yi(py)],_a.prototype,"lineDashOffset",2),y([yi(py)],_a.prototype,"cornerRadius",2),y([yi(dy)],_a.prototype,"wick",2);var FT=class extends PT{constructor(){super(...arguments),this.up=new _a,this.down=new _a}};y([yi(dy)],FT.prototype,"up",2),y([yi(dy)],FT.prototype,"down",2);var xv=class extends kn{constructor(){super(...arguments),this.item=new FT,this.tooltip=new Trt}};y([yi(dy)],xv.prototype,"item",2),y([yi(dy)],xv.prototype,"tooltip",2),y([yi(Crt,{optional:!0})],xv.prototype,"itemStyler",2);var{createDatumId:Nrt}=wT._ModuleSupport,jT=class extends gj{constructor(){super(...arguments),this.properties=new xv}nodeFactory(){return new tp}updateDatumNodes({datumSelection:t,isHighlight:e}){const{id:i,properties:s}=this,{xKey:n,highKey:a,lowKey:o,openKey:r,closeKey:l,item:c,itemStyler:h}=s,{up:u,down:d}=c,{fill:p,fillOpacity:g,stroke:f,strokeWidth:x,strokeOpacity:m,lineDash:b,lineDashOffset:v}=u,{stroke:S,strokeWidth:A,strokeOpacity:T,lineDash:D,lineDashOffset:L}=u.wick,{fill:C,fillOpacity:O,stroke:_,strokeWidth:N,strokeOpacity:P,lineDash:j,lineDashOffset:F}=d,{stroke:V,strokeWidth:W,strokeOpacity:H,lineDash:G,lineDashOffset:B}=d.wick,z=e?s.highlightStyle.item:void 0;t.each((U,Y)=>{const{isRising:K,centerX:Z,width:X,y:Q,height:$,yOpen:q,yClose:J,crisp:nt}=Y;let it;if(h!=null){const{fill:dt,fillOpacity:at,stroke:Dt,strokeWidth:kt,strokeOpacity:Mt,lineDash:ft,lineDashOffset:xt}=K?u:d;it=this.cachedDatumCallback(Nrt(this.getDatumId(Y),e?"highlight":"node"),()=>h({seriesId:i,itemId:Y.itemId,xKey:n,highKey:a,lowKey:o,openKey:r,closeKey:l,datum:Y.datum,fill:dt,fillOpacity:at,strokeOpacity:Mt,stroke:Dt,strokeWidth:kt,lineDash:ft,lineDashOffset:xt,highlighted:e}))}U.centerX=Z,U.width=X,U.y=Q,U.height=$,U.yOpen=q,U.yClose=J,U.crisp=nt,U.fill=z?.fill??it?.fill??(K?p:C),U.fillOpacity=z?.fillOpacity??it?.fillOpacity??(K?g:O),U.stroke=z?.stroke??it?.stroke??(K?f:_),U.strokeWidth=z?.strokeWidth??it?.strokeWidth??(K?x:N),U.strokeOpacity=z?.strokeOpacity??it?.strokeOpacity??(K?m:P),U.lineDash=z?.lineDash??it?.lineDash??(K?b:j),U.lineDashOffset=z?.lineDashOffset??it?.lineDashOffset??(K?v:F);const rt=it?.wick;U.wickStroke=z?.stroke??rt?.stroke??(K?S:V),U.wickStrokeWidth=z?.strokeWidth??rt?.strokeWidth??(K?A:W),U.wickStrokeOpacity=z?.strokeOpacity??rt?.strokeOpacity??(K?T:H),U.wickLineDash=z?.lineDash??rt?.lineDash??(K?D:G),U.wickLineDashOffset=z?.lineDashOffset??rt?.lineDashOffset??(K?L:B),U.strokeAlignment=(it?.strokeWidth??(K?x:N))/2})}legendItemSymbol(){const{up:t,down:e}=this.properties.item,i=new wT._ModuleSupport.LinearGradient("rgb",[{color:t.fill,offset:0},{color:t.fill,offset:.5},{color:e.fill,offset:.5}],90),s=new wT._ModuleSupport.LinearGradient("rgb",[{color:t.stroke,offset:0},{color:t.stroke,offset:.5},{color:e.stroke,offset:.5}],90);return{marker:{fill:i,fillOpacity:t.fillOpacity,stroke:s,strokeWidth:t.strokeWidth??1,strokeOpacity:t.strokeOpacity??1,lineDash:t.lineDash,lineDashOffset:t.lineDashOffset}}}getLegendData(t){const{id:e,data:i,visible:s,ctx:{legendManager:n}}=this,{xKey:a,yName:o,showInLegend:r,legendItemName:l}=this.properties;return!i?.length||!a||t!=="category"?[]:[{legendType:"category",id:e,itemId:e,seriesId:e,enabled:s&&n.getItemEnabled({seriesId:e,itemId:e}),label:{text:l??o??e},symbol:this.legendItemSymbol(),legendItemName:l,hideInLegend:!r}]}};jT.className="CandleStickSeries",jT.type="candlestick";var Ort=(R(),E(w)),{CARTESIAN_AXIS_TYPE:xj}=Ort._ModuleSupport.ThemeConstants,wrt={series:{highlightStyle:{item:{strokeWidth:3}}},animation:{enabled:!1},axes:{[xj.NUMBER]:{crosshair:{snap:!1}},[xj.ORDINAL_TIME]:{groupPaddingInner:0,crosshair:{enabled:!0}}}},{CARTESIAN_AXIS_TYPE:bj,CARTESIAN_POSITION:Sj}=Jot._ModuleSupport.ThemeConstants,Ert={type:"series",optionsKey:"series[]",packageType:"enterprise",chartTypes:["cartesian"],identifier:"candlestick",moduleFactory:t=>new jT(t),tooltipDefaults:{range:"nearest"},defaultAxes:[{type:bj.NUMBER,position:Sj.LEFT},{type:bj.ORDINAL_TIME,position:Sj.BOTTOM}],themeTemplate:wrt,groupable:!1,paletteFactory:({takeColors:t,colorsCount:e,userPalette:i,palette:s})=>{if(i==="user-indexed"){const{fills:n,strokes:a}=t(e);return{item:{up:{fill:"transparent",stroke:a[0]},down:{fill:n[0],stroke:a[0]}}}}return{item:{up:s.up,down:s.down}}}},Abt=(R(),E(w)),Rrt=(R(),E(w)),vj=(R(),E(w));function Mj(t,e,i){i||(e=_rt(e));const s=new Map;for(const a of t)s.set(a.id,{datum:a,linksBefore:[],linksAfter:[],maxPathLengthBefore:-1,maxPathLengthAfter:-1});let n=0;return s.forEach((a,o)=>{n=Math.max(n,VT(s,e,a,o,-1,[])+VT(s,e,a,o,1,[])+1)}),{links:e,nodeGraph:s,maxPathLength:n}}function Ij(t,e,i,s){const n=s.indexOf(e);if(n!==-1){for(let o=n;o!e.has(i))}function VT(t,e,i,s,n,a){if(a.includes(s))return 1/0;let o=n===-1?i.maxPathLengthBefore:i.maxPathLengthAfter;if(o===-1){o=0;const r=n===-1?i.linksBefore:i.linksAfter;for(const l of e){const{fromNode:c,toNode:h}=l,u=n===-1?h.id:c.id,d=n===-1?c.id:h.id,p=s===u?t.get(d):void 0;p!=null&&(r.push({node:p,link:l}),a?.push(s),o=Math.max(o,VT(t,e,p,d,n,a)+1),a?.pop())}n===-1?i.maxPathLengthBefore=o:i.maxPathLengthAfter=o}return o}var{Series:Prt,DataController:Brt,Validate:zrt,ARRAY:Frt,keyProperty:jrt,valueProperty:bv,Selection:Vh,Group:ip,TransformableText:Vrt}=vj._ModuleSupport,Grt=class extends vj._ModuleSupport.SeriesNodeEvent{constructor(t,e,i,s){super(t,e,i,s);const{datumIndex:n}=i,a=s.contextNodeData?.nodeData.find(o=>o.datumIndex.type===n.type&&o.datumIndex.index===n.index);this.size=a?.size,this.label=a?.type===1?a?.label:void 0}},GT=class extends Prt{constructor(){super(...arguments),this.NodeEvent=Grt,this._chartNodes=void 0,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 ip({name:"linkGroup"})),this.nodeGroup=this.contentGroup.appendChild(new ip({name:"nodeGroup"})),this.focusLinkGroup=this.highlightNode.appendChild(new ip({name:"linkGroup"})),this.focusNodeGroup=this.highlightNode.appendChild(new ip({name:"nodeGroup"})),this.highlightLinkGroup=this.highlightNode.appendChild(new ip({name:"linkGroup"})),this.highlightNodeGroup=this.highlightNode.appendChild(new ip({name:"nodeGroup"})),this.labelSelection=Vh.select(this.labelGroup,Vrt),this.linkSelection=Vh.select(this.linkGroup,()=>this.linkFactory()),this.nodeSelection=Vh.select(this.nodeGroup,()=>this.nodeFactory()),this.focusLinkSelection=Vh.select(this.focusLinkGroup,()=>this.linkFactory()),this.focusNodeSelection=Vh.select(this.focusNodeGroup,()=>this.nodeFactory()),this.highlightLinkSelection=Vh.select(this.highlightLinkGroup,()=>this.linkFactory()),this.highlightNodeSelection=Vh.select(this.highlightNodeGroup,()=>this.nodeFactory())}get nodes(){return this.properties.nodes??this._chartNodes}setChartNodes(t){this._chartNodes=t,this.nodes===t&&(this.nodeDataRefresh=!0)}async processData(t){const{data:e,nodes:i}=this;if(e==null||!this.properties.isValid())return;const{fromKey:s,toKey:n,sizeKey:a,idKey:o,labelKey:r}=this.properties,l=new Brt("standalone",t.suppressFieldDotNotation),c=i!=null?l.request(this.id,i,{props:[jrt(o,void 0,{id:"idValue",includeProperty:!1}),...r!=null?[bv(r,void 0,{id:"labelValue",includeProperty:!1})]:[]],groupByKeys:!0}):null,h=t.request(this.id,e,{props:[bv(s,void 0,{id:"fromValue",includeProperty:!1}),bv(n,void 0,{id:"toValue",includeProperty:!1}),...a!=null?[bv(a,void 0,{id:"sizeValue",includeProperty:!1,missingValue:0})]:[]],groupByKeys:!1});i!=null&&l.execute();const[u,d]=await Promise.all([c,h]);this.nodesDataModel=u?.dataModel,this.nodesProcessedData=u?.processedData,this.linksDataModel=d?.dataModel,this.linksProcessedData=d?.processedData;const p=new Map;if(u==null){const g=d.dataModel.resolveColumnById(this,"fromValue",d.processedData),f=d.dataModel.resolveColumnById(this,"toValue",d.processedData),x=m=>{const b=p.size;return{series:this,itemId:void 0,datum:{},datumIndex:{type:1,index:b},type:1,index:b,linksBefore:[],linksAfter:[],id:m,size:0,label:m}};d.processedData.dataSources.get(this.id)?.forEach((m,b)=>{const v=g[b],S=f[b];v==null||S==null||(p.has(v)||p.set(v,x(v)),p.has(S)||p.set(S,x(S)))})}else{const g=u.dataModel.resolveColumnById(this,"idValue",u.processedData),f=r!=null?u.dataModel.resolveColumnById(this,"labelValue",u.processedData):void 0;u.processedData.dataSources.get(this.id)?.forEach((x,m)=>{const b=g[m],v=f?.[m];p.set(b,{series:this,itemId:void 0,datum:x,datumIndex:{type:1,index:m},type:1,index:m,linksBefore:[],linksAfter:[],id:b,size:0,label:v})})}this.processedNodes=p}getNodeGraph(t,e,{includeCircularReferences:i}){const{linksDataModel:s,linksProcessedData:n}=this;if(s==null||n==null){const{links:g,nodeGraph:f,maxPathLength:x}=Mj(new Map().values(),[],i);return this.nodeCount=0,this.linkCount=0,{nodeGraph:f,links:g,maxPathLength:x}}const{sizeKey:a}=this.properties,o=s.resolveColumnById(this,"fromValue",n),r=s.resolveColumnById(this,"toValue",n),l=a!=null?s.resolveColumnById(this,"sizeValue",n):void 0,c=new Map;this.processedNodes.forEach(g=>{const f=t(g);c.set(g.id,f)});const h=[];n.dataSources.get(this.id)?.forEach((g,f)=>{const x=o[f],m=r[f],b=l!=null?l[f]:1,v=c.get(x),S=c.get(m);if(b<=0||v==null||S==null)return;const A=e({series:this,itemId:void 0,datum:g,datumIndex:{type:0,index:f},type:0,index:f,fromNode:v,toNode:S,size:b});h.push(A)});const{links:u,nodeGraph:d,maxPathLength:p}=Mj(c.values(),h,i);return d.forEach(g=>{g.datum.linksBefore=g.linksBefore.map(f=>f.link),g.datum.linksAfter=g.linksAfter.map(f=>f.link)}),this.nodeCount=d.size,this.linkCount=u.length,{nodeGraph:d,links:u,maxPathLength:p}}updateSelections(){this.nodeDataRefresh&&(this.contextNodeData=this.createNodeData(),this.nodeDataRefresh=!1)}update(t){const{seriesRect:e}=t,i={seriesRectWidth:e?.width??0,seriesRectHeight:e?.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??[],n=this.contextNodeData?.labelData??[];let a=this.ctx.highlightManager?.getActiveHighlight();if(a?.series===this&&a.type==null){const{itemId:h}=a;a=h!=null?s.find(u=>u.type===1&&u.id===h):void 0}else a?.series!==this&&(a=void 0);this.contentGroup.visible=this.visible,this.contentGroup.opacity=a!=null?this.properties.highlightStyle.series.dimOpacity??1:1,this.labelSelection=this.updateLabelSelection({labelData:n,labelSelection:this.labelSelection}),this.updateLabelNodes({labelSelection:this.labelSelection}),this.linkSelection=this.updateLinkSelection({nodeData:s.filter(h=>h.type===0),datumSelection:this.linkSelection}),this.updateLinkNodes({datumSelection:this.linkSelection,isHighlight:!1}),this.nodeSelection=this.updateNodeSelection({nodeData:s.filter(h=>h.type===1),datumSelection:this.nodeSelection}),this.updateNodeNodes({datumSelection:this.nodeSelection,isHighlight:!1});let o,r,l,c;a?.type===1?(o=s.filter(h=>h.type===0&&(h.toNode===a||h.fromNode===a)),r=o.map(h=>h.fromNode===a?h.toNode:h.fromNode),r.push(a),l=[],c=[a]):a?.type===0?(o=[a],r=[a.fromNode,a.toNode],l=[a],c=[]):(o=[],r=[],l=[],c=[]),this.focusLinkSelection=this.updateLinkSelection({nodeData:o,datumSelection:this.focusLinkSelection}),this.updateLinkNodes({datumSelection:this.focusLinkSelection,isHighlight:!1}),this.focusNodeSelection=this.updateNodeSelection({nodeData:r,datumSelection:this.focusNodeSelection}),this.updateNodeNodes({datumSelection:this.focusNodeSelection,isHighlight:!1}),this.highlightLinkSelection=this.updateLinkSelection({nodeData:l,datumSelection:this.highlightLinkSelection}),this.updateLinkNodes({datumSelection:this.highlightLinkSelection,isHighlight:!0}),this.highlightNodeSelection=this.updateNodeSelection({nodeData:c,datumSelection:this.highlightNodeSelection}),this.updateNodeNodes({datumSelection:this.highlightNodeSelection,isHighlight:!0})}resetAnimation(t){}getSeriesDomain(t){return[]}getSeriesRange(t,e){return[NaN,NaN]}legendItemSymbol(t,e,i={}){const{fills:s,strokes:n}=this.properties,{fill:a=s[e%s.length],fillOpacity:o=1,stroke:r=n[e%n.length],strokeWidth:l=0,strokeOpacity:c=1,lineDash:h=[0],lineDashOffset:u=0}=i;return{marker:{fill:a,fillOpacity:o,stroke:r,strokeWidth:l,strokeOpacity:c,lineDash:h,lineDashOffset:u}}}getLegendData(t){if(t!=="category")return[];const{showInLegend:e}=this.properties;return Array.from(this.processedNodes.values(),({id:i,label:s},n)=>({legendType:"category",id:this.id,itemId:i,seriesId:this.id,enabled:!0,label:{text:s??i},symbol:this.legendItemSymbol(1,n),hideInLegend:!e,isFixed:!0}))}pickNodeClosestDatum({x:t,y:e}){let i=1/0,s;return this.linkSelection.each((n,a)=>{const o=n.containsPoint(t,e)?0:1/0;o{const o=n.distanceSquared(t,e);oh.datum),c=r.indexOf(s)+e;if(c>=0&&c0)n=r[r.length-1];else{const h=Array.from(this.nodeSelection,u=>u.datum);n=h[h.length-1]}}else if(s?.type===1){const r=Array.from(this.nodeSelection,h=>h.datum),c=r.indexOf(s)+e;c>=0&&cu.datum)[0]}if(n==null)return;const a=n.type===1?Array.from(this.nodeSelection).find(r=>r.datum===n):Array.from(this.linkSelection).find(r=>r.datum===n);if(a==null)return;const o=this.computeFocusBounds(a.node);if(o!=null)return{datum:a.datum,datumIndex:this.contextNodeData?.nodeData.indexOf(a.datum)??0,otherIndex:0,bounds:o,clipFocusBox:!0}}};y([zrt(Frt,{optional:!0,property:"nodes"})],GT.prototype,"_chartNodes",2);var Wrt=(R(),E(w)),{BBox:Urt,Path:Hrt,ScenePathChangeDetection:$l}=Wrt._ModuleSupport;function Sv({radius:t,startAngle:e,endAngle:i,tension:s}){const n=t*Math.cos(e),a=t*Math.sin(e),o=t*Math.cos(i),r=t*Math.sin(i),l=n*s,c=a*s,h=o*s,u=r*s;return{x:[n,l,h,o],y:[a,c,u,r]}}var _r=class extends Hrt{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}computeBBox(){const{centerX:t,centerY:e,radius:i,startAngle1:s,endAngle1:n,startAngle2:a,endAngle2:o,tension:r}=this,l=Sv({radius:i,startAngle:s,endAngle:o,tension:r}),c=Sv({radius:i,startAngle:a,endAngle:n,tension:r}),h=Math.min(...l.x,...c.x),u=Math.max(...l.x,...c.x)-h,d=Math.min(...l.y,...c.y),p=Math.max(...l.y,...c.y)-d;return new Urt(t+h,e+d,u,p)}tensionedCurveTo(t,e,i,s,n,a,o,r){const{path:l,tension:c}=this,h=1-c;l.cubicCurveTo((i-t)*h+t,(s-e)*h+e,(n-o)*h+o,(a-r)*h+r,o,r)}updatePath(){const{path:t,centerX:e,centerY:i,radius:s}=this;let{startAngle1:n,endAngle1:a,startAngle2:o,endAngle2:r}=this;n>o&&([n,o]=[o,n],[a,r]=[r,a]),t.clear();const l=e+s*Math.cos(n),c=i+s*Math.sin(n);t.moveTo(l,c),this.tensionedCurveTo(l,c,e,i,e,i,e+s*Math.cos(r),i+s*Math.sin(r)),t.arc(e,i,s,r,o,!0),this.tensionedCurveTo(e+s*Math.cos(o),i+s*Math.sin(o),e,i,e,i,e+s*Math.cos(a),i+s*Math.sin(a)),t.arc(e,i,s,a,n,!0),t.closePath()}};y([$l()],_r.prototype,"centerX",2),y([$l()],_r.prototype,"centerY",2),y([$l()],_r.prototype,"radius",2),y([$l()],_r.prototype,"startAngle1",2),y([$l()],_r.prototype,"endAngle1",2),y([$l()],_r.prototype,"startAngle2",2),y([$l()],_r.prototype,"endAngle2",2),y([$l()],_r.prototype,"tension",2);var Yrt=(R(),E(w)),{BaseProperties:Aj,SeriesTooltip:Krt,SeriesProperties:$rt,ARRAY:Xrt,COLOR_STRING:vv,COLOR_STRING_ARRAY:Dj,FUNCTION:kj,LINE_DASH:Lj,OBJECT:Mv,POSITIVE_NUMBER:Xl,RATIO:gy,STRING:Zl,Validate:Pt,Label:Zrt}=Yrt._ModuleSupport,WT=class extends Zrt{constructor(){super(...arguments),this.spacing=1,this.maxWidth=1}};y([Pt(Xl)],WT.prototype,"spacing",2),y([Pt(Xl)],WT.prototype,"maxWidth",2);var Ro=class extends Aj{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}};y([Pt(vv,{optional:!0})],Ro.prototype,"fill",2),y([Pt(gy)],Ro.prototype,"fillOpacity",2),y([Pt(vv,{optional:!0})],Ro.prototype,"stroke",2),y([Pt(gy)],Ro.prototype,"strokeOpacity",2),y([Pt(Xl)],Ro.prototype,"strokeWidth",2),y([Pt(Lj)],Ro.prototype,"lineDash",2),y([Pt(Xl)],Ro.prototype,"lineDashOffset",2),y([Pt(gy)],Ro.prototype,"tension",2),y([Pt(kj,{optional:!0})],Ro.prototype,"itemStyler",2);var Pa=class extends Aj{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}};y([Pt(Xl)],Pa.prototype,"spacing",2),y([Pt(Xl)],Pa.prototype,"width",2),y([Pt(vv,{optional:!0})],Pa.prototype,"fill",2),y([Pt(gy)],Pa.prototype,"fillOpacity",2),y([Pt(vv,{optional:!0})],Pa.prototype,"stroke",2),y([Pt(gy)],Pa.prototype,"strokeOpacity",2),y([Pt(Xl)],Pa.prototype,"strokeWidth",2),y([Pt(Lj)],Pa.prototype,"lineDash",2),y([Pt(Xl)],Pa.prototype,"lineDashOffset",2),y([Pt(kj,{optional:!0})],Pa.prototype,"itemStyler",2);var ys=class extends $rt{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.fills=[],this.strokes=[],this.label=new WT,this.link=new Ro,this.node=new Pa,this.tooltip=new Krt}};y([Pt(Zl)],ys.prototype,"fromKey",2),y([Pt(Zl)],ys.prototype,"toKey",2),y([Pt(Zl)],ys.prototype,"idKey",2),y([Pt(Zl,{optional:!0})],ys.prototype,"idName",2),y([Pt(Zl,{optional:!0})],ys.prototype,"labelKey",2),y([Pt(Zl,{optional:!0})],ys.prototype,"labelName",2),y([Pt(Zl,{optional:!0})],ys.prototype,"sizeKey",2),y([Pt(Zl,{optional:!0})],ys.prototype,"sizeName",2),y([Pt(Xrt,{optional:!0})],ys.prototype,"nodes",2),y([Pt(Dj)],ys.prototype,"fills",2),y([Pt(Dj)],ys.prototype,"strokes",2),y([Pt(Mv)],ys.prototype,"label",2),y([Pt(Mv)],ys.prototype,"link",2),y([Pt(Mv)],ys.prototype,"node",2),y([Pt(Mv)],ys.prototype,"tooltip",2);var{SeriesNodePickMode:Tj,CachedTextMeasurerPool:Qrt,TextWrapper:qrt,TextUtils:Jrt,createDatumId:Iv,angleBetween:Av,normalizeAngle360:tlt,isBetweenAngles:Cj,Sector:elt,evaluateBezier:Dv,applyShapeStyle:ilt}=Rrt._ModuleSupport,kv=t=>t.startAngle+Av(t.startAngle,t.endAngle)/2,UT=class extends GT{constructor(t){super({moduleCtx:t,pickModes:[Tj.NEAREST_NODE,Tj.EXACT_SHAPE_MATCH]}),this.properties=new ys}isLabelEnabled(){return(this.properties.labelKey!=null||this.nodes==null)&&this.properties.label.enabled}linkFactory(){return new _r}nodeFactory(){return new elt}createNodeData(){const{id:t,_nodeDataDependencies:{seriesRectWidth:e,seriesRectHeight:i}={seriesRectWidth:0,seriesRectHeight:0}}=this,{fromKey:s,toKey:n,sizeKey:a,label:{spacing:o,maxWidth:r,fontSize:l},node:{width:c,spacing:h}}=this.properties,u=e/2,d=i/2;let p=[];const{nodeGraph:g,links:f}=this.getNodeGraph(P=>({...P,centerX:u,centerY:d,innerRadius:NaN,outerRadius:NaN,startAngle:NaN,endAngle:NaN}),P=>({...P,centerX:u,centerY:d,radius:NaN,startAngle1:NaN,endAngle1:NaN,startAngle2:NaN,endAngle2:NaN}),{includeCircularReferences:!0});let x=0;g.forEach(({datum:P,linksBefore:j,linksAfter:F},V)=>{const W=j.reduce((H,{link:G})=>H+G.size,0)+F.reduce((H,{link:G})=>H+G.size,0);if(W===0)g.delete(V);else{P.size=W,x+=P.size;const H=this.getLabelText(this.properties.label,{datum:P.datum,value:P.label,fromKey:s,toKey:n,sizeKey:a,size:P.size});P.label=String(H)}});let m=0;if(this.isLabelEnabled()){const P=this.properties.label.getFont();let j=0;g.forEach(({datum:F})=>{const{id:V,label:W}=F;if(W==null)return;const H=qrt.wrapText(W,{maxWidth:r,font:this.properties.label,textWrap:"never"}),{width:G}=Qrt.measureText(H,{font:P,textAlign:"left",textBaseline:"middle"});j=Math.max(G,j),p.push({id:V,text:H,centerX:u,centerY:d,angle:NaN,radius:NaN})}),m=j+o}const b=g.size;let v=Math.min(e,i)/2-c-m,S=h/v;if(m!==0&&(b*S>=1.5*Math.PI||v<=0)&&(p=[],v=Math.min(e,i)/2-c,S=h/v),b*S>=2*Math.PI||v<=0){Gt.warnOnce("There was insufficient space to display the Chord Series.");return}const A=v,T=v+c,D=Math.max((2*Math.PI-b*S)/x,0);let L=0;g.forEach(({datum:P})=>{P.innerRadius=A,P.outerRadius=T,P.startAngle=L,P.endAngle=L+P.size*D,L=P.endAngle+S;const j=(P.innerRadius+P.outerRadius)/2,F=kv(P);P.midPoint={x:P.centerX+j*Math.cos(F),y:P.centerY+j*Math.sin(F)}});const C=[];g.forEach(({datum:P,linksBefore:j,linksAfter:F})=>{const V=kv(P),W=[...j.map(G=>({link:G.link,distance:Av(kv(G.node.datum),V),after:!1})),...F.map(G=>({link:G.link,distance:Av(kv(G.node.datum),V),after:!0}))];let H=P.startAngle;W.toSorted((G,B)=>G.distance-B.distance).forEach(({link:G,after:B})=>{const z=G.size*D;B?(G.startAngle1=H,G.endAngle1=H+z):(G.startAngle2=H,G.endAngle2=H+z),H+=G.size*D}),C.push(P)});const{tension:O}=this.properties.link;f.forEach(P=>{P.radius=v;const j=Sv({radius:v,startAngle:P.startAngle1,endAngle:P.endAngle2,tension:O}),F=Sv({radius:v,startAngle:P.startAngle2,endAngle:P.endAngle1,tension:O}),V=Dv(...j.x,.5),W=Dv(...j.y,.5),H=Dv(...F.x,.5),G=Dv(...F.y,.5);P.midPoint={x:P.centerX+(V+H)/2,y:P.centerY+(W+G)/2},C.push(P)}),p.forEach(P=>{const j=g.get(P.id)?.datum;j!=null&&(P.radius=T+o,P.angle=tlt(j.startAngle+Av(j.startAngle,j.endAngle)/2))}),p.sort((P,j)=>P.angle-j.angle);let _=1/0,N=-1/0;return p=p.filter(P=>{const j=Jrt.getLineHeight(l),F=Math.atan2(j/2,P.radius),V=P.angle-F,W=P.angle+F;return Cj(_,V,W)||Cj(N,V,W)?!1:(_=Math.min(V,_),N=Math.max(W,N),!0)}),{itemId:t,nodeData:C,labelData:p}}updateLabelSelection(t){const e=this.isLabelEnabled()?t.labelData:[];return t.labelSelection.update(e)}updateLabelNodes(t){const{labelSelection:e}=t,{color:i,fontStyle:s,fontWeight:n,fontSize:a,fontFamily:o}=this.properties.label;e.each((r,{text:l,centerX:c,centerY:h,radius:u,angle:d})=>{r.visible=!0,r.translationX=c+u*Math.cos(d),r.translationY=h+u*Math.sin(d),r.text=l,r.fill=i,r.fontStyle=s,r.fontWeight=n,r.fontSize=a,r.fontFamily=o,r.textBaseline="middle",Math.cos(d)>=0?(r.textAlign="left",r.rotation=d):(r.textAlign="right",r.rotation=d-Math.PI)})}updateNodeSelection(t){return t.datumSelection.update(t.nodeData,void 0,e=>Iv([e.type,e.id]))}getBaseNodeStyle(t){const{properties:e}=this,{fill:i,fillOpacity:s,stroke:n,strokeOpacity:a,lineDash:o,lineDashOffset:r}=e.node,l=t?e.highlightStyle.item:void 0;return{fill:l?.fill??i,fillOpacity:l?.fillOpacity??s,stroke:l?.stroke??n,strokeOpacity:l?.strokeOpacity??a,strokeWidth:l?.strokeWidth??this.getStrokeWidth(e.node.strokeWidth),lineDash:l?.lineDash??o,lineDashOffset:l?.lineDashOffset??r}}getNodeStyleOverrides(t,e,i,s,n,a,o){const{id:r,properties:l}=this,{fills:c,strokes:h}=l,{itemStyler:u}=l.node,d=a.fill??c[i%c.length],p=a.stroke??h[i%h.length],g={};if(o||(g.fill=d,g.stroke=p),u!=null){const f=this.cachedDatumCallback(Iv(t,o?"highlight":"node"),()=>{const{fillOpacity:x=1,strokeOpacity:m=1,strokeWidth:b=0,lineDash:v=[],lineDashOffset:S=0}=a;return u({seriesId:r,datum:e,highlighted:o,label:n,size:s,fill:d,fillOpacity:x,stroke:p,strokeOpacity:m,strokeWidth:b,lineDash:v,lineDashOffset:S})});Object.assign(g,f)}return g}updateNodeNodes(t){const{datumSelection:e,isHighlight:i}=t,s=this.getBaseNodeStyle(i);e.each((n,a)=>{const{datumIndex:o,size:r,label:l}=a,c=this.getNodeStyleOverrides(String(o),a,o.index,r,l,s,i);n.centerX=a.centerX,n.centerY=a.centerY,n.innerRadius=a.innerRadius,n.outerRadius=a.outerRadius,n.startAngle=a.startAngle,n.endAngle=a.endAngle,n.fill=c.fill??s?.fill,n.fillOpacity=c.fillOpacity??s?.fillOpacity,n.stroke=c.stroke??s?.stroke,n.strokeOpacity=c.strokeOpacity??s?.strokeOpacity,n.strokeWidth=c.strokeWidth??s?.strokeWidth,n.lineDash=c.lineDash??s?.lineDash,n.lineDashOffset=c.lineDashOffset??s?.lineDashOffset,n.inset=n.strokeWidth/2})}updateLinkSelection(t){return t.datumSelection.update(t.nodeData,void 0,e=>Iv([e.type,e.index,e.fromNode.id,e.toNode.id]))}getBaseLinkStyle(t){const{properties:e}=this,{fill:i,fillOpacity:s,stroke:n,strokeOpacity:a,lineDash:o,lineDashOffset:r,tension:l}=e.link,c=t?e.highlightStyle.item:void 0;return{fill:c?.fill??i,fillOpacity:c?.fillOpacity??s,stroke:c?.stroke??n,strokeOpacity:c?.strokeOpacity??a,strokeWidth:c?.strokeWidth??this.getStrokeWidth(e.link.strokeWidth),lineDash:c?.lineDash??o,lineDashOffset:c?.lineDashOffset??r,tension:l}}getLinkStyleOverrides(t,e,i,s,n){const{id:a,properties:o}=this,{fills:r,strokes:l}=o,{itemStyler:c}=o.link,h=s.fill??r[i%r.length],u=s.stroke??l[i%l.length],d={};if(n||(d.fill=h,d.stroke=u),c!=null){const p=this.cachedDatumCallback(Iv(t,n?"highlight":"node"),()=>{const{fillOpacity:g=1,strokeOpacity:f=1,strokeWidth:x=0,lineDash:m=[],lineDashOffset:b=0,tension:v}=s;return c({seriesId:a,datum:e,highlighted:n,tension:v,fill:h,fillOpacity:g,stroke:u,strokeOpacity:f,strokeWidth:x,lineDash:m,lineDashOffset:b})});Object.assign(d,p)}return d}updateLinkNodes(t){const{datumSelection:e,isHighlight:i}=t,s=this.getBaseLinkStyle(i);e.each((n,a)=>{const{datumIndex:o}=a,r=a.fromNode.datumIndex,l=this.getLinkStyleOverrides(String(o),a,r.index,s,i);n.centerX=a.centerX,n.centerY=a.centerY,n.radius=a.radius,n.startAngle1=a.startAngle1,n.endAngle1=a.endAngle1,n.startAngle2=a.startAngle2,n.endAngle2=a.endAngle2,ilt(n,s,l),n.tension=l?.tension??s.tension})}getTooltipContent(t){const{id:e,linksProcessedData:i,nodesProcessedData:s,properties:n}=this,{fromKey:a,toKey:o,sizeKey:r,sizeName:l,tooltip:c}=n,{datumIndex:h}=t,u=t.type===0?t.fromNode.index:t.index,d=t.type===0?`${t.fromNode.label} - ${t.toNode.label}`:t.label,p=h.type===0?i?.dataSources.get(this.id)?.[h.index]:s?.dataSources.get(this.id)?.[h.index],g=t.size;let f;if(t.type===0){const x=t.fromNode.datumIndex,m=this.getBaseLinkStyle(!1);Object.assign(m,this.getLinkStyleOverrides(String(h),p,x.index,m,!1)),f=m}else{const x=t.label,m=this.getBaseNodeStyle(!1);Object.assign(m,this.getNodeStyleOverrides(String(h),p,h.index,g,x,m,!1)),f=m}return c.formatTooltip({title:d,symbol:this.legendItemSymbol(t.type,u,f),data:r!=null?[{label:l,fallbackLabel:r,value:String(g)}]:[]},{seriesId:e,datum:p,title:d,fromKey:a,toKey:o,sizeKey:r,sizeName:l,size:g,...f})}computeFocusBounds(t){return t}};UT.className="ChordSeries",UT.type="chord";var slt={type:"series",optionsKey:"series[]",packageType:"enterprise",chartTypes:["flow-proportion"],solo:!0,identifier:"chord",tooltipDefaults:{range:"exact"},moduleFactory:t=>new UT(t),themeTemplate:{series:{highlightStyle:{series:{dimOpacity:.2}},label:{fontFamily:{$ref:"fontFamily"},fontSize:{$ref:"fontSize"},fontWeight:{$ref:"fontWeight"},color:{$ref:"textColor"},spacing:5,maxWidth:100},node:{spacing:8,width:10,strokeWidth:0},link:{fillOpacity:.5,strokeWidth:0,tension:.4}},legend:{enabled:!1,toggleSeries:!1}},paletteFactory({takeColors:t,colorsCount:e}){const{fills:i,strokes:s}=t(e);return{fills:i,strokes:s}}},nlt=(R(),E(w)),alt=(R(),E(w)),{ThemeConstants:{CARTESIAN_AXIS_TYPE:sp,CARTESIAN_POSITION:np},ThemeSymbols:{DEFAULT_SHADOW_COLOUR:olt}}=alt._ModuleSupport;function Nj(t){const{placement:e,...i}=t?.stageLabel??{};return t?.direction!=="horizontal"?[{type:sp.CATEGORY,position:e==="after"?np.RIGHT:np.LEFT,label:i},{type:sp.NUMBER,position:np.BOTTOM}]:[{type:sp.NUMBER,position:np.LEFT},{type:sp.CATEGORY,position:e==="before"?np.TOP:np.BOTTOM,label:i}]}var rlt={series:{direction:"vertical",strokeWidth:0,spacingRatio:.25,label:{enabled:!0,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"backgroundColor"}},dropOff:{enabled:!0,fillOpacity:.2,strokeWidth:0},shadow:{enabled:!1,color:olt,xOffset:3,yOffset:3,blur:5}},axes:{[sp.NUMBER]:{nice:!1,gridLine:{enabled:!1},crosshair:{enabled:!1},label:{enabled:!1,formatter(t){return Math.abs(t.value).toFixed(t.fractionDigits??0)}}},[sp.CATEGORY]:{line:{enabled:!1}}}},llt=(R(),E(w)),HT=(R(),E(w)),clt=(R(),E(w)),{lineDistanceSquared:Lv,BBox:hlt,Path:ult,ScenePathChangeDetection:Ql}=clt._ModuleSupport,Oj=1e-6;function wj([t,e],[i,s]){return Math.abs(t-i)<=Oj&&Math.abs(e-s)<=Oj}var _o=class extends ult{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:t,y0:e,x1:i,y1:s,x2:n,y2:a,x3:o,y3:r}=this;return{x:(t+i+n+o)/4,y:(e+s+a+r)/4}}distanceSquared(t,e){if(this.containsPoint(t,e))return 0;const{x0:i,y0:s,x1:n,y1:a,x2:o,y2:r,x3:l,y3:c}=this;return Math.min(Lv(t,e,i,s,n,a,1/0),Lv(t,e,n,a,o,r,1/0),Lv(t,e,o,r,l,c,1/0),Lv(t,e,l,c,i,s,1/0))}computeBBox(){const{x0:t,y0:e,x1:i,y1:s,x2:n,y2:a,x3:o,y3:r}=this,l=Math.min(t,i,n,o),c=Math.max(t,i,n,o)-l,h=Math.min(e,s,a,r),u=Math.max(e,s,a,r)-h;return new hlt(l,h,c,u)}updatePath(){const{path:t,x0:e,y0:i,x1:s,y1:n,x2:a,y2:o,x3:r,y3:l}=this,c=[[e,i],[s,n],[a,o],[r,l]];t.clear();let h,u;c.forEach(d=>{if(h!=null&&wj(h,d)||u!=null&&wj(u,d))return;const[p,g]=d;h==null?t.moveTo(p,g):t.lineTo(p,g),h??(h=d),u=d}),t.closePath()}};y([Ql()],_o.prototype,"x0",2),y([Ql()],_o.prototype,"y0",2),y([Ql()],_o.prototype,"x1",2),y([Ql()],_o.prototype,"y1",2),y([Ql()],_o.prototype,"x2",2),y([Ql()],_o.prototype,"y2",2),y([Ql()],_o.prototype,"x3",2),y([Ql()],_o.prototype,"y3",2);var dlt=(R(),E(w)),{NODE_UPDATE_STATE_TO_PHASE_MAPPING:plt}=dlt._ModuleSupport;function Ej(t,e,i,s){const{x0:n,y0:a,x1:o,y1:r,x2:l,y2:c,x3:h,y3:u,opacity:d}=t;return i?{x0:(n+h)/2,y0:(a+u)/2,x1:(o+l)/2,y1:(r+c)/2,x2:(o+l)/2,y2:(r+c)/2,x3:(n+h)/2,y3:(a+u)/2,opacity:d}:{x0:(n+o)/2,y0:(a+r)/2,x1:(n+o)/2,y1:(a+r)/2,x2:(l+h)/2,y2:(c+u)/2,x3:(l+h)/2,y3:(c+u)/2,opacity:d}}function glt(t,e){const i=a=>a==null;return{fromFn:(a,o,r)=>{r==="updated"&&i(o)?r="removed":r==="updated"&&i(a.previousDatum)&&(r="added");let l;r==="added"&&a.previousDatum==null&&e==="fade"?l={...fy(a,o),opacity:0}:r==="unknown"||r==="added"?l=Ej(o,a.previousDatum,t,e):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=plt[r];return{...l,phase:c}},toFn:(a,o,r)=>{let l;return r==="removed"&&a.datum==null&&e==="fade"?l={...fy(a,o),opacity:0}:r==="removed"||i(o)?l=Ej(o,a.previousDatum,t,e):l=fy(a,o),l}}}function fy(t,e){const{x0:i,y0:s,x1:n,y1:a,x2:o,y2:r,x3:l,y3:c,opacity:h}=e;return{x0:i,y0:s,x1:n,y1:a,x2:o,y2:r,x3:l,y3:c,opacity:h}}var{SeriesNodePickMode:Rj,SeriesZIndexMap:_j,valueProperty:flt,keyProperty:ylt,ChartAxisDirection:Pj,updateLabelNode:mlt,SMALLEST_KEY_INTERVAL:xlt,LARGEST_KEY_INTERVAL:blt,diff:Slt,fixNumericExtent:vlt,seriesLabelFadeInAnimation:Bj,resetMotion:Mlt,resetLabelFn:Ilt,animationValidation:Alt,computeBarFocusBounds:Dlt,ContinuousScale:klt,Group:Llt,Selection:Tlt,PointerEvents:zj,motion:Clt,checkCrisp:Nlt,createDatumId:Olt}=HT._ModuleSupport,wlt=class extends HT._ModuleSupport.SeriesNodeEvent{constructor(t,e,i,s){super(t,e,i,s),this.xKey=s.properties.stageKey,this.yKey=s.properties.valueKey}},Fj=class extends HT._ModuleSupport.AbstractBarSeries{constructor({moduleCtx:t,animationResetFns:e}){super({moduleCtx:t,pickModes:[Rj.AXIS_ALIGNED,Rj.EXACT_SHAPE_MATCH],hasHighlightedLabels:!0,directionKeys:{x:["stageKey"],y:["valueKey"]},directionNames:{x:[],y:[]},datumSelectionGarbageCollection:!1,animationResetFns:{datum:e.datum,label:Ilt}}),this.NodeEvent=wlt,this.connectorNodeGroup=this.contentGroup.appendChild(new Llt({name:`${this.id}-series-connectorNodes`,zIndex:_j.BACKGROUND})),this.connectorSelection=Tlt.select(this.connectorNodeGroup,()=>this.connectionFactory()),this.connectorNodeGroup.pointerEvents=zj.None}get pickModeAxis(){return"main-category"}setSeriesIndex(t){return super.setSeriesIndex(t)?(this.connectorNodeGroup.zIndex=[_j.BACKGROUND,t],!0):!1}isVertical(){return!super.isVertical()}connectionFactory(){return new _o}async processData(t){if(!this.properties.isValid())return;const{stageKey:e,valueKey:i}=this.properties,{visible:s,id:n}=this,a=(g,f,x)=>s&&this.ctx.legendManager.getItemEnabled({seriesId:n,itemId:x}),o=this.getCategoryAxis()?.scale,r=this.getValueAxis()?.scale,{isContinuousX:l,xScaleType:c,yScaleType:h}=this.getScaleInformation({xScale:o,yScale:r}),u=[];this.ctx.animationManager.isSkipped()||(this.processedData&&u.push(Slt(this.id,this.processedData)),u.push(Alt()));const d=this.visible?{}:{forceValue:0},{processedData:p}=await this.requestDataModel(t,this.data,{props:[ylt(e,c,{id:"xValue"}),flt(i,h,{id:"yValue",...d,validation:a,invalidValue:0}),...l?[xlt,blt]:[],...u],groupByKeys:!1});this.smallestDataInterval=p.reduced?.smallestKeyInterval,this.largestDataInterval=p.reduced?.largestKeyInterval,this.animationState.transition("updateData")}getSeriesDomain(t){const{processedData:e,dataModel:i,id:s,ctx:{legendManager:n}}=this;if(!e||!i)return[];const{keys:[a]}=e.domain;if(t===this.getCategoryDirection()){const o=i.resolveProcessedDataDefById(this,"xValue");return o?.def.type==="key"&&o?.def.valueType==="category"?this.hasData?a.filter((r,l)=>n.getItemEnabled({seriesId:s,itemId:l})):[]:this.padBandExtent(a)}else{const o=this.domainForClippedRange(Pj.Y,["yValue"],"xValue",!0),r=Math.max(...o),l=[-r,r];return vlt(l)}}getSeriesRange(t,e){return[NaN,NaN]}createNodeData(){const{hasData:t,data:e,dataModel:i,groupScale:s,processedData:n,id:a,ctx:{legendManager:o}}=this,r=this.getCategoryAxis(),l=this.getValueAxis();if(!(t&&e&&r&&l&&i&&n?.type==="ungrouped"))return;const c=r.scale,h=l.scale,u=this.getBarDirection()===Pj.X,{stageKey:d,valueKey:p}=this.properties,{strokeWidth:g}=this.barStyle(),f=`${p}`,x={itemId:f,nodeData:[],labelData:[],connectorData:[],scales:this.calculateScaling(),visible:this.visible},m=this.visible;if(!m)return x;const b=i.resolveKeysById(this,"xValue",n),v=i.resolveColumnById(this,"yValue",n),{barWidth:S,groupIndex:A}=this.updateGroupScale(r),T=klt.is(c)?S*-.5:0,D=Nlt(r?.scale,r?.visibleRange,this.smallestDataInterval,this.largestDataInterval);let L;return(n.dataSources.get(this.id)??[]).forEach((O,_)=>{const N=m&&o.getItemEnabled({seriesId:a,itemId:_}),P=b[_];if(P==null)return;const j=Math.round(c.convert(P))+s.convert(String(A))+T,F=v[_],V=Math.round(h.convert(-F)),W=Math.round(h.convert(F)),H=Math.max(g,Math.abs(W-V)),G={x:u?Math.min(W,V):j,y:u?j:Math.min(W,V),width:u?H:S,height:u?S:H},B={x:G.x+G.width/2,y:G.y+G.height/2},z=this.createLabelData({datumIndex:_,rect:G,barAlongX:u,yDatum:F,datum:O,visible:N}),U={index:_,series:this,itemId:f,datum:O,datumIndex:_,xValue:P,yValue:F,xKey:d,yKey:p,x:G.x,y:G.y,width:G.width,height:G.height,midPoint:B,strokeWidth:g,crisp:D,label:z,visible:N};if(x.nodeData.push(U),z!=null&&x.labelData.push(z),L!=null){const Y=L.rect,K=L.nodeDatum,Z=L.datumIndex;u?x.connectorData.push({datum:K,datumIndex:Z,x0:Y.x,y0:Y.y+Y.height,x1:Y.x+Y.width,y1:Y.y+Y.height,x2:G.x+G.width,y2:G.y,x3:G.x,y3:G.y,opacity:1}):x.connectorData.push({datum:K,datumIndex:Z,x0:Y.x+Y.width,y0:Y.y,x1:G.x,y1:G.y,x2:G.x,y2:G.y+G.height,x3:Y.x+Y.width,y3:Y.y+Y.height,opacity:1})}N&&(L={itemId:f,rect:G,nodeDatum:U,datumIndex:_})}),x}updateNodes(t,e,i){super.updateNodes(t,e,i);const{connectorSelection:s}=this,n=this.contextNodeData?.connectorData??[];this.connectorSelection=this.updateConnectorSelection({connectorSelection:s,connectorData:n}),this.updateConnectorNodes({connectorSelection:s})}updateDatumSelection(t){const{nodeData:e,datumSelection:i}=t,s=e??[];return i.update(s,void 0,n=>this.getDatumId(n))}updateConnectorSelection(t){const{connectorData:e,connectorSelection:i}=t;return i.update(this.connectorEnabled()?e:[],void 0,s=>this.getDatumId(s.datum))}updateConnectorNodes(t){const{fills:e,strokes:i}=this.properties,{fill:s,fillOpacity:n,stroke:a,strokeOpacity:o,strokeWidth:r,lineDash:l,lineDashOffset:c}=this.connectorStyle();t.connectorSelection.each((h,u)=>{const{datumIndex:d}=u;h.setProperties(fy(h,u)),h.fill=s??e[d%e.length],h.fillOpacity=n,h.stroke=a??i[d%i.length],h.strokeOpacity=o,h.strokeWidth=r,h.lineDash=l,h.lineDashOffset=c})}getHighlightLabelData(t,e){const i=t.filter(s=>s.datum===e.datum);return i.length>0?i:void 0}updateLabelSelection(t){const e=this.properties.label.enabled?t.labelData:[];return t.labelSelection.update(e,i=>{i.pointerEvents=zj.None})}updateLabelNodes(t){t.labelSelection.each((e,i)=>{mlt(e,this.properties.label,i)})}getTooltipContent(t){const{id:e,dataModel:i,processedData:s,properties:n}=this,{stageKey:a,valueKey:o,tooltip:r}=n,l=this.getCategoryAxis(),c=this.getValueAxis();if(!i||!s||!l||!c)return;const{datumIndex:h}=t,u=s.dataSources.get(this.id)?.[h],d=i.resolveKeysById(this,"xValue",s)[h],p=i.resolveColumnById(this,"yValue",s)[h];if(d!=null)return r.formatTooltip({symbol:this.legendItemSymbol(h),data:[{label:l.formatDatum(d),value:c.formatDatum(p)}]},{seriesId:e,datum:u,title:a,stageKey:a,valueKey:o,...this.tooltipStyle(u,h)})}resetAllAnimation(t){super.resetAllAnimation(t),Mlt([this.connectorSelection],fy)}animateEmptyUpdateReady({labelSelection:t}){const{connectorSelection:e}=this,i=this.isVertical(),n=glt(i,"normal");Clt.fromToMotion(this.id,"connectors",this.ctx.animationManager,[e],n),Bj(this,"labels",this.ctx.animationManager,t)}animateWaitingUpdateReady(t){const{labelSelection:e}=t;this.ctx.animationManager.stopByAnimationGroupId(this.id),Bj(this,"labels",this.ctx.animationManager,e)}getDatumId(t){return Olt(t.xValue)}isLabelEnabled(){return this.properties.label.enabled}computeFocusBounds({datumIndex:t}){return Dlt(this,this.contextNodeData?.nodeData[t])}legendItemSymbol(t){const{strokeWidth:e,fillOpacity:i,strokeOpacity:s,lineDash:n,lineDashOffset:a}=this.barStyle(),{fills:o,strokes:r}=this.properties,l=o[t%o.length]??"black",c=r[t%r.length]??"black";return{marker:{fill:l,fillOpacity:i,stroke:c,strokeWidth:e,strokeOpacity:s,lineDash:n,lineDashOffset:a}}}getLegendData(t){const{id:e,processedData:i,dataModel:s,ctx:{legendManager:n},visible:a}=this;if(!s||!i||t!=="category"||!this.properties.isValid())return[];const{showInLegend:o}=this.properties,r=s.resolveKeysById(this,"xValue",i);return(i.dataSources.get(this.id)??[]).map((l,c)=>{const h=r[c];if(h!=null)return{legendType:"category",id:e,datum:l,itemId:c,seriesId:e,enabled:a&&n.getItemEnabled({seriesId:e,itemId:c}),label:{text:String(h)},symbol:this.legendItemSymbol(c),skipAnimations:!0,hideInLegend:!o}}).filter(l=>l!=null)}},Elt=(R(),E(w)),{Label:Rlt,AbstractBarSeriesProperties:_lt,SeriesTooltip:Plt,AxisLabel:Blt,Validate:Os,UNION:jj,COLOR_STRING_ARRAY:Vj,LINE_DASH:zlt,OBJECT:YT,POSITIVE_NUMBER:KT,RATIO:Gj,STRING:Wj}=Elt._ModuleSupport,$T=class extends Rlt{constructor(){super(...arguments),this.spacing=0}};y([Os(jj(["before","middle","after"],"a placement"))],$T.prototype,"placement",2),y([Os(KT)],$T.prototype,"spacing",2);var Uj=class extends Blt{};y([Os(jj(["before","after"],"a placement"))],Uj.prototype,"placement",2);var Ln=class extends _lt{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 $T,this.stageLabel=new Uj,this.tooltip=new Plt}};y([Os(Wj)],Ln.prototype,"stageKey",2),y([Os(Wj)],Ln.prototype,"valueKey",2),y([Os(Vj)],Ln.prototype,"fills",2),y([Os(Gj)],Ln.prototype,"fillOpacity",2),y([Os(Vj)],Ln.prototype,"strokes",2),y([Os(KT)],Ln.prototype,"strokeWidth",2),y([Os(Gj)],Ln.prototype,"strokeOpacity",2),y([Os(zlt)],Ln.prototype,"lineDash",2),y([Os(KT)],Ln.prototype,"lineDashOffset",2),y([Os(YT)],Ln.prototype,"label",2),y([Os(YT)],Ln.prototype,"stageLabel",2),y([Os(YT)],Ln.prototype,"tooltip",2);function Hj(t,{x:e,y:i,width:s,height:n,opacity:a}){return{x1:e,y1:i,x2:e+s,y2:i+n,opacity:a}}var{formatValue:Flt,Line:jlt}=llt._ModuleSupport,XT=class extends Fj{constructor(t){super({moduleCtx:t,animationResetFns:{datum:Hj}}),this.properties=new Ln}get hasData(){const{id:t,ctx:{legendManager:e}}=this,i=this.data?.reduce((s,n,a)=>s+(e.getItemEnabled({seriesId:t,itemId:a})?1:0),0);return i!=null&&i>1}getBandScalePadding(){return{inner:1,outer:0}}connectorEnabled(){return!0}barStyle(){return{fillOpacity:1,strokeOpacity:1,strokeWidth:0,lineDash:[],lineDashOffset:0}}connectorStyle(){const{fillOpacity:t,strokeOpacity:e,strokeWidth:i,lineDash:s,lineDashOffset:n}=this.properties;return{fillOpacity:t,strokeOpacity:e,strokeWidth:i,lineDash:s,lineDashOffset:n}}nodeFactory(){return new jlt}createLabelData({datumIndex:t,rect:e,barAlongX:i,yDatum:s,datum:n,visible:a}){const{stageKey:o,valueKey:r,label:l}=this.properties,{spacing:c,placement:h}=l;let u,d,p,g;if(i)switch(u=e.x+e.width/2,p="center",h){case"before":d=e.y-c,g="bottom";break;case"after":d=e.y+e.height+c,g="top";break;default:d=e.y+e.height/2,g="middle"}else switch(d=e.y+e.height/2,g="middle",h){case"before":u=e.x-c,p="right";break;case"after":u=e.x+e.width+c,p="left";break;default:u=e.x+e.width/2,p="center"}return{x:u,y:d,textAlign:p,textBaseline:g,text:this.getLabelText(l,{itemId:r,value:s,datum:n,stageKey:o,valueKey:r},f=>Flt(f,0)),itemId:r,datum:n,datumIndex:t,series:this,visible:a}}updateDatumNodes(t){const e=t.isHighlight?this.properties.highlightStyle.item:void 0;t.datumSelection.each((i,s)=>{i.setProperties(Hj(i,s)),i.stroke=e?.stroke,i.strokeWidth=e?.strokeWidth??0,i.strokeOpacity=e?.strokeOpacity??1,i.lineDash=e?.lineDash,i.lineDashOffset=e?.lineDashOffset??0})}tooltipStyle(t,e){const{fills:i,strokes:s}=this.properties,n=i[e%i.length]??"black",a=s[e%s.length]??"black",{fillOpacity:o,strokeOpacity:r,strokeWidth:l,lineDash:c,lineDashOffset:h}=this.barStyle();return{fill:n,fillOpacity:o,stroke:a,strokeOpacity:r,strokeWidth:l,lineDash:c,lineDashOffset:h}}};XT.className="ConeFunnelSeries",XT.type="cone-funnel";var Vlt=(R(),E(w)),{ThemeConstants:{CARTESIAN_AXIS_TYPE:Yj}}=Vlt._ModuleSupport,Glt={series:{direction:"vertical",strokeWidth:0,label:{enabled:!0,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"textColor"},placement:"before",spacing:4}},seriesArea:{padding:{top:20,bottom:20}},axes:{[Yj.NUMBER]:{nice:!1,gridLine:{enabled:!1},crosshair:{enabled:!1},label:{enabled:!1,formatter(t){return Math.abs(t.value).toFixed(t.fractionDigits??0)}}},[Yj.CATEGORY]:{line:{enabled:!1}}}},Wlt={type:"series",optionsKey:"series[]",packageType:"enterprise",chartTypes:["cartesian"],identifier:"cone-funnel",moduleFactory:t=>new XT(t),solo:!0,tooltipDefaults:{range:"nearest"},defaultAxes:Nj,themeTemplate:Glt,paletteFactory:({userPalette:t,themeTemplateParameters:e,takeColors:i,colorsCount:s})=>{const{fills:n}=i(s),a=e.get(nlt._ModuleSupport.ThemeSymbols.DEFAULT_FUNNEL_SERIES_COLOR_RANGE),o=t==="inbuilt"?a:[n[0],n[1]];return{fills:o,strokes:o.slice(0)}}},Ult=(R(),E(w)),Hlt=(R(),E(w)),{Label:Ylt,DropShadow:Klt,AbstractBarSeriesProperties:$lt,BaseProperties:Xlt,SeriesTooltip:Zlt,AxisLabel:Qlt,Validate:me,UNION:qlt,BOOLEAN:Jlt,COLOR_STRING_ARRAY:Kj,COLOR_STRING:$j,FUNCTION:tct,LINE_DASH:Xj,OBJECT:yy,POSITIVE_NUMBER:Tv,RATIO:my,STRING:Zj}=Hlt._ModuleSupport,ect=class extends Ylt{},Qj=class extends Qlt{};y([me(qlt(["before","after"],"a placement"))],Qj.prototype,"placement",2);var Pr=class extends Xlt{constructor(){super(...arguments),this.enabled=!0,this.fillOpacity=1,this.strokeWidth=1,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0}};y([me(Jlt)],Pr.prototype,"enabled",2),y([me($j,{optional:!0})],Pr.prototype,"fill",2),y([me(my)],Pr.prototype,"fillOpacity",2),y([me($j,{optional:!0})],Pr.prototype,"stroke",2),y([me(Tv)],Pr.prototype,"strokeWidth",2),y([me(my)],Pr.prototype,"strokeOpacity",2),y([me(Xj)],Pr.prototype,"lineDash",2),y([me(Tv)],Pr.prototype,"lineDashOffset",2);var Ui=class extends $lt{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 Pr,this.shadow=new Klt().set({enabled:!1}),this.label=new ect,this.stageLabel=new Qj,this.tooltip=new Zlt}};y([me(Zj)],Ui.prototype,"stageKey",2),y([me(Zj)],Ui.prototype,"valueKey",2),y([me(Kj)],Ui.prototype,"fills",2),y([me(my)],Ui.prototype,"fillOpacity",2),y([me(Kj)],Ui.prototype,"strokes",2),y([me(Tv)],Ui.prototype,"strokeWidth",2),y([me(my)],Ui.prototype,"strokeOpacity",2),y([me(Xj)],Ui.prototype,"lineDash",2),y([me(Tv)],Ui.prototype,"lineDashOffset",2),y([me(my)],Ui.prototype,"spacingRatio",2),y([me(tct,{optional:!0})],Ui.prototype,"itemStyler",2),y([me(yy)],Ui.prototype,"dropOff",2),y([me(yy)],Ui.prototype,"shadow",2),y([me(yy)],Ui.prototype,"label",2),y([me(yy)],Ui.prototype,"stageLabel",2),y([me(yy)],Ui.prototype,"tooltip",2);var{ChartAxisDirection:ict,resetBarSelectionsFn:sct,prepareBarAnimationFunctions:qj,midpointStartingBarPosition:Jj,createDatumId:nct,formatValue:act,Rect:oct,motion:tV,applyShapeStyle:rct}=Ult._ModuleSupport,ZT=class extends Fj{constructor(t){super({moduleCtx:t,animationResetFns:{datum:sct}}),this.properties=new Ui}getBandScalePadding(){return{inner:this.properties.spacingRatio,outer:0}}connectorEnabled(){return this.properties.dropOff.enabled}barStyle(){const{fillOpacity:t,strokeOpacity:e,strokeWidth:i,lineDash:s,lineDashOffset:n}=this.properties;return{fillOpacity:t,strokeOpacity:e,strokeWidth:i,lineDash:s,lineDashOffset:n}}connectorStyle(){const{fill:t,fillOpacity:e,stroke:i,strokeOpacity:s,strokeWidth:n,lineDash:a,lineDashOffset:o}=this.properties.dropOff;return{fill:t,fillOpacity:e,stroke:i,strokeOpacity:s,strokeWidth:n,lineDash:a,lineDashOffset:o}}nodeFactory(){return new oct}createLabelData({datumIndex:t,rect:e,yDatum:i,datum:s,visible:n}){const{valueKey:a,stageKey:o,label:r}=this.properties;return{x:e.x+e.width/2,y:e.y+e.height/2,textAlign:"center",textBaseline:"middle",text:this.getLabelText(r,{itemId:o,value:i,datum:s,valueKey:a,stageKey:o},l=>act(l,0)),itemId:o,datum:s,datumIndex:t,series:this,visible:n}}getItemBaseStyle(t){const{properties:e}=this,i=t?e.highlightStyle.item:void 0;return{fill:i?.fill,fillOpacity:i?.fillOpacity??e.fillOpacity,stroke:i?.stroke,strokeWidth:i?.strokeWidth??this.getStrokeWidth(e.strokeWidth),strokeOpacity:i?.strokeOpacity??e.strokeOpacity,lineDash:i?.lineDash??e.lineDash,lineDashOffset:i?.lineDashOffset??e.lineDashOffset}}getItemStyleOverrides(t,e,i,s,n){const{id:a,properties:o}=this,{stageKey:r,valueKey:l,fills:c,strokes:h,itemStyler:u}=o,d=s.fill??c[i%c.length]??"black",p=s.stroke??h[i%h.length]??"black",g={};if(n||(g.fill=d,g.stroke=p),u!=null){const f=this.cachedDatumCallback(nct(t,n?"highlight":"node"),()=>{const{fillOpacity:x,strokeOpacity:m,strokeWidth:b,lineDash:v,lineDashOffset:S}=s;return u({seriesId:a,datum:e,highlighted:n,stageKey:r,valueKey:l,fill:d,fillOpacity:x,stroke:p,strokeOpacity:m,strokeWidth:b,lineDash:v,lineDashOffset:S})});Object.assign(g,f)}return g}updateDatumNodes(t){const{shadow:e}=this.properties,{datumSelection:i,isHighlight:s}=t,n=this.getCategoryDirection()===ict.X,a=this.getItemBaseStyle(s);i.each((o,r)=>{const{datumIndex:l}=r,c=this.getItemStyleOverrides(String(r.datumIndex),r.datum,l,a,s);rct(o,a,c),o.visible=n?r.width>0:r.height>0,o.crisp=r.crisp,o.fillShadow=e})}tooltipStyle(t,e){const i=this.getItemBaseStyle(!1);return Object.assign(i,this.getItemStyleOverrides(String(e),t,e,i,!1)),i}animateEmptyUpdateReady(t){super.animateEmptyUpdateReady(t);const{datumSelection:e}=t,i=this.isVertical(),n=qj(Jj(i,"normal"));tV.fromToMotion(this.id,"datums",this.ctx.animationManager,[e],n)}animateWaitingUpdateReady(t){super.animateWaitingUpdateReady(t);const{datumSelection:e}=t,{processedData:i}=this,s=i?.reduced?.diff?.[this.id],n=qj(Jj(this.isVertical(),"fade"));tV.fromToMotion(this.id,"datums",this.ctx.animationManager,[e],n,(a,o)=>o.xValue,s)}};ZT.className="FunnelSeries",ZT.type="funnel";var lct={type:"series",optionsKey:"series[]",packageType:"enterprise",chartTypes:["cartesian"],identifier:"funnel",moduleFactory:t=>new ZT(t),solo:!0,tooltipDefaults:{range:"exact"},defaultAxes:Nj,themeTemplate:rlt,paletteFactory:({takeColors:t})=>{const{fills:e,strokes:i}=t(1);return{fills:e,strokes:i}}},cct=(R(),E(w)),QT=(R(),E(w)),hct=(R(),E(w)),{CachedTextMeasurerPool:eV,TextUtils:iV,TextWrapper:Cv}=hct._ModuleSupport;function uct(t,e){const{fontSize:i,minimumFontSize:s=i}=t,{fontSize:n,minimumFontSize:a=n}=e,o=i-s,r=n-a;let l=t.fontSize,c=e.fontSize;const h=[{labelFontSize:i,secondaryLabelFontSize:n}];for(;l>s||c>a;){const u=o>0?(l-s)/o:-1,d=r>0?(c-a)/r:-1;u>d?l--:c--,h.push({labelFontSize:l,secondaryLabelFontSize:c})}return h.reverse(),h}function ap(t,e){return t.lineHeight!=null&&t.fontSize!=null?t.lineHeight*e/t.fontSize:iV.getLineHeight(e)}function sV(t,e,i,s,{padding:n},a){const{spacing:o=0}=e,r=2*n,l=2*n+o,c=(e.minimumFontSize??e.fontSize)+(s.minimumFontSize??s.fontSize);if(c>a(c+l,!1).height-l)return;const h=uct(e,s),u={fontFamily:e.fontFamily,fontSize:e.fontSize,fontStyle:e.fontStyle,fontWeight:e.fontWeight},d={fontFamily:s.fontFamily,fontSize:s.fontSize,fontStyle:s.fontStyle,fontWeight:s.fontWeight};let p,g;return NB(0,h.length-1,f=>{const{labelFontSize:x,secondaryLabelFontSize:m}=h[f],b=f===0,v=ap(e,x),S=ap(s,m),A=a(v+S+l,b),T=A.width-r,D=A.height-l;if(v+S>D||((p==null||p.fontSize!==x)&&(u.fontSize=x,p=aV(e,t,T,D,u,e.wrapping,b?e.overflowStrategy:"hide")),p==null||p.width>T||p.height>D)||((g==null||g.fontSize!==m)&&(d.fontSize=m,g=aV(s,i,T,D,d,s.wrapping,b?s.overflowStrategy:"hide")),g==null))return;const L=p.height+g.height;if(!(g.width>T||L>D))return{width:Math.max(p.width,g.width),height:L+o,meta:A.meta,label:p,secondaryLabel:g}})}function xy(t,e,{padding:i},s){const n=2*i,a=Math.min(e.minimumFontSize??e.fontSize,e.fontSize),o={fontFamily:e.fontFamily,fontSize:e.fontSize,fontStyle:e.fontStyle,fontWeight:e.fontWeight};return NB(a,e.fontSize,r=>{const l=ap(e,r),c=r===a,h=s(l+n,c),u=h.width-n,d=h.height-n;if(l>d)return;o.fontSize=r;const p=Cv.wrapLines(t,{maxWidth:u,maxHeight:d,font:o,textWrap:e.wrapping,overflow:(c?e.overflowStrategy:void 0)??"hide"});if(!p.length)return;const g=dct(p,{lineHeight:l,font:o,maxWidth:u,maxHeight:d});if(g)return[{fontSize:r,lineHeight:l,...g},h.meta]})}function nV(t){return t?.minimumFontSize!=null&&t?.fontSize!=null&&t?.minimumFontSize>t?.fontSize}function qT(t,e,i,s,n,a){const o=e.enabled?t:void 0,r=s.enabled?i:void 0;(nV(e)||nV(s))&&Gt.warnOnce("minimumFontSize should be set to a value less than or equal to the font size");let l;o!=null&&r!=null&&(l=sV(o,e,r,s,n,a));let c;if(l==null&&o!=null&&(c=xy(o,e,n,a)),c!=null){const[u,d]=c;l={width:u.width,height:u.height,meta:d,label:u,secondaryLabel:void 0}}let h;if(l==null&&o==null&&r!=null&&(h=xy(r,s,n,a)),h!=null){const[u,d]=h;l={width:u.width,height:u.height,meta:d,label:void 0,secondaryLabel:u}}return l}function aV(t,e,i,s,n,a,o){const r=Cv.wrapLines(e,{maxWidth:i,maxHeight:s,font:n,textWrap:a,overflow:o});if(!r.length)return;const l=ap(t,n.fontSize),{width:c}=eV.measureLines(r,{font:n});return{width:c,lineHeight:l,text:r.join(` `),height:r.length*l,fontSize:n.fontSize}}function dct(t,{font:e,lineHeight:i=iV.defaultLineHeight,maxWidth:s,maxHeight:n=1/0}){let a=i*t.length;for(;a>n;){if(t.length===1)return;t.pop(),t[t.length-1]=Cv.appendEllipsis(t.at(-1)),a=i*t.length}const o=eV.measureLines(t,{font:e});let r,l;if(o.width>s){const c=[];l=0;for(const h of o.lineMetrics){if(h.width>s){if(!c.length)return;break}c.push(h.text),l=Math.max(l,h.width)}r=Cv.appendEllipsis(c.join(` `))}else r=t.join(` `),l=o.width;return{text:r,width:l,height:a}}var pct=(R(),E(w)),oV=(R(),E(w)),{Validate:by,NUMBER:gct,POSITIVE_NUMBER:rV,TEXT_WRAP:fct,OVERFLOW_STRATEGY:yct}=oV._ModuleSupport,op=class extends oV._ModuleSupport.Label{constructor(){super(...arguments),this.wrapping="on-space",this.overflowStrategy="ellipsis"}};y([by(fct)],op.prototype,"wrapping",2),y([by(yct)],op.prototype,"overflowStrategy",2),y([by(rV,{optional:!0})],op.prototype,"lineHeight",2),y([by(rV,{optional:!0})],op.prototype,"minimumFontSize",2);var Po=class extends op{constructor(){super(...arguments),this.spacing=0}};y([by(gct)],Po.prototype,"spacing",2);var Sy=class extends op{},{CartesianSeriesProperties:mct,SeriesTooltip:xct,Validate:Hi,AND:bct,ARRAY:Sct,COLOR_STRING:vct,COLOR_STRING_ARRAY:Mct,FUNCTION:Ict,OBJECT:lV,POSITIVE_NUMBER:cV,RATIO:Act,STRING:Gh,TEXT_ALIGN:Dct,VERTICAL_ALIGN:kct}=pct._ModuleSupport,Ci=class extends mct{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 Po,this.tooltip=new xct}};y([Hi(Gh,{optional:!0})],Ci.prototype,"title",2),y([Hi(Gh)],Ci.prototype,"xKey",2),y([Hi(Gh)],Ci.prototype,"yKey",2),y([Hi(Gh,{optional:!0})],Ci.prototype,"colorKey",2),y([Hi(Gh,{optional:!0})],Ci.prototype,"xName",2),y([Hi(Gh,{optional:!0})],Ci.prototype,"yName",2),y([Hi(Gh,{optional:!0})],Ci.prototype,"colorName",2),y([Hi(bct(Mct,Sct.restrict({minLength:1})))],Ci.prototype,"colorRange",2),y([Hi(vct,{optional:!0})],Ci.prototype,"stroke",2),y([Hi(Act)],Ci.prototype,"strokeOpacity",2),y([Hi(cV,{optional:!0})],Ci.prototype,"strokeWidth",2),y([Hi(Dct)],Ci.prototype,"textAlign",2),y([Hi(kct)],Ci.prototype,"verticalAlign",2),y([Hi(cV)],Ci.prototype,"itemPadding",2),y([Hi(Ict,{optional:!0})],Ci.prototype,"itemStyler",2),y([Hi(lV)],Ci.prototype,"label",2),y([Hi(lV)],Ci.prototype,"tooltip",2);var{SeriesNodePickMode:hV,computeBarFocusBounds:Lct,getMissCount:Tct,valueProperty:JT,ChartAxisDirection:ea,DEFAULT_CARTESIAN_DIRECTION_KEYS:Cct,DEFAULT_CARTESIAN_DIRECTION_NAMES:Nct,createDatumId:Oct,ColorScale:wct,Rect:Ect,PointerEvents:Rct,applyShapeStyle:_ct}=QT._ModuleSupport,Pct=class extends QT._ModuleSupport.CartesianSeriesNodeEvent{constructor(t,e,i,s){super(t,e,i,s),this.colorKey=s.properties.colorKey}},Bct={left:-.5,center:0,right:-.5},zct={top:-.5,middle:0,bottom:-.5},tC=class extends QT._ModuleSupport.CartesianSeries{constructor(t){super({moduleCtx:t,directionKeys:Cct,directionNames:Nct,pickModes:[hV.NEAREST_NODE,hV.EXACT_SHAPE_MATCH],pathsPerSeries:[],hasMarkers:!1,hasHighlightedLabels:!0}),this.properties=new Ci,this.NodeEvent=Pct,this.colorScale=new wct}async processData(t){const e=this.axes[ea.X],i=this.axes[ea.Y];if(!e||!i||!this.properties.isValid()||!this.data?.length)return;const{xKey:s,yKey:n,colorRange:a,colorKey:o}=this.properties,r=this.axes[ea.X]?.scale,l=this.axes[ea.Y]?.scale,{xScaleType:c,yScaleType:h}=this.getScaleInformation({xScale:r,yScale:l}),u=this.colorScale.type,{dataModel:d,processedData:p}=await this.requestDataModel(t,this.data,{props:[JT(s,c,{id:"xValue"}),JT(n,h,{id:"yValue"}),...o?[JT(o,u,{id:"colorValue"})]:[]]});if(this.isColorScaleValid()){const g=d.resolveProcessedDataIndexById(this,"colorValue");this.colorScale.domain=p.domain.values[g],this.colorScale.range=a,this.colorScale.update()}}isColorScaleValid(){const{colorKey:t}=this.properties;if(!t)return!1;const{dataModel:e,processedData:i}=this;if(!e||!i)return!1;const s=e.resolveProcessedDataIndexById(this,"colorValue"),n=i.input.count,a=Tct(this,i.defs.values[s].missing);return!(n===0||n===a)}xCoordinateRange(t,e){const i=this.axes[ea.X].scale,s=e*(i.bandwidth??0)/2,n=i.convert(t)+s,a=e*(i.bandwidth??10);return[n,n+a]}yCoordinateRange(t,e){const i=this.axes[ea.Y].scale,s=e*(i.bandwidth??0)/2,n=i.convert(t[0])+s,a=e*(i.bandwidth??10);return[n,n+a]}getSeriesDomain(t){const{dataModel:e,processedData:i}=this;return!e||!i?[]:t===ea.X?e.getDomain(this,"xValue","value",i):e.getDomain(this,"yValue","value",i)}getSeriesRange(t,e){return[NaN,NaN]}createNodeData(){const{data:t,visible:e,axes:i,dataModel:s,processedData:n}=this,a=i[ea.X],o=i[ea.Y];if(!(t&&s&&n&&e&&a&&o))return;if(a.type!=="category"||o.type!=="category"){Gt.warnOnce(`Heatmap series expected axes to have "category" type, but received "${a.type}" and "${o.type}" instead.`);return}const{xKey:r,xName:l,yKey:c,yName:h,colorKey:u,colorName:d,textAlign:p,verticalAlign:g,itemPadding:f,label:x}=this.properties,m=s.resolveColumnById(this,"xValue",n),b=s.resolveColumnById(this,"yValue",n),v=u?s.resolveColumnById(this,"colorValue",n):void 0,S=a.scale,A=o.scale,T=(S.bandwidth??0)/2,D=(A.bandwidth??0)/2,L=[],C=[],O=S.bandwidth??10,_=A.bandwidth??10,N=(O-2*f)*Bct[p],P=(_-2*f)*zct[g],j=()=>({width:O,height:_,meta:null});return(n.dataSources.get(this.id)??[]).forEach((V,W)=>{const H=m[W],G=b[W],B=S.convert(H)+T,z=A.convert(G)+D,U=v?.[W],Y=U==null?void 0:this.getLabelText(x,{value:U,datum:V,colorKey:u,colorName:d,xKey:r,yKey:c,xName:l,yName:h}),K=qT(Y,this.properties.label,void 0,this.properties.label,{padding:f},j),Z={x:B,y:z,size:0};if(L.push({series:this,itemId:c,datumIndex:W,yKey:c,xKey:r,xValue:H,yValue:G,colorValue:U,datum:V,point:Z,width:O,height:_,midPoint:{x:B,y:z},missing:U==null}),K?.label!=null){const{text:X,fontSize:Q,lineHeight:$,height:q}=K.label,{fontStyle:J,fontFamily:nt,fontWeight:it,color:rt}=this.properties.label,dt=Z.x+N*(O-2*f),at=Z.y+P*(_-2*f)-(K.height-q)*.5;C.push({series:this,itemId:c,datum:V,datumIndex:W,text:X,fontSize:Q,lineHeight:$,fontStyle:J,fontFamily:nt,fontWeight:it,color:rt,textAlign:p,verticalAlign:g,x:dt,y:at})}}),{itemId:this.properties.yKey??this.id,nodeData:L,labelData:C,scales:this.calculateScaling(),visible:this.visible}}nodeFactory(){return new Ect}update(t){return this.ctx.animationManager.skipCurrentBatch(),super.update(t)}updateDatumSelection(t){const{nodeData:e,datumSelection:i}=t,s=e??[];return i.update(s)}getItemBaseStyle(t){const{properties:e}=this,i=t?e.highlightStyle.item:void 0;return{fill:i?.fill,fillOpacity:i?.fillOpacity??1,stroke:i?.stroke??e.stroke,strokeWidth:i?.strokeWidth??this.getStrokeWidth(e.strokeWidth),strokeOpacity:i?.strokeOpacity??e.strokeOpacity}}getItemStyleOverrides(t,e,i,s,n){const{id:a,properties:o}=this,{xKey:r,yKey:l,colorRange:c,itemStyler:h}=o,u=this.isColorScaleValid()&&i!=null?this.colorScale.convert(i):c[0];let d=s.fill==null?{fill:u}:void 0;if(h!=null){d??(d={});const p=this.cachedDatumCallback(Oct(t,n?"highlight":"node"),()=>h({seriesId:a,datum:e,xKey:r,yKey:l,highlighted:n,fill:u,...s}));Object.assign(d,p)}return d}updateDatumNodes(t){const{isHighlight:e}=t,i=this.axes[ea.X],[s,n]=i?.visibleRange??[],o=!(s!==0||n!==1),r=this.getItemBaseStyle(e);t.datumSelection.each((l,c)=>{const{datumIndex:h,colorValue:u,datum:d,point:p,width:g,height:f}=c,x=this.getItemStyleOverrides(String(h),d,u,r,e);l.crisp=o,l.x=Math.floor(p.x-g/2),l.y=Math.floor(p.y-f/2),l.width=Math.ceil(g),l.height=Math.ceil(f),_ct(l,r,x)})}updateLabelSelection(t){const{labelData:e,labelSelection:i}=t,{enabled:s}=this.properties.label,n=s?e:[];return i.update(n)}updateLabelNodes(t){t.labelSelection.each((e,i)=>{e.text=i.text,e.fontSize=i.fontSize,e.lineHeight=i.lineHeight,e.fontStyle=i.fontStyle,e.fontFamily=i.fontFamily,e.fontWeight=i.fontWeight,e.fill=i.color,e.textAlign=i.textAlign,e.textBaseline=i.verticalAlign,e.x=i.x,e.y=i.y,e.pointerEvents=Rct.None})}getTooltipContent(t){const{id:e,dataModel:i,processedData:s,axes:n,properties:a,colorScale:o}=this,{xKey:r,xName:l,yKey:c,yName:h,colorKey:u,colorName:d,colorRange:p,title:g,legendItemName:f,tooltip:x}=a,m=n[ea.X],b=n[ea.Y];if(!i||!s||!m||!b)return;const{datumIndex:v}=t,S=s.dataSources.get(this.id)?.[v],A=i.resolveColumnById(this,"xValue",s)[v],T=i.resolveColumnById(this,"yValue",s)[v],D=u!=null&&this.isColorScaleValid()?i.resolveColumnById(this,"colorValue",s)[v]:void 0;if(A==null)return;const L=[];let C;D==null?C=p[0]:(C=o.convert(D),L.push({label:d,fallbackLabel:u,value:String(D)})),L.push({label:l,fallbackLabel:r,value:m.formatDatum(A)},{label:h,fallbackLabel:c,value:b.formatDatum(T)});const O=C!=null?{marker:{shape:"square",fill:C,fillOpacity:1,stroke:void 0,strokeWidth:0,strokeOpacity:1,lineDash:[0],lineDashOffset:0}}:void 0,_=this.getItemBaseStyle(!1);return Object.assign(_,this.getItemStyleOverrides(String(v),S,D,_,!1)),x.formatTooltip({title:g??f,symbol:O,data:L},{seriesId:e,datum:S,title:g,xKey:r,xName:l,yKey:c,yName:h,colorKey:u,colorName:d,..._})}getLegendData(t){return t!=="gradient"||!this.properties.isValid()||!this.isColorScaleValid()||!this.dataModel?[]:[{legendType:"gradient",enabled:this.visible,seriesId:this.id,colorName:this.properties.colorName,colorDomain:this.processedData.domain.values[this.dataModel.resolveProcessedDataIndexById(this,"colorValue")],colorRange:this.properties.colorRange}]}isLabelEnabled(){return this.properties.label.enabled&&!!this.properties.colorKey}getBandScalePadding(){return{inner:0,outer:0}}computeFocusBounds({datumIndex:t}){const e=this.contextNodeData?.nodeData[t];if(e===void 0)return;const{width:i,height:s,midPoint:n}=e,a={x:n.x-i/2,y:n.y-s/2,width:i,height:s};return Lct(this,a)}};tC.className="HeatmapSeries",tC.type="heatmap";var Dbt=(R(),E(w)),Fct={series:{label:{enabled:!1,color:{$ref:"textColor"},fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},wrapping:"on-space",overflowStrategy:"ellipsis"},itemPadding:3},gradientLegend:{enabled:!0}},{ThemeSymbols:{DEFAULT_DIVERGING_SERIES_COLOR_RANGE:jct,DEFAULT_BACKGROUND_COLOUR:Vct},ThemeConstants:{CARTESIAN_AXIS_TYPE:uV,CARTESIAN_POSITION:dV}}=cct._ModuleSupport,Gct={type:"series",optionsKey:"series[]",packageType:"enterprise",chartTypes:["cartesian"],identifier:"heatmap",moduleFactory:t=>new tC(t),tooltipDefaults:{range:"exact"},defaultAxes:[{type:uV.CATEGORY,position:dV.LEFT},{type:uV.CATEGORY,position:dV.BOTTOM}],themeTemplate:Fct,paletteFactory:({takeColors:t,colorsCount:e,userPalette:i,themeTemplateParameters:s})=>{const n=s.get(jct),a=s.get(Vct),o=(Array.isArray(a)?a[0]:a)??"white",{fills:r,strokes:l}=t(e);return{stroke:i==="inbuilt"?o:l[0],colorRange:i==="inbuilt"?n:[r[0],r[1]]}}},Wct=(R(),E(w)),pV=(R(),E(w)),kbt=(R(),E(w)),Uct=1e3,gV=10;function fV(t,e,i,s,n,a){const o=t[a];if(o==null)return!1;const r=uv(o,e,i),l=dv(r,n);return a===s[l+Wi]||a===s[l+Ns]||a===s[l+Qs]||a===s[l+qs]}function Hct(t,e,i){if(t.lengthgV&&a>64;)({maxRange:a}=ry(o,r,a,{inPlace:!0})),l=l.filter(fV.bind(null,t,s,n,o,a)),c.push({maxRange:a,indices:l});return c.reverse(),c}var{ChartAxisDirection:Yct,ContinuousScale:Kct,OrdinalTimeScale:$ct}=pV._ModuleSupport,Xct=class extends pV._ModuleSupport.LineSeries{aggregateData(t,e){const i=this.axes[Yct.X];if(i==null||!(Kct.is(i.scale)||$ct.is(i.scale)))return;const s=t.resolveColumnById(this,"xValue",e),n=t.resolveColumnById(this,"yValueRaw",e),a=t.getDomain(this,"xValue","value",e);return Hct(s,n,a)}},{LineSeriesModule:Zct}=Wct._ModuleSupport,Qct={...Zct,type:"series",optionsKey:"series[]",packageType:"enterprise",chartTypes:["cartesian"],identifier:"line",moduleFactory:t=>new Xct(t)},qct=(R(),E(w)),Jct=(R(),E(w)),{ColorScale:tht}=Jct._ModuleSupport;function yV(t){if(t==null)return[];const e=new tht;e.domain=[0,1],e.range=t;const i=5;return Array.from({length:5},(s,n)=>e.convert(n/(i-1)))}var rp=(R(),E(w)),mV=class{*[Symbol.iterator](){const{node:t,datum:e}=this;t&&e&&(yield{node:t,datum:e})}nodes(){return this.node?[this.node]:[]}update(t,e,i,s){const n=t.nodes();if(n.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,e.appendChild(this.node));const a=n[0],o=n.toReversed().find(r=>r.datum.datum.value>r.datum.datum.segmentStart)??n[n.length-1];this.node.datum=this.datum=a.datum,s(this.node,a,o)}}},xV={fromFn:()=>({opacity:0,phase:"initial"}),toFn:()=>({opacity:1})};function bV(t,e){if(t==null)return"";if(e==null)return String(t);const[i,s]=e.scale.domain,n=i!==0?Math.ceil(Math.log10(Math.abs(i))):0,a=s!==0?Math.ceil(Math.log10(Math.abs(s))):0,o=Math.max(2-Math.max(n,a),0);return t.toFixed(o)}function vy(t,e,i){if(e.text!=null)return e.text;const s=i??e.value,n=e?.formatter?.({seriesId:t.id,datum:void 0,value:s});if(n!=null)return String(n)}var Lbt=(R(),E(w));function SV({path:t,x:e,y:i,size:s}){t.moveTo(e,i-s/2),t.lineTo(e,i+s/2)}var eht=(R(),E(w)),{clamp:vV}=eht._ModuleSupport;function MV(t,e){const i=UQ(t.datumUnion.nodes(),t.targetSelection.nodes());return t.pickNodeNearestDistantObject(e,i)}function IV(t,e){const i=[{data:t.contextNodeData?.nodeData,selection:t.datumUnion},{data:t.contextNodeData?.targetData,selection:t.targetSelection}].filter(l=>l.data&&l.data.length>0),s=vV(0,e.otherIndex+e.otherIndexDelta,i.length-1);if(i.length===0)return;const{data:n,selection:a}=i[s];if(n==null||n.length===0)return;const o=vV(0,e.datumIndex,n.length-1),r=n[o];for(const l of a)if(l.datum===r)return{bounds:l.node,clipFocusBox:!0,datum:r,datumIndex:o,otherIndex:s}}var iht=(R(),E(w)),{MARKER_SHAPE:sht,UNION:eC,OR:nht}=iht._ModuleSupport,Nv=eC(["continuous","discrete"],"a fill mode"),AV=nht(sht,eC(["line"],"a marker shape")),DV=eC(["container","item"],"a corner mode");function kV(t){let e,i;return typeof t.value=="number"&&(e=t.value),typeof t.text=="string"&&(i=t.text),{value:e,text:i}}var iC=(R(),E(w)),aht=(R(),E(w)),{BaseProperties:LV,Validate:lp,OBJECT:oht,BOOLEAN:rht,NUMBER:sC,NUMBER_ARRAY:lht}=aht._ModuleSupport,Ov=class extends LV{getSegments(t,e){const{values:i,step:s,count:n}=this,a=Math.min(...t.domain),o=Math.max(...t.domain);let r;if(i!=null){const l=i.filter(c=>c>a&&cc-h);r=[a,...l,o]}else if(s!=null){const l=[];for(let c=a;ch/l*(o-a)+a)}else{const l=t.ticks({nice:!0,interval:void 0,tickCount:void 0,minTickCount:0,maxTickCount:1/0})?.filter(c=>c>a&&ce&&(Gt.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,o]),r}};y([lp(lht,{optional:!0})],Ov.prototype,"values",2),y([lp(sC,{optional:!0})],Ov.prototype,"step",2),y([lp(sC,{optional:!0})],Ov.prototype,"count",2);var My=class extends LV{constructor(){super(...arguments),this.enabled=!1,this.interval=new Ov,this.spacing=0}};y([lp(rht)],My.prototype,"enabled",2),y([lp(oht)],My.prototype,"interval",2),y([lp(sC)],My.prototype,"spacing",2);var{BaseProperties:nC,SeriesTooltip:cht,SeriesProperties:hht,PropertiesArray:aC,Validate:gt,BOOLEAN:TV,COLOR_STRING:Wh,COLOR_STRING_ARRAY:uht,FUNCTION:dht,LINE_DASH:oC,NUMBER:cp,OBJECT_ARRAY:rC,OBJECT:Uh,POSITIVE_NUMBER:Bo,RATIO:Hh,STRING:CV,UNION:lC,Label:pht}=iC._ModuleSupport,ght=lC(["before","after","middle"],"a placement"),fht=lC(["inside-start","outside-start","inside-end","outside-end","inside-center","bar-inside","bar-inside-end","bar-outside-end","bar-end"],"an placement"),yht=lC(["horizontal","vertical"],"an orientation"),NV=class extends pht{};y([gt(cp,{optional:!0})],NV.prototype,"spacing",2);var Yi=class extends nC{constructor(){super(...arguments),this.value=0,this.label=new NV}};y([gt(CV,{optional:!0})],Yi.prototype,"text",2),y([gt(cp)],Yi.prototype,"value",2),y([gt(AV,{optional:!0})],Yi.prototype,"shape",2),y([gt(ght,{optional:!0})],Yi.prototype,"placement",2),y([gt(cp,{optional:!0})],Yi.prototype,"spacing",2),y([gt(Bo,{optional:!0})],Yi.prototype,"size",2),y([gt(cp,{optional:!0})],Yi.prototype,"rotation",2),y([gt(Wh,{optional:!0})],Yi.prototype,"fill",2),y([gt(Hh,{optional:!0})],Yi.prototype,"fillOpacity",2),y([gt(Wh,{optional:!0})],Yi.prototype,"stroke",2),y([gt(Bo,{optional:!0})],Yi.prototype,"strokeWidth",2),y([gt(Hh,{optional:!0})],Yi.prototype,"strokeOpacity",2),y([gt(oC,{optional:!0})],Yi.prototype,"lineDash",2),y([gt(Bo,{optional:!0})],Yi.prototype,"lineDashOffset",2),y([gt(Uh)],Yi.prototype,"label",2);var Tn=class extends nC{constructor(){super(...arguments),this.enabled=!0,this.thicknessRatio=1,this.fills=new aC(iC._ModuleSupport.StopProperties),this.fillMode="continuous",this.fillOpacity=1,this.stroke="black",this.strokeWidth=0,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0}};y([gt(TV)],Tn.prototype,"enabled",2),y([gt(Bo,{optional:!0})],Tn.prototype,"thickness",2),y([gt(Hh)],Tn.prototype,"thicknessRatio",2),y([gt(rC)],Tn.prototype,"fills",2),y([gt(Nv)],Tn.prototype,"fillMode",2),y([gt(Wh,{optional:!0})],Tn.prototype,"fill",2),y([gt(Hh)],Tn.prototype,"fillOpacity",2),y([gt(Wh)],Tn.prototype,"stroke",2),y([gt(Bo)],Tn.prototype,"strokeWidth",2),y([gt(Hh)],Tn.prototype,"strokeOpacity",2),y([gt(oC)],Tn.prototype,"lineDash",2),y([gt(Bo)],Tn.prototype,"lineDashOffset",2);var Ba=class extends nC{constructor(){super(...arguments),this.fills=new aC(iC._ModuleSupport.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"}};y([gt(rC)],Ba.prototype,"fills",2),y([gt(Nv)],Ba.prototype,"fillMode",2),y([gt(Wh,{optional:!0})],Ba.prototype,"fill",2),y([gt(Hh)],Ba.prototype,"fillOpacity",2),y([gt(Wh)],Ba.prototype,"stroke",2),y([gt(Bo)],Ba.prototype,"strokeWidth",2),y([gt(Hh)],Ba.prototype,"strokeOpacity",2),y([gt(oC)],Ba.prototype,"lineDash",2),y([gt(Bo)],Ba.prototype,"lineDashOffset",2),y([gt(Wh)],Ba.prototype,"defaultFill",2);var wv=class extends Po{constructor(){super(...arguments),this.placement="inside-center",this.avoidCollisions=!0}};y([gt(CV,{optional:!0})],wv.prototype,"text",2),y([gt(fht)],wv.prototype,"placement",2),y([gt(TV)],wv.prototype,"avoidCollisions",2);var ms=class extends hht{constructor(){super(...arguments),this.value=0,this.segmentation=new My,this.defaultColorRange=[],this.targets=new aC(Yi),this.defaultTarget=new Yi,this.direction="vertical",this.thickness=1,this.cornerRadius=0,this.cornerMode="container",this.margin=0,this.scale=new Ba,this.bar=new Tn,this.label=new wv,this.tooltip=new cht}};y([gt(cp)],ms.prototype,"value",2),y([gt(Uh)],ms.prototype,"segmentation",2),y([gt(uht)],ms.prototype,"defaultColorRange",2),y([gt(rC)],ms.prototype,"targets",2),y([gt(Uh)],ms.prototype,"defaultTarget",2),y([gt(yht)],ms.prototype,"direction",2),y([gt(Bo)],ms.prototype,"thickness",2),y([gt(Bo)],ms.prototype,"cornerRadius",2),y([gt(DV)],ms.prototype,"cornerMode",2),y([gt(cp)],ms.prototype,"margin",2),y([gt(Uh)],ms.prototype,"scale",2),y([gt(Uh)],ms.prototype,"bar",2),y([gt(dht,{optional:!0})],ms.prototype,"itemStyler",2),y([gt(Uh)],ms.prototype,"label",2),y([gt(Uh)],ms.prototype,"tooltip",2);var mht=(R(),E(w)),{CachedTextMeasurerPool:xht,BBox:bht}=mht._ModuleSupport;function cC(t){const{x0:e,y0:i,x1:s,y1:n,horizontalInset:a,verticalInset:o}=t,r=Math.min(e,s)+a,l=Math.min(i,n)+o,c=Math.max(Math.abs(s-e)-2*a,0),h=Math.max(Math.abs(n-i)-2*o,0);return{x:r,y:l,width:c,height:h}}function Sht(t,e){if(e==null)return!0;const i=cC(t),s=1e-6,n=i.x+s,a=i.y+s,o=i.x+i.width-s,r=i.y+i.height-s,l=e.x,c=e.x+e.width,h=e.y,u=e.y+e.height;return Math.max(n,l)<=Math.min(o,c)&&Math.max(a,h)<=Math.min(r,u)}function hC(t){const{clipX0:e,clipX1:i,clipY0:s,clipY1:n}=t;return e!=null&&i!=null||s!=null&&n!=null}function vht(t){if(!hC(t))return;const{x0:e,y0:i,x1:s,y1:n}=t,{x:a,y:o,width:r,height:l}=cC(t);let{clipX0:c,clipX1:h,clipY0:u,clipY1:d}=t;(c==null||h==null)&&(c=e,h=s),(u==null||d==null)&&(u=i,d=n);const p=Math.min(c,h),g=Math.min(u,d),f=Math.abs(h-c),x=Math.abs(d-u);return c=Math.max(a,p),u=Math.max(o,g),h=Math.min(a+r,p+f),d=Math.min(o+l,g+x),new bht(Math.min(c,h),Math.min(u,d),Math.abs(h-c),Math.abs(d-u))}function OV(t,e){const i=t?"initial":"update";return{node:{fromFn(n,a){const o=n.previousDatum;let{x0:r,y0:l,x1:c,y1:h,clipX0:u,clipY0:d,clipX1:p,clipY1:g}=o??a;const{horizontalInset:f,verticalInset:x}=a,m=o!=null&&hC(o),b=hC(a);return m&&b||(!m&&b?({x0:r,y0:l,x1:c,y1:h,clipX0:u,clipY0:d,clipX1:p,clipY1:g}=a,t&&(e?p=a.clipX0:g=a.clipY0)):m&&!b?({x0:r,y0:l,x1:c,y1:h}=a,u=void 0,d=void 0,p=void 0,g=void 0):t&&(e?c=r:h=l)),{x0:r,y0:l,x1:c,y1:h,clipX0:u,clipY0:d,clipX1:p,clipY1:g,horizontalInset:f,verticalInset:x,phase:i}},toFn(n,a){const{x0:o,y0:r,x1:l,y1:c,clipX0:h,clipY0:u,clipX1:d,clipY1:p,horizontalInset:g,verticalInset:f}=a;return{x0:o,y0:r,x1:l,y1:c,clipX0:h,clipY0:u,clipX1:d,clipY1:p,horizontalInset:g,verticalInset:f}},applyFn(n,a){n.setProperties(Ev(n,a))}}}}function Ev(t,e){const{x:i,y:s,width:n,height:a}=cC(e),o=vht(e),r=Sht(e,o);return{x:i,y:s,width:n,height:a,clipBBox:o,visible:r}}var Mht={Before:"right",Center:"center",After:"left"},Iht={Before:"top",Center:"middle",After:"bottom"},Aht={Before:-1,Center:-.5,After:0},Dht={Before:0,Center:-.5,After:-1};function kht(t,e,i,s,n){const{scale:a,bar:o}=s,{padding:r,horizontal:l}=i;e.each((c,h)=>{const u=vy(t,h,n?.label),d=()=>({width:a.width,height:a.height,meta:null});let p;const g=h.avoidCollisions&&h.placement!=="outside-start"&&h.placement!=="outside-end";if(u==null)return;if(g)p=xy(u,h,{padding:r},d)?.[0];else{const P={fontSize:h.fontSize,fontStyle:h.fontStyle,fontWeight:h.fontWeight,fontFamily:h.fontFamily,lineHeight:h.lineHeight},{width:j,height:F}=xht.measureText(u,{font:P});p={text:u,fontSize:h.fontSize,lineHeight:ap(h,h.fontSize),width:j,height:F}}if(p==null){c.visible=!1;return}const f=l?a.x:a.y+a.height,x=l?a.x+a.width:a.y,m=l?o.x:o.y+o.height,b=l?o.x+o.width:o.y,v=h.spacing*(l?1:-1);let S,A,T,D;switch(h.placement){case"outside-start":S=-1/0,A=1/0,T=f-v,D="Before";break;case"outside-end":S=-1/0,A=1/0,T=x+v,D="After";break;case"inside-start":S=f,A=b,T=f+v,D="After";break;case"inside-end":S=b,A=x,T=x-v,D="Before";break;case"inside-center":S=f,A=x,T=(f+x)/2,D="Center";break;case"bar-inside":S=m,A=b,T=(m+b)/2,D="Center";break;case"bar-inside-end":S=m,A=b,T=b-v,D="Before";break;case"bar-outside-end":S=b,A=x,T=b+v,D="After";break;case"bar-end":S=-1/0,A=1/0,T=b,D="Center";break}const L=l?T:a.x+a.width/2,C=l?a.y+a.height/2:T;let O,_;l?(O=L+Aht[D]*p.width,_=O+p.width):(O=C+Dht[D]*p.height,_=O+p.height);const N=Math.min(O,_)>=Math.min(S,A)&&Math.max(O,_)<=Math.max(S,A);if(h.avoidCollisions&&!N){c.visible=!1;return}c.visible=!0,c.text=p.text,c.fontSize=p.fontSize,c.lineHeight=p.lineHeight,c.textAlign=l?Mht[D]:"center",c.textBaseline=l?"middle":Iht[D],c.x=L,c.y=C})}var{fromToMotion:uC,resetMotion:Lht,SeriesNodePickMode:wV,StateMachine:Tht,createDatumId:EV,ChartAxisDirection:za,CachedTextMeasurerPool:Cht,toRadians:Nht,BBox:Iy,Group:hp,PointerEvents:Oht,Selection:up,Rect:wht,Text:RV,LinearGradient:Eht,Marker:Rht,easing:_ht,getColorStops:Pht}=rp._ModuleSupport,Bht={before:180,middle:0,after:0},zht={before:90,middle:0,after:-90},dC=class extends rp._ModuleSupport.Series{constructor(t){super({moduleCtx:t,useLabelLayer:!0,pickModes:[wV.EXACT_SHAPE_MATCH,wV.NEAREST_NODE]}),this.canHaveAxes=!0,this.properties=new ms,this.originX=0,this.originY=0,this.scaleGroup=this.contentGroup.appendChild(new hp({name:"scaleGroup"})),this.itemGroup=this.contentGroup.appendChild(new hp({name:"itemGroup"})),this.itemTargetGroup=this.contentGroup.appendChild(new hp({name:"itemTargetGroup"})),this.itemTargetLabelGroup=this.contentGroup.appendChild(new hp({name:"itemTargetLabelGroup"})),this.itemLabelGroup=this.contentGroup.appendChild(new hp({name:"itemLabelGroup"})),this.highlightTargetGroup=this.highlightGroup.appendChild(new hp({name:"itemTargetLabelGroup"})),this.scaleSelection=up.select(this.scaleGroup,()=>this.nodeFactory()),this.datumSelection=up.select(this.itemGroup,()=>this.nodeFactory()),this.targetSelection=up.select(this.itemTargetGroup,()=>this.markerFactory()),this.targetLabelSelection=up.select(this.itemTargetLabelGroup,RV),this.labelSelection=up.select(this.itemLabelGroup,RV),this.highlightTargetSelection=up.select(this.highlightTargetGroup,()=>this.markerFactory()),this.datumUnion=new mV,this.animationState=new Tht("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=Oht.None}get horizontal(){return this.properties.direction==="horizontal"}get thickness(){return this.properties.thickness}computeInset(t,e){const{label:i}=this.properties;let s;switch(i.placement){case"outside-start":s=1;break;case"outside-end":s=-1;break;default:return 0}const n=i.text?.split(` `);let a;if(t===za.Y)a=ap(i,i.fontSize)*(n?.length??1);else{const o=i.getFont();a=(n??e.map(l=>vy(this,this.labelDatum(i,l))??"")).reduce((l,c)=>{const{width:h}=Cht.measureText(c,{font:o});return Math.max(l,h)},0)}return s*(i.spacing+a)}get hasData(){return!0}nodeFactory(){const t=new wht;return t.crisp=!0,t}markerFactory(){return new Rht}processData(){this.nodeDataRefresh=!0,this.animationState.transition("updateData")}formatLabel(t){const{axes:e,horizontal:i}=this,s=i?e[za.X]:e[za.Y];return bV(t,s)}createLinearGradient(t,e){const{properties:i,originX:s,originY:n,horizontal:a,axes:o}=this,{thickness:r,defaultColorRange:l}=i,c=a?o[za.X]:o[za.Y],{domain:h,range:u}=c.scale,d=u[1]-u[0],p=Pht(t,l,h,e);return new Eht("oklch",p,a?90:0,new Iy(s,n,a?d:r,a?r:d))}getTargets(){const{properties:t}=this,e=t.defaultTarget;return Array.from(t.targets).map(i=>{const{text:s=e.text,value:n=e.value??0,shape:a=e.shape??"triangle",rotation:o=e.rotation??0,strokeWidth:r=e.strokeWidth??0,placement:l=e.placement??"middle",spacing:c=e.spacing??0,size:h=e.size??0,fill:u=e.fill??"black",fillOpacity:d=e.fillOpacity??1,stroke:p=e.stroke??"black",strokeOpacity:g=e.strokeOpacity??1,lineDash:f=e.lineDash??[0],lineDashOffset:x=e.lineDashOffset??0}=i,{enabled:m=e.label.enabled,color:b=e.label.color??"black",fontStyle:v=e.label.fontStyle??"normal",fontWeight:S=e.label.fontWeight??"normal",fontSize:A=e.label.fontSize,fontFamily:T=e.label.fontFamily,spacing:D=e.label.spacing??0}=i.label;return{text:s,value:n,shape:a,placement:l,spacing:c,size:h,rotation:o,fill:u,fillOpacity:d,stroke:p,strokeWidth:r,strokeOpacity:g,lineDash:f,lineDashOffset:x,label:{enabled:m,color:b,fontStyle:v,fontWeight:S,fontSize:A,fontFamily:T,spacing:D}}})}getTargetPoint(t){const e=this.axes[za.X],i=this.axes[za.Y];if(e==null||i==null)return{x:0,y:0};const{properties:s,originX:n,originY:a,horizontal:o}=this,{thickness:r}=s,{value:l,placement:c,spacing:h,size:u}=t,d=o?e:i,p=d.scale.convert(l)-d.scale.range[0];let g;switch(c){case"before":g=-(h+u/2);break;case"after":g=r+h+u/2;break;default:g=r/2;break}return{x:n+e.range[0]+(o?p:g),y:a+i.range[0]+(o?g:p)}}getTargetLabel(t){const{size:e,placement:i,label:s}=t,{spacing:n,color:a,fontStyle:o,fontWeight:r,fontSize:l,fontFamily:c}=s,h=void 0,u=e/2+n;let d,p,g=0,f=0;return this.horizontal?(d="center",i==="after"?(p="top",f=u):(p="bottom",f=-u)):(p="middle",i==="before"?(d="right",g=-u):(d="left",g=u)),{offsetX:g,offsetY:f,fill:a,textAlign:d,textBaseline:p,fontStyle:o,fontWeight:r,fontSize:l,fontFamily:c,lineHeight:h}}labelDatum(t,e){const{placement:i,avoidCollisions:s,spacing:n,text:a,color:o,fontSize:r,minimumFontSize:l,fontStyle:c,fontWeight:h,fontFamily:u,lineHeight:d,wrapping:p,overflowStrategy:g,formatter:f=x=>this.formatLabel(x.value)}=t;return{placement:i,avoidCollisions:s,spacing:n,text:a,value:e,fill:o,fontSize:r,minimumFontSize:l,fontStyle:c,fontWeight:h,fontFamily:u,lineHeight:d,wrapping:p,overflowStrategy:g,formatter:f}}createNodeData(){const{id:t,properties:e,originX:i,originY:s,horizontal:n}=this;if(!e.isValid())return;const{value:a,segmentation:o,thickness:r,cornerRadius:l,cornerMode:c,bar:h,scale:u,label:d}=e,p=this.getTargets(),g=this.axes[za.X],f=this.axes[za.Y];if(g==null||f==null)return;const x=n?g:f,m=g.scale,b=f.scale,v=x.scale;let{domain:S}=x.scale;x.isReversed()&&(S=S.slice().reverse());const A=[],T=[],D=[],L=[],[C,O]=v.range,_=Math.abs(O-C);let[N,P]=g.range;g.isReversed()&&([P,N]=[N,P]);let[j,F]=f.range;f.isReversed()&&([F,j]=[j,F]);const V=n?m.convert(a):P,W=n?F:b.convert(a),H=o.enabled?o.spacing/2:0,G=n?H:0,B=n?0:H,z=Math.min(h.thickness??Math.round(h.thicknessRatio*r),r),U=-(r-z)/2,Y=n?0:U,K=n?U:0,Z=c==="item",X=Math.ceil(_);let Q=o.enabled?o.interval.getSegments(v,X):void 0;const $=h.fill??this.createLinearGradient(h.fills,h.fillMode),q=u.fill??(h.enabled&&u.fills.length===0?u.defaultFill:void 0)??this.createLinearGradient(u.fills,u.fillMode);if(Q==null&&Z){const nt=Math.min(...S),it=Math.max(...S),rt={value:a,segmentStart:nt,segmentEnd:it};if(h.enabled){const ft=Math.min(l,z/2,_/2)*(x.isReversed()?-1:1),xt=n?ft:0,Nt=n?0:ft;A.push({series:this,itemId:"value",datum:rt,datumIndex:{type:0},type:0,x0:i+N-xt-Y,y0:s+j-Nt-K,x1:i+V+xt+Y,y1:s+W+Nt+K,clipX0:void 0,clipY0:void 0,clipX1:void 0,clipY1:void 0,topLeftCornerRadius:l,topRightCornerRadius:l,bottomRightCornerRadius:l,bottomLeftCornerRadius:l,fill:$,horizontalInset:G,verticalInset:B})}const at=Math.min(l,r/2,_/2)*(x.isReversed()?-1:1),Dt=n?at:0,kt=n?0:at;L.push({series:this,itemId:"scale",datum:rt,datumIndex:{type:0},type:0,x0:i+N-Dt,y0:s+j-kt,x1:i+P+Dt,y1:s+F+kt,clipX0:void 0,clipY0:void 0,clipX1:void 0,clipY1:void 0,topLeftCornerRadius:l,topRightCornerRadius:l,bottomRightCornerRadius:l,bottomLeftCornerRadius:l,fill:q,horizontalInset:G,verticalInset:B})}else{Q??(Q=S);const nt=i+N-Y,it=s+j-K,rt=i+V+Y,dt=s+W+K;for(let at=0;atEV(t.nodeData.length,e.itemId))}updateDatumNodes(t){const{datumSelection:e}=t,{ctx:i,properties:s}=this,{bar:n}=s,{fillOpacity:a,stroke:o,strokeOpacity:r,lineDash:l,lineDashOffset:c}=n,h=this.getStrokeWidth(n.strokeWidth),u=i.animationManager.isSkipped();e.each((d,p)=>{const{topLeftCornerRadius:g,topRightCornerRadius:f,bottomRightCornerRadius:x,bottomLeftCornerRadius:m,fill:b}=p;d.fill=b,d.fillOpacity=a,d.stroke=o,d.strokeOpacity=r,d.strokeWidth=h,d.lineDash=l,d.lineDashOffset=c,d.topLeftCornerRadius=g,d.topRightCornerRadius=f,d.bottomRightCornerRadius=x,d.bottomLeftCornerRadius=m,d.pointerEvents=this.properties.bar.enabled?rp._ModuleSupport.PointerEvents.All:rp._ModuleSupport.PointerEvents.None,(u||d.previousDatum==null)&&d.setProperties(Ev(d,p))}),this.datumUnion.update(e,this.itemGroup,rp._ModuleSupport.Rect,(d,p,g)=>{d.pointerEvents=rp._ModuleSupport.PointerEvents.None,d.clipBBox??(d.clipBBox=new Iy(NaN,NaN,NaN,NaN)),d.x=p.x,d.y=p.y,d.clipBBox.x=p.clipBBox?.x??p.x,d.clipBBox.y=p.clipBBox?.y??p.y,this.properties.direction==="horizontal"?(d.height=d.clipBBox.height=g.height,d.width=g===p?g.width:g.x+g.width,d.clipBBox.width=d.width-(g.width-(g.clipBBox?.width??g.width)),d.topLeftCornerRadius=p.topLeftCornerRadius,d.bottomLeftCornerRadius=p.bottomLeftCornerRadius,d.topRightCornerRadius=g.topRightCornerRadius,d.bottomRightCornerRadius=g.bottomRightCornerRadius):(d.width=d.clipBBox.width=g.width,d.height=g===p?g.height:g.x+g.height,d.clipBBox.height=d.height-(g.height-(g.clipBBox?.height??g.height)),d.topLeftCornerRadius=p.topLeftCornerRadius,d.topRightCornerRadius=p.topRightCornerRadius,d.bottomLeftCornerRadius=g.bottomLeftCornerRadius,d.bottomRightCornerRadius=g.bottomRightCornerRadius)})}updateScaleSelection(t){return t.scaleSelection.update(t.scaleData,void 0,e=>EV(t.scaleData.length,e.itemId))}updateScaleNodes(t){const{scaleSelection:e}=t,{scale:i}=this.properties,{fillOpacity:s,stroke:n,strokeOpacity:a,strokeWidth:o,lineDash:r,lineDashOffset:l}=i;e.each((c,h)=>{const{topLeftCornerRadius:u,topRightCornerRadius:d,bottomRightCornerRadius:p,bottomLeftCornerRadius:g,fill:f}=h;c.fill=f,c.fillOpacity=s,c.stroke=n,c.strokeOpacity=a,c.strokeWidth=o,c.lineDash=r,c.lineDashOffset=l,c.topLeftCornerRadius=u,c.topRightCornerRadius=d,c.bottomRightCornerRadius=p,c.bottomLeftCornerRadius=g,c.setProperties(Ev(c,h))})}updateTargetSelection(t){return t.targetSelection.update(t.targetData,void 0,e=>e.itemId)}updateTargetNodes(t){const{targetSelection:e,isHighlight:i}=t,s=i?this.properties.highlightStyle.item:void 0;e.each((n,a)=>{const{x:o,y:r,shape:l,size:c,rotation:h,fill:u,fillOpacity:d,stroke:p,strokeOpacity:g,strokeWidth:f,lineDash:x,lineDashOffset:m}=a;n.size=c,n.shape=l==="line"?SV:l,n.fill=s?.fill??u,n.fillOpacity=s?.fillOpacity??d,n.stroke=s?.stroke??p,n.strokeOpacity=s?.strokeOpacity??g,n.strokeWidth=s?.strokeWidth??f,n.lineDash=s?.lineDash??x,n.lineDashOffset=s?.lineDashOffset??m,n.translationX=o,n.translationY=r,n.rotation=h})}updateTargetLabelSelection(t){return t.targetLabelSelection.update(t.targetData)}updateTargetLabelNodes(t){const{targetLabelSelection:e}=t;e.each((i,s)=>{const{x:n,y:a,text:o}=s,{offsetX:r,offsetY:l,fill:c,fontStyle:h,fontWeight:u,fontSize:d,fontFamily:p,textAlign:g,textBaseline:f}=s.label;i.visible=!0,i.x=n+r,i.y=a+l,i.text=o,i.fill=c,i.fontStyle=h,i.fontWeight=u,i.fontSize=d,i.fontFamily=p,i.textAlign=g,i.textBaseline=f})}updateLabelSelection(t){return t.labelSelection.update(t.labelData,void 0,e=>"primary")}updateLabelNodes(t){const{labelSelection:e}=t,i=this.ctx.animationManager.isSkipped();e.each((s,n)=>{s.fill=n.fill,s.fontStyle=n.fontStyle,s.fontWeight=n.fontWeight,s.fontFamily=n.fontFamily}),(i||this.labelsHaveExplicitText())&&this.formatLabelText()}labelsHaveExplicitText(){for(const{datum:t}of this.labelSelection)if(t.text==null)return!1;return!0}formatLabelText(t){const{labelSelection:e,horizontal:i,axes:s}=this,n=s[za.X],a=s[za.Y];if(n==null||a==null)return;const[o,r]=n.range,[l,c]=a.range,h=this.originX+Math.min(o,r),u=this.originY+Math.min(l,c),d=Math.abs(r-o),p=Math.abs(c-l),g=t?.label??this.properties.value;let f;if(i){const b=n.scale.convert(g);f=new Iy(h,u,b-h,p)}else{const b=a.scale.convert(g);f=new Iy(h,b,d,p-b)}const x={scale:new Iy(h,u,d,p),bar:f},{margin:m}=this.properties;kht(this,e,{padding:m,horizontal:i},x,t)}resetAllAnimation(){this.ctx.animationManager.stopByAnimationGroupId(this.id),Lht([this.datumSelection],Ev),this.formatLabelText()}resetAnimation(t){t==="initial"?this.animationState.transition("reset"):t==="ready"&&this.animationState.transition("skip")}animateLabelText(t={}){const{animationManager:e}=this.ctx;let i=0,s=0;if(this.labelSelection.each((n,a)=>{n.opacity=1,i=n.previousDatum?.value??t.from??a.value,s=a.value}),!this.labelsHaveExplicitText())if(i===s)this.formatLabelText({label:s});else{const n=`${this.id}_labels`;e.animate({id:n,groupId:"label",from:{label:i},to:{label:s},phase:t.phase??"update",ease:_ht.easeOut,onUpdate:a=>this.formatLabelText(a)})}}animateEmptyUpdateReady(){const{animationManager:t}=this.ctx,{node:e}=OV(!0,this.horizontal);uC(this.id,"node",t,[this.datumSelection],e,(i,s)=>s.itemId),uC(this.id,"label",t,[this.labelSelection],xV,()=>"primary"),this.animateLabelText({from:0,phase:"initial"})}animateWaitingUpdateReady(){const{animationManager:t}=this.ctx,{node:e}=OV(!1,this.horizontal);uC(this.id,"node",t,[this.datumSelection],e,(i,s)=>s.itemId),this.animateLabelText()}animateReadyResize(){this.resetAllAnimation()}getSeriesDomain(){return[0,1]}getSeriesRange(t,e){return[NaN,NaN]}getLegendData(){return[]}getTooltipContent(t){const{id:e,properties:i}=this,{tooltip:s}=i;if(!i.isValid())return;const{value:n=i.value,text:a=i.label.text}=kV(t);return s.formatTooltip({data:[{label:a,fallbackLabel:"Value",value:this.formatLabel(n)}]},{seriesId:e,title:void 0,datum:void 0,value:n})}pickNodeClosestDatum(t){return MV(this,t)}pickFocus(t){return IV(this,t)}getCaptionText(){return this.formatLabel(this.properties.value)}};dC.className="LinearGaugeSeries",dC.type="linear-gauge";var{ThemeSymbols:{DEFAULT_HIERARCHY_FILLS:Fht,DEFAULT_GAUGE_SERIES_COLOR_RANGE:jht},ThemeConstants:{CARTESIAN_AXIS_TYPE:pC}}=qct._ModuleSupport,Vht={type:"series",optionsKey:"series[]",packageType:"enterprise",chartTypes:["gauge"],identifier:"linear-gauge",moduleFactory:t=>new dC(t),tooltipDefaults:{range:10},defaultAxes:[{type:pC.NUMBER,line:{enabled:!1}},{type:pC.NUMBER,line:{enabled:!1}}],themeTemplate:{minWidth:200,minHeight:200,tooltip:{enabled:!1},series:{thickness:50,bar:{strokeWidth: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}},label:{enabled:!1,placement:"inside-start",fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},fontSize:{$rem:[2]},minimumFontSize:12,spacing:18,color:{$ref:"backgroundColor"}},margin:4},axes:{[pC.NUMBER]:{line:{enabled:!1},gridLine:{enabled:!1}}}},paletteFactory(t){const{takeColors:e,colorsCount:i,userPalette:s,themeTemplateParameters:n}=t,{fills:a}=e(i),o=n.get(jht),r=n.get(Fht),l=s==="inbuilt"?o:[a[0],a[1]];return{scale:{defaultFill:r?.[1],stroke:r?.[2]},defaultColorRange:yV(l)}}},Ght=(R(),E(w)),Ay={zoom:{axes:"xy",anchorPointX:"pointer",anchorPointY:"pointer",buttons:{anchorPointX:"middle",anchorPointY:"middle"}},legend:{enabled:!1},gradientLegend:{enabled:!1},tooltip:{range:"exact"}},Wht=(R(),E(w)),Uht=(R(),E(w)),Hht=1e-9;function _V(t,e,i,s){const[n,a]=t,[o,r]=e,l=o-n,c=r-a,h=l*l+c*c;let u,d;if(Math.abs(h)e){const h=(e-n)/l,u=[i+(o-i)*h,s+(r-s)*h],d=Math.atan2(r-s,o-i);return{point:u,angle:d}}n=c,i=o,s=r}}var Yht=(R(),E(w)),{LonLatBBox:Kht}=Yht._ModuleSupport;function Dy(t,e,i,s,n){return t==null?t=new Kht(e,i,s,n):(t.lon0=Math.min(t.lon0,e),t.lat0=Math.min(t.lat0,i),t.lon1=Math.max(t.lon1,s),t.lat1=Math.max(t.lat1,n)),t}function Yh(t,e){return t.forEach(i=>{const[s,n]=i;e=Dy(e,s,n,s,n)}),e}function $ht(t){if(t.length===0)return;let e=0,i=0,s=0,[n,a]=t[t.length-1];for(const[o,r]of t){const l=n*r-o*a;s+=l,e+=(n+o)*l,i+=(a+r)*l,n=o,a=r}return s*=3,[e/s,i/s]}function _v(t,e,i){let s=!1,n=1/0;for(const a of t){let o=a[a.length-1],[r,l]=o;for(const c of a){const[h,u]=c;u>i!=l>i&&e<(r-h)*(i-u)/(l-u)+h&&(s=!s),n=Math.min(n,_V(o,c,e,i)),o=c,r=h,l=u}}return(s?-1:1)*Math.sqrt(n)}var{Path:Xht,ExtendedPath2D:Zht,BBox:Qht,ScenePathChangeDetection:BV}=Uht._ModuleSupport,dp=class extends Xht{constructor(){super(...arguments),this.projectedGeometry=void 0,this.renderMode=3,this.strokePath=new Zht}computeBBox(){return(this.dirtyPath||this.isDirtyPath())&&(this.updatePath(),this.dirtyPath=!1),this.bbox?.clone()}updatePath(){const{projectedGeometry:t}=this;this.strokePath.clear(),this.path.clear(),this.bbox=t!=null?this.drawGeometry(t,void 0):void 0}drawPath(t){super.drawPath(t),this.renderStroke(t,this.strokePath.getPath2D())}containsPoint(t,e){const{projectedGeometry:i}=this;return i==null||!this.getBBox().containsPoint(t,e)?!1:this.geometryDistance(i,t,e)<=0}distanceSquared(t,e){const{projectedGeometry:i}=this;if(i==null)return 1/0;const s=this.geometryDistance(i,t,e);return s>0?s*s:0}geometryDistance(t,e,i){const{renderMode:s,strokeWidth:n}=this,a=(s&1)!==0,o=(s&2)!==0,r=Math.max(n/2,1)+1;switch(t.type){case"GeometryCollection":return t.geometries.reduce((l,c)=>Math.min(l,this.geometryDistance(c,e,i)),1/0);case"MultiPolygon":return a?t.coordinates.reduce((l,c)=>Math.min(l,Math.max(_v(c,e,i),0)),1/0):1/0;case"Polygon":return a?Math.max(_v(t.coordinates,e,i),0):1/0;case"MultiLineString":return o?t.coordinates.reduce((l,c)=>Math.min(l,Math.max(PV(c,e,i)-r,0)),1/0):1/0;case"LineString":return o?Math.max(PV(t.coordinates,e,i)-r,0):1/0;case"MultiPoint":case"Point":default:return 1/0}}drawGeometry(t,e){const{renderMode:i,path:s,strokePath:n}=this,a=(i&1)!==0,o=(i&2)!==0;switch(t.type){case"GeometryCollection":t.geometries.forEach(r=>{e=this.drawGeometry(r,e)});break;case"MultiPolygon":a&&t.coordinates.forEach(r=>{e=this.drawPolygon(s,r,e)});break;case"Polygon":a&&(e=this.drawPolygon(s,t.coordinates,e));break;case"LineString":o&&(e=this.drawLineString(n,t.coordinates,e,!1));break;case"MultiLineString":o&&t.coordinates.forEach(r=>{e=this.drawLineString(n,r,e,!1)});break;case"Point":case"MultiPoint":break}return e}drawPolygon(t,e,i){if(e.length<1)return i;i=this.drawLineString(t,e[0],i,!0);for(let s=1;s{e=pp(i,e)});break;case"MultiPolygon":t.coordinates.forEach(i=>{i.length>0&&(e=Yh(i[0],e))});break;case"Polygon":t.coordinates.length>0&&(e=Yh(t.coordinates[0],e));break;case"MultiLineString":t.coordinates.forEach(i=>{e=Yh(i,e)});break;case"LineString":e=Yh(t.coordinates,e);break;case"MultiPoint":t.coordinates.forEach(i=>{const[s,n]=i;e=Dy(e,s,n,s,n)});break;case"Point":{const[i,s]=t.coordinates;e=Dy(e,i,s,i,s);break}}return e}function Pv(t){switch(t.type){case"GeometryCollection":{let e,i;return t.geometries.forEach(s=>{const n=Pv(s);if(n==null)return;const a=Yh(n[0],void 0);if(a==null)return;const o=Math.abs(a.lat1-a.lat0)*Math.abs(a.lon1-a.lon0);(e==null||o>e)&&(e=o,i=n)}),i}case"MultiPolygon":{let e,i;return t.coordinates.forEach(s=>{const n=Yh(s[0],void 0);if(n==null)return;const a=Math.abs(n.lat1-n.lat0)*Math.abs(n.lon1-n.lon0);(e==null||a>e)&&(e=a,i=s)}),i}case"Polygon":return t.coordinates;case"MultiLineString":case"LineString":case"MultiPoint":case"Point":return}}function Bv(t){switch(t.type){case"GeometryCollection":{let e,i;return t.geometries.forEach(s=>{const n=Bv(s);if(n==null)return;const a=gC(n);a!=null&&(e==null||a>e)&&(e=a,i=n)}),i}case"MultiLineString":{let e=0,i;return t.coordinates.forEach(s=>{const n=gC(s);n>e&&(e=n,i=s)}),i}case"LineString":return t.coordinates;case"MultiPolygon":case"Polygon":case"MultiPoint":case"Point":return}}function fC(t,e){if(t==null)return!1;switch(t.type){case"GeometryCollection":return t.geometries.some(i=>fC(i,e));case"MultiPolygon":case"Polygon":return(e&1)!==0;case"MultiLineString":case"LineString":return(e&2)!==0;case"MultiPoint":case"Point":return(e&4)!==0}}function ql(t,e){switch(t.type){case"GeometryCollection":return{type:"GeometryCollection",geometries:t.geometries.map(i=>ql(i,e))};case"Polygon":return{type:"Polygon",coordinates:yC(t.coordinates,e)};case"MultiPolygon":return{type:"MultiPolygon",coordinates:qht(t.coordinates,e)};case"MultiLineString":return{type:"MultiLineString",coordinates:yC(t.coordinates,e)};case"LineString":return{type:"LineString",coordinates:mC(t.coordinates,e)};case"MultiPoint":return{type:"MultiPoint",coordinates:mC(t.coordinates,e)};case"Point":return{type:"Point",coordinates:e.convert(t.coordinates)}}}function qht(t,e){return t.map(i=>yC(i,e))}function yC(t,e){return t.map(i=>mC(i,e))}function mC(t,e){return t.map(i=>e.convert(i))}var zV=(R(),E(w)),Tbt=class extends zV._ModuleSupport.SeriesProperties{},ky=class extends zV._ModuleSupport.DataModelSeries{addChartEventListeners(){this.destroyFns.push(this.ctx.chartEventManager.addListener("legend-item-click",t=>{this.onLegendItemClick(t)}),this.ctx.chartEventManager.addListener("legend-item-double-click",t=>{this.onLegendItemDoubleClick(t)}))}getSeriesDomain(){return[NaN,NaN]}getSeriesRange(t,e){return[NaN,NaN]}},Jht=(R(),E(w));function FV(t){return Array.isArray(t)&&t.length>=2&&t.every(kl)}function zv(t){return Array.isArray(t)&&t.length>=2&&t.every(FV)}var jV=.001;function tut(t){return Math.abs(t[0][0]-t[t.length-1][0])this.nodeFactory())}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(t){this._chartTopology=t,this.topology===t&&(this.nodeDataRefresh=!0)}setSeriesIndex(t){return super.setSeriesIndex(t)?(this.contentGroup.zIndex=[0,t,0],this.highlightGroup.zIndex=[0,t,1],!0):!1}nodeFactory(){const t=new dp;return t.renderMode=2,t.lineJoin="round",t.lineCap="round",t.pointerEvents=fut.None,t}processData(){const{topology:t}=this;this.topologyBounds=t?.features.reduce((e,i)=>{const s=i.geometry;return s==null?e:pp(s,e)},void 0),t==null&&Gt.warnOnce("no topology was provided for [MapShapeBackgroundSeries]; nothing will be rendered.")}createNodeData(){const{id:t,topology:e,scale:i}=this;if(e==null)return;const s=[],n=[];return e.features.forEach((a,o)=>{const{geometry:r}=a,l=r!=null&&i!=null?ql(r,i):void 0;l!=null&&s.push({series:this,itemId:o,datum:a,datumIndex:0,index:o,projectedGeometry:l})}),{itemId:t,nodeData:s,labelData:n}}updateSelections(){this.nodeDataRefresh&&(this.contextNodeData=this.createNodeData(),this.nodeDataRefresh=!1)}update(){const{datumSelection:t}=this;this.updateSelections(),this.contentGroup.visible=this.visible;const{nodeData:e=[]}=this.contextNodeData??{};this.datumSelection=this.updateDatumSelection({nodeData:e,datumSelection:t}),this.updateDatumNodes({datumSelection:t})}updateDatumSelection(t){return t.datumSelection.update(t.nodeData,void 0,e=>hut(e.index))}updateDatumNodes(t){const{properties:e}=this,{datumSelection:i}=t,{stroke:s,strokeOpacity:n,lineDash:a,lineDashOffset:o}=e,r=this.getStrokeWidth(e.strokeWidth);i.each((l,c)=>{const{projectedGeometry:h}=c;if(h==null){l.visible=!1,l.projectedGeometry=void 0;return}l.visible=!0,l.projectedGeometry=h,l.stroke=s,l.strokeWidth=r,l.strokeOpacity=n,l.lineDash=a,l.lineDashOffset=o})}resetAnimation(){}getLegendData(){return[]}getTooltipContent(t){}computeFocusBounds(t){}};Fv.className="MapLineBackgroundSeries",Fv.type="map-line-background",y([dut(zo,{optional:!0,property:"topology"})],Fv.prototype,"_chartTopology",2);var{DEFAULT_HIERARCHY_STROKES:yut}=Ght._ModuleSupport.ThemeSymbols,mut={type:"series",optionsKey:"series[]",packageType:"enterprise",chartTypes:["topology"],identifier:"map-line-background",moduleFactory:t=>new Fv(t),tooltipDefaults:{range:"exact"},themeTemplate:{...Ay,series:{strokeWidth:1,lineDash:[0],lineDashOffset:0}},paletteFactory:({themeTemplateParameters:t})=>({stroke:t.get(yut)?.[1]})},UV=(R(),E(w)),HV=(R(),E(w));function xut(){return{fromFn:(i,s,n)=>n==="removed"?{scalingX:1,scalingY:1}:i.previousDatum==null?{scalingX:0,scalingY:0}:{scalingX:i.scalingX,scalingY:i.scalingY},toFn:(i,s,n)=>n==="removed"?{scalingX:0,scalingY:0}:{scalingX:1,scalingY:1}}}function YV(t,e){const i=t.contextNodeData?.nodeData[e.datumIndex];if(i!==void 0){for(const s of t.datumSelection.nodes())if(s.datum===i)return s}}var but=(R(),E(w)),{AND:Sut,ARRAY:vut,COLOR_STRING:Mut,COLOR_STRING_ARRAY:Iut,FUNCTION:Aut,LINE_DASH:Dut,NUMBER_ARRAY:kut,OBJECT:KV,POSITIVE_NUMBER:xC,RATIO:Lut,STRING:Fa,Validate:Ce,SeriesProperties:Tut,SeriesTooltip:Cut,Label:Nut}=but._ModuleSupport,Ae=class extends Tut{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 Nut,this.tooltip=new Cut}};y([Ce(zo,{optional:!0})],Ae.prototype,"topology",2),y([Ce(Fa,{optional:!0})],Ae.prototype,"title",2),y([Ce(Fa,{optional:!0})],Ae.prototype,"legendItemName",2),y([Ce(Fa)],Ae.prototype,"idKey",2),y([Ce(Fa)],Ae.prototype,"topologyIdKey",2),y([Ce(Fa,{optional:!0})],Ae.prototype,"idName",2),y([Ce(Fa,{optional:!0})],Ae.prototype,"labelKey",2),y([Ce(Fa,{optional:!0})],Ae.prototype,"labelName",2),y([Ce(Fa,{optional:!0})],Ae.prototype,"sizeKey",2),y([Ce(Fa,{optional:!0})],Ae.prototype,"sizeName",2),y([Ce(Fa,{optional:!0})],Ae.prototype,"colorKey",2),y([Ce(Fa,{optional:!0})],Ae.prototype,"colorName",2),y([Ce(kut,{optional:!0})],Ae.prototype,"sizeDomain",2),y([Ce(Sut(Iut,vut.restrict({minLength:1})),{optional:!0})],Ae.prototype,"colorRange",2),y([Ce(xC,{optional:!0})],Ae.prototype,"maxStrokeWidth",2),y([Ce(Mut)],Ae.prototype,"stroke",2),y([Ce(Lut)],Ae.prototype,"strokeOpacity",2),y([Ce(xC)],Ae.prototype,"strokeWidth",2),y([Ce(Dut)],Ae.prototype,"lineDash",2),y([Ce(xC)],Ae.prototype,"lineDashOffset",2),y([Ce(Aut,{optional:!0})],Ae.prototype,"itemStyler",2),y([Ce(KV)],Ae.prototype,"label",2),y([Ce(KV)],Ae.prototype,"tooltip",2);var{getMissCount:Out,createDatumId:$V,SeriesNodePickMode:XV,valueProperty:Ly,CachedTextMeasurerPool:wut,Validate:Eut,ColorScale:Rut,LinearScale:_ut,Selection:bC,Text:Put,Transformable:But}=HV._ModuleSupport,jv=class extends ky{constructor(t){super({moduleCtx:t,useLabelLayer:!0,pickModes:[XV.EXACT_SHAPE_MATCH,XV.NEAREST_NODE],usesPlacedLabels:!0}),this.properties=new Ae,this._chartTopology=void 0,this.colorScale=new Rut,this.sizeScale=new _ut,this.datumSelection=bC.select(this.contentGroup,()=>this.nodeFactory()),this.labelSelection=bC.select(this.labelGroup,Put),this.highlightDatumSelection=bC.select(this.highlightNode,()=>this.nodeFactory()),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}setSeriesIndex(t){return super.setSeriesIndex(t)?(this.contentGroup.zIndex=[1,t],this.highlightGroup.zIndex=[2,t],!0):!1}setChartTopology(t){this._chartTopology=t,this.topology===t&&(this.nodeDataRefresh=!0)}isLabelEnabled(){return this.properties.labelKey!=null&&this.properties.label.enabled}nodeFactory(){const t=new dp;return t.renderMode=2,t.lineJoin="round",t.lineCap="round",t}async processData(t){if(this.data==null||!this.properties.isValid())return;const{data:e,topology:i,sizeScale:s,colorScale:n}=this,{topologyIdKey:a,idKey:o,sizeKey:r,colorKey:l,labelKey:c,sizeDomain:h,colorRange:u}=this.properties,d=new Map;i?.features.forEach(v=>{const S=v.properties?.[a];S==null||!fC(v.geometry,2)||d.set(S,v)});const p=this.sizeScale.type,g=this.colorScale.type,f=this.scale?.type,{dataModel:x,processedData:m}=await this.requestDataModel(t,e,{props:[Ly(o,f,{id:"idValue",includeProperty:!1}),Ly(o,f,{id:"featureValue",includeProperty:!1,processor:()=>v=>d.get(v)}),...c!=null?[Ly(c,"band",{id:"labelValue"})]:[],...r!=null?[Ly(r,p,{id:"sizeValue"})]:[],...l!=null?[Ly(l,g,{id:"colorValue"})]:[]]}),b=x.resolveColumnById(this,"featureValue",m);if(this.topologyBounds=b.reduce((v,S)=>{const A=S?.geometry;return A==null?v:pp(A,v)},void 0),r!=null){const v=x.resolveProcessedDataIndexById(this,"sizeValue"),S=m.domain.values[v]??[];s.domain=h??S}if(u!=null&&this.isColorScaleValid()){const v=x.resolveProcessedDataIndexById(this,"colorValue");n.domain=m.domain.values[v],n.range=u,n.update()}i==null&&Gt.warnOnce("no topology was provided for [MapLineSeries]; nothing will be rendered.")}isColorScaleValid(){const{colorKey:t}=this.properties;if(!t)return!1;const{dataModel:e,processedData:i}=this;if(!e||!i)return!1;const s=e.resolveProcessedDataIndexById(this,"colorValue"),n=i.input.count,a=Out(this,i.defs.values[s].missing);return!(n===0||n===a)}getLabelDatum(t,e,i,s){if(e==null||i==null)return;const n=Bv(i);if(n==null)return;const{idKey:a,idName:o,sizeKey:r,sizeName:l,colorKey:c,colorName:h,labelKey:u,labelName:d,label:p}=this.properties,g=this.getLabelText(p,{value:e,datum:t,idKey:a,idName:o,sizeKey:r,sizeName:l,colorKey:c,colorName:h,labelKey:u,labelName:d});if(g==null)return;const f=wut.measureText(String(g),{font:s}),x=Rv(n);if(x==null)return;const[m,b]=x.point,{width:v,height:S}=f;return{point:{x:m,y:b,size:0},label:{width:v,height:S,text:g},anchor:void 0,placement:void 0}}createNodeData(){const{id:t,dataModel:e,processedData:i,sizeScale:s,properties:n,scale:a}=this,{idKey:o,sizeKey:r,colorKey:l,labelKey:c,label:h}=n;if(e==null||i==null)return;const u=e.resolveColumnById(this,"idValue",i),d=e.resolveColumnById(this,"featureValue",i),p=c!=null?e.resolveColumnById(this,"labelValue",i):void 0,g=r!=null?e.resolveColumnById(this,"sizeValue",i):void 0,f=l!=null?e.resolveColumnById(this,"colorValue",i):void 0,x=n.maxStrokeWidth??n.strokeWidth;s.range=[Math.min(n.strokeWidth,x),x];const m=h.getFont(),b=new Map;i.dataSources.get(this.id)?.forEach((L,C)=>{const O=u[C],_=d[C]?.geometry??void 0,N=_!=null&&a!=null?ql(_,a):void 0;O!=null&&N!=null&&b.set(O,N)});const v=[],S=[],A=[];(i.dataSources.get(this.id)??[]).forEach((L,C)=>{const O=u[C],_=f?.[C],N=g?.[C],P=p?.[C],j=b.get(O);j==null&&A.push(O);const F=this.getLabelDatum(L,P,j,m);F!=null&&S.push(F),v.push({series:this,itemId:o,datum:L,datumIndex:C,idValue:O,labelValue:P,colorValue:_,sizeValue:N,projectedGeometry:j})});const D=10;if(A.length>D){const L=A.length-D;A.length=D,A.push(`(+${L} more)`)}return A.length>0&&Gt.warnOnce("some data items do not have matches in the provided topology",A),{itemId:t,nodeData:v,labelData:S}}updateSelections(){this.nodeDataRefresh&&(this.contextNodeData=this.createNodeData(),this.nodeDataRefresh=!1)}update(){const{datumSelection:t,highlightDatumSelection:e}=this;this.updateSelections(),this.contentGroup.visible=this.visible,this.contentGroup.opacity=this.getOpacity();let i=this.ctx.highlightManager?.getActiveHighlight();i!=null&&(i.series!==this||i.datum==null)&&(i=void 0);const s=this.contextNodeData?.nodeData??[];this.datumSelection=this.updateDatumSelection({nodeData:s,datumSelection:t}),this.updateDatumNodes({datumSelection:t,isHighlight:!1}),this.highlightDatumSelection=this.updateDatumSelection({nodeData:i!=null?[i]:[],datumSelection:e}),this.updateDatumNodes({datumSelection:e,isHighlight:!0})}updateDatumSelection(t){return t.datumSelection.update(t.nodeData,void 0,e=>$V(e.idValue))}getItemBaseStyle(t){const{properties:e}=this,i=t?e.highlightStyle.item:void 0;return{stroke:i?.stroke??e.stroke,strokeWidth:i?.strokeWidth??this.getStrokeWidth(e.strokeWidth),strokeOpacity:i?.strokeOpacity??e.strokeOpacity,lineDash:i?.lineDash??e.lineDash,lineDashOffset:i?.lineDashOffset??e.lineDashOffset}}getItemStyleOverrides(t,e,i,s,n,a){const{id:o,properties:r,colorScale:l,sizeScale:c}=this,{colorRange:h,itemStyler:u}=r;let d;if(!a&&i!=null&&(d??(d={}),d.stroke=this.isColorScaleValid()?l.convert(i):h?.[0]??r.stroke),s!=null&&(d??(d={}),d.strokeWidth=c.convert(s,!0)),u!=null){const p=this.cachedDatumCallback($V(t,a?"highlight":"node"),()=>u({seriesId:o,datum:e,highlighted:a,...n,...d}));d??(d={}),Object.assign(d,p)}return d}updateDatumNodes(t){const{datumSelection:e,isHighlight:i}=t,s=this.getItemBaseStyle(i);e.each((n,a)=>{const{datum:o,datumIndex:r,colorValue:l,sizeValue:c,projectedGeometry:h}=a;if(h==null){n.visible=!1,n.projectedGeometry=void 0;return}const u=this.getItemStyleOverrides(String(r),o,l,c,s,i);n.visible=!0,n.projectedGeometry=h,n.stroke=u?.stroke??s.stroke,n.strokeWidth=u?.strokeWidth??s.strokeWidth,n.strokeOpacity=u?.strokeOpacity??s.strokeOpacity,n.lineDash=u?.lineDash??s.lineDash,n.lineDashOffset=u?.lineDashOffset??s.lineDashOffset})}updatePlacedLabelData(t){this.labelSelection=this.labelSelection.update(t,e=>{e.pointerEvents=HV._ModuleSupport.PointerEvents.None}),this.updateLabelNodes({labelSelection:this.labelSelection})}updateLabelNodes(t){const{labelSelection:e}=t,{color:i,fontStyle:s,fontWeight:n,fontSize:a,fontFamily:o}=this.properties.label;e.each((r,{x:l,y:c,width:h,height:u,text:d})=>{r.visible=!0,r.x=l+h/2,r.y=c+u/2,r.text=d,r.fill=i,r.fontStyle=s,r.fontWeight=n,r.fontSize=a,r.fontFamily=o,r.textAlign="center",r.textBaseline="middle"})}resetAnimation(){}getLabelData(){return this.isLabelEnabled()?this.contextNodeData?.labelData??[]:[]}pickNodeClosestDatum({x:t,y:e}){let i=1/0,s;return this.datumSelection.each((n,a)=>{const o=n.distanceSquared(t,e);onew jv(t),tooltipDefaults:{range:"exact"},themeTemplate:{...Ay,series:{strokeWidth:1,maxStrokeWidth:3,lineDash:[0],lineDashOffset:0,label:{enabled:!0,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"textColor"}}}},paletteFactory:t=>{const{takeColors:e,colorsCount:i,userPalette:s,themeTemplateParameters:n}=t,{fill:a}=UV._ModuleSupport.singleSeriesPaletteFactory(t),o=n.get(zut),{fills:r}=e(i);return{colorRange:s==="inbuilt"?o:[r[0],r[1]],stroke:a}}},ZV=(R(),E(w)),QV=(R(),E(w)),jut=(t,e,i)=>{let s=t,n=s;for(const a of e)if(s==null||i(s.value,a)>0)s={value:a,next:s},n=s;else{for(n=n;n.next!=null&&i(n.next.value,a)<=0;)n=n.next;n.next={value:a,next:n.next}}return s};function qV(t,e,i){const s=Yh(t[0],void 0);if(s==null)return;const n=(s.lon0+s.lon1)/2,a=(s.lat0+s.lat1)/2,o=Math.abs(s.lon1-s.lon0),r=Math.abs(s.lat1-s.lat0),l=$ht(t[0]),[c,h]=l,u=-_v(t,c,h);let d;const p=(A,T)=>{const L=Math.max(T-u,0);return A-.5*L},g=(A,T,D)=>{const{distance:L,maxDistance:C}=i(t,A,T,D),O=Math.hypot(c-A,h-T),_=Math.min(Math.max(c,A-D/2),A+D/2),N=Math.min(Math.max(h,T-D/2),T+D/2),P=Math.hypot(c-_,h-N),j=p(L,O),F=p(C,P);return{distance:L,maxDistance:C,value:j,maxValue:F,x:A,y:T,stride:D}},f=(A,T,D,L)=>{const C=g(T,D,L);C.maxDistance>=0&&A.push(C)},x=Math.min(o,r)/2;let m={value:g(n,a,x),next:null};for(;m!=null;){const A=m.value,{distance:T,value:D,maxValue:L,x:C,y:O,stride:_}=A;if(m=m.next,T>0&&(d==null||D>d.value)&&(d=A),d!=null&&L-d.value<=e)continue;const N=_/2,P=[];f(P,C-N,O-N,N),f(P,C+N,O-N,N),f(P,C-N,O+N,N),f(P,C+N,O+N,N),P.sort(JV),m=jut(m,P,JV)}if(d==null)return;const{distance:b,x:v,y:S}=d;return{x:v,y:S,distance:b}}var JV=(t,e)=>e.maxValue-t.maxValue;function SC(t,e){const i=qV(t,e,(a,o,r,l)=>{const c=-_v(a,o,r),h=c+l*Math.SQRT2;return{distance:c,maxDistance:h}});if(i==null)return;const{x:s,y:n}=i;return[s,n]}function tG(t,e){let i;switch(t.type){case"GeometryCollection":return t.geometries.flatMap(s=>tG(s,e));case"MultiPoint":return t.coordinates;case"Point":return[t.coordinates];case"MultiPolygon":{const s=Pv(t);i=s!=null?SC(s,e):void 0;break}case"Polygon":{const s=t.coordinates;i=s!=null?SC(s,e):void 0;break}case"MultiLineString":{const s=Bv(t);i=s!=null?Rv(s)?.point:void 0;break}case"LineString":{const s=t.coordinates;i=Rv(s)?.point;break}}return i!=null?[i]:[]}var Vut=(R(),E(w)),{AND:Gut,ARRAY:Wut,COLOR_STRING:eG,COLOR_STRING_ARRAY:Uut,FUNCTION:Hut,NUMBER_ARRAY:Yut,OBJECT:iG,POSITIVE_NUMBER:Vv,RATIO:sG,STRING:xs,MARKER_SHAPE:Kut,LINE_DASH:$ut,Validate:Xt,SeriesProperties:Xut,SeriesTooltip:Zut,Label:Qut}=Vut._ModuleSupport,nG=class extends Qut{constructor(){super(...arguments),this.placement="bottom"}};y([Xt(xs)],nG.prototype,"placement",2);var Zt=class extends Xut{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 nG,this.tooltip=new Zut}isValid(){const t=super.isValid(),e=this.idKey!=null,i=this.latitudeKey!=null&&this.longitudeKey!=null;return!e&&!i?(Gt.warnOnce("Either both [topology] and [idKey] or both [latitudeKey] and [longitudeKey] must be set to render a map marker series."),!1):t}};y([Xt(zo,{optional:!0})],Zt.prototype,"topology",2),y([Xt(xs,{optional:!0})],Zt.prototype,"title",2),y([Xt(xs,{optional:!0})],Zt.prototype,"legendItemName",2),y([Xt(xs,{optional:!0})],Zt.prototype,"idKey",2),y([Xt(xs)],Zt.prototype,"topologyIdKey",2),y([Xt(xs,{optional:!0})],Zt.prototype,"idName",2),y([Xt(xs,{optional:!0})],Zt.prototype,"latitudeKey",2),y([Xt(xs,{optional:!0})],Zt.prototype,"latitudeName",2),y([Xt(xs,{optional:!0})],Zt.prototype,"longitudeKey",2),y([Xt(xs,{optional:!0})],Zt.prototype,"longitudeName",2),y([Xt(xs,{optional:!0})],Zt.prototype,"labelKey",2),y([Xt(xs,{optional:!0})],Zt.prototype,"labelName",2),y([Xt(xs,{optional:!0})],Zt.prototype,"sizeKey",2),y([Xt(xs,{optional:!0})],Zt.prototype,"sizeName",2),y([Xt(xs,{optional:!0})],Zt.prototype,"colorKey",2),y([Xt(xs,{optional:!0})],Zt.prototype,"colorName",2),y([Xt(Gut(Uut,Wut.restrict({minLength:1})),{optional:!0})],Zt.prototype,"colorRange",2),y([Xt(Kut)],Zt.prototype,"shape",2),y([Xt(Vv)],Zt.prototype,"size",2),y([Xt(Vv,{optional:!0})],Zt.prototype,"maxSize",2),y([Xt(Yut,{optional:!0})],Zt.prototype,"sizeDomain",2),y([Xt(eG)],Zt.prototype,"fill",2),y([Xt(sG)],Zt.prototype,"fillOpacity",2),y([Xt(eG)],Zt.prototype,"stroke",2),y([Xt(Vv)],Zt.prototype,"strokeWidth",2),y([Xt(sG)],Zt.prototype,"strokeOpacity",2),y([Xt($ut)],Zt.prototype,"lineDash",2),y([Xt(Vv)],Zt.prototype,"lineDashOffset",2),y([Xt(Hut,{optional:!0})],Zt.prototype,"itemStyler",2),y([Xt(iG)],Zt.prototype,"label",2),y([Xt(iG)],Zt.prototype,"tooltip",2);var{CachedTextMeasurerPool:qut,Validate:Jut,fromToMotion:tdt,StateMachine:edt,getMissCount:idt,createDatumId:aG,SeriesNodePickMode:oG,valueProperty:$h,computeMarkerFocusBounds:sdt,ColorScale:ndt,LinearScale:adt,Group:odt,Selection:vC,Text:rdt,Marker:MC,applyShapeStyle:ldt}=QV._ModuleSupport,Gv=class extends ky{constructor(t){super({moduleCtx:t,useLabelLayer:!0,pickModes:[oG.EXACT_SHAPE_MATCH,oG.NEAREST_NODE],usesPlacedLabels:!0}),this.properties=new Zt,this._chartTopology=void 0,this.colorScale=new ndt,this.sizeScale=new adt,this.markerGroup=this.contentGroup.appendChild(new odt({name:"markerGroup"})),this.labelSelection=vC.select(this.labelGroup,rdt,!1),this.markerSelection=vC.select(this.markerGroup,MC,!1),this.highlightMarkerSelection=vC.select(this.highlightNode,MC),this.animationState=new edt("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 t=this.properties.latitudeKey!=null&&this.properties.longitudeKey!=null;return super.hasData&&(this.topology!=null||t)}renderToOffscreenCanvas(){return!0}setChartTopology(t){this._chartTopology=t,this.topology===t&&(this.nodeDataRefresh=!0)}setSeriesIndex(t){return super.setSeriesIndex(t)?(this.contentGroup.zIndex=[3,t],this.highlightGroup.zIndex=[4,t],!0):!1}isLabelEnabled(){return this.properties.labelKey!=null&&this.properties.label.enabled}async processData(t){if(this.data==null||!this.properties.isValid())return;const{data:e,topology:i,sizeScale:s,colorScale:n}=this,{topologyIdKey:a,idKey:o,latitudeKey:r,longitudeKey:l,sizeKey:c,colorKey:h,labelKey:u,sizeDomain:d,colorRange:p}=this.properties,g=new Map;i?.features.forEach(L=>{const C=L.properties?.[a];C!=null&&g.set(C,L)});const f=this.sizeScale.type,x=this.colorScale.type,m=this.scale?.type,b=r!=null&&l!=null,{dataModel:v,processedData:S}=await this.requestDataModel(t,e,{props:[...o!=null?[$h(o,m,{id:"idValue",includeProperty:!1}),$h(o,m,{id:"featureValue",includeProperty:!1,processor:()=>L=>g.get(L)})]:[],...b?[$h(r,m,{id:"latValue"}),$h(l,m,{id:"lonValue"})]:[],...u?[$h(u,"band",{id:"labelValue"})]:[],...c?[$h(c,f,{id:"sizeValue"})]:[],...h?[$h(h,x,{id:"colorValue"})]:[]]}),A=o!=null?v.resolveColumnById(this,"featureValue",S):void 0,T=b?v.resolveColumnById(this,"latValue",S):void 0,D=b?v.resolveColumnById(this,"lonValue",S):void 0;if(this.topologyBounds=S.dataSources.get(this.id)?.reduce((L,C,O)=>{const N=A?.[O]?.geometry;if(N!=null&&(L=pp(N,L)),T!=null&&D!=null){const P=D[O],j=T[O];L=Dy(L,P,j,P,j)}return L},void 0),c!=null){const L=v.resolveProcessedDataIndexById(this,"sizeValue"),C=S.domain.values[L]??[];s.domain=d??C}if(p!=null&&this.isColorScaleValid()){const L=v.resolveProcessedDataIndexById(this,"colorValue");n.domain=S.domain.values[L],n.range=p,n.update()}this.animationState.transition("updateData")}isColorScaleValid(){const{colorKey:t}=this.properties;if(!t)return!1;const{dataModel:e,processedData:i}=this;if(!e||!i)return!1;const s=e.resolveProcessedDataIndexById(this,"colorValue"),n=i.input.count,a=idt(this,i.defs.values[s].missing);return!(n===0||n===a)}getLabelDatum(t,e,i,s,n,a){if(e==null)return;const{idKey:o,idName:r,latitudeKey:l,latitudeName:c,longitudeKey:h,longitudeName:u,sizeKey:d,sizeName:p,colorKey:g,colorName:f,labelKey:x,labelName:m,label:b,shape:v}=this.properties,{placement:S}=b,A=this.getLabelText(b,{value:e,datum:t,idKey:o,idName:r,latitudeKey:l,latitudeName:c,longitudeKey:h,longitudeName:u,sizeKey:d,sizeName:p,colorKey:g,colorName:f,labelKey:x,labelName:m});if(A==null)return;const{width:T,height:D}=qut.measureText(String(A),{font:a}),L=MC.anchor(v);return{point:{x:i,y:s,size:n},label:{width:T,height:D,text:A},anchor:L,placement:S}}createNodeData(){const{id:t,dataModel:e,processedData:i,sizeScale:s,properties:n,scale:a}=this,{idKey:o,latitudeKey:r,longitudeKey:l,sizeKey:c,colorKey:h,labelKey:u,label:d}=n;if(e==null||i==null||a==null)return;const p=r!=null&&l!=null,g=o!=null?e.resolveColumnById(this,"idValue",i):void 0,f=o!=null?e.resolveColumnById(this,"featureValue",i):void 0,x=p?e.resolveColumnById(this,"latValue",i):void 0,m=p?e.resolveColumnById(this,"lonValue",i):void 0,b=u!=null?e.resolveColumnById(this,"labelValue",i):void 0,v=c!=null?e.resolveColumnById(this,"sizeValue",i):void 0,S=h!=null?e.resolveColumnById(this,"colorValue",i):void 0,A=n.maxSize??n.size;s.range=[Math.min(n.size,A),A];const T=d.getFont();let D;g!=null&&f!=null&&(D=new Map,i.dataSources.get(this.id)?.forEach((P,j)=>{const F=g[j],V=f[j]?.geometry??void 0,W=V!=null&&a!=null?ql(V,a):void 0;F!=null&&W!=null&&D.set(F,W)}));const L=[],C=[],O=[];(i.dataSources.get(this.id)??[]).forEach((P,j)=>{const F=g?.[j],V=m?.[j],W=x?.[j],H=S?.[j],G=v?.[j],B=b?.[j],z=G!=null?s.convert(G,!0):n.size,U=F!=null?D?.get(F):void 0;if(F!=null&&ql==null&&O.push(F),V!=null&&W!=null){const[Y,K]=a.convert([V,W]),Z=this.getLabelDatum(P,B,Y,K,z,T);Z&&C.push(Z),L.push({series:this,itemId:r,datum:P,datumIndex:j,index:-1,idValue:F,lonValue:V,latValue:W,labelValue:B,sizeValue:G,colorValue:H,point:{x:Y,y:K,size:z},midPoint:{x:Y,y:K}})}else U!=null&&tG(U,1).forEach(([Y,K],Z)=>{const X=this.getLabelDatum(P,B,Y,K,z,T);X&&C.push(X),L.push({series:this,itemId:r,datum:P,datumIndex:j,index:Z,idValue:F,lonValue:V,latValue:W,labelValue:B,sizeValue:G,colorValue:H,point:{x:Y,y:K,size:z},midPoint:{x:Y,y:K}})})});const N=10;if(O.length>N){const P=O.length-N;O.length=N,O.push(`(+${P} more)`)}return O.length>0&&Gt.warnOnce("some data items do not have matches in the provided topology",O),{itemId:t,nodeData:L,labelData:C}}updateSelections(){this.nodeDataRefresh&&(this.contextNodeData=this.createNodeData(),this.nodeDataRefresh=!1)}checkScaleChange(){return this.previousScale===this.scale?!1:(this.previousScale=this.scale,!0)}update({seriesRect:t}){const e=this.checkResize(t),i=this.checkScaleChange(),{markerSelection:s,highlightMarkerSelection:n}=this;this.updateSelections(),this.contentGroup.visible=this.visible,this.contentGroup.opacity=this.getOpacity();let a=this.ctx.highlightManager?.getActiveHighlight();a!=null&&(a.series!==this||a.datum==null)&&(a=void 0);const o=this.contextNodeData?.nodeData??[];this.markerSelection=this.updateMarkerSelection({markerData:o,markerSelection:s}),this.updateMarkerNodes({markerSelection:s,isHighlight:!1,highlightedDatum:a}),this.highlightMarkerSelection=this.updateMarkerSelection({markerData:a!=null?[a]:[],markerSelection:n}),this.updateMarkerNodes({markerSelection:n,isHighlight:!0,highlightedDatum:a}),(i||e)&&this.animationState.transition("resize"),this.animationState.transition("update")}updatePlacedLabelData(t){this.labelSelection=this.labelSelection.update(t,e=>{e.pointerEvents=QV._ModuleSupport.PointerEvents.None}),this.updateLabelNodes({labelSelection:this.labelSelection})}updateLabelNodes(t){const{labelSelection:e}=t,{color:i,fontStyle:s,fontWeight:n,fontSize:a,fontFamily:o}=this.properties.label;e.each((r,{x:l,y:c,width:h,height:u,text:d})=>{r.visible=!0,r.x=l+h/2,r.y=c+u/2,r.text=d,r.fill=i,r.fontStyle=s,r.fontWeight=n,r.fontSize=a,r.fontFamily=o,r.textAlign="center",r.textBaseline="middle"})}updateMarkerSelection(t){const{markerData:e,markerSelection:i}=t;return i.update(e,void 0,s=>aG([s.index,s.idValue,s.lonValue,s.latValue]))}getMarkerItemBaseStyle(t){const{properties:e}=this,i=t?e.highlightStyle.item:void 0;return{shape:e.shape,size:e.size,fill:i?.fill??e.fill,fillOpacity:i?.fillOpacity??e.fillOpacity,stroke:i?.stroke??e.stroke,strokeWidth:i?.strokeWidth??this.getStrokeWidth(e.strokeWidth),strokeOpacity:i?.strokeOpacity??e.strokeOpacity,lineDash:i?.lineDash??e.lineDash,lineDashOffset:i?.lineDashOffset??e.lineDashOffset}}getMarkerItemStyleOverrides(t,e,i,s,n,a){const{id:o,properties:r,colorScale:l,sizeScale:c}=this,{colorRange:h,itemStyler:u}=r;let d;if(!a&&i!=null&&(d??(d={}),d.fill=this.isColorScaleValid()?l.convert(i):h?.[0]??r.fill),s!=null&&(d??(d={}),d.size=c.convert(s,!0)),u!=null){const p=this.cachedDatumCallback(aG(t,a?"highlight":"node"),()=>u({seriesId:o,datum:e,highlighted:a,...n,...d}));d??(d={}),Object.assign(d,p)}return d}updateMarkerNodes(t){const{markerSelection:e,isHighlight:i,highlightedDatum:s}=t,n=this.getMarkerItemBaseStyle(i);e.each((a,o)=>{const{datumIndex:r,datum:l,point:c,colorValue:h,sizeValue:u}=o,d=this.getMarkerItemStyleOverrides(String(r),l,h,u,n,i);a.shape=d?.shape??n.shape,a.size=d?.size??n.size,ldt(a,n,d),a.translationX=c.x,a.translationY=c.y,a.zIndex=!i&&s!=null&&l===s.datum?1:0})}isProcessedDataAnimatable(){return!0}resetAnimation(t){t==="initial"?this.animationState.transition("reset"):t==="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()}animateMarkers(){const{animationManager:t}=this.ctx,e=xut();tdt(this.id,"markers",t,[this.markerSelection,this.highlightMarkerSelection],e)}getLabelData(){return this.isLabelEnabled()?this.contextNodeData?.labelData??[]:[]}pickNodeClosestDatum(t){const{x:e,y:i}=t;let s=1/0,n;return this.contextNodeData?.nodeData.forEach(a=>{const{x:o,y:r,size:l}=a.point,c=Math.max(Math.abs(o-e)-l,0),h=Math.max(Math.abs(r-i)-l,0),u=c*c+h*h;u=0?"N":"S"}, ${Math.abs(N).toFixed(4)}\xB0 ${N>=0?"W":"E"}`}const O=this.getMarkerItemBaseStyle(!1);return Object.assign(O,this.getMarkerItemStyleOverrides(String(S),S,D,T,O,!1)),v.formatTooltip({heading:C,title:m??b,symbol:this.legendItemSymbol(S),data:L},{seriesId:e,datum:A,title:m,idKey:a,idName:o,latitudeKey:r,latitudeName:l,longitudeKey:c,longitudeName:h,colorKey:u,colorName:d,sizeKey:p,sizeName:g,labelKey:f,labelName:x,...O})}getFormattedMarkerStyle(t){const{datumIndex:e,colorValue:i,sizeValue:s}=t,n=this.getMarkerItemBaseStyle(!1);return Object.assign(n,this.getMarkerItemStyleOverrides(String(e),e,i,s,n,!1)),{size:n.size}}computeFocusBounds(t){return sdt(this,t)}};Gv.className="MapMarkerSeries",Gv.type="map-marker",y([Jut(zo,{optional:!0,property:"topology"})],Gv.prototype,"_chartTopology",2);var{DEFAULT_DIVERGING_SERIES_COLOR_RANGE:cdt}=ZV._ModuleSupport.ThemeSymbols,hdt={type:"series",optionsKey:"series[]",packageType:"enterprise",chartTypes:["topology"],identifier:"map-marker",moduleFactory:t=>new Gv(t),tooltipDefaults:{range:"exact"},themeTemplate:{...Ay,series:{shape:"circle",maxSize:30,fillOpacity:.5,label:{color:{$ref:"textColor"}}}},paletteFactory:t=>{const{takeColors:e,colorsCount:i,userPalette:s,themeTemplateParameters:n}=t,{fill:a,stroke:o}=ZV._ModuleSupport.singleSeriesPaletteFactory(t),r=n.get(cdt),{fills:l}=e(i);return{fill:a,stroke:o,colorRange:s==="inbuilt"?r:[l[0],l[1]]}}},udt=(R(),E(w)),ddt=(R(),E(w)),pdt=(R(),E(w)),{COLOR_STRING:rG,LINE_DASH:gdt,OBJECT:fdt,POSITIVE_NUMBER:lG,RATIO:cG,Validate:Br,SeriesProperties:ydt,SeriesTooltip:mdt}=pdt._ModuleSupport,Fo=class extends ydt{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=new mdt}};y([Br(zo,{optional:!0})],Fo.prototype,"topology",2),y([Br(rG)],Fo.prototype,"fill",2),y([Br(cG)],Fo.prototype,"fillOpacity",2),y([Br(rG)],Fo.prototype,"stroke",2),y([Br(cG)],Fo.prototype,"strokeOpacity",2),y([Br(lG)],Fo.prototype,"strokeWidth",2),y([Br(gdt)],Fo.prototype,"lineDash",2),y([Br(lG)],Fo.prototype,"lineDashOffset",2),y([Br(fdt)],Fo.prototype,"tooltip",2);var{createDatumId:xdt,SeriesNodePickMode:bdt,Validate:Sdt,Selection:vdt,Group:Mdt,PointerEvents:Idt}=ddt._ModuleSupport,Wv=class extends ky{constructor(t){super({moduleCtx:t,useLabelLayer:!0,pickModes:[bdt.EXACT_SHAPE_MATCH]}),this.properties=new Fo,this._chartTopology=void 0,this.itemGroup=this.contentGroup.appendChild(new Mdt({name:"itemGroup"})),this.datumSelection=vdt.select(this.itemGroup,()=>this.nodeFactory())}get topology(){return this.properties.topology??this._chartTopology}get focusable(){return!1}setOptionsData(){}setChartData(){}getNodeData(){}get hasData(){return!1}renderToOffscreenCanvas(){return!0}setChartTopology(t){this._chartTopology=t,this.topology===t&&(this.nodeDataRefresh=!0)}setSeriesIndex(t){return super.setSeriesIndex(t)?(this.contentGroup.zIndex=[0,t,0],this.highlightGroup.zIndex=[0,t,1],!0):!1}nodeFactory(){const t=new dp;return t.renderMode=1,t.lineJoin="round",t.pointerEvents=Idt.None,t}processData(){const{topology:t}=this;this.topologyBounds=t?.features.reduce((e,i)=>{const s=i.geometry;return s==null?e:pp(s,e)},void 0),t==null&&Gt.warnOnce("no topology was provided for [MapShapeBackgroundSeries]; nothing will be rendered.")}createNodeData(){const{id:t,topology:e,scale:i}=this;if(e==null)return;const s=[],n=[];return e.features.forEach((a,o)=>{const{geometry:r}=a,l=r!=null&&i!=null?ql(r,i):void 0;l!=null&&s.push({series:this,itemId:o,datum:a,datumIndex:0,index:o,projectedGeometry:l})}),{itemId:t,nodeData:s,labelData:n}}updateSelections(){this.nodeDataRefresh&&(this.contextNodeData=this.createNodeData(),this.nodeDataRefresh=!1)}update(){const{datumSelection:t}=this;this.updateSelections(),this.contentGroup.visible=this.visible;const{nodeData:e=[]}=this.contextNodeData??{};this.datumSelection=this.updateDatumSelection({nodeData:e,datumSelection:t}),this.updateDatumNodes({datumSelection:t})}updateDatumSelection(t){return t.datumSelection.update(t.nodeData,void 0,e=>xdt(e.index))}updateDatumNodes(t){const{properties:e}=this,{datumSelection:i}=t,{fill:s,fillOpacity:n,stroke:a,strokeOpacity:o,lineDash:r,lineDashOffset:l}=e,c=this.getStrokeWidth(e.strokeWidth);i.each((h,u)=>{const{projectedGeometry:d}=u;if(d==null){h.visible=!1,h.projectedGeometry=void 0;return}h.visible=!0,h.projectedGeometry=d,h.fill=s,h.fillOpacity=n,h.stroke=a,h.strokeWidth=c,h.strokeOpacity=o,h.lineDash=r,h.lineDashOffset=l})}resetAnimation(){}getLegendData(){return[]}getTooltipContent(t){}pickFocus(){}computeFocusBounds(t){}};Wv.className="MapShapeBackgroundSeries",Wv.type="map-shape-background",y([Sdt(zo,{optional:!0,property:"topology"})],Wv.prototype,"_chartTopology",2);var{DEFAULT_HIERARCHY_FILLS:Adt}=udt._ModuleSupport.ThemeSymbols,Ddt={type:"series",optionsKey:"series[]",packageType:"enterprise",chartTypes:["topology"],identifier:"map-shape-background",moduleFactory:t=>new Wv(t),tooltipDefaults:{range:"exact"},themeTemplate:{...Ay,series:{stroke:{$ref:"backgroundColor"},strokeWidth:1}},paletteFactory:({themeTemplateParameters:t})=>({fill:t.get(Adt)?.[1]})},hG=(R(),E(w)),uG=(R(),E(w));function kdt(t,{aspectRatio:e,precision:i}){const s=qV(t,i,(l,c,h,u)=>{const d=Tdt(l,c,h,e),p=d+2*u*e,g=d*Math.SQRT2,f=p*Math.SQRT2;return{distance:g,maxDistance:f}});if(s==null)return;const{x:n,y:a,distance:o}=s,r=o/Math.SQRT2;return{x:n,y:a,maxWidth:r}}function Ldt(t,e,i,s,n){const[a,o]=t,[r,l]=e,c=1/n,h=r-a,u=l-o,[d,p]=o<=l?t:e,[g,f]=a<=r?t:e,[x,m]=o<=l?e:t,[b,v]=a<=r?e:t;let S=1/0;if(h!==0){const O=u/h;for(let _=0;_<=1;_+=1){const N=_===0?c:-c,P=(O*a-o-N*i+s)/(O-N);if(P>=g&&P<=b){const j=Math.abs(i-P)*2;S=Math.min(S,j)}}}else for(let O=0;O<=1;O+=1){const N=(O===0?c:-c)*(a-i)+s;if(N>=p&&N<=m){const j=Math.abs(s-N)*2*n;S=Math.min(S,j)}}const A=n,T=Math.abs((d-i)/(p-s)),D=Math.abs((x-i)/(m-s));if(ms&&Ti&&Li!=c>i&&e<(l-u)*(i-d)/(c-d)+u&&(n=!n);const p=Ldt(r,h,e,i,s);a=Math.min(a,p),r=h,l=u,c=d}}return(n?1:-1)*a}function Uv(t,e,i){i>=e&&(t.maxX=Math.min(t.maxX,i-e)),i<=e&&(t.minX=Math.max(t.minX,i-e))}function Cdt(t,e,i,s,n,a){const o=n-a/2,r=n+a/2,[l,c]=e,[h,u]=i,d=h-l,p=u-c,[g,f]=l<=h?e:i,[x,m]=l<=h?i:e;if(d!==0){const b=p/d;for(let v=0;v<=1;v+=1){const A=((v===0?o:r)-c)/b+l;A>=g&&A<=x&&Uv(t,s,A)}}else Math.max(o,Math.min(c,u))<=Math.min(r,Math.max(c,u))&&Uv(t,s,l);return x=o&&m<=r?Uv(t,s,x):g>s&&f>=o&&f<=r&&Uv(t,s,g),t}function Ndt(t,e,i,s){const n={minX:-1/0,maxX:1/0};for(const r of t){let l=r[r.length-1];for(const c of r)Cdt(n,l,c,e,i,s),l=c}const{minX:a,maxX:o}=n;return Number.isFinite(a)&&Number.isFinite(o)?{x:e+(a+o)/2,width:o-a}:{x:e,width:0}}var Odt=(R(),E(w)),{AND:wdt,ARRAY:Edt,COLOR_STRING:dG,COLOR_STRING_ARRAY:Rdt,FUNCTION:_dt,LINE_DASH:Pdt,OBJECT:pG,POSITIVE_NUMBER:IC,RATIO:gG,STRING:zr,Validate:ze,SeriesProperties:Bdt,SeriesTooltip:zdt}=Odt._ModuleSupport,Ne=class extends Bdt{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 Sy,this.tooltip=new zdt}};y([ze(zo,{optional:!0})],Ne.prototype,"topology",2),y([ze(zr,{optional:!0})],Ne.prototype,"title",2),y([ze(zr,{optional:!0})],Ne.prototype,"legendItemName",2),y([ze(zr)],Ne.prototype,"idKey",2),y([ze(zr,{optional:!0})],Ne.prototype,"idName",2),y([ze(zr)],Ne.prototype,"topologyIdKey",2),y([ze(zr,{optional:!0})],Ne.prototype,"labelKey",2),y([ze(zr,{optional:!0})],Ne.prototype,"labelName",2),y([ze(zr,{optional:!0})],Ne.prototype,"colorKey",2),y([ze(zr,{optional:!0})],Ne.prototype,"colorName",2),y([ze(wdt(Rdt,Edt.restrict({minLength:1})),{optional:!0})],Ne.prototype,"colorRange",2),y([ze(dG)],Ne.prototype,"fill",2),y([ze(gG)],Ne.prototype,"fillOpacity",2),y([ze(dG)],Ne.prototype,"stroke",2),y([ze(gG)],Ne.prototype,"strokeOpacity",2),y([ze(IC)],Ne.prototype,"strokeWidth",2),y([ze(Pdt)],Ne.prototype,"lineDash",2),y([ze(IC)],Ne.prototype,"lineDashOffset",2),y([ze(IC)],Ne.prototype,"padding",2),y([ze(_dt,{optional:!0})],Ne.prototype,"itemStyler",2),y([ze(pG)],Ne.prototype,"label",2),y([ze(pG)],Ne.prototype,"tooltip",2);var{getMissCount:Fdt,createDatumId:fG,SeriesNodePickMode:yG,valueProperty:Hv,Validate:jdt,CachedTextMeasurerPool:Vdt,TextUtils:mG,ColorScale:Gdt,Group:xG,Selection:AC,Text:Wdt,PointerEvents:Udt,applyShapeStyle:Hdt}=uG._ModuleSupport,bG=uG._ModuleSupport.MercatorScale.fixedScale(),Yv=class extends ky{constructor(t){super({moduleCtx:t,useLabelLayer:!0,pickModes:[yG.EXACT_SHAPE_MATCH,yG.NEAREST_NODE]}),this.properties=new Ne,this._chartTopology=void 0,this.colorScale=new Gdt,this.itemGroup=this.contentGroup.appendChild(new xG({name:"itemGroup"})),this.itemLabelGroup=this.contentGroup.appendChild(new xG({name:"itemLabelGroup"})),this.datumSelection=AC.select(this.itemGroup,()=>this.nodeFactory()),this.labelSelection=AC.select(this.itemLabelGroup,Wdt),this.highlightDatumSelection=AC.select(this.highlightNode,()=>this.nodeFactory()),this.previousLabelLayouts=void 0,this._previousDatumMidPoint=void 0,this.itemLabelGroup.pointerEvents=Udt.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(t){this._chartTopology=t,this.topology===t&&(this.nodeDataRefresh=!0)}setSeriesIndex(t){return super.setSeriesIndex(t)?(this.contentGroup.zIndex=[1,t],this.highlightGroup.zIndex=[2,t],!0):!1}isLabelEnabled(){return this.properties.labelKey!=null&&this.properties.label.enabled}nodeFactory(){const t=new dp;return t.renderMode=1,t.lineJoin="round",t}async processData(t){if(this.data==null||!this.properties.isValid())return;const{data:e,topology:i,colorScale:s}=this,{topologyIdKey:n,idKey:a,colorKey:o,labelKey:r,colorRange:l}=this.properties,c=new Map;i?.features.forEach(f=>{const x=f.properties?.[n];x==null||!fC(f.geometry,1)||c.set(x,f)});const h=this.colorScale.type,u=this.scale?.type,{dataModel:d,processedData:p}=await this.requestDataModel(t,e,{props:[Hv(a,u,{id:"idValue",includeProperty:!1}),Hv(a,u,{id:"featureValue",includeProperty:!1,processor:()=>f=>c.get(f)}),...r?[Hv(r,"band",{id:"labelValue"})]:[],...o?[Hv(o,h,{id:"colorValue"})]:[]]}),g=d.resolveColumnById(this,"featureValue",p);if(this.topologyBounds=g.reduce((f,x)=>{const m=x?.geometry;return m==null?f:pp(m,f)},void 0),l!=null&&this.isColorScaleValid()){const f=d.resolveProcessedDataIndexById(this,"colorValue");s.domain=p.domain.values[f],s.range=l,s.update()}i==null&&Gt.warnOnce("no topology was provided for [MapShapeSeries]; nothing will be rendered.")}isColorScaleValid(){const{colorKey:t}=this.properties;if(!t)return!1;const{dataModel:e,processedData:i}=this;if(!e||!i)return!1;const s=e.resolveProcessedDataIndexById(this,"colorValue"),n=i.input.count,a=Fdt(this,i.defs.values[s].missing);return!(n===0||n===a)}getLabelLayout(t,e,i,s,n){if(e==null||s==null)return;const{idKey:a,idName:o,colorKey:r,colorName:l,labelKey:c,labelName:h,padding:u,label:d}=this.properties,p=this.getLabelText(d,{value:e,datum:t,idKey:a,idName:o,colorKey:r,colorName:l,labelKey:c,labelName:h});if(p==null)return;const g=Vdt.measureText(String(p),{font:i}),f=p.split(` `).length,x=(g.width+2*u)/(f*mG.getLineHeight(d.fontSize)+2*u);if(n?.geometry===s&&n?.labelText===p&&n?.aspectRatio===x)return n;const m=ql(s,bG),b=Pv(m);if(b==null)return;const v=kdt(b,{aspectRatio:x,precision:.001});if(v==null)return;const{x:S,y:A,maxWidth:T}=v;return{geometry:s,labelText:p,aspectRatio:x,x:S,y:A,maxWidth:T,fixedPolygon:b}}getLabelDatum(t,e){const{scale:i}=this;if(i==null)return;const{padding:s,label:n}=this.properties,{labelText:a,aspectRatio:o,x:r,y:l,maxWidth:c,fixedPolygon:h}=t,u={width:Math.ceil(c*e),height:Math.ceil(c*e/o),meta:r},d=xy(a,n,{padding:s},(S,A)=>{if(!A)return u;const T=Ndt(h,r,l,S/e);return{width:T.width*e,height:S,meta:T.x}});if(d==null)return;const[{text:p,fontSize:g,lineHeight:f,width:x},m]=d;if(p===mG.EllipsisChar)return;const b=x{const L=u[D],C=g?.[D],O=p?.[D],_=d[D]?.geometry??void 0;_==null&&v.push(L);const N=this.getLabelLayout(T,O,f,_,a?.get(L));N!=null&&x.set(L,N);const P=N!=null&&n!=null?this.getLabelDatum(N,h):void 0;P!=null&&b.push(P);const j=_!=null&&n!=null?ql(_,n):void 0;m.push({series:this,itemId:o,datum:T,datumIndex:D,idValue:L,colorValue:C,labelValue:O,projectedGeometry:j})});const A=10;if(v.length>A){const T=v.length-A;v.length=A,v.push(`(+${T} more)`)}return v.length>0&&Gt.warnOnce("some data items do not have matches in the provided topology",v),{itemId:t,nodeData:m,labelData:b}}updateSelections(){this.nodeDataRefresh&&(this.contextNodeData=this.createNodeData(),this.nodeDataRefresh=!1)}update(){const{datumSelection:t,labelSelection:e,highlightDatumSelection:i}=this;this.updateSelections(),this.contentGroup.visible=this.visible,this.contentGroup.opacity=this.getOpacity();let s=this.ctx.highlightManager?.getActiveHighlight();s!=null&&(s.series!==this||s.datum==null)&&(s=void 0);const n=this.contextNodeData?.nodeData??[],a=this.contextNodeData?.labelData??[];this.datumSelection=this.updateDatumSelection({nodeData:n,datumSelection:t}),this.updateDatumNodes({datumSelection:t,isHighlight:!1}),this.labelSelection=this.updateLabelSelection({labelData:a,labelSelection:e}),this.updateLabelNodes({labelSelection:e}),this.highlightDatumSelection=this.updateDatumSelection({nodeData:s!=null?[s]:[],datumSelection:i}),this.updateDatumNodes({datumSelection:i,isHighlight:!0})}updateDatumSelection(t){return t.datumSelection.update(t.nodeData,void 0,e=>fG(e.idValue))}getItemBaseStyle(t){const{properties:e}=this,i=t?e.highlightStyle.item:void 0;return{fill:i?.fill??e.fill,fillOpacity:i?.fillOpacity??e.fillOpacity,stroke:i?.stroke??e.stroke,strokeWidth:i?.strokeWidth??this.getStrokeWidth(e.strokeWidth),strokeOpacity:i?.strokeOpacity??e.strokeOpacity,lineDash:i?.lineDash??e.lineDash,lineDashOffset:i?.lineDashOffset??e.lineDashOffset}}getItemStyleOverrides(t,e,i,s,n){const{id:a,properties:o,colorScale:r}=this,{colorRange:l,itemStyler:c}=o;let h;if(!n&&i!=null&&(h??(h={}),h.fill=this.isColorScaleValid()?r.convert(i):l?.[0]??o.fill),c!=null){const u=this.cachedDatumCallback(fG(t,n?"highlight":"node"),()=>c({seriesId:a,datum:e,highlighted:n,...s,...h}));h??(h={}),Object.assign(h,u)}return h}updateDatumNodes(t){const{datumSelection:e,isHighlight:i}=t,s=this.getItemBaseStyle(i);e.each((n,a)=>{const{datum:o,datumIndex:r,colorValue:l,projectedGeometry:c}=a;if(c==null){n.visible=!1,n.projectedGeometry=void 0;return}const h=this.getItemStyleOverrides(String(r),o,l,s,i);n.visible=!0,n.projectedGeometry=c,Hdt(n,s,h)})}updateLabelSelection(t){const e=this.isLabelEnabled()?t.labelData:[];return t.labelSelection.update(e)}updateLabelNodes(t){const{labelSelection:e}=t,{color:i,fontStyle:s,fontWeight:n,fontFamily:a}=this.properties.label;e.each((o,{x:r,y:l,text:c,fontSize:h,lineHeight:u})=>{o.visible=!0,o.x=r,o.y=l,o.text=c,o.fill=i,o.fontStyle=s,o.fontWeight=n,o.fontSize=h,o.lineHeight=u,o.fontFamily=a,o.textAlign="center",o.textBaseline="middle"})}resetAnimation(){}pickNodeClosestDatum({x:t,y:e}){let i=1/0,s;return this.datumSelection.each((n,a)=>{const o=n.distanceSquared(t,e);onew Yv(t),tooltipDefaults:{range:"exact"},themeTemplate:{...Ay,series:{fillOpacity:1,strokeWidth:1,lineDash:[0],lineDashOffset:0,padding:2,label:{color:{$ref:"backgroundColor"},fontFamily:{$ref:"fontFamily"},fontSize:{$ref:"fontSize"},fontWeight:"bold",overflowStrategy:"hide"}}},paletteFactory:t=>{const{takeColors:e,colorsCount:i,userPalette:s,themeTemplateParameters:n}=t,{fill:a}=hG._ModuleSupport.singleSeriesPaletteFactory(t),o=n.get(Ydt),{fills:r}=e(i);return{fill:a,stroke:n.get(Kdt),colorRange:s==="inbuilt"?o:[r[0],r[1]]}}},Xdt=(R(),E(w)),Zdt=(R(),E(w)),DC=(R(),E(w)),{ChartAxisDirection:Fr,PolarAxis:Qdt,diff:qdt,fixNumericExtent:Jdt,groupAccumulativeValueProperty:SG,keyProperty:tpt,normaliseGroupTo:ept,resetLabelFn:ipt,seriesLabelFadeInAnimation:spt,seriesLabelFadeOutAnimation:npt,valueProperty:apt,animationValidation:opt,createDatumId:vG,SeriesNodePickMode:MG,normalizeAngle360:IG,CategoryScale:rpt,motion:AG,applyShapeStyle:lpt}=DC._ModuleSupport,cpt=class extends DC._ModuleSupport.SeriesNodeEvent{constructor(t,e,i,s){super(t,e,i,s),this.angleKey=s.properties.angleKey,this.radiusKey=s.properties.radiusKey}},DG=class extends DC._ModuleSupport.PolarSeries{constructor(t,{animationResetFns:e}){super({moduleCtx:t,useLabelLayer:!0,canHaveAxes:!0,pickModes:[MG.NEAREST_NODE,MG.EXACT_SHAPE_MATCH],animationResetFns:{...e,label:ipt}}),this.NodeEvent=cpt,this.groupScale=new rpt,this.circleCache={r:0,cx:0,cy:0}}getSeriesDomain(t){const{dataModel:e,processedData:i}=this;if(!i||!e)return[];if(t===Fr.X)return e.getDomain(this,"angleValue","key",i);{const s=e.getDomain(this,"radiusValue-end","value",i),n=Number.isFinite(s[1]-s[0])?[s[0]>0?0:s[0],s[1]<0?0:s[1]]:[];return Jdt(n)}}async processData(t){const{visible:e}=this,{angleKey:i,radiusKey:s,normalizedTo:n}=this.properties,a=!this.ctx.animationManager.isSkipped();if(!this.properties.isValid())return;const o=this.getStackId(),r=`${o}-trailing`,l=[];Fi(n)&&l.push(ept([o,r],Math.abs(n))),a&&this.processedData&&l.push(qdt(this.id,this.processedData)),a&&l.push(opt());const c=e||!a?{}:{forceValue:0},h=this.axes[Fr.Y]?.scale.type,u=this.axes[Fr.X]?.scale.type;await this.requestDataModel(t,this.data,{props:[tpt(i,u,{id:"angleValue"}),apt(s,h,{id:"radiusValue-raw",invalidValue:null,...c}),...SG(s,"normal","current",{id:"radiusValue-end",rangeId:"radiusValue-range",invalidValue:null,groupId:o,separateNegative:!0,...c},h),...SG(s,"trailing","current",{id:"radiusValue-start",invalidValue:null,groupId:r,separateNegative:!0,...c},h),...l],groupByKeys:!0,groupByData:!1}),this.animationState.transition("updateData")}didCircleChange(){const t=this.radius,e=this.centerX,i=this.centerY,s=this.circleCache;return t!==s.r||e!==s.cx||i!==s.cy?(this.circleCache={r:t,cx:e,cy:i},!0):!1}isRadiusAxisReversed(){return this.axes[Fr.Y]?.isReversed()}maybeRefreshNodeData(){if(!this.didCircleChange()&&!this.nodeDataRefresh)return;const{nodeData:e=[]}=this.createNodeData()??{};this.nodeData=e,this.nodeDataRefresh=!1}getAxisInnerRadius(){const t=this.axes[Fr.Y];return t instanceof Qdt?this.radius*t.innerRadiusRatio:0}createNodeData(){const{processedData:t,dataModel:e,groupScale:i}=this;if(!e||!t||t.type!=="grouped"||!this.properties.isValid())return;const s=this.axes[Fr.X],n=this.axes[Fr.Y],a=s?.scale,o=n?.scale;if(!a||!o)return;const r=e.resolveKeysById(this,"angleValue",t),l=e.resolveColumnById(this,"radiusValue-start",t),c=e.resolveColumnById(this,"radiusValue-end",t),h=e.resolveColumnById(this,"radiusValue-raw",t),u=e.resolveProcessedDataIndexById(this,"radiusValue-range");let d=0,p=0;s instanceof ph&&(d=s.groupPaddingInner,p=s.paddingInner);const f=(a.bandwidth??0)*(1-p),{index:x,visibleGroupCount:m}=this.ctx.seriesStateManager.getVisiblePeerGroupIndex(this);i.domain=Array.from({length:m}).map((V,W)=>String(W)),i.range=[-f/2,f/2],i.paddingInner=m>1?d:0;const b=this.isRadiusAxisReversed(),v=b?this.radius:this.getAxisInnerRadius(),S=b?this.getAxisInnerRadius():this.radius,A=S+v,{angleKey:T,radiusKey:D,angleName:L,radiusName:C,label:O}=this.properties,_=(V,W,H,G)=>{const B=this.getLabelText(O,{value:W,datum:V,angleKey:T,radiusKey:D,angleName:L,radiusName:C});if(B)return{x:H,y:G,text:B,textAlign:"center",textBaseline:"middle"}},N=[],P={itemId:D,nodeData:N,labelData:N};if(!this.visible)return P;const{dataSources:j}=t,F=j.get(this.id)??[];for(const{datumIndex:V,group:W}of e.forEachGroupDatum(this,t)){const H=F[V],G=r[V];if(G==null)return;const B=h[V],z=B>=0&&!Object.is(B,-0),U=l[V],Y=c[V],K=W.aggregation[u][z?1:0]??0,Z=z===b;if(U===void 0||Y===void 0)return;let X,Q;if(F.length===1)X=-.5*Math.PI,Q=1.5*Math.PI;else{const Mt=a.convert(G);X=IG(Mt+i.convert(String(x))),Q=IG(X+i.bandwidth)}const $=X+i.bandwidth/2,q=A-o.convert(U),J=A-o.convert(Y),nt=(q+J)/2,it=A-o.convert(0),rt=A-o.convert(K),dt=Math.cos($)*nt,at=Math.sin($)*nt,Dt=this.properties.label.enabled?_(H,B,dt,at):void 0,kt=this.getColumnWidth(X,Q);N.push({series:this,datum:H,datumIndex:V,point:{x:dt,y:at,size:0},midPoint:{x:dt,y:at},label:Dt,angleValue:G,radiusValue:B,negative:Z,innerRadius:q,outerRadius:J,stackInnerRadius:it,stackOuterRadius:rt,startAngle:X,endAngle:Q,axisInnerRadius:v,axisOuterRadius:S,columnWidth:kt,index:V})}return{itemId:D,nodeData:N,labelData:N}}getColumnWidth(t,e){return NaN}update({seriesRect:t}){const e=this.checkResize(t);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(),e&&this.animationState.transition("resize"),this.animationState.transition("update")}getItemBaseStyle(t){const{properties:e}=this,i=t?e.highlightStyle.item:void 0;return{fill:i?.fill??e.fill,fillOpacity:i?.fillOpacity??e.fillOpacity,stroke:i?.stroke??e.stroke,strokeWidth:i?.strokeWidth??this.getStrokeWidth(e.strokeWidth),strokeOpacity:i?.strokeOpacity??e.strokeOpacity,lineDash:i?.lineDash??e.lineDash,lineDashOffset:i?.lineDashOffset??e.lineDashOffset,cornerRadius:e.cornerRadius}}getItemStyleOverrides(t,e,i,s){const{id:n,properties:a}=this,{angleKey:o,radiusKey:r,itemStyler:l}=a;if(l!=null)return this.cachedDatumCallback(vG(t,s?"highlight":"node"),()=>l({seriesId:n,datum:e,highlighted:s,angleKey:o,radiusKey:r,...i}))}updateSectorSelection(t,e){let i=[];if(e){const n=this.ctx.highlightManager?.getActiveHighlight();n?.datum&&n.series===this&&i.push(n)}else i=this.nodeData;const s=this.getItemBaseStyle(e);t.update(i,void 0,n=>this.getDatumId(n)).each((n,a)=>{const{datum:o,datumIndex:r}=a,l=this.getItemStyleOverrides(String(r),o,s,e);this.updateItemPath(n,a,e),lpt(n,s,l),n.cornerRadius=l?.cornerRadius??s.cornerRadius,n.lineJoin="round"})}updateLabels(){const{label:t}=this.properties;this.labelSelection.update(this.nodeData).each((e,i)=>{t.enabled&&i.label?(e.x=i.label.x,e.y=i.label.y,e.fill=t.color,e.fontFamily=t.fontFamily,e.fontSize=t.fontSize,e.fontStyle=t.fontStyle,e.fontWeight=t.fontWeight,e.text=i.label.text,e.textAlign=i.label.textAlign,e.textBaseline=i.label.textBaseline,e.visible=!0):e.visible=!1})}animateEmptyUpdateReady(){const{labelSelection:t}=this,e=this.getColumnTransitionFunctions();AG.fromToMotion(this.id,"datums",this.ctx.animationManager,[this.itemSelection],e),spt(this,"labels",this.ctx.animationManager,t)}animateClearingUpdateEmpty(){const{itemSelection:t}=this,{animationManager:e}=this.ctx,i=this.getColumnTransitionFunctions();AG.fromToMotion(this.id,"datums",e,[t],i),npt(this,"labels",e,this.labelSelection)}getTooltipContent(t){const{id:e,dataModel:i,processedData:s,axes:n,properties:a}=this,{angleKey:o,angleName:r,radiusKey:l,radiusName:c,tooltip:h}=a,u=n[Fr.X],d=n[Fr.Y];if(!i||!s||!u||!d)return;const{datumIndex:p}=t,g=s.dataSources.get(this.id)?.[p],f=i.resolveKeysById(this,"angleValue",s)[p],x=i.resolveColumnById(this,"radiusValue-raw",s)[p];if(f==null)return;const m=this.getItemBaseStyle(!1);return Object.assign(m,this.getItemStyleOverrides(String(p),p,m,!1)),h.formatTooltip({heading:u.formatDatum(f),symbol:this.legendItemSymbol(),data:[{label:c,fallbackLabel:l,value:d.formatDatum(x)}]},{seriesId:e,datum:g,title:r,angleKey:o,angleName:r,radiusKey:l,radiusName:c,...m})}pickNodeClosestDatum(t){return this.pickNodeNearestDistantObject(t,this.itemSelection.nodes())}legendItemSymbol(){const{fill:t,stroke:e,fillOpacity:i,strokeOpacity:s,strokeWidth:n,lineDash:a,lineDashOffset:o}=this.properties;return{marker:{fill:t??"rgba(0, 0, 0, 0)",stroke:e??"rgba(0, 0, 0, 0)",fillOpacity:i,strokeOpacity:s,strokeWidth:n,lineDash:a,lineDashOffset:o}}}getLegendData(t){if(!this.properties.isValid()||t!=="category")return[];const{id:e,visible:i}=this,{radiusKey:s,radiusName:n,showInLegend:a}=this.properties;return[{legendType:"category",id:e,itemId:s,seriesId:e,enabled:i,label:{text:n??s},symbol:this.legendItemSymbol(),hideInLegend:!a}]}getDatumId(t){return vG(t.angleValue)}computeLabelsBBox(){return null}},hpt=(R(),E(w)),{SeriesProperties:upt,SeriesTooltip:dpt,Validate:Ni,COLOR_STRING:kG,NUMBER:LG,FUNCTION:ppt,LINE_DASH:gpt,OBJECT:TG,POSITIVE_NUMBER:kC,RATIO:CG,STRING:Ty,Label:fpt}=hpt._ModuleSupport,li=class extends upt{constructor(){super(...arguments),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 fpt,this.tooltip=new dpt}};y([Ni(Ty)],li.prototype,"angleKey",2),y([Ni(Ty,{optional:!0})],li.prototype,"angleName",2),y([Ni(Ty)],li.prototype,"radiusKey",2),y([Ni(Ty,{optional:!0})],li.prototype,"radiusName",2),y([Ni(kG)],li.prototype,"fill",2),y([Ni(CG)],li.prototype,"fillOpacity",2),y([Ni(kG)],li.prototype,"stroke",2),y([Ni(kC)],li.prototype,"strokeWidth",2),y([Ni(CG)],li.prototype,"strokeOpacity",2),y([Ni(gpt)],li.prototype,"lineDash",2),y([Ni(kC)],li.prototype,"lineDashOffset",2),y([Ni(kC)],li.prototype,"cornerRadius",2),y([Ni(ppt,{optional:!0})],li.prototype,"itemStyler",2),y([Ni(LG)],li.prototype,"rotation",2),y([Ni(Ty,{optional:!0})],li.prototype,"stackGroup",2),y([Ni(LG,{optional:!0})],li.prototype,"normalizedTo",2),y([Ni(TG)],li.prototype,"label",2),y([Ni(TG)],li.prototype,"tooltip",2);var ypt=(R(),E(w)),mpt=(R(),E(w)),{motion:xpt}=mpt._ModuleSupport;function NG(){const t={startAngle:new Map,endAngle:new Map},e=["startAngle","endAngle"],i=(o,r,l)=>{e.forEach(c=>{const h=t[c];let u=(l==="removed"||l==="updated"?o:r)[c],d=(l==="removed"?o:r)[c];isNaN(d)&&(d=o.previousDatum?.[c]??NaN);const p=u-d;Math.abs(p)>Math.PI&&(u-=Math.sign(p)*2*Math.PI),h.set(r,{from:u,to:d})})},s=(o,r)=>({startAngle:t.startAngle.get(o)[r],endAngle:t.endAngle.get(o)[r]});return{calculate:i,from:o=>s(o,"from"),to:o=>s(o,"to")}}function OG(t,e,i){if(i==="updated"){if(t.previousDatum==null||isNaN(t.previousDatum.startAngle)||isNaN(t.previousDatum.endAngle))return"added";if(isNaN(e.startAngle)||isNaN(e.endAngle))return"removed"}return i==="added"&&t.previousDatum!=null?"updated":i}function bpt(t){const e=NG();return{toFn:(n,a,o)=>{const{startAngle:r,endAngle:l}=e.to(a);let c,h,u,d,p;return o==="removed"?(c=n.innerRadius,h=n.innerRadius,u=n.columnWidth,d=n.axisInnerRadius,p=n.axisOuterRadius):(c=isNaN(a.innerRadius)?t:a.innerRadius,h=isNaN(a.outerRadius)?t:a.outerRadius,u=isNaN(a.columnWidth)?n.columnWidth:a.columnWidth,d=a.axisInnerRadius,p=a.axisOuterRadius),{innerRadius:c,outerRadius:h,columnWidth:u,axisInnerRadius:d,axisOuterRadius:p,startAngle:r,endAngle:l}},fromFn:(n,a,o)=>{o=OG(n,a,o),e.calculate(n,a,o);const{startAngle:r,endAngle:l}=e.from(a);let c,h,u,d,p;o==="removed"||o==="updated"?(c=n.innerRadius,h=n.outerRadius,u=n.columnWidth,d=n.axisInnerRadius,p=n.axisOuterRadius):(c=t,h=t,u=a.columnWidth,d=a.axisInnerRadius,p=a.axisOuterRadius);const g=xpt.NODE_UPDATE_STATE_TO_PHASE_MAPPING[o];return{innerRadius:c,outerRadius:h,columnWidth:u,axisInnerRadius:d,axisOuterRadius:p,startAngle:r,endAngle:l,phase:g}}}}function Spt(t,{innerRadius:e,outerRadius:i,columnWidth:s,axisInnerRadius:n,axisOuterRadius:a,startAngle:o,endAngle:r}){return{innerRadius:e,outerRadius:i,columnWidth:s,axisInnerRadius:n,axisOuterRadius:a,startAngle:o,endAngle:r}}var{SectorBox:Kv,motion:vpt}=ypt._ModuleSupport;function LC(t){const{negative:e,innerRadius:i,outerRadius:s,stackInnerRadius:n,stackOuterRadius:a}=t;return{innerRadius:e?a:n,outerRadius:e?n:a,clipInnerRadius:e?s:i,clipOuterRadius:e?i:s}}function Mpt(t){const e=NG();return{toFn:(n,a,o)=>{const{startAngle:r,endAngle:l}=e.to(a);let c,h,u;if(o==="removed")c=t,h=t,u=new Kv(r,l,c,h);else{let d,p;({innerRadius:c,outerRadius:h,clipInnerRadius:d,clipOuterRadius:p}=LC(a)),isNaN(c)&&(c=t),isNaN(h)&&(h=t),isNaN(d)&&(d=t),isNaN(p)&&(p=t),u=new Kv(r,l,d,p)}return{innerRadius:c,outerRadius:h,startAngle:r,endAngle:l,clipSector:u}},fromFn:(n,a,o)=>{o=OG(n,a,o),e.calculate(n,a,o);const{startAngle:r,endAngle:l}=e.from(a);let c,h,u;o==="removed"||o==="updated"?(c=n.innerRadius,h=n.outerRadius,u=n.clipSector):(c=t,h=t),u??(u=new Kv(r,l,c,h));const d=vpt.NODE_UPDATE_STATE_TO_PHASE_MAPPING[o];return{innerRadius:c,outerRadius:h,startAngle:r,endAngle:l,clipSector:u,phase:d}}}}function Ipt(t,e){const{startAngle:i,endAngle:s}=e,{innerRadius:n,outerRadius:a,clipInnerRadius:o,clipOuterRadius:r}=LC(e),l=new Kv(i,s,o,r);return{innerRadius:n,outerRadius:a,startAngle:i,endAngle:s,clipSector:l}}var{Sector:Apt,SectorBox:Dpt,PolarZIndexMap:TC}=Zdt._ModuleSupport,CC=class extends DG{constructor(t){super(t,{animationResetFns:{item:Ipt}}),this.properties=new li}setSeriesIndex(t){return super.setSeriesIndex(t)?(this.contentGroup.zIndex=[0,TC.FOREGROUND,t],this.highlightGroup.zIndex=[0,TC.HIGHLIGHT,t],this.labelGroup.zIndex=[0,TC.LABEL,t],!0):!1}getStackId(){return`nightingale-stack-${this.seriesGrouping?.groupIndex??this.id}-yValues`}nodeFactory(){return new Apt}updateItemPath(t,e,i){const{negative:s}=e;if(t.centerX=0,t.centerY=0,t.startOuterCornerRadius=s?0:this.properties.cornerRadius,t.endOuterCornerRadius=s?0:this.properties.cornerRadius,t.startInnerCornerRadius=s?this.properties.cornerRadius:0,t.endInnerCornerRadius=s?this.properties.cornerRadius:0,i){const{startAngle:n,endAngle:a}=e,{innerRadius:o,outerRadius:r,clipInnerRadius:l,clipOuterRadius:c}=LC(e);t.innerRadius=o,t.outerRadius=r,t.startAngle=n,t.endAngle=a,t.clipSector=new Dpt(n,a,l,c)}}getColumnTransitionFunctions(){const t=this.isRadiusAxisReversed()?this.radius:this.getAxisInnerRadius();return Mpt(t)}};CC.className="NightingaleSeries",CC.type="nightingale";var kpt=(R(),E(w)),{ThemeConstants:{POLAR_AXIS_TYPE:wG,POLAR_AXIS_SHAPE:EG}}=kpt._ModuleSupport,Lpt={series:{strokeWidth:1,label:{enabled:!1,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"textColor"}}},axes:{[wG.ANGLE_CATEGORY]:{shape:EG.CIRCLE,groupPaddingInner:0,paddingInner:0,label:{spacing:10}},[wG.RADIUS_NUMBER]:{shape:EG.CIRCLE}}},{ThemeSymbols:{DEFAULT_POLAR_SERIES_STROKE:Tpt},ThemeConstants:{POLAR_AXIS_TYPE:RG}}=Xdt._ModuleSupport,Cpt={type:"series",optionsKey:"series[]",packageType:"enterprise",chartTypes:["polar"],identifier:"nightingale",moduleFactory:t=>new CC(t),tooltipDefaults:{range:"exact"},defaultAxes:[{type:RG.ANGLE_CATEGORY},{type:RG.RADIUS_NUMBER}],themeTemplate:Lpt,paletteFactory({takeColors:t,userPalette:e}){const{fills:[i],strokes:[s]}=t(1);return{fill:i,stroke:e!=="inbuilt"?s:Tpt}},stackable:!0,groupable:!0,stackedByDefault:!0},Npt=(R(),E(w)),_G=(R(),E(w)),{createDatumId:Opt}=_G._ModuleSupport,NC=class extends gj{constructor(){super(...arguments),this.properties=new mv}nodeFactory(){return new xrt}updateDatumNodes({datumSelection:t,isHighlight:e}){const{id:i,properties:s}=this,{xKey:n,highKey:a,lowKey:o,openKey:r,closeKey:l,item:c,itemStyler:h}=s,{up:u,down:d}=c,{stroke:p,strokeWidth:g,strokeOpacity:f,lineDash:x,lineDashOffset:m}=u,{stroke:b,strokeWidth:v,strokeOpacity:S,lineDash:A,lineDashOffset:T}=d,D=e?s.highlightStyle.item:void 0;t.each((L,C)=>{const{isRising:O,centerX:_,width:N,y:P,height:j,yOpen:F,yClose:V,crisp:W}=C;let H;if(h!=null){const{stroke:G,strokeWidth:B,strokeOpacity:z,lineDash:U,lineDashOffset:Y}=O?u:d;H=this.cachedDatumCallback(Opt(this.getDatumId(C),e?"highlight":"node"),()=>h({seriesId:i,itemId:C.itemId,xKey:n,highKey:a,lowKey:o,openKey:r,closeKey:l,datum:C.datum,strokeOpacity:z,stroke:G,strokeWidth:B,lineDash:U,lineDashOffset:Y,highlighted:e}))}L.centerX=_,L.width=N,L.y=P,L.height=j,L.yOpen=F,L.yClose=V,L.crisp=W,L.stroke=D?.stroke??H?.stroke??(O?p:b),L.strokeWidth=D?.strokeWidth??H?.strokeWidth??(O?g:v),L.strokeOpacity=D?.strokeOpacity??H?.strokeOpacity??(O?f:S),L.lineDash=D?.lineDash??H?.lineDash??(O?x:A),L.lineDashOffset=D?.lineDashOffset??H?.lineDashOffset??(O?m:T),L.strokeAlignment=(H?.strokeWidth??(O?g:v))/2})}getLegendData(t){const{id:e,data:i,ctx:{legendManager:s},visible:n}=this,{xKey:a,yName:o,item:{up:r,down:l},showInLegend:c,legendItemName:h}=this.properties;if(!i?.length||!a||t!=="category")return[];const u=new _G._ModuleSupport.LinearGradient("rgb",[{color:r.stroke,offset:0},{color:r.stroke,offset:.5},{color:l.stroke,offset:.5}],90);return[{legendType:"category",id:e,itemId:e,seriesId:e,enabled:n&&s.getItemEnabled({seriesId:e,itemId:e}),label:{text:h??o??e},symbol:{marker:{fill:u,fillOpacity:r.strokeOpacity,stroke:void 0,strokeWidth:0,strokeOpacity:1,lineDash:[0],lineDashOffset:0}},legendItemName:h,hideInLegend:!c}]}};NC.className="ohlc",NC.type="ohlc";var{CARTESIAN_AXIS_TYPE:$v,CARTESIAN_POSITION:PG}=Npt._ModuleSupport.ThemeConstants,wpt={type:"series",optionsKey:"series[]",packageType:"enterprise",chartTypes:["cartesian"],identifier:"ohlc",moduleFactory:t=>new NC(t),tooltipDefaults:{range:"nearest"},defaultAxes:[{type:$v.NUMBER,position:PG.LEFT},{type:$v.ORDINAL_TIME,position:PG.BOTTOM}],themeTemplate:{animation:{enabled:!1},axes:{[$v.NUMBER]:{crosshair:{snap:!1}},[$v.ORDINAL_TIME]:{groupPaddingInner:0,crosshair:{enabled:!0}}}},groupable:!1,paletteFactory:({takeColors:t,colorsCount:e,userPalette:i,palette:s})=>{if(i==="user-indexed"){const[n]=t(e).strokes;return{item:{up:{stroke:n},down:{stroke:n}}}}return{item:{up:{stroke:s.up.stroke},down:{stroke:s.down.stroke}}}}},Cbt=(R(),E(w)),BG=(R(),E(w)),Ept=(R(),E(w)),{SeriesProperties:Rpt,SeriesTooltip:_pt,Validate:ci,UNION:Ppt,COLOR_STRING_ARRAY:zG,FUNCTION:Bpt,DIRECTION:zpt,BOOLEAN:Fpt,LINE_DASH:jpt,OBJECT:Xv,NUMBER:Vpt,POSITIVE_NUMBER:Zv,RATIO:FG,STRING:jG,Label:VG,DropShadow:Gpt}=Ept._ModuleSupport,Wpt=class extends VG{},OC=class extends VG{constructor(){super(...arguments),this.spacing=0}};y([ci(Vpt)],OC.prototype,"spacing",2),y([ci(Ppt(["before","after"],"a placement"))],OC.prototype,"placement",2);var mi=class extends Rpt{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 Gpt().set({enabled:!1}),this.label=new Wpt,this.stageLabel=new OC,this.tooltip=new _pt}};y([ci(jG)],mi.prototype,"stageKey",2),y([ci(jG)],mi.prototype,"valueKey",2),y([ci(zG)],mi.prototype,"fills",2),y([ci(FG)],mi.prototype,"fillOpacity",2),y([ci(zG)],mi.prototype,"strokes",2),y([ci(Zv)],mi.prototype,"strokeWidth",2),y([ci(FG)],mi.prototype,"strokeOpacity",2),y([ci(jpt)],mi.prototype,"lineDash",2),y([ci(Zv)],mi.prototype,"lineDashOffset",2),y([ci(zpt)],mi.prototype,"direction",2),y([ci(Fpt,{optional:!0})],mi.prototype,"reverse",2),y([ci(Zv)],mi.prototype,"spacing",2),y([ci(Zv,{optional:!0})],mi.prototype,"aspectRatio",2),y([ci(Bpt,{optional:!0})],mi.prototype,"itemStyler",2),y([ci(Xv)],mi.prototype,"shadow",2),y([ci(Xv)],mi.prototype,"label",2),y([ci(Xv)],mi.prototype,"stageLabel",2),y([ci(Xv)],mi.prototype,"tooltip",2);var{valueProperty:GG,SeriesNodePickMode:WG,CachedTextMeasurerPool:Upt,TextUtils:Hpt,createDatumId:Ypt,BBox:wC,Group:EC,Selection:Qv,Text:UG,PointerEvents:HG,applyShapeStyle:Kpt}=BG._ModuleSupport,RC=class extends BG._ModuleSupport.DataModelSeries{constructor(t){super({moduleCtx:t,pickModes:[WG.EXACT_SHAPE_MATCH,WG.NEAREST_NODE]}),this.properties=new mi,this.itemGroup=this.contentGroup.appendChild(new EC({name:"itemGroup"})),this.itemLabelGroup=this.contentGroup.appendChild(new EC({name:"itemLabelGroup"})),this.stageLabelGroup=this.contentGroup.appendChild(new EC({name:"stageLabelGroup"})),this.datumSelection=Qv.select(this.itemGroup,()=>this.nodeFactory()),this.labelSelection=Qv.select(this.itemLabelGroup,UG),this.stageLabelSelection=Qv.select(this.stageLabelGroup,UG),this.highlightDatumSelection=Qv.select(this.highlightNode,()=>this.nodeFactory()),this.itemLabelGroup.pointerEvents=HG.None,this.stageLabelGroup.pointerEvents=HG.None}addChartEventListeners(){this.destroyFns.push(this.ctx.chartEventManager?.addListener("legend-item-click",t=>this.onLegendItemClick(t)))}nodeFactory(){return new _o}getNodeData(){return this.contextNodeData?.nodeData}async processData(t){if(this.data==null||!this.properties.isValid())return;const{id:e,visible:i,ctx:{legendManager:s}}=this,{stageKey:n,valueKey:a}=this.properties,o="band",r="number",l=(h,u,d)=>i&&s.getItemEnabled({seriesId:e,itemId:d}),c=this.visible?{}:{forceValue:0};await this.requestDataModel(t,this.data,{props:[GG(n,o,{id:"xValue"}),GG(a,r,{id:"yValue",...c,validation:l,invalidValue:0})]})}createNodeData(){const{id:t,dataModel:e,processedData:i,properties:s,visible:n,ctx:{legendManager:a}}=this,{stageKey:o,valueKey:r,direction:l,reverse:c=l==="horizontal",spacing:h,aspectRatio:u,label:d,stageLabel:p}=s;if(e==null||i==null)return;const g=l==="horizontal",f=e.resolveColumnById(this,"xValue",i),x=e.resolveColumnById(this,"yValue",i),m=Upt.getMeasurer({font:p.getFont()});let b,v;g?(b="center",v=p.placement==="before"?"bottom":"top"):(b=p.placement==="after"?"left":"right",v="middle");const S=p.enabled?[]:void 0;let A=0,T=0,D=0;const L=i.dataSources.get(this.id)??[];L.forEach((B,z)=>{const U=f[z],Y=x[z],K=n&&a.getItemEnabled({seriesId:t,itemId:z});if(D+=Y,S==null)return;const Z=this.getLabelText(this.properties.stageLabel,{datum:B,value:U,stageKey:o,valueKey:r}),{width:X}=m.measureText(Z),Q=Z.split(` `).length*Hpt.getLineHeight(d.fontSize);A=Math.max(A,X),T=Math.max(T,Q),S.push({x:NaN,y:NaN,text:Z,textAlign:b,textBaseline:v,visible:K})});const C=this._nodeDataDependencies?.seriesRectWidth??0,O=this._nodeDataDependencies?.seriesRectHeight??0,_=h*(i.input.count-1);let N;if(g){const B=T+p.spacing;N=new wC(0,p.placement==="before"?B:0,C,O-B)}else{const B=A+p.spacing;N=new wC(p.placement==="after"?0:B,0,C-B,O)}if(u!=null&&u!==0){const B=l==="horizontal"?1/u:u,z=Math.min(N.width,N.height*B),U=z/B;N=new wC(N.x+(N.width-z)/2,N.y+(N.height-U)/2,z,U)}let P,j;g?j=p.placement==="before"?N.y-p.spacing:N.y+N.height+p.spacing:P=p.placement==="after"?N.x+N.width+p.spacing:N.x-p.spacing;const F=N.width-(g?_:0),V=N.height-(g?0:_);if(F<0||V<0)return;const W=[],H=[];let G=0;return L.forEach((B,z)=>{const U=f[z],Y=x[z],K=n&&a.getItemEnabled({seriesId:t,itemId:z}),Z=G+Y,X=(G+Z)/(2*D),Q=(Z-G)/D,$=g?F*X+h*z:F*.5,q=g?V*.5:V*X+h*z,J=N.x+$,nt=N.y+q;if(S!=null){const Mt=S[z];Mt.x=P??J,Mt.y=j??nt}let it,rt,dt,at;if(g){const Mt=F*Q;it=Mt,dt=Mt;const ft=($+Mt/2)*(V/N.width),xt=($-Mt/2)*(V/N.width);rt=c?N.height-ft:ft,at=c?N.height-xt:xt}else{const Mt=V*Q;rt=Mt,at=Mt;const ft=(q-Mt/2)*(F/N.height),xt=(q+Mt/2)*(F/N.height);it=c?N.width-ft:ft,dt=c?N.width-xt:xt}const Dt=this.getLabelText(d,{datum:B,value:Y,stageKey:o,valueKey:r}),kt={x:J,y:nt,text:Dt,textAlign:"center",textBaseline:"middle",visible:K};H.push(kt),W.push({series:this,itemId:r,datum:B,datumIndex:z,index:z,xValue:U,yValue:Y,x:J,y:nt,top:it,right:rt,bottom:dt,left:at,label:kt,enabled:K,midPoint:{x:J,y:nt}}),G=Z}),{itemId:t,nodeData:W,labelData:H,stageLabelData:S}}updateSelections(){this.nodeDataRefresh&&(this.contextNodeData=this.createNodeData(),this.nodeDataRefresh=!1)}update({seriesRect:t}){this.checkResize(t);const{datumSelection:e,labelSelection:i,stageLabelSelection:s,highlightDatumSelection:n}=this;this.updateSelections(),this.contentGroup.visible=this.visible,this.contentGroup.opacity=this.getOpacity();let a=this.ctx.highlightManager?.getActiveHighlight();a!=null&&(a.series!==this||a.datum==null)&&(a=void 0);const o=this.contextNodeData?.nodeData??[],r=this.contextNodeData?.labelData??[],l=this.contextNodeData?.stageLabelData??[];this.datumSelection=this.updateDatumSelection({nodeData:o,datumSelection:e}),this.updateDatumNodes({datumSelection:e,isHighlight:!1}),this.labelSelection=this.updateLabelSelection({labelData:r,labelSelection:i}),this.updateLabelNodes({labelSelection:i,labelProperties:this.properties.label}),this.stageLabelSelection=this.updateStageLabelSelection({stageLabelData:l,stageLabelSelection:s}),this.updateLabelNodes({labelSelection:s,labelProperties:this.properties.stageLabel}),this.highlightDatumSelection=this.updateDatumSelection({nodeData:a!=null?[a]:[],datumSelection:n}),this.updateDatumNodes({datumSelection:n,isHighlight:!0})}updateDatumSelection(t){return t.datumSelection.update(t.nodeData)}getItemBaseStyle(t){const{properties:e}=this,i=t?e.highlightStyle.item:void 0;return{fill:i?.fill,fillOpacity:i?.fillOpacity??e.fillOpacity,stroke:i?.stroke,strokeWidth:i?.strokeWidth??this.getStrokeWidth(e.strokeWidth),strokeOpacity:i?.strokeOpacity??e.strokeOpacity,lineDash:i?.lineDash??e.lineDash,lineDashOffset:i?.lineDashOffset??e.lineDashOffset}}getItemStyleOverrides(t,e,i,s,n){const{id:a,properties:o}=this,{fills:r,strokes:l,stageKey:c,valueKey:h,itemStyler:u}=o,d=s.fill??r[i%r.length],p=s.stroke??l[i%l.length],g={};if(n||(g.fill=d,g.stroke=p),u!=null){const f=this.cachedDatumCallback(Ypt(t,n?"highlight":"node"),()=>u({seriesId:a,datum:e,stageKey:c,valueKey:h,highlighted:n,fill:d,stroke:p,...s}));Object.assign(g,f)}return g}updateDatumNodes(t){const{datumSelection:e,isHighlight:i}=t,{properties:s}=this,{shadow:n}=s,a=this.getItemBaseStyle(i);e.each((o,r)=>{const{datumIndex:l,datum:c,x:h,y:u,top:d,right:p,bottom:g,left:f}=r,x=this.getItemStyleOverrides(String(l),c,l,a,i);o.x0=h-d/2,o.x1=h+d/2,o.x2=h+g/2,o.x3=h-g/2,o.y0=u-f/2,o.y1=u-p/2,o.y2=u+p/2,o.y3=u+f/2,Kpt(o,a,x),o.fillShadow=n})}updateLabelSelection(t){return t.labelSelection.update(this.properties.label.enabled?t.labelData:[])}updateStageLabelSelection(t){return t.stageLabelSelection.update(t.stageLabelData)}updateLabelNodes(t){const{labelSelection:e,labelProperties:i}=t,{color:s,fontSize:n,fontStyle:a,fontWeight:o,fontFamily:r}=i;e.each((l,{visible:c,x:h,y:u,text:d,textAlign:p,textBaseline:g})=>{l.visible=c,l.x=h,l.y=u,l.text=d,l.fill=s,l.fontStyle=a,l.fontWeight=o,l.fontSize=n,l.fontFamily=r,l.textAlign=p,l.textBaseline=g})}resetAnimation(t){}computeFocusBounds(t){const e=this.getNodeData()?.[t.datumIndex];if(e!==void 0){for(const i of this.datumSelection)if(i.datum===e)return i.node}}getTooltipContent(t){const{id:e,dataModel:i,processedData:s,properties:n}=this,{stageKey:a,valueKey:o,tooltip:r}=n;if(!i||!s)return;const{datumIndex:l}=t,c=s.dataSources.get(this.id)?.[l],h=i.resolveColumnById(this,"xValue",s)[l],u=i.resolveColumnById(this,"yValue",s)[l];if(h==null)return;const d=this.getLabelText(this.properties.stageLabel,{datum:s.dataSources.get(this.id)?.[l],value:u,stageKey:a,valueKey:o}),p=this.getItemBaseStyle(!1);return Object.assign(p,this.getItemStyleOverrides(String(l),l,l,p,!1)),r.formatTooltip({symbol:this.legendItemSymbol(l),data:[{label:String(h),value:d}]},{seriesId:e,datum:c,title:void 0,stageKey:a,valueKey:o,...p})}getSeriesDomain(){return[NaN,NaN]}getSeriesRange(t,e){return[NaN,NaN]}pickNodeClosestDatum({x:t,y:e}){let i=1/0,s;return this.datumSelection.each((n,a)=>{const o=n.distanceSquared(t,e);o{const d=l[u];r.push({legendType:"category",id:s,itemId:u,seriesId:s,enabled:a&&n.getItemEnabled({seriesId:s,itemId:u}),label:{text:d},symbol:this.legendItemSymbol(u),hideInLegend:!o})}),r}};RC.className="PyramidSeries",RC.type="pyramid";var $pt=(R(),E(w)),{ThemeSymbols:{DEFAULT_SHADOW_COLOUR:Xpt}}=$pt._ModuleSupport,Zpt={series:{direction:"vertical",strokeWidth:0,spacing:2,label:{enabled:!0,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"backgroundColor"}},stageLabel:{enabled:!0,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"textColor"},spacing:12},shadow:{enabled:!1,color:Xpt,xOffset:3,yOffset:3,blur:5}}},Qpt={type:"series",optionsKey:"series[]",packageType:"enterprise",chartTypes:["standalone"],identifier:"pyramid",moduleFactory:t=>new RC(t),solo:!0,tooltipDefaults:{range:"exact"},themeTemplate:Zpt,paletteFactory:({takeColors:t,colorsCount:e})=>{const{fills:i,strokes:s}=t(e);return{fills:i,strokes:s}}},qpt=(R(),E(w)),_C=(R(),E(w)),{ThemeConstants:{POLAR_AXIS_TYPE:Jpt}}=_C._ModuleSupport,YG={series:{label:{enabled:!1,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"textColor"}},marker:{enabled:!0,fillOpacity:1,shape:"circle",size:6,strokeOpacity:1,strokeWidth:0}},axes:{[Jpt.ANGLE_CATEGORY]:{label:{spacing:10}}}},tgt=_C._ModuleSupport.mergeDefaults({series:{strokeWidth:2}},YG),egt=_C._ModuleSupport.mergeDefaults({series:{fillOpacity:.8,strokeWidth:2,marker:{enabled:!1}}},YG),KG=(R(),E(w)),gp=(R(),E(w)),igt=(R(),E(w)),{Label:sgt,SeriesMarker:ngt,SeriesProperties:agt,SeriesTooltip:ogt,Validate:Js,BOOLEAN:rgt,COLOR_STRING:lgt,NUMBER:cgt,LINE_DASH:hgt,OBJECT:PC,POSITIVE_NUMBER:$G,RATIO:ugt,STRING:qv}=igt._ModuleSupport,bs=class extends agt{constructor(){super(...arguments),this.stroke="black",this.strokeWidth=1,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.rotation=0,this.marker=new ngt,this.label=new sgt,this.tooltip=new ogt,this.connectMissingData=!1}};y([Js(qv)],bs.prototype,"angleKey",2),y([Js(qv)],bs.prototype,"radiusKey",2),y([Js(qv,{optional:!0})],bs.prototype,"angleName",2),y([Js(qv,{optional:!0})],bs.prototype,"radiusName",2),y([Js(lgt)],bs.prototype,"stroke",2),y([Js($G)],bs.prototype,"strokeWidth",2),y([Js(ugt)],bs.prototype,"strokeOpacity",2),y([Js(hgt)],bs.prototype,"lineDash",2),y([Js($G)],bs.prototype,"lineDashOffset",2),y([Js(cgt)],bs.prototype,"rotation",2),y([Js(PC)],bs.prototype,"marker",2),y([Js(PC)],bs.prototype,"label",2),y([Js(PC)],bs.prototype,"tooltip",2),y([Js(rgt)],bs.prototype,"connectMissingData",2);var{ChartAxisDirection:ja,PolarAxis:dgt,SeriesNodePickMode:XG,valueProperty:ZG,fixNumericExtent:pgt,seriesLabelFadeInAnimation:ggt,markerFadeInAnimation:fgt,resetMarkerFn:ygt,animationValidation:mgt,computeMarkerFocusBounds:xgt,extent:bgt,isNumberEqual:QG,createDatumId:Sgt,BBox:vgt,Group:Mgt,Path:Igt,PointerEvents:Agt,Selection:qG,Text:Dgt,Marker:kgt,applyShapeStyle:Lgt}=gp._ModuleSupport,Tgt=class extends gp._ModuleSupport.SeriesNodeEvent{constructor(t,e,i,s){super(t,e,i,s),this.angleKey=s.properties.angleKey,this.radiusKey=s.properties.radiusKey}},BC=class extends gp._ModuleSupport.PolarSeries{constructor(t){super({moduleCtx:t,useLabelLayer:!0,pickModes:[XG.NEAREST_NODE,XG.EXACT_SHAPE_MATCH],canHaveAxes:!0,animationResetFns:{item:ygt}}),this.clipFocusBox=!1,this.properties=new bs,this.NodeEvent=Tgt,this.lineGroup=this.contentGroup.appendChild(new Mgt({name:"radar-line",zIndex:gp._ModuleSupport.SeriesZIndexMap.ANY_CONTENT})),this.lineSelection=qG.select(this.lineGroup,Igt),this.resetInvalidToZero=!1,this.circleCache={r:0,cx:0,cy:0}}nodeFactory(){return new kgt}setSeriesIndex(t){return super.setSeriesIndex(t)?(this.lineGroup.zIndex=[gp._ModuleSupport.SeriesZIndexMap.ANY_CONTENT,t,gp._ModuleSupport.SeriesContentZIndexMap.FOREGROUND,1],!0):!1}getSeriesDomain(t){const{dataModel:e,processedData:i}=this;if(!i||!e)return[];if(t===ja.X)return e.getDomain(this,"angleValue","value",i);{const s=e.getDomain(this,"radiusValue","value",i),n=bgt(s.length===0?s:[0].concat(s));return pgt(n)}}async processData(t){if(!this.properties.isValid())return;const{angleKey:e,radiusKey:i}=this.properties,s=[];this.ctx.animationManager.isSkipped()||s.push(mgt());const n=this.axes[ja.Y]?.scale.type,a=this.axes[ja.X]?.scale.type;await this.requestDataModel(t,this.data,{props:[ZG(e,a,{id:"angleValue"}),ZG(i,n,{id:"radiusValue",invalidValue:void 0}),...s]}),this.animationState.transition("updateData")}didCircleChange(){const t=this.radius,e=this.centerX,i=this.centerY,s=this.circleCache;return t===s.r&&e===s.cx&&i===s.cy?!1:(this.circleCache={r:t,cx:e,cy:i},!0)}getAxisInnerRadius(){const t=this.axes[ja.Y];return t instanceof dgt?this.radius*t.innerRadiusRatio:0}maybeRefreshNodeData(){if(!this.didCircleChange()&&!this.nodeDataRefresh)return;const{nodeData:e=[]}=this.createNodeData()??{};this.nodeData=e,this.nodeDataRefresh=!1}createNodeData(){const{processedData:t,dataModel:e}=this;if(!t||!e||!this.properties.isValid())return;const{angleKey:i,radiusKey:s,angleName:n,radiusName:a,marker:o,label:r}=this.properties,l=this.axes[ja.X]?.scale,c=this.axes[ja.Y]?.scale;if(!l||!c)return;const h=e.resolveColumnById(this,"angleValue",t),u=e.resolveColumnById(this,"radiusValue",t),d=this.getAxisInnerRadius(),g=(t.dataSources.get(this.id)??[]).map((f,x)=>{const m=h[x],b=u[x],v=l.convert(m),S=this.radius+d-c.convert(b),A=Math.cos(v),T=Math.sin(v),D=A*S,L=T*S;let C;if(r.enabled){const O=this.getLabelText(r,{value:b,datum:f,angleKey:i,radiusKey:s,angleName:n,radiusName:a});if(O){let _="right";QG(A,0)?_="center":A>0&&(_="left");let N="bottom";QG(T,0)?N="middle":T>0&&(N="top"),C={x:D+A*o.size,y:L+T*o.size,text:O,textAlign:_,textBaseline:N}}}return{series:this,datum:f,datumIndex:x,index:x,point:{x:D,y:L,size:o.size},midPoint:{x:D,y:L},label:C,angleValue:m,radiusValue:b,missing:!kl(v)||!kl(S)}});return{itemId:s,nodeData:g,labelData:g}}update({seriesRect:t}){const e=this.checkResize(t),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.updateMarkers(this.itemSelection,!1),this.updateMarkers(this.highlightSelection,!0),this.updateLabels(),e&&this.animationState.transition("resize"),this.animationState.transition("update")}updatePathSelections(){const t=this.visible?[!0]:[];this.lineSelection.update(t)}updateMarkerSelection(){this.properties.marker.isDirty()&&(this.itemSelection.clear(),this.itemSelection.cleanup(),this.itemSelection=qG.select(this.itemGroup,()=>this.nodeFactory(),!1)),this.itemSelection.update(this.properties.marker.enabled?this.nodeData:[])}getMarkerFill(t){return t?.fill??this.properties.marker.fill}getMarkerItemBaseStyle(t){const{properties:e}=this,{marker:i}=e,s=t?e.highlightStyle.item:void 0;return{shape:i.shape,size:i.size,fill:s?.fill??i.fill,fillOpacity:s?.fillOpacity??i.fillOpacity,stroke:s?.stroke??i.stroke,strokeWidth:s?.strokeWidth??this.getStrokeWidth(i.strokeWidth),strokeOpacity:s?.strokeOpacity??i.strokeOpacity,lineDash:s?.lineDash??i.lineDash,lineDashOffset:s?.lineDashOffset??i.lineDashOffset}}getMarkerItemStyleOverrides(t,e,i,s){const{id:n,properties:a}=this,{angleKey:o,radiusKey:r,marker:l}=a,{itemStyler:c}=l;if(c!=null)return this.cachedDatumCallback(Sgt(t,s?"highlight":"node"),()=>c({seriesId:n,datum:e,angleKey:o,radiusKey:r,highlighted:s,...i}))}updateMarkers(t,e){const{visible:i}=this,{marker:s}=this.properties;let n=[];if(i&&s.shape&&s.enabled)if(e){const o=this.ctx.highlightManager?.getActiveHighlight();o?.datum&&(n=[o])}else n=this.nodeData;const a=this.getMarkerItemBaseStyle(e);t.update(n).each((o,r)=>{const{datum:l,datumIndex:c,point:h}=r,u=this.getMarkerItemStyleOverrides(String(c),l,a,e);Lgt(o,a,u),o.shape=u?.shape??a.shape,o.size=u?.size??a.size;const{x:d,y:p}=h;o.x=d,o.y=p,o.visible=i&&o.size>0&&!isNaN(d)&&!isNaN(p)})}updateLabels(){const{label:t}=this.properties;this.labelSelection.update(this.nodeData).each((e,i)=>{t.enabled&&i.label?(e.x=i.label.x,e.y=i.label.y,e.fill=t.color,e.fontFamily=t.fontFamily,e.fontSize=t.fontSize,e.fontStyle=t.fontStyle,e.fontWeight=t.fontWeight,e.text=i.label.text,e.textAlign=i.label.textAlign,e.textBaseline=i.label.textBaseline,e.visible=!0):e.visible=!1})}getTooltipContent(t){const{id:e,dataModel:i,processedData:s,axes:n,properties:a}=this,{angleKey:o,angleName:r,radiusKey:l,radiusName:c,tooltip:h}=a,u=n[ja.X],d=n[ja.Y];if(!i||!s||!u||!d)return;const{datumIndex:p}=t,g=s.dataSources.get(this.id)?.[p],f=i.resolveColumnById(this,"angleValue",s)[p],x=i.resolveColumnById(this,"radiusValue",s)[p];if(f==null)return;const m=this.getMarkerItemBaseStyle(!1);return Object.assign(m,this.getMarkerItemStyleOverrides(String(p),p,m,!1)),h.formatTooltip({heading:u.formatDatum(f),symbol:this.legendItemSymbol(),data:[{label:c,fallbackLabel:l,value:d.formatDatum(x)}]},{seriesId:e,datum:g,title:r,angleKey:o,radiusKey:l,angleName:r,radiusName:c,...m})}legendItemSymbol(){const{stroke:t,strokeWidth:e,strokeOpacity:i,lineDash:s,marker:n}=this.properties;return{marker:{shape:n.shape,fill:this.getMarkerFill()??n.stroke??t??"rgba(0, 0, 0, 0)",stroke:n.stroke??t??"rgba(0, 0, 0, 0)",fillOpacity:n.fillOpacity,strokeOpacity:n.strokeOpacity,strokeWidth:n.strokeWidth,lineDash:n.lineDash,lineDashOffset:n.lineDashOffset,enabled:n.enabled||e<=0},line:{stroke:t,strokeOpacity:i,strokeWidth:e,lineDash:s}}}getLegendData(t){if(!this.properties.isValid()||t!=="category")return[];const{id:e,ctx:{legendManager:i},visible:s}=this,{radiusKey:n,radiusName:a,showInLegend:o}=this.properties;return[{legendType:"category",id:e,itemId:n,seriesId:e,enabled:s&&i.getItemEnabled({seriesId:e,itemId:n}),label:{text:a??n},symbol:this.legendItemSymbol(),hideInLegend:!o}]}pickNodeClosestDatum(t){const{nodeData:e,centerX:i,centerY:s}=this,{x:n,y:a}=t,o=this.radius;if(Math.sqrt((n-i)**2+(a-s)**2)>o+this.properties.marker.size)return;let l=1/0,c;for(const h of e){const{point:{x:u=NaN,y:d=NaN}={}}=h;if(isNaN(u)||isNaN(d))continue;const p=Math.sqrt((t.x-u-i)**2+(t.y-d-s)**2);p{if(!t.enabled||!s.label)return;i.text=s.label.text,i.x=s.label.x,i.y=s.label.y,i.setFont(t),i.setAlign(s.label);const n=i.getBBox();e.push(n)}),e.length===0?null:vgt.merge(e)}getLineNode(){return this.lineSelection?.at(0)}beforePathAnimation(){const t=this.getLineNode();t&&(t.fill=void 0,t.lineJoin="round",t.lineCap="round",t.pointerEvents=Agt.None,t.stroke=this.properties.stroke,t.strokeWidth=this.getStrokeWidth(this.properties.strokeWidth),t.strokeOpacity=this.properties.strokeOpacity,t.lineDash=this.properties.lineDash,t.lineDashOffset=this.properties.lineDashOffset)}getLinePoints(){const{nodeData:t,resetInvalidToZero:e}=this,{connectMissingData:i}=this.properties;if(t.length===0)return[];const s=this.axes[ja.Y],a=this.axes[ja.X]?.isReversed(),r=s?.isReversed()&&!a?[...t].reverse():t,l=[];let c=!1,h;return r.forEach((u,d)=>{let{x:p,y:g}=u.point;const f=isNaN(p)||isNaN(g);f||(h??(h=u)),f&&!i&&(p=0,g=0);const x=d===0||!e&&!i&&(f||c);l.push({x:p,y:g,moveTo:x}),c=f}),h!==void 0&&l.push({x:h.point.x,y:h.point.y,moveTo:!1}),l}animateSinglePath(t,e,i){const{path:s}=t;s.clear(!0);const n=this.getAxisInnerRadius(),a=this.axes[ja.Y],r=a?.isReversed()?this.radius+n-a?.scale.convert(0):n;e.forEach(l=>{const{x:c,y:h,arc:u,radius:d=0,startAngle:p=0,endAngle:g=0,moveTo:f}=l,x=Math.atan2(h,c),m=r*Math.cos(x),b=r*Math.sin(x),v=i,S=m*(1-v)+c*v,A=b*(1-v)+h*v;u?s.arc(c,h,d,p,g):f?s.moveTo(S,A):s.lineTo(S,A)}),t.checkPathDirty()}animatePaths(t){const e=this.getLinePoints(),i=this.getLineNode();i&&this.animateSinglePath(i,e,t)}animateEmptyUpdateReady(){const{itemSelection:t,labelSelection:e}=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)}),fgt(this,i,"added",t),ggt(this,"labels",i,e)}animateWaitingUpdateReady(t){super.animateWaitingUpdateReady(t),this.resetPaths()}animateReadyResize(t){super.animateReadyResize(t),this.resetPaths()}resetPaths(){const t=this.getLineNode();if(t){const{path:e}=t,i=this.getLinePoints();t.fill=void 0,t.stroke=this.properties.stroke,t.strokeWidth=this.getStrokeWidth(this.properties.strokeWidth),t.strokeOpacity=this.properties.strokeOpacity,t.lineDash=this.properties.lineDash,t.lineDashOffset=this.properties.lineDashOffset,e.clear(!0);for(const{x:s,y:n,moveTo:a}of i)a?e.moveTo(s,n):e.lineTo(s,n);t.checkPathDirty()}}getFormattedMarkerStyle(t){const{angleKey:e,radiusKey:i}=this.properties;return this.getMarkerStyle(this.properties.marker,{datum:t,angleKey:e,radiusKey:i,highlighted:!0})}computeFocusBounds(t){return xgt(this,t)}};BC.className="RadarSeries";var Cgt=(R(),E(w)),{RATIO:Ngt,COLOR_STRING:Ogt,Validate:JG}=Cgt._ModuleSupport,zC=class extends bs{constructor(){super(...arguments),this.fill="black",this.fillOpacity=1}};y([JG(Ogt)],zC.prototype,"fill",2),y([JG(Ngt)],zC.prototype,"fillOpacity",2);var{Group:wgt,Path:Egt,PointerEvents:Rgt,Selection:_gt,ChartAxisDirection:tW}=KG._ModuleSupport,FC=class extends BC{constructor(t){super(t),this.properties=new zC,this.resetInvalidToZero=!0;const e=new wgt;this.contentGroup.append(e),this.areaSelection=_gt.select(e,Egt)}updatePathSelections(){const t=this.visible?[!0]:[];this.areaSelection.update(t),super.updatePathSelections()}getAreaNode(){return this.areaSelection.at(0)}getMarkerFill(t){return t?.fill??this.properties.marker.fill??this.properties.fill}beforePathAnimation(){super.beforePathAnimation();const t=this.getAreaNode();t.fill=this.properties.fill,t.fillOpacity=this.properties.fillOpacity,t.pointerEvents=Rgt.None,t.stroke=void 0}animatePaths(t){super.animatePaths(t),this.animateSinglePath(this.getAreaNode(),this.getAreaPoints(),t)}getAreaPoints(){const t=this.getLinePoints(),e=o=>{const r=this.axes[o];return r instanceof KG._ModuleSupport.PolarAxis?r:void 0},i=e(tW.Y),s=e(tW.X);if(!i?.isReversed())return t;const a=s?.getAxisLinePoints()?.points??[];return t.concat(...a)}resetPaths(){super.resetPaths();const t=this.getAreaNode();if(t){const{path:e}=t,i=this.getAreaPoints();t.fill=this.properties.fill,t.fillOpacity=this.properties.fillOpacity,t.stroke=void 0,t.lineDash=this.properties.lineDash,t.lineDashOffset=this.properties.lineDashOffset,t.lineJoin=t.lineCap="round",e.clear(!0),i.forEach(({x:s,y:n,moveTo:a,arc:o,radius:r=0,startAngle:l=0,endAngle:c=0})=>{o?e.arc(s,n,r,l,c):a?e.moveTo(s,n):e.lineTo(s,n)}),e.closePath(),t.checkPathDirty()}}};FC.className="RadarAreaSeries",FC.type="radar-area";var{markerPaletteFactory:Pgt,ThemeConstants:{POLAR_AXIS_TYPE:eW}}=qpt._ModuleSupport,Bgt={type:"series",optionsKey:"series[]",packageType:"enterprise",chartTypes:["polar"],identifier:"radar-area",moduleFactory:t=>new FC(t),tooltipDefaults:{range:"nearest"},defaultAxes:[{type:eW.ANGLE_CATEGORY},{type:eW.RADIUS_NUMBER}],themeTemplate:egt,paletteFactory:t=>{const{marker:e}=Pgt(t);return{stroke:e.stroke,fill:e.fill,marker:e}}},zgt=(R(),E(w)),jC=class extends BC{updatePathSelections(){this.lineSelection.update(this.visible?[!0]:[])}};jC.className="RadarLineSeries",jC.type="radar-line";var{POLAR_AXIS_TYPE:iW}=zgt._ModuleSupport.ThemeConstants,Fgt={type:"series",optionsKey:"series[]",packageType:"enterprise",chartTypes:["polar"],identifier:"radar-line",moduleFactory:t=>new jC(t),tooltipDefaults:{range:"nearest"},defaultAxes:[{type:iW.ANGLE_CATEGORY},{type:iW.RADIUS_NUMBER}],themeTemplate:tgt,paletteFactory:({takeColors:t})=>{const{fills:[e],strokes:[i]}=t(1);return{stroke:e,marker:{fill:e,stroke:i}}}},jgt=(R(),E(w)),VC=(R(),E(w)),Vgt=(R(),E(w)),{SeriesProperties:Ggt,SeriesTooltip:Wgt,Validate:Oi,COLOR_STRING:sW,NUMBER:nW,FUNCTION:Ugt,LINE_DASH:Hgt,OBJECT:aW,POSITIVE_NUMBER:GC,RATIO:oW,STRING:Cy,Label:Ygt}=Vgt._ModuleSupport,xi=class extends Ggt{constructor(){super(...arguments),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 Ygt,this.tooltip=new Wgt}};y([Oi(Cy)],xi.prototype,"angleKey",2),y([Oi(Cy)],xi.prototype,"radiusKey",2),y([Oi(Cy,{optional:!0})],xi.prototype,"angleName",2),y([Oi(Cy,{optional:!0})],xi.prototype,"radiusName",2),y([Oi(sW)],xi.prototype,"fill",2),y([Oi(oW)],xi.prototype,"fillOpacity",2),y([Oi(sW)],xi.prototype,"stroke",2),y([Oi(GC)],xi.prototype,"strokeWidth",2),y([Oi(oW)],xi.prototype,"strokeOpacity",2),y([Oi(Hgt)],xi.prototype,"lineDash",2),y([Oi(GC)],xi.prototype,"lineDashOffset",2),y([Oi(GC)],xi.prototype,"cornerRadius",2),y([Oi(Ugt,{optional:!0})],xi.prototype,"itemStyler",2),y([Oi(nW)],xi.prototype,"rotation",2),y([Oi(Cy,{optional:!0})],xi.prototype,"stackGroup",2),y([Oi(nW,{optional:!0})],xi.prototype,"normalizedTo",2),y([Oi(aW)],xi.prototype,"label",2),y([Oi(aW)],xi.prototype,"tooltip",2);var Kgt=(R(),E(w)),{SectorBox:rW,motion:$gt}=Kgt._ModuleSupport;function Xgt(t,e,i){if(i==="updated"){if(t.previousDatum==null||isNaN(t.previousDatum.innerRadius)||isNaN(t.previousDatum.outerRadius))return"added";if(isNaN(e.innerRadius)||isNaN(e.outerRadius))return"removed"}return i==="added"&&t.previousDatum!=null?"updated":i}function lW(t){return{toFn:(s,n,a)=>{let o,r,l,c,h;return a==="removed"?(o=t,r=t,l=n.innerRadius,c=n.outerRadius,h=new rW(o,r,l,c)):(o=n.startAngle,r=n.endAngle,l=isNaN(n.innerRadius)?s.innerRadius:n.innerRadius,c=isNaN(n.outerRadius)?s.outerRadius:n.outerRadius,h=n.clipSector),{startAngle:o,endAngle:r,innerRadius:l,outerRadius:c,clipSector:h}},fromFn:(s,n,a)=>{a=Xgt(s,n,a);let o,r,l,c,h;a==="removed"||a==="updated"?(o=s.startAngle,r=s.endAngle,l=s.innerRadius,c=s.outerRadius,h=s.clipSector):(o=t,r=t,l=n.innerRadius,c=n.outerRadius),h??(h=new rW(o,r,l,c));const u=$gt.NODE_UPDATE_STATE_TO_PHASE_MAPPING[a];return{startAngle:o,endAngle:r,innerRadius:l,outerRadius:c,clipSector:h,phase:u}}}}function Zgt(t,e){return{centerX:0,centerY:0,innerRadius:e.innerRadius,outerRadius:e.outerRadius,startAngle:e.startAngle,endAngle:e.endAngle,clipSector:e.clipSector}}var{ChartAxisDirection:jr,PolarAxis:Qgt,diff:qgt,groupAccumulativeValueProperty:cW,keyProperty:Jgt,normaliseGroupTo:tft,valueProperty:eft,fixNumericExtent:ift,resetLabelFn:sft,seriesLabelFadeInAnimation:nft,seriesLabelFadeOutAnimation:aft,animationValidation:oft,angleBetween:rft,createDatumId:hW,CategoryScale:lft,Sector:cft,SectorBox:hft,motion:uW,applyShapeStyle:uft}=VC._ModuleSupport,dft=class extends VC._ModuleSupport.SeriesNodeEvent{constructor(t,e,i,s){super(t,e,i,s),this.angleKey=s.properties.angleKey,this.radiusKey=s.properties.radiusKey}},WC=class extends VC._ModuleSupport.PolarSeries{constructor(t){super({moduleCtx:t,useLabelLayer:!0,canHaveAxes:!0,animationResetFns:{item:Zgt,label:sft}}),this.properties=new xi,this.NodeEvent=dft,this.groupScale=new lft,this.circleCache={r:0,cx:0,cy:0}}nodeFactory(){return new cft}getSeriesDomain(t){const{dataModel:e,processedData:i}=this;if(!i||!e)return[];if(t===jr.X){const s=e.getDomain(this,"angleValue-end","value",i),n=[s[0]>0?0:s[0],s[1]<0?0:s[1]];return ift(n)}else return e.getDomain(this,"radiusValue","key",i)}async processData(t){const{visible:e}=this,{angleKey:i,radiusKey:s,normalizedTo:n}=this.properties,a=!this.ctx.animationManager.isSkipped();if(!this.properties.isValid())return;const o=this.getStackId(),r=`${o}-trailing`,l=[];Fi(n)&&l.push(tft([o,r],Math.abs(n))),a&&(this.processedData&&l.push(qgt(this.id,this.processedData)),l.push(oft()));const c=e||!a?{}:{forceValue:0},h=this.axes[jr.Y]?.scale.type,u=this.axes[jr.X]?.scale.type;await this.requestDataModel(t,this.data,{props:[Jgt(s,h,{id:"radiusValue"}),eft(i,u,{id:"angleValue-raw",invalidValue:null,...c}),...cW(i,"normal","current",{id:"angleValue-end",rangeId:"angleValue-range",invalidValue:null,groupId:o,separateNegative:!0,...c},u),...cW(i,"trailing","current",{id:"angleValue-start",invalidValue:null,groupId:r,separateNegative:!0,...c},u),...l],groupByKeys:!0,groupByData:!1}),this.animationState.transition("updateData")}didCircleChange(){const t=this.radius,e=this.centerX,i=this.centerY,s=this.circleCache;return t===s.r&&e===s.cx&&i===s.cy?!1:(this.circleCache={r:t,cx:e,cy:i},!0)}maybeRefreshNodeData(){if(!this.didCircleChange()&&!this.nodeDataRefresh)return;const{nodeData:e=[]}=this.createNodeData()??{};this.nodeData=e,this.nodeDataRefresh=!1}getAxisInnerRadius(){const t=this.axes[jr.Y];return t instanceof Qgt?this.radius*t.innerRadiusRatio:0}createNodeData(){const{processedData:t,dataModel:e}=this;if(!e||!t||t.type!=="grouped"||!this.properties.isValid())return;const i=this.axes[jr.X],s=this.axes[jr.Y],n=i?.scale,a=s?.scale;if(!n||!a)return;const o=e.resolveKeysById(this,"radiusValue",t),r=e.resolveColumnById(this,"angleValue-start",t),l=e.resolveColumnById(this,"angleValue-end",t),c=e.resolveColumnById(this,"angleValue-raw",t),h=e.resolveProcessedDataIndexById(this,"angleValue-range");let u=0;s instanceof gh&&(u=s.groupPaddingInner);const{groupScale:d}=this,{index:p,visibleGroupCount:g}=this.ctx.seriesStateManager.getVisiblePeerGroupIndex(this);d.domain=Array.from({length:g}).map((F,V)=>String(V)),d.range=[0,Math.abs(a.bandwidth??0)],d.paddingInner=g>1?u:0;const f=d.bandwidth>=1?d.bandwidth:d.rawBandwidth,x=i.isReversed(),m=s.isReversed(),b=m?this.radius:this.getAxisInnerRadius(),S=(m?this.getAxisInnerRadius():this.radius)+b,{angleKey:A,radiusKey:T,angleName:D,radiusName:L,label:C}=this.properties,O=(F,V,W,H)=>{const G=this.getLabelText(C,{value:V,datum:F,angleKey:A,radiusKey:T,angleName:D,radiusName:L});if(G)return{x:W,y:H,text:G,textAlign:"center",textBaseline:"middle"}},_=[],N={itemId:T,nodeData:_,labelData:_};if(!this.visible)return N;const{dataSources:P}=t,j=P.get(this.id)??[];for(const{datumIndex:F,group:V}of e.forEachGroupDatum(this,t)){const W=j[F],H=o[F];if(H==null)return;const G=c[F],B=r[F],z=l[F],U=G>=0&&!Object.is(G,-0),Y=V.aggregation[h][U?1:0],K=U===x;let Z=n.convert(B,!0),X=n.convert(z,!0),Q=n.convert(0,!0),$=n.convert(Y,!0);K&&([Q,$]=[$,Q],[Z,X]=[X,Z]);const J=S-a.convert(H)+d.convert(String(p)),nt=J+f,it=(J+nt)/2,rt=Z+rft(Z,X)/2,dt=Math.cos(rt)*it,at=Math.sin(rt)*it,Dt=this.properties.label.enabled?O(W,G,dt,at):void 0,kt=new hft(Z,X,J,nt);_.push({series:this,datum:W,datumIndex:F,point:{x:dt,y:at,size:0},midPoint:{x:dt,y:at},label:Dt,angleValue:G,radiusValue:H,innerRadius:J,outerRadius:nt,startAngle:Q,endAngle:$,clipSector:kt,reversed:K,index:F})}return N}update({seriesRect:t}){const e=this.checkResize(t);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(),e&&this.animationState.transition("resize"),this.animationState.transition("update")}getItemBaseStyle(t){const{properties:e}=this,i=t?e.highlightStyle.item:void 0;return{fill:i?.fill??e.fill,fillOpacity:i?.fillOpacity??e.fillOpacity,stroke:i?.stroke??e.stroke,strokeWidth:i?.strokeWidth??this.getStrokeWidth(e.strokeWidth),strokeOpacity:i?.strokeOpacity??e.strokeOpacity,lineDash:i?.lineDash??e.lineDash,lineDashOffset:i?.lineDashOffset??e.lineDashOffset,cornerRadius:e.cornerRadius}}getItemStyleOverrides(t,e,i,s){const{id:n,properties:a}=this,{angleKey:o,radiusKey:r,itemStyler:l}=a;if(l!=null)return this.cachedDatumCallback(hW(t,s?"highlight":"node"),()=>l({seriesId:n,datum:e,highlighted:s,angleKey:o,radiusKey:r,...i}))}updateSectorSelection(t,e){let i=[];if(e){const n=this.ctx.highlightManager?.getActiveHighlight();n?.datum&&n.series===this&&i.push(n)}else i=this.nodeData;const s=this.getItemBaseStyle(e);t.update(i,void 0,n=>this.getDatumId(n)).each((n,a)=>{const{datum:o,datumIndex:r}=a,l=this.getItemStyleOverrides(String(r),o,s,e),c=l?.cornerRadius??s.cornerRadius;uft(n,s,l),n.lineJoin="round",n.inset=n.stroke!=null?n.strokeWidth/2:0,n.startInnerCornerRadius=o.reversed?c:0,n.startOuterCornerRadius=o.reversed?c:0,n.endInnerCornerRadius=o.reversed?0:c,n.endOuterCornerRadius=o.reversed?0:c,e&&(n.startAngle=a.startAngle,n.endAngle=a.endAngle,n.clipSector=a.clipSector,n.innerRadius=a.innerRadius,n.outerRadius=a.outerRadius)})}updateLabels(){const{label:t}=this.properties;this.labelSelection.update(this.nodeData).each((e,i)=>{t.enabled&&i.label?(e.x=i.label.x,e.y=i.label.y,e.fill=t.color,e.fontFamily=t.fontFamily,e.fontSize=t.fontSize,e.fontStyle=t.fontStyle,e.fontWeight=t.fontWeight,e.text=i.label.text,e.textAlign=i.label.textAlign,e.textBaseline=i.label.textBaseline,e.visible=!0):e.visible=!1})}getBarTransitionFunctions(){const t=this.axes[jr.X]?.scale;let e=0;if(!t)return lW(e);const i=Math.min(t.domain[0],t.domain[1]),s=Math.max(t.domain[0],t.domain[1]);return i<=0&&s>=0&&(e=t.convert(0)),lW(e)}animateEmptyUpdateReady(){const{labelSelection:t}=this,e=this.getBarTransitionFunctions();uW.fromToMotion(this.id,"datums",this.ctx.animationManager,[this.itemSelection],e),nft(this,"labels",this.ctx.animationManager,t)}animateClearingUpdateEmpty(){const{itemSelection:t}=this,{animationManager:e}=this.ctx,i=this.getBarTransitionFunctions();uW.fromToMotion(this.id,"datums",e,[t],i),aft(this,"labels",e,this.labelSelection)}getTooltipContent(t){const{id:e,dataModel:i,processedData:s,axes:n,properties:a}=this,{angleKey:o,angleName:r,radiusKey:l,radiusName:c,tooltip:h}=a,u=n[jr.X],d=n[jr.Y];if(!i||!s||!u||!d)return;const{datumIndex:p}=t,g=s.dataSources.get(this.id)?.[p],f=i.resolveKeysById(this,"radiusValue",s)[p],x=i.resolveColumnById(this,"angleValue-raw",s)[p];if(f==null)return;const m=this.getItemBaseStyle(!1);return Object.assign(m,this.getItemStyleOverrides(String(p),p,m,!1)),h.formatTooltip({heading:d.formatDatum(f),symbol:this.legendItemSymbol(),data:[{label:r,fallbackLabel:o,value:u.formatDatum(x)}]},{seriesId:e,datum:g,title:r,angleKey:o,angleName:r,radiusKey:l,radiusName:c,...m})}pickNodeClosestDatum(t){return this.pickNodeNearestDistantObject(t,this.itemSelection.nodes())}legendItemSymbol(){const{fill:t,stroke:e,fillOpacity:i,strokeOpacity:s,strokeWidth:n,lineDash:a,lineDashOffset:o}=this.properties;return{marker:{fill:t??"rgba(0, 0, 0, 0)",stroke:e??"rgba(0, 0, 0, 0)",fillOpacity:i,strokeOpacity:s,strokeWidth:n,lineDash:a,lineDashOffset:o}}}getLegendData(t){if(!this.properties.isValid()||t!=="category")return[];const{id:e,visible:i}=this,{angleKey:s,angleName:n,showInLegend:a}=this.properties;return[{legendType:"category",id:e,itemId:s,seriesId:e,enabled:i,label:{text:n??s},symbol:this.legendItemSymbol(),hideInLegend:!a}]}getDatumId(t){return hW(t.radiusValue)}computeLabelsBBox(){return null}getStackId(){return`radialBar-stack-${this.seriesGrouping?.groupIndex??this.id}-xValues`}};WC.className="RadialBarSeries",WC.type="radial-bar";var pft=(R(),E(w)),{ThemeConstants:{POLAR_AXIS_TYPE:gft}}=pft._ModuleSupport,fft={series:{strokeWidth:0,label:{enabled:!1,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"backgroundColor"}}},axes:{[gft.RADIUS_CATEGORY]:{innerRadiusRatio:.2,groupPaddingInner:.2,paddingInner:.2,paddingOuter:.1}}},{POLAR_AXIS_TYPE:dW}=jgt._ModuleSupport.ThemeConstants,yft={type:"series",optionsKey:"series[]",packageType:"enterprise",chartTypes:["polar"],identifier:"radial-bar",moduleFactory:t=>new WC(t),tooltipDefaults:{range:"exact"},defaultAxes:[{type:dW.ANGLE_NUMBER},{type:dW.RADIUS_CATEGORY}],themeTemplate:fft,paletteFactory:({takeColors:t})=>{const{fills:[e],strokes:[i]}=t(1);return{fill:e,stroke:i}},stackable:!0,groupable:!0},mft=(R(),E(w)),xft=(R(),E(w)),bft=(R(),E(w)),{Validate:pW,RATIO:gW}=bft._ModuleSupport,UC=class extends li{};y([pW(gW,{optional:!0})],UC.prototype,"columnWidthRatio",2),y([pW(gW,{optional:!0})],UC.prototype,"maxColumnWidthRatio",2);var{ChartAxisDirection:Sft,PolarAxis:vft,RadialColumnShape:Mft,getRadialColumnWidth:Ift}=xft._ModuleSupport,HC=class extends DG{constructor(t){super(t,{animationResetFns:{item:Spt}}),this.properties=new UC}getStackId(){return`radarColumn-stack-${this.seriesGrouping?.groupIndex??this.id}-yValues`}nodeFactory(){return new Mft}getColumnTransitionFunctions(){const t=this.isRadiusAxisReversed()?this.radius:this.getAxisInnerRadius();return bpt(t)}isRadiusAxisCircle(){const t=this.axes[Sft.Y];return t instanceof vft?t.shape==="circle":!1}updateItemPath(t,e,i){t.isBeveled=this.isRadiusAxisCircle(),t.isRadiusAxisReversed=this.isRadiusAxisReversed(),i&&(t.innerRadius=e.innerRadius,t.outerRadius=e.outerRadius,t.startAngle=e.startAngle,t.endAngle=e.endAngle,t.columnWidth=e.columnWidth,t.axisInnerRadius=e.axisInnerRadius,t.axisOuterRadius=e.axisOuterRadius)}getColumnWidth(t,e){const{columnWidthRatio:i=.5,maxColumnWidthRatio:s=.5}=this.properties;return Ift(t,e,this.radius,i,s)}};HC.className="RadialColumnSeries",HC.type="radial-column";var Aft=(R(),E(w)),{ThemeConstants:{POLAR_AXIS_TYPE:fW,POLAR_AXIS_SHAPE:yW}}=Aft._ModuleSupport,Dft={series:{columnWidthRatio:.5,maxColumnWidthRatio:.5,strokeWidth:0,label:{enabled:!1,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"textColor"}}},axes:{[fW.ANGLE_CATEGORY]:{shape:yW.CIRCLE,groupPaddingInner:0,paddingInner:0,label:{spacing:10}},[fW.RADIUS_NUMBER]:{shape:yW.CIRCLE,innerRadiusRatio:.5}}},{POLAR_AXIS_TYPE:mW}=mft._ModuleSupport.ThemeConstants,kft={type:"series",optionsKey:"series[]",packageType:"enterprise",chartTypes:["polar"],identifier:"radial-column",moduleFactory:t=>new HC(t),tooltipDefaults:{range:"exact"},defaultAxes:[{type:mW.ANGLE_CATEGORY},{type:mW.RADIUS_NUMBER}],themeTemplate:Dft,paletteFactory:({takeColors:t})=>{const{fills:[e],strokes:[i]}=t(1);return{fill:e,stroke:i}},stackable:!0,groupable:!0},Lft=(R(),E(w)),fp=(R(),E(w)),Tft=(R(),E(w)),{SvgPath:Cft,Rotatable:Nft,Translatable:Oft,Scalable:wft}=Tft._ModuleSupport,YC=class extends Nft(wft(Oft(Cft))){constructor(){super(...arguments),this.scalingCenterX=.5,this.scalingCenterY=.5,this.rotationCenterX=.5,this.rotationCenterY=.5}};YC.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";var KC=(R(),E(w)),{BaseProperties:Jv,SeriesTooltip:Eft,SeriesProperties:Rft,PropertiesArray:$C,Validate:ut,BOOLEAN:xW,COLOR_STRING:Vr,COLOR_STRING_ARRAY:_ft,FUNCTION:Pft,LINE_DASH:tM,NUMBER:Xh,OBJECT_ARRAY:XC,OBJECT:Gr,POSITIVE_NUMBER:ia,RATIO:Va,STRING:ZC,UNION:Bft,Label:zft}=KC._ModuleSupport,Fft=Bft(["inside","outside","middle"],"a placement"),bW=class extends zft{};y([ut(Xh,{optional:!0})],bW.prototype,"spacing",2);var Ki=class extends Jv{constructor(){super(...arguments),this.label=new bW}};y([ut(ZC,{optional:!0})],Ki.prototype,"text",2),y([ut(Xh,{optional:!0})],Ki.prototype,"value",2),y([ut(AV,{optional:!0})],Ki.prototype,"shape",2),y([ut(Fft,{optional:!0})],Ki.prototype,"placement",2),y([ut(Xh,{optional:!0})],Ki.prototype,"spacing",2),y([ut(ia,{optional:!0})],Ki.prototype,"size",2),y([ut(Xh,{optional:!0})],Ki.prototype,"rotation",2),y([ut(Vr,{optional:!0})],Ki.prototype,"fill",2),y([ut(Va,{optional:!0})],Ki.prototype,"fillOpacity",2),y([ut(Vr,{optional:!0})],Ki.prototype,"stroke",2),y([ut(ia,{optional:!0})],Ki.prototype,"strokeWidth",2),y([ut(Va,{optional:!0})],Ki.prototype,"strokeOpacity",2),y([ut(tM,{optional:!0})],Ki.prototype,"lineDash",2),y([ut(ia,{optional:!0})],Ki.prototype,"lineDashOffset",2),y([ut(Gr)],Ki.prototype,"label",2);var Ga=class extends Jv{constructor(){super(...arguments),this.enabled=!0,this.fills=new $C(KC._ModuleSupport.StopProperties),this.fillMode="continuous",this.fillOpacity=1,this.stroke="black",this.strokeWidth=0,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0}};y([ut(xW)],Ga.prototype,"enabled",2),y([ut(XC)],Ga.prototype,"fills",2),y([ut(Nv)],Ga.prototype,"fillMode",2),y([ut(Vr,{optional:!0})],Ga.prototype,"fill",2),y([ut(Va)],Ga.prototype,"fillOpacity",2),y([ut(Vr,{optional:!0})],Ga.prototype,"stroke",2),y([ut(ia,{optional:!0})],Ga.prototype,"strokeWidth",2),y([ut(Va)],Ga.prototype,"strokeOpacity",2),y([ut(tM)],Ga.prototype,"lineDash",2),y([ut(ia)],Ga.prototype,"lineDashOffset",2);var Wa=class extends Jv{constructor(){super(...arguments),this.fills=new $C(KC._ModuleSupport.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"}};y([ut(XC)],Wa.prototype,"fills",2),y([ut(Nv)],Wa.prototype,"fillMode",2),y([ut(Vr,{optional:!0})],Wa.prototype,"fill",2),y([ut(Va)],Wa.prototype,"fillOpacity",2),y([ut(Vr)],Wa.prototype,"stroke",2),y([ut(ia)],Wa.prototype,"strokeWidth",2),y([ut(Va)],Wa.prototype,"strokeOpacity",2),y([ut(tM)],Wa.prototype,"lineDash",2),y([ut(ia)],Wa.prototype,"lineDashOffset",2),y([ut(Vr)],Wa.prototype,"defaultFill",2);var Ua=class extends Jv{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}};y([ut(xW)],Ua.prototype,"enabled",2),y([ut(Va,{optional:!0})],Ua.prototype,"radiusRatio",2),y([ut(Xh)],Ua.prototype,"spacing",2),y([ut(Vr)],Ua.prototype,"fill",2),y([ut(Va)],Ua.prototype,"fillOpacity",2),y([ut(Vr)],Ua.prototype,"stroke",2),y([ut(ia)],Ua.prototype,"strokeWidth",2),y([ut(Va)],Ua.prototype,"strokeOpacity",2),y([ut(tM)],Ua.prototype,"lineDash",2),y([ut(ia)],Ua.prototype,"lineDashOffset",2);var SW=class extends Po{};y([ut(ZC,{optional:!0})],SW.prototype,"text",2);var vW=class extends Sy{};y([ut(ZC,{optional:!0})],vW.prototype,"text",2);var hi=class extends Rft{constructor(){super(...arguments),this.segmentation=new My,this.defaultColorRange=[],this.targets=new $C(Ki),this.defaultTarget=new Ki,this.outerRadiusRatio=1,this.innerRadiusRatio=1,this.cornerRadius=0,this.cornerMode="container",this.spacing=0,this.scale=new Wa,this.bar=new Ga,this.needle=new Ua,this.label=new SW,this.secondaryLabel=new vW,this.tooltip=new Eft}isValid(t){if(!super.isValid(t))return!1;const{outerRadius:e,innerRadius:i}=this;return e==null!=(i==null)?(Gt.warnOnce("Either [innerRadius] and [outerRadius] must both be set, or neither can be set."),!1):!0}};y([ut(Xh)],hi.prototype,"value",2),y([ut(Gr)],hi.prototype,"segmentation",2),y([ut(_ft)],hi.prototype,"defaultColorRange",2),y([ut(XC)],hi.prototype,"targets",2),y([ut(Gr)],hi.prototype,"defaultTarget",2),y([ut(Va)],hi.prototype,"outerRadiusRatio",2),y([ut(Va)],hi.prototype,"innerRadiusRatio",2),y([ut(ia,{optional:!0})],hi.prototype,"outerRadius",2),y([ut(ia,{optional:!0})],hi.prototype,"innerRadius",2),y([ut(ia)],hi.prototype,"cornerRadius",2),y([ut(DV)],hi.prototype,"cornerMode",2),y([ut(Xh)],hi.prototype,"spacing",2),y([ut(Gr)],hi.prototype,"scale",2),y([ut(Gr)],hi.prototype,"bar",2),y([ut(Gr)],hi.prototype,"needle",2),y([ut(Pft,{optional:!0})],hi.prototype,"itemStyler",2),y([ut(Gr)],hi.prototype,"label",2),y([ut(Gr)],hi.prototype,"secondaryLabel",2),y([ut(Gr)],hi.prototype,"tooltip",2);var jft=(R(),E(w)),{SectorBox:QC}=jft._ModuleSupport;function Vft(t){const{startAngle:e,endAngle:i,clipStartAngle:s,clipEndAngle:n,innerRadius:a,outerRadius:o}=t;if(!(s==null||n==null))return new QC(Math.max(s,e),Math.min(n,i),a,o)}function MW(t,e,i){return Math.max(t,i.startAngle)<=Math.min(e,i.endAngle)}function qC(t){return t.clipStartAngle!=null&&t.clipEndAngle!=null}function JC(t,e){const{clipStartAngle:i,clipEndAngle:s,innerRadius:n,outerRadius:a}=t;return new QC(i,e?i:s,n,a)}function IW(t,e){const i=t?"initial":"update";return{node:{fromFn(a,o){const r=a.previousDatum;let{startAngle:l,endAngle:c}=r??o;const h=r!=null&&qC(r)?JC(r,t):void 0,u=qC(o)?JC(o,t):void 0;let d;return h!=null&&u!=null?d=h:h==null&&u!=null?(d=u,l=o.startAngle,c=o.endAngle):h!=null&&u==null?(d=void 0,l=o.startAngle,c=o.endAngle):t&&(c=l),{startAngle:l,endAngle:c,clipSector:d,phase:i}},toFn(a,o){const{startAngle:r,endAngle:l}=o;let c;return qC(o)&&(c=JC(o,!1)),{startAngle:r,endAngle:l,clipSector:c}},applyFn(a,o){const{startAngle:r,endAngle:l}=o;let{clipSector:c}=o;c!=null&&(c=new QC(Math.max(r,c.startAngle),Math.min(l,c.endAngle),c.innerRadius,c.outerRadius));const h=c==null||MW(r,l,c);a.startAngle=r,a.endAngle=l,a.clipSector=c,a.visible=h}},needle:{fromFn(a){let{angle:o}=a.previousDatum??a.datum;return t&&(o=e),{rotation:o,phase:i}},toFn(a,o){const{angle:r}=o;return{rotation:r}}}}}function tN(t,e){const{startAngle:i,endAngle:s}=e,n=Vft(e),a=n==null||MW(i,s,n);return{startAngle:i,endAngle:s,clipSector:n,visible:a}}function AW(t,e){const{angle:i}=e;return{rotation:i}}var Gft={top:0,middle:.5,bottom:1};function Wft(t,e,i,s,n){const{padding:a,textAlign:o,verticalAlign:r}=i;let l,c;if(e.each((S,A)=>{A.label==="primary"?l=A:A.label==="secondary"&&(c=A)}),l==null)return;const h=vy(t,l,n?.label);if(h==null)return;const u=c!=null?vy(t,c,n?.secondaryLabel):void 0,d={padding:a},p=o==="center"?2:1,g=r==="middle"?2:1,f=S=>({width:Math.sqrt(Math.max(s**2-(S/g)**2,0))*p,height:Math.min(S,g*s),meta:null});let x,m,b;if(c!=null&&u!=null){const S=sV(h,l,u,c,d,f);x=S?.label,m=S?.secondaryLabel,b=S?.height??0}else{const S=xy(h,l,d,f);x=S?.[0],m=void 0,b=S?.[0].height??0}const v=b*Gft[r];e.each((S,A)=>{let T;if(A.label==="primary"?T=x:A.label==="secondary"&&(T=m),T==null){S.visible=!1;return}S.visible=!0,S.text=T.text,S.fontSize=T.fontSize,S.lineHeight=T.lineHeight,S.textAlign=o,S.textBaseline="middle";const D=A.label==="primary"?T.height/2:b-T.height/2;S.y=A.centerY+D-v,S.x=A.centerX})}var{fromToMotion:Ny,resetMotion:DW,SeriesNodePickMode:kW,StateMachine:Uft,createDatumId:eN,ChartAxisDirection:tc,normalizeAngle360:LW,normalizeAngle360Inclusive:TW,toDegrees:Hft,toRadians:Yft,BBox:Kft,Group:Zh,PointerEvents:$ft,Selection:Qh,Sector:Xft,SectorBox:Zft,Text:CW,ConicGradient:Qft,Marker:qft,getColorStops:Jft}=fp._ModuleSupport,tyt={inside:90,middle:0,outside:-90},eyt=[{textAlign:"left",textBaseline:"top"},{textAlign:"right",textBaseline:"top"},{textAlign:"right",textBaseline:"bottom"},{textAlign:"left",textBaseline:"bottom"}],iyt=[{textAlign:"right",textBaseline:"bottom"},{textAlign:"left",textBaseline:"bottom"},{textAlign:"left",textBaseline:"top"},{textAlign:"right",textBaseline:"top"}],iN=class extends fp._ModuleSupport.Series{constructor(t){super({moduleCtx:t,useLabelLayer:!0,pickModes:[kW.EXACT_SHAPE_MATCH,kW.NEAREST_NODE]}),this.canHaveAxes=!0,this.properties=new hi,this.centerX=0,this.centerY=0,this.radius=0,this.textAlign="center",this.verticalAlign="middle",this.scaleGroup=this.contentGroup.appendChild(new Zh({name:"scaleGroup"})),this.itemGroup=this.contentGroup.appendChild(new Zh({name:"itemGroup"})),this.itemNeedleGroup=this.contentGroup.appendChild(new Zh({name:"itemNeedleGroup"})),this.itemTargetGroup=this.contentGroup.appendChild(new Zh({name:"itemTargetGroup"})),this.itemTargetLabelGroup=this.contentGroup.appendChild(new Zh({name:"itemTargetLabelGroup"})),this.itemLabelGroup=this.contentGroup.appendChild(new Zh({name:"itemLabelGroup"})),this.highlightTargetGroup=this.highlightGroup.appendChild(new Zh({name:"itemTargetLabelGroup"})),this.scaleSelection=Qh.select(this.scaleGroup,()=>this.nodeFactory()),this.datumSelection=Qh.select(this.itemGroup,()=>this.nodeFactory()),this.needleSelection=Qh.select(this.itemNeedleGroup,YC),this.targetSelection=Qh.select(this.itemTargetGroup,()=>this.markerFactory()),this.targetLabelSelection=Qh.select(this.itemTargetLabelGroup,CW),this.labelSelection=Qh.select(this.itemLabelGroup,CW),this.highlightTargetSelection=Qh.select(this.highlightTargetGroup,()=>this.markerFactory()),this.datumUnion=new mV,this.animationState=new Uft("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=$ft.None}get maximumRadius(){return this.properties.outerRadius}get minimumRadius(){return this.properties.outerRadius}get hasData(){return this.properties.value!=null}nodeFactory(){return new Xft}markerFactory(){const t=new qft;return t.size=1,t}processData(){this.nodeDataRefresh=!0,this.animationState.transition("updateData")}formatLabel(t){return bV(t,this.axes[tc.X])}createConicGradient(t,e){const{centerX:i,centerY:s,radius:n}=this,{domain:a,range:o}=this.axes[tc.X].scale,[r,l]=o,{defaultColorRange:c}=this.properties,h=LW((r+l)/2+Math.PI),u=TW(l-r),d=Jft(t,c,a,e).map(({color:p,offset:g})=>(g=Math.min(Math.max(g,0),1),g=(r+u*g-h)/(2*Math.PI),g=(g%1+1)%1,{offset:g,color:p}));return new Qft("oklch",d,Hft(h)-90,new Kft(i-n,s-n,2*n,2*n))}getTargets(){const{properties:t}=this,e=t.defaultTarget;return Array.from(t.targets).map(i=>{const{text:s=e.text,value:n=e.value??0,shape:a=e.shape??"triangle",rotation:o=e.rotation??0,strokeWidth:r=e.strokeWidth??0,placement:l=e.placement??"middle",spacing:c=e.spacing??0,size:h=e.size??0,fill:u=e.fill??"black",fillOpacity:d=e.fillOpacity??1,stroke:p=e.stroke??"black",strokeOpacity:g=e.strokeOpacity??1,lineDash:f=e.lineDash??[0],lineDashOffset:x=e.lineDashOffset??0}=i,{enabled:m=e.label.enabled,color:b=e.label.color??"black",fontStyle:v=e.label.fontStyle??"normal",fontWeight:S=e.label.fontWeight??"normal",fontSize:A=e.label.fontSize,fontFamily:T=e.label.fontFamily,spacing:D=e.label.spacing??0}=i.label;return{text:s,value:n,shape:a,placement:l,spacing:c,size:h,rotation:o,fill:u,fillOpacity:d,stroke:p,strokeWidth:r,strokeOpacity:g,lineDash:f,lineDashOffset:x,label:{enabled:m,color:b,fontStyle:v,fontWeight:S,fontSize:A,fontFamily:T,spacing:D}}})}getTargetRadius(t){const{radius:e,properties:i}=this,{innerRadiusRatio:s,outerRadiusRatio:n}=i,{placement:a,spacing:o,size:r}=t,l=e*n,c=e*s;switch(a){case"inside":return Math.max(c-o-r/2,0);case"outside":return l+o+r/2;default:return(c+l)/2}}getTargetLabel(t){const i=this.axes[tc.X].scale,{value:s,size:n,placement:a,label:o}=t,{spacing:r,color:l,fontStyle:c,fontWeight:h,fontSize:u,fontFamily:d}=o,p=void 0,g=i.convert(s),f=LW(g)/(Math.PI/2)|0,x=n/2+r;let m,b,v,S;switch(a){case"outside":({textAlign:m,textBaseline:b}=eyt[f]),v=x*Math.cos(g),S=x*Math.sin(g);break;case"inside":({textAlign:m,textBaseline:b}=iyt[f]),v=-x*Math.cos(g),S=-x*Math.sin(g);break;default:m="center",b="bottom",v=0,S=-x;break}return{offsetX:v,offsetY:S,fill:l,textAlign:m,textBaseline:b,fontStyle:c,fontWeight:h,fontSize:u,fontFamily:d,lineHeight:p}}createNodeData(){const{id:t,properties:e,radius:i,centerX:s,centerY:n}=this;if(!e.isValid())return;const a=this.axes[tc.X];if(a==null)return;const{value:o,innerRadiusRatio:r,outerRadiusRatio:l,segmentation:c,cornerRadius:h,cornerMode:u,needle:d,bar:p,scale:g,label:f,secondaryLabel:x}=e,{outerRadius:m=i*l,innerRadius:b=i*r}=e,v=this.getTargets(),{domain:S}=a.scale,A=[],T=[],D=[],L=[],C=[],[O,_]=a.range,N=a.scale,P=u==="item",j=N.convert(S[0]),F=N.convert(o),V=Math.ceil(TW(F-j)*i);let W=c.enabled?c.interval.getSegments(a.scale,V):void 0;const H=p.enabled?p.fill??this.createConicGradient(p.fills,p.fillMode):"rgba(0,0,0,0)",G=g.fill??(p.enabled&&g.fills.length===0?g.defaultFill:void 0)??this.createConicGradient(g.fills,g.fillMode);if(W==null&&P){const[B,z]=S,U={value:o,segmentStart:B,segmentEnd:z},K=Math.min(h,(m-b)/2)/((b+m)/2);A.push({series:this,itemId:"value",datum:U,datumIndex:{type:0},type:0,centerX:s,centerY:n,outerRadius:m,innerRadius:b,startAngle:j-K,endAngle:F+K,clipStartAngle:void 0,clipEndAngle:void 0,startCornerRadius:h,endCornerRadius:h,fill:H}),C.push({series:this,itemId:"scale",datum:U,datumIndex:{type:0},type:0,centerX:s,centerY:n,outerRadius:m,innerRadius:b,startAngle:O-K,endAngle:_+K,clipStartAngle:void 0,clipEndAngle:void 0,startCornerRadius:h,endCornerRadius:h,fill:G})}else{W??(W=S);for(let B=0;Bthis.formatLabel(q.value)}=f;L.push({label:"primary",centerX:s,centerY:n,text:B,value:o,fill:z,fontSize:U,minimumFontSize:Y,fontStyle:K,fontWeight:Z,fontFamily:X,lineHeight:Q,formatter:$})}if(!d.enabled&&x.enabled){const{text:B,color:z,fontSize:U,minimumFontSize:Y,fontStyle:K,fontWeight:Z,fontFamily:X,lineHeight:Q,formatter:$}=x;L.push({label:"secondary",centerX:s,centerY:n,text:B,value:o,fill:z,fontSize:U,minimumFontSize:Y,fontStyle:K,fontWeight:Z,fontFamily:X,lineHeight:Q,formatter:$})}if(d.enabled){let B=d.radiusRatio!=null?i*d.radiusRatio:b;B=Math.max(B-d.spacing,0);const z=N.convert(o);D.push({centerX:s,centerY:n,radius:B,angle:z,series:this})}for(let B=0;BMath.max(...S))continue;const rt=this.getTargetRadius(z),dt=N.convert(U),at=Yft(z.rotation+tyt[z.placement]);T.push({series:this,itemId:`target-${B}`,midPoint:{x:rt*Math.cos(dt)+s,y:rt*Math.sin(dt)+n},datum:{value:U},datumIndex:{type:1,index:B},type:1,value:U,text:Y,centerX:s,centerY:n,shape:Z,radius:rt,angle:dt,rotation:at,size:K,fill:X,fillOpacity:Q,stroke:$,strokeOpacity:J,strokeWidth:q,lineDash:nt,lineDashOffset:it,label:this.getTargetLabel(z)})}return{itemId:t,nodeData:A,needleData:D,targetData:T,labelData:L,scaleData:C}}updateSelections(t){(this.nodeDataRefresh||t)&&(this.contextNodeData=this.createNodeData(),this.nodeDataRefresh=!1)}highlightDatum(t){if(t!=null&&t.series===this&&t.type===1)return t}update({seriesRect:t}){const{datumSelection:e,labelSelection:i,needleSelection:s,targetSelection:n,targetLabelSelection:a,scaleSelection:o,highlightTargetSelection:r}=this,l=this.checkResize(t);this.updateSelections(l),this.contentGroup.visible=this.visible,this.contentGroup.opacity=this.getOpacity();const c=this.contextNodeData?.nodeData??[],h=this.contextNodeData?.labelData??[],u=this.contextNodeData?.needleData??[],d=this.contextNodeData?.targetData??[],p=this.contextNodeData?.scaleData??[],g=this.highlightDatum(this.ctx.highlightManager.getActiveHighlight());this.scaleSelection=this.updateScaleSelection({scaleData:p,scaleSelection:o}),this.updateScaleNodes({scaleSelection:o}),this.needleSelection=this.updateNeedleSelection({needleData:u,needleSelection:s}),this.updateNeedleNodes({needleSelection:s}),this.targetSelection=this.updateTargetSelection({targetData:d,targetSelection:n}),this.updateTargetNodes({targetSelection:n,isHighlight:!1}),this.targetLabelSelection=this.updateTargetLabelSelection({targetData:d,targetLabelSelection:a}),this.updateTargetLabelNodes({targetLabelSelection:a}),this.datumSelection=this.updateDatumSelection({nodeData:c,datumSelection:e}),this.updateDatumNodes({datumSelection:e}),this.labelSelection=this.updateLabelSelection({labelData:h,labelSelection:i}),this.updateLabelNodes({labelSelection:i}),this.highlightTargetSelection=this.updateTargetSelection({targetData:g!=null?[g]:[],targetSelection:r}),this.updateTargetNodes({targetSelection:r,isHighlight:!0}),l&&this.animationState.transition("resize"),this.animationState.transition("update")}updateDatumSelection(t){return t.datumSelection.update(t.nodeData,void 0,e=>eN(t.nodeData.length,e.itemId))}updateDatumNodes(t){const{datumSelection:e}=t,{ctx:i,properties:s}=this,{bar:n,segmentation:a}=s,o=a.spacing??0,{fillOpacity:r,stroke:l,strokeOpacity:c,lineDash:h,lineDashOffset:u}=n,d=this.getStrokeWidth(n.strokeWidth),p=i.animationManager.isSkipped();e.each((g,f)=>{const{centerX:x,centerY:m,innerRadius:b,outerRadius:v,startCornerRadius:S,endCornerRadius:A,fill:T}=f;g.centerX=x,g.centerY=m,g.innerRadius=b,g.outerRadius=v,g.pointerEvents=this.properties.bar.enabled?fp._ModuleSupport.PointerEvents.All:fp._ModuleSupport.PointerEvents.None,g.fill=T,g.fillOpacity=r,g.stroke=l,g.strokeOpacity=c,g.strokeWidth=d,g.lineDash=h,g.lineDashOffset=u,g.startOuterCornerRadius=S,g.startInnerCornerRadius=S,g.endOuterCornerRadius=A,g.endInnerCornerRadius=A,g.radialEdgeInset=(o+g.strokeWidth)/2,g.concentricEdgeInset=g.strokeWidth/2,(p||g.previousDatum==null)&&g.setProperties(tN(g,f))}),this.datumUnion.update(e,this.itemGroup,fp._ModuleSupport.Sector,(g,f,x)=>{g.clipSector??(g.clipSector=new Zft(NaN,NaN,NaN,NaN)),g.centerX=f.centerX,g.centerY=f.centerY,g.outerRadius=g.clipSector.outerRadius=f.outerRadius,g.innerRadius=g.clipSector.innerRadius=f.innerRadius,g.startAngle=g.clipSector.startAngle=f.startAngle,g.startInnerCornerRadius=f.startInnerCornerRadius,g.startOuterCornerRadius=f.startOuterCornerRadius,g.endAngle=x.endAngle,g.clipSector.endAngle=x.clipSector?.endAngle??x.endAngle,g.endInnerCornerRadius=x.endInnerCornerRadius,g.endOuterCornerRadius=x.endOuterCornerRadius,g.pointerEvents=fp._ModuleSupport.PointerEvents.None})}updateScaleSelection(t){return t.scaleSelection.update(t.scaleData,void 0,e=>eN(t.scaleData.length,e.itemId))}updateScaleNodes(t){const{scaleSelection:e}=t,{scale:i,segmentation:s}=this.properties,n=s.spacing??0,{fillOpacity:a,stroke:o,strokeOpacity:r,strokeWidth:l,lineDash:c,lineDashOffset:h}=i;e.each((u,d)=>{const{centerX:p,centerY:g,innerRadius:f,outerRadius:x,startCornerRadius:m,endCornerRadius:b,fill:v}=d;u.centerX=p,u.centerY=g,u.innerRadius=f,u.outerRadius=x,u.fill=v,u.fillOpacity=a,u.stroke=o,u.strokeOpacity=r,u.strokeWidth=l,u.lineDash=c,u.lineDashOffset=h,u.startOuterCornerRadius=m,u.startInnerCornerRadius=m,u.endOuterCornerRadius=b,u.endInnerCornerRadius=b,u.radialEdgeInset=(n+u.strokeWidth)/2,u.concentricEdgeInset=u.strokeWidth/2,u.setProperties(tN(u,d))})}updateNeedleSelection(t){return t.needleSelection.update(t.needleData,void 0,()=>eN([]))}updateNeedleNodes(t){const{needleSelection:e}=t,{fill:i,fillOpacity:s,stroke:n,strokeOpacity:a,strokeWidth:o,lineDash:r,lineDashOffset:l}=this.properties.needle,c=this.ctx.animationManager.isSkipped();e.each((h,u)=>{const{centerX:d,centerY:p,radius:g}=u,f=g*2;h.d=YC.defaultPathData,h.fill=i,h.fillOpacity=s,h.stroke=n,h.strokeOpacity=a,h.strokeWidth=o/f,h.lineDash=r.map(x=>x/f),h.lineDashOffset=l/f,h.translationX=d,h.translationY=p,h.scalingX=f,h.scalingY=f,c&&h.setProperties(AW(h,u))})}updateTargetSelection(t){return t.targetSelection.update(t.targetData,void 0,e=>e.itemId)}updateTargetNodes(t){const{targetSelection:e,isHighlight:i}=t,s=i?this.properties.highlightStyle.item:void 0;e.each((n,a)=>{const{centerX:o,centerY:r,angle:l,radius:c,shape:h,size:u,rotation:d,fill:p,fillOpacity:g,stroke:f,strokeOpacity:x,strokeWidth:m,lineDash:b,lineDashOffset:v}=a;n.shape=h==="line"?SV:h,n.size=u,n.fill=s?.fill??p,n.fillOpacity=s?.fillOpacity??g,n.stroke=s?.stroke??f,n.strokeOpacity=s?.strokeOpacity??x,n.strokeWidth=s?.strokeWidth??m,n.lineDash=s?.lineDash??b,n.lineDashOffset=s?.lineDashOffset??v,n.translationX=o+c*Math.cos(l),n.translationY=r+c*Math.sin(l),n.rotation=l+d})}updateTargetLabelSelection(t){return t.targetLabelSelection.update(t.targetData,void 0,e=>e.itemId)}updateTargetLabelNodes(t){const{targetLabelSelection:e}=t;e.each((i,s)=>{const{centerX:n,centerY:a,radius:o,angle:r,text:l}=s,{offsetX:c,offsetY:h,fill:u,fontStyle:d,fontWeight:p,fontSize:g,fontFamily:f,textAlign:x,textBaseline:m}=s.label;if(l==null){i.visible=!1;return}i.visible=!0,i.x=n+o*Math.cos(r)+c,i.y=a+o*Math.sin(r)+h,i.text=l,i.fill=u,i.fontStyle=d,i.fontWeight=p,i.fontSize=g,i.fontFamily=f,i.textAlign=x,i.textBaseline=m})}updateLabelSelection(t){return t.labelSelection.update(t.labelData,void 0,e=>e.label)}updateLabelNodes(t){const{labelSelection:e}=t,i=this.ctx.animationManager.isSkipped();e.each((s,n)=>{s.fill=n.fill,s.fontStyle=n.fontStyle,s.fontWeight=n.fontWeight,s.fontFamily=n.fontFamily}),(i||this.labelsHaveExplicitText())&&this.formatLabelText()}labelsHaveExplicitText(){for(const{datum:t}of this.labelSelection)if(t.text==null)return!1;return!0}formatLabelText(t){if(this.axes[tc.X]==null)return;const{labelSelection:i,radius:s,textAlign:n,verticalAlign:a}=this,{spacing:o,innerRadiusRatio:r}=this.properties;Wft(this,i,{padding:o,textAlign:n,verticalAlign:a},s*r,t)}resetAllAnimation(){this.ctx.animationManager.stopByAnimationGroupId(this.id),DW([this.datumSelection],tN),DW([this.needleSelection],AW),this.formatLabelText()}resetAnimation(t){t==="initial"?this.animationState.transition("reset"):t==="ready"&&this.animationState.transition("skip")}animateLabelText(t={}){const{animationManager:e}=this.ctx;let i,s,n,a;if(this.labelSelection.each((o,r)=>{o.opacity=1,r.label==="primary"?(i=o.previousDatum?.value??t.from??r.value,s=r.value):r.label==="secondary"&&(n=o.previousDatum?.value??t.from??r.value,a=r.value)}),!this.labelsHaveExplicitText())if(s==null||a==null)this.formatLabelText();else if(i===s&&n===a)this.formatLabelText({label:s,secondaryLabel:a});else{const o=`${this.id}_labels`;e.animate({id:o,groupId:"label",from:{label:i,secondaryLabel:n},to:{label:s,secondaryLabel:a},phase:t.phase??"update",onUpdate:r=>this.formatLabelText(r)})}}animateEmptyUpdateReady(){const{animationManager:t}=this.ctx,{node:e,needle:i}=IW(!0,this.axes[tc.X]?.range[0]??0);Ny(this.id,"node",t,[this.datumSelection],e,(s,n)=>n.itemId),Ny(this.id,"needle",t,[this.needleSelection],i,()=>"needle"),Ny(this.id,"label",t,[this.labelSelection],xV,(s,n)=>n.label),this.animateLabelText({from:this.axes[tc.X]?.scale.domain[0]??0,phase:"initial"})}animateWaitingUpdateReady(){const{animationManager:t}=this.ctx,{node:e,needle:i}=IW(!1,this.axes[tc.X]?.range[0]??0);Ny(this.id,"node",t,[this.datumSelection],e,(s,n)=>n.itemId),Ny(this.id,"needle",t,[this.needleSelection],i,()=>"needle"),this.animateLabelText()}animateReadyResize(){this.resetAllAnimation()}getSeriesDomain(){return[NaN,NaN]}getSeriesRange(t,e){return[NaN,NaN]}getLegendData(){return[]}getTooltipContent(t){const{id:e,properties:i}=this,{tooltip:s}=i;if(!i.isValid())return;const{value:n=i.value,text:a=i.label.text}=kV(t);return s.formatTooltip({data:[{label:a,fallbackLabel:"Value",value:this.formatLabel(n)}]},{seriesId:e,title:void 0,datum:void 0,value:n})}pickNodeClosestDatum(t){return MV(this,t)}pickFocus(t){return IV(this,t)}getCaptionText(){const{value:t}=this.properties,e=[];return e.push(this.formatLabel(t)),this.labelSelection.each((i,s)=>{const n=vy(this,s);n!=null&&e.push(n)}),e.join(". ")}};iN.className="RadialGaugeSeries",iN.type="radial-gauge";var{FONT_SIZE_RATIO:syt,ThemeSymbols:{DEFAULT_HIERARCHY_FILLS:nyt,DEFAULT_GAUGE_SERIES_COLOR_RANGE:ayt},ThemeConstants:{POLAR_AXIS_TYPE:sN}}=Lft._ModuleSupport,oyt={type:"series",optionsKey:"series[]",packageType:"enterprise",chartTypes:["gauge"],identifier:"radial-gauge",moduleFactory:t=>new iN(t),tooltipDefaults:{range:10},defaultAxes:[{type:sN.ANGLE_NUMBER,line:{enabled:!1}},{type:sN.RADIUS_NUMBER,line:{enabled:!1}}],themeTemplate:{minWidth:200,minHeight:200,tooltip:{enabled:!1},series:{outerRadiusRatio:1,innerRadiusRatio:.8,bar:{strokeWidth: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:{enabled:!0,fontWeight:{$ref:"fontWeight"},fontSize:56,minimumFontSize:18/56,fontFamily:{$ref:"fontFamily"},color:{$ref:"textColor"}},secondaryLabel:{enabled:!0,fontWeight:{$ref:"fontWeight"},fontSize:{$rem:[syt.LARGE]},minimumFontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},color:{$ref:"subtleTextColor"}}},axes:{[sN.ANGLE_NUMBER]:{startAngle:270,endAngle:450,nice:!1,line:{enabled:!1}}}},paletteFactory(t){const{takeColors:e,colorsCount:i,userPalette:s,themeTemplateParameters:n}=t,{fills:a}=e(i),o=n.get(ayt),r=n.get(nyt),l=s==="inbuilt"?o:[a[0],a[1]];return{scale:{defaultFill:r?.[1],stroke:r?.[2]},defaultColorRange:yV(l)}}},ryt=(R(),E(w)),eM=(R(),E(w)),lyt=1e3;function NW(t,e,i,s,n,a){const o=t[a];if(o==null)return!1;const r=uv(o,e,i),l=dv(r,n);return a===s[l+qs]}function OW(t,e,i,s,n,a){const o=t[a];if(o==null)return!1;const r=uv(o,e,i),l=dv(r,n);return a===s[l+Qs]}function cyt(t,e,i,s){if(t.length64;)({maxRange:o}=ry(r,l,o,{inPlace:!0})),c=c.filter(NW.bind(null,t,n,a,r,o)),h=h.filter(OW.bind(null,t,n,a,r,o)),u.push({maxRange:o,topIndices:c,bottomIndices:h});return u.reverse(),u}var hyt=(R(),E(w)),{CartesianSeriesProperties:uyt,InterpolationProperties:dyt,SeriesMarker:pyt,SeriesTooltip:gyt,Validate:Fe,BOOLEAN:fyt,COLOR_STRING:wW,LINE_DASH:yyt,OBJECT:Oy,PLACEMENT:myt,POSITIVE_NUMBER:nN,RATIO:EW,STRING:qh,DropShadow:xyt,Label:byt}=hyt._ModuleSupport,aN=class extends byt{constructor(){super(...arguments),this.placement="outside",this.padding=6}};y([Fe(myt)],aN.prototype,"placement",2),y([Fe(nN)],aN.prototype,"padding",2);var Qe=class extends uyt{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 dyt,this.shadow=new xyt().set({enabled:!1}),this.marker=new pyt,this.label=new aN,this.tooltip=new gyt,this.connectMissingData=!1}};y([Fe(qh)],Qe.prototype,"xKey",2),y([Fe(qh)],Qe.prototype,"yLowKey",2),y([Fe(qh)],Qe.prototype,"yHighKey",2),y([Fe(qh,{optional:!0})],Qe.prototype,"xName",2),y([Fe(qh,{optional:!0})],Qe.prototype,"yName",2),y([Fe(qh,{optional:!0})],Qe.prototype,"yLowName",2),y([Fe(qh,{optional:!0})],Qe.prototype,"yHighName",2),y([Fe(wW)],Qe.prototype,"fill",2),y([Fe(EW)],Qe.prototype,"fillOpacity",2),y([Fe(wW)],Qe.prototype,"stroke",2),y([Fe(nN)],Qe.prototype,"strokeWidth",2),y([Fe(EW)],Qe.prototype,"strokeOpacity",2),y([Fe(yyt)],Qe.prototype,"lineDash",2),y([Fe(nN)],Qe.prototype,"lineDashOffset",2),y([Fe(Oy)],Qe.prototype,"interpolation",2),y([Fe(Oy)],Qe.prototype,"shadow",2),y([Fe(Oy)],Qe.prototype,"marker",2),y([Fe(Oy)],Qe.prototype,"label",2),y([Fe(Oy)],Qe.prototype,"tooltip",2),y([Fe(fyt)],Qe.prototype,"connectMissingData",2);var Syt=(R(),E(w)),{CollapseMode:iM,isScaleValid:RW,pairUpSpans:sM,prepareAreaFillAnimationFns:vyt,plotInterpolatedLinePathStroke:yp,prepareLinePathPropertyAnimation:Myt,areScalingEqual:_W}=Syt._ModuleSupport;function Iyt(t,e,i,s){const n=(l,c)=>{yp(l,c,e.removed),yp(l,c,i.removed)},a=(l,c)=>{yp(l,c,e.moved),yp(l,c,i.moved)},o=(l,c)=>{yp(l,c,e.added),yp(l,c,i.added)},r=Myt(t,s);return{status:t,path:{addPhaseFn:o,updatePhaseFn:a,removePhaseFn:n},pathProperties:r}}function Ayt(t,e,i){const s=t.scales.x?.type==="category",n=e.scales.x?.type==="category";if(s!==n||!RW(t.scales.x)||!RW(e.scales.x))return;let a="updated";e.visible&&!t.visible?a="removed":!e.visible&&t.visible&&(a="added");const o=sM({scales:t.scales,data:t.fillData.spans},{scales:e.scales,data:e.fillData.spans},iM.Split);if(o==null)return;const r=sM({scales:t.scales,data:t.fillData.phantomSpans},{scales:e.scales,data:e.fillData.phantomSpans},iM.Split);if(r==null)return;const l=sM({scales:t.scales,data:t.highStrokeData.spans},{scales:e.scales,data:e.highStrokeData.spans},iM.Split);if(l==null)return;const c=sM({scales:t.scales,data:t.lowStrokeData.spans},{scales:e.scales,data:e.lowStrokeData.spans},iM.Split);if(c==null)return;const h="fade",u=vyt(a,o,r,h),d=Iyt(a,l,c,h),p=(i?.changed??!0)||!_W(t.scales.x,e.scales.x)||!_W(t.scales.y,e.scales.y)||a!=="updated";return{status:a,fill:u,stroke:d,hasMotion:p}}var{valueProperty:PW,keyProperty:Dyt,ChartAxisDirection:Ss,mergeDefaults:kyt,updateLabelNode:Lyt,fixNumericExtent:BW,buildResetPathFn:Tyt,resetLabelFn:Cyt,resetMarkerFn:Nyt,resetMarkerPositionFn:zW,pathSwipeInAnimation:Oyt,resetMotion:wyt,markerSwipeScaleInAnimation:Eyt,seriesLabelFadeInAnimation:oN,animationValidation:Ryt,diff:_yt,updateClipPath:FW,computeMarkerFocusBounds:jW,plotAreaPathFill:Pyt,plotLinePathStroke:VW,interpolatePoints:GW,pathFadeInAnimation:WW,markerFadeInAnimation:UW,fromToMotion:HW,pathMotion:YW,extent:Byt,createDatumId:zyt,PointerEvents:rN,Group:Fyt,BBox:jyt,ContinuousScale:Vyt,OrdinalTimeScale:Gyt,findMinMax:Wyt}=eM._ModuleSupport,Uyt=class extends eM._ModuleSupport.SeriesNodeEvent{constructor(t,e,i,s){super(t,e,i,s),this.xKey=s.properties.xKey,this.yLowKey=s.properties.yLowKey,this.yHighKey=s.properties.yHighKey}},lN=class extends eM._ModuleSupport.CartesianSeries{constructor(t){super({moduleCtx:t,hasMarkers:!0,pathsPerSeries:["fill","stroke"],pickModes:[eM._ModuleSupport.SeriesNodePickMode.AXIS_ALIGNED],directionKeys:{[Ss.X]:["xKey"],[Ss.Y]:["yLowKey","yHighKey"]},directionNames:{[Ss.X]:["xName"],[Ss.Y]:["yLowName","yHighName","yName"]},animationResetFns:{path:Tyt({getVisible:()=>this.visible,getOpacity:()=>this.getOpacity()}),label:Cyt,marker:(e,i)=>({...Nyt(e),...zW(e,i)})}}),this.properties=new Qe,this.NodeEvent=Uyt,this.dataAggregationFilters=void 0}async processData(t){if(!this.properties.isValid())return;const{xKey:e,yLowKey:i,yHighKey:s}=this.properties,n=this.axes[Ss.X]?.scale,a=this.axes[Ss.Y]?.scale,{xScaleType:o,yScaleType:r}=this.getScaleInformation({xScale:n,yScale:a}),l=[],c=!this.ctx.animationManager.isSkipped();!this.ctx.animationManager.isSkipped()&&this.processedData&&l.push(_yt(this.id,this.processedData)),c&&l.push(Ryt());const{dataModel:h,processedData:u}=await this.requestDataModel(t,this.data,{props:[Dyt(e,o,{id:"xValue"}),PW(i,r,{id:"yLowValue"}),PW(s,r,{id:"yHighValue"}),...l]});this.dataAggregationFilters=this.aggregateData(h,u),this.animationState.transition("updateData")}aggregateData(t,e){const i=this.axes[Ss.X];if(i==null||!(Vyt.is(i.scale)||Gyt.is(i.scale)))return;const s=t.resolveKeysById(this,"xValue",e),n=t.resolveColumnById(this,"yHighValue",e),a=t.resolveColumnById(this,"yLowValue",e),{index:o}=t.resolveProcessedDataDefById(this,"xValue"),r=e.domain.keys[o];return cyt(s,n,a,r)}xCoordinateRange(t){const e=this.axes[Ss.X].scale.convert(t);return[e,e]}yCoordinateRange(t){const e=this.axes[Ss.Y].scale.convert(t[0]);return[e,e]}getSeriesDomain(t){const{processedData:e,dataModel:i}=this;if(!(e&&i))return[];const{domain:{keys:[s]}}=e;if(t===Ss.X){const n=i.resolveProcessedDataDefById(this,"xValue");return n?.def.type==="key"&&n.def.valueType==="category"?s:BW(Byt(s))}else{const n=this.domainForClippedRange(Ss.Y,["yHighValue","yLowValue"],"xValue",!0),a=Wyt(n);return BW(a)}}getSeriesRange(t,e){return this.domainForVisibleRange(Ss.Y,["yHighValue","yLowValue"],"xValue",e,!0)}createNodeData(){const{data:t,dataModel:e,processedData:i,axes:s}=this,n=s[Ss.X],a=s[Ss.Y];if(!(t&&n&&a&&e&&i))return;const o=n.scale,r=a.scale,{xKey:l,yLowKey:c,yHighKey:h,connectMissingData:u,marker:d,interpolation:p}=this.properties,g=i.dataSources.get(this.id)??[],f=(o.bandwidth??0)/2,x=e.resolveKeysById(this,"xValue",i),m=e.resolveColumnById(this,"yHighValue",i),b=e.resolveColumnById(this,"yLowValue",i),v=B=>o.convert(x[B])+f,S=[],A=[],T=[],D=(B,z,U)=>{const Y=g[B],K=x[B];if(K==null)return;const Z=T[T.length-1];if(Number.isFinite(z)&&Number.isFinite(U)){const X=(rt,dt,at)=>{A.push({index:B,series:this,itemId:rt,datum:Y,datumIndex:B,midPoint:{x:$,y:at},yHighValue:z,yLowValue:U,xValue:K,xKey:l,yLowKey:c,yHighKey:h,point:{x:$,y:at,size:nt},enabled:!0});const Dt=this.createLabelData({datumIndex:B,point:{x:$,y:at},value:dt,yLowValue:U,yHighValue:z,itemId:rt,inverted:Q,datum:Y,series:this});S.push(Dt)},Q=U>z,$=v(B),q=r.convert(z),J=r.convert(U),{size:nt}=d;X("high",z,q),X("low",U,J);const it={high:{point:{x:$,y:q},xDatum:K,yDatum:z},low:{point:{x:$,y:J},xDatum:K,yDatum:U}};Array.isArray(Z)?Z.push(it):Z!=null?(Z.skip+=1,T.push([it])):T.push([it])}else u||(Array.isArray(Z)||Z==null?T.push({skip:0}):Z.skip+=1)},{dataAggregationFilters:L}=this,[C,O]=o.range,_=O-C,N=L?.find(B=>B.maxRange>_),P=N?.topIndices,j=N?.bottomIndices;let[F,V]=this.visibleRange("xValue",n.range,P);F=Math.max(F-1,0),V=Math.min(V+1,P?.length??x.length),i.input.count<1e3&&(F=0,V=i.input.count);for(let B=F;B{if(!Array.isArray(B))return[];const z=B.map(U=>U.high);return GW(z,p)}),H=T.flatMap(B=>{if(!Array.isArray(B))return[];const z=B.map(U=>U.low);return GW(z,p)});return{itemId:`${c}-${h}`,labelData:S,nodeData:A,fillData:{itemId:"high",spans:W,phantomSpans:H},highStrokeData:{itemId:"high",spans:W},lowStrokeData:{itemId:"low",spans:H},scales:this.calculateScaling(),visible:this.visible}}createLabelData({datumIndex:t,point:e,value:i,itemId:s,inverted:n,datum:a,series:o}){const{xKey:r,yLowKey:l,yHighKey:c,xName:h,yName:u,yLowName:d,yHighName:p,label:g}=this.properties,{placement:f,padding:x=10}=g;let m=s;n&&(m=s==="low"?"high":"low");const b=f==="outside"&&m==="high"||f==="inside"&&m==="low"?-1:1;return{x:e.x,y:e.y+x*b,series:o,itemId:s,datum:a,datumIndex:t,text:this.getLabelText(g,{value:i,datum:a,itemId:s,xKey:r,yLowKey:l,yHighKey:c,xName:h,yLowName:d,yHighName:p,yName:u}),textAlign:"center",textBaseline:b===-1?"bottom":"top"}}isPathOrSelectionDirty(){return this.properties.marker.isDirty()}updatePathNodes(t){const{opacity:e,visible:i,animationEnabled:s}=t,[n,a]=t.paths,o=this.getStrokeWidth(this.properties.strokeWidth);a.setProperties({fill:void 0,lineCap:"round",lineJoin:"round",pointerEvents:rN.None,stroke:this.properties.stroke,strokeWidth:o,strokeOpacity:this.properties.strokeOpacity,lineDash:this.properties.lineDash,lineDashOffset:this.properties.lineDashOffset,opacity:e,visible:i||s}),n.setProperties({stroke:void 0,lineJoin:"round",pointerEvents:rN.None,fill:this.properties.fill,fillOpacity:this.properties.fillOpacity,lineDash:this.properties.lineDash,lineDashOffset:this.properties.lineDashOffset,strokeOpacity:this.properties.strokeOpacity,fillShadow:this.properties.shadow,strokeWidth:o,opacity:e,visible:i||s}),FW(this,a),FW(this,n)}updatePaths(t){this.updateAreaPaths(t.paths,t.contextData)}updateAreaPaths(t,e){for(const i of t)i.visible=e.visible;if(e.visible)this.updateFillPath(t,e),this.updateStrokePath(t,e);else for(const i of t)i.path.clear(),i.markDirty()}updateFillPath(t,e){const[i]=t;i.path.clear(),Pyt(i,e.fillData),i.markDirty()}updateStrokePath(t,e){const[,i]=t;i.path.clear(),VW(i,e.highStrokeData.spans),VW(i,e.lowStrokeData.spans),i.markDirty()}updateMarkerSelection(t){const{nodeData:e,markerSelection:i}=t;return this.properties.marker.isDirty()&&(i.clear(),i.cleanup()),i.update(this.properties.marker.enabled?e:[])}getMarkerItemBaseStyle(t){const{properties:e}=this,{marker:i}=e,s=t?e.highlightStyle.item:void 0;return{shape:i.shape,size:i.size,fill:s?.fill??i.fill,fillOpacity:s?.fillOpacity??i.fillOpacity,stroke:s?.stroke??i.stroke,strokeWidth:s?.strokeWidth??this.getStrokeWidth(i.strokeWidth),strokeOpacity:s?.strokeOpacity??i.strokeOpacity,lineDash:s?.lineDash??i.lineDash,lineDashOffset:s?.lineDashOffset??i.lineDashOffset}}getMarkerItemStyleOverrides(t,e,i,s){const{id:n,properties:a}=this,{xKey:o,yHighKey:r,yLowKey:l,marker:c}=a,{itemStyler:h}=c;if(h!=null)return this.cachedDatumCallback(zyt(t,s?"highlight":"node"),()=>h({seriesId:n,datum:e,xKey:o,yHighKey:r,yLowKey:l,highlighted:s,...i}))}updateMarkerNodes(t){const{markerSelection:e,isHighlight:i}=t,{xKey:s,yLowKey:n,yHighKey:a,marker:o,fill:r,stroke:l,strokeWidth:c,fillOpacity:h,strokeOpacity:u}=this.properties,d=kyt(i&&this.properties.highlightStyle.item,o.getStyle(),{fill:r,fillOpacity:h,stroke:l,strokeWidth:c,strokeOpacity:u});e.each((p,g)=>{this.updateMarkerStyle(p,o,{datum:g,highlighted:i,xKey:s,yHighKey:a,yLowKey:n},d)}),i||this.properties.marker.markClean()}updateLabelSelection(t){const{labelData:e,labelSelection:i}=t;return i.update(e,s=>{s.pointerEvents=rN.None})}updateLabelNodes(t){t.labelSelection.each((e,i)=>{Lyt(e,this.properties.label,i)})}getHighlightLabelData(t,e){const i=t.filter(s=>s.datum===e.datum);return i.length>0?i:void 0}getHighlightData(t,e){const i=t.filter(s=>s.datum===e.datum);return i.length>0?i:void 0}getTooltipContent(t){const{id:e,dataModel:i,processedData:s,axes:n,properties:a}=this,{xName:o,yName:r,yLowKey:l,yLowName:c,xKey:h,yHighKey:u,yHighName:d,tooltip:p}=a,g=n[Ss.X],f=n[Ss.Y];if(!i||!s||!g||!f)return;const{datumIndex:x}=t,m=s.dataSources.get(this.id)?.[x],b=i.resolveKeysById(this,"xValue",s)[x],v=i.resolveColumnById(this,"yHighValue",s)[x],S=i.resolveColumnById(this,"yLowValue",s)[x];if(b==null)return;const A=this.getMarkerItemBaseStyle(!1);Object.assign(A,this.getMarkerItemStyleOverrides(String(x),x,A,!1));const T=`${f.formatDatum(S)} - ${f.formatDatum(v)}`;return p.formatTooltip({heading:g.formatDatum(b),symbol:this.legendItemSymbol(),data:[{label:r,fallbackLabel:`${c??l} - ${d??u}`,value:T}]},{seriesId:e,datum:m,title:r,itemId:t.itemId,xName:o,yName:r,yLowKey:l,yLowName:c,xKey:h,yHighKey:u,yHighName:d,...A})}legendItemSymbol(){const{fill:t,stroke:e,strokeWidth:i,strokeOpacity:s,lineDash:n,marker:a}=this.properties;return{marker:{shape:a.shape,fill:a.fill??t,stroke:a.stroke??e,fillOpacity:a.fillOpacity,strokeOpacity:a.strokeOpacity,strokeWidth:a.strokeWidth,lineDash:a.lineDash,lineDashOffset:a.lineDashOffset},line:{stroke:e,strokeOpacity:s,strokeWidth:i,lineDash:n}}}getLegendData(t){if(t!=="category")return[];const{id:e,visible:i}=this,{yLowKey:s,yHighKey:n,yName:a,yLowName:o,yHighName:r,showInLegend:l}=this.properties,c=a??`${o??s} - ${r??n}`,h=`${s}-${n}`;return[{legendType:"category",id:e,itemId:h,seriesId:e,enabled:i,label:{text:`${c}`},symbol:this.legendItemSymbol(),hideInLegend:!l}]}isLabelEnabled(){return this.properties.label.enabled}onDataChange(){}nodeFactory(){return new Fyt}animateEmptyUpdateReady(t){const{markerSelection:e,labelSelection:i,contextData:s,paths:n}=t,{animationManager:a}=this.ctx;this.updateAreaPaths(n,s),Oyt(this,a,...n),wyt([e],zW),Eyt(this,a,e),oN(this,"labels",a,i)}animateReadyResize(t){const{contextData:e,paths:i}=t;this.updateAreaPaths(i,e),super.animateReadyResize(t)}animateWaitingUpdateReady(t){const{animationManager:e}=this.ctx,{markerSelection:i,labelSelection:s,contextData:n,paths:a,previousContextData:o}=t,[r,l]=a;if(r==null&&l==null)return;this.resetMarkerAnimation(t),this.resetLabelAnimation(t);const c=()=>{this.resetPathAnimation(t),this.updateAreaPaths(a,n)},h=()=>{e.skipCurrentBatch(),c()};if(n==null||o==null){c(),UW(this,e,"added",i),WW(this,"fill_path_properties",e,"add",r),WW(this,"stroke_path_properties",e,"add",l),oN(this,"labels",e,s);return}const u=Ayt(n,o,this.processedData?.reduced?.diff?.[this.id]);if(u===void 0){h();return}else if(u.status==="no-op")return;HW(this.id,"fill_path_properties",e,[r],u.fill.pathProperties),HW(this.id,"stroke_path_properties",e,[l],u.stroke.pathProperties),u.status==="added"?this.updateAreaPaths(a,n):u.status==="removed"?this.updateAreaPaths(a,o):(YW(this.id,"fill_path_update",e,[r],u.fill.path),YW(this.id,"stroke_path_update",e,[l],u.stroke.path)),u.hasMotion&&(UW(this,e,void 0,i),oN(this,"labels",e,s)),this.ctx.animationManager.animate({id:this.id,groupId:"reset_after_animation",phase:"trailing",from:{},to:{},onComplete:()=>this.updateAreaPaths(a,n)})}getFormattedMarkerStyle(t){const{xKey:e,yLowKey:i,yHighKey:s}=this.properties;return this.getMarkerStyle(this.properties.marker,{datum:t,xKey:e,yLowKey:i,yHighKey:s,highlighted:!0})}computeFocusBounds(t){const e=jW(this,t),i=jW(this,{...t,datumIndex:t.datumIndex+1});if(e&&i)return jyt.merge([e,i])}computeFocusDatumIndex(t,e){const i={...t,datumIndex:t.datumIndex+t.datumIndexDelta,datumIndexDelta:t.datumIndexDelta*2};return super.computeFocusDatumIndex(i,e)}};lN.className="RangeAreaSeries",lN.type="range-area";var Hyt=(R(),E(w)),Yyt={series:{fillOpacity:.7,nodeClickRange:"nearest",marker:{enabled:!1,size:6,strokeWidth:2},label:{enabled:!1,placement:"outside",padding:10,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"textColor"}},interpolation:{type:"linear",tension:1,position:"end"}},axes:{[Hyt._ModuleSupport.ThemeConstants.CARTESIAN_AXIS_TYPE.NUMBER]:{crosshair:{enabled:!0}}}},{markerPaletteFactory:Kyt,ThemeConstants:{CARTESIAN_AXIS_TYPE:KW,CARTESIAN_POSITION:$W}}=ryt._ModuleSupport,$yt={type:"series",optionsKey:"series[]",packageType:"enterprise",chartTypes:["cartesian"],identifier:"range-area",moduleFactory:t=>new lN(t),tooltipDefaults:{range:"nearest"},defaultAxes:[{type:KW.NUMBER,position:$W.LEFT},{type:KW.CATEGORY,position:$W.BOTTOM}],themeTemplate:Yyt,paletteFactory:t=>{const{marker:e}=Kyt(t);return{fill:e.fill,stroke:e.stroke,marker:e}}},XW=(R(),E(w)),cN=(R(),E(w)),Xyt=1e3,Zyt=5;function Qyt(t,e,i,s){if(t.length64;)({indexData:r,valueData:l,maxRange:o}=ry(r,l,o)),c.push({maxRange:o,indexData:r});return c.reverse(),c}var qyt=(R(),E(w)),{AbstractBarSeriesProperties:Jyt,SeriesTooltip:tmt,Validate:je,COLOR_STRING:ZW,FUNCTION:emt,LINE_DASH:imt,OBJECT:hN,PLACEMENT:smt,POSITIVE_NUMBER:nM,RATIO:QW,STRING:Jh,BOOLEAN:nmt,DropShadow:amt,Label:omt}=qyt._ModuleSupport,uN=class extends omt{constructor(){super(...arguments),this.placement="inside",this.padding=6}};y([je(smt)],uN.prototype,"placement",2),y([je(nM)],uN.prototype,"padding",2);var qe=class extends Jyt{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 amt().set({enabled:!1}),this.label=new uN,this.tooltip=new tmt,this.fastDataProcessing=!1}};y([je(Jh)],qe.prototype,"xKey",2),y([je(Jh)],qe.prototype,"yLowKey",2),y([je(Jh)],qe.prototype,"yHighKey",2),y([je(Jh,{optional:!0})],qe.prototype,"xName",2),y([je(Jh,{optional:!0})],qe.prototype,"yName",2),y([je(Jh,{optional:!0})],qe.prototype,"yLowName",2),y([je(Jh,{optional:!0})],qe.prototype,"yHighName",2),y([je(ZW)],qe.prototype,"fill",2),y([je(QW)],qe.prototype,"fillOpacity",2),y([je(ZW)],qe.prototype,"stroke",2),y([je(nM)],qe.prototype,"strokeWidth",2),y([je(QW)],qe.prototype,"strokeOpacity",2),y([je(imt)],qe.prototype,"lineDash",2),y([je(nM)],qe.prototype,"lineDashOffset",2),y([je(nM)],qe.prototype,"cornerRadius",2),y([je(emt,{optional:!0})],qe.prototype,"itemStyler",2),y([je(hN)],qe.prototype,"shadow",2),y([je(hN)],qe.prototype,"label",2),y([je(hN)],qe.prototype,"tooltip",2),y([je(nmt)],qe.prototype,"fastDataProcessing",2);var{SeriesNodePickMode:qW,valueProperty:JW,keyProperty:rmt,ChartAxisDirection:wy,checkCrisp:lmt,updateLabelNode:cmt,SMALLEST_KEY_INTERVAL:hmt,LARGEST_KEY_INTERVAL:umt,diff:dmt,prepareBarAnimationFunctions:tU,midpointStartingBarPosition:eU,resetBarSelectionsFn:pmt,fixNumericExtent:gmt,seriesLabelFadeInAnimation:iU,resetLabelFn:fmt,animationValidation:ymt,computeBarFocusBounds:mmt,visibleRangeIndices:sU,createDatumId:xmt,ContinuousScale:nU,OrdinalTimeScale:bmt,Rect:Smt,PointerEvents:vmt,motion:aU,applyShapeStyle:Mmt,findMinMax:Imt}=cN._ModuleSupport,Amt=class extends cN._ModuleSupport.SeriesNodeEvent{constructor(t,e,i,s){super(t,e,i,s),this.xKey=s.properties.xKey,this.yLowKey=s.properties.yLowKey,this.yHighKey=s.properties.yHighKey}},dN=class extends cN._ModuleSupport.AbstractBarSeries{constructor(t){super({moduleCtx:t,pickModes:[qW.AXIS_ALIGNED,qW.EXACT_SHAPE_MATCH],hasHighlightedLabels:!0,directionKeys:{x:["xKey"],y:["yLowKey","yHighKey"]},directionNames:{x:["xName"],y:["yLowName","yHighName","yName"]},datumSelectionGarbageCollection:!1,animationResetFns:{datum:pmt,label:fmt}}),this.properties=new qe,this.dataAggregationFilters=void 0,this.NodeEvent=Amt}async processData(t){if(!this.properties.isValid())return;const{xKey:e,yLowKey:i,yHighKey:s,fastDataProcessing:n}=this.properties,a=!n,o=this.getCategoryAxis()?.scale,r=this.getValueAxis()?.scale,{isContinuousX:l,xScaleType:c,yScaleType:h}=this.getScaleInformation({xScale:o,yScale:r}),u=[];this.ctx.animationManager.isSkipped()||(this.processedData&&u.push(dmt(this.id,this.processedData)),u.push(ymt()));const d=this.visible?{}:{forceValue:0},{dataModel:p,processedData:g}=await this.requestDataModel(t,this.data,{props:[rmt(e,c,{id:"xValue"}),JW(i,h,{id:"yLowValue",invalidValue:null,...d}),JW(s,h,{id:"yHighValue",invalidValue:null,...d}),...l?[hmt,umt]:[],...u],groupByKeys:a});this.smallestDataInterval=g.reduced?.smallestKeyInterval,this.largestDataInterval=g.reduced?.largestKeyInterval,this.dataAggregationFilters=this.aggregateData(p,g),this.animationState.transition("updateData")}aggregateData(t,e){if(e.type!=="grouped")return;const i=this.axes[wy.X];if(i==null||!(nU.is(i.scale)||bmt.is(i.scale)))return;const s=t.resolveKeysById(this,"xValue",e),n=t.resolveColumnById(this,"yHighValue",e),a=t.resolveColumnById(this,"yLowValue",e),{index:o}=t.resolveProcessedDataDefById(this,"xValue"),r=e.domain.keys[o];return Qyt(s,n,a,r)}getSeriesDomain(t){const{processedData:e,dataModel:i}=this;if(!e||!i)return[];const{keys:[s]}=e.domain;if(t===this.getCategoryDirection()){const n=i.resolveProcessedDataDefById(this,"xValue");return n?.def.type==="key"&&n?.def.valueType==="category"?s:this.padBandExtent(s)}else{const n=this.domainForClippedRange(wy.Y,["yHighValue","yLowValue"],"xValue",!0),a=Imt(n);return gmt(a)}}getSeriesRange(t,e){return this.domainForVisibleRange(wy.Y,["yHighValue","yLowValue"],"xValue",e,!0)}createNodeData(){const{data:t,dataModel:e,groupScale:i,processedData:s,visible:n}=this,a=this.getCategoryAxis(),o=this.getValueAxis();if(!(t&&a&&o&&e&&s?.dataSources))return;const r=a.scale,l=o.scale,c=this.getBarDirection()===wy.X,{xKey:h,yLowKey:u,yHighKey:d,strokeWidth:p}=this.properties,g=`${u}-${d}`,f={itemId:g,nodeData:[],labelData:[],scales:this.calculateScaling(),visible:this.visible};if(!n)return f;const x=s.dataSources.get(this.id)??[],m=e.resolveKeysById(this,"xValue",s),b=e.resolveColumnById(this,"yLowValue",s),v=e.resolveColumnById(this,"yHighValue",s),{barWidth:S,groupIndex:A}=this.updateGroupScale(a),T=nU.is(r)?S*-.5:0,D=i.convert(String(A)),L=lmt(a?.scale,a?.visibleRange,this.smallestDataInterval,this.largestDataInterval),C=V=>Math.round(r.convert(m[V]))+D+T,O=(V,W,H,G,B,z,U)=>{const Y=x[V],K=m[V];if(K==null)return;const Z=b[V],X=v[V];if(!Number.isFinite(Z?.valueOf())||!Number.isFinite(X?.valueOf()))return;const[Q,$]=ZV.maxRange>j);if(F!=null){const{maxRange:V,indexData:W}=F,[H,G]=sU(V,a.range,B=>{const z=B*An,U=W[z+Wi],Y=W[z+Ns];if(U===-1)return;const K=(U+Y)/2|0;return[C(K),C(Y)+S]});for(let B=H;B[C(H),S]);s.input.count<1e3&&(V=0,W=s.input.count);for(let H=V;Hthis.getDatumId(n))}getItemBaseStyle(t){const{properties:e}=this,{cornerRadius:i}=e,s=t?e.highlightStyle.item:void 0;return{fill:s?.fill??e.fill,fillOpacity:s?.fillOpacity??e.fillOpacity,stroke:s?.stroke??e.stroke,strokeWidth:s?.strokeWidth??this.getStrokeWidth(e.strokeWidth),strokeOpacity:s?.strokeOpacity??e.strokeOpacity,lineDash:s?.lineDash??e.lineDash??[],lineDashOffset:s?.lineDashOffset??e.lineDashOffset,cornerRadius:i}}getItemStyleOverrides(t,e,i,s){const{id:n,properties:a}=this,{xKey:o,yHighKey:r,yLowKey:l,itemStyler:c}=a;if(c!=null)return this.cachedDatumCallback(xmt(t,s?"highlight":"node"),()=>c({seriesId:n,datum:e,xKey:o,yHighKey:r,yLowKey:l,highlighted:s,...i}))}updateDatumNodes(t){const{datumSelection:e,isHighlight:i}=t,s=this.getCategoryDirection()===wy.X,n=this.getItemBaseStyle(i);e.each((a,o)=>{const r=this.getItemStyleOverrides(String(o.datumIndex),o.datum,n,i);Mmt(a,n,r),a.cornerRadius=r?.cornerRadius??n.cornerRadius,a.visible=s?o.width>0:o.height>0,a.crisp=o.crisp})}getHighlightLabelData(t,e){const i=t.filter(s=>s.datum===e.datum);return i.length>0?i:void 0}updateLabelSelection(t){const e=this.properties.label.enabled?t.labelData:[];return t.labelSelection.update(e,i=>{i.pointerEvents=vmt.None})}updateLabelNodes(t){t.labelSelection.each((e,i)=>{cmt(e,this.properties.label,i)})}getTooltipContent(t){const{id:e,dataModel:i,processedData:s,properties:n}=this,{xKey:a,xName:o,yName:r,yLowKey:l,yHighKey:c,yLowName:h,yHighName:u,tooltip:d}=n,p=this.getCategoryAxis(),g=this.getValueAxis();if(!i||!s||!p||!g)return;const{datumIndex:f}=t,x=s.dataSources.get(this.id)?.[f],m=i.resolveKeysById(this,"xValue",s)[f],b=i.resolveColumnById(this,"yHighValue",s)[f],v=i.resolveColumnById(this,"yLowValue",s)[f];if(m==null)return;const S=this.getItemBaseStyle(!1);Object.assign(S,this.getItemStyleOverrides(String(f),x,S,!1));const A=`${g.formatDatum(v)} - ${g.formatDatum(b)}`;return d.formatTooltip({heading:p.formatDatum(m),symbol:this.legendItemSymbol(),data:[{label:r,fallbackLabel:`${h??l} - ${u??c}`,value:A}]},{seriesId:e,datum:x,title:r,xKey:a,xName:o,yName:r,yLowKey:l,yHighKey:c,yLowName:h,yHighName:u,...S})}legendItemSymbol(){const{fill:t,stroke:e,strokeWidth:i,fillOpacity:s,strokeOpacity:n,lineDash:a,lineDashOffset:o}=this.properties;return{marker:{fill:t,stroke:e,fillOpacity:s,strokeOpacity:n,strokeWidth:i,lineDash:a,lineDashOffset:o}}}getLegendData(t){if(t!=="category")return[];const{id:e,visible:i}=this,{yName:s,yLowName:n,yHighName:a,yLowKey:o,yHighKey:r,showInLegend:l}=this.properties,c=s??`${n??o} - ${a??r}`,h=`${o}-${r}`;return[{legendType:"category",id:e,itemId:h,seriesId:e,enabled:i,label:{text:`${c}`},symbol:this.legendItemSymbol(),hideInLegend:!l}]}animateEmptyUpdateReady({datumSelection:t,labelSelection:e}){const i=tU(eU(this.isVertical(),"normal"));aU.fromToMotion(this.id,"datums",this.ctx.animationManager,[t],i),iU(this,"labels",this.ctx.animationManager,e)}animateWaitingUpdateReady(t){const{datumSelection:e,labelSelection:i}=t,{processedData:s}=this,n=s?.reduced?.diff?.[this.id];this.ctx.animationManager.stopByAnimationGroupId(this.id);const a=tU(eU(this.isVertical(),"fade"));aU.fromToMotion(this.id,"datums",this.ctx.animationManager,[e],a,(o,r)=>this.getDatumId(r),n),iU(this,"labels",this.ctx.animationManager,i)}getDatumId(t){return`${t.xValue}-${t.valueIndex}`}isLabelEnabled(){return this.properties.label.enabled}onDataChange(){}computeFocusBounds({datumIndex:t}){return mmt(this,this.contextNodeData?.nodeData[t])}};dN.className="RangeBarSeries",dN.type="range-bar";var Dmt=(R(),E(w)),kmt={series:{direction:"vertical",strokeWidth:0,label:{enabled:!1,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"backgroundColor"},placement:"inside"}},axes:{[Dmt._ModuleSupport.ThemeConstants.CARTESIAN_AXIS_TYPE.NUMBER]:{crosshair:{enabled:!0}}}},{CARTESIAN_AXIS_TYPE:oU,CARTESIAN_POSITION:rU}=XW._ModuleSupport.ThemeConstants,Lmt={type:"series",optionsKey:"series[]",packageType:"enterprise",chartTypes:["cartesian"],identifier:"range-bar",moduleFactory:t=>new dN(t),tooltipDefaults:{range:"exact"},defaultAxes:XW._ModuleSupport.swapAxisCondition([{type:oU.NUMBER,position:rU.LEFT},{type:oU.CATEGORY,position:rU.BOTTOM}],t=>t?.direction==="horizontal"),themeTemplate:kmt,paletteFactory:({takeColors:t})=>{const{fills:[e],strokes:[i]}=t(1);return{fill:e,stroke:i}},groupable:!0},Nbt=(R(),E(w)),Tmt=(R(),E(w));function lU(t){t.nodes.sort((e,i)=>Math.round((e.datum.y-i.datum.y)*100)/100||-(e.datum.size-i.datum.size))}function Cmt({nodes:t,size:e},{seriesRectHeight:i,nodeSpacing:s,sizeScale:n}){const a=i*e*n;let o=(i-(a+s*(t.length-1)))/2;t.forEach(({datum:r})=>{const l=i*r.size*n;r.y=o,r.height=l,o+=l+s})}function Nmt(t,e){const{nodes:i}=t,{seriesRectHeight:s,nodeSpacing:n}=e;lU(t);let a=0,o=0;for(const{datum:c}of i){const h=Math.max(o-c.y,0);c.y+=h,a+=h,o=c.y+c.height+n}if(o-n0;let l=s;for(let c=i.length-1;c>=0;c-=1){const{datum:h}=i[c],u=h.y+h.height,d=Math.min(l-u,0);h.y+=d,a+=d,l=h.y-n}return!0}function pN(t,e,i,s,n,a,o,r){const l=(i-t)/(s-e),c=(o-n)/(r-a),h=((a-e)*(l*c)+t*c-n*l)/(c-l);return tt&&hMath.max(i,o)}function cU(t,e){let i=!1;const s=t.nodes.filter(a=>e(a).length===1);let n=!0;for(let a=0;n&&ai.linksBefore)||e,e=cU(t,i=>i.linksAfter)||e,e}function wmt(t){if(t.length===0)return;let e=0,i=0;for(const{node:{datum:s}}of t)e+=s.y*s.size,i+=s.size;return e/i}function hU(t,e,i,s){return t.nodes.forEach(({datum:n,linksBefore:a,linksAfter:o})=>{const r=s===1?a:o,l=s===1?o:a,c=wmt(r);if(c!=null){const h=l.length!==0?i:1;n.y=n.y+(c-n.y)*h}}),Nmt(t,e)}function uU(t,e,i){let s=!1;for(const n of t)s=hU(n,e,i,1)||s;return s}function Emt(t,e,i){let s=!1;for(let n=t.length-1;n>=0;n-=1)s=hU(t[n],e,i,-1)||s;return s}function dU(t){let e=!1;for(let i=t.length-1;i>=0;i-=1)e=Omt(t[i])||e;return e}function Rmt(t,e){t.forEach(s=>{Cmt(s,e)});let i=!1;for(let s=0;s<6;s+=1){const n=uU(t,e,1);i=Emt(t,e,.5);const a=dU(t);if(!n&&!i&&!a)break}i&&(uU(t,e,1),dU(t))}var _mt=(R(),E(w)),{BBox:Pmt,Path:Bmt,ScenePathChangeDetection:mp,splitBezier:zmt}=_mt._ModuleSupport;function aM(t,e,i,s,n,a,o,r,l,c){let h,u;if(n!==i&&l!==o){const T=-(s-e)/(n-i),D=-(r-a)/(l-o);h=(o-i+T*e-D*a)/(T-D),u=T*(h-e)+i}else if(n===i&&l!==o)h=e,u=-(r-a)/(l-o)*(h-r)+l;else if(n!==i&&l===o)h=r,u=-(s-e)/(n-i)*(h-e)+i;else throw new Error("Offsetting flat bezier curve");const d=Math.hypot(i-u,e-h),p=(d+c)/d,g=Math.hypot(l-u,r-h),f=(g+c)/g,x=h+(s-h)*p,m=u+(n-u)*p,b=h+(a-h)*f,v=u+(o-u)*f,S=h+(r-h)*f,A=u+(l-u)*f;t.cubicCurveTo(x,m,b,v,S,A)}var tu=class extends Bmt{constructor(){super(...arguments),this.x1=0,this.x2=0,this.y1=0,this.y2=0,this.height=0,this.inset=0}computeBBox(){const t=Math.min(this.x1,this.x2),e=Math.max(this.x1,this.x2)-t,i=Math.min(this.y1,this.y2),s=Math.max(this.y1,this.y2)-i+this.height;return new Pmt(t,i,e,s)}updatePath(){const{path:t,inset:e}=this;t.clear();const i=this.x1+e,s=this.x2-e,n=this.y1+e,a=this.y2+e,o=this.height-2*e;if(o<0||i>s)return;const r=i,l=n+o/2,c=(i+s)/2,h=n+o/2,u=(i+s)/2,d=a+o/2,p=s,g=a+o/2;if(t.moveTo(r,l-o/2),Math.abs(this.y2-this.y1)<1||this.x2-this.x1n?1:-1)*o/2;aM(t,f[0].x,f[0].y,f[1].x,f[1].y,f[2].x,f[2].y,f[3].x,f[3].y,m),aM(t,x[0].x,x[0].y,x[1].x,x[1].y,x[2].x,x[2].y,x[3].x,x[3].y,-m),t.lineTo(p,g+o/2),aM(t,x[3].x,x[3].y,x[2].x,x[2].y,x[1].x,x[1].y,x[0].x,x[0].y,m),aM(t,f[3].x,f[3].y,f[2].x,f[2].y,f[1].x,f[1].y,f[0].x,f[0].y,-m)}t.closePath()}};y([mp()],tu.prototype,"x1",2),y([mp()],tu.prototype,"x2",2),y([mp()],tu.prototype,"y1",2),y([mp()],tu.prototype,"y2",2),y([mp()],tu.prototype,"height",2),y([mp()],tu.prototype,"inset",2);var Fmt=(R(),E(w)),{BaseProperties:pU,SeriesTooltip:jmt,SeriesProperties:Vmt,ARRAY:Gmt,COLOR_STRING:oM,COLOR_STRING_ARRAY:gU,FUNCTION:fU,LINE_DASH:yU,OBJECT:rM,POSITIVE_NUMBER:eu,RATIO:lM,STRING:ec,UNION:Wmt,Validate:Ft,Label:Umt}=Fmt._ModuleSupport,Hmt=Wmt(["left","right","center","justify"],"a justification value"),mU=class extends Umt{constructor(){super(...arguments),this.spacing=1}};y([Ft(eu)],mU.prototype,"spacing",2);var Wr=class extends pU{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}};y([Ft(oM,{optional:!0})],Wr.prototype,"fill",2),y([Ft(lM)],Wr.prototype,"fillOpacity",2),y([Ft(oM,{optional:!0})],Wr.prototype,"stroke",2),y([Ft(lM)],Wr.prototype,"strokeOpacity",2),y([Ft(eu)],Wr.prototype,"strokeWidth",2),y([Ft(yU)],Wr.prototype,"lineDash",2),y([Ft(eu)],Wr.prototype,"lineDashOffset",2),y([Ft(fU,{optional:!0})],Wr.prototype,"itemStyler",2);var sa=class extends pU{constructor(){super(...arguments),this.spacing=1,this.width=1,this.alignment="justify",this.fill=void 0,this.fillOpacity=1,this.stroke=void 0,this.strokeOpacity=1,this.strokeWidth=1,this.lineDash=[0],this.lineDashOffset=0}};y([Ft(eu)],sa.prototype,"spacing",2),y([Ft(eu)],sa.prototype,"width",2),y([Ft(Hmt)],sa.prototype,"alignment",2),y([Ft(oM,{optional:!0})],sa.prototype,"fill",2),y([Ft(lM)],sa.prototype,"fillOpacity",2),y([Ft(oM,{optional:!0})],sa.prototype,"stroke",2),y([Ft(lM)],sa.prototype,"strokeOpacity",2),y([Ft(eu)],sa.prototype,"strokeWidth",2),y([Ft(yU)],sa.prototype,"lineDash",2),y([Ft(eu)],sa.prototype,"lineDashOffset",2),y([Ft(fU,{optional:!0})],sa.prototype,"itemStyler",2);var vs=class extends Vmt{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.fills=[],this.strokes=[],this.label=new mU,this.link=new Wr,this.node=new sa,this.tooltip=new jmt}};y([Ft(Gmt,{optional:!0})],vs.prototype,"nodes",2),y([Ft(ec)],vs.prototype,"fromKey",2),y([Ft(ec)],vs.prototype,"toKey",2),y([Ft(ec)],vs.prototype,"idKey",2),y([Ft(ec,{optional:!0})],vs.prototype,"idName",2),y([Ft(ec,{optional:!0})],vs.prototype,"labelKey",2),y([Ft(ec,{optional:!0})],vs.prototype,"labelName",2),y([Ft(ec,{optional:!0})],vs.prototype,"sizeKey",2),y([Ft(ec,{optional:!0})],vs.prototype,"sizeName",2),y([Ft(gU)],vs.prototype,"fills",2),y([Ft(gU)],vs.prototype,"strokes",2),y([Ft(rM)],vs.prototype,"label",2),y([Ft(rM)],vs.prototype,"link",2),y([Ft(rM)],vs.prototype,"node",2),y([Ft(rM)],vs.prototype,"tooltip",2);var{Transformable:Ymt,applyShapeStyle:xU,SeriesNodePickMode:bU,CachedTextMeasurerPool:Kmt,TextWrapper:SU,TextUtils:vU,createDatumId:cM,Rect:MU,BBox:$mt}=Tmt._ModuleSupport,gN=class extends GT{constructor(t){super({moduleCtx:t,pickModes:[bU.NEAREST_NODE,bU.EXACT_SHAPE_MATCH]}),this.properties=new vs}isLabelEnabled(){return(this.properties.labelKey!=null||this.nodes==null)&&this.properties.label.enabled}linkFactory(){return new tu}nodeFactory(){return new MU}createNodeData(){const{id:t,_nodeDataDependencies:{seriesRectWidth:e,seriesRectHeight:i}={seriesRectWidth:0,seriesRectHeight:0}}=this,{fromKey:s,toKey:n,sizeKey:a,label:{spacing:o},node:{spacing:r,width:l,alignment:c}}=this.properties,{nodeGraph:h,links:u,maxPathLength:d}=this.getNodeGraph(D=>({...D,x:NaN,y:NaN,width:l,height:NaN}),D=>({...D,x1:NaN,x2:NaN,y1:NaN,y2:NaN,height:NaN}),{includeCircularReferences:!1}),p=h,g=this.isLabelEnabled()?(e-l)*(1-d/(d+1)):0,f=(e-l-2*g)/(d-1),x=[];for(let D=0;D{const{datum:L,linksBefore:C,linksAfter:O,maxPathLengthBefore:_,maxPathLengthAfter:N}=D,P=Math.max(C.reduce((V,{link:W})=>V+W.size,0),O.reduce((V,{link:W})=>V+W.size,0));if(C.length===0&&O.length===0||P===0){D.columnIndex=-1;return}let j;switch(c){case"left":j=x[_];break;case"right":j=x[d-1-N];break;case"center":{if(C.length!==0)j=x[_];else if(O.length!==0){const V=O.reduce((W,H)=>Math.min(W,H.node.maxPathLengthBefore),d)-1;j=x[V]}else j=x[0];break}case"justify":{j=O.length===0?x[d-1]:x[_];break}}L.x=j.x,L.size=P;const F=this.getLabelText(this.properties.label,{datum:L.datum,value:L.label,fromKey:s,toKey:n,sizeKey:a,size:P});L.label=String(F),j.nodes.push(D),j.size+=P,D.columnIndex=j.index}),p.forEach(D=>{let L=1/0,C=0;D.linksAfter.forEach(O=>{const _=O.node,{columnIndex:N}=_;N{const O=(1-(C.length-1)*(r/i))/L;return Math.min(D,O)},1/0);for(let D=x.length-1;D>=0;D-=1)x[D].nodes.sort((C,O)=>C.closestColumnIndex-O.closestColumnIndex||C.maxSizeOfClosestNodesAfter-O.maxSizeOfClosestNodesAfter||C.datum.size-O.datum.size);Rmt(x,{seriesRectHeight:i,nodeSpacing:r,sizeScale:m});let b=!1;if(p.forEach(({datum:D,linksBefore:L,linksAfter:C})=>{b||(b=D.height<0);const O=D.y+D.height,_=j=>j.sort((F,V)=>{const W=F.node.datum,H=V.node.datum,G=W.y+W.height,B=H.y+H.height,z=Math.atan2(W.y-D.y,Math.abs(W.x-D.x))-Math.atan2(H.y-D.y,Math.abs(H.x-D.x)),U=Math.atan2(G-O,Math.abs(W.x-D.x))-Math.atan2(B-O,Math.abs(H.x-D.x));return z+U});let N=D.y;_(L).forEach(({link:j})=>{j.y2=N,N+=j.size*i*m});let P=D.y;_(C).forEach(({link:j})=>{j.y1=P,P+=j.size*i*m})}),b){Gt.warnOnce("There was insufficient space to display the Sankey Series. Reduce the node spacing, or provide a larger container.");return}const v=[],S=[],{fontSize:A}=this.properties.label,T=this.properties.label.getFont();return x.forEach((D,L)=>{const C=L===0,O=L===x.length-1;let _=-1/0;D.nodes.sort((N,P)=>N.datum.y-P.datum.y),D.nodes.forEach(({datum:N})=>{if(N.midPoint={x:N.x+N.width/2,y:N.y+N.height/2},v.push(N),N.label==null)return;const P=C?N.x-o:N.x+N.width+o,j=N.y+N.height/2;let F;if(!C&&!O){const G=j-vU.getLineHeight(A),B=j+vU.getLineHeight(A);let z=e;p.forEach(({datum:Y})=>{Y.x>N.x&&Math.max(Y.y,G)<=Math.min(Y.y+Y.height,B)&&(z=Math.min(z,Y.x-o))});const U=z-N.x-2*o;F=SU.wrapText(N.label,{maxWidth:U,maxHeight:N.height,font:this.properties.label,textWrap:"never",overflow:"hide"})}if(F==null||F===""){const G=C||O?o:o*2;F=SU.wrapText(N.label,{maxWidth:f-G,maxHeight:N.height,font:this.properties.label,textWrap:"never"})}if(F==="")return;const{height:V}=Kmt.measureText(F,{font:T,textAlign:"left",textBaseline:"middle"}),W=j-V/2,H=j+V/2;W>=_&&(S.push({x:P,y:j,leading:C,text:F}),_=H)})}),u.forEach(D=>{const{fromNode:L,toNode:C,size:O}=D;D.height=i*O*m,D.x1=L.x+l,D.x2=C.x,D.midPoint={x:(D.x1+D.x2)/2,y:(D.y1+D.y2)/2+D.height/2},v.push(D)}),{itemId:t,nodeData:v,labelData:S}}updateLabelSelection(t){const e=this.isLabelEnabled()?t.labelData:[];return t.labelSelection.update(e)}updateLabelNodes(t){const{labelSelection:e}=t,{color:i,fontStyle:s,fontWeight:n,fontSize:a,fontFamily:o}=this.properties.label;e.each((r,{x:l,y:c,leading:h,text:u})=>{r.visible=!0,r.x=l,r.y=c,r.text=u,r.fill=i,r.fontStyle=s,r.fontWeight=n,r.fontSize=a,r.fontFamily=o,r.textAlign=h?"right":"left",r.textBaseline="middle"})}updateNodeSelection(t){return t.datumSelection.update(t.nodeData,void 0,e=>cM([e.type,e.id]))}getBaseNodeStyle(t){const{properties:e}=this,{fill:i,fillOpacity:s,stroke:n,strokeOpacity:a,lineDash:o,lineDashOffset:r}=e.node,l=t?e.highlightStyle.item:void 0;return{fill:l?.fill??i,fillOpacity:l?.fillOpacity??s,stroke:l?.stroke??n,strokeOpacity:l?.strokeOpacity??a,strokeWidth:l?.strokeWidth??this.getStrokeWidth(e.node.strokeWidth),lineDash:l?.lineDash??o,lineDashOffset:l?.lineDashOffset??r}}getNodeStyleOverrides(t,e,i,s,n,a,o){const{id:r,properties:l}=this,{fills:c,strokes:h}=l,{itemStyler:u}=l.node,d=a.fill??c[i%c.length],p=a.stroke??h[i%h.length],g={};if(o||(g.fill=d,g.stroke=p),u!=null){const f=this.cachedDatumCallback(cM(t,o?"highlight":"node"),()=>{const{fillOpacity:x=1,strokeOpacity:m=1,strokeWidth:b=0,lineDash:v=[],lineDashOffset:S=0}=a;return u({seriesId:r,datum:e,highlighted:o,label:n,size:s,fill:d,fillOpacity:x,stroke:p,strokeOpacity:m,strokeWidth:b,lineDash:v,lineDashOffset:S})});Object.assign(g,f)}return g}updateNodeNodes(t){const{datumSelection:e,isHighlight:i}=t,s=this.getBaseNodeStyle(i);e.each((n,a)=>{const{datumIndex:o,size:r,label:l}=a,c=this.getNodeStyleOverrides(String(o),a,o.index,r,l,s,i);n.x=a.x,n.y=a.y,n.width=Math.max(a.width,0),n.height=Math.max(a.height,0),xU(n,s,c)})}updateLinkSelection(t){return t.datumSelection.update(t.nodeData,void 0,e=>cM([e.type,e.index,e.fromNode.id,e.toNode.id]))}getBaseLinkStyle(t){const{properties:e}=this,{fill:i,fillOpacity:s,stroke:n,strokeOpacity:a,lineDash:o,lineDashOffset:r}=e.link,l=t?e.highlightStyle.item:void 0;return{fill:l?.fill??i,fillOpacity:l?.fillOpacity??s,stroke:l?.stroke??n,strokeOpacity:l?.strokeOpacity??a,strokeWidth:l?.strokeWidth??this.getStrokeWidth(e.link.strokeWidth),lineDash:l?.lineDash??o,lineDashOffset:l?.lineDashOffset??r}}getLinkStyleOverrides(t,e,i,s,n){const{id:a,properties:o}=this,{fills:r,strokes:l}=o,{itemStyler:c}=o.link,h=s.fill??r[i%r.length],u=s.stroke??l[i%l.length],d={};if(n||(d.fill=h,d.stroke=u),c!=null){const p=this.cachedDatumCallback(cM(t,n?"highlight":"node"),()=>{const{fillOpacity:g=1,strokeOpacity:f=1,strokeWidth:x=0,lineDash:m=[],lineDashOffset:b=0}=s;return c({seriesId:a,datum:e,highlighted:n,fill:h,fillOpacity:g,stroke:u,strokeOpacity:f,strokeWidth:x,lineDash:m,lineDashOffset:b})});Object.assign(d,p)}return d}updateLinkNodes(t){const{datumSelection:e,isHighlight:i}=t,s=this.getBaseLinkStyle(i);e.each((n,a)=>{const{datumIndex:o}=a,r=a.fromNode.datumIndex,l=this.getLinkStyleOverrides(String(o),a,r.index,s,i);n.x1=a.x1,n.y1=a.y1,n.x2=a.x2,n.y2=a.y2,n.height=a.height,xU(n,s,l),n.inset=n.strokeWidth/2})}getTooltipContent(t){const{id:e,linksProcessedData:i,nodesProcessedData:s,properties:n}=this,{fromKey:a,toKey:o,sizeKey:r,sizeName:l,tooltip:c}=n,{datumIndex:h}=t,u=t.type===0?t.fromNode.index:t.index,d=t.type===0?`${t.fromNode.label} - ${t.toNode.label}`:t.label,p=h.type===0?i?.dataSources.get(this.id)?.[h.index]:s?.dataSources.get(this.id)?.[h.index],g=t.size;let f;if(t.type===0){const x=t.fromNode.datumIndex,m=this.getBaseLinkStyle(!1);Object.assign(m,this.getLinkStyleOverrides(String(h),p,x.index,m,!1)),f=m}else{const x=t.label,m=this.getBaseNodeStyle(!1);Object.assign(m,this.getNodeStyleOverrides(String(h),p,h.index,g,x,m,!1)),f=m}return c.formatTooltip({title:d,symbol:this.legendItemSymbol(t.type,u,f),data:r!=null?[{label:l,fallbackLabel:r,value:String(g)}]:[]},{seriesId:e,datum:p,title:d,fromKey:a,toKey:o,sizeKey:r,sizeName:l,size:g,...f})}computeFocusBounds(t){if(t instanceof MU){const{x:e,y:i,width:s,height:n}=t,a=new $mt(e,i,s,n);return Ymt.toCanvas(this.contentGroup,a)}return t}};gN.className="SankeySeries",gN.type="sankey";var Xmt={type:"series",optionsKey:"series[]",packageType:"enterprise",chartTypes:["flow-proportion"],solo:!0,identifier:"sankey",moduleFactory:t=>new gN(t),tooltipDefaults:{range:"exact"},themeTemplate:{seriesArea:{padding:{top:10,bottom:10}},series:{highlightStyle:{series:{dimOpacity:.2}},label:{fontFamily:{$ref:"fontFamily"},fontSize:{$ref:"fontSize"},fontWeight:{$ref:"fontWeight"},color:{$ref:"textColor"},spacing:10},node:{spacing:20,width:10,strokeWidth:0},link:{fillOpacity:.5,strokeWidth:0}},legend:{enabled:!1,toggleSeries:!1}},paletteFactory({takeColors:t,colorsCount:e}){return t(e)}},Zmt=(R(),E(w)),fN=(R(),E(w)),Qmt=(R(),E(w)),{HierarchySeriesProperties:qmt,HighlightStyle:Jmt,SeriesTooltip:txt,Validate:Je,COLOR_STRING:ext,FUNCTION:ixt,NUMBER:IU,OBJECT:xp,POSITIVE_NUMBER:yN,RATIO:hM,STRING:uM}=Qmt._ModuleSupport,ic=class extends Jmt{constructor(){super(...arguments),this.label=new Po,this.secondaryLabel=new Po}};y([Je(uM,{optional:!0})],ic.prototype,"fill",2),y([Je(hM,{optional:!0})],ic.prototype,"fillOpacity",2),y([Je(ext,{optional:!0})],ic.prototype,"stroke",2),y([Je(yN,{optional:!0})],ic.prototype,"strokeWidth",2),y([Je(hM,{optional:!0})],ic.prototype,"strokeOpacity",2),y([Je(xp)],ic.prototype,"label",2),y([Je(xp)],ic.prototype,"secondaryLabel",2);var ws=class extends qmt{constructor(){super(...arguments),this.fillOpacity=1,this.strokeWidth=0,this.strokeOpacity=1,this.cornerRadius=0,this.highlightStyle=new ic,this.label=new Po,this.secondaryLabel=new Sy,this.tooltip=new txt}};y([Je(uM,{optional:!0})],ws.prototype,"sizeName",2),y([Je(uM,{optional:!0})],ws.prototype,"labelKey",2),y([Je(uM,{optional:!0})],ws.prototype,"secondaryLabelKey",2),y([Je(hM)],ws.prototype,"fillOpacity",2),y([Je(yN)],ws.prototype,"strokeWidth",2),y([Je(hM)],ws.prototype,"strokeOpacity",2),y([Je(yN)],ws.prototype,"cornerRadius",2),y([Je(IU,{optional:!0})],ws.prototype,"sectorSpacing",2),y([Je(IU,{optional:!0})],ws.prototype,"padding",2),y([Je(ixt,{optional:!0})],ws.prototype,"itemStyler",2),y([Je(xp)],ws.prototype,"highlightStyle",2),y([Je(xp)],ws.prototype,"label",2),y([Je(xp)],ws.prototype,"secondaryLabel",2),y([Je(xp)],ws.prototype,"tooltip",2);var{fromToMotion:sxt,normalizeAngle360:nxt,createDatumId:axt,Sector:mN,Group:dM,ScalableGroup:oxt,Selection:xN,TransformableText:bN,applyShapeStyle:rxt}=fN._ModuleSupport,lxt=class extends fN._ModuleSupport.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 AU(t,e=0,i=2*Math.PI/t.sumSize){for(const s of t.children){const n=e+s.sumSize*i;s.startAngle=e,s.endAngle=n,AU(s,e,i),e=n}}var SN=class extends fN._ModuleSupport.HierarchySeries{constructor(){super(...arguments),this.NodeClass=lxt,this.properties=new ws,this.scalingGroup=this.contentGroup.appendChild(new oxt),this.sectorGroup=this.scalingGroup.appendChild(new dM),this.sectorLabelGroup=this.scalingGroup.appendChild(new dM),this.highlightSectorGroup=this.scalingGroup.appendChild(new dM),this.datumSelection=xN.select(this.sectorGroup,mN),this.labelSelection=xN.select(this.sectorLabelGroup,dM),this.highlightSelection=xN.select(this.highlightSectorGroup,mN)}processData(){super.processData(),AU(this.rootNode)}updateSelections(){const t=this.ctx.highlightManager?.getActiveHighlight();if(this.highlightSelection.update(t!=null?[t]:[],void 0,a=>this.getDatumId(a)),!this.nodeDataRefresh)return;this.nodeDataRefresh=!1;const{chart:e}=this;if(e==null||e.seriesRect==null)return;const s=Array.from(this.rootNode),n=a=>{a.append([new bN({tag:0}),new bN({tag:1})])};this.datumSelection.update(s,void 0,a=>this.getDatumId(a)),this.labelSelection.update(s,n,a=>this.getDatumId(a))}getItemBaseStyle(t){const{properties:e}=this,i=t?e.highlightStyle:void 0;return{fill:i?.fill,fillOpacity:i?.fillOpacity??e.fillOpacity,stroke:i?.stroke,strokeWidth:i?.strokeWidth??this.getStrokeWidth(e.strokeWidth),strokeOpacity:i?.strokeOpacity??e.strokeOpacity}}getItemStyleOverrides(t,e,i,s,n,a){const{id:o,properties:r,colorScale:l}=this,{fills:c,strokes:h,itemStyler:u}=r,d=t[0],p=n.fill??c[d%c.length],g=n.stroke??h[d%h.length],f={};if(a||(f.fill=s!=null?l.convert(s):p,f.stroke=g),u!=null){const x=this.cachedDatumCallback(axt(t.join(":"),a?"highlight":"node"),()=>u({seriesId:o,datum:e,depth:i,highlighted:a,fill:p,stroke:g,...n}));Object.assign(f,x)}return f}updateNodes(){const{chart:t,data:e,maxDepth:i}=this;if(t==null||e==null)return;const{width:s,height:n}=t.seriesRect,{sectorSpacing:a=0,padding:o=0,cornerRadius:r,childrenKey:l,colorKey:c,colorName:h,labelKey:u,secondaryLabelKey:d,sizeKey:p,sizeName:g}=this.properties;this.contentGroup.translationX=s/2,this.contentGroup.translationY=n/2;const f=a*.5,m=Math.min(s,n)/2/(i+1),b=-Math.PI/2;this.rootNode?.walk(L=>{const{startAngle:C,endAngle:O}=L;if(L.depth!=null){const _=(C+O)/2+b,N=(L.depth+.5)*m;L.midPoint.x=Math.cos(_)*N,L.midPoint.y=Math.sin(_)*N}}),this.rootNode?.walk(L=>{const{datum:C,depth:O,startAngle:_,endAngle:N,parent:P,sumSize:j}=L;L.label=void 0,L.secondaryLabel=void 0,L.contentHeight=0;let F;if(C!=null&&O!=null&&u!=null){const ft=C[u];F=this.getLabelText(this.properties.label,{depth:O,datum:C,childrenKey:l,colorKey:c,colorName:h,labelKey:u,secondaryLabelKey:d,sizeKey:p,sizeName:g,value:ft})}F===""&&(F=void 0);let V;if(C!=null&&O!=null&&d!=null){const ft=C[d];V=this.getLabelText(this.properties.secondaryLabel,{depth:O,datum:C,childrenKey:l,colorKey:c,colorName:h,labelKey:u,secondaryLabelKey:d,sizeKey:p,sizeName:g,value:ft})}if(V===""&&(V=void 0),O==null)return;const W=O*m+f,H=(O+1)*m-f,G=W>f?f/W:f,B=H>f?f/H:f,z=_+G,Y=N+G-z,K=_+B,X=N+B-K,Q=ft=>{if(O===0&&P?.sumSize===j)return{width:2*Math.sqrt(H**2-(ft*.5)**2),height:ft,meta:0};const Nt=ft,Yt=2*Math.sqrt(H**2-(W+Nt)**2),Nn=Y=oc?{width:$i,height:Nt,meta:1}:{width:oc,height:oa,meta:2}},$=qT(F,this.properties.label,V,this.properties.secondaryLabel,{padding:o},Q);if($==null)return;const{width:q,height:J,meta:nt,label:it,secondaryLabel:rt}=$,dt=b+(_+N)/2,at=Math.sin(dt)>=0,Dt=Math.cos(dt)>=0,kt=(at?3:12)&(Dt?6:9);let Mt;switch(nt){case 0:Mt=0;break;case 1:{const xt=H-(m-J)*.58,Nt=Math.sqrt((H-o)**2-(q/2)**2);Mt=Math.min(xt,Nt);break}case 2:if(O===0){const ft=J/(2*Math.tan(Y*.5))+q*.5,xt=Math.sqrt(H**2-(J*.5)**2)-q*.5;Mt=(ft+xt)*.5}else Mt=(W+H)*.5;break}if(it!=null){const{fontStyle:ft="normal",fontFamily:xt,fontWeight:Nt="normal",color:Yt="black"}=this.properties.label;L.label={...it,fontStyle:ft,fontFamily:xt,fontWeight:Nt,color:Yt,labelPlacement:nt,circleQuarter:kt,radius:Mt,theta:dt}}if(rt!=null){const{fontStyle:ft="normal",fontFamily:xt,fontWeight:Nt="normal",color:Yt="black"}=this.properties.secondaryLabel;L.secondaryLabel={...rt,fontStyle:ft,fontFamily:xt,fontWeight:Nt,color:Yt,labelPlacement:nt,circleQuarter:kt,radius:Mt,theta:dt}}L.contentHeight=$.height});const v=(L,C,O,_)=>{const{datum:N,datumIndex:P,depth:j,colorValue:F,startAngle:V,endAngle:W}=L;if(j==null){C.visible=!1;return}C.visible=!0;const H=this.getItemStyleOverrides(P,N,j,F,O,_),G=H.strokeWidth??O.strokeWidth;rxt(C,O,H),C.centerX=0,C.centerY=0,C.innerRadius=j*m,C.outerRadius=(j+1)*m,C.startAngle=V+b,C.endAngle=W+b,C.inset=f+G*.5,C.cornerRadius=r},S=this.getItemBaseStyle(!1);this.datumSelection.each((L,C)=>{v(C,L,S,!1)});const A=this.getItemBaseStyle(!0);this.highlightSelection.each((L,C)=>{v(C,L,A,!0)});const T=(L,C,O,_)=>{const{depth:N,contentHeight:P}=L,j=O===0,F=j?L.label:L.secondaryLabel;if(N==null||F==null){C.visible=!1;return}const{labelPlacement:V,circleQuarter:W,radius:H,theta:G}=F;let B;switch(_&&(B=(j?this.properties.highlightStyle.label:this.properties.highlightStyle.secondaryLabel).color),C.text=F.text,C.fontSize=F.fontSize,C.lineHeight=F.lineHeight,C.fontStyle=F.fontStyle,C.fontFamily=F.fontFamily,C.fontWeight=F.fontWeight,C.fill=B??F.color,V){case 0:C.textAlign="center",C.textBaseline="top",C.translationX=0,C.translationY=(j?0:P-F.height)-P*.5,C.rotation=0;break;case 1:{const z=(W&3)!==0,U=j===!z?H:H-(P-F.height);C.textAlign="center",C.textBaseline=z?"bottom":"top",C.translationX=Math.cos(G)*U,C.translationY=Math.sin(G)*U,C.rotation=z?G-Math.PI*.5:G+Math.PI*.5;break}case 2:{const z=(W&6)!==0,U=j===!z?(P-F.height)*.5:(F.height-P)*.5;C.textAlign="center",C.textBaseline="middle",C.translationX=Math.cos(G)*H+Math.cos(G+Math.PI/2)*U,C.translationY=Math.sin(G)*H+Math.sin(G+Math.PI/2)*U,C.rotation=z?G:G+Math.PI;break}}C.visible=!0},D=this.ctx.highlightManager?.getActiveHighlight();this.labelSelection.selectByClass(bN).forEach(L=>{T(L.datum,L,L.tag,L.datum===D)})}getTooltipContent(t){const{id:e,properties:i}=this,{labelKey:s,secondaryLabelKey:n,childrenKey:a,sizeKey:o,sizeName:r,colorKey:l,colorName:c,tooltip:h}=i,{datum:u,datumIndex:d,depth:p}=t;if(u==null||p==null)return;const g=[],f=o!=null?u[o]:void 0;f!=null&&g.push({label:r,fallbackLabel:o,value:f});const x=l!=null?u[l]:void 0;x!=null&&g.push({label:c,fallbackLabel:l,value:x});const m=this.getItemBaseStyle(!1);Object.assign(m,this.getItemStyleOverrides(d,u,p,x,m,!1));const b=m.fill;return h.formatTooltip({title:s!=null?u[s]:void 0,symbol:{marker:{shape:"square",fill:b,fillOpacity:1,stroke:void 0,strokeWidth:0,strokeOpacity:1,lineDash:[0],lineDashOffset:0}},data:g},{seriesId:e,datum:u,title:void 0,depth:p,labelKey:s,secondaryLabelKey:n,childrenKey:a,sizeKey:o,sizeName:r,colorKey:l,colorName:c,...m})}createNodeData(){}pickNodeClosestDatum(t){return this.pickNodeNearestDistantObject(t,this.datumSelection.selectByClass(mN))}animateEmptyUpdateReady(){sxt(this.id,"nodes",this.ctx.animationManager,[this.scalingGroup],{toFn(){return{scalingX:1,scalingY:1}},fromFn(){return{scalingX:0,scalingY:0}}})}computeFocusBounds(t){return t}};SN.className="SunburstSeries",SN.type="sunburst";var{FONT_SIZE_RATIO:DU,ThemeSymbols:{DEFAULT_DIVERGING_SERIES_COLOR_RANGE:cxt}}=Zmt._ModuleSupport,hxt={type:"series",optionsKey:"series[]",packageType:"enterprise",chartTypes:["hierarchy"],identifier:"sunburst",moduleFactory:t=>new SN(t),tooltipDefaults:{range:"exact"},solo:!0,themeTemplate:{series:{label:{fontFamily:{$ref:"fontFamily"},fontSize:{$rem:[DU.LARGE]},minimumFontSize:{$round:[{$mul:[{$ref:"fontSize"},9/12]}]},fontWeight:{$ref:"fontWeight"},color:{$ref:"backgroundColor"},overflowStrategy:"ellipsis",wrapping:"never",spacing:2},secondaryLabel:{fontFamily:{$ref:"fontFamily"},fontSize:{$rem:[DU.SMALLEST]},minimumFontSize:{$round:[{$mul:[{$ref:"fontSize"},7/12]}]},fontWeight:{$ref:"fontWeight"},color:{$ref:"backgroundColor"},overflowStrategy:"ellipsis",wrapping:"never"},sectorSpacing:2,padding:3,highlightStyle:{label:{color:{$ref:"backgroundColor"}},secondaryLabel:{color:{$ref:"backgroundColor"}},fill:"rgba(255,255,255, 0.33)",stroke:"rgba(0, 0, 0, 0.4)",strokeWidth:2}},gradientLegend:{enabled:!0}},paletteFactory:({takeColors:t,colorsCount:e,themeTemplateParameters:i})=>{const{fills:s,strokes:n}=t(e),a=i.get(cxt);return{fills:s,strokes:n,colorRange:a}}},uxt=(R(),E(w)),pM=(R(),E(w)),dxt=(R(),E(w)),{BaseProperties:gM,HierarchySeriesProperties:pxt,HighlightStyle:gxt,SeriesTooltip:fxt,Validate:vt,BOOLEAN:yxt,COLOR_STRING:fM,FUNCTION:mxt,NUMBER:xxt,OBJECT:na,POSITIVE_NUMBER:jo,RATIO:sc,STRING:iu,STRING_ARRAY:kU,TEXT_ALIGN:LU,VERTICAL_ALIGN:bxt,Label:Sxt}=dxt._ModuleSupport,TU=class extends Sxt{constructor(){super(...arguments),this.spacing=0}};y([vt(xxt)],TU.prototype,"spacing",2);var aa=class extends gM{constructor(){super(...arguments),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 TU}};y([vt(iu,{optional:!0})],aa.prototype,"fill",2),y([vt(sc)],aa.prototype,"fillOpacity",2),y([vt(fM,{optional:!0})],aa.prototype,"stroke",2),y([vt(jo)],aa.prototype,"strokeWidth",2),y([vt(sc)],aa.prototype,"strokeOpacity",2),y([vt(jo)],aa.prototype,"cornerRadius",2),y([vt(LU)],aa.prototype,"textAlign",2),y([vt(jo)],aa.prototype,"gap",2),y([vt(jo)],aa.prototype,"padding",2),y([vt(yxt)],aa.prototype,"interactive",2),y([vt(na)],aa.prototype,"label",2);var Cn=class extends gM{constructor(){super(...arguments),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 Po,this.secondaryLabel=new Sy}};y([vt(iu,{optional:!0})],Cn.prototype,"fill",2),y([vt(sc)],Cn.prototype,"fillOpacity",2),y([vt(fM,{optional:!0})],Cn.prototype,"stroke",2),y([vt(jo,{optional:!0})],Cn.prototype,"strokeWidth",2),y([vt(sc)],Cn.prototype,"strokeOpacity",2),y([vt(jo)],Cn.prototype,"cornerRadius",2),y([vt(LU)],Cn.prototype,"textAlign",2),y([vt(bxt)],Cn.prototype,"verticalAlign",2),y([vt(jo)],Cn.prototype,"gap",2),y([vt(jo)],Cn.prototype,"padding",2),y([vt(na)],Cn.prototype,"label",2),y([vt(na)],Cn.prototype,"secondaryLabel",2);var su=class extends gM{constructor(){super(...arguments),this.label=new Po}};y([vt(iu,{optional:!0})],su.prototype,"fill",2),y([vt(sc,{optional:!0})],su.prototype,"fillOpacity",2),y([vt(fM,{optional:!0})],su.prototype,"stroke",2),y([vt(jo,{optional:!0})],su.prototype,"strokeWidth",2),y([vt(sc,{optional:!0})],su.prototype,"strokeOpacity",2),y([vt(na)],su.prototype,"label",2);var nc=class extends gM{constructor(){super(...arguments),this.label=new Po,this.secondaryLabel=new Sy}};y([vt(iu,{optional:!0})],nc.prototype,"fill",2),y([vt(sc,{optional:!0})],nc.prototype,"fillOpacity",2),y([vt(fM,{optional:!0})],nc.prototype,"stroke",2),y([vt(jo,{optional:!0})],nc.prototype,"strokeWidth",2),y([vt(sc,{optional:!0})],nc.prototype,"strokeOpacity",2),y([vt(na)],nc.prototype,"label",2),y([vt(na)],nc.prototype,"secondaryLabel",2);var vN=class extends gxt{constructor(){super(...arguments),this.group=new su,this.tile=new nc}};y([vt(na)],vN.prototype,"group",2),y([vt(na)],vN.prototype,"tile",2);var Ha=class extends pxt{constructor(){super(...arguments),this.highlightStyle=new vN,this.tooltip=new fxt,this.group=new aa,this.tile=new Cn,this.undocumentedGroupFills=[],this.undocumentedGroupStrokes=[]}};y([vt(iu,{optional:!0})],Ha.prototype,"sizeName",2),y([vt(iu,{optional:!0})],Ha.prototype,"labelKey",2),y([vt(iu,{optional:!0})],Ha.prototype,"secondaryLabelKey",2),y([vt(mxt,{optional:!0})],Ha.prototype,"itemStyler",2),y([vt(na)],Ha.prototype,"highlightStyle",2),y([vt(na)],Ha.prototype,"tooltip",2),y([vt(na)],Ha.prototype,"group",2),y([vt(na)],Ha.prototype,"tile",2),y([vt(kU)],Ha.prototype,"undocumentedGroupFills",2),y([vt(kU)],Ha.prototype,"undocumentedGroupStrokes",2);var{TextUtils:vxt,TextWrapper:Mxt,isNumberEqual:Ixt,createDatumId:CU,Rect:NU,Group:OU,BBox:yM,Selection:MN,Text:mM,Transformable:Axt,applyShapeStyle:Dxt}=pM._ModuleSupport,kxt=class extends pM._ModuleSupport.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}},wU=new mM;function Lxt(t,e){const{fontStyle:i,fontWeight:s,fontSize:n,fontFamily:a}=e;wU.setProperties({text:t,fontStyle:i,fontWeight:s,fontSize:n,fontFamily:a,textAlign:"left",textBaseline:"top"});const{width:o,height:r}=wU.getBBox();return{width:o,height:r}}function ac(t){return t.children.length>0?t.sumSize-t.sizeValue:t.sizeValue}var EU={left:0,center:.5,right:1},Txt={top:0,middle:.5,bottom:1},Obt=class extends pM._ModuleSupport.Group{distanceSquared(t,e){return this.getBBox().distanceSquared(t,e)}},IN=class extends pM._ModuleSupport.HierarchySeries{constructor(){super(...arguments),this.NodeClass=kxt,this.properties=new Ha,this.rectGroup=this.contentGroup.appendChild(new OU),this.datumSelection=MN.select(this.rectGroup,NU),this.labelSelection=MN.select(this.labelGroup,OU),this.highlightSelection=MN.select(this.rectGroup,NU)}groupTitleHeight(t,e){const{labelValue:i}=t,{label:s}=this.properties.group,n=3;if(i!=null){if(s.fontSize>e.width/n||s.fontSize>e.height/n)return;{const{height:a}=Lxt(i,s);return Math.max(a,s.fontSize)}}}getNodePadding(t,e){if(t.parent==null)return{top:0,right:0,bottom:0,left:0};if(t.children.length===0){const{padding:o}=this.properties.tile;return{top:o,right:o,bottom:o,left:o}}const{label:{spacing:i},padding:s}=this.properties.group,n=this.groupTitleHeight(t,e),a=n!=null?n+i:0;return{top:s+a,right:s,bottom:s,left:s}}sortChildren({children:t}){const e=Array.from(t,(s,n)=>n).filter(s=>ac(t[s])>0).sort((s,n)=>ac(t[n])-ac(t[s]));return{sortedChildrenIndices:e,childAt:s=>{const n=e[s];return t[n]}}}squarify(t,e){const{datum:i,children:s}=t;if(e.width<=0||e.height<=0){t.bbox=void 0,t.padding=void 0,t.midPoint.x=NaN,t.midPoint.y=NaN;return}const n=i!=null?this.getNodePadding(t,e):{top:0,right:0,bottom:0,left:0};t.parent==null?(t.bbox=void 0,t.padding=void 0,t.midPoint.x=NaN,t.midPoint.y=NaN):(t.bbox=e,t.padding=n,t.midPoint.x=e.x+e.width/2,t.midPoint.y=e.y);const{sortedChildrenIndices:a,childAt:o}=this.sortChildren(t),r=a.every(A=>s[A].children.length===0),l=1,c=e.width-n.left-n.right,h=e.height-n.top-n.bottom;if(c<=0||h<=0)return;const u=a.length;let d=0,p=0,g=1/0,f=a.reduce((A,T)=>A+ac(s[T]),0);const x=new yM(e.x+n.left,e.y+n.top,c,h),m=x.clone();let b=0;for(;b({left:l.x,top:l.y,right:l.x+l.width,bottom:l.y+l.height}),a=n(t),o=n(e);["top","right","bottom","left"].forEach(l=>{Ixt(a[l],o[l])||e.shrink(s,l)})}createNodeData(){}getGroupBaseStyle(t){const{properties:e}=this,{group:i}=e,s=t?e.highlightStyle.group:void 0;return{fill:s?.fill??i.fill,fillOpacity:s?.fillOpacity??i.fillOpacity,stroke:s?.stroke??i.stroke,strokeWidth:s?.strokeWidth??i.strokeWidth,strokeOpacity:s?.strokeOpacity??i.strokeOpacity}}getGroupStyleOverrides(t,e,i,s,n){const{id:a,properties:o}=this,{undocumentedGroupFills:r,undocumentedGroupStrokes:l,itemStyler:c}=o,h=s.fill??r[Math.min(i??0,r.length)],u=s.stroke??l[Math.min(i??0,l.length)],d={};if(n||(d.fill=h,d.stroke=u),c!=null){const p=this.cachedDatumCallback(CU(t.join(":"),n?"highlight":"node"),()=>c({seriesId:a,datum:e,depth:i,highlighted:n,fill:h,stroke:u,...s}));Object.assign(d,p)}return d}getTileBaseStyle(t){const{properties:e}=this,{tile:i}=e,s=t?e.highlightStyle.tile:void 0;return{fill:s?.fill??i.fill,fillOpacity:s?.fillOpacity??i.fillOpacity,stroke:s?.stroke??i.stroke,strokeWidth:s?.strokeWidth??i.strokeWidth,strokeOpacity:s?.strokeOpacity??i.strokeOpacity}}getTileStyleOverrides(t,e,i,s,n,a){const{id:o,properties:r,colorScale:l}=this,{fills:c,strokes:h,itemStyler:u}=r,d=t[0],p=n.fill??c[d%c.length],g=n.stroke??h[d%h.length],f={};if(a||(f.fill=s!=null?l.convert(s):p,f.stroke=g),u!=null){const x=this.cachedDatumCallback(CU(t.join(":"),a?"highlight":"node"),()=>u({seriesId:o,datum:e,depth:i,highlighted:a,fill:p,stroke:g,...n}));Object.assign(f,x)}return f}updateSelections(){let t=this.ctx.highlightManager?.getActiveHighlight();if(t!=null&&!this.properties.group.interactive&&t.children.length!==0&&(t=void 0),this.highlightSelection.update(t!=null?[t]:[],void 0,n=>this.getDatumId(n)),!this.nodeDataRefresh)return;this.nodeDataRefresh=!1;const{seriesRect:e}=this.chart??{};if(!e)return;const i=Array.from(this.rootNode),s=n=>{n.append([new mM({tag:0}),new mM({tag:1})])};this.datumSelection.update(i,void 0,n=>this.getDatumId(n)),this.labelSelection.update(i,s,n=>this.getDatumId(n))}updateNodes(){const{rootNode:t,data:e}=this,{childrenKey:i,colorKey:s,colorName:n,labelKey:a,secondaryLabelKey:o,sizeKey:r,sizeName:l,highlightStyle:c,tile:h,group:u}=this.properties,{seriesRect:d}=this.chart??{};if(!d||!e)return;this.rootNode?.walk(T=>{const{datum:D,depth:L,children:C}=T,O=C.length===0,_=O?h.label:u.label;let N;if(D!=null&&L!=null&&a!=null){const j=D[a];N=this.getLabelText(_,{depth:L,datum:D,childrenKey:i,colorKey:s,colorName:n,labelKey:a,secondaryLabelKey:o,sizeKey:r,sizeName:l,value:j})}N===""&&(N=void 0);let P;if(O&&D!=null&&L!=null&&o!=null){const j=D[o];P=this.getLabelText(h.secondaryLabel,{depth:L,datum:D,childrenKey:i,colorKey:s,colorName:n,labelKey:a,secondaryLabelKey:o,sizeKey:r,sizeName:l,value:j})}P===""&&(P=void 0),T.labelValue=N,T.secondaryLabelValue=P});const{width:p,height:g}=d;this.squarify(t,new yM(0,0,p,g)),this.rootNode?.walk(T=>{const{bbox:D,children:L,labelValue:C,secondaryLabelValue:O}=T;if(T.label=void 0,T.secondaryLabel=void 0,D!=null)if(L.length===0){const _={width:D.width,height:D.height,meta:null},N=qT(C,this.properties.tile.label,O,this.properties.tile.secondaryLabel,{padding:h.padding},()=>_);if(N==null)return;const{height:P,label:j,secondaryLabel:F}=N,{textAlign:V,verticalAlign:W,padding:H}=h,G=EU[V]??.5,B=D.x+H+(D.width-2*H)*G,z=Txt[W]??.5,U=D.y+H+P*.5+(D.height-2*H-P)*z;if(j!=null){const{fontStyle:Y="normal",fontFamily:K,fontWeight:Z="normal",color:X="black"}=this.properties.tile.label;T.label={text:j.text,fontSize:j.fontSize,lineHeight:j.lineHeight,fontStyle:Y,fontFamily:K,fontWeight:Z,color:X,textAlign:V,verticalAlign:"middle",x:B,y:U-(P-j.height)*.5}}if(F!=null){const{fontStyle:Y="normal",fontFamily:K,fontWeight:Z="normal",color:X="black"}=this.properties.tile.secondaryLabel;T.secondaryLabel={text:F.text,fontSize:F.fontSize,lineHeight:F.fontSize,fontStyle:Y,fontFamily:K,fontWeight:Z,color:X,textAlign:V,verticalAlign:"middle",x:B,y:U+(P-F.height)*.5}}}else{if(C==null)return;{const{padding:_,textAlign:N}=u,P=this.groupTitleHeight(T,D);if(P==null)return;const j=D.width-2*_,F=Mxt.wrapText(C,{maxWidth:D.width-2*_,font:u.label,textWrap:"never"}),V=EU[N]??.5,{fontStyle:W="normal",fontFamily:H,fontWeight:G="normal",color:B="black"}=this.properties.group.label;T.label={text:F,fontSize:u.label.fontSize,lineHeight:vxt.getLineHeight(u.label.fontSize),fontStyle:W,fontFamily:H,fontWeight:G,color:B,textAlign:N,verticalAlign:"middle",x:D.x+_+j*V,y:D.y+_+P*.5}}}});const f=(T,D,L,C,O)=>{const{bbox:_}=T;if(_==null){D.visible=!1;return}const{datum:N,depth:P=-1,datumIndex:j,colorValue:F}=T,V=T.children.length===0,W=V?C:L,H=V?this.getTileStyleOverrides(j,N,P,F,W,O):this.getGroupStyleOverrides(j,N,P,W,O);D.crisp=!0,Dxt(D,W,H),D.cornerRadius=V?h.cornerRadius:u.cornerRadius,D.zIndex=[0,P,O?1:0];const G=T.parent?.children.every(U=>U.children.length===0),B=T.parent!=null?T.parent.bbox:void 0,z=T.parent!=null?T.parent.padding:void 0;G===!0&&B!=null&&z!=null?(D.clipBBox=_,D.x=B.x+z.left,D.y=B.y+z.top,D.width=B.width-(z.left+z.right),D.height=B.height-(z.top+z.bottom)):(D.clipBBox=void 0,D.x=_.x,D.y=_.y,D.width=_.width,D.height=_.height),D.visible=!0},x=this.getGroupBaseStyle(!1),m=this.getTileBaseStyle(!1);this.datumSelection.each((T,D)=>f(D,T,x,m,!1));const b=this.getGroupBaseStyle(!0),v=this.getTileBaseStyle(!0);this.highlightSelection.each((T,D)=>{f(D,T,b,v,!0)});const S=(T,D,L,C)=>{const O=T.children.length===0,_=L===0?T.label:T.secondaryLabel;if(_==null){D.visible=!1;return}let N;if(C){const{tile:P,group:j}=c;N=P.secondaryLabel.color,O?L===0&&(N=P.label.color):N=j.label.color}D.text=_.text,D.fontSize=_.fontSize,D.lineHeight=_.lineHeight,D.fontStyle=_.fontStyle,D.fontFamily=_.fontFamily,D.fontWeight=_.fontWeight,D.fill=N??_.color,D.textAlign=_.textAlign,D.textBaseline=_.verticalAlign,D.x=_.x,D.y=_.y,D.visible=!0,D.zIndex=1},A=this.ctx.highlightManager?.getActiveHighlight();this.labelSelection.selectByClass(mM).forEach(T=>{S(T.datum,T,T.tag,T.datum===A)})}pickNodeClosestDatum(t){const e=this.pickNodeExactShape(t);return e!==void 0?e:this.pickNodeNearestDistantObject(t,this.datumSelection.nodes())}getTooltipContent(t){const{id:e,properties:i}=this,{labelKey:s,secondaryLabelKey:n,childrenKey:a,sizeKey:o,sizeName:r,colorKey:l,colorName:c,tooltip:h}=i,{datum:u,datumIndex:d,depth:p,children:g}=t;if(u==null||p==null)return;const f=g.length===0,x=[],m=o!=null?u[o]:void 0;m!=null&&x.push({label:r,fallbackLabel:o,value:m});const b=l!=null?u[l]:void 0;b!=null&&x.push({label:c,fallbackLabel:l,value:b});let v;f?(v=this.getTileBaseStyle(!1),Object.assign(v,this.getTileStyleOverrides(d,u,p,b,v,!1))):(v=this.getGroupBaseStyle(!1),Object.assign(v,this.getGroupStyleOverrides(d,u,p,v,!1)));const S=v.fill,A=f?{marker:{shape:"square",fill:S,fillOpacity:1,stroke:void 0,strokeWidth:0,strokeOpacity:1,lineDash:[0],lineDashOffset:0}}:void 0;return h.formatTooltip({title:s!=null?u[s]:void 0,symbol:A,data:x},{seriesId:e,datum:u,title:void 0,depth:p,labelKey:s,secondaryLabelKey:n,childrenKey:a,sizeKey:o,sizeName:r,colorKey:l,colorName:c,...v})}computeFocusBounds(t){return Axt.toCanvas(this.contentGroup,t.getBBox())}};IN.className="TreemapSeries",IN.type="treemap";var{FONT_SIZE_RATIO:RU,ThemeSymbols:{DEFAULT_DIVERGING_SERIES_COLOR_RANGE:Cxt,DEFAULT_HIERARCHY_FILLS:Nxt,DEFAULT_HIERARCHY_STROKES:Oxt}}=uxt._ModuleSupport,wxt={type:"series",optionsKey:"series[]",packageType:"enterprise",chartTypes:["hierarchy"],identifier:"treemap",moduleFactory:t=>new IN(t),tooltipDefaults:{range:"exact"},solo:!0,themeTemplate:{series:{group:{label:{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"},tile:{label:{enabled:!0,color:{$ref:"backgroundColor"},fontStyle:void 0,fontWeight:{$ref:"fontWeight"},fontSize:{$rem:[1.5]},minimumFontSize:{$rem:[RU.SMALLER]},fontFamily:{$ref:"fontFamily"},wrapping:"on-space",overflowStrategy:"ellipsis",spacing:2},secondaryLabel:{enabled:!0,color:{$ref:"backgroundColor"},fontStyle:void 0,fontWeight:void 0,fontSize:{$ref:"fontSize"},minimumFontSize:{$rem:[RU.SMALLER]},fontFamily:{$ref:"fontFamily"},wrapping:"never",overflowStrategy:"ellipsis"},fill:void 0,stroke:void 0,strokeWidth:0,padding:3,gap:1},highlightStyle:{group:{label:{color:{$ref:"textColor"}},fill:"rgba(255,255,255, 0.33)",stroke:"rgba(0, 0, 0, 0.4)",strokeWidth:2},tile:{label:{color:{$ref:"backgroundColor"}},secondaryLabel:{color:{$ref:"backgroundColor"}},fill:"rgba(255,255,255, 0.33)",stroke:"rgba(0, 0, 0, 0.4)",strokeWidth:2}}},gradientLegend:{enabled:!0}},paletteFactory:({takeColors:t,colorsCount:e,themeTemplateParameters:i})=>{const{fills:s,strokes:n}=t(e),a=i.get(Cxt),o=i.get(Nxt),r=i.get(Oxt);return{fills:s,strokes:n,colorRange:a,undocumentedGroupFills:o,undocumentedGroupStrokes:r}}},_U=(R(),E(w)),nu=(R(),E(w)),Ext=(R(),E(w)),{AbstractBarSeriesProperties:Rxt,BaseProperties:Ey,PropertiesArray:_xt,SeriesTooltip:Pxt,Validate:Bt,BOOLEAN:Bxt,COLOR_STRING:AN,FUNCTION:PU,LINE_DASH:BU,NUMBER:zxt,OBJECT:Ur,OBJECT_ARRAY:Fxt,POSITIVE_NUMBER:bp,RATIO:DN,STRING:Sp,UNION:zU,DropShadow:jxt,Label:Vxt}=Ext._ModuleSupport,xM=class extends Ey{};y([Bt(zU(["subtotal","total"],"a total type"))],xM.prototype,"totalType",2),y([Bt(zxt)],xM.prototype,"index",2),y([Bt(Sp)],xM.prototype,"axisLabel",2);var FU=class extends Ey{};y([Bt(PU,{optional:!0})],FU.prototype,"renderer",2);var kN=class extends Vxt{constructor(){super(...arguments),this.placement="outside-end",this.padding=6}};y([Bt(zU(["inside-center","inside-start","inside-end","outside-start","outside-end"],"a placement"))],kN.prototype,"placement",2),y([Bt(bp)],kN.prototype,"padding",2);var Ms=class extends Ey{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 jxt().set({enabled:!1}),this.label=new kN,this.tooltip=new FU}};y([Bt(Sp,{optional:!0})],Ms.prototype,"name",2),y([Bt(AN)],Ms.prototype,"fill",2),y([Bt(AN)],Ms.prototype,"stroke",2),y([Bt(DN)],Ms.prototype,"fillOpacity",2),y([Bt(DN)],Ms.prototype,"strokeOpacity",2),y([Bt(BU)],Ms.prototype,"lineDash",2),y([Bt(bp)],Ms.prototype,"lineDashOffset",2),y([Bt(bp)],Ms.prototype,"strokeWidth",2),y([Bt(bp)],Ms.prototype,"cornerRadius",2),y([Bt(PU,{optional:!0})],Ms.prototype,"itemStyler",2),y([Bt(Ur)],Ms.prototype,"shadow",2),y([Bt(Ur)],Ms.prototype,"label",2),y([Bt(Ur)],Ms.prototype,"tooltip",2);var au=class extends Ey{constructor(){super(...arguments),this.enabled=!0,this.stroke="black",this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.strokeWidth=2}};y([Bt(Bxt)],au.prototype,"enabled",2),y([Bt(AN)],au.prototype,"stroke",2),y([Bt(DN)],au.prototype,"strokeOpacity",2),y([Bt(BU)],au.prototype,"lineDash",2),y([Bt(bp)],au.prototype,"lineDashOffset",2),y([Bt(bp)],au.prototype,"strokeWidth",2);var bM=class extends Ey{constructor(){super(...arguments),this.positive=new Ms,this.negative=new Ms,this.total=new Ms}};y([Bt(Ur)],bM.prototype,"positive",2),y([Bt(Ur)],bM.prototype,"negative",2),y([Bt(Ur)],bM.prototype,"total",2);var Hr=class extends Rxt{constructor(){super(...arguments),this.item=new bM,this.totals=new _xt(xM),this.line=new au,this.tooltip=new Pxt}};y([Bt(Sp)],Hr.prototype,"xKey",2),y([Bt(Sp)],Hr.prototype,"yKey",2),y([Bt(Sp,{optional:!0})],Hr.prototype,"xName",2),y([Bt(Sp,{optional:!0})],Hr.prototype,"yName",2),y([Bt(Ur)],Hr.prototype,"item",2),y([Bt(Fxt)],Hr.prototype,"totals",2),y([Bt(Ur)],Hr.prototype,"line",2),y([Bt(Ur)],Hr.prototype,"tooltip",2);var{adjustLabelPlacement:Gxt,SeriesNodePickMode:jU,fixNumericExtent:Wxt,valueProperty:VU,keyProperty:Uxt,accumulativeValueProperty:SM,trailingAccumulatedValueProperty:Hxt,ChartAxisDirection:LN,createDatumId:Yxt,checkCrisp:Kxt,updateLabelNode:$xt,prepareBarAnimationFunctions:Xxt,collapsedStartingBarPosition:Zxt,resetBarSelectionsFn:Qxt,seriesLabelFadeInAnimation:qxt,resetLabelFn:Jxt,animationValidation:tbt,DEFAULT_CARTESIAN_DIRECTION_KEYS:ebt,DEFAULT_CARTESIAN_DIRECTION_NAMES:ibt,computeBarFocusBounds:sbt,isContinuous:GU,Rect:nbt,motion:abt,applyShapeStyle:obt}=nu._ModuleSupport,TN=class extends nu._ModuleSupport.AbstractBarSeries{constructor(t){super({moduleCtx:t,directionKeys:ebt,directionNames:ibt,pickModes:[jU.NEAREST_NODE,jU.EXACT_SHAPE_MATCH],pathsPerSeries:["connector"],hasHighlightedLabels:!0,pathsZIndexSubOrderOffset:[-1,-1],animationResetFns:{datum:Qxt,label:Jxt}}),this.properties=new Hr,this.seriesItemTypes=new Set(["positive","negative","total"])}async processData(t){const{xKey:e,yKey:i,totals:s}=this.properties,{data:n=[]}=this;if(!this.properties.isValid()||!this.visible)return;const a=b=>GU(b)&&Number(b)>=0,o=b=>GU(b)&&Number(b)>=0,r=b=>b==="total"||b==="subtotal",l={missingValue:void 0,invalidValue:void 0},c=[],h=s.reduce((b,v)=>{const S=b.get(v.index);return S?S.push(v):b.set(v.index,[v]),b},new Map);n.forEach((b,v)=>{c.push(b),h.get(v)?.forEach(S=>c.push({...S.toJson(),[e]:S.axisLabel}))});const u=[];this.ctx.animationManager.isSkipped()||u.push(tbt());const d=this.getCategoryAxis()?.scale,p=this.getValueAxis()?.scale,{isContinuousX:g,xScaleType:f,yScaleType:x}=this.getScaleInformation({xScale:d,yScale:p}),{processedData:m}=await this.requestDataModel(t,c,{props:[Uxt(e,f,{id:"xValue"}),SM(i,x,{...l,id:"yCurrent"}),SM(i,x,{...l,missingValue:0,id:"yCurrentTotal"}),SM(i,x,{...l,id:"yCurrentPositive",validation:a}),SM(i,x,{...l,id:"yCurrentNegative",validation:o}),Hxt(i,x,{...l,id:"yPrevious"}),VU(i,x,{id:"yRaw"}),VU("totalType","band",{id:"totalTypeValue",missingValue:void 0,validation:r}),...g?[nu._ModuleSupport.SMALLEST_KEY_INTERVAL,nu._ModuleSupport.LARGEST_KEY_INTERVAL]:[],...u]});this.smallestDataInterval=m.reduced?.smallestKeyInterval,this.largestDataInterval=m.reduced?.largestKeyInterval,this.updateSeriesItemTypes(),this.animationState.transition("updateData")}getSeriesDomain(t){const{processedData:e,dataModel:i}=this;if(!e||!i)return[];const{keys:[s],values:n}=e.domain;if(t===this.getCategoryDirection()){const a=i.resolveProcessedDataDefById(this,"xValue");if(a?.def.type==="key"&&a?.def.valueType==="category")return s;const o=t===LN.Y,r=this.getCategoryAxis().isReversed();return this.padBandExtent(s,r!==o)}else{const a=i.resolveProcessedDataIndexById(this,"yCurrent"),o=n[a],r=[Math.min(0,o[0]),Math.max(0,o[1])];return Wxt(r)}}getSeriesRange(t,e){return[NaN,NaN]}createNodeData(){const{data:t,dataModel:e,processedData:i}=this,s=this.getCategoryAxis(),n=this.getValueAxis();if(!t||!s||!n||!e||!i)return;const{line:a}=this.properties,o=s.scale,r=n.scale,l=this.getBarDirection()===LN.X,c=this.getBandwidth(s)??10,h=s.isReversed(),u=n.isReversed();if(i.type!=="ungrouped")return;const d={itemId:this.properties.yKey,nodeData:[],labelData:[],pointData:[],scales:this.calculateScaling(),visible:this.visible};if(!this.visible)return d;const p=[],g=e.resolveKeysById(this,"xValue",i),f=e.resolveColumnById(this,"yRaw",i),x=e.resolveColumnById(this,"totalTypeValue",i),m=e.resolveColumnById(this,"yCurrent",i),b=e.resolveColumnById(this,"yPrevious",i),v=e.resolveColumnById(this,"yCurrentTotal",i),S=Kxt(s?.scale,s?.visibleRange,this.smallestDataInterval,this.largestDataInterval);function A(j,F,V){return j||F?{cumulativeValue:v[V],trailingValue:F?D:0}:{cumulativeValue:m[V],trailingValue:b[V]}}function T(j,F,V,W,H){return j?W:F?(W??0)-(H??0):V}let D=0;const{xKey:L,yKey:C,xName:O,yName:_}=this.properties;(i.dataSources.get(this.id)??[]).forEach((j,F)=>{const V=x[F],W=this.isSubtotal(V),H=this.isTotal(V),G=H||W,B=g[F];if(B==null)return;const z=Math.round(o.convert(B)),U=f[F],{cumulativeValue:Y,trailingValue:K}=A(H,W,F);G&&(D=Y??0);const Z=Math.round(r.convert(Y)),X=Math.round(r.convert(K)),Q=T(H,W,U,Y,K),$=(Q??0)>=0,q=this.getSeriesItemType($,V),{strokeWidth:J,label:nt}=this.getItemConfig(q),it=$?Z:X,rt=$?X:Z,dt=Math.max(J,Math.abs(rt-it)),at={x:l?Math.min(it,rt):z,y:l?z:Math.min(it,rt),width:l?dt:c,height:l?c:dt},Dt={x:at.x+at.width/2,y:at.y+at.height/2},kt=G?Z:X,Mt=Math.floor(a.strokeWidth)%2/2,ft=h?Z:kt,xt=h?kt:Z;let Nt,Yt;l?(Nt={x:ft+Mt,y:at.y},Yt={x:xt+Mt,y:at.y+at.height}):(Nt={x:at.x,y:ft+Mt},Yt={x:at.x+at.width,y:xt+Mt});const Nn={x:h?Yt.x:Nt.x,y:h?Yt.y:Nt.y,x2:h?Nt.x:Yt.x,y2:h?Nt.y:Yt.y,size:0};p.push(Nn);const $i=q==="subtotal"?"total":q,Ya=this.getLabelText(nt,{itemId:$i,value:Q,datum:j,xKey:L,yKey:C,xName:O,yName:_}),oa={index:F,series:this,itemId:q,datum:j,datumIndex:F,cumulativeValue:Y??0,xValue:B,yValue:Q,yKey:C,xKey:L,x:at.x,y:at.y,width:at.width,height:at.height,midPoint:Dt,crisp:S,label:{text:Ya,...Gxt({isUpward:(Q??-1)>=0!==u,isVertical:!l,placement:nt.placement,padding:nt.padding,rect:at})}};d.nodeData.push(oa),d.labelData.push(oa)});const P=this.properties.line.enabled;return m!=null&&P&&(d.pointData=p),d}updateSeriesItemTypes(){const{dataModel:t,seriesItemTypes:e,processedData:i}=this;if(!t||!i)return;e.clear();const s=t.resolveProcessedDataIndexById(this,"yCurrentPositive"),n=t.resolveProcessedDataIndexById(this,"yCurrentNegative"),a=t.resolveProcessedDataIndexById(this,"totalTypeValue"),o=i.domain.values[s]??[],r=i.domain.values[n]??[];o.length>0&&e.add("positive"),r.length>0&&e.add("negative");const l=i?.domain.values[a];l&&l.forEach(c=>{(c==="total"||c==="subtotal")&&e.add("total")})}isSubtotal(t){return t==="subtotal"}isTotal(t){return t==="total"}nodeFactory(){return new nbt}getSeriesItemType(t,e){return e??(t?"positive":"negative")}getItemConfig(t){switch(t){case"positive":return this.properties.item.positive;case"negative":return this.properties.item.negative;case"subtotal":case"total":return this.properties.item.total}}updateDatumSelection(t){const{nodeData:e,datumSelection:i}=t,s=e??[];return i.update(s)}getItemStyle(t,e,i,s){const{id:n,properties:a}=this,o=a.item[i==="subtotal"?"total":i],r=s?a.highlightStyle.item:void 0,{itemStyler:l}=o,{xKey:c,yKey:h}=a,u={fill:r?.fill??o.fill,fillOpacity:r?.fillOpacity??o.fillOpacity,stroke:r?.stroke??o.stroke,strokeWidth:r?.strokeWidth??o.strokeWidth,strokeOpacity:r?.strokeOpacity??o.strokeOpacity,lineDash:r?.lineDash??o.lineDash??[],lineDashOffset:r?.lineDashOffset??o.lineDashOffset,cornerRadius:o.cornerRadius};if(l!=null){const d=this.cachedDatumCallback(Yxt(t,s?"highlight":"node"),()=>l({seriesId:n,itemId:i,datum:e,xKey:c,yKey:h,highlighted:s,...u}));Object.assign(u,d)}return u}updateDatumNodes(t){const{datumSelection:e,isHighlight:i}=t,s=this.getCategoryDirection()===LN.X;e.each((n,a)=>{const o=a.itemId,r=this.getItemStyle(String(a.datumIndex),a.datum,o,i);obt(n,r),n.visible=s?a.width>0:a.height>0,n.crisp=a.crisp})}updateLabelSelection(t){const{labelData:e,labelSelection:i}=t;if(e.length===0)return i.update([]);const s=e.filter(n=>{const{label:a}=this.getItemConfig(n.itemId);return a.enabled});return i.update(s)}updateLabelNodes(t){t.labelSelection.each((e,i)=>{$xt(e,this.getItemConfig(i.itemId).label,i.label)})}getTooltipContent(t){const{id:e,dataModel:i,processedData:s,properties:n}=this,{xKey:a,xName:o,yKey:r,yName:l,tooltip:c}=n,h=this.getCategoryAxis(),u=this.getValueAxis();if(!i||!s||!h||!u)return;const{datumIndex:d}=t,p=s.dataSources.get(this.id)?.[d],g=i.resolveKeysById(this,"xValue",s)[d],f=i.resolveColumnById(this,"yRaw",s)[d],x=i.resolveColumnById(this,"yCurrentTotal",s),m=i.resolveColumnById(this,"totalTypeValue",s);if(g==null)return;const b=m[d],v=(f??0)>=0,S=this.getSeriesItemType(v,b);let A;if(this.isTotal(b))A=x[d];else if(this.isSubtotal(b)){A=x[d];for(let D=d-1;D>=0;D-=1)if(this.isSubtotal(m[D])){A=A-x[D];break}}else A=f;const T=this.getItemStyle(String(d),p,S,!1);return c.formatTooltip({heading:h.formatDatum(g),symbol:this.legendItemSymbol(S),data:[{label:l,fallbackLabel:r,value:u.formatDatum(A)}]},{seriesId:e,datum:p,title:l,itemId:S,xKey:a,xName:o,yKey:r,yName:l,...T})}legendItemSymbol(t){const{fill:e,stroke:i,fillOpacity:s,strokeOpacity:n,strokeWidth:a,lineDash:o,lineDashOffset:r}=this.getItemConfig(t);return{marker:{fill:e,stroke:i,fillOpacity:s,strokeOpacity:n,strokeWidth:a,lineDash:o,lineDashOffset:r}}}getLegendData(t){if(t!=="category")return[];const{id:e,seriesItemTypes:i}=this,s=[],n=o=>o.charAt(0).toUpperCase()+o.substring(1),{showInLegend:a}=this.properties;return i.forEach(o=>{const{name:r}=this.getItemConfig(o);s.push({legendType:"category",id:e,itemId:o,seriesId:e,enabled:!0,label:{text:r??n(o)},symbol:this.legendItemSymbol(o),hideInLegend:!a,isFixed:!0})}),s}toggleSeriesItem(){}animateEmptyUpdateReady({datumSelection:t,labelSelection:e,contextData:i,paths:s}){const n=Xxt(Zxt(this.isVertical(),this.axes,"normal"));abt.fromToMotion(this.id,"datums",this.ctx.animationManager,[t],n),qxt(this,"labels",this.ctx.animationManager,e);const{pointData:a}=i;if(!a)return;const[o]=s;this.isVertical()?this.animateConnectorLinesVertical(o,a):this.animateConnectorLinesHorizontal(o,a)}animateConnectorLinesHorizontal(t,e){const{path:i}=t;this.updateLineNode(t);const s=this.getValueAxis(),n=s?.isReversed(),a=n?(c,h)=>cc>h,o=s?.scale.convert(0),r=e.reduce((c,h)=>(a(h.x,c)&&(c=h.x),c),n?1/0:0),l=(c,h,u,d,p)=>(c-h)/(u-h)*(p-d)+d;this.ctx.animationManager.animate({id:`${this.id}_connectors`,groupId:this.id,phase:"initial",from:o,to:r,ease:nu._ModuleSupport.Motion.easeOut,collapsable:!1,onUpdate(c){i.clear(!0),e.forEach((h,u)=>{const d=l(c,o,r,o,h.x),p=l(c,o,r,o,h.x2);u!==0&&i.lineTo(d,h.y),i.moveTo(p,h.y2)}),t.checkPathDirty()}})}animateConnectorLinesVertical(t,e){const{path:i}=t;this.updateLineNode(t);const s=this.getValueAxis(),n=s?.isReversed(),a=n?(c,h)=>c>h:(c,h)=>c(a(h.y,c)&&(c=h.y),c),n?0:1/0),l=(c,h,u,d,p)=>(c-h)/(u-h)*(p-d)+d;this.ctx.animationManager.animate({id:`${this.id}_connectors`,groupId:this.id,phase:"initial",from:o,to:r,ease:nu._ModuleSupport.Motion.easeOut,collapsable:!1,onUpdate(c){i.clear(!0),e.forEach((h,u)=>{const d=l(c,o,r,o,h.y),p=l(c,o,r,o,h.y2);u!==0&&i.lineTo(h.x,d),i.moveTo(h.x2,p)}),t.checkPathDirty()}})}animateReadyResize(t){super.animateReadyResize(t),this.resetConnectorLinesPath(t)}updatePaths(t){this.resetConnectorLinesPath({contextData:t.contextData,paths:t.paths})}resetConnectorLinesPath({contextData:t,paths:e}){if(e.length===0)return;const[i]=e;this.updateLineNode(i);const{path:s}=i;s.clear(!0);const{pointData:n}=t;n&&(n.forEach((a,o)=>{o!==0&&s.lineTo(a.x,a.y),s.moveTo(a.x2,a.y2)}),i.checkPathDirty())}updateLineNode(t){const{stroke:e,strokeWidth:i,strokeOpacity:s,lineDash:n,lineDashOffset:a}=this.properties.line;t.setProperties({fill:void 0,stroke:e,strokeWidth:this.getStrokeWidth(i),strokeOpacity:s,lineDash:n,lineDashOffset:a,lineJoin:"round",pointerEvents:nu._ModuleSupport.PointerEvents.None})}isLabelEnabled(){const{positive:t,negative:e,total:i}=this.properties.item;return t.label.enabled||e.label.enabled||i.label.enabled}onDataChange(){}computeFocusBounds({datumIndex:t}){return sbt(this,this.contextNodeData?.nodeData[t])}};TN.className="WaterfallSeries",TN.type="waterfall";var rbt=(R(),E(w)),CN={strokeWidth:0,label:{enabled:!1,fontStyle:void 0,fontWeight:{$ref:"fontWeight"},fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},color:{$ref:"textColor"},formatter:void 0,placement:"outside-end"}},lbt={series:{item:{positive:CN,negative:CN,total:CN},line:{stroke:rbt._ModuleSupport.ThemeSymbols.PALETTE_NEUTRAL_STROKE,strokeOpacity:1,lineDash:[0],lineDashOffset:0,strokeWidth:2}},legend:{enabled:!0,toggleSeries:!1}},{ThemeConstants:vM}=_U._ModuleSupport,cbt={type:"series",optionsKey:"series[]",packageType:"enterprise",chartTypes:["cartesian"],identifier:"waterfall",solo:!0,moduleFactory:t=>new TN(t),tooltipDefaults:{range:"exact"},defaultAxes:_U._ModuleSupport.swapAxisCondition([{type:vM.CARTESIAN_AXIS_TYPE.NUMBER,position:vM.CARTESIAN_POSITION.LEFT},{type:vM.CARTESIAN_AXIS_TYPE.CATEGORY,position:vM.CARTESIAN_POSITION.BOTTOM}],t=>t?.direction==="horizontal"),themeTemplate:lbt,paletteFactory:({takeColors:t,colorsCount:e,userPalette:i,palette:s})=>{if(i==="user-indexed"){const{fills:n,strokes:a}=t(e);return{line:{stroke:s.neutral.stroke},item:{positive:{fill:n[0],stroke:a[0]},negative:{fill:n[1],stroke:a[1]},total:{fill:n[2],stroke:a[2]}}}}return{line:{stroke:s.neutral.stroke},item:{positive:{fill:s.altUp.fill,stroke:s.altUp.stroke,label:{color:{$ref:"textColor"}}},negative:{fill:s.altDown.fill,stroke:s.altDown.stroke,label:{color:{$ref:"textColor"}}},total:{fill:s.neutral.fill,stroke:s.neutral.stroke,label:{color:{$ref:"textColor"}}}}}}},hbt=`.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-chrome-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-chrome-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;--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,');--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::-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::-webkit-slider-thumb{background:hsl(var(--h),100%,50%)}.ag-charts-color-picker__alpha-input::-webkit-slider-thumb{background:transparent}.ag-charts-color-picker__alpha-input--opaque::-webkit-slider-thumb{background:var(--color)}.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: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: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: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{.ag-charts-menu__row:first-child{border-radius:0}}.ag-charts-annotations__text-size-menu{--item-padding: 4px 8px;border-top-left-radius:0;border-top-right-radius:0;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-chrome-font-family);font-size:var(--ag-charts-chrome-font-size);font-weight:var(--ag-charts-chrome-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{background:var(--ag-charts-chrome-background-color);border:var(--ag-charts-border);border-radius:var(--ag-charts-border-radius);box-shadow:var(--ag-charts-shadow);color:var(--ag-charts-chrome-text-color);font-family:var(--ag-charts-chrome-font-family);font-size:calc(var(--ag-charts-chrome-font-size) * (13 / 12));font-weight:var(--ag-charts-chrome-font-weight);transition:transform .1s ease;white-space:nowrap;z-index:var(--ag-charts-layer-ui-overlay)}.ag-charts-context-menu__cover{position:fixed;left:0;top:0}.ag-charts-context-menu__menu{display:flex;flex-direction:column;padding:.5em 0}.ag-charts-context-menu__menu:focus{outline:none}.ag-charts-context-menu__item{background:none;border:none;box-sizing:border-box;color:inherit;font:inherit;padding:.5em 1em;text-align:left;-webkit-appearance:none;-moz-appearance:none}.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-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;opacity:.5;text-align:left}.ag-charts-context-menu__item[aria-disabled=true]:focus{background:inherit;cursor:inherit}.ag-charts-context-menu__divider{margin:5px 0;background:#babfc7;height:1px}.ag-charts-context-menu__divider.ag-charts-dark-context-menu{background:#2196f31a}.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}} `;Id._ModuleSupport.ModuleRegistry.registerMany([EQ,eq,oq,uq,yq]);function WU(){Id._ModuleSupport.moduleRegistry.register(_7,K7,bq,ist,dst,Tot,cnt,qot,Ert,slt,Wlt,lct,wpt,xst,Ist,Bst,jst,snt,Vht,Qct,Fut,mut,hdt,$dt,Ddt,wnt,rat,got,Gct,Cpt,X7,Bgt,Fgt,yft,kft,vQ,oyt,LQ,Lmt,$yt,Ynt,Qpt,Xmt,$nt,hxt,pat,wxt,cbt,tot),Id._ModuleSupport.enterpriseModule.isEnterprise=!0,Id._ModuleSupport.enterpriseModule.styles=hbt,Id._ModuleSupport.enterpriseModule.licenseManager=t=>new Md(t.container?.ownerDocument??(typeof document>"u"?void 0:document)),Id._ModuleSupport.enterpriseModule.injectWatermark=yot}Z8(uk,(R(),E(w)),ra.exports),WU();var ubt={setLicenseKey(t){Md.setLicenseKey(t)}};function UU(){WU(),(0,br.setupCommunityModules)()}var dbt={VERSION:br.VERSION,_Scene:br._Scene,_Theme:br._Theme,_Util:br._Util,create:br.AgCharts.create.bind(br.AgCharts),createSparkline:br.AgCharts.__createSparkline.bind(br.AgCharts),setup:UU,setGridContext:Md.setGridContext.bind(Md),setLicenseKey:Md.setLicenseKey.bind(Md),isEnterprise:!0};if(typeof ra.exports=="object"&&typeof Mp=="object"){var pbt=(t,e,i,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of Object.getOwnPropertyNames(e))!Object.prototype.hasOwnProperty.call(t,n)&&n!==i&&Object.defineProperty(t,n,{get:()=>e[n],enumerable:!(s=Object.getOwnPropertyDescriptor(e,n))||s.enumerable});return t};ra.exports=pbt(ra.exports,Mp)}return ra.exports});