UNPKG

ag-charts-community

Version:

Advanced Charting / Charts supporting Javascript / Typescript / React / Angular / Vue

5 lines 140 kB
"use strict";var __defProp=Object.defineProperty,__getOwnPropDesc=Object.getOwnPropertyDescriptor,__getOwnPropNames=Object.getOwnPropertyNames,__hasOwnProp=Object.prototype.hasOwnProperty,__export=(e,t)=>{for(var n in t)__defProp(e,n,{get:t[n],enumerable:!0})},__copyProps=(e,t,n,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of __getOwnPropNames(t))!__hasOwnProp.call(e,s)&&s!==n&&__defProp(e,s,{get:()=>t[s],enumerable:!(i=__getOwnPropDesc(t,s))||i.enumerable});return e},__toCommonJS=e=>__copyProps(__defProp({},"__esModule",{value:!0}),e),__decorateClass=(e,t,n,i)=>{for(var s=i>1?void 0:i?__getOwnPropDesc(t,n):t,r=e.length-1,a;r>=0;r--)(a=e[r])&&(s=(i?a(t,n,s):a(s))||s);return i&&s&&__defProp(t,n,s),s},integrated_charts_scene_exports={};__export(integrated_charts_scene_exports,{Arc:()=>Arc,BBox:()=>BBox,Caption:()=>Caption,CategoryScale:()=>CategoryScale,Group:()=>Group,Line:()=>Line,LinearScale:()=>LinearScale,Marker:()=>Marker,Path:()=>Path,RadialColumnShape:()=>RadialColumnShape,Rect:()=>Rect,Scene:()=>Scene,Sector:()=>Sector,Shape:()=>Shape,TranslatableGroup:()=>TranslatableGroup,getRadialColumnWidth:()=>getRadialColumnWidth,toRadians:()=>toRadians}),module.exports=__toCommonJS(integrated_charts_scene_exports);var import_ag_charts_core2=require("ag-charts-core"),ID_MAP=new Map;function createId(e){const t=e.constructor,n=Object.hasOwn(t,"className")?t.className:t.name;if(!n)throw new Error(`The ${t} is missing the 'className' property.`);const i=(ID_MAP.get(n)??0)+1;return ID_MAP.set(n,i),`${n}-${i}`}function generateUUID(){return crypto.randomUUID?.()??generateUUIDv4()}function generateUUIDv4(){const e=new Uint8Array(16);crypto.getRandomValues(e),e[6]=e[6]&15|64,e[8]=e[8]&63|128;let t="";for(let n=0;n<e.length;n++)(n===4||n===6||n===8||n===10)&&(t+="-"),t+=e[n].toString(16).padStart(2,"0");return t}var import_ag_charts_core=require("ag-charts-core"),BBoxValues={containsPoint,isEmpty,normalize};function containsPoint(e,t,n){return t>=e.x&&t<=e.x+e.width&&n>=e.y&&n<=e.y+e.height}function isEmpty(e){return e==null||e.height===0||e.width===0||isNaN(e.height)||isNaN(e.width)}function normalize(e){let{x:t,y:n,width:i,height:s}=e;return(i==null||i>0)&&(s==null||s>0)?e:(t!=null&&i!=null&&i<0&&(i=-i,t=t-i),n!=null&&s!=null&&s<0&&(s=-s,n=n-s),{x:t,y:n,width:i,height:s})}var interpolate=Symbol("interpolate");function nearestSquared(e,t,n,i=1/0){const s={nearest:void 0,distanceSquared:i};for(const r of n){const a=r.distanceSquared(e,t);if(a===0)return{nearest:r,distanceSquared:0};a<s.distanceSquared&&(s.nearest=r,s.distanceSquared=a)}return s}var _BBox=class G{constructor(t,n,i,s){this.x=t,this.y=n,this.width=i,this.height=s}static fromDOMRect({x:t,y:n,width:i,height:s}){return new G(t,n,i,s)}static merge(t){let n=1/0,i=1/0,s=-1/0,r=-1/0;for(const a of t)a.x<n&&(n=a.x),a.y<i&&(i=a.y),a.x+a.width>s&&(s=a.x+a.width),a.y+a.height>r&&(r=a.y+a.height);return new G(n,i,s-n,r-i)}static nearestBox(t,n,i){return nearestSquared(t,n,i)}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:t,y:n,width:i,height:s}=this;return new G(t,n,i,s)}equals(t){return this.x===t.x&&this.y===t.y&&this.width===t.width&&this.height===t.height}containsPoint(t,n){return BBoxValues.containsPoint(this,t,n)}intersection(t){if(!this.collidesBBox(t))return;const n=(0,import_ag_charts_core.clamp)(t.x,this.x,t.x+t.width),i=(0,import_ag_charts_core.clamp)(t.y,this.y,t.y+t.height),s=(0,import_ag_charts_core.clamp)(t.x,this.x+this.width,t.x+t.width),r=(0,import_ag_charts_core.clamp)(t.y,this.y+this.height,t.y+t.height);return new G(n,i,s-n,r-i)}collidesBBox(t){return this.x<t.x+t.width&&this.x+this.width>t.x&&this.y<t.y+t.height&&this.y+this.height>t.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(t,n){if(this.containsPoint(t,n))return 0;const i=t-(0,import_ag_charts_core.clamp)(this.x,t,this.x+this.width),s=n-(0,import_ag_charts_core.clamp)(this.y,n,this.y+this.height);return i*i+s*s}shrink(t,n){if(typeof t=="number")this.applyMargin(t,n);else for(const i of Object.keys(t)){const s=t[i];typeof s=="number"&&this.applyMargin(s,i)}return this.width<0&&(this.width=0),this.height<0&&(this.height=0),this}grow(t,n){if(typeof t=="number")this.applyMargin(-t,n);else for(const i of Object.keys(t)){const s=t[i];typeof s=="number"&&this.applyMargin(-s,i)}return this}applyMargin(t,n){switch(n){case"top":this.y+=t;case"bottom":this.height-=t;break;case"left":this.x+=t;case"right":this.width-=t;break;case"vertical":this.y+=t,this.height-=t*2;break;case"horizontal":this.x+=t,this.width-=t*2;break;case void 0:this.x+=t,this.y+=t,this.width-=t*2,this.height-=t*2;break}}translate(t,n){return this.x+=t,this.y+=n,this}[interpolate](t,n){return new G(this.x*(1-n)+t.x*n,this.y*(1-n)+t.y*n,this.width*(1-n)+t.width*n,this.height*(1-n)+t.height*n)}};_BBox.zero=Object.freeze(new _BBox(0,0,0,0)),_BBox.NaN=Object.freeze(new _BBox(NaN,NaN,NaN,NaN));var BBox=_BBox;function SceneChangeDetection(e){return function(t,n){const i=`__${n}`;t[n]||prepareGetSet(t,n,i,e)}}function prepareGetSet(e,t,n,i){const{type:s="normal",changeCb:r,convertor:a,checkDirtyOnAssignment:c=!1}=i??{},o={type:s,changeCb:r,checkDirtyOnAssignment:c,convertor:a};let h;switch(s){case"normal":h=buildNormalSetter(n,o);break;case"transform":h=buildTransformSetter(n);break;case"path":h=buildPathSetter(n);break}h=buildCheckDirtyChain(n,buildChangeCallbackChain(buildConvertorChain(h,o),o),o),Object.defineProperty(e,t,{set:h,get:function(){return this[n]},enumerable:!0,configurable:!0})}function buildConvertorChain(e,t){const{convertor:n}=t;return n?function(i){e.call(this,n(i))}:e}var NO_CHANGE=Symbol("no-change");function buildChangeCallbackChain(e,t){const{changeCb:n}=t;return n?function(i){const s=e.call(this,i);return s!==NO_CHANGE&&n.call(this,this),s}:e}function buildCheckDirtyChain(e,t,n){const{checkDirtyOnAssignment:i}=n;return i?function(s){const r=t.call(this,s);return s?._dirty===!0&&this.markDirty(e),r}:t}function buildNormalSetter(e,t){const{changeCb:n}=t;return function(i){const s=this[e];return i!==s?(this[e]=i,this.markDirty(e),n?.(this),i):NO_CHANGE}}function buildTransformSetter(e){return function(t){const n=this[e];return t!==n?(this[e]=t,this.markDirtyTransform(),t):NO_CHANGE}}function buildPathSetter(e){return function(t){const n=this[e];return t!==n?(this[e]=t,this._dirtyPath||(this._dirtyPath=!0,this.markDirty(e)),t):NO_CHANGE}}var _Node=class Y{constructor(t){this.serialNumber=Y._nextSerialNumber++,this.childNodeCounts={groups:0,nonGroups:0,thisComplexity:0,complexity:0},this.id=createId(this),this.pointerEvents=0,this._dirty=!0,this.dirtyZIndex=!1,this.isContainerNode=!1,this.visible=!0,this.zIndex=0,this.name=t?.name,this.tag=t?.tag??NaN,this.zIndex=t?.zIndex??0,(t?.debugDirty??Y._debugEnabled)&&(this._debugDirtyProperties=new Map([["__first__",[]]]))}static toSVG(t,n,i){const s=t?.toSVG();if(s==null||!s.elements.length&&!s.defs?.length)return;const r=(0,import_ag_charts_core2.createSvgElement)("svg");if(r.setAttribute("width",String(n)),r.setAttribute("height",String(i)),r.setAttribute("viewBox",`0 0 ${n} ${i}`),s.defs?.length){const a=(0,import_ag_charts_core2.createSvgElement)("defs");a.append(...s.defs),r.append(a)}return r.append(...s.elements),r.outerHTML}static*extractBBoxes(t,n){for(const i of t)if(!n||i.visible&&!i.transitionOut){const s=i.getBBox();s&&(yield s)}}get datum(){return this._datum}set datum(t){this._datum!==t&&(this._previousDatum=this._datum,this._datum=t)}get previousDatum(){return this._previousDatum}get layerManager(){return this._layerManager}get dirty(){return this._dirty}closestDatum(){for(const{datum:t}of this.traverseUp(!0))if(t!=null)return t}preRender(t,n=1){this.childNodeCounts.groups=0,this.childNodeCounts.nonGroups=1,this.childNodeCounts.complexity=n,this.childNodeCounts.thisComplexity=n;for(const i of this.children()){const s=i.preRender(t);this.childNodeCounts.groups+=s.groups,this.childNodeCounts.nonGroups+=s.nonGroups,this.childNodeCounts.complexity+=s.complexity}return this.childNodeCounts}render(t){const{stats:n}=t;if(this._dirty=!1,this.debugDirtyProperties(),t.debugNodeSearch){const i=this.name??this.id;t.debugNodeSearch.some(s=>typeof s=="string"?s===i:s.test(i))&&(t.debugNodes[this.name??this.id]=this)}n&&(n.nodesRendered++,n.opsPerformed+=this.childNodeCounts.thisComplexity)}_setLayerManager(t){this._layerManager=t,this._debug=t?.debug;for(const n of this.children())n._setLayerManager(t)}sortChildren(t){if(this.dirtyZIndex=!1,!this.childNodes)return;const n=[...this.childNodes].sort(t);this.childNodes.clear();for(const i of n)this.childNodes.add(i)}*traverseUp(t){let n=this;for(t&&(yield n);n=n.parentNode;)yield n}*children(){if(this.childNodes)for(const t of this.childNodes)yield t}*descendants(){for(const t of this.children())yield t,yield*t.descendants()}isLeaf(){return!this.childNodes?.size}isRoot(){return!this.parentNode}append(t){this.childNodes??(this.childNodes=new Set);for(const n of(0,import_ag_charts_core2.toIterable)(t))n.parentNode?.removeChild(n),this.childNodes.add(n),n.parentNode=this,n._setLayerManager(this.layerManager);this.invalidateCachedBBox(),this.dirtyZIndex=!0,this.markDirty()}appendChild(t){return this.append(t),t}removeChild(t){if(!this.childNodes?.delete(t))throw new Error(`AG Charts - internal error, unknown child node ${t.name??t.id} in $${this.name??this.id}`);delete t.parentNode,t._setLayerManager(),this.invalidateCachedBBox(),this.dirtyZIndex=!0,this.markDirty()}remove(){this.parentNode?.removeChild(this)}clear(){for(const t of this.children())delete t.parentNode,t._setLayerManager();this.childNodes?.clear(),this.invalidateCachedBBox()}destroy(){this.parentNode?.removeChild(this)}setProperties(t,n){if(n)for(const i of n)this[i]=t[i];else Object.assign(this,t);return this}containsPoint(t,n){return!1}pickNode(t,n){if(!(!this.visible||this.pointerEvents===1||!this.containsPoint(t,n))){if(this.childNodes!=null&&this.childNodes.size!==0){const i=[...this.children()];for(let s=i.length-1;s>=0;s--){const r=i[s].pickNode(t,n);if(r)return r}}else if(!this.isContainerNode)return this}}pickNodes(t,n,i=[]){if(!this.visible||this.pointerEvents===1||!this.containsPoint(t,n))return i;this.isContainerNode||i.push(this);for(const s of this.children())s.pickNodes(t,n,i);return i}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(t){const{_dirty:n}=this;t!=null&&this._debugDirtyProperties&&this.markDebugProperties(t),!(this.cachedBBox==null&&n)&&(this.invalidateCachedBBox(),this._dirty=!0,this.parentNode&&this.parentNode.markDirty())}markClean(){if(this._dirty){this._dirty=!1,this.debugDirtyProperties();for(const t of this.children())t.markClean()}}markDebugProperties(t){const n=this._debugDirtyProperties?.get(t)??[],i=new Error().stack?.split(`
`).filter(s=>s!=="Error"&&!s.includes(".markDebugProperties")&&!s.includes(".markDirty")&&!s.includes("Object.assign ")&&!s.includes(`${this.constructor.name}.`))??"unknown";n.push(i[0].replace(" at ","").trim()),this._debugDirtyProperties?.set(t,n)}debugDirtyProperties(){this._debugDirtyProperties!=null&&(this._debugDirtyProperties.has("__first__")||this._debugDirtyProperties.forEach((t,n)=>{t.length>1&&(console.groupCollapsed(`Property changed multiple times before render: ${this.constructor.name}.${n} (${t.length}x)`),t.forEach(i=>console.log(i)),console.groupEnd())}),this._debugDirtyProperties.clear())}onZIndexChange(){const{parentNode:t}=this;t&&(t.dirtyZIndex=!0)}toSVG(){}};_Node._nextSerialNumber=0,_Node._debugEnabled=!1,__decorateClass([SceneChangeDetection()],_Node.prototype,"visible",2),__decorateClass([SceneChangeDetection({changeCb:e=>e.onZIndexChange()})],_Node.prototype,"zIndex",2);var Node=_Node,import_ag_charts_core20=require("ag-charts-core");function createCanvasContext(e=0,t=0){return new OffscreenCanvas(e,t).getContext("2d")}var LRUCache=class{constructor(e=5){this.maxCacheSize=e,this.store=new Map}get(e){if(!this.store.has(e))return;const t=this.store.get(e);return this.store.delete(e),this.store.set(e,t),t}has(e){return this.store.has(e)}set(e,t){if(this.store.set(e,t),this.store.size>this.maxCacheSize){const n=this.store.keys();let i=this.store.size-this.maxCacheSize;for(;i>0;){const s=n.next();s.done||this.store.delete(s.value),i--}}return t}clear(){this.store.clear()}},CachedTextMeasurerPool=class{static measureText(e,t){return this.getMeasurer(t).measureText(e)}static measureLines(e,t){return this.getMeasurer(t).measureLines(e)}static getMeasurer(e){const t=typeof e.font=="string"?e.font:TextUtils.toFontString(e.font),n=`${t}-${e.textAlign??"start"}-${e.textBaseline??"alphabetic"}`;return this.instanceMap.get(n)??this.createFontMeasurer(t,e,n)}static createFontMeasurer(e,t,n){const i=createCanvasContext();i.font=e,i.textAlign=t.textAlign??"start",i.textBaseline=t.textBaseline??"alphabetic";const s=new CachedTextMeasurer(i,t);return this.instanceMap.set(n,s),s}};CachedTextMeasurerPool.instanceMap=new LRUCache(10);var CachedTextMeasurer=class{constructor(e,t){this.ctx=e,this.measureMap=new LRUCache(100),t.textAlign&&(e.textAlign=t.textAlign),t.textBaseline&&(e.textBaseline=t.textBaseline),e.font=typeof t.font=="string"?t.font:TextUtils.toFontString(t.font),this.textMeasurer=new SimpleTextMeasurer(n=>this.cachedCtxMeasureText(n),t.textBaseline??"alphabetic")}textWidth(e,t){return this.textMeasurer.textWidth(e,t)}measureText(e){return this.textMeasurer.measureText(e)}measureLines(e){return this.textMeasurer.measureLines(e)}cachedCtxMeasureText(e){if(!this.measureMap.has(e)){const t=this.ctx.measureText(e);this.measureMap.set(e,{actualBoundingBoxAscent:t.actualBoundingBoxAscent,emHeightAscent:t.emHeightAscent,emHeightDescent:t.emHeightDescent,actualBoundingBoxDescent:t.actualBoundingBoxDescent,actualBoundingBoxLeft:t.actualBoundingBoxLeft,actualBoundingBoxRight:t.actualBoundingBoxRight,alphabeticBaseline:t.alphabeticBaseline,fontBoundingBoxAscent:t.fontBoundingBoxAscent,fontBoundingBoxDescent:t.fontBoundingBoxDescent,hangingBaseline:t.hangingBaseline,ideographicBaseline:t.ideographicBaseline,width:t.width})}return this.measureMap.get(e)}},TextUtils=class{static toFontString({fontSize:e=10,fontStyle:t,fontWeight:n,fontFamily:i,lineHeight:s}){let r="";return t&&(r+=`${t} `),n&&(r+=`${n} `),r+=`${e}px`,s&&(r+=`/${s}px`),r+=` ${i}`,r.trim()}static getLineHeight(e){return Math.ceil(e*this.defaultLineHeight)}static getVerticalModifier(e){switch(e){case"hanging":case"top":return 0;case"middle":return .5;case"alphabetic":case"bottom":case"ideographic":default:return 1}}};TextUtils.EllipsisChar="\u2026",TextUtils.defaultLineHeight=1.15,TextUtils.lineSplitter=/\r?\n/g;var SimpleTextMeasurer=class{constructor(e,t="alphabetic"){this.measureTextFn=e,this.textBaseline=t,this.charMap=new Map}getMetrics(e){const t=this.measureTextFn(e);return t.fontBoundingBoxAscent??(t.fontBoundingBoxAscent=t.emHeightAscent),t.fontBoundingBoxDescent??(t.fontBoundingBoxDescent=t.emHeightDescent),{width:t.width,height:t.actualBoundingBoxAscent+t.actualBoundingBoxDescent,lineHeight:t.fontBoundingBoxAscent+t.fontBoundingBoxDescent,offsetTop:t.actualBoundingBoxAscent,offsetLeft:t.actualBoundingBoxLeft}}getMultilineMetrics(e){let t=0,n=0,i=0,s=0,r=0;const a=TextUtils.getVerticalModifier(this.textBaseline),c=[];let o=0;const h=e.length;for(const l of e){const u=this.measureTextFn(l);u.fontBoundingBoxAscent??(u.fontBoundingBoxAscent=u.emHeightAscent),u.fontBoundingBoxDescent??(u.fontBoundingBoxDescent=u.emHeightDescent),t<u.width&&(t=u.width),s<u.actualBoundingBoxLeft&&(s=u.actualBoundingBoxLeft),o===0?(n+=u.actualBoundingBoxAscent,i+=u.actualBoundingBoxAscent):r+=u.fontBoundingBoxAscent,o===h-1?n+=u.actualBoundingBoxDescent:r+=u.fontBoundingBoxDescent,c.push({text:l,width:u.width,height:u.actualBoundingBoxAscent+u.actualBoundingBoxDescent,lineHeight:u.fontBoundingBoxAscent+u.fontBoundingBoxDescent,offsetTop:u.actualBoundingBoxAscent,offsetLeft:u.actualBoundingBoxLeft}),o++}return n+=r,i+=r*a,{width:t,height:n,offsetTop:i,offsetLeft:s,lineMetrics:c}}textWidth(e,t){if(t){let n=0;for(let i=0;i<e.length;i++)n+=this.textWidth(e.charAt(i));return n}return e.length>1?this.measureTextFn(e).width:this.charMap.get(e)??this.charWidth(e)}measureText(e){return this.getMetrics(e)}measureLines(e){const t=typeof e=="string"?e.split(TextUtils.lineSplitter):e;return this.getMultilineMetrics(t)}charWidth(e){const{width:t}=this.measureTextFn(e);return this.charMap.set(e,t),t}},import_ag_charts_core4=require("ag-charts-core"),import_ag_charts_core3=require("ag-charts-core"),IDENTITY_MATRIX_ELEMENTS=[1,0,0,1,0,0],Matrix=class W{get e(){return[...this.elements]}constructor(t=IDENTITY_MATRIX_ELEMENTS){this.elements=[...t]}setElements(t){const n=this.elements;return n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=t[3],n[4]=t[4],n[5]=t[5],this}get identity(){const t=this.elements;return(0,import_ag_charts_core3.isNumberEqual)(t[0],1)&&(0,import_ag_charts_core3.isNumberEqual)(t[1],0)&&(0,import_ag_charts_core3.isNumberEqual)(t[2],0)&&(0,import_ag_charts_core3.isNumberEqual)(t[3],1)&&(0,import_ag_charts_core3.isNumberEqual)(t[4],0)&&(0,import_ag_charts_core3.isNumberEqual)(t[5],0)}AxB(t,n,i){const s=t[0]*n[0]+t[2]*n[1],r=t[1]*n[0]+t[3]*n[1],a=t[0]*n[2]+t[2]*n[3],c=t[1]*n[2]+t[3]*n[3],o=t[0]*n[4]+t[2]*n[5]+t[4],h=t[1]*n[4]+t[3]*n[5]+t[5];i=i??t,i[0]=s,i[1]=r,i[2]=a,i[3]=c,i[4]=o,i[5]=h}multiplySelf(t){return this.AxB(this.elements,t.elements),this}multiply(t){const n=new Array(6);return t instanceof W?this.AxB(this.elements,t.elements,n):this.AxB(this.elements,[t.a,t.b,t.c,t.d,t.e,t.f],n),new W(n)}preMultiplySelf(t){return this.AxB(t.elements,this.elements,this.elements),this}inverse(){const t=this.elements;let n=t[0],i=t[1],s=t[2],r=t[3];const a=t[4],c=t[5],o=1/(n*r-i*s);return n*=o,i*=o,s*=o,r*=o,new W([r,-i,-s,n,s*c-r*a,i*a-n*c])}invertSelf(){const t=this.elements;let n=t[0],i=t[1],s=t[2],r=t[3];const a=t[4],c=t[5],o=1/(n*r-i*s);return n*=o,i*=o,s*=o,r*=o,t[0]=r,t[1]=-i,t[2]=-s,t[3]=n,t[4]=s*c-r*a,t[5]=i*a-n*c,this}transformPoint(t,n){const i=this.elements;return{x:t*i[0]+n*i[2]+i[4],y:t*i[1]+n*i[3]+i[5]}}transformBBox(t,n){const i=this.elements,s=i[0],r=i[1],a=i[2],c=i[3],o=t.width*.5,h=t.height*.5,l=t.x+o,u=t.y+h,d=Math.abs(o*s)+Math.abs(h*a),f=Math.abs(o*r)+Math.abs(h*c);return n??(n=new BBox(0,0,0,0)),n.x=l*s+u*a+i[4]-d,n.y=l*r+u*c+i[5]-f,n.width=d+d,n.height=f+f,n}toContext(t){if(this.identity)return;const n=this.elements;t.transform(n[0],n[1],n[2],n[3],n[4],n[5])}static updateTransformMatrix(t,n,i,s,r,a,c){const o=n,h=i;let l,u;o===1&&h===1?(l=0,u=0):(l=c?.scalingCenterX??0,u=c?.scalingCenterY??0);const d=s,f=Math.cos(d),p=Math.sin(d);let m,g;d===0?(m=0,g=0):(m=c?.rotationCenterX??0,g=c?.rotationCenterY??0);const y=r,b=a,x=l*(1-o)-m,P=u*(1-h)-g;return t.setElements([f*o,p*o,-p*h,f*h,f*x-p*P+m+y,p*x+f*P+g+b]),t}};function isMatrixTransform(e){return isMatrixTransformType(e.constructor)}var MATRIX_TRANSFORM_TYPE=Symbol("isMatrixTransform");function isMatrixTransformType(e){return e[MATRIX_TRANSFORM_TYPE]===!0}function MatrixTransform(e){var t,n;const i=e;if(isMatrixTransformType(e))return e;const s=Symbol("matrix_combined_transform");class r extends i{constructor(){super(...arguments),this[n]=new Matrix,this._dirtyTransform=!0}markDirtyTransform(){this._dirtyTransform=!0,super.markDirty()}updateMatrix(c){}computeTransformMatrix(){this._dirtyTransform&&(this[s].setElements(IDENTITY_MATRIX_ELEMENTS),this.updateMatrix(this[s]),this._dirtyTransform=!1)}toParent(c){return this.computeTransformMatrix(),this[s].identity?c.clone():this[s].transformBBox(c)}toParentPoint(c,o){return this.computeTransformMatrix(),this[s].identity?{x:c,y:o}:this[s].transformPoint(c,o)}fromParent(c){return this.computeTransformMatrix(),this[s].identity?c.clone():this[s].inverse().transformBBox(c)}fromParentPoint(c,o){return this.computeTransformMatrix(),this[s].identity?{x:c,y:o}:this[s].inverse().transformPoint(c,o)}computeBBox(){const c=super.computeBBox();return c&&this.toParent(c)}computeBBoxWithoutTransforms(){return super.computeBBox()}pickNode(c,o){return{x:c,y:o}=this.fromParentPoint(c,o),super.pickNode(c,o)}pickNodes(c,o,h){return{x:c,y:o}=this.fromParentPoint(c,o),super.pickNodes(c,o,h)}render(c){this.computeTransformMatrix();const{ctx:o}=c,h=this[s];let l=!1;h.identity||(o.save(),l=!0,h.toContext(o)),super.render(c),l&&o.restore()}toSVG(){this.computeTransformMatrix();const c=super.toSVG(),o=this[s];if(o.identity||c==null)return c;const h=(0,import_ag_charts_core4.createSvgElement)("g");h.append(...c.elements);const[l,u,d,f,p,m]=o.e;return h.setAttribute("transform",`matrix(${l} ${u} ${d} ${f} ${p} ${m})`),{elements:[h],defs:c.defs}}}return t=MATRIX_TRANSFORM_TYPE,n=s,r[t]=!0,r}function Rotatable(e){var t;const n=e,i=Symbol("matrix_rotation");class s extends MatrixTransform(n){constructor(){super(...arguments),this[t]=new Matrix,this.rotationCenterX=null,this.rotationCenterY=null,this.rotation=0}updateMatrix(a){super.updateMatrix(a);const{rotation:c,rotationCenterX:o,rotationCenterY:h}=this;c!==0&&(Matrix.updateTransformMatrix(this[i],1,1,c,0,0,{rotationCenterX:o,rotationCenterY:h}),a.multiplySelf(this[i]))}}return t=i,__decorateClass([SceneChangeDetection({type:"transform"})],s.prototype,"rotationCenterX",2),__decorateClass([SceneChangeDetection({type:"transform"})],s.prototype,"rotationCenterY",2),__decorateClass([SceneChangeDetection({type:"transform"})],s.prototype,"rotation",2),s}function Scalable(e){var t;const n=e,i=Symbol("matrix_scale");class s extends MatrixTransform(n){constructor(){super(...arguments),this[t]=new Matrix,this.scalingX=1,this.scalingY=1,this.scalingCenterX=null,this.scalingCenterY=null}updateMatrix(a){super.updateMatrix(a);const{scalingX:c,scalingY:o,scalingCenterX:h,scalingCenterY:l}=this;c===1&&o===1||(Matrix.updateTransformMatrix(this[i],c,o,0,0,0,{scalingCenterX:h,scalingCenterY:l}),a.multiplySelf(this[i]))}}return t=i,__decorateClass([SceneChangeDetection({type:"transform"})],s.prototype,"scalingX",2),__decorateClass([SceneChangeDetection({type:"transform"})],s.prototype,"scalingY",2),__decorateClass([SceneChangeDetection({type:"transform"})],s.prototype,"scalingCenterX",2),__decorateClass([SceneChangeDetection({type:"transform"})],s.prototype,"scalingCenterY",2),s}function Translatable(e){var t;const n=e,i=Symbol("matrix_translation");class s extends MatrixTransform(n){constructor(){super(...arguments),this[t]=new Matrix,this.translationX=0,this.translationY=0}updateMatrix(a){super.updateMatrix(a);const{translationX:c,translationY:o}=this;c===0&&o===0||(Matrix.updateTransformMatrix(this[i],1,1,0,c,o),a.multiplySelf(this[i]))}}return t=i,__decorateClass([SceneChangeDetection({type:"transform"})],s.prototype,"translationX",2),__decorateClass([SceneChangeDetection({type:"transform"})],s.prototype,"translationY",2),s}var Transformable=class{static fromCanvas(e,t){const n=[];for(const i of e.traverseUp())isMatrixTransform(i)&&n.unshift(i);for(const i of n)t=i.fromParent(t);return isMatrixTransform(e)&&(t=e.fromParent(t)),t}static toCanvas(e,t){t==null?t=e.getBBox():isMatrixTransform(e)&&(t=e.toParent(t));for(const n of e.traverseUp())isMatrixTransform(n)&&(t=n.toParent(t));return t}static fromCanvasPoint(e,t,n){const i=[];for(const s of e.traverseUp())isMatrixTransform(s)&&i.unshift(s);for(const s of i)({x:t,y:n}=s.fromParentPoint(t,n));return isMatrixTransform(e)&&({x:t,y:n}=e.fromParentPoint(t,n)),{x:t,y:n}}static toCanvasPoint(e,t,n){isMatrixTransform(e)&&({x:t,y:n}=e.toParentPoint(t,n));for(const i of e.traverseUp())isMatrixTransform(i)&&({x:t,y:n}=i.toParentPoint(t,n));return{x:t,y:n}}},import_ag_charts_core19=require("ag-charts-core"),import_ag_charts_core5=require("ag-charts-core"),BREAK_TRANSFORM_CHAIN=Symbol("BREAK"),CONFIG_KEY="__decorator_config";function addFakeTransformToInstanceProperty(e,t){initialiseConfig(e,t).optional=!0}function initialiseConfig(e,t){Object.getOwnPropertyDescriptor(e,CONFIG_KEY)==null&&Object.defineProperty(e,CONFIG_KEY,{value:{}});const n=e[CONFIG_KEY],i=t.toString();if(typeof n[i]<"u")return n[i];const s=new WeakMap;n[i]={setters:[],getters:[],observers:[],valuesMap:s};const r=Object.getOwnPropertyDescriptor(e,t),a=r?.set,c=r?.get;return Object.defineProperty(e,t,{set:function(l){const{setters:u,observers:d}=n[i];let f;u.some(p=>p.length>2)&&(f=c?c.call(this):s.get(this));for(const p of u)if(l=p(this,t,l,f),l===BREAK_TRANSFORM_CHAIN)return;a?a.call(this,l):s.set(this,l);for(const p of d)p(this,l,f)},get:function(){let l=c?c.call(this):s.get(this);for(const u of n[i].getters)if(l=u(this,t,l),l===BREAK_TRANSFORM_CHAIN)return;return l},enumerable:!0,configurable:!1}),n[i]}function addTransformToInstanceProperty(e,t,n){return(i,s)=>{const r=initialiseConfig(i,s);r.setters.push(e),t&&r.getters.unshift(t),n&&Object.assign(r,n)}}function addObserverToInstanceProperty(e){return(t,n)=>{initialiseConfig(t,n).observers.push(e)}}function isDecoratedObject(e){return typeof e<"u"&&CONFIG_KEY in e}function listDecoratedProperties(e){const t=new Set;for(;isDecoratedObject(e);)t.add(e?.[CONFIG_KEY]),e=Object.getPrototypeOf(e);return Array.from(t).flatMap(n=>Object.keys(n))}function extractDecoratedPropertyMetadata(e,t){const n=t.toString();for(;isDecoratedObject(e);){const i=e[CONFIG_KEY];if(Object.hasOwn(i,n))return i[n];e=Object.getPrototypeOf(e)}}function objectsEqual(e,t){return Array.isArray(e)?!Array.isArray(t)||e.length!==t.length?!1:e.every((n,i)=>objectsEqual(n,t[i])):(0,import_ag_charts_core5.isPlainObject)(e)?(0,import_ag_charts_core5.isPlainObject)(t)?objectsEqualWith(e,t,objectsEqual):!1:e===t}function objectsEqualWith(e,t,n){for(const i of Object.keys(t))if(!(i in e))return!1;for(const i of Object.keys(e))if(!(i in t)||!n(e[i],t[i]))return!1;return!0}function merge(...e){const t={};for(const n of e){if(!(0,import_ag_charts_core5.isObject)(n))continue;const i=isDecoratedObject(n)?listDecoratedProperties(n):Object.keys(n);for(const s of i)(0,import_ag_charts_core5.isPlainObject)(t[s])&&(0,import_ag_charts_core5.isPlainObject)(n[s])?t[s]=merge(t[s],n[s]):s in t||(t[s]??(t[s]=n[s]))}return t}var import_ag_charts_core9=require("ag-charts-core"),twoPi=Math.PI*2,halfPi=Math.PI/2;function normalizeAngle360(e){return e%=twoPi,e+=twoPi,e%=twoPi,e}function normalizeAngle180(e){return e%=twoPi,e<-Math.PI?e+=twoPi:e>=Math.PI&&(e-=twoPi),e}function isBetweenAngles(e,t,n){const i=normalizeAngle360(e),s=normalizeAngle360(t),r=normalizeAngle360(n);return s<r?s<=i&&i<=r:s>r?s<=i||i<=r:!0}function toRadians(e){return e/180*Math.PI}function angleBetween(e,t){return e=normalizeAngle360(e),t=normalizeAngle360(t),t-e+(e>t?twoPi:0)}var import_ag_charts_core8=require("ag-charts-core"),import_ag_charts_core7=require("ag-charts-core"),import_ag_charts_core6=require("ag-charts-core"),lerp=(e,t,n)=>e*(1-n)+t*n,srgbToLinear=e=>{const t=e<0?-1:1,n=Math.abs(e);return n<=.04045?e/12.92:t*((n+.055)/1.055)**2.4},srgbFromLinear=e=>{const t=e<0?-1:1,n=Math.abs(e);return n>.0031308?t*(1.055*n**(1/2.4)-.055):12.92*e},_Color=class k{constructor(t,n,i,s=1){this.r=(0,import_ag_charts_core6.clamp)(0,t||0,1),this.g=(0,import_ag_charts_core6.clamp)(0,n||0,1),this.b=(0,import_ag_charts_core6.clamp)(0,i||0,1),this.a=(0,import_ag_charts_core6.clamp)(0,s||0,1)}static validColorString(t){return t.indexOf("#")>=0?!!k.parseHex(t):t.indexOf("rgb")>=0?!!k.stringToRgba(t):k.nameToHex.has(t.toLowerCase())}static fromString(t){if(t.indexOf("#")>=0)return k.fromHexString(t);const n=k.nameToHex.get(t.toLowerCase());if(n)return k.fromHexString(n);if(t.indexOf("rgb")>=0)return k.fromRgbaString(t);throw new Error(`Invalid color string: '${t}'`)}static parseHex(t){t=t.replace(/ /g,"").slice(1);let n;switch(t.length){case 6:case 8:n=[];for(let i=0;i<t.length;i+=2)n.push(parseInt(`${t[i]}${t[i+1]}`,16));break;case 3:case 4:n=t.split("").map(i=>parseInt(i,16)).map(i=>i+i*16);break}if(n?.length>=3&&n.every(i=>i>=0))return n.length===3&&n.push(255),n}static fromHexString(t){const n=k.parseHex(t);if(n){const[i,s,r,a]=n;return new k(i/255,s/255,r/255,a/255)}throw new Error(`Malformed hexadecimal color string: '${t}'`)}static stringToRgba(t){let n=-1,i=-1;for(let c=0;c<t.length;c++){const o=t[c];if(n===-1&&o==="(")n=c;else if(o===")"){i=c;break}}if(n===-1||i===-1)return;const r=t.substring(n+1,i).split(","),a=[];for(let c=0;c<r.length;c++){const o=r[c];let h=parseFloat(o);if(!Number.isFinite(h))return;o.indexOf("%")>=0?(h=(0,import_ag_charts_core6.clamp)(0,h,100),h/=100):c===3?h=(0,import_ag_charts_core6.clamp)(0,h,1):(h=(0,import_ag_charts_core6.clamp)(0,h,255),h/=255),a.push(h)}return a}static fromRgbaString(t){const n=k.stringToRgba(t);if(n){if(n.length===3)return new k(n[0],n[1],n[2]);if(n.length===4)return new k(n[0],n[1],n[2],n[3])}throw new Error(`Malformed rgb/rgba color string: '${t}'`)}static fromArray(t){if(t.length===4)return new k(t[0],t[1],t[2],t[3]);if(t.length===3)return new k(t[0],t[1],t[2]);throw new Error("The given array should contain 3 or 4 color components (numbers).")}static fromHSB(t,n,i,s=1){const r=k.HSBtoRGB(t,n,i);return new k(r[0],r[1],r[2],s)}static fromHSL(t,n,i,s=1){const r=k.HSLtoRGB(t,n,i);return new k(r[0],r[1],r[2],s)}static fromOKLCH(t,n,i,s=1){const r=k.OKLCHtoRGB(t,n,i);return new k(r[0],r[1],r[2],s)}static padHex(t){return t.length===1?"0"+t:t}toHexString(){let t="#"+k.padHex(Math.round(this.r*255).toString(16))+k.padHex(Math.round(this.g*255).toString(16))+k.padHex(Math.round(this.b*255).toString(16));return this.a<1&&(t+=k.padHex(Math.round(this.a*255).toString(16))),t}toRgbaString(t=3){const n=[Math.round(this.r*255),Math.round(this.g*255),Math.round(this.b*255)],i=Math.pow(10,t);return this.a!==1?(n.push(Math.round(this.a*i)/i),`rgba(${n.join(", ")})`):`rgb(${n.join(", ")})`}toString(){return this.a===1?this.toHexString():this.toRgbaString()}toHSB(){return k.RGBtoHSB(this.r,this.g,this.b)}static RGBtoOKLCH(t,n,i){const s=srgbToLinear(t),r=srgbToLinear(n),a=srgbToLinear(i),c=Math.cbrt(.4122214708*s+.5363325363*r+.0514459929*a),o=Math.cbrt(.2119034982*s+.6806995451*r+.1073969566*a),h=Math.cbrt(.0883024619*s+.2817188376*r+.6299787005*a),l=.2104542553*c+.793617785*o-.0040720468*h,u=1.9779984951*c-2.428592205*o+.4505937099*h,d=.0259040371*c+.7827717662*o-.808675766*h,f=Math.atan2(d,u)*180/Math.PI,p=l,m=Math.hypot(u,d),g=f>=0?f:f+360;return[p,m,g]}static OKLCHtoRGB(t,n,i){const s=t,r=n*Math.cos(i*Math.PI/180),a=n*Math.sin(i*Math.PI/180),c=(s+.3963377774*r+.2158037573*a)**3,o=(s-.1055613458*r-.0638541728*a)**3,h=(s-.0894841775*r-1.291485548*a)**3,l=4.0767416621*c-3.3077115913*o+.2309699292*h,u=-1.2684380046*c+2.6097574011*o-.3413193965*h,d=-.0041960863*c-.7034186147*o+1.707614701*h,f=srgbFromLinear(l),p=srgbFromLinear(u),m=srgbFromLinear(d);return[f,p,m]}static RGBtoHSL(t,n,i){const s=Math.min(t,n,i),r=Math.max(t,n,i),a=(r+s)/2;let c,o;if(r===s)c=0,o=0;else{const h=r-s;o=a>.5?h/(2-r-s):h/(r+s),r===t?c=(n-i)/h+(n<i?6:0):r===n?c=(i-t)/h+2:c=(t-n)/h+4,c*=360/6}return[c,o,a]}static HSLtoRGB(t,n,i){if(t=(t%360+360)%360,n===0)return[i,i,i];const s=i<.5?i*(1+n):i+n-i*n,r=2*i-s;function a(l){return l<0&&(l+=1),l>1&&(l-=1),l<1/6?r+(s-r)*6*l:l<1/2?s:l<2/3?r+(s-r)*(2/3-l)*6:r}const c=a(t/360+1/3),o=a(t/360),h=a(t/360-1/3);return[c,o,h]}static RGBtoHSB(t,n,i){const s=Math.min(t,n,i),r=Math.max(t,n,i),a=r===0?0:(r-s)/r;let c=0;if(s!==r){const o=r-s,h=(r-t)/o,l=(r-n)/o,u=(r-i)/o;t===r?c=u-l:n===r?c=2+h-u:c=4+l-h,c/=6,c<0&&(c=c+1)}return[c*360,a,r]}static HSBtoRGB(t,n,i){t=(t%360+360)%360/360;let s=0,r=0,a=0;if(n===0)s=r=a=i;else{const c=(t-Math.floor(t))*6,o=c-Math.floor(c),h=i*(1-n),l=i*(1-n*o),u=i*(1-n*(1-o));switch(c>>0){case 0:s=i,r=u,a=h;break;case 1:s=l,r=i,a=h;break;case 2:s=h,r=i,a=u;break;case 3:s=h,r=l,a=i;break;case 4:s=u,r=h,a=i;break;case 5:s=i,r=h,a=l;break}}return[s,r,a]}static mix(t,n,i){return new k(lerp(t.r,n.r,i),lerp(t.g,n.g,i),lerp(t.b,n.b,i),lerp(t.a,n.a,i))}static lighten(t,n){const i=k.RGBtoOKLCH(t.r,t.g,t.b);return k.fromOKLCH((0,import_ag_charts_core6.clamp)(0,i[0]+n,1),i[1],i[2])}static darken(t,n){const i=k.RGBtoOKLCH(t.r,t.g,t.b);return k.fromOKLCH((0,import_ag_charts_core6.clamp)(0,i[0]-n,1),i[1],i[2])}static interpolate(t,n){const i=1/(t.length-1),s=t.map(r=>k.RGBtoOKLCH(r.r,r.g,r.b));return Array.from({length:n},(r,a)=>{const c=a/(n-1),o=t.length<=2?0:Math.min(Math.floor(c*(t.length-1)),t.length-2),h=(c-o*i)/i,l=s[o],u=s[o+1];return k.fromOKLCH(lerp(l[0],u[0],h),lerp(l[1],u[1],h),lerp(l[2],u[2],h))})}};_Color.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"]]);var Color=_Color,AbstractScale=class{ticks(e,t,n){}niceDomain(e,t=this.domain){return t}tickFormatter(e){}datumFormatter(e){}get bandwidth(){}get step(){}get inset(){}},Invalidating=(e,t)=>{const n=Symbol(String(t));e[n]=void 0,Object.defineProperty(e,t,{get(){return this[n]},set(i){this[n]!==i&&(this[n]=i,this.invalid=!0)},enumerable:!0,configurable:!1})},convertColorStringToOklcha=e=>{const t=Color.fromString(e),[n,i,s]=Color.RGBtoOKLCH(t.r,t.g,t.b);return{l:n,c:i,h:s,a:t.a}},delta=1e-6,isAchromatic=e=>e.c<delta||e.l<delta||e.l>1-delta,interpolateOklch=(e,t,n)=>{n=(0,import_ag_charts_core7.clamp)(0,n,1);let i;if(isAchromatic(e))i=t.h;else if(isAchromatic(t))i=e.h;else{const c=e.h;let o=t.h;const h=t.h-e.h;h>180?o-=360:h<-180&&(o+=360),i=c*(1-n)+o*n}const s=e.c*(1-n)+t.c*n,r=e.l*(1-n)+t.l*n,a=e.a*(1-n)+t.a*n;return Color.fromOKLCH(r,s,i,a)},ColorScale=class extends AbstractScale{constructor(){super(...arguments),this.type="color",this.invalid=!0,this.domain=[0,1],this.range=["red","blue"],this.parsedRange=this.range.map(convertColorStringToOklcha)}update(){const{domain:e,range:t}=this;e.length<2&&(import_ag_charts_core7.Logger.warnOnce("`colorDomain` should have at least 2 values."),e.length===0?e.push(0,1):e.length===1&&e.push(e[0]+1));for(let n=1;n<e.length;n++){const i=e[n-1],s=e[n];if(i>=s){import_ag_charts_core7.Logger.warnOnce("`colorDomain` values should be supplied in ascending order."),e.sort((r,a)=>r-a);break}}if(t.length<e.length)for(let n=t.length;n<e.length;n++)t.push(t.length>0?t[0]:"black");this.parsedRange=this.range.map(convertColorStringToOklcha)}normalizeDomains(...e){return{domain:e.flat(),animatable:!0}}toDomain(){}convert(e){this.refresh();const{domain:t,range:n,parsedRange:i}=this,s=t[0],r=t.at(-1),a=n[0],c=n[n.length-1];if(e<=s)return a;if(e>=r)return c;let o,h;if(t.length===2){const d=(e-s)/(r-s),f=1/(n.length-1);o=n.length<=2?0:Math.min(Math.floor(d*(n.length-1)),n.length-2),h=(d-o*f)/f}else{for(o=0;o<t.length-2&&!(e<t[o+1]);o++);const d=t[o],f=t[o+1];h=(e-d)/(f-d)}const l=i[o],u=i[o+1];return interpolateOklch(l,u,h).toRgbaString()}invert(){}refresh(){this.invalid&&(this.invalid=!1,this.update(),this.invalid&&import_ag_charts_core7.Logger.warnOnce("Expected update to not invalidate scale"))}};__decorateClass([Invalidating],ColorScale.prototype,"domain",2),__decorateClass([Invalidating],ColorScale.prototype,"range",2);var Gradient=class{constructor(e,t=[],n){this.colorSpace=e,this.stops=t,this.bbox=n,this._cache=void 0}createGradient(e,t,n){const i=this.bbox??t;if(isNaN(i.x)||isNaN(i.y))return;if(this._cache!=null&&this._cache.ctx===e&&this._cache.bbox.equals(i))return this._cache.gradient;const{stops:s,colorSpace:r}=this;if(s.length===0)return;if(s.length===1)return s[0].color;let a=this.createCanvasGradient(e,i,n);if(a==null)return;const c=r==="oklch",o=.05;let h=s[0];a.addColorStop(h.stop,h.color);for(let l=1;l<s.length;l+=1){const u=s[l];if(c){const d=new ColorScale;d.domain=[h.stop,u.stop],d.range=[h.color,u.color];for(let f=h.stop+o;f<u.stop;f+=o)a.addColorStop(f,d.convert(f))}a.addColorStop(u.stop,u.color),h=u}return"createPattern"in a&&(a=a.createPattern()),this._cache={ctx:e,bbox:i,gradient:a},a}toSvg(e){const t=this.bbox??e,n=this.createSvgGradient(t);return this.stops.forEach(({stop:i,color:s})=>{const r=(0,import_ag_charts_core8.createSvgElement)("stop");r.setAttribute("offset",`${i}`),r.setAttribute("stop-color",`${s}`),n.appendChild(r)}),n}},ConicGradient=class extends Gradient{constructor(e,t,n=0,i){super(e,t,i),this.angle=n}createCanvasGradient(e,t,n){const{angle:s}=this,r=normalizeAngle360(toRadians(s+-90)),a=n?.centerX??t.x+t.width*.5,c=n?.centerY??t.y+t.height*.5;return e.createConicGradient(r,a,c)}createSvgGradient(e){return(0,import_ag_charts_core9.createSvgElement)("linearGradient")}},import_ag_charts_core10=require("ag-charts-core"),LinearGradient=class extends Gradient{constructor(e,t,n=0,i){super(e,t,i),this.angle=n}getGradientPoints(e){const{angle:n}=this,i=normalizeAngle360(toRadians(n+90)),s=Math.cos(i),r=Math.sin(i),a=e.width,c=e.height,o=e.x+a*.5,h=e.y+c*.5,l=Math.sqrt(c*c+a*a)/2,u=Math.atan2(c,a);let d;i<Math.PI/2?d=i:i<Math.PI?d=Math.PI-i:i<1.5*Math.PI?d=i-Math.PI:d=2*Math.PI-i;const f=l*Math.abs(Math.cos(d-u));return{x0:o+s*f,y0:h+r*f,x1:o-s*f,y1:h-r*f}}createCanvasGradient(e,t){const{x0:n,y0:i,x1:s,y1:r}=this.getGradientPoints(t);return e.createLinearGradient(n,i,s,r)}createSvgGradient(e){const{x0:t,y0:n,x1:i,y1:s}=this.getGradientPoints(e),r=(0,import_ag_charts_core10.createSvgElement)("linearGradient");return r.setAttribute("x1",String(t)),r.setAttribute("y1",String(n)),r.setAttribute("x2",String(i)),r.setAttribute("y2",String(s)),r.setAttribute("gradientUnits","userSpaceOnUse"),r}},import_ag_charts_core11=require("ag-charts-core"),RadialGradient=class extends Gradient{constructor(e,t,n){super(e,t,n)}createCanvasGradient(e,t,n){const i=n?.centerX??t.x+t.width*.5,s=n?.centerY??t.y+t.height*.5,r=n?.innerRadius??0,a=n?.outerRadius??Math.hypot(t.width*.5,t.height*.5)/Math.SQRT2;return e.createRadialGradient(i,s,r,i,s,a)}createSvgGradient(e){const t=e.x+e.width*.5,n=e.y+e.height*.5,i=(0,import_ag_charts_core11.createSvgElement)("radialGradient");return i.setAttribute("cx",String(t)),i.setAttribute("cy",String(n)),i.setAttribute("r",String(Math.hypot(e.width*.5,e.height*.5)/Math.SQRT2)),i.setAttribute("gradientUnits","userSpaceOnUse"),i}},import_ag_charts_core14=require("ag-charts-core"),import_ag_charts_core12=require("ag-charts-core"),BaseProperties=class{handleUnknownProperties(e,t){}set(e){const{className:t=this.constructor.name}=this.constructor;if(typeof e!="object")return import_ag_charts_core12.Logger.warn(`unable to set ${t} - expecting a properties object`),this;const n=new Set(Object.keys(e));for(const i of listDecoratedProperties(this))if(n.has(i)){const s=e[i],r=this;if(isProperties(r[i]))if(r[i]instanceof PropertiesArray){const a=r[i].reset(s);a!=null?r[i]=a:import_ag_charts_core12.Logger.warn(`unable to set [${i}] - expecting a properties array`)}else r[i].set(s);else(0,import_ag_charts_core12.isPlainObject)(s)?r[i]=merge(s,r[i]??{}):r[i]=s;n.delete(i)}this.handleUnknownProperties(n,e);for(const i of n)import_ag_charts_core12.Logger.warn(`unable to set [${i}] in ${t} - property is unknown`);return this}isValid(e){return listDecoratedProperties(this).every(t=>{const n=extractDecoratedPropertyMetadata(this,t);if(n==null)return!0;const i=n.optional===!0||typeof this[t]<"u";return i||import_ag_charts_core12.Logger.warnOnce(`${e??""}[${t}] is required.`),i})}toJson(){return listDecoratedProperties(this).reduce((e,t)=>{const n=this[t];return e[t]=isProperties(n)?n.toJson():n,e},{})}},PropertiesArray=class it extends Array{constructor(t,...n){super(n.length);const s=(r=>!!r?.prototype?.constructor?.name)(t)?r=>new t().set(r):t;Object.defineProperty(this,"itemFactory",{value:s,enumerable:!1,configurable:!1}),this.set(n)}set(t){if((0,import_ag_charts_core12.isArray)(t)){this.length=t.length;for(let n=0;n<t.length;n++)this[n]=this.itemFactory(t[n])}return this}reset(t){if(Array.isArray(t))return new it(this.itemFactory,...t)}toJson(){return this.map(t=>t?.toJson?.()??t)}};function isProperties(e){return e instanceof BaseProperties||e instanceof PropertiesArray}var import_ag_charts_core13=require("ag-charts-core"),TestEnv=!1,TempValidate=TestEnv?(e,t={})=>{const{optional:n=!1}=t;return addTransformToInstanceProperty((i,s,r)=>{const a={...t,target:i,property:s};if(n&&typeof r>"u"||e(r,a)){if(isProperties(i[s])&&!isProperties(r))return i[s].set(r),i[s]}else{const c=(0,import_ag_charts_core13.stringifyValue)(r,50),o=String(s).replace(/^_*/,""),h=i.constructor.className??i.constructor.name.replace(/Properties$/,""),l=e.message?`; expecting ${getPredicateMessage(e,a)}`:"";import_ag_charts_core13.Logger.warn(`TempValidation!!! Property [${o}] of [${h}] cannot be set to [${c}]${l}, ignoring.`)}return r},void 0,{optional:n})}:()=>addFakeTransformToInstanceProperty,AND=(...e)=>{const t=[];return predicateWithMessage((n,i)=>(t.length=0,e.every(s=>{const r=s(n,i);return r||t.push(getPredicateMessage(s,i)),r})),()=>t.filter(Boolean).join(" AND "))},OR=(...e)=>predicateWithMessage((t,n)=>e.some(i=>i(t,n)),t=>e.map(getPredicateMessageMapper(t)).filter(Boolean).join(" OR ")),OBJECT=attachObjectRestrictions(predicateWithMessage((e,t)=>isProperties(e)||(0,import_ag_charts_core13.isObject)(e)&&isProperties(t.target[t.property]),"a properties object")),PLAIN_OBJECT=attachObjectRestrictions(predicateWithMessage(e=>(0,import_ag_charts_core13.isObject)(e),"an object")),BOOLEAN=predicateWithMessage(import_ag_charts_core13.isBoolean,"a boolean"),FUNCTION=predicateWithMessage(import_ag_charts_core13.isFunction,"a function"),STRING=predicateWithMessage(import_ag_charts_core13.isString,"a string"),NUMBER=attachNumberRestrictions(predicateWithMessage(import_ag_charts_core13.isFiniteNumber,"a number")),REAL_NUMBER=predicateWithMessage(e=>(0,import_ag_charts_core13.isNumber)(e)&&!isNaN(e),"a real number"),NAN=predicateWithMessage(e=>(0,import_ag_charts_core13.isNumber)(e)&&isNaN(e),"NaN"),POSITIVE_NUMBER=NUMBER.restrict({min:0}),RATIO=NUMBER.restrict({min:0,max:1}),NUMBER_OR_NAN=OR(NUMBER,NAN),ARRAY=attachArrayRestrictions(predicateWithMessage(import_ag_charts_core13.isArray,"an array")),ARRAY_OF=(e,t)=>predicateWithMessage((n,i)=>(0,import_ag_charts_core13.isArray)(n)&&n.every(s=>e(s,i)),n=>{const i=getPredicateMessage(ARRAY,n)??"";return typeof t=="function"?`${i} of ${t(n)}`:t?`${i} of ${t}`:i}),isComparable=e=>(0,import_ag_charts_core13.isFiniteNumber)(e)||(0,import_ag_charts_core13.isValidDate)(e),LESS_THAN=e=>predicateWithMessage((t,n)=>!isComparable(t)||!isComparable(n.target[e])||t<n.target[e],`to be less than ${e}`),GREATER_THAN=e=>predicateWithMessage((t,n)=>!isComparable(t)||!isComparable(n.target[e])||t>n.target[e],`to be greater than ${e}`),DATE=predicateWithMessage(import_ag_charts_core13.isValidDate,"Date object"),DATE_OR_DATETIME_MS=OR(DATE,POSITIVE_NUMBER),colorMessage="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",COLOR_STRING=predicateWithMessage(import_ag_charts_core13.isColor,`color string. ${colorMessage}`),COLOR_GRADIENT=attachObjectRestrictions(predicateWithMessage(e=>(0,import_ag_charts_core13.isObject)(e)&&e.type==="gradient","a color gradient object")),COLOR_PATTERN=attachObjectRestrictions(predicateWithMessage(e=>(0,import_ag_charts_core13.isObject)(e)&&e.type==="pattern","a color pattern object")),COLOR_STRING_ARRAY=predicateWithMessage(ARRAY_OF(COLOR_STRING),`color strings. ${colorMessage}`),BOOLEAN_ARRAY=ARRAY_OF(BOOLEAN,"boolean values"),NUMBER_ARRAY=ARRAY_OF(NUMBER,"numbers"),STRING_ARRAY=ARRAY_OF(STRING,"strings"),DATE_ARRAY=predicateWithMessage(ARRAY_OF(DATE),"Date objects"),OBJECT_ARRAY=predicateWithMessage(ARRAY_OF(OBJECT),"objects"),LINE_CAP=UNION(["butt","round","square"],"a line cap"),LINE_JOIN=UNION(["round","bevel","miter"],"a line join"),LINE_STYLE=UNION(["solid","dashed","dotted"],"a line style"),LINE_DASH=predicateWithMessage(ARRAY_OF(POSITIVE_NUMBER),"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."),POSITION=UNION(["top","right","bottom","left"],"a position"),FONT_STYLE=UNION(["normal","italic","oblique"],"a font style"),FONT_WEIGHT=OR(UNION(["normal","bold","bolder","lighter"],"a font weight"),NUMBER.restrict({min:1,max:1e3})),TEXT_WRAP=UNION(["never","always","hyphenate","on-space"],"a text wrap strategy"),TEXT_ALIGN=UNION(["left","center","right"],"a text align"),VERTICAL_ALIGN=UNION(["top","middle","bottom"],"a vertical align"),OVERFLOW_STRATEGY=UNION(["ellipsis","hide"],"an overflow strategy"),DIRECTION=UNION(["horizontal","vertical"],"a direction"),PLACEMENT=UNION(["inside","outside"],"a placement"),INTERACTION_RANGE=OR(UNION(["exact","nearest"],"interaction range"),NUMBER),LABEL_PLACEMENT=UNION(["top","bottom","left","right"]);function UNION(e,t="a"){return predicateWithMessage((n,i)=>{const s=e.find(r=>{const a=typeof r=="string"?r:r.value;return n===a});if(s==null)return!1;if(typeof s!="string"&&(s.deprecated===!0||s.deprecatedTo!=null)){const r=[`Property [%s] with value '${s.value}' is deprecated.`];s.deprecatedTo&&r.push(`Use ${s.deprecatedTo} instead.`),import_ag_charts_core13.Logger.warnOnce(r.join(" "),i.property)}return!0},`${t} keyword such as ${joinUnionOptions(e)}`)}var MIN_SPACING=OR(AND(NUMBER.restrict({min:1}),LESS_THAN("maxSpacing")),NAN),MAX_SPACING=OR(AND(NUMBER.restrict({min:1}),GREATER_THAN("minSpacing")),NAN);function predicateWithMessage(e,t){return e.message=t,e}function joinUnionOptions(e){const t=e.filter(i=>typeof i=="string"||i.undocumented!==!0).map(i=>`'${typeof i=="string"?i:i.value}'`);if(t.length===1)return t[0];const n=t.pop();return`${t.join(", ")} or ${n}`}function getPredicateMessage(e,t){return(0,import_ag_charts_core13.isFunction)(e.message)?e.message(t):e.message}function getPredicateMessageMapper(e){return t=>getPredicateMessage(t,e)}function attachArrayRestrictions(e){return Object.assign(e,{restrict({length:t,minLength:n}={}){let i="an array";return(0,import_ag_charts_core13.isNumber)(n)&&n>0?i="a non-empty array":(0,import_ag_charts_core13.isNumber)(t)&&(i=`an array of length ${t}`),predicateWithMessage(s=>(0,import_ag_charts_core13.isArray)(s)&&((0,import_ag_charts_core13.isNumber)(t)?s.length===t:!0)&&((0,import_ag_charts_core13.isNumber)(n)?s.length>=n:!0),i)}})}function attachNumberRestrictions(e){return Object.assign(e,{restrict({min:t,max:n}={}){const i=["a number"],s=(0,import_ag_charts_core13.isNumber)(t),r=(0,import_ag_charts_core13.isNumber)(n);return s&&r?i.push(`between ${t} and ${n} inclusive`):s?i.push(`greater than or equal to ${t}`):r&&i.push(`less than or equal to ${n}`),predicateWithMessage(a=>(0,import_ag_charts_core13.isFiniteNumber)(a)&&(s?a>=t:!0)&&(r?a<=n:!0),i.join(" "))}})}function attachObjectRestrictions(e){return Object.assign(e,{restrict(t){return predicateWithMessage(n=>n instanceof t,n=>getPredicateMessage(e,n)??`an instance of ${t.name}`)}})}var StopProperties=class extends BaseProperties{constructor(){super(...arguments),this.color="black"}};__decorateClass([TempValidate(NUMBER,{optional:!0})],StopProperties.prototype,"stop",2),__decorateClass([TempValidate(COLOR_STRING,{optional:!0})],StopProperties.prototype,"color",2);function stopsAreAscending(e){let t;for(const n of e)if(n?.stop!=null){if(t!=null&&n.stop<t)return!1;t=n.stop}return!0}function discreteColorStops(e){return e.flatMap((t,n)=>{const{stop:i}=t,s=e.at(n+1)?.color;return s!=null?[t,{stop:i,color:s}]:[t]})}function getDefaultColorStops(e,t){const n=t==="discrete"?1:0,i=e.map((s,r,{length:a})=>({stop:(r+n)/(a-1+n),color:s}));return t==="discrete"?discreteColorStops(i):i}function getColorStops(e,t,n,i="continuous"){const s=e.map(p=>typeof p=="string"?{color:p}:p);if(s.length===0)return getDefaultColorStops(t,i);if(!stopsAreAscending(s))return import_ag_charts_core14.Logger.warnOnce("[fills] must have the stops defined in ascending order"),[];const r=Math.min(...n),a=Math.max(...n),c=i==="discrete",o=new Float64Array(s.length);let h=0,l=-1;for(let p=0;p<s.length;p+=1){const m=s[p];if(p>=l){l=s.length-1;for(let y=p+1;y<s.length;y+=1)if(s[y]?.stop!=null){l=y;break}}let g=m?.stop;if(g==null){const y=s[h]?.stop,b=s[l]?.stop,x=y??r,P=b??a,S=c&&y==null?1:0;g=x+(P-x)*(p-h+S)/(l-h+S)}else h=p;o[p]=Math.max(0,Math.min(1,(g-r)/(a-r)))}let u=s.find(p=>p.color!=null)?.color,d;const f=s.map((p,m)=>{let g=p?.color;const y=o[m];return g!=null?u=g:u!=null?g=u:(d==null&&(d=new ColorScale,d.domain=[0,1],d.range=t),g=d.convert(y)),{stop:y,color:g}});return i==="discrete"?discreteColorStops(f):f}var import_ag_charts_core17=require("ag-charts-core"),import_ag_charts_core15=require("ag-charts-core"),LONG_TIME_PERIOD_THRESHOLD=2e3,timeOfLastLog=Date.now(),logTimeGap=()=>{const e=Date.now()-timeOfLastLog;if(e>LONG_TIME_PERIOD_THRESHOLD){const t=(Math.floor(e/100)/10).toFixed(1);import_ag_charts_core15.Logger.log(`**** ${t}s since last log message ****`)}timeOfLastLog=Date.now()},Debug={create(...e){return Object.assign((...n)=>{Debug.check(...e)&&(typeof n[0]=="function"&&(n=(0,import_ag_charts_core15.toArray)(n[0]())),logTimeGap(),import_ag_charts_core15.Logger.log(...n))},{check:()=>Debug.check(...e),group:(n,i)=>Debug.check(...e)?import_ag_charts_core15.Logger.logGroup(n,i):i()})},check(...e){return e.length===0&&e.push(!0),(0,import_ag_charts_core15.toArray)((0,import_ag_charts_core15.getWindow)("agChartsDebug")).some(n=>e.includes(n))},inDevelopmentMode(e){if(Debug.check("dev"))return e()}};function clearContext({context:e,pixelRatio:t,width:n,height:i}){e.save(),e.resetTransform(),e.clearRect(0,0,Math.ceil(n*t),Math.ceil(i*t)),e.restore()}function debugContext(e){if(Debug.check("canvas")){const t=e.save.bind(e),n=e.restore.bind(e);let i=0;Object.assign(e,{save(){t(),i++},restore(){if(i===0)throw new Error("AG Charts - Unable to restore() past depth 0");n(),i--},verifyDepthZero(){if(i!==0)throw new Error(`AG Charts - Save/restore depth is non-zero: ${i}`)}})}}function canvasDimensions(e,t,n){return[Math.floor(e*n),Math.floor(t*n)]}var HdpiOffscreenCanvas=class{constructor(e){const{width:t,height:n,pixelRatio:i,willReadFrequently:s=!1}=e;this.width=t,this.height=n,this.pixelRatio=i;const[r,a]=canvasDimensions(t,n,i);this.canvas=new OffscreenCanvas(r,a),this.context=this.canvas.getContext("2d",{willReadFrequently:s}),this.context.setTransform(i,0,0,i,0,0),debugContext(this.context)}drawImage(e,t=0,n=0){return e.drawImage(this.canvas,t,n)}transferToImageBitmap(){return this.canvas.transferToImageBitmap()}resize(e,t,n){if(!(e>0&&t>0))return;const{canvas:i,context:s}=this;if(e!==this.width||t!==this.height||n!==this.pixelRatio){const[r,a]=canvasDimensions(e,t,n);i.width=r,i.height=a}s.setTransform(n,0,0,n,0,0),this.width=e,this.height=t,this.pixelRatio=n}clear(){clearContext(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)}},import_ag_charts_core16=require("ag-charts-core");function pointsDistanceSquared(e,t,n,i){const s=e-n,r=t-i;return s*s+r*r}function lineDistanceSquared(e,t,n,i,s,r,a){if(n===s&&i===r)return Math.min(a,pointsDistanceSquared(e,t,n,i));const c=s-n,o=r-i,h=Math.max(0,Math.min(1,((e-n)*c+(t-i)*o)/(c*c+o*o))),l=n+h*c,u=i+h*o;return Math.min(a,pointsDistanceSquared(e,t,l,u))}function arcDistanceSquared(e,t,n,i,s,r,a,c,o){c&&([a,r]=[r,a]);const h=Math.atan2(t-i,e-n);if(!isBetweenAngles(h,r,a)){const u=n+Math.cos(r)*s,d=i+Math.sin(r)*s,f=n+Math.cos(r)*s,p=i+Math.sin(r)*s;return Math.min(o,pointsDistanceSquared(e,t,u,d),pointsDistanceSquared(e,t,f,p))}const l=s-Math.sqrt(pointsDistanceSquared(e,t,n,i));return Math.min(o,l*l)}function linearRoot(e,t){const n=-t/e;return e!==0&&n>=0&&n<=1?[n]:[]}function quadraticRoots(e,t,n){if(e===0)return linearRoot(t,n);const i=t*t-4*e*n,s=[];if(i===0){const r=-t/(2*e);r>=0&&r<=1&&s.push(r)}else if(i>0){const r=Math.sqrt(i),a=(-t-r)/(2*e),c=(-t+r)/(2*e);a>=0&&a<=1&&s.push(a),c>=0&&c<=1&&s.push(c)}return s}function cubicRoots(e,t,n,i){if(e===0)return quadraticRoots(t,n,i);const s=t/e,r=n/e,a=i/e,c=(3*r-s*s)/9,o=(9*s*r-27*a-2*s*s*s)/54,h=c*c*c+o*o,l=1/3,u=[];if(h>=0){const d=Math.sqrt(h),f=Math.sign(o+d)*Math.pow(Math.abs(o+d),l),p=Math.sign(o-d)*Math.pow(Math.abs(o-d),l),m=Math.abs(Math.sqrt(3)*(f-p)/2),g=-l*s+(f+p);if(g>=0&&g<=1&&u.push(g),m===0){const y=-l*s-(f+p)/2;y>=0&&y<=1&&u.push(y)}}else{const d=Math.acos(o/Math.sqrt(-c*c*c)),f=l*s,p=2*Math.sqrt(-c),m=p*Math.cos(l*d)-f,g=p*Math.cos(l*(d+2*Math.PI))-f,y=p*Math.cos(l*(d+4*Math.PI))-f;m>=0&&m<=1&&u.push(m),g>=0&&g<=1&&u.push(g),y>=0&&y<=1&&u.push(y)}return u}function segmentIntersection(e,t,n,i,s,r,a,c){const o=(n-e)*(c-r)-(i-t)*(a-s);if(o===0)return 0;const h=((a-s)*(t-r)-(e-s)*(c-r))/o,l=((n-e)*(t-r)-(i-t)*(e-s))/o;return h>=0&&h<=1&&l>=0&&l<=1?1:0}function cubicSegmentIntersections(e,t,n,i,s,r,a,c,o,h,l,u){let d=0;const f=h-u,p=l-o,m=o*(u-h)-h*(l-o),g=bezierCoefficients(e,n,s,a),y=bezierCoefficients(t,i,r,c),b=f*g[0]+p*y[0],x=f*g[1]+p*y[1],P=f*g[2]+p*y[2],S=f*g[3]+p*y[3]+m,A=cubicRoots(b,x,P,S);for(const M of A){const v=M*M,C=M*v,w=g[0]*C+g[1]*v+g[2]*M+g[3],R=y[0]*C+y[1]*v+y[2]*M+y[3];let N;o===l?N=(R-h)/(u-h):N=(w-o)/(l-o),N>=0&&N<=1&&d++}return d}function bezierCoefficients(e,t,n,i){return[-e+3*t-3*n+i,3*e-6*t+3*n,-3*e+3*t,e]}function arcIntersections(e,t,n,i,s,r,a,c,o,h){if(isNaN(e)||isNaN(t))return 0;r&&([s,i]=[i,s]);const l=(h-c)/(o-a),u=c-l*a,d=Math.pow(l,2)+1,f=2*(l*(u-t)-e),p=Math.pow(e,2)+Math.pow(u-t,2)-Math.pow(n,2),m=Math.pow(f,2)-4*d*p;if(m<0)return 0;const g=(-f+Math.sqrt(m))/2/d,y=(-f-Math.sqrt(m))/2/d;let b=0;return[g,y].forEach(x=>{if(!(x>=Math.min(a,o)&&x<=Math.max(a,o)))return;const S=l*x+u,A=x-e,M=S-t,v=Math.atan2(M,A);isBetweenAngles(v,i,s)&&b++}),b}function evaluateBezier(e,t,n,i,s){return(1-s)**3*e+3*(1-s)**2*s*t+3*(1-s)*s**2*n+s**3*i}function calculateDerivativeExtrema(e,t,n,i){const s=-e+3*t-3*n+i,r=3*e-6*t+3*n,a=-3*e+3*t;if(s===0){if(r!==0){const o=-a/r;if(o>0&&o<1)return[o]}return[]}const c=r*r-4*s*a;if(c>=0){const o=Math.sqrt(c),h=(-r+o)/(2*s),l=(-r-o)/(2*s);return[h,l].filter(u=>u>0&&u<1)}return[]}function calculateDerivativeExtremaXY(e,t,n,i,s,r,a,c){const o=calculateDerivativeExtrema(e,n,s,a),h=calculateDerivativeExtrema(t,i,r,c);return[...o,...h]}var ExtendedPath2D=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(e,t){this.openedPath=!0,this.path2d.moveTo(e,t),this.commands.push(0),this.params.push(e,t)}lineTo(e,t){this.openedPath?(this.path2d.lineTo(e,t),this.commands.push(1),this.params.push(e,t)):this.moveTo(e,t)}rect(e,t,n,i){this.moveTo(e,t),this.lineTo(e+n,t),this.lineTo(e+n,t+i),this.lineTo(e,t+i),this.closePath()}roundRect(e,t,n,i,s){s=Math.min(s,n/2,i/2),this.moveTo(e,t+s),this.arc(e+s,t+s,s,Math.PI,1.5*Math.PI),this.lineTo(e+s,t),this.lineTo(e+n-s,t),this.arc(e+n-s,t+s,s,1.5*Math.PI,2*Math.PI),this.lineTo(e+n,t+s),this.lineTo(e+n,t+i-s),this.arc(e+n-s,t+i-s,s,0,Math.PI/2),this.lineTo(e+n-s,t+i),this.lineTo(e+s,t+i),this.arc(e+ +s,t+i-s,s,Math.PI/2,Math.PI),this.lineTo(e,t+i-s),this.closePath()}arc(e,t,n,i,s,r){this.openedPath=!0,this.path2d.arc(e,t,n,i,s,r),this.commands.push(2),this.params.push(e,t,n,i,s,r?1:0)}cubicCurveTo(e,t,n,i,s,r){this.openedPath||this.moveTo(e,t),this.path2d.bezierCurveTo(e,t,n,i,s,r),this.commands.push(3),this.params.push(e,t,n,i,s,r)}closePath(){this.openedPath&&(this.path2d.closePath(),this.commands.push(4),this.openedPath=!1,this.closedPath=!0)}clear(e){e&&(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(e,t){const n=this.commands,i=this.params,s=n.length,r=-1e4,a=-1e4;let c=NaN,o=NaN,h=0,l=0,u=0;for(let d=0,f=0;d<s;d++)switch(n[d]){case 0:u+=segmentIntersection(c,o,h,l,r,a,e,t),h=i[f++],c=h,l=i[f++],o=l;break;case 1:u+=segmentIntersection(h,l,i[f++],i[f++],r,a,e,t),h=i[f-2],l=i[f-1];break;case 3:u+=cubicSegmentIntersections(h,l,i[f++],i[f++],i[f++],i[f++],i[f++],i[f++],r,a,e,t),h=i[f-2],l=i[f-1];break;case 2:{const p=i[f++],m=i[f++],g=i[f++],y=i[f++],b=i[f++],x=!!i[f++];if(u+=arcIntersections(p,m,g,y,b,x,r,a,e,t),!isNaN(c)){const P=p+Math.cos(y)*g,S=m+Math.sin(y)*g;u+=segmentIntersection(h,l,P,S,r,a,e,t)}h=p+Math.cos(b)*g,l=m+Math.sin(b)*g;break}case 4:u+=segmentIntersection(c,o,h,l,r,a,e,t);break}return u%2===1}distanceSquared(e,t){let n=1/0;const i=this.commands,s=this.params,r=i.length;let a=NaN,c=NaN,o=0,h=0;for(let l=0,u=0;l<r;l++)switch(i[l]){case 0:o=a=s[u++],h=c=s[u++];break;case 1:{const d=s[u++],f=s[u++];n=lineDistanceSquared(e,t,o,h,d,f,n);break}case 3:import_ag_charts_core16.Logger.error("Command.Curve distanceSquare not implemented");break;case 2:{const d=s[u++],f=s[u++],p=s[u++],m=s[u++],g=s[u++],y=d+Math.cos(m)*p,b=f+Math.sin(m)*p,x=!!s[u++];n=lineDistanceSquared(e,t,o,h,y,b,n),n=arcDistanceSquared(e,t,d,f,p,m,g,x,n),o=d+Math.cos(g)*p,h=f+Math.sin(g)*p;break}case 4:n=lineDistanceSquared(e,t,o,h,a,c,n);break}return n}toSVG(e=(t,n)=>({x:t,y:n})){const t=[],{commands:n,params:i}=this,s=(a,...c)=>{t.push(a);for(let o=0;o<c.length;o+=2){const{x:h,y:l}=e(c[o],c[o+1]);t.push(h,l)}};let r=0;for(const a of n)switch(a){case 0:s("M",i[r++],i[r++]);break;case 1:s("L",i[r++],i[r++]);break;case 3:s("C",i[r++],i[r++],i[r++],i[r++],i[r++],i[r++]);break;case 2:{const c=i[r++],o=i[r++],h=i[r++],l=i[r++],u=i[r++],d=i[r++];let f=d?l-u:u-l;f<0&&(f+=Math.ceil(-f/(2*Math.PI))*2*Math.PI),d&&(f=-f);const p=Math.max(Math.ceil(Math.abs(f)/(Math.PI/2)),1),m=f/p,g=4/3*Math.tan(m/4),y=t.length===0?"M":"L";s(y,c+Math.cos(l)*h,o+Math.sin(l)*h);for(let b=0;b<p;b+=1){const x=l+m*(b+0),P=l+m*(b+1),S=h*Math.sin(x),A=h*Math.cos(x),M=h*Math.sin(P),v=h*Math.cos(P);s("C",c+A-g*S,o+S+g*A,c+v+g*M,o+M-g*v,c+v,o+M)}break}case 4:t.push("Z");break}return t.join(" ")}computeBBox(){const{commands:e,params:t}=this;let[n,i,s,r]=[1/0,1/0,-1/0,-1/0],[a,c]=[NaN,NaN],[o,h]=[NaN,NaN];const l=(d,f,p)=>{n=Math.min(f,n),i=Math.min(d,i),s=Math.max(d,s),r=Math.max(f,r),p&&([a,c]=[d,f])};let u=0;for(const d of e)switch(d){case 0:l(t[u++],t[u++],!0),[o,h]=[a,c];break;case 1:l(t[u++],t[u++],!0);break;case 3:{const f=t[u++],p=t[u++],m=t[u++],g=t[u++],y=t[u++],b=t[u++];l(y,b,!0),calculateDerivativeExtremaXY(a,c,f,p,m,g,y,b).forEach(P=>{const S=evaluateBezier(a,f,m,y,P),A=evaluateBezier(c,p,g,b,P);l(S,A)});break}case 2:{const f=t[u++],p=t[u++],m=t[u++];let g=normalizeAngle360(t[u++]),y=normalizeAngle360(t[u++]);t[u++]&&([g,y]=[y,g]);const x=(S,A)=>{const M=f+m*Math.cos(S),v=p+m*Math.sin(S);l(M,v,A)};x(g),x(y,!0);const P=[0,Math.PI/2,Math.PI,3*Math.PI/2];for(const S of P)(g<y&&g<=S&&S<=y||g>y&&(g<=S||S<=y))&&x(S);break}case 4:[a,c]=[o,h];break}return new BBox(i,n,s-i,r-n)}};function align(e,t,n){const i=Math.round(t*e)/e;return n==null?i:n===0?0:n<1?Math.ceil(n*e)/e:Math.round((n+t)*e)/e-i}function alignBefore(e,t){return Math.floor(t*e)/e}function drawPatternUnitPolygon(e,t,n){const{width:i,height:s,padding:r,strokeWidth:a}=t,c=i/2,o=s/2,h=Math.max(1,i-r-a/2),l=Math.max(1,s-r-a/2);let u=!1;for(const[d,f]of n){const p=c+(d-.5)*h,m=o+(f-.5)*l;u?e.lineTo(p,m):e.moveTo(p,m),u=!0}e.closePath()}var PATTERNS={circles(e,{width:t,strokeWidth:n,padding:i}){const s=t/2,r=Math.max(1,s-i-n/2);e.arc(s,s,r,0,Math.PI*2)},squares(e,{width:t,height:n,pixelRatio:i,padding:s,strokeWidth:r}){const a=s+r/2;e.moveTo(align(i,a),align(i,a)),e.lineTo(align(i,t-a),align(i,a)),e.lineTo(align(i,t-a),align(i,n-a)),e.lineTo(align(i,a),align(i,n-a)),e.closePath()},triangles(e,t){drawPatternUnitPolygon(e,t,[[.5,0],[1,1],[0,1]])},diamonds(e,t){drawPatternUnitPolygon(e,t,[[.5,0],[1,.5],[.5,1],[0,.5]])},stars(e,{width:t,height:n,padding:i}){const r=Math.max(1,(t-i)/2),a=r/2,c=Math.PI/2;for(let o=0;o<5*2;o++){const h=o%2===0?r:a,l=o*Math.PI/5-c,u=t/2+Math.cos(l)*h,d=n/2+Math.sin(l)*h;e.lineTo(u,d)}e.closePath()},hearts(e,{width:t,height:n,padding:i}){const s=Math.max(1,t/4-i/2),r=t/2,a=n/2+s/2;e.arc(r-s,a-s,s,toRadians(130),toRadians(330)),e.arc(r+s,a-s,s,toRadians(220),toRadians(50)),e.lineTo(r,a+s),e.closePath()},crosses(e,t){drawPatternUnitPolygon(e,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]])},"vertical-lines"(e,{width:t,height:n,pixelRatio:i,strokeWidth:s}){const r=align(i,t/2)-s%2/2;e.moveTo(r,0),e.lineTo(r,n)},"horizontal-lines"(e,{width:t,height:n,pixelRatio:i,strokeWidth:s}){const r=align(i,n/2)-s%2/2;e.moveTo(0,r),e.lineTo(t,r)},"forward-slanted-lines"(e,{width:t,height:n,strokeWidth:i}){const s=Math.atan2(n,t),r=i*Math.cos(s),a=i*Math.sin(s);e.moveTo(-r,a),e.lineTo(r,-a),e.moveTo(-r,n+a),e.lineTo(t+r,-a),e.moveTo(t-r,n+a),e.lineTo(t+r,n-a)},"backward-slanted-lines"(e,{width:t,height:n,strokeWidth:i}){const s=Math.atan2(n,t),r=i*Math.cos(s),a=i*Math.sin(s);e.moveTo(t-r,-a),e.lineTo(t+r,a),e.moveTo(-r,-a),e.lineTo(t+r,n+a),e.moveTo(-r,n-a),e.lineTo(r,n+a)}},Pattern=class{constructor(e,t=1){this.pixelRatio=t,this._cache=void 0,this.width=Math.max(e?.width??10,1),this.height=Math.max(e?.height??10,1),this.fill=e.fill??"transparent",this.fillOpacity=e.fillOpacity??1,this.backgroundFill=e.backgroundFill??"transparent",this.backgroundFillOpacity=e.backgroundFillOpacity??1,this.stroke=e.stroke??"black",this.strokeOpacity=e.strokeOpacity??1,this.strokeWidth=e.strokeWidth??1,this.padding=e.padding??1,this.pattern=e.pattern??"forward-slanted-lines",this.rotation=e.rotation??0}getPath(){const{pattern:e,width:t,height:n,padding:i,strokeWidth:s,pixelRatio:r}=this,a=new ExtendedPath2D;return PATTERNS[e](a,{width:t,height:n,pixelRatio:r,strokeWidth:s,padding:i}),a}renderStroke(e,t){const{stroke:n,strokeWidth:i,strokeOpacity:s}=this;i&&(t.strokeStyle=n,t.lineWidth=i,t.globalAlpha=s,t.stroke(e))}renderFill(e,t){const{fill:n,fillOpacity:i}=this;t.fillStyle=n,t.globalAlpha=i,t.fill(e)}createCanvasPattern(e){const{width:t,height:n,backgroundFill:i,backgroundFillOpacity:s,pixelRatio:r,rotation:a}=this,c=new HdpiOffscreenCanvas({width:t,height:n,pixelRatio:r}),o=c.context;o.fillStyle=i,o.globalAlpha=s,o.fillRect(0,0,t,n);const h=this.getPath().getPath2D();this.renderFill(h,o),this.renderStroke(h,o);const l=e.createPattern(c.canvas,"repeat"),u=normalizeAngle360(toRadians(a)),d=1/r,f=Math.cos(u)*d,p=Math.sin(u)*d;return l?.setTransform(new DOMMatrix([f,p,-p,f,0,0])),c.destroy(),l}createPattern(e){if(this._cache!=null&&this._cache.ctx===e)return this._cache.pattern;const t=this.createCanvasPattern(e);if(t!=null)return this._cache={ctx:e,pattern:t},t}toSvg(){const{width:e,height:t,fill:n,fillOpacity:i,backgroundFill:s,backgroundFillOpacity:r,stroke:a,strokeWidth:c,strokeOpacity:o,rotation:h}=this,l=(0,import_ag_charts_core17.createSvgElement)("pattern");l.setAttribute("viewBox",`0 0 ${e} ${t}`),l.setAttribute("width",String(e)),l.setAttribute("height",String(t)),l.setAttribute("patternUnits","userSpaceOnUse");const u=(0,import_ag_charts_core17.createSvgElement)("rect");u.setAttribute("x","0"),u.setAttribute("y","0"),u.setAttribute("width",String(e)),u.setAttribute("height",String(t)),u.setAttribute("fill",s),u.setAttribute("fill-opacity",String(r)),l.appendChild(u);const d=(0,import_ag_charts_core17.createSvgElement)("path");return d.setAttribute("fill",n),d.setAttribute("fill-opacity",String(i)),d.setAttribute("stroke-opacity",String(o)),d.setAttribute("stroke",a),d.setAttribute("stroke-width",String(c)),d.setAttribute("transform",`rotate(${h})`),d.setAttribute("d",this.getPath().toSVG()),l.appendChild(d),l}},import_ag_charts_core18=require("ag-charts-core");function isGradientFill(e){return(0,import_ag_charts_core18.isObject)(e)&&e.type=="gradient"}function isPatternFill(e){return e!==null&&(0,import_ag_charts_core18.isObject)(e)&&e.type=="pattern"}var _Shape=class I extends Node{constructor(){super(...arguments),this.fillOpacity=1,this.strokeOpacity=1,this.fill=I.defaultStyles.fill,this.stroke=I.defaultStyles.stroke,this.strokeWidth=I.defaultStyles.strokeWidth,this.lineDash=I.defaultStyles.lineDash,this.lineDashOffset=I.defaultStyles.lineDashOffset,this.lineCap=I.defaultStyles.lineCap,this.lineJoin=I.defaultStyles.lineJoin,this.miterLimit=void 0,this.opacity=I.defaultStyles.opacity,this.fillShadow=I.defaultStyles.fillShadow}restoreOwnStyles(){const{defaultStyles:t}=this.constructor;Object.assign(this,t)}getGradient(t){if(isGradientFill(t))return this.createGradient(t)}createGradient(t){const{colorSpace:n="rgb",gradient:i="linear",colorStops:s,rotation:r=0,reverse:a=!1}=t;if(s==null)return;let c=getColorStops(s,["black"],[0,1]);switch(a&&(c=c.map(o=>({color:o.color,stop:1-o.stop})).reverse()),i){case"linear":return new LinearGradient(n,c,r);case"radial":return new RadialGradient(n,c);case"conic":return new ConicGradient(n,c,r)}}getPattern(t){if(isPatternFill(t))return this.createPattern(t)}createPattern(t){const n=this.layerManager?.canvas?.pixelRatio??1;return new Pattern(t,n)}onFillChange(){typeof this.fill=="object"&&objectsEqual(this._cachedFill??{},this.fill)||(this.fillGradient=this.getGradient(this.fill),this.fillPattern=this.getPattern(this.fill),this._cachedFill=this.fill)}onStrokeChange(){this.strokeGradient=this.getGradient(this.stroke)}align(t,n){return align(this.layerManager?.canvas?.pixelRatio??1,t,n)}preRender(t,n){return this.dirty&&(this.cachedDefaultGradientFillBBox=void 0),super.preRender(t,n)}fillStroke(t,n){this.renderFill(t,n),this.renderStroke(t,n)}renderFill(t,n){if(this.fill){const{globalAlpha:i}=t;this.applyFill(t),this.applyFillAlpha(t),this.applyShadow(t),this.executeFill(t,n),t.globalAlpha=i}t.shadowColor="rgba(0, 0, 0, 0)"}executeFill(t,n){n?t.fill(n):t.fill()}applyFill(t){const{fill:n,fillGradient:i,fillBBox:s=this.getDefaultGradientFillBBox()??this.getBBox(),fillParams:r}=this,a=s?i?.createGradient(t,s,r):void 0,c=this.fillPattern?.createPattern(t);t.fillStyle=c??a??(typeof n=="string"?n:void 0)??"black"}applyStroke(t){t.strokeStyle=this.strokeGradient?.createGradient(t,this.getBBox())??(typeof this.stroke=="string"?this.stroke:void 0)??"black"}applyFillAlpha(t){t.globalAlpha*=this.opacity*this.fillOpacity}applyShadow(t){const n=this.layerManager?.canvas.pixelRatio??1,i=this.fillShadow;i?.enabled&&(t.shadowColor=i.color,t.shadowOffsetX=i.xOffset*n,t.shadowOffsetY=i.yOffset*n,t.shadowBlur=i.blur*n)}renderStroke(t,n){if(this.stroke&&this.strokeWidth){const{globalAlpha:i}=t;this.applyStroke(t),t.globalAlpha*=this.opacity*this.strokeOpacity,t.lineWidth=this.strokeWidth,this.lineDash&&t.setLineDash(this.lineDash),this.lineDashOffset&&(t.lineDashOffset=this.lineDashOffset),this.lineCap&&(t.lineCap=this.lineCap),this.lineJoin&&(t.lineJoin=this.lineJoin),this.miterLimit!=null&&(t.miterLimit=this.miterLimit),this.executeStroke(t,n),t.globalAlpha=i}}executeStroke(t,n){n?t.stroke(n):t.stroke()}getDefaultGradientFillBBox(){return this.cachedDefaultGradientFillBBox==null&&(this.cachedDefaultGradientFillBBox=Object.freeze(this.computeDefaultGradientFillBBox())),this.cachedDefaultGradientFillBBox}computeDefaultGradientFillBBox(){}containsPoint(t,n){return this.isPointInPath(t,n)}applySvgFillAttributes(t,n){const{fill:i,fillOpacity:s}=this;if(typeof i=="string")t.setAttribute("fill",i);else if(isGradientFill(i)&&this.fillGradient){n??(n=[]);const r=this.fillGradient.toSvg(this.fillBBox??this.getBBox()),a=generateUUID();r.setAttribute("id",a),n.push(r),t.setAttribute("fill",`url(#${a})`)}else if(isPatternFill(i)&&this.fillPattern){n??(n=[]);const r=this.fillPattern.toSvg(),a=generateUUID();r.setAttribute("id",a),n.push(r),t.setAttribute("fill",`url(#${a})`)}else t.setAttribute("fill","none");return t.setAttribute("fill-opacity",String(s)),n}applySvgStrokeAttributes(t){const{stroke:n,strokeOpacity:i,strokeWidth:s,lineDash:r,lineDashOffset:a}=this;if(n!=null&&(t.setAttribute("stroke",typeof n=="string"?n:"none"),t.setAttribute("stroke-opacity",String(i)),t.setAttribute("stroke-width",String(s))),r?.some(c=>c!==0)===!0){const c=r.length%2===1?[...r,...r]:r;t.setAttribute("stroke-dasharray",c.join(" ")),t.setAttribute("stroke-dashoffset",String(a))}}};_Shape.defaultStyles={fill:"black",stroke:void 0,strokeWidth:0,lineDash:void 0,lineDashOffset:0,lineCap:void 0,lineJoin:void 0,opacity:1,fillShadow:void 0},__decorateClass([SceneChangeDetection()],_Shape.prototype,"fillOpacity",2),__decorateClass([SceneChangeDetection()],_Shape.prototype,"strokeOpacity",2),__decorateClass([SceneChangeDetection({changeCb:e=>e.onFillChange()})],_Shape.prototype,"fill",2),__decorateClass([SceneChangeDetection({changeCb:e=>e.onStrokeChange()})],_Shape.prototype,"stroke",2),__decorateClass([SceneChangeDetection()],_Shape.prototype,"strokeWidth",2),__decorateClass([SceneChangeDetection()],_Shape.prototype,"lineDash",2),__decorateClass([SceneChangeDetection()],_Shape.prototype,"lineDashOffset",2),__decorateClass([SceneChangeDetection()],_Shape.prototype,"lineCap",2),__decorateClass([SceneChangeDetection()],_Shape.prototype,"lineJoin",2),__decorateClass([SceneChangeDetection()],_Shape.prototype,"miterLimit",2),__decorateClass([SceneChangeDetection({convertor:e=>(0,import_ag_charts_core19.clamp)(0,e,1)})],_Shape.prototype,"opacity",2),__decorateClass([SceneChangeDetection({checkDirtyOnAssignment:!0})],_Shape.prototype,"fillShadow",2),__decorateClass([SceneChangeDetection({changeCb:e=>e.onFillChange()})],_Shape.prototype,"fillBBox",2),__decorateClass([SceneChangeDetection({changeCb:e=>e.onFillChange()})],_Shape.prototype,"fillParams",2);var Shape=_Shape,_Text=class $ extends Shape{constructor(){super(...arguments),this.x=0,this.y=0,this.lines=[],this.text=void 0,this.fontSize=10,this.fontFamily="sans-serif",this.textAlign=$.defaultStyles.textAlign,this.textBaseline=$.defaultStyles.textBaseline}onTextChange(){this.lines=this.text?.split(`
`).map(t=>t.trim())??[]}static computeBBox(t,n,i,s){const{offsetTop:r,offsetLeft:a,width:c,height:o}=CachedTextMeasurerPool.measureLines(t,s);return new BBox(n-a,i-r,c,o)}computeBBox(){const{x:t,y:n,lines:i,textBaseline:s,textAlign:r}=this;return $.computeBBox(i,t,n,{font:this,textBaseline:s,textAlign:r})}isPointInPath(t,n){const i=this.getBBox();return i?i.containsPoint(t,n):!1}render(t){const{ctx:n,stats:i}=t;if(!this.lines.length||!this.layerManager)return i&&(i.nodesSkipped+=1),super.render(t);const{fill:s,stroke:r,strokeWidth:a}=this,{pixelRatio:c}=this.layerManager.canvas;if(!s&&!(r!=null&&a>0))return super.render(t);const o=TextUtils.toFontString(this);if(n.font!==o&&(n.font=o),n.textAlign=this.textAlign,n.textBaseline=this.textBaseline,s){this.applyFill(n),n.globalAlpha*=this.opacity*this.fillOpacity;const{fillShadow:h}=this;h?.enabled&&(n.shadowColor=h.color,n.shadowOffsetX=h.xOffset*c,n.shadowOffsetY=h.yOffset*c,n.shadowBlur=h.blur*c),this.renderLines((l,u,d)=>n.fillText(l,u,d))}if(r&&a){this.applyStroke(n),n.lineWidth=a,n.globalAlpha*=this.opacity*this.strokeOpacity;const{lineDash:h,lineDashOffset:l,lineCap:u,lineJoin:d}=this;h&&n.setLineDash(h),l&&(n.lineDashOffset=l),u&&(n.lineCap=u),d&&(n.lineJoin=d),this.renderLines((f,p,m)=>n.strokeText(f,p,m))}super.render(t)}renderLines(t){const{lines:n,x:i,y:s}=this,r=this.lineHeight??TextUtils.getLineHeight(this.fontSize);let a=(r-r*n.length)*TextUtils.getVerticalModifier(this.textBaseline);for(const c of n)t(c,i,s+a),a+=r}setFont(t){this.fontFamily=t.fontFamily,this.fontSize=t.fontSize,this.fontStyle=t.fontStyle,this.fontWeight=t.fontWeight}setAlign(t){this.textAlign=t.textAlign,this.textBaseline=t.textBaseline}toSVG(){if(!this.visible||!this.text)return;const t=(0,import_ag_charts_core20.createSvgElement)("text");return this.applySvgFillAttributes(t),t.setAttribute("font-family",this.fontFamily?.split(",")[0]??""),t.setAttribute("font-size",String(this.fontSize)),t.setAttribute("font-style",this.fontStyle??""),t.setAttribute("font-weight",String(this.fontWeight??"")),t.setAttribute("text-anchor",{center:"middle",left:"start",right:"end",start:"start",end:"end"}[this.textAlign??"start"]),t.setAttribute("alignment-baseline",{alphabetic:"alphabetic",top:"top",bottom:"bottom",hanging:"hanging",middle:"middle",ideographic:"ideographic"}[this.textBaseline??"alphabetic"]),t.setAttribute("x",String(this.x)),t.setAttribute("y",String(this.y)),t.textContent=this.text??"",{elements:[t]}}};_Text.className="Text",_Text.defaultStyles={...Shape.defaultStyles,textAlign:"start",fontStyle:void 0,fontWeight:void 0,fontSize:10,fontFamily:"sans-serif",textBaseline:"alphabetic"},__decorateClass([SceneChangeDetection()],_Text.prototype,"x",2),__decorateClass([SceneChangeDetection()],_Text.prototype,"y",2),__decorateClass([SceneChangeDetection({changeCb:e=>e.onTextChange()})],_Text.prototype,"text",2),__decorateClass([SceneChangeDetection()],_Text.prototype,"fontStyle",2),__decorateClass([SceneChangeDetection()],_Text.prototype,"fontWeight",2),__decorateClass([SceneChangeDetection()],_Text.prototype,"fontSize",2),__decorateClass([SceneChangeDetection()],_Text.prototype,"fontFamily",2),__decorateClass([SceneChangeDetection()],_Text.prototype,"textAlign",2),__decorateClass([SceneChangeDetection()],_Text.prototype,"textBaseline",2),__decorateClass([SceneChangeDetection()],_Text.prototype,"lineHeight",2);var Text=_Text,RotatableText=class extends Rotatable(Text){},TransformableText=class extends Rotatable(Translatable(Text)){},import_ag_charts_core21=require("ag-charts-core");function ProxyPropertyOnWrite(e,t){return addTransformToInstanceProperty((n,i,s)=>n[e][t??i]=s)}function ObserveChanges(e){return addObserverToInstanceProperty(e)}var TextWrapper=class{static wrapText(e,t){return this.wrapLines(e,t).join(`
`)}static wrapLines(e,t){const n=this.textWrap(e,t);return t.overflow==="hide"&&n.some(i=>i.endsWith(TextUtils.EllipsisChar))?[]:n}static appendEllipsis(e){return e.replace(/[.,]{1,5}$/,"")+TextUtils.EllipsisChar}static truncateLine(e,t,n,i){const s=t.textWidth(TextUtils.EllipsisChar);let r=0,a=0;for(;a<e.length;a++){const c=t.textWidth(e.charAt(a));if(r+c>n)break;r+=c}if(e.length===a&&(!i||r+s<=n))return i?e+TextUtils.EllipsisChar:e;for(e=e.slice(0,a).trimEnd();e.length&&t.textWidth(e)+s>n;)e=e.slice(0,-1).trimEnd();return e+TextUtils.EllipsisChar}static textWrap(e,t){const n=e.split(TextUtils.lineSplitter),i=CachedTextMeasurerPool.getMeasurer(t);if(t.textWrap==="never")return n.map(c=>this.truncateLine(c.trimEnd(),i,t.maxWidth));const s=[],r=t.textWrap==="hyphenate",a=t.textWrap==null||t.textWrap==="on-space";for(const c of n){let o=c.trimEnd();if(o===""){s.push(o);continue}let h=0,l=0,u=0;for(;h<o.length;){const d=o.charAt(h);if(l+=i.textWidth(d),d===" "&&(u=h),l>t.maxWidth){if(h===0)break;const f=i.textWidth(o.slice(0,h+1));if(f<=t.maxWidth){l=f,h++;continue}if(u){const g=this.getWordAt(o,u+1),y=i.textWidth(g);if(y<=t.maxWidth){s.push(o.slice(0,u).trimEnd()),o=o.slice(u).trimStart(),h=0,l=0,u=0;continue}else a&&y>t.maxWidth&&s.push(o.slice(0,u).trimEnd(),this.truncateLine(o.slice(u).trimStart(),i,t.maxWidth,!0))}else a&&s.push(this.truncateLine(o,i,t.maxWidth,!0));if(a){o="";break}const p=r?"-":"";let m=o.slice(0,h).trim();for(;m.length&&i.textWidth(m+p)>t.maxWidth;)m=m.slice(0,-1).trimEnd();if(s.push(m+p),!m.length){o="";break}o=o.slice(m.length).trimStart(),h=-1,l=0,u=0}h++}o&&s.push(o)}return this.avoidOrphans(s,i,t),this.clipLines(s,i,t)}static getWordAt(e,t){const n=e.indexOf(" ",t);return n===-1?e.slice(t):e.slice(t,n)}static clipLines(e,t,n){if(!n.maxHeight)return e;const{height:i,lineMetrics:s}=t.measureLines(e);if(i<=n.maxHeight)return e;for(let r=0,a=0;r<s.length;r++){const{lineHeight:c}=s[r];if(a+=c,a>n.maxHeight){if(n.overflow==="hide")return[];const o=e.slice(0,r||1),h=o.pop();return o.concat(this.truncateLine(h,t,n.maxWidth,!0))}}return e}static avoidOrphans(e,t,n){if(n.avoidOrphans===!1||e.length<2)return;const{length:i}=e,s=e[i-1],r=e[i-2];if(r.length<s.length)return;const a=r.lastIndexOf(" ");if(a===-1||a===r.indexOf(" ")||s.includes(" "))return;const c=r.slice(a+1);t.textWidth(s+c)<=n.maxWidth&&(e[i-2]=r.slice(0,a),e[i-1]=c+" "+s)}},Caption=class extends BaseProperties{constructor(){super(...arguments),this.id=createId(this),this.node=new RotatableText({zIndex:1}).setProperties({textAlign:"center",pointerEvents:1}),this.enabled=!1,this.textAlign="center",this.fontSize=10,this.fontFamily="sans-serif",this.wrapping="always",this.padding=0,this.layoutStyle="block",this.truncated=!1}registerInteraction(e,t){return e.layoutManager.addListener("layout:complete",()=>this.updateA11yText(e,t))}computeTextWrap(e,t){const{text:n,padding:i,wrapping:s}=this,r=Math.min(this.maxWidth??1/0,e)-i*2,a=this.maxHeight??t-i*2;if(!isFinite(r)&&!isFinite(a)){this.node.text=n;return}const c=TextWrapper.wrapText(n??"",{maxWidth:r,maxHeight:a,font:this,textWrap:s});this.node.text=c,this.truncated=c.includes(TextUtils.EllipsisChar)}updateA11yText(e,t){const{proxyInteractionService:n}=e;if(this.enabled&&this.text){const i=Transformable.toCanvas(this.node);if(i){const{id:s}=this;this.proxyText??(this.proxyText=n.createProxyElement({type:"text",domManagerId:s,where:t})),this.proxyText.textContent=this.text,this.proxyText.setBounds(i),this.proxyText.addListener("mousemove",r=>this.handleMouseMove(e,r)),this.proxyText.addListener("mouseleave",r=>this.handleMouseLeave(e,r))}}else this.proxyText?.destroy(),this.proxyText=void 0}handleMouseMove(e,t){if(t!=null&&this.enabled&&this.node.visible&&this.truncated){const{x:n,y:i}=Transformable.toCanvas(this.node),s=t.sourceEvent.offsetX+n,r=t.sourceEvent.offsetY+i;e.tooltipManager.updateTooltip(this.id,{canvasX:s,canvasY:r,showArrow:!1},[{type:"structured",title:this.text}])}}handleMouseLeave(e,t){e.tooltipManager.removeTooltip(this.id)}};Caption.SMALL_PADDING=10,__decorateClass([TempValidate(BOOLEAN),ProxyPropertyOnWrite("node","visible")],Caption.prototype,"enabled",2),__decorateClass([TempValidate(STRING,{optional:!0}),ProxyPropertyOnWrite("node")],Caption.prototype,"text",2),__decorateClass([TempValidate(TEXT_ALIGN,{optional:!0}),ProxyPropertyOnWrite("node")],Caption.prototype,"textAlign",2),__decorateClass([TempValidate(FONT_STYLE,{optional:!0}),ProxyPropertyOnWrite("node")],Caption.prototype,"fontStyle",2),__decorateClass([TempValidate(FONT_WEIGHT,{optional:!0}),ProxyPropertyOnWrite("node")],Caption.prototype,"fontWeight",2),__decorateClass([TempValidate(POSITIVE_NUMBER),ProxyPropertyOnWrite("node")],Caption.prototype,"fontSize",2),__decorateClass([TempValidate(STRING),ProxyPropertyOnWrite("node")],Caption.prototype,"fontFamily",2),__decorateClass([TempValidate(COLOR_STRING,{optional:!0}),ProxyPropertyOnWrite("node","fill")],Caption.prototype,"color",2),__decorateClass([TempValidate(POSITIVE_NUMBER,{optional:!0})],Caption.prototype,"spacing",2),__decorateClass([TempValidate(POSITIVE_NUMBER,{optional:!0})],Caption.prototype,"maxWidth",2),__decorateClass([TempValidate(POSITIVE_NUMBER,{optional:!0})],Caption.prototype,"maxHeight",2),__decorateClass([TempValidate(TEXT_WRAP)],Caption.prototype,"wrapping",2),__decorateClass([TempValidate(POSITIVE_NUMBER)],Caption.prototype,"padding",2),__decorateClass([TempValidate(STRING)],Caption.prototype,"layoutStyle",2);var import_ag_charts_core22=require("ag-charts-core");function ScenePathChangeDetection(e){const{changeCb:t,convertor:n}=e??{};return SceneChangeDetection({type:"path",convertor:n,changeCb:t})}var Path=class extends Shape{constructor(){super(...arguments),this.path=new ExtendedPath2D,this._clipX=NaN,this._clipY=NaN,this.clip=!1,this._dirtyPath=!0,this.lastPixelRatio=NaN}set clipX(e){this._clipX=e,this.dirtyPath=!0}set clipY(e){this._clipY=e,this.dirtyPath=!0}set dirtyPath(e){this._dirtyPath!==e&&(this._dirtyPath=e,e&&this.markDirty("path"))}get dirtyPath(){return this._dirtyPath}checkPathDirty(){this._dirtyPath||(this.dirtyPath=this.path.isDirty()||(this.fillShadow?.isDirty()??!1)||(this._clipPath?.isDirty()??!1))}computeBBox(){return this.updatePathIfDirty(),this.path.computeBBox()}isPointInPath(e,t){return this.updatePathIfDirty(),this.path.closedPath&&this.path.isPointInPath(e,t)}distanceSquared(e,t){return this.distanceSquaredTransformedPoint(e,t)}svgPathData(e){return this.updatePathIfDirty(),this.path.toSVG(e)}distanceSquaredTransformedPoint(e,t){return this.updatePathIfDirty(),this.path.closedPath&&this.path.isPointInPath(e,t)?0:this.path.distanceSquared(e,t)}isDirtyPath(){return!1}updatePath(){}updatePathIfDirty(){(this.dirtyPath||this.isDirtyPath())&&(this.updatePath(),this.dirtyPath=!1)}preRender(e){return e.devicePixelRatio!==this.lastPixelRatio&&(this.dirtyPath=!0),this.lastPixelRatio=e.devicePixelRatio,this.updatePathIfDirty(),super.preRender(e,this.path.commands.length)}render(e){const{ctx:t}=e;if(this.clip&&!isNaN(this._clipX)&&!isNaN(this._clipY)){t.save();const n=this.strokeWidth/2;this._clipPath??(this._clipPath=new ExtendedPath2D),this._clipPath.clear(),this._clipPath.rect(-n,-n,this._clipX+n,this._clipY+n+n),t.clip(this._clipPath?.getPath2D()),this._clipX>0&&this._clipY>0&&this.drawPath(t),t.restore()}else this._clipPath=void 0,this.drawPath(t);this.fillShadow?.markClean(),super.render(e)}drawPath(e){this.fillStroke(e,this.path.getPath2D())}toSVG(){if(!this.visible)return;const e=(0,import_ag_charts_core22.createSvgElement)("path");e.setAttribute("d",this.svgPathData());const t=this.applySvgFillAttributes(e,[]);return this.applySvgStrokeAttributes(e),{elements:[e],defs:t}}};Path.className="Path",__decorateClass([ScenePathChangeDetection()],Path.prototype,"clip",2),__decorateClass([ScenePathChangeDetection()],Path.prototype,"clipX",1),__decorateClass([ScenePathChangeDetection()],Path.prototype,"clipY",1);function drawMarkerUnitPolygon(e,t){const{path:n,size:i}=e,{x:s,y:r}=e;n.clear();let a=!1;for(const[c,o]of t){const h=s+(c-.5)*i,l=r+(o-.5)*i;a?n.lineTo(h,l):n.moveTo(h,l),a=!0}n.closePath()}var MARKER_SHAPES={circle({path:e,x:t,y:n,size:i}){const s=i/2;e.clear(),e.arc(t,n,s,0,Math.PI*2),e.closePath()},cross(e){drawMarkerUnitPolygon(e,[[.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(e){drawMarkerUnitPolygon(e,[[.5,0],[1,.5],[.5,1],[0,.5]])},heart({path:e,x:t,y:n,size:i}){const s=i/4;n=n+s/2,e.clear(),e.arc(t-s,n-s,s,toRadians(130),toRadians(330)),e.arc(t+s,n-s,s,toRadians(220),toRadians(50)),e.lineTo(t,n+s),e.closePath()},pin({path:e,x:t,y:n,size:i}){e.moveTo(t+(.15625-.5)*i,n+(.34375-.5)*i),e.cubicCurveTo(t+(.15625-.5)*i,n+(.151491-.5)*i,t+(.307741-.5)*i,n+(0-.5)*i,t+(.5-.5)*i,n+(0-.5)*i),e.cubicCurveTo(t+(.692259-.5)*i,n+(0-.5)*i,t+(.84375-.5)*i,n+(.151491-.5)*i,t+(.84375-.5)*i,n+(.34375-.5)*i),e.cubicCurveTo(t+(.84375-.5)*i,n+(.493824-.5)*i,t+(.784625-.5)*i,n+(.600181-.5)*i,t+(.716461-.5)*i,n+(.695393-.5)*i),e.cubicCurveTo(t+(.699009-.5)*i,n+(.719769-.5)*i,t+(.681271-.5)*i,n+(.743104-.5)*i,t+(.663785-.5)*i,n+(.766105-.5)*i),e.cubicCurveTo(t+(.611893-.5)*i,n+(.834367-.5)*i,t+(.562228-.5)*i,n+(.899699-.5)*i,t+(.528896-.5)*i,n+(.980648-.5)*i),e.cubicCurveTo(t+(.524075-.5)*i,n+(.992358-.5)*i,t+(.512663-.5)*i,n+(1-.5)*i,t+(.5-.5)*i,n+(1-.5)*i),e.cubicCurveTo(t+(.487337-.5)*i,n+(1-.5)*i,t+(.475925-.5)*i,n+(.992358-.5)*i,t+(.471104-.5)*i,n+(.980648-.5)*i),e.cubicCurveTo(t+(.487337-.5)*i,n+(1-.5)*i,t+(.475925-.5)*i,n+(.992358-.5)*i,t+(.471104-.5)*i,n+(.980648-.5)*i),e.cubicCurveTo(t+(.437772-.5)*i,n+(.899699-.5)*i,t+(.388107-.5)*i,n+(.834367-.5)*i,t+(.336215-.5)*i,n+(.766105-.5)*i),e.cubicCurveTo(t+(.318729-.5)*i,n+(.743104-.5)*i,t+(.300991-.5)*i,n+(.719769-.5)*i,t+(.283539-.5)*i,n+(.695393-.5)*i),e.cubicCurveTo(t+(.215375-.5)*i,n+(.600181-.5)*i,t+(.15625-.5)*i,n+(.493824-.5)*i,t+(.15625-.5)*i,n+(.34375-.5)*i),e.closePath()},plus(e){drawMarkerUnitPolygon(e,[[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:e,x:t,y:n,size:i,pixelRatio:s}){const r=i/2;e.clear(),e.moveTo(align(s,t-r),align(s,n-r)),e.lineTo(align(s,t+r),align(s,n-r)),e.lineTo(align(s,t+r),align(s,n+r)),e.lineTo(align(s,t-r),align(s,n+r)),e.closePath()},star({path:e,x:t,y:n,size:i}){const r=i/2,a=r/2,c=Math.PI/2;for(let o=0;o<5*2;o++){const h=o%2===0?r:a,l=o*Math.PI/5-c,u=t+Math.cos(l)*h,d=n+Math.sin(l)*h;e.lineTo(u,d)}e.closePath()},triangle(e){drawMarkerUnitPolygon(e,[[.5,0],[1,.87],[0,.87]])}},InternalMarker=class extends Path{constructor(){super(...arguments),this.shape="square",this.x=0,this.y=0,this.size=12}updatePath(){const{path:e,shape:t,x:n,y:i,size:s}=this,r=this.layerManager?.canvas?.pixelRatio??1,a=Marker.anchor(t),c={path:e,x:n-(a.x-.5)*s,y:i-(a.y-.5)*s,size:s,pixelRatio:r};e.clear(),typeof t=="string"?MARKER_SHAPES[t](c):typeof t=="function"&&t(c)}computeBBox(){const{x:e,y:t,size:n}=this,i=Marker.anchor(this.shape);return new BBox(e-n*i.x,t-n*i.y,n,n)}executeFill(e,t){if(t)return super.executeFill(e,t)}executeStroke(e,t){if(t)return super.executeStroke(e,t)}};__decorateClass([ScenePathChangeDetection()],InternalMarker.prototype,"shape",2),__decorateClass([ScenePathChangeDetection()],InternalMarker.prototype,"x",2),__decorateClass([ScenePathChangeDetection()],InternalMarker.prototype,"y",2),__decorateClass([ScenePathChangeDetection({convertor:Math.abs})],InternalMarker.prototype,"size",2);var Marker=class extends Rotatable(Scalable(Translatable(InternalMarker))){static anchor(e){return e==="pin"?{x:.5,y:1}:typeof e=="function"&&"anchor"in e?e.anchor:{x:.5,y:.5}}constructor(e){super(e),e?.shape!=null&&(this.shape=e.shape)}},import_ag_charts_core23=require("ag-charts-core");function findMinMax(e){if(e.length===0)return[];const t=[1/0,-1/0];for(const n of e)n<t[0]&&(t[0]=n),n>t[1]&&(t[1]=n);return t}var import_ag_charts_core24=require("ag-charts-core"),TimeInterval=class{constructor(e,t,n){this._encode=e,this._decode=t,this._rangeCallback=n}floor(e){const t=new Date(e),n=this._encode(t);return this._decode(n)}ceil(e){const t=new Date(Number(e)-1),n=this._encode(t);return this._decode(n+1)}range(e,t,{extend:n=!1,visibleRange:i=[0,1]}={}){let s=!1;e.getTime()>t.getTime()&&([e,t]=[t,e],s=!0);const r=this._rangeCallback?.(e,t),a=this._encode(n?this.floor(e):this.ceil(e)),c=this._encode(n?this.ceil(t):this.floor(t));if(c<a)return[];const o=c-a;let h,l;s?(h=Math.ceil(a+(1-i[1])*o),l=Math.floor(a+(1-i[0])*o)):(h=Math.floor(a+i[0]*o),l=Math.ceil(a+i[1]*o));const u=[];for(let d=h;d<=l;d+=1){const f=this._decode(d);u.push(f)}return r?.(),u}},CountableTimeInterval=class extends TimeInterval{getOffset(e,t){return Math.floor(this._encode(new Date(e)))%t}every(e,t){let n=0,i;const s=e;e=Math.max(1,Math.round(e)),s!==e&&import_ag_charts_core24.Logger.warnOnce(`interval step of [${s}] rounded to [${e}].`);const{snapTo:r="start"}=t??{};if(typeof r=="string"){const o=n;i=(h,l)=>{const u=r==="start"?h:l;return n=this.getOffset(u,e),()=>n=o}}else typeof r=="number"?n=this.getOffset(new Date(r),e):r instanceof Date&&(n=this.getOffset(r,e));const a=o=>Math.floor((this._encode(o)-n)/e),c=o=>this._decode(o*e+n);return new TimeInterval(a,c,i)}},durationSecond=1e3,durationMinute=durationSecond*60,durationHour=durationMinute*60,durationDay=durationHour*24,durationWeek=durationDay*7,durationMonth=durationDay*30,durationYear=durationDay*365,offset=new Date().getTimezoneOffset()*durationMinute;function encode(e){return Math.floor((e.getTime()-offset)/durationSecond)}function decode(e){return new Date(offset+e*durationSecond)}var second=new CountableTimeInterval(encode,decode),offset2=new Date().getTimezoneOffset()*durationMinute;function encode2(e){return Math.floor((e.getTime()-offset2)/durationMinute)}function decode2(e){return new Date(offset2+e*durationMinute)}var minute=new CountableTimeInterval(encode2,decode2),offset3=new Date().getTimezoneOffset()*durationMinute;function encode3(e){return Math.floor((e.getTime()-offset3)/durationHour)}function decode3(e){return new Date(offset3+e*durationHour)}var hour=new CountableTimeInterval(encode3,decode3);function encode4(e){const t=e.getTimezoneOffset()*durationMinute;return Math.floor((e.getTime()-t)/durationDay)}function decode4(e){const t=new Date(1970,0,1);return t.setDate(t.getDate()+e),t}var day=new CountableTimeInterval(encode4,decode4);function weekday(e){const n=(7+e-4)%7;function i(r){const a=r.getTimezoneOffset()*durationMinute;return Math.floor((r.getTime()-a)/durationWeek-n/7)}function s(r){const a=new Date(1970,0,1);return a.setDate(a.getDate()+r*7+n),a}return new CountableTimeInterval(i,s)}var sunday=weekday(0),monday=weekday(1),tuesday=weekday(2),wednesday=weekday(3),thursday=weekday(4),friday=weekday(5),saturday=weekday(6);function encode5(e){return e.getFullYear()*12+e.getMonth()}function decode5(e){const t=Math.floor(e/12),n=e-t*12;return new Date(t,n,1)}var month=new CountableTimeInterval(encode5,decode5);function encode6(e){return e.getFullYear()}function decode6(e){const t=new Date;return t.setFullYear(e),t.setMonth(0,1),t.setHours(0,0,0,0),t}var year=new CountableTimeInterval(encode6,decode6);function dateToNumber(e){return e instanceof Date?e.getTime():e}var import_ag_charts_core26=require("ag-charts-core"),import_ag_charts_core25=require("ag-charts-core");function filterVisibleTicks(e,t,n){if(n==null||n[0]===0&&n[1]===1)return e;const i=(0,import_ag_charts_core25.clamp)(0,Math.floor(n[0]*e.length),e.length),s=(0,import_ag_charts_core25.clamp)(0,Math.ceil(n[1]*e.length),e.length),r=t?e.length-s:i,a=t?e.length-i:s;return e.slice(r,a)}var _BandScale=class st extends AbstractScale{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(t){return t instanceof st}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(t){t=(0,import_ag_charts_core26.clamp)(0,t,1),this._paddingInner=t,this._paddingOuter=t}get padding(){return this._paddingInner}set paddingInner(t){this.invalid=!0,this._paddingInner=(0,import_ag_charts_core26.clamp)(0,t,1)}get paddingInner(){return this._paddingInner}set paddingOuter(t){this.invalid=!0,this._paddingOuter=(0,import_ag_charts_core26.clamp)(0,t,1)}get paddingOuter(){return this._paddingOuter}refresh(){this.invalid&&(this.invalid=!1,this.update(),this.invalid&&import_ag_charts_core26.Logger.warnOnce("Expected update to not invalidate scale"))}ticks(t,n=this.domain,i){return filterVisibleTicks(n,!1,i)}convert(t,n){this.refresh();const i=this.getIndex(t);return i==null||i<0||i>=this.domain.length?NaN:this.ordinalRange(i)}invertNearestIndex(t){this.refresh();const{domain:n}=this;if(n.length===0)return-1;let i=0,s=n.length-1,r=1/0,a=0;for(;i<=s;){const c=(s+i)/2|0,o=this.ordinalRange(c),h=Math.abs(o-t);if(h===0)return c;h<r&&(r=h,a=c),o<t?i=c+1:s=c-1}return a}update(){const t=this.domain.length;if(t===0)return;const[n,i]=this.range;let{_paddingInner:s}=this;const{_paddingOuter:r,round:a}=this,c=i-n;let o;t===1?(s=0,o=c*(1-r*2)):o=c/Math.max(1,t-s+r*2);const h=a?Math.floor(o):o;let l=n+(c-h*(t-s))/2,u=h*(1-s);a&&(l=Math.round(l),u=Math.round(u)),this._step=h,this._inset=l,this._bandwidth=u,this._rawBandwidth=o*(1-s)}ordinalRange(t){const{_inset:n,_step:i,range:s}=this,r=Math.min(s[0],s[1]),a=Math.max(s[0],s[1]);return(0,import_ag_charts_core26.clamp)(r,n+i*t,a)}};__decorateClass([Invalidating],_BandScale.prototype,"range",2),__decorateClass([Invalidating],_BandScale.prototype,"round",2),__decorateClass([Invalidating],_BandScale.prototype,"interval",2);var BandScale=_BandScale,CategoryScale=class extends BandScale{constructor(){super(...arguments),this.type="band",this.index=void 0,this._domain=[]}set domain(e){this._domain!==e&&(this.invalid=!0,this._domain=e,this.index=void 0)}get domain(){return this._domain}normalizeDomains(...e){let t;const n=new Set;let i=!0;for(const s of e)n.has(s)||(n.add(s),t==null?t=deduplicateCategories(s):(i&&(i=domainOrderedToNormalizedDomain(s,t)),t=deduplicateCategories([...t,...s])));return t??(t=[]),{domain:t,animatable:i}}toDomain(e){}invert(e,t=!1){this.refresh();const n=t?this.bandwidth/2:0,i=this.invertNearestIndex(Math.max(0,e-n));return t||e===this.ordinalRange(i)?this.domain[i]:void 0}getIndex(e){let{index:t}=this;if(t==null){const{domain:n}=this;t=new Map;for(let i=0;i<n.length;i++)t.set(dateToNumber(n[i]),i);this.index=t}return t.get(dateToNumber(e))}};function deduplicateCategories(e){let t;const n=new Set;for(const i of e){const s=dateToNumber(i),r=n.size;n.add(s),n.size!==r?t?.push(i):t??(t=e.slice(0,n.size))}return t??e}function domainOrderedToNormalizedDomain(e,t){let n=-1;for(const i of e){const s=t.indexOf(i);if(s===-1)n=1/0;else{if(s<=n)return!1;n=s}}return!0}var percentFormatter=new Intl.NumberFormat("en-US",{style:"percent"});function formatValue(e,t=2){return typeof e=="number"?formatNumber(e,t):typeof e=="string"?e:String(e??"")}var numberFormatters=new Map().set(2,new Intl.NumberFormat("en-US",{maximumFractionDigits:2,useGrouping:!1}));function formatNumber(e,t){let n=numberFormatters.get(t);return n||(n=new Intl.NumberFormat("en-US",{maximumFractionDigits:t,useGrouping:!1}),numberFormatters.set(t,n)),n.format(e)}var import_ag_charts_core27=require("ag-charts-core"),tInterval=(e,t,n)=>({duration:t*n,timeInterval:e,step:n}),TickIntervals=[tInterval(second,durationSecond,1),tInterval(second,durationSecond,5),tInterval(second,durationSecond,15),tInterval(second,durationSecond,30),tInterval(minute,durationMinute,1),tInterval(minute,durationMinute,5),tInterval(minute,durationMinute,15),tInterval(minute,durationMinute,30),tInterval(hour,durationHour,1),tInterval(hour,durationHour,3),tInterval(hour,durationHour,6),tInterval(hour,durationHour,12),tInterval(day,durationDay,1),tInterval(day,durationDay,2),tInterval(sunday,durationWeek,1),tInterval(sunday,durationWeek,2),tInterval(sunday,durationWeek,3),tInterval(month,durationMonth,1),tInterval(month,durationMonth,2),tInterval(month,durationMonth,3),tInterval(month,durationMonth,4),tInterval(month,durationMonth,6),tInterval(year,durationYear,1)],TickMultipliers=[1,2,5,10];function isCloseToInteger(e,t){return Math.abs(Math.round(e)-e)<t}function createTicks(e,t,n,i,s,r){if(n<2)return[e,t];const a=tickStep(e,t,n,i,s);if(!Number.isFinite(a))return[];if(isCloseToInteger(e/a,1e-12)||(e=Math.ceil(e/a)*a),isCloseToInteger(t/a,1e-12)||(t=Math.floor(t/a)*a),r!=null&&r[0]!==0&&r[1]!==1){const c=t-e,o=e+c*r[0],h=t-c*(1-r[1]);return range(o-o%a,h+h%a,a)}return range(e,t,a)}function tickStep(e,t,n,i=0,s=1/0){if(e===t)return(0,import_ag_charts_core27.clamp)(1,i,s);if(n<1)return NaN;const r=Math.abs(t-e),a=10**Math.floor(Math.log10(r/n));let c=NaN,o=1/0,h=!1;for(const l of TickMultipliers){const u=Math.ceil(r/(l*a)),d=u>=i&&u<=s;if(h&&!d)continue;const f=Math.abs(u-n);(o>f||h!==d)&&(h||(h=d),o=f,c=l)}return c*a}function decimalPlaces(e){for(let t=e.length-1;t>=0;t-=1)if(e[t]!=="0")return t+1;return 0}function tickFormat(e,t){const n=(0,import_ag_charts_core27.parseNumberFormat)(t??",f");(n.precision==null||isNaN(n.precision))&&(!n.type||"eEFgGnprs".includes(n.type)?n.precision=Math.max(...e.map(s=>{if(!Number.isFinite(s))return 0;const[r,a]=s.toExponential((n.type?6:12)-1).split(/[.e]/g);return(r!=="1"&&r!=="-1"?1:0)+decimalPlaces(a)+1})):"f%".includes(n.type)&&(n.precision=Math.max(...e.map(s=>{if(!Number.isFinite(s)||s===0)return 0;const r=Math.floor(Math.log10(Math.abs(s))),a=n.type?6:12,c=s.toExponential(a-1).split(/[.e]/g)[1],o=decimalPlaces(c);return Math.max(0,o-r)}))));const i=(0,import_ag_charts_core27.createNumberFormatter)(n);return s=>i(Number(s))}function range(e,t,n){if(!Number.isFinite(n)||n<=0)return[];const i=10**(0,import_ag_charts_core27.countFractionDigits)(n),s=Math.min(e,t),r=Math.max(e,t),a=[];for(let c=0;;c+=1){const o=Math.round((s+n*c)*i)/i;if(o>r)break;a.push(o)}return a}function isDenseInterval(e,t){return e>=t?(import_ag_charts_core27.Logger.warnOnce("the configured interval results in more than 1 item per pixel, ignoring. Supply a larger interval or omit this configuration"),!0):!1}function niceTicksDomain(e,t){const n=Math.abs(t-e),i=10**Math.floor(Math.log10(n));let s=1/0,r=[e,t];for(const a of TickMultipliers){const c=a*i,o=Math.floor(e/c)*c,h=Math.ceil(t/c)*c,l=1-n/Math.abs(h-o);s>l&&(s=l,r=[o,h])}return r}var _ContinuousScale=class rt extends AbstractScale{constructor(t=[],n=[]){super(),this.domain=t,this.range=n,this.defaultClamp=!1}static is(t){return t instanceof rt}normalizeDomains(...t){let n,i=1/0,s,r=-1/0;for(const a of t)for(const c of a){const o=c.valueOf();o<i&&(i=o,n=c),o>r&&(r=o,s=c)}return n!=null&&s!=null?{domain:[n,s],animatable:!0}:{domain:[],animatable:!1}}transform(t){return t}transformInvert(t){return t}calcBandwidth(t=1){const{domain:n}=this,i=this.getPixelRange();if(n.length===0)return i;const s=Math.abs(n[1].valueOf()-n[0].valueOf())/t+1,r=Math.floor(i),a=Math.min(s,r);return i/Math.max(1,a)}convert(t,n=this.defaultClamp){const{domain:i}=this;if(!i||i.length<2)return NaN;const s=Number(this.transform(i[0])),r=Number(this.transform(i[1])),a=Number(this.transform(t)),{range:c}=this,[o,h]=c;if(n){const[l,u]=findMinMax([s,r]);if(a<l)return o;if(a>u)return h}return s===r?(o+h)/2:a===s?o:a===r?h:o+(a-s)/(r-s)*(h-o)}invert(t,n){const i=this.domain.map(l=>this.transform(l)),[s,r]=i,{range:a}=this,[c,o]=a;let h;return c===o?h=this.toDomain((Number(s)+Number(r))/2):h=this.toDomain(Number(s)+(t-c)/(o-c)*(Number(r)-Number(s))),this.transformInvert(h)}getPixelRange(){const[t,n]=this.range;return Math.abs(n-t)}};_ContinuousScale.defaultTickCount=5;var ContinuousScale=_ContinuousScale,LinearScale=class at extends ContinuousScale{constructor(){super([0,1],[0,1]),this.type="number"}static getTickStep(t,n,i){const{interval:s,tickCount:r=ContinuousScale.defaultTickCount,minTickCount:a,maxTickCount:c}=i;return s??tickStep(t,n,r,a,c)}toDomain(t){return t}ticks({interval:t,tickCount:n=ContinuousScale.defaultTickCount,minTickCount:i,maxTickCount:s},r=this.domain,a){if(!r||r.length<2||n<1||!r.every(isFinite))return[];const[c,o]=r;if(t){const h=Math.abs(t);if(!isDenseInterval((o-c)/h,this.getPixelRange()))return range(c,o,h)}return createTicks(c,o,n,i,s,a)}niceDomain(t,n=this.domain){if(n.length<2)return[];const{tickCount:i=ContinuousScale.defaultTickCount}=t;let[s,r]=n;if(i===1)[s,r]=niceTicksDomain(s,r);else if(i>1){const a=s>r?Math.ceil:Math.floor,c=s>r?Math.floor:Math.ceil,o=4;for(let h=0;h<o;h++){const l=s,u=r,d=at.getTickStep(s,r,t),[f,p]=n;if(s=a(f/d)*d,r=c(p/d)*d,s===l&&r===u)break}}return[s,r]}tickFormatter({ticks:t,fractionDigits:n,specifier:i}){return i!=null?tickFormat(t,i):s=>formatValue(s,n)}datumFormatter({ticks:t,fractionDigits:n,specifier:i}){return i!=null?tickFormat(t,i):s=>formatValue(s,n+1)}},import_ag_charts_core28=require("ag-charts-core"),cmp=(e,t)=>Math.sign(e-t);function compareZIndex(e,t){if(typeof e=="number"&&typeof t=="number")return cmp(e,t);const n=typeof e=="number"?[e]:e,i=typeof t=="number"?[t]:t,s=Math.min(n.length,i.length);for(let r=0;r<s;r+=1){const a=cmp(n[r],i[r]);if(a!==0)return a}return cmp(n.length,i.length)}var sharedOffscreenCanvas,_Group=class q extends Node{constructor(t){super(t),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=t?.renderToOffscreenCanvas===!0}static is(t){return t instanceof q}static computeChildrenBBox(t,n=!0){return BBox.merge(Node.extractBBoxes(t,n))}static compareChildren(t,n){return compareZIndex(t.zIndex,n.zIndex)||t.serialNumber-n.serialNumber}containsPoint(t,n){return!0}computeBBox(){return q.computeChildrenBBox(this.children())}computeSafeClippingBBox(t){const n=this.computeBBox();if(!n.isFinite())return;let i=0;const s=4;for(const d of this.descendants())d instanceof Shape&&(i=Math.max(i,d.strokeWidth));const r=Math.max(1,i/2*s),{x:a,y:c}=Transformable.toCanvasPoint(this,0,0),o=alignBefore(t,a+n.x-r)-a,h=alignBefore(t,c+n.y-r)-c,l=Math.ceil(n.x+n.width-o+r),u=Math.ceil(n.y+n.height-h+r);return new BBox(o,h,l,u)}prepareSharedCanvas(t,n,i){return sharedOffscreenCanvas==null||sharedOffscreenCanvas.pixelRatio!==i?sharedOffscreenCanvas=new HdpiOffscreenCanvas({width:t,height:n,pixelRatio:i}):sharedOffscreenCanvas.resize(t,n,i),sharedOffscreenCanvas}isDirty(t){const{width:n,height:i,devicePixelRatio:s}=t,{dirty:r,dirtyZIndex:a,layer:c}=this,o=c!=null&&(this._lastWidth!==n||this._lastHeight!==i),h=this._lastDevicePixelRatio!==s;if(this._lastWidth=n,this._lastHeight=i,this._lastDevicePixelRatio=s,r||a||o||h)return!0;for(const l of this.children())if(l.dirty)return!0;return!1}preRender(t){const n=super.preRender(t,0);return n.groups+=1,n.nonGroups-=1,this.renderToOffscreenCanvas&&!this.optimizeForInfrequentRedraws&&n.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),n}render(t){const{layer:n,renderToOffscreenCanvas:i}=this,s={...t};if(!i){this.renderInContext(s),super.render(s);return}const{ctx:r,stats:a,devicePixelRatio:c}=t;let{image:o}=this;if(this.isDirty(t)){o?.bitmap.close(),o=void 0;const l=n?void 0:this.computeSafeClippingBBox(c),u=(d,...f)=>{const p=d.context;s.ctx=p,d.clear(),p.save(),p.setTransform(...f),p.globalAlpha=1,this.renderInContext(s),p.restore(),p.verifyDepthZero?.()};if(n)u(n,r.getTransform());else if(l){const{x:d,y:f,width:p,height:m}=l,g=this.prepareSharedCanvas(p,m,c);u(g,c,0,0,c,-d*c,-f*c),o={bitmap:g.transferToImageBitmap(),x:d,y:f,width:p,height:m}}else this.dirtyZIndex&&this.sortChildren(q.compareChildren);this.image=o,a&&a.layersRendered++}else this.skipRender(s),a&&a.layersSkipped++;const{globalAlpha:h}=r;if(r.globalAlpha=h*this.opacity,n)r.save(),r.resetTransform(),n.drawImage(r),r.restore();else if(o){const{bitmap:l,x:u,y:d,width:f,height:p}=o;r.drawImage(l,0,0,f*c,p*c,u,d,f,p)}r.globalAlpha=h,super.render(s)}skipRender(t){const{stats:n}=t;for(const i of this.children())i.markClean(),n&&(n.nodesSkipped+=this.childNodeCounts.groups+this.childNodeCounts.nonGroups,n.opsSkipped+=this.childNodeCounts.complexity)}applyClip(t,n){const{x:i,y:s,width:r,height:a}=n;t.beginPath(),t.rect(i,s,r,a),t.clip()}renderInContext(t){const{ctx:n,stats:i}=t;this.dirtyZIndex&&this.sortChildren(q.compareChildren),n.save(),n.globalAlpha*=this.opacity,this.clipRect!=null&&(this.applyClip(n,this.clipRect),t.clipBBox=Transformable.toCanvas(this,this.clipRect));for(const s of this.children()){if(!s.visible){s.markClean(),i&&(i.nodesSkipped+=s.childNodeCounts.nonGroups+s.childNodeCounts.groups,i.opsSkipped+=s.childNodeCounts.complexity);continue}n.save(),s.render(t),n.restore()}n.restore()}setClipRect(t){this.clipRect=t?Transformable.fromCanvas(this,t):void 0}setClipRectCanvasSpace(t){this.clipRect=t}_setLayerManager(t){this.layer&&(this._layerManager?.removeLayer(this.layer),this.layer=void 0),super._setLayerManager(t)}getVisibility(){for(const t of this.traverseUp(!0))if(!t.visible)return!1;return!0}toSVG(){if(!this.visible)return;const t=[],n=[];for(const i of this.children()){const s=i.toSVG();s!=null&&(n.push(...s.elements),s.defs!=null&&t.push(...s.defs))}return{elements:n,defs:t}}};_Group.className="Group",__decorateClass([SceneChangeDetection({convertor:e=>(0,import_ag_charts_core28.clamp)(0,e,1)})],_Group.prototype,"opacity",2);var Group=_Group,ScalableGroup=class extends Scalable(Group){},RotatableGroup=class extends Rotatable(Group){},TranslatableGroup=class extends Translatable(Group){},TransformableGroup=class extends Rotatable(Translatable(Group)){},import_ag_charts_core31=require("ag-charts-core"),import_ag_charts_core29=require("ag-charts-core"),HdpiCanvas=class{constructor(e){this.enabled=!0,this.width=600,this.height=300;const{width:t,height:n,canvasElement:i,willReadFrequently:s=!1}=e;this.pixelRatio=e.pixelRatio??(0,import_ag_charts_core29.getWindow)("devicePixelRatio")??1,this.element=i??(0,import_ag_charts_core29.createElement)("canvas"),this.element.style.display="block",this.element.style.width=(t??this.width)+"px",this.element.style.height=(n??this.height)+"px",this.element.width=Math.round((t??this.width)*this.pixelRatio),this.element.height=Math.round((n??this.height)*this.pixelRatio),this.context=this.element.getContext("2d",{willReadFrequently:s}),this.onEnabledChange(),this.resize(t??0,n??0,this.pixelRatio),debugContext(this.context)}drawImage(e,t=0,n=0){return e.drawImage(this.context.canvas,t,n)}toDataURL(e){return this.element.toDataURL(e)}resize(e,t,n){if(!(e>0&&t>0))return;const{element:i,context:s}=this;i.width=Math.round(e*n),i.height=Math.round(t*n),s.setTransform(n,0,0,n,0,0),i.style.width=e+"px",i.style.height=t+"px",this.width=e,this.height=t,this.pixelRatio=n}clear(){clearContext(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")}};__decorateClass([ObserveChanges(e=>e.onEnabledChange())],HdpiCanvas.prototype,"enabled",2);var LayersManager=class{constructor(e){this.canvas=e,this.debug=Debug.create(!0,"scene"),this.layersMap=new Map,this.nextLayerId=0}get size(){return this.layersMap.size}resize(e,t,n){this.canvas.resize(e,t,n),this.layersMap.forEach(({canvas:i})=>i.resize(e,t,n))}addLayer(e){const{width:t,height:n,pixelRatio:i}=this.canvas,{name:s}=e,r=new HdpiOffscreenCanvas({width:t,height:n,pixelRatio:i});return this.layersMap.set(r,{id:this.nextLayerId++,name:s,canvas:r}),this.debug("Scene.addLayer() - layers",this.layersMap),r}removeLayer(e){this.layersMap.has(e)&&(this.layersMap.delete(e),e.destroy(),this.debug("Scene.removeLayer() -  layers",this.layersMap))}clear(){for(const e of this.layersMap.values())e.canvas.destroy();this.layersMap.clear()}},import_ag_charts_core30=require("ag-charts-core");function formatBytes(e){for(const t of["B","KB","MB","GB"]){if(e<1536)return`${e.toFixed(1)}${t}`;e/=1024}return`${e.toFixed(1)}TB}`}function memoryUsage(){if(!("memory"in performance))return;const{totalJSHeapSize:e,usedJSHeapSize:t,jsHeapSizeLimit:n}=performance.memory,i=[];for(const s of[t,e,n])typeof s=="number"&&i.push(formatBytes(s));return`Heap ${i.join(" / ")}`}function debugStats(e,t,n,i,s={},r=BBox.zero){if(!Debug.check("scene:stats","scene:stats:verbose"))return;const{layersRendered:a=0,layersSkipped:c=0,nodesRendered:o=0,nodesSkipped:h=0,opsPerformed:l=0,opsSkipped:u=0}=i??{},d=performance.now(),{start:f,...p}=t,m=Object.entries(p).map(([w,R])=>time(w,R)).filter(w=>w!=null).join(" + "),g=Object.entries(s).map(([w,R])=>`${w}: ${JSON.stringify(R)}`).join(" ; "),y=Debug.check("scene:stats:verbose"),b=memoryUsage(),x=[`${time("\u23F1\uFE0F",f,d)} (${m})`,`${g}`,`Layers: ${y?pct(a,c):e.size}`,y?`Nodes: ${pct(o,h)}`:null,y?`Ops: ${pct(l,u)}`:null,y&&b?b:null].filter(import_ag_charts_core30.isString),P=new SimpleTextMeasurer(w=>n.measureText(w)),S=new Map(x.map(w=>[w,P.measureLines(w)])),A=Math.max(...Array.from(S.values(),w=>w.width)),M=accumulate(S.values(),w=>w.height),v=2+r.x;n.save(),n.fillStyle="white",n.fillRect(v,0,A,M),n.fillStyle="black";let C=0;for(const[w,R]of S.entries())C+=R.height,n.fillText(w,v,C);n.restore()}function prepareSceneNodeHighlight(e){const t=(0,import_ag_charts_core30.toArray)((0,import_ag_charts_core30.getWindow)("agChartsSceneDebug")),n=[];for(const i of t)i==="layout"?n.push("seriesRoot","legend","root",/.*Axis-\d+-axis.*/):n.push(i);e.debugNodeSearch=n}function debugSceneNodeHighlight(e,t){e.save();for(const[n,i]of Object.entries(t)){const s=Transformable.toCanvas(i);if(!s){import_ag_charts_core30.Logger.log(`Scene.render() - no bbox for debugged node [${n}].`);continue}e.globalAlpha=.8,e.strokeStyle="red",e.lineWidth=1,e.strokeRect(s.x,s.y,s.width,s.height),e.fillStyle="red",e.strokeStyle="white",e.font="16px sans-serif",e.textBaseline="top",e.textAlign="left",e.lineWidth=2,e.strokeText(n,s.x,s.y,s.width),e.fillText(n,s.x,s.y,s.width)}e.restore()}var skippedProperties=new Set,allowedProperties=new Set(["gradient","zIndex","clipRect","cachedBBox","childNodeCounts","path","__zIndex","name","__scalingCenterX","__scalingCenterY","__rotationCenterX","__rotationCenterY","_previousDatum","__fill","__lineDash","borderPath","borderClipPath","_clipPath"]);function nodeProps(e){const{...t}=e;for(const n of Object.keys(t))allowedProperties.has(n)||typeof t[n]!="number"&&typeof t[n]!="string"&&typeof t[n]!="boolean"&&(skippedProperties.add(n),delete t[n]);return t}function buildTree(e,t){if(!Debug.check(!0,"scene"))return{};let n=0;return{node:t==="json"?nodeProps(e):e,name:e.name??e.id,dirty:e.dirty,...Array.from(e.children(),i=>buildTree(i,t)).reduce((i,s)=>{let{name:r}=s;const{node:{visible:a,opacity:c,zIndex:o,translationX:h,translationY:l,rotation:u,scalingX:d,scalingY:f},node:p}=s;(!a||c<=0)&&(r=`(${r})`),Group.is(p)&&p.renderToOffscreenCanvas&&(r=`*${r}*`);const m=Array.isArray(o)?`(${o.join(", ")})`:o,g=[`${(n++).toString().padStart(3,"0")}|`,`${r??"<unknown>"}`,`z: ${m}`,h&&`x: ${h}`,l&&`y: ${l}`,u&&`r: ${u}`,d!=null&&d!==1&&`sx: ${d}`,f!=null&&f!==1&&`sy: ${f}`].filter(x=>!!x).join(" ");let y=g,b=1;for(;i[y]!=null&&b<100;)y=`${g} (${b++})`;return i[y]=s,i},{})}}function buildDirtyTree(e){if(!e.dirty)return{dirtyTree:{},paths:[]};const t=Array.from(e.children(),s=>buildDirtyTree(s)).filter(s=>s.paths.length>0),n=Group.is(e)?e.name??e.id:e.id,i=t.length?t.flatMap(s=>s.paths).map(s=>`${n}.${s}`):[n];return{dirtyTree:{name:n,node:e,dirty:e.dirty,...t.map(s=>s.dirtyTree).filter(s=>s.dirty!=null).reduce((s,r)=>(s[r.name??"<unknown>"]=r,s),{})},paths:i}}function pct(e,t){const n=e+t;return`${e} / ${n} (${Math.round(100*e/n)}%)`}function time(e,t,n){const i=n!=null?n-t:t;return`${e}: ${Math.round(i*100)/100}ms`}function accumulate(e,t){let n=0;for(const i of e)n+=t(i);return n}var Scene=class{constructor(e){this.debug=Debug.create(!0,"scene"),this.id=createId(this),this.root=null,this.pendingSize=null,this.isDirty=!1,this.updateDebugFlags(),this.canvas=new HdpiCanvas(e),this.layersManager=new LayersManager(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(e){const{element:t}=this.canvas;return t.parentElement?.removeChild(t),e.appendChild(t),this}setRoot(e){return this.root===e?this:(this.isDirty=!0,this.root?._setLayerManager(),this.root=e,e&&(e.visible=!0,e._setLayerManager(this.layersManager)),this)}updateDebugFlags(){Debug.inDevelopmentMode(()=>Node._debugEnabled=!0)}clear(){this.canvas.clear()}attachNode(e){return this.appendChild(e),()=>this.removeChild(e)}appendChild(e){return this.root?.appendChild(e),this}removeChild(e){return this.root?.removeChild(e),this}download(e,t){(0,import_ag_charts_core31.downloadUrl)(this.canvas.toDataURL(t),e?.trim()??"image")}getDataURL(e){return this.canvas.toDataURL(e)}resize(e,t,n){return e=Math.round(e),t=Math.round(t),n??(n=this.pixelRatio),e>0&&t>0&&(e!==this.width||t!==this.height||n!==this.pixelRatio)?(this.pendingSize=[e,t,n],this.isDirty=!0,!0):!1}render(e){const{debugSplitTimes:t={start:performance.now()},extraDebugStats:n,seriesRect:i}=e??{},{canvas:s,canvas:{context:r}={},root:a,pendingSize:c,width:o,height:h,pixelRatio:l}=this;if(!r)return;const u=performance.now();let d=!1;if(c&&(d=!0,this.layersManager.resize(...c),this.pendingSize=null),a&&!a.visible){this.isDirty=!1;return}if(a?.dirty===!1&&!this.isDirty){this.debug.check()&&this.debug("Scene.render() - no-op",{tree:buildTree(a,"console")}),debugStats(this.layersManager,t,r,void 0,n,i);return}const f={ctx:r,width:o,height:h,devicePixelRatio:l,debugNodes:{}};Debug.check("scene:stats:verbose")&&(f.stats={layersRendered:0,layersSkipped:0,nodesRendered:0,nodesSkipped:0,opsPerformed:0,opsSkipped:0}),prepareSceneNodeHighlight(f);let p=!1;if((a?.dirty!==!1||d)&&(p=!0,s.clear()),a&&Debug.check("scene:dirtyTree")){const{dirtyTree:m,paths:g}=buildDirtyTree(a);Debug.create("scene:dirtyTree")("Scene.render() - dirtyTree",{dirtyTree:m,paths:g})}if(a&&p){if(a.visible&&a.preRender(f),this.debug.check()){const m=buildTree(a,"console");this.debug("Scene.render() - before",{canvasCleared:p,tree:m})}a.visible&&(r.save(),a.render(f),r.restore())}t["\u270D\uFE0F"]=performance.now()-u,r.verifyDepthZero?.(),this.isDirty=!1,debugStats(this.layersManager,t,r,f.stats,n,i),debugSceneNodeHighlight(r,f.debugNodes),a&&this.debug.check()&&this.debug("Scene.render() - after",{tree:buildTree(a,"console"),canvasCleared:p})}toSVG(){const{root:e,width:t,height:n}=this;if(e!=null)return Node.toSVG(e,t,n)}strip(){const{context:e,pixelRatio:t}=this.canvas;e.setTransform(t,0,0,t,0,0),this.layersManager.clear(),this.setRoot(null),this.isDirty=!1}destroy(){this.strip(),this.canvas.destroy(),Object.assign(this,{canvas:void 0})}};Scene.className="Scene";var import_ag_charts_core32=require("ag-charts-core"),Arc=class extends Path{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(0,import_ag_charts_core32.isNumberEqual)(normalizeAngle360(this.startAngle),normalizeAngle360(this.endAngle))}updatePath(){const e=this.path;e.clear(),e.arc(this.centerX,this.centerY,this.radius,this.startAngle,this.endAngle,this.counterClockwise),this.type===1?e.closePath():this.type===2&&!this.fullPie&&(e.lineTo(this.centerX,this.centerY),e.closePath())}computeBBox(){return new BBox(this.centerX-this.radius,this.centerY-this.radius,this.radius*2,this.radius*2)}isPointInPath(e,t){const n=this.getBBox();return this.type!==0&&n.containsPoint(e,t)&&this.path.isPointInPath(e,t)}};Arc.className="Arc",__decorateClass([ScenePathChangeDetection()],Arc.prototype,"centerX",2),__decorateClass([ScenePathChangeDetection()],Arc.prototype,"centerY",2),__decorateClass([ScenePathChangeDetection()],Arc.prototype,"radius",2),__decorateClass([ScenePathChangeDetection()],Arc.prototype,"startAngle",2),__decorateClass([ScenePathChangeDetection()],Arc.prototype,"endAngle",2),__decorateClass([ScenePathChangeDetection()],Arc.prototype,"counterClockwise",2),__decorateClass([ScenePathChangeDetection()],Arc.prototype,"type",2);var import_ag_charts_core33=require("ag-charts-core"),Line=class extends Shape{constructor(e={}){super(e),this.x1=0,this.y1=0,this.x2=0,this.y2=0,this.restoreOwnStyles()}set x(e){this.x1=e,this.x2=e}set y(e){this.y1=e,this.y2=e}get midPoint(){return{x:(this.x1+this.x2)/2,y:(this.y1+this.y2)/2}}computeBBox(){return new BBox(Math.min(this.x1,this.x2),Math.min(this.y1,this.y2),Math.abs(this.x2-this.x1),Math.abs(this.y2-this.y1))}isPointInPath(e,t){return this.x1===this.x2||this.y1===this.y2?this.getBBox().clone().grow(this.strokeWidth/2).containsPoint(e,t):!1}distanceSquared(e,t){const{x1:n,y1:i,x2:s,y2:r}=this;return lineDistanceSquared(e,t,n,i,s,r,1/0)}render(e){const{ctx:t,devicePixelRatio:n}=e;let{x1:i,y1:s,x2:r,y2:a}=this;if(i===r){const{strokeWidth:c}=this,o=Math.round(i*n)/n+Math.trunc(c*n)%2/(n*2);i=o,r=o}else if(s===a){const{strokeWidth:c}=this,o=Math.round(s*n)/n+Math.trunc(c*n)%2/(n*2);s=o,a=o}t.beginPath(),t.moveTo(i,s),t.lineTo(r,a),this.fillStroke(t),this.fillShadow?.markClean(),super.render(e)}toSVG(){if(!this.visible)return;const e=(0,import_ag_charts_core33.createSvgElement)("line");return e.setAttribute("x1",String(this.x1)),e.setAttribute("y1",String(this.y1)),e.setAttribute("x2",String(this.x2)),e.setAttribute("y2",String(this.y2)),this.applySvgStrokeAttributes(e),{elements:[e]}}};Line.className="Line",Line.defaultStyles={...Shape.defaultStyles,fill:void 0,strokeWidth:1},__decorateClass([SceneChangeDetection()],Line.prototype,"x1",2),__decorateClass([SceneChangeDetection()],Line.prototype,"y1",2),__decorateClass([SceneChangeDetection()],Line.prototype,"x2",2),__decorateClass([SceneChangeDetection()],Line.prototype,"y2",2);var import_ag_charts_core34=require("ag-charts-core");function rotatePoint(e,t,n){const i=Math.sqrt(e**2+t**2),r=Math.atan2(t,e)+n;return{x:Math.cos(r)*i,y:Math.sin(r)*i}}var RadialColumnShape=class extends Path{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(e){}computeBBox(){const{innerRadius:e,outerRadius:t,columnWidth:n}=this,i=this.getRotation(),s=-n/2,r=n/2,a=-t,c=-e;let o=1/0,h=1/0,l=-1/0,u=-1/0;for(let d=0;d<4;d+=1){const{x:f,y:p}=rotatePoint(d%2===0?s:r,d<2?a:c,i);o=Math.min(f,o),h=Math.min(p,h),l=Math.max(f,l),u=Math.max(p,u)}return new BBox(o,h,l-o,u-h)}getRotation(){const{startAngle:e,endAngle:t}=this,n=angleBetween(e,t);return normalizeAngle360(e+n/2+Math.PI/2)}updatePath(){const{isBeveled:e}=this;e?this.updateBeveledPath():this.updateRectangularPath(),this.checkPathDirty()}updateRectangularPath(){const{columnWidth:e,innerRadius:t,outerRadius:n,path:i}=this,s=-e/2,r=e/2,a=-n,c=-t,o=this.getRotation(),h=[[s,c],[s,a],[r,a],[r,c]].map(([l,u])=>rotatePoint(l,u,o));i.clear(!0),i.moveTo(h[0].x,h[0].y),i.lineTo(h[1].x,h[1].y),i.lineTo(h[2].x,h[2].y),i.lineTo(h[3].x,h[3].y),i.closePath()}updateBeveledPath(){const{columnWidth:e,path:t,outerRadius:n,innerRadius:i,axisInnerRadius:s,axisOuterRadius:r,isRadiusAxisReversed:a}=this,c=(0,import_ag_charts_core34.isNumberEqual)(i,s),o=Math.asin(e/2/i),h=this.getRotation(),l=(v,C)=>rotatePoint(v,C,h),u=(v,C)=>Math.sqrt(v**2+C**2),d=(v,C)=>C>v?0:Math.sqrt(v**2-C**2),f=(v,C,w)=>w?v<C:v>C,p=c&&!isNaN(o)&&o<Math.PI/6;let m=-e/2,g=e/2;const y=-n,b=-i*(p?Math.cos(o):1),x=f(r,u(i,e/2),!a);if(x){const v=d(r,i);m=-v,g=v}t.clear(!0);const P=l(m,b);t.moveTo(P.x,P.y);const S=(0,import_ag_charts_core34.isNumberEqual)(i,n),A=f(r,u(n,e/2),!a);if(S&&p)t.arc(0,0,i,normalizeAngle360(-o-Math.PI/2)+h,normalizeAngle360(o-Math.PI/2)+h,!1);else if(A){const v=-d(r,e/2),C=d(r,n);if(!x){const w=l(m,v);t.lineTo(w.x,w.y)}if(t.arc(0,0,r,Math.atan2(v,m)+h,Math.atan2(y,-C)+h,!1),!(0,import_ag_charts_core34.isNumberEqual)(C,0)){const w=l(C,y);t.lineTo(w.x,w.y)}t.arc(0,0,r,Math.atan2(y,C)+h,Math.atan2(v,g)+h,!1)}else{const v=l(m,y),C=l(g,y);t.lineTo(v.x,v.y),t.lineTo(C.x,C.y)}const M=l(g,b);if(t.lineTo(M.x,M.y),p)t.arc(0,0,i,normalizeAngle360(o-Math.PI/2)+h,normalizeAngle360(-o-Math.PI/2)+h,!0);else{const v=l(m,b);t.lineTo(v.x,v.y)}t.closePath()}};RadialColumnShape.className="RadialColumnShape",__decorateClass([ScenePathChangeDetection()],RadialColumnShape.prototype,"isBeveled",2),__decorateClass([ScenePathChangeDetection()],RadialColumnShape.prototype,"columnWidth",2),__decorateClass([ScenePathChangeDetection()],RadialColumnShape.prototype,"startAngle",2),__decorateClass([ScenePathChangeDetection()],RadialColumnShape.prototype,"endAngle",2),__decorateClass([ScenePathChangeDetection()],RadialColumnShape.prototype,"outerRadius",2),__decorateClass([ScenePathChangeDetection()],RadialColumnShape.prototype,"innerRadius",2),__decorateClass([ScenePathChangeDetection()],RadialColumnShape.prototype,"axisInnerRadius",2),__decorateClass([ScenePathChangeDetection()],RadialColumnShape.prototype,"axisOuterRadius",2),__decorateClass([ScenePathChangeDetection()],RadialColumnShape.prototype,"isRadiusAxisReversed",2);function getRadialColumnWidth(e,t,n,i,s){const r=angleBetween(e,t),a=r*(1-i)/2;if(e+=a,t-=a,r<.001)return 2*n*s;if(r>=2*Math.PI){const f=e+r/2;e=f-Math.PI,t=f+Math.PI}const c=n*Math.cos(e),o=n*Math.sin(e),h=n*Math.cos(t),l=n*Math.sin(t),u=Math.floor(Math.sqrt((c-h)**2+(o-l)**2)),d=2*n*s;return Math.max(1,Math.min(d,u))}var drawCorner=(e,{x0:t,y0:n,x1:i,y1:s,cx:r,cy:a},c,o)=>{if(o&&e.moveTo(t,n),t!==i||n!==s){const h=Math.atan2(n-a,t-r),l=Math.atan2(s-a,i-r);e.arc(r,a,c,h,l)}else e.lineTo(t,n)},epsilon=1e-6,cornerEdges=(e,t,n,i,s)=>{let r=!1,a=!1,c=i-Math.sqrt(Math.max(s**2-n**2,0)),o=0,h=0,l=n-Math.sqrt(Math.max(s**2-i**2,0));return c>e?(r=!0,c=e,o=n-Math.sqrt(Math.max(s**2-(i-e)**2))):c<epsilon&&(c=0),l>t?(a=!0,h=i-Math.sqrt(Math.max(s**2-(n-t)**2)),l=t):l<epsilon&&(l=0),{leading0:c,leading1:o,trailing0:h,trailing1:l,leadingClipped:r,trailingClipped:a}},clippedRoundRect=(e,t,n,i,s,r,a)=>{let{topLeft:c,topRight:o,bottomRight:h,bottomLeft:l}=r;const u=Math.max(c+l,o+h),d=Math.max(c+o,l+h);if(u<=0&&d<=0){a==null?e.rect(t,n,i,s):e.rect(a.x,a.y,a.width,a.height);return}else if(a==null&&c===o&&c===h&&c===l){e.roundRect(t,n,i,s,c);return}if(i<0&&(t+=i,i=Math.abs(i)),s<0&&(n+=s,s=Math.abs(s)),i<=0||s<=0)return;if(a==null)a=new BBox(t,n,i,s);else{const M=Math.max(t,a.x),v=Math.min(t+i,a.x+a.width),C=Math.max(n,a.y),w=Math.min(n+s,a.y+a.height);a=new BBox(M,C,v-M,w-C)}const f=Math.max(u/s,d/i,1);f>1&&(c/=f,o/=f,h/=f,l/=f);let p=!0,m=!0,g=!0,y=!0,b,x,P,S;if(p){const M=cornerEdges(a.height,a.width,Math.max(t+c-a.x,0),Math.max(n+c-a.y,0),c);M.leadingClipped&&(y=!1),M.trailingClipped&&(m=!1);const v=Math.max(a.x+M.leading1,a.x),C=Math.max(a.y+M.leading0,a.y),w=Math.max(a.x+M.trailing1,a.x),R=Math.max(a.y+M.trailing0,a.y),N=t+c,F=n+c;b={x0:v,y0:C,x1:w,y1:R,cx:N,cy:F}}if(m){const M=cornerEdges(a.width,a.height,Math.max(n+o-a.y,0),Math.max(a.x+a.width-(t+i-o),0),o);M.leadingClipped&&(p=!1),M.trailingClipped&&(g=!1);const v=Math.min(a.x+a.width-M.leading0,a.x+a.width),C=Math.max(a.y+M.leading1,a.y),w=Math.min(a.x+a.width-M.trailing0,a.x+a.width),R=Math.max(a.y+M.trailing1,a.y),N=t+i-o,F=n+o;x={x0:v,y0:C,x1:w,y1:R,cx:N,cy:F}}if(g){const M=cornerEdges(a.height,a.width,Math.max(a.x+a.width-(t+i-h),0),Math.max(a.y+a.height-(n+s-h),0),h);M.leadingClipped&&(m=!1),M.trailingClipped&&(y=!1);const v=Math.min(a.x+a.width-M.leading1,a.x+a.width),C=Math.min(a.y+a.height-M.leading0,a.y+a.height),w=Math.min(a.x+a.width-M.trailing1,a.x+a.width),R=Math.min(a.y+a.height-M.trailing0,a.y+a.height),N=t+i-h,F=n+s-h;P={x0:v,y0:C,x1:w,y1:R,cx:N,cy:F}}if(y){const M=cornerEdges(a.width,a.height,Math.max(a.y+a.height-(n+s-l),0),Math.max(t+l-a.x,0),l);M.leadingClipped&&(g=!1),M.trailingClipped&&(p=!1);const v=Math.max(a.x+M.leading0,a.x),C=Math.min(a.y+a.height-M.leading1,a.y+a.height),w=Math.max(a.x+M.trailing0,a.x),R=Math.min(a.y+a.height-M.trailing1,a.y+a.height),N=t+l,F=n+s-l;S={x0:v,y0:C,x1:w,y1:R,cx:N,cy:F}}let A=!1;p&&b!=null&&(drawCorner(e,b,c,!A),A||(A=!0)),m&&x!=null&&(drawCorner(e,x,o,!A),A||(A=!0)),g&&P!=null&&(drawCorner(e,P,h,!A),A||(A=!0)),y&&S!=null&&drawCorner(e,S,l,!A),e.closePath()},Rect=class extends Path{constructor(){super(...arguments),this.borderPath=new ExtendedPath2D,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=Shape.defaultStyles.strokeWidth,this.effectiveStrokeWidth=Shape.defaultStyles.strokeWidth,this.hittester=super.isPointInPath.bind(this),this.distanceCalculator=super.distanceSquaredTransformedPoint.bind(this),this.microPixelEffectOpacity=1}set cornerRadius(e){this.topLeftCornerRadius=e,this.topRightCornerRadius=e,this.bottomRightCornerRadius=e,this.bottomLeftCornerRadius=e}isDirtyPath(){return this.lastUpdatePathStrokeWidth!==this.strokeWidth||!!(this.path.isDirty()||this.borderPath.isDirty())}updatePath(){const{path:e,borderPath:t,crisp:n,topLeftCornerRadius:i,topRightCornerRadius:s,bottomRightCornerRadius:r,bottomLeftCornerRadius:a}=this;let{x:c,y:o,width:h,height:l,strokeWidth:u,clipBBox:d}=this;const p=1/(this.layerManager?.canvas.pixelRatio??1);let m=1;if(e.clear(!0),t.clear(!0),n&&(h<=p&&(m*=h/p),l<=p&&(m*=l/p),h=this.align(c,h),l=this.align(o,l),c=this.align(c),o=this.align(o),d=d!=null?new BBox(this.align(d.x),this.align(d.y),this.align(d.x,d.width),this.align(d.y,d.height)):void 0),u)if(h<p){const g=c+p/2;t.moveTo(g,o),t.lineTo(g,o+l),u=p,this.borderClipPath=void 0}else if(l<p){const g=o+p/2;t.moveTo(c,g),t.lineTo(c+h,g),u=p,this.borderClipPath=void 0}else if(u<h&&u<l){const g=u/2;c+=g,o+=g,h-=u,l-=u;const y=d?.clone().shrink(g),b={topLeft:i>0?i-u:0,topRight:s>0?s-u:0,bottomRight:r>0?r-u:0,bottomLeft:a>0?a-u:0};this.borderClipPath=void 0,h>0&&l>0&&(y==null||y?.width>0&&y?.height>0)&&(clippedRoundRect(e,c,o,h,l,b,y),clippedRoundRect(t,c,o,h,l,b,y))}else this.borderClipPath=this.borderClipPath??new ExtendedPath2D,this.borderClipPath.clear(!0),this.borderClipPath.rect(c,o,h,l),t.rect(c,o,h,l);else{const g={topLeft:i,topRight:s,bottomRight:r,bottomLeft:a};this.borderClipPath=void 0,clippedRoundRect(e,c,o,h,l,g,d)}if([i,s,r,a].every(g=>g===0)){const g=this.getBBox();this.hittester=g.containsPoint.bind(g),this.distanceSquared=(y,b)=>this.getBBox().distanceSquared(y,b)}else this.hittester=super.isPointInPath,this.distanceCalculator=super.distanceSquaredTransformedPoint;this.effectiveStrokeWidth=u,this.lastUpdatePathStrokeWidth=u,this.microPixelEffectOpacity=m}computeBBox(){const{x:e,y:t,width:n,height:i,clipBBox:s}=this;return s?.clone()??new BBox(e,t,n,i)}isPointInPath(e,t){return this.hittester(e,t)}get midPoint(){return{x:this.x+this.width/2,y:this.y+this.height/2}}distanceSquared(e,t){return this.distanceCalculator(e,t)}applyFillAlpha(e){const{fillOpacity:t,microPixelEffectOpacity:n,opacity:i}=this;e.globalAlpha*=i*t*n}renderStroke(e){const{stroke:t,effectiveStrokeWidth:n}=this;if(t&&n){const{globalAlpha:i}=e,{strokeOpacity:s,lineDash:r,lineDashOffset:a,lineCap:c,lineJoin:o,borderPath:h,borderClipPath:l,opacity:u,microPixelEffectOpacity:d}=this;l&&e.clip(l.getPath2D()),this.applyStroke(e),e.globalAlpha*=u*s*d,e.lineWidth=n,r&&e.setLineDash(r),a&&(e.lineDashOffset=a),c&&(e.lineCap=c),o&&(e.lineJoin=o),e.stroke(h.getPath2D()),e.globalAlpha=i}}};Rect.className="Rect",__decorateClass([ScenePathChangeDetection()],Rect.prototype,"x",2),__decorateClass([ScenePathChangeDetection()],Rect.prototype,"y",2),__decorateClass([ScenePathChangeDetection()],Rect.prototype,"width",2),__decorateClass([ScenePathChangeDetection()],Rect.prototype,"height",2),__decorateClass([ScenePathChangeDetection()],Rect.prototype,"topLeftCornerRadius",2),__decorateClass([ScenePathChangeDetection()],Rect.prototype,"topRightCornerRadius",2),__decorateClass([ScenePathChangeDetection()],Rect.prototype,"bottomRightCornerRadius",2),__decorateClass([ScenePathChangeDetection()],Rect.prototype,"bottomLeftCornerRadius",2),__decorateClass([ScenePathChangeDetection()],Rect.prototype,"clipBBox",2),__decorateClass([ScenePathChangeDetection()],Rect.prototype,"crisp",2);var SectorBox=class X{constructor(t,n,i,s){this.startAngle=t,this.endAngle=n,this.innerRadius=i,this.outerRadius=s}clone(){const{startAngle:t,endAngle:n,innerRadius:i,outerRadius:s}=this;return new X(t,n,i,s)}equals(t){return this.startAngle===t.startAngle&&this.endAngle===t.endAngle&&this.innerRadius===t.innerRadius&&this.outerRadius===t.outerRadius}[interpolate](t,n){return new X(this.startAngle*(1-n)+t.startAngle*n,this.endAngle*(1-n)+t.endAngle*n,this.innerRadius*(1-n)+t.innerRadius*n,this.outerRadius*(1-n)+t.outerRadius*n)}};function sectorBox({startAngle:e,endAngle:t,innerRadius:n,outerRadius:i}){let s=1/0,r=1/0,a=-1/0,c=-1/0;const o=(h,l)=>{s=Math.min(h,s),r=Math.min(l,r),a=Math.max(h,a),c=Math.max(l,c)};return o(n*Math.cos(e),n*Math.sin(e)),o(n*Math.cos(t),n*Math.sin(t)),o(i*Math.cos(e),i*Math.sin(e)),o(i*Math.cos(t),i*Math.sin(t)),isBetweenAngles(0,e,t)&&o(i,0),isBetweenAngles(Math.PI*.5,e,t)&&o(0,i),isBetweenAngles(Math.PI,e,t)&&o(-i,0),isBetweenAngles(Math.PI*1.5,e,t)&&o(0,-i),new BBox(s,r,a-s,c-r)}function isPointInSector(e,t,n){const i=Math.sqrt(Math.pow(e,2)+Math.pow(t,2)),{innerRadius:s,outerRadius:r}=n;if(n.startAngle===n.endAngle||i<Math.min(s,r)||i>Math.max(s,r))return!1;const a=normalizeAngle180(n.startAngle),c=normalizeAngle180(n.endAngle),o=Math.atan2(t,e);return a<c?o<=c&&o>=a:o<=c&&o>=-Math.PI||o>=a&&o<=Math.PI}function radiiScalingFactor(e,t,n,i){if(n===0&&i===0)return 0;if(Math.asin(Math.abs(1*n)/(e+1*n))+Math.asin(Math.abs(1*i)/(e+1*i))-t<0)return 1;let r=0,a=1;for(let c=0;c<8;c+=1){const o=(r+a)/2;Math.asin(Math.abs(o*n)/(e+o*n))+Math.asin(Math.abs(o*i)/(e+o*i))-t<0?r=o:a=o}return r}var delta2=1e-6;function clockwiseAngle(e,t){return angleBetween(e,t)<delta2?t:normalizeAngle360(e-t)+t}function clockwiseAngles(e,t,n=0){const s=Math.abs(t-e)>=2*Math.PI?2*Math.PI:normalizeAngle360(t-e);return e=clockwiseAngle(e,n),t=e+s,{startAngle:e,endAngle:t}}function arcRadialLineIntersectionAngle(e,t,n,i,s,r){const a=Math.sin(r),c=Math.cos(r),o=e**2+t**2-n**2;let h,l,u,d;if(c>.5){const x=a/c,P=1+x**2,S=-2*(e+t*x),A=S**2-4*P*o;if(A<0)return;const M=(-S+Math.sqrt(A))/(2*P),v=(-S-Math.sqrt(A))/(2*P);h=M,l=M*x,u=v,d=v*x}else{const x=c/a,P=1+x**2,S=-2*(t+e*x),A=S**2-4*P*o;if(A<0)return;const M=(-S+Math.sqrt(A))/(2*P),v=(-S-Math.sqrt(A))/(2*P);h=M*x,l=M,u=v*x,d=v}const f=c,p=a,m=h*f+l*p,g=u*f+d*p,y=m>0?clockwiseAngle(Math.atan2(l-t,h-e),i):NaN,b=g>0?clockwiseAngle(Math.atan2(d-t,u-e),i):NaN;if(y>=i&&y<=s)return y;if(b>=i&&b<=s)return b}function arcCircleIntersectionAngle(e,t,n,i,s,r){const a=Math.hypot(e,t),c=(a**2-n**2+r**2)/(2*a),o=a-c,h=Math.atan2(t,e),l=Math.acos(-o/n),u=clockwiseAngle(h+l,i),d=clockwiseAngle(h-l,i);if(u>=i&&u<=s)return u;if(d>=i&&d<=s)return d}var Arc2=class{constructor(e,t,n,i,s){this.cx=e,this.cy=t,this.r=n,this.a0=i,this.a1=s,this.a0>=this.a1&&(this.a0=NaN,this.a1=NaN)}isValid(){return Number.isFinite(this.a0)&&Number.isFinite(this.a1)}pointAt(e){return{x:this.cx+this.r*Math.cos(e),y:this.cy+this.r*Math.sin(e)}}clipStart(e){e==null||!this.isValid()||e<this.a0||(this.a0=e,(Number.isNaN(e)||this.a0>=this.a1)&&(this.a0=NaN,this.a1=NaN))}clipEnd(e){e==null||!this.isValid()||e>this.a1||(this.a1=e,(Number.isNaN(e)||this.a0>=this.a1)&&(this.a0=NaN,this.a1=NaN))}},Sector=class extends Path{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(e){this.concentricEdgeInset=e,this.radialEdgeInset=e}set cornerRadius(e){this.startOuterCornerRadius=e,this.endOuterCornerRadius=e,this.startInnerCornerRadius=e,this.endInnerCornerRadius=e}computeBBox(){return sectorBox(this).translate(this.centerX,this.centerY)}normalizedRadii(){const{concentricEdgeInset:e}=this;let{innerRadius:t,outerRadius:n}=this;return t=t>0?t+e:0,n=Math.max(n-e,0),{innerRadius:t,outerRadius:n}}normalizedClipSector(){const{clipSector:e}=this;if(e==null)return;const{startAngle:t,endAngle:n}=clockwiseAngles(this.startAngle,this.endAngle),{innerRadius:i,outerRadius:s}=this.normalizedRadii(),r=clockwiseAngles(e.startAngle,e.endAngle,t);return new SectorBox(Math.max(t,r.startAngle),Math.min(n,r.endAngle),Math.max(i,e.innerRadius),Math.min(s,e.outerRadius))}getAngleOffset(e){return e>0?this.radialEdgeInset/e:0}arc(e,t,n,i,s,r,a,c){if(e<=0)return;const{startAngle:o,endAngle:h}=clockwiseAngles(this.startAngle,this.endAngle),{innerRadius:l,outerRadius:u}=this.normalizedRadii(),d=this.normalizedClipSector();if(c&&l<=0)return;const f=c?this.getAngleOffset(l+e):this.getAngleOffset(u-e),p=a?o+f+t:h-f-t,m=c?l+e:u-e,g=m*Math.cos(p),y=m*Math.sin(p);if(d!=null&&(!a&&!(p>=o-1e-6&&p<=d.endAngle-1e-6)||a&&!(p>=d.startAngle+1e-6&&p<=h-1e-6)||c&&m<d.innerRadius-1e-6||!c&&m>d.outerRadius+1e-6))return;const b=new Arc2(g,y,e,n,i);if(d!=null){c?(b.clipStart(arcRadialLineIntersectionAngle(g,y,e,n,i,d.endAngle)),b.clipEnd(arcRadialLineIntersectionAngle(g,y,e,n,i,d.startAngle))):(b.clipStart(arcRadialLineIntersectionAngle(g,y,e,n,i,d.startAngle)),b.clipEnd(arcRadialLineIntersectionAngle(g,y,e,n,i,d.endAngle)));let M,v;if(a?(M=arcCircleIntersectionAngle(g,y,e,n,i,d.innerRadius),v=arcCircleIntersectionAngle(g,y,e,n,i,d.outerRadius)):(M=arcCircleIntersectionAngle(g,y,e,n,i,d.outerRadius),v=arcCircleIntersectionAngle(g,y,e,n,i,d.innerRadius)),b.clipStart(M),b.clipEnd(v),M!=null){const{x:C,y:w}=b.pointAt(M),R=clockwiseAngle(Math.atan2(w,C),o);a?r?.clipStart(R):s.clipEnd(R)}if(v!=null){const{x:C,y:w}=b.pointAt(v),R=clockwiseAngle(Math.atan2(w,C),o);a?s.clipStart(R):r?.clipEnd(R)}}if(d!=null){const{x:M,y:v}=b.pointAt((b.a0+b.a1)/2);if(!isPointInSector(M,v,d))return}const{x,y:P}=b.pointAt(a===c?b.a0:b.a1),S=clockwiseAngle(Math.atan2(P,x),o),A=c?r:s;return a?A?.clipStart(S):A?.clipEnd(S),b}updatePath(){const{path:t,centerX:n,centerY:i,concentricEdgeInset:s,radialEdgeInset:r}=this;let{startOuterCornerRadius:a,endOuterCornerRadius:c,startInnerCornerRadius:o,endInnerCornerRadius:h}=this;const{startAngle:l,endAngle:u}=clockwiseAngles(this.startAngle,this.endAngle),{innerRadius:d,outerRadius:f}=this.normalizedRadii(),p=this.normalizedClipSector(),m=u-l,g=m>=2*Math.PI-1e-6;if(t.clear(),d===0&&f===0||d>f)return;if((p?.startAngle??l)===(p?.endAngle??u))return;if(g&&this.clipSector==null&&a===0&&c===0&&o===0&&h===0){t.moveTo(n+f*Math.cos(l),i+f*Math.sin(l)),t.arc(n,i,f,l,u),d>s&&(t.moveTo(n+d*Math.cos(u),i+d*Math.sin(u)),t.arc(n,i,d,u,l,!0)),t.closePath();return}else if(this.clipSector==null&&Math.abs(d-f)<1e-6){t.arc(n,i,f,l,u,!1),t.arc(n,i,f,u,l,!0),t.closePath();return}const y=this.getAngleOffset(d),b=this.getAngleOffset(f);if(m<2*b)return;const P=(p?.innerRadius??d)>s,S=d<s||m<2*y,A=f-d,M=Math.max(a,o,c,h),v=M>0?Math.min(A/M,1):1;a*=v,c*=v,o*=v,h*=v;const C=radiiScalingFactor(f,m-2*b,-a,-c);if(a*=C,c*=C,!S&&P){const _=radiiScalingFactor(d,m-2*y,o,h);o*=_,h*=_}else o=0,h=0;const w=Math.max(a+o,c+h),R=w>0?Math.min(A/w,1):1;a*=R,c*=R,o*=R,h*=R;let N=0,F=0;const z=a/(f-a),j=c/(f-c);if(z>=0&&z<1-1e-6)N=Math.asin(z);else{N=m/2;const _=f/(1/Math.sin(N)+1);a=Math.min(_,a)}if(j>=0&&j<1-1e-6)F=Math.asin(j);else{F=m/2;const _=f/(1/Math.sin(F)+1);c=Math.min(_,c)}const V=Math.asin(o/(d+o)),U=Math.asin(h/(d+h)),J=p?.outerRadius??f,K=this.getAngleOffset(J),B=new Arc2(0,0,J,l+K,u-K),Z=p?.innerRadius??d,Q=this.getAngleOffset(Z),O=P?new Arc2(0,0,Z,l+Q,u-Q):void 0;p!=null&&(B.clipStart(p.startAngle),B.clipEnd(p.endAngle),O?.clipStart(p.startAngle),O?.clipEnd(p.endAngle));const tt=this.arc(a,N,l-Math.PI*.5,l+N,B,O,!0,!1),et=this.arc(c,F,u-F,u+Math.PI*.5,B,O,!1,!1),nt=this.arc(h,U,u+Math.PI*.5,u+Math.PI-U,B,O,!1,!0),H=this.arc(o,V,l+Math.PI+V,l+Math.PI*1.5,B,O,!0,!0);if(S){const _=m<Math.PI*.5?r*(1+Math.cos(m))/Math.sin(m):NaN;let T;_>0&&_<f?T=Math.max(Math.hypot(r,_),d):T=r,T=Math.max(T,d);const D=l+m*.5;t.moveTo(n+T*Math.cos(D),i+T*Math.sin(D))}else if(!(H?.isValid()===!0||O?.isValid()===!0)){const _=l+m/2,T=d*Math.cos(_),D=d*Math.sin(_);t.moveTo(n+T,i+D)}if(tt?.isValid()===!0){const{cx:_,cy:T,r:D,a0:E,a1:L}=tt;t.arc(n+_,i+T,D,E,L)}if(B.isValid()){const{r:_,a0:T,a1:D}=B;t.arc(n,i,_,T,D)}if(et?.isValid()===!0){const{cx:_,cy:T,r:D,a0:E,a1:L}=et;t.arc(n+_,i+T,D,E,L)}if(!S){if(nt?.isValid()===!0){const{cx:_,cy:T,r:D,a0:E,a1:L}=nt;t.arc(n+_,i+T,D,E,L)}if(O?.isValid()===!0){const{r:_,a0:T,a1:D}=O;t.arc(n,i,_,D,T,!0)}if(H?.isValid()===!0){const{cx:_,cy:T,r:D,a0:E,a1:L}=H;t.arc(n+_,i+T,D,E,L)}}t.closePath()}isPointInPath(e,t){const{startAngle:n,endAngle:i,innerRadius:s,outerRadius:r}=this.clipSector??this;return isPointInSector(e-this.centerX,t-this.centerY,{startAngle:n,endAngle:i,innerRadius:Math.min(s,r),outerRadius:Math.max(s,r)})}};Sector.className="Sector",__decorateClass([ScenePathChangeDetection()],Sector.prototype,"centerX",2),__decorateClass([ScenePathChangeDetection()],Sector.prototype,"centerY",2),__decorateClass([ScenePathChangeDetection()],Sector.prototype,"innerRadius",2),__decorateClass([ScenePathChangeDetection()],Sector.prototype,"outerRadius",2),__decorateClass([ScenePathChangeDetection()],Sector.prototype,"startAngle",2),__decorateClass([ScenePathChangeDetection()],Sector.prototype,"endAngle",2),__decorateClass([ScenePathChangeDetection()],Sector.prototype,"clipSector",2),__decorateClass([ScenePathChangeDetection()],Sector.prototype,"concentricEdgeInset",2),__decorateClass([ScenePathChangeDetection()],Sector.prototype,"radialEdgeInset",2),__decorateClass([ScenePathChangeDetection()],Sector.prototype,"startOuterCornerRadius",2),__decorateClass([ScenePathChangeDetection()],Sector.prototype,"endOuterCornerRadius",2),__decorateClass([ScenePathChangeDetection()],Sector.prototype,"startInnerCornerRadius",2),__decorateClass([ScenePathChangeDetection()],Sector.prototype,"endInnerCornerRadius",2);