UNPKG

ag-charts-community

Version:

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

2 lines 145 kB
"use strict";var __defProp=Object.defineProperty,__getOwnPropDesc=Object.getOwnPropertyDescriptor,__getOwnPropNames=Object.getOwnPropertyNames,__hasOwnProp=Object.prototype.hasOwnProperty,__export=(e,t)=>{for(var i in t)__defProp(e,i,{get:t[i],enumerable:!0})},__copyProps=(e,t,i,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of __getOwnPropNames(t))!__hasOwnProp.call(e,n)&&n!==i&&__defProp(e,n,{get:()=>t[n],enumerable:!(s=__getOwnPropDesc(t,n))||s.enumerable});return e},__toCommonJS=e=>__copyProps(__defProp({},"__esModule",{value:!0}),e),__decorateClass=(e,t,i,s)=>{for(var n=s>1?void 0:s?__getOwnPropDesc(t,i):t,r=e.length-1,a;r>=0;r--)(a=e[r])&&(n=(s?a(t,i,n):a(n))||n);return s&&n&&__defProp(t,i,n),n},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_core28=require("ag-charts-core"),import_ag_charts_core4=require("ag-charts-core"),import_ag_charts_core=require("ag-charts-core"),BREAK_TRANSFORM_CHAIN=Symbol("BREAK"),CONFIG_KEY="__decorator_config",ACCESSORS_KEY="__decorator_accessors";function addFakeTransformToInstanceProperty(e,t){initialiseConfig(e,t).optional=!0}function initialiseConfig(e,t){if(Object.getOwnPropertyDescriptor(e,CONFIG_KEY)==null&&Object.defineProperty(e,CONFIG_KEY,{value:{}}),Object.getOwnPropertyDescriptor(e,ACCESSORS_KEY)==null){const l=Object.getPrototypeOf(e)?.[ACCESSORS_KEY]?.slice()??[];Object.defineProperty(e,ACCESSORS_KEY,{value:l})}const i=e[CONFIG_KEY],s=t.toString();if(i[s]!=null)return i[s];i[s]={setters:[],getters:[],observers:[]};const n=Object.getOwnPropertyDescriptor(e,t);let r=n?.get,a=n?.set;if(r==null||a==null){const c=e[ACCESSORS_KEY];let l=c.indexOf(t);l===-1&&(l=c.push(t)-1),r??(r=function(){let d=this.__accessors;return d==null&&(d=c.slice().fill(void 0),Object.defineProperty(this,"__accessors",{value:d})),d[l]}),a??(a=function(d){let u=this.__accessors;u==null&&(u=c.slice().fill(void 0),Object.defineProperty(this,"__accessors",{value:u})),u[l]=d})}return Object.defineProperty(e,t,{set:function(c){const{setters:l,observers:d}=i[s];let u;l.some(f=>f.length>2)&&(u=r.call(this));for(const f of l)if(c=f(this,t,c,u),c===BREAK_TRANSFORM_CHAIN)return;a.call(this,c);for(const f of d)f(this,c,u)},get:function(){let c=r.call(this);for(const l of i[s].getters)if(c=l(this,t,c),c===BREAK_TRANSFORM_CHAIN)return;return c},enumerable:!0,configurable:!1}),i[s]}function addTransformToInstanceProperty(e,t,i){return(s,n)=>{const r=initialiseConfig(s,n);r.setters.push(e),t&&r.getters.unshift(t),i&&Object.assign(r,i)}}function addObserverToInstanceProperty(e){return(t,i)=>{initialiseConfig(t,i).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(i=>Object.keys(i))}function objectsEqual(e,t){return Array.isArray(e)?!Array.isArray(t)||e.length!==t.length?!1:e.every((i,s)=>objectsEqual(i,t[s])):(0,import_ag_charts_core.isPlainObject)(e)?(0,import_ag_charts_core.isPlainObject)(t)?objectsEqualWith(e,t,objectsEqual):!1:e===t}function objectsEqualWith(e,t,i){if(Object.is(e,t))return!0;for(const s of Object.keys(t))if(!(s in e))return!1;for(const s of Object.keys(e))if(!(s in t)||!i(e[s],t[s]))return!1;return!0}function mergeDefaults(...e){const t={};for(const i of e){if(!(0,import_ag_charts_core.isObject)(i))continue;const s=isDecoratedObject(i)?listDecoratedProperties(i):Object.keys(i);for(const n of s)(0,import_ag_charts_core.isPlainObject)(t[n])&&(0,import_ag_charts_core.isPlainObject)(i[n])?t[n]=mergeDefaults(t[n],i[n]):t[n]??(t[n]=i[n])}return t}function merge(...e){const t={};for(const i of e){if(!(0,import_ag_charts_core.isObject)(i))continue;const s=isDecoratedObject(i)?listDecoratedProperties(i):Object.keys(i);for(const n of s)(0,import_ag_charts_core.isPlainObject)(t[n])&&(0,import_ag_charts_core.isPlainObject)(i[n])?t[n]=merge(t[n],i[n]):n in t||(t[n]??(t[n]=i[n]))}return t}var import_ag_charts_core2=require("ag-charts-core"),interpolate=Symbol("interpolate");function nearestSquared(e,t,i,s=1/0){const n={nearest:void 0,distanceSquared:s};for(const r of i){const a=r.distanceSquared(e,t);if(a===0)return{nearest:r,distanceSquared:0};a<n.distanceSquared&&(n.nearest=r,n.distanceSquared=a)}return n}var _BBox=class z{constructor(t,i,s,n){this.x=t,this.y=i,this.width=s,this.height=n}static fromDOMRect({x:t,y:i,width:s,height:n}){return new z(t,i,s,n)}static merge(t){let i=1/0,s=1/0,n=-1/0,r=-1/0;for(const a of t)a.x<i&&(i=a.x),a.y<s&&(s=a.y),a.x+a.width>n&&(n=a.x+a.width),a.y+a.height>r&&(r=a.y+a.height);return new z(i,s,n-i,r-s)}static nearestBox(t,i,s){return nearestSquared(t,i,s)}toDOMRect(){return{x:this.x,y:this.y,width:this.width,height:this.height,top:this.y,left:this.x,right:this.x+this.width,bottom:this.y+this.height,toJSON(){return{}}}}clone(){const{x:t,y:i,width:s,height:n}=this;return new z(t,i,s,n)}equals(t){return(0,import_ag_charts_core2.boxesEqual)(this,t)}containsPoint(t,i){return(0,import_ag_charts_core2.boxContains)(this,t,i)}intersection(t){if(!this.collidesBBox(t))return;const i=(0,import_ag_charts_core2.clamp)(t.x,this.x,t.x+t.width),s=(0,import_ag_charts_core2.clamp)(t.y,this.y,t.y+t.height),n=(0,import_ag_charts_core2.clamp)(t.x,this.x+this.width,t.x+t.width),r=(0,import_ag_charts_core2.clamp)(t.y,this.y+this.height,t.y+t.height);return new z(i,s,n-i,r-s)}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,i){if(this.containsPoint(t,i))return 0;const s=t-(0,import_ag_charts_core2.clamp)(this.x,t,this.x+this.width),n=i-(0,import_ag_charts_core2.clamp)(this.y,i,this.y+this.height);return s*s+n*n}shrink(t,i){if(typeof t=="number")this.applyMargin(t,i);else for(const s of Object.keys(t)){const n=t[s];typeof n=="number"&&this.applyMargin(n,s)}return this.width<0&&(this.width=0),this.height<0&&(this.height=0),this}grow(t,i){if(typeof t=="number")this.applyMargin(-t,i);else for(const s of Object.keys(t)){const n=t[s];typeof n=="number"&&this.applyMargin(-n,s)}return this}applyMargin(t,i){switch(i){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,i){return this.x+=t,this.y+=i,this}[interpolate](t,i){return new z(this.x*(1-i)+t.x*i,this.y*(1-i)+t.y*i,this.width*(1-i)+t.width*i,this.height*(1-i)+t.height*i)}};_BBox.zero=Object.freeze(new _BBox(0,0,0,0)),_BBox.NaN=Object.freeze(new _BBox(NaN,NaN,NaN,NaN));var BBox=_BBox,import_ag_charts_core3=require("ag-charts-core"),TRIPLE_EQ=(e,t)=>e===t;function SceneChangeDetection(e){return function(t,i){const s=`__${i}`;t[i]||prepareGetSet(t,i,s,e)}}function SceneRefChangeDetection(e){return SceneChangeDetection(e)}function SceneObjectChangeDetection(e){return SceneChangeDetection(e)}function SceneArrayChangeDetection(e){const t=e??{};return t.equals=import_ag_charts_core3.arraysEqual,SceneChangeDetection(e)}function prepareGetSet(e,t,i,s){const{changeCb:n,convertor:r,checkDirtyOnAssignment:a=!1}=s??{},h={changeCb:n,checkDirtyOnAssignment:a,convertor:r},o=buildCheckDirtyChain(i,buildChangeCallbackChain(buildConvertorChain(buildSetter(i,h),h),h),h);Object.defineProperty(e,t,{set:o,get:function(){return this[i]},enumerable:!0,configurable:!0})}function buildConvertorChain(e,t){const{convertor:i}=t;return i?function(s){e.call(this,i(s))}:e}var NO_CHANGE=Symbol("no-change");function buildChangeCallbackChain(e,t){const{changeCb:i}=t;return i?function(s){const n=e.call(this,s);return n!==NO_CHANGE&&i.call(this,this),n}:e}function buildCheckDirtyChain(e,t,i){const{checkDirtyOnAssignment:s}=i;return s?function(n){const r=t.call(this,n);return n?._dirty===!0&&this.markDirty(e),r}:t}function buildSetter(e,t){const{equals:i=TRIPLE_EQ}=t;return function(s){const n=this[e];return i(s,n)?NO_CHANGE:(this[e]=s,this.onChangeDetection(e),s)}}var cmp=(e,t)=>Math.sign(e-t);function compareZIndex(e,t){if(typeof e=="number"&&typeof t=="number")return cmp(e,t);const i=typeof e=="number"?[e]:e,s=typeof t=="number"?[t]:t,n=Math.min(i.length,s.length);for(let r=0;r<n;r+=1){const a=cmp(i[r],s[r]);if(a!==0)return a}return cmp(i.length,s.length)}var MAX_ERROR_COUNT=5,_Node=class V{constructor(t){this.serialNumber=V._nextSerialNumber++,this.childNodeCounts={groups:0,nonGroups:0,thisComplexity:0,complexity:0},this.id=(0,import_ag_charts_core4.createId)(this),this.name=void 0,this.transitionOut=void 0,this.pointerEvents=0,this._datum=void 0,this._previousDatum=void 0,this.scene=void 0,this._debugDirtyProperties=void 0,this.parentNode=void 0,this.cachedBBox=void 0,this.isContainerNode=!1,this.visible=!0,this.zIndex=0,this.batchLevel=0,this.batchDirty=!1,this.name=t?.name,this.tag=t?.tag??NaN,this.zIndex=t?.zIndex??0,this.scene=t?.scene,(t?.debugDirty??V._debugEnabled)&&(this._debugDirtyProperties=new Map([["__first__",[]]]))}static toSVG(t,i,s){const n=t?.toSVG();if(n==null||!n.elements.length&&!n.defs?.length)return;const r=(0,import_ag_charts_core4.createSvgElement)("svg");if(r.setAttribute("width",String(i)),r.setAttribute("height",String(s)),r.setAttribute("viewBox",`0 0 ${i} ${s}`),r.setAttribute("overflow","visible"),n.defs?.length){const a=(0,import_ag_charts_core4.createSvgElement)("defs");a.append(...n.defs),r.append(a)}return r.append(...n.elements),r.outerHTML}static*extractBBoxes(t,i){for(const s of t)if(!i||s.visible&&!s.transitionOut){const n=s.getBBox();n&&(yield n)}}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.scene?.layersManager}get imageLoader(){return this.scene?.imageLoader}closestDatum(){for(const{datum:t}of this.traverseUp(!0))if(t!=null)return t}preRender(t,i=1){if(this.childNodeCounts.groups=0,this.childNodeCounts.nonGroups=1,this.childNodeCounts.complexity=i,this.childNodeCounts.thisComplexity=i,this.batchLevel>0||this.batchDirty)throw new Error("AG Charts - illegal rendering state; batched update in progress");return this.childNodeCounts}isolatedRender(t){t.ctx.save();try{this.render(t)}catch(i){const s=i.errorCount??1;if(s>=MAX_ERROR_COUNT)throw i.errorCount=s,i;import_ag_charts_core4.Logger.warnOnce("Error during rendering",i,i.stack)}finally{t.ctx.restore()}}render(t){const{stats:i}=t;if(this.debugDirtyProperties(),t.debugNodeSearch){const s=this.name??this.id;t.debugNodeSearch.some(n=>typeof n=="string"?n===s:n.test(s))&&(t.debugNodes[this.name??this.id]=this)}i&&(i.nodesRendered++,i.opsPerformed+=this.childNodeCounts.thisComplexity)}setScene(t){this.scene=t}*traverseUp(t){let i=this;for(t&&(yield i);i=i.parentNode;)yield i}isRoot(){return!this.parentNode}removeChild(t){throw new Error(`AG Charts - internal error, unknown child node ${t.name??t.id} in $${this.name??this.id}`)}remove(){this.parentNode?.removeChild(this)}destroy(){this.parentNode?.removeChild(this)}batchedUpdate(t){this.batchLevel++,t(),this.batchLevel--,this.batchLevel===0&&this.batchDirty&&(this.markDirty(),this.batchDirty=!1)}setProperties(t){return this.batchLevel++,Object.assign(this,t),this.batchLevel--,this.batchLevel===0&&this.batchDirty&&(this.markDirty(),this.batchDirty=!1),this}containsPoint(t,i){return!1}pickNode(t,i){if(this.containsPoint(t,i))return this}pickNodes(t,i,s=[]){return this.containsPoint(t,i)&&s.push(this),s}getBBox(){return this.cachedBBox??(this.cachedBBox=Object.freeze(this.computeBBox())),this.cachedBBox}computeBBox(){}onChangeDetection(t){this.markDirty(t)}markDirtyChildrenOrder(){this.cachedBBox=void 0}markDirty(t){if(this.batchLevel>0){this.batchDirty=!0;return}t!=null&&this._debugDirtyProperties&&this.markDebugProperties(t),this.cachedBBox=void 0,this.parentNode?.markDirty()}markDebugProperties(t){const i=this._debugDirtyProperties?.get(t)??[],s=new Error().stack?.split(` `).filter(n=>n!=="Error"&&!n.includes(".markDebugProperties")&&!n.includes(".markDirty")&&!n.includes("Object.assign ")&&!n.includes(`${this.constructor.name}.`))??"unknown";i.push(s[0].replace(" at ","").trim()),this._debugDirtyProperties?.set(t,i)}debugDirtyProperties(){this._debugDirtyProperties!=null&&(this._debugDirtyProperties.has("__first__")||this._debugDirtyProperties.forEach((t,i)=>{t.length>1&&(console.groupCollapsed(`Property changed multiple times before render: ${this.constructor.name}.${i} (${t.length}x)`),t.forEach(s=>console.log(s)),console.groupEnd())}),this._debugDirtyProperties.clear())}onZIndexChange(){this.parentNode?.markDirtyChildrenOrder()}toSVG(){}};_Node._nextSerialNumber=0,_Node._debugEnabled=!1,__decorateClass([SceneChangeDetection()],_Node.prototype,"visible",2),__decorateClass([SceneObjectChangeDetection({equals:objectsEqual,changeCb:e=>e.onZIndexChange()})],_Node.prototype,"zIndex",2);var Node=_Node,import_ag_charts_core26=require("ag-charts-core"),import_ag_charts_core5=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_core5.Logger.log(`**** ${t}s since last log message ****`)}timeOfLastLog=Date.now()},Debug={create(...e){return Object.assign((...i)=>{Debug.check(...e)&&(typeof i[0]=="function"&&(i=(0,import_ag_charts_core5.toArray)(i[0]())),logTimeGap(),import_ag_charts_core5.Logger.log(...i))},{check:()=>Debug.check(...e),group:(i,s)=>Debug.check(...e)?import_ag_charts_core5.Logger.logGroup(i,s):s()})},check(...e){return e.length===0&&e.push(!0),(0,import_ag_charts_core5.toArray)((0,import_ag_charts_core5.getWindow)("agChartsDebug")).some(i=>e.includes(i))},inDevelopmentMode(e){if(Debug.check("dev"))return e()}};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 i=this.store.keys();let s=this.store.size-this.maxCacheSize;for(;s>0;){const n=i.next();n.done||this.store.delete(n.value),s--}}return 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=TextUtils.toFontString(e.font),i=`${t}-${e.textAlign??"start"}-${e.textBaseline??"top"}`;return this.instanceMap.get(i)??this.createFontMeasurer(t,e,i)}static clear(){this.instanceMap.clear()}static createFontMeasurer(e,t,i){const s=createCanvasContext();s.font=e,s.textAlign=t.textAlign??"start",s.textBaseline=t.textBaseline??"top";const n=new CachedTextMeasurer(s,t);return this.instanceMap.set(i,n),n}};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=TextUtils.toFontString(t.font),this.textMeasurer=new SimpleTextMeasurer(i=>this.cachedCtxMeasureText(i),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:i,fontFamily:s}){let n="";return t&&t!=="normal"&&(n+=`${t} `),i&&i!=="normal"&&i!==400&&(n+=`${i} `),n+=`${e}px`,n+=` ${s}`,n.trim()}static getLineHeight(e){return Math.ceil(e*this.defaultLineHeight)}static getHorizontalModifier(e){switch(e){case"left":case"start":return 0;case"center":return .5;case"right":case"end":return 1;default:return 0}}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}}getMultilineMetrics(e){let t=0,i=0,s=0,n=0,r=0,a=0;const h=TextUtils.getVerticalModifier(this.textBaseline),o=[];let c=0;const l=e.length;for(const d of e){const u=this.measureTextFn(d);u.fontBoundingBoxAscent??(u.fontBoundingBoxAscent=u.emHeightAscent),u.fontBoundingBoxDescent??(u.fontBoundingBoxDescent=u.emHeightDescent),t<u.width&&(t=u.width),n<u.actualBoundingBoxLeft&&(n=u.actualBoundingBoxLeft),c===0?(i+=u.actualBoundingBoxAscent,s+=u.actualBoundingBoxAscent,a=u.alphabeticBaseline):r+=u.fontBoundingBoxAscent,c===l-1?i+=u.actualBoundingBoxDescent:r+=u.fontBoundingBoxDescent,o.push({text:d,width:u.width,height:u.actualBoundingBoxAscent+u.actualBoundingBoxDescent,lineHeight:u.fontBoundingBoxAscent+u.fontBoundingBoxDescent,offsetTop:u.actualBoundingBoxAscent,offsetLeft:u.actualBoundingBoxLeft}),c++}return i+=r,s+=r*h,{width:t,height:i,offsetTop:s,offsetLeft:n,alphabeticBaseline:a,lineMetrics:o}}textWidth(e,t){if(t){let i=0;for(let s=0;s<e.length;s++)i+=this.textWidth(e.charAt(s));return i}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_core22=require("ag-charts-core");function clearContext({context:e,pixelRatio:t,width:i,height:s}){e.save();try{e.resetTransform(),e.clearRect(0,0,Math.ceil(i*t),Math.ceil(s*t))}finally{e.restore()}}function debugContext(e){if(Debug.check("canvas")){const t=e.save.bind(e),i=e.restore.bind(e);let s=0;Object.assign(e,{save(){t(),s++},restore(){if(s===0)throw new Error("AG Charts - Unable to restore() past depth 0");i(),s--},verifyDepthZero(){if(s!==0)throw new Error(`AG Charts - Save/restore depth is non-zero: ${s}`)}})}}function canvasDimensions(e,t,i){return[Math.floor(e*i),Math.floor(t*i)]}var HdpiOffscreenCanvas=class{constructor(e){const{width:t,height:i,pixelRatio:s,willReadFrequently:n=!1}=e;this.width=t,this.height=i,this.pixelRatio=s;const[r,a]=canvasDimensions(t,i,s);this.canvas=new OffscreenCanvas(r,a),this.context=this.canvas.getContext("2d",{willReadFrequently:n}),this.context.setTransform(s,0,0,s,0,0),debugContext(this.context)}drawImage(e,t=0,i=0){return e.drawImage(this.canvas,t,i)}transferToImageBitmap(){return this.canvas.transferToImageBitmap()}resize(e,t,i){if(!(e>0&&t>0))return;const{canvas:s,context:n}=this;if(e!==this.width||t!==this.height||i!==this.pixelRatio){const[r,a]=canvasDimensions(e,t,i);s.width=r,s.height=a}n.setTransform(i,0,0,i,0,0),this.width=e,this.height=t,this.pixelRatio=i}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_core19=require("ag-charts-core"),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,i){const s=normalizeAngle360(e),n=normalizeAngle360(t),r=normalizeAngle360(i);return n<r?n<=s&&s<=r:n>r?n<=s||s<=r:t!==i}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)}function normalizeAngle360FromDegrees(e){return e?normalizeAngle360(toRadians(e)):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,i)=>e*(1-i)+t*i,srgbToLinear=e=>{const t=e<0?-1:1,i=Math.abs(e);return i<=.04045?e/12.92:t*((i+.055)/1.055)**2.4},srgbFromLinear=e=>{const t=e<0?-1:1,i=Math.abs(e);return i>.0031308?t*(1.055*i**(1/2.4)-.055):12.92*e},_Color=class A{constructor(t,i,s,n=1){this.r=(0,import_ag_charts_core6.clamp)(0,t||0,1),this.g=(0,import_ag_charts_core6.clamp)(0,i||0,1),this.b=(0,import_ag_charts_core6.clamp)(0,s||0,1),this.a=(0,import_ag_charts_core6.clamp)(0,n||0,1)}static validColorString(t){return t.indexOf("#")>=0?!!A.parseHex(t):t.indexOf("rgb")>=0?!!A.stringToRgba(t):A.nameToHex.has(t.toLowerCase())}static fromString(t){if(t.indexOf("#")>=0)return A.fromHexString(t);const i=A.nameToHex.get(t.toLowerCase());if(i)return A.fromHexString(i);if(t.indexOf("rgb")>=0)return A.fromRgbaString(t);throw new Error(`Invalid color string: '${t}'`)}static parseHex(t){t=t.replace(/ /g,"").slice(1);let i;switch(t.length){case 6:case 8:i=[];for(let s=0;s<t.length;s+=2)i.push(parseInt(`${t[s]}${t[s+1]}`,16));break;case 3:case 4:i=t.split("").map(s=>parseInt(s,16)).map(s=>s+s*16);break}if(i?.length>=3&&i.every(s=>s>=0))return i.length===3&&i.push(255),i}static fromHexString(t){const i=A.parseHex(t);if(i){const[s,n,r,a]=i;return new A(s/255,n/255,r/255,a/255)}throw new Error(`Malformed hexadecimal color string: '${t}'`)}static stringToRgba(t){let i=-1,s=-1;for(let h=0;h<t.length;h++){const o=t[h];if(i===-1&&o==="(")i=h;else if(o===")"){s=h;break}}if(i===-1||s===-1)return;const r=t.substring(i+1,s).split(","),a=[];for(let h=0;h<r.length;h++){const o=r[h];let c=parseFloat(o);if(!Number.isFinite(c))return;o.indexOf("%")>=0?(c=(0,import_ag_charts_core6.clamp)(0,c,100),c/=100):h===3?c=(0,import_ag_charts_core6.clamp)(0,c,1):(c=(0,import_ag_charts_core6.clamp)(0,c,255),c/=255),a.push(c)}return a}static fromRgbaString(t){const i=A.stringToRgba(t);if(i){if(i.length===3)return new A(i[0],i[1],i[2]);if(i.length===4)return new A(i[0],i[1],i[2],i[3])}throw new Error(`Malformed rgb/rgba color string: '${t}'`)}static fromArray(t){if(t.length===4)return new A(t[0],t[1],t[2],t[3]);if(t.length===3)return new A(t[0],t[1],t[2]);throw new Error("The given array should contain 3 or 4 color components (numbers).")}static fromHSB(t,i,s,n=1){const r=A.HSBtoRGB(t,i,s);return new A(r[0],r[1],r[2],n)}static fromHSL(t,i,s,n=1){const r=A.HSLtoRGB(t,i,s);return new A(r[0],r[1],r[2],n)}static fromOKLCH(t,i,s,n=1){const r=A.OKLCHtoRGB(t,i,s);return new A(r[0],r[1],r[2],n)}static padHex(t){return t.length===1?"0"+t:t}toHexString(){let t="#"+A.padHex(Math.round(this.r*255).toString(16))+A.padHex(Math.round(this.g*255).toString(16))+A.padHex(Math.round(this.b*255).toString(16));return this.a<1&&(t+=A.padHex(Math.round(this.a*255).toString(16))),t}toRgbaString(t=3){const i=[Math.round(this.r*255),Math.round(this.g*255),Math.round(this.b*255)],s=Math.pow(10,t);return this.a!==1?(i.push(Math.round(this.a*s)/s),`rgba(${i.join(", ")})`):`rgb(${i.join(", ")})`}toString(){return this.a===1?this.toHexString():this.toRgbaString()}toHSB(){return A.RGBtoHSB(this.r,this.g,this.b)}static RGBtoOKLCH(t,i,s){const n=srgbToLinear(t),r=srgbToLinear(i),a=srgbToLinear(s),h=Math.cbrt(.4122214708*n+.5363325363*r+.0514459929*a),o=Math.cbrt(.2119034982*n+.6806995451*r+.1073969566*a),c=Math.cbrt(.0883024619*n+.2817188376*r+.6299787005*a),l=.2104542553*h+.793617785*o-.0040720468*c,d=1.9779984951*h-2.428592205*o+.4505937099*c,u=.0259040371*h+.7827717662*o-.808675766*c,f=Math.atan2(u,d)*180/Math.PI,g=l,p=Math.hypot(d,u),y=f>=0?f:f+360;return[g,p,y]}static OKLCHtoRGB(t,i,s){const n=t,r=i*Math.cos(s*Math.PI/180),a=i*Math.sin(s*Math.PI/180),h=(n+.3963377774*r+.2158037573*a)**3,o=(n-.1055613458*r-.0638541728*a)**3,c=(n-.0894841775*r-1.291485548*a)**3,l=4.0767416621*h-3.3077115913*o+.2309699292*c,d=-1.2684380046*h+2.6097574011*o-.3413193965*c,u=-.0041960863*h-.7034186147*o+1.707614701*c,f=srgbFromLinear(l),g=srgbFromLinear(d),p=srgbFromLinear(u);return[f,g,p]}static RGBtoHSL(t,i,s){const n=Math.min(t,i,s),r=Math.max(t,i,s),a=(r+n)/2;let h,o;if(r===n)h=0,o=0;else{const c=r-n;o=a>.5?c/(2-r-n):c/(r+n),r===t?h=(i-s)/c+(i<s?6:0):r===i?h=(s-t)/c+2:h=(t-i)/c+4,h*=360/6}return[h,o,a]}static HSLtoRGB(t,i,s){if(t=(t%360+360)%360,i===0)return[s,s,s];const n=s<.5?s*(1+i):s+i-s*i,r=2*s-n;function a(l){return l<0&&(l+=1),l>1&&(l-=1),l<1/6?r+(n-r)*6*l:l<1/2?n:l<2/3?r+(n-r)*(2/3-l)*6:r}const h=a(t/360+1/3),o=a(t/360),c=a(t/360-1/3);return[h,o,c]}static RGBtoHSB(t,i,s){const n=Math.min(t,i,s),r=Math.max(t,i,s),a=r===0?0:(r-n)/r;let h=0;if(n!==r){const o=r-n,c=(r-t)/o,l=(r-i)/o,d=(r-s)/o;t===r?h=d-l:i===r?h=2+c-d:h=4+l-c,h/=6,h<0&&(h=h+1)}return[h*360,a,r]}static HSBtoRGB(t,i,s){t=(t%360+360)%360/360;let n=0,r=0,a=0;if(i===0)n=r=a=s;else{const h=(t-Math.floor(t))*6,o=h-Math.floor(h),c=s*(1-i),l=s*(1-i*o),d=s*(1-i*(1-o));switch(h>>0){case 0:n=s,r=d,a=c;break;case 1:n=l,r=s,a=c;break;case 2:n=c,r=s,a=d;break;case 3:n=c,r=l,a=s;break;case 4:n=d,r=c,a=s;break;case 5:n=s,r=c,a=l;break}}return[n,r,a]}static mix(t,i,s){return new A(lerp(t.r,i.r,s),lerp(t.g,i.g,s),lerp(t.b,i.b,s),lerp(t.a,i.a,s))}static lighten(t,i){const s=A.RGBtoOKLCH(t.r,t.g,t.b);return A.fromOKLCH((0,import_ag_charts_core6.clamp)(0,s[0]+i,1),s[1],s[2])}static darken(t,i){const s=A.RGBtoOKLCH(t.r,t.g,t.b);return A.fromOKLCH((0,import_ag_charts_core6.clamp)(0,s[0]-i,1),s[1],s[2])}static interpolate(t,i){const s=1/(t.length-1),n=t.map(r=>A.RGBtoOKLCH(r.r,r.g,r.b));return Array.from({length:i},(r,a)=>{const h=a/(i-1),o=t.length<=2?0:Math.min(Math.floor(h*(t.length-1)),t.length-2),c=(h-o*s)/s,l=n[o],d=n[o+1];return A.fromOKLCH(lerp(l[0],d[0],c),lerp(l[1],d[1],c),lerp(l[2],d[2],c))})}};_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,i){}niceDomain(e,t=this.domain){return t}get bandwidth(){}get step(){}get inset(){}},Invalidating=(e,t)=>{const i=Symbol(String(t));e[i]=void 0,Object.defineProperty(e,t,{get(){return this[i]},set(s){this[i]!==s&&(this[i]=s,this.invalid=!0)},enumerable:!0,configurable:!1})},convertColorStringToOklcha=e=>{const t=Color.fromString(e),[i,s,n]=Color.RGBtoOKLCH(t.r,t.g,t.b);return{l:i,c:s,h:n,a:t.a}},delta=1e-6,isAchromatic=e=>e.c<delta||e.l<delta||e.l>1-delta,interpolateOklch=(e,t,i)=>{i=(0,import_ag_charts_core7.clamp)(0,i,1);let s;if(isAchromatic(e))s=t.h;else if(isAchromatic(t))s=e.h;else{const h=e.h;let o=t.h;const c=t.h-e.h;c>180?o-=360:c<-180&&(o+=360),s=h*(1-i)+o*i}const n=e.c*(1-i)+t.c*i,r=e.l*(1-i)+t.l*i,a=e.a*(1-i)+t.a*i;return Color.fromOKLCH(r,n,s,a)},ColorScale=class extends AbstractScale{constructor(){super(...arguments),this.type="color",this.defaultTickCount=0,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 i=1;i<e.length;i++){const s=e[i-1],n=e[i];if(s>n){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 i=t.length;i<e.length;i++)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:i,parsedRange:s}=this,n=t[0],r=t.at(-1),a=i[0],h=i[i.length-1];if(e<=n)return a;if(e>=r)return h;let o,c;if(t.length===2){const u=(e-n)/(r-n),f=1/(i.length-1);o=i.length<=2?0:Math.min(Math.floor(u*(i.length-1)),i.length-2),c=(u-o*f)/f}else{for(o=0;o<t.length-2&&!(e<t[o+1]);o++);const u=t[o],f=t[o+1];c=(e-u)/(f-u)}const l=s[o],d=s[o+1];return interpolateOklch(l,d,c).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=[],i){this.colorSpace=e,this.stops=t,this.bbox=i,this._cache=void 0}createGradient(e,t,i){const s=this.bbox??t;if(!s.isFinite())return;if(this._cache!=null&&this._cache.ctx===e&&this._cache.bbox.equals(s))return this._cache.gradient;const{stops:n,colorSpace:r}=this;if(n.length===0)return;if(n.length===1)return n[0].color;let a=this.createCanvasGradient(e,s,i);if(a==null)return;const h=r==="oklch",o=.05;let c=n[0];a.addColorStop(c.stop,c.color);for(let l=1;l<n.length;l+=1){const d=n[l];if(h){const u=new ColorScale;u.domain=[c.stop,d.stop],u.range=[c.color,d.color];for(let f=c.stop+o;f<d.stop;f+=o)a.addColorStop(f,u.convert(f))}a.addColorStop(d.stop,d.color),c=d}return"createPattern"in a&&(a=a.createPattern()),this._cache={ctx:e,bbox:s,gradient:a},a}toSvg(e){const t=this.bbox??e,i=this.createSvgGradient(t);return this.stops.forEach(({stop:s,color:n})=>{const r=(0,import_ag_charts_core8.createSvgElement)("stop");r.setAttribute("offset",`${s}`),r.setAttribute("stop-color",`${n}`),i.appendChild(r)}),i}},ConicGradient=class extends Gradient{constructor(e,t,i=0,s){super(e,t,s),this.angle=i}createCanvasGradient(e,t,i){const{angle:n}=this,r=normalizeAngle360FromDegrees(n+-90),a=i?.centerX??t.x+t.width*.5,h=i?.centerY??t.y+t.height*.5;return e.createConicGradient(r,a,h)}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,i=0,s){super(e,t,s),this.angle=i}getGradientPoints(e){const{angle:i}=this,s=normalizeAngle360FromDegrees(i+90),n=Math.cos(s),r=Math.sin(s),a=e.width,h=e.height,o=e.x+a*.5,c=e.y+h*.5,l=Math.sqrt(h*h+a*a)/2,d=Math.atan2(h,a);let u;s<Math.PI/2?u=s:s<Math.PI?u=Math.PI-s:s<1.5*Math.PI?u=s-Math.PI:u=2*Math.PI-s;const f=l*Math.abs(Math.cos(u-d));return{x0:o+n*f,y0:c+r*f,x1:o-n*f,y1:c-r*f}}createCanvasGradient(e,t){const{x0:i,y0:s,x1:n,y1:r}=this.getGradientPoints(t);if(!(isNaN(i)||isNaN(s)||isNaN(n)||isNaN(r)))return e.createLinearGradient(i,s,n,r)}createSvgGradient(e){const{x0:t,y0:i,x1:s,y1:n}=this.getGradientPoints(e),r=(0,import_ag_charts_core10.createSvgElement)("linearGradient");return r.setAttribute("x1",String(t)),r.setAttribute("y1",String(i)),r.setAttribute("x2",String(s)),r.setAttribute("y2",String(n)),r.setAttribute("gradientUnits","userSpaceOnUse"),r}},import_ag_charts_core11=require("ag-charts-core"),RadialGradient=class extends Gradient{constructor(e,t,i){super(e,t,i)}createCanvasGradient(e,t,i){const s=i?.centerX??t.x+t.width*.5,n=i?.centerY??t.y+t.height*.5,r=i?.innerRadius??0,a=i?.outerRadius??Math.hypot(t.width*.5,t.height*.5)/Math.SQRT2;return e.createRadialGradient(s,n,r,s,n,a)}createSvgGradient(e){const t=e.x+e.width*.5,i=e.y+e.height*.5,s=(0,import_ag_charts_core11.createSvgElement)("radialGradient");return s.setAttribute("cx",String(t)),s.setAttribute("cy",String(i)),s.setAttribute("r",String(Math.hypot(e.width*.5,e.height*.5)/Math.SQRT2)),s.setAttribute("gradientUnits","userSpaceOnUse"),s}},import_ag_charts_core13=require("ag-charts-core"),import_ag_charts_core12=require("ag-charts-core"),Property=addFakeTransformToInstanceProperty,BaseProperties=class{handleUnknownProperties(e,t){}set(e){const{className:t=this.constructor.name}=this.constructor;if(e==null)return this.clear(),this;if(typeof e!="object")return import_ag_charts_core12.Logger.warn(`unable to set ${t} - expecting a properties object`),this;const i=new Set(Object.keys(e));for(const s of listDecoratedProperties(this))if(i.has(s)){const n=e[s],r=this;if(isProperties(r[s]))if(r[s]instanceof PropertiesArray){const a=r[s].reset(n);a==null?import_ag_charts_core12.Logger.warn(`unable to set [${String(s)}] - expecting a properties array`):r[s]=a}else r[s].set(n);else(0,import_ag_charts_core12.isPlainObject)(n)?r[s]=merge(n,r[s]??{}):r[s]=n;i.delete(s)}this.handleUnknownProperties(i,e);for(const s of i)import_ag_charts_core12.Logger.warn(`unable to set [${String(s)}] in ${t} - property is unknown`);return this}clear(){for(const e of listDecoratedProperties(this)){const t=this[e];isProperties(t)?t.clear():this[e]=void 0}return this}toJson(){return listDecoratedProperties(this).reduce((e,t)=>{const i=this[t];return e[String(t)]=isProperties(i)?i.toJson():i,e},{})}},PropertiesArray=class nt extends Array{constructor(t,...i){super(i.length);const n=(r=>!!r?.prototype?.constructor?.name)(t)?r=>new t().set(r):t;Object.defineProperty(this,"itemFactory",{value:n,enumerable:!1,configurable:!1}),this.set(i)}set(t){if((0,import_ag_charts_core12.isArray)(t)){this.length=t.length;for(let i=0;i<t.length;i++)this[i]=this.itemFactory(t[i])}return this}reset(t){if(Array.isArray(t))return new nt(this.itemFactory,...t)}toJson(){return this.map(t=>t?.toJson?.()??t)}};function isProperties(e){return e instanceof BaseProperties||e instanceof PropertiesArray}var StopProperties=class extends BaseProperties{constructor(){super(...arguments),this.color="black"}};__decorateClass([Property],StopProperties.prototype,"stop",2),__decorateClass([Property],StopProperties.prototype,"color",2);function stopsAreAscending(e){let t;for(const i of e)if(i?.stop!=null){if(t!=null&&i.stop<t)return!1;t=i.stop}return!0}function discreteColorStops(e){return e.flatMap((t,i)=>{const{stop:s}=t,n=e.at(i+1)?.color;return n!=null?[t,{stop:s,color:n}]:[t]})}function getDefaultColorStops(e,t){const i=t==="discrete"?1:0,s=e.map((n,r,{length:a})=>({stop:(r+i)/(a-1+i),color:n}));return t==="discrete"?discreteColorStops(s):s}function getColorStops(e,t,i,s="continuous"){const n=e.map(g=>typeof g=="string"?{color:g}:g);if(n.length===0)return getDefaultColorStops(t,s);if(!stopsAreAscending(n))return import_ag_charts_core13.Logger.warnOnce("[fills] must have the stops defined in ascending order"),[];const r=Math.min(...i),a=Math.max(...i),h=s==="discrete",o=new Float64Array(n.length);let c=0,l=-1;for(let g=0;g<n.length;g+=1){const p=n[g];if(g>=l){l=n.length-1;for(let m=g+1;m<n.length;m+=1)if(n[m]?.stop!=null){l=m;break}}let y=p?.stop;if(y==null){const m=n[c]?.stop,x=n[l]?.stop,S=m??r,C=x??a,P=h&&m==null?1:0;y=S+(C-S)*(g-c+P)/(l-c+P)}else c=g;o[g]=Math.max(0,Math.min(1,(y-r)/(a-r)))}let d=n.find(g=>g.color!=null)?.color,u;const f=n.map((g,p)=>{let y=g?.color;const m=o[p];return y!=null?d=y:d!=null?y=d:(u==null&&(u=new ColorScale,u.domain=[0,1],u.range=t),y=u.convert(m)),{stop:m,color:y}});return s==="discrete"?discreteColorStops(f):f}var import_ag_charts_core14=require("ag-charts-core"),Image2=class{constructor(e,t){this.imageLoader=e,this._cache=void 0,this.url=t.url,this.backgroundFill=t.backgroundFill??"black",this.backgroundFillOpacity=t.backgroundFillOpacity??1,this.repeat=t.repeat??"no-repeat",this.width=t.width,this.height=t.height,this.fit=t.fit??"stretch",this.rotation=t.rotation??0}createCanvasImage(e,t,i,s){if(!t)return null;const[n,r]=this.getSize(t.width,t.height,i,s);return n<1||r<1?(import_ag_charts_core14.Logger.warnOnce("Image fill is too small to render, ignoring."),null):e.createPattern(t,this.repeat)}getSize(e,t,i,s){const{fit:n}=this;let r=e,a=t,h=1;const o=i/s,c=e/t;return n==="stretch"||e===0||t===0?(r=i,a=s):n==="contain"?h=c>o?i/e:s/t:n==="cover"&&(h=c>o?s/t:i/e),[Math.max(1,r*h),Math.max(1,a*h)]}setImageTransform(e,t){if(typeof e=="string")return;const{url:i,rotation:s,width:n,height:r}=this,a=this.imageLoader?.loadImage(i);if(!a)return;const h=normalizeAngle360FromDegrees(s),o=Math.cos(h),c=Math.sin(h),[l,d]=this.getSize(a.width,a.height,n??t.width,r??t.height),u=l/a.width,f=d/a.height,g=t.x+t.width/2,p=t.y+t.height/2,y=o*l-c*d,m=c*l+o*d,x=y/2,S=m/2;e?.setTransform(new DOMMatrix([o*u,c*f,-c*u,o*f,g-x,p-S]))}createPattern(e,t,i,s){const n=this.width??t,r=this.height??i,a=this._cache;if(a!=null&&a.ctx===e&&a.width===n&&a.height===r)return a.pattern;const h=this.imageLoader?.loadImage(this.url,s),o=this.createCanvasImage(e,h,n,r);if(o!=null)return this._cache={ctx:e,pattern:o,width:n,height:r},o}toSvg(e,t){const{url:i,rotation:s,backgroundFill:n,backgroundFillOpacity:r}=this,{x:a,y:h,width:o,height:c}=e,l=(0,import_ag_charts_core14.createSvgElement)("pattern");l.setAttribute("viewBox",`0 0 ${o} ${c}`),l.setAttribute("x",String(a)),l.setAttribute("y",String(h)),l.setAttribute("width",String(o)),l.setAttribute("height",String(c)),l.setAttribute("patternUnits","userSpaceOnUse");const d=(0,import_ag_charts_core14.createSvgElement)("rect");d.setAttribute("x","0"),d.setAttribute("y","0"),d.setAttribute("width",String(o)),d.setAttribute("height",String(c)),d.setAttribute("fill",n),d.setAttribute("fill-opacity",String(r)),l.appendChild(d);const u=(0,import_ag_charts_core14.createSvgElement)("image");return u.setAttribute("href",i),u.setAttribute("x","0"),u.setAttribute("y","0"),u.setAttribute("width",String(o)),u.setAttribute("height",String(c)),u.setAttribute("preserveAspectRatio","none"),u.setAttribute("transform",`scale(${1/t}) rotate(${s}, ${o/2}, ${c/2})`),l.appendChild(u),l}},import_ag_charts_core17=require("ag-charts-core");function pointsDistanceSquared(e,t,i,s){const n=e-i,r=t-s;return n*n+r*r}function lineDistanceSquared(e,t,i,s,n,r,a){if(i===n&&s===r)return Math.min(a,pointsDistanceSquared(e,t,i,s));const h=n-i,o=r-s,c=Math.max(0,Math.min(1,((e-i)*h+(t-s)*o)/(h*h+o*o))),l=i+c*h,d=s+c*o;return Math.min(a,pointsDistanceSquared(e,t,l,d))}var import_ag_charts_core15=require("ag-charts-core"),commandEx=/^[\t\n\f\r ]*([achlmqstvz])[\t\n\f\r ]*/i,coordinateEx=/^[+-]?((\d*\.\d+)|(\d+\.)|(\d+))(e[+-]?\d+)?/i,commaEx=/[\t\n\f\r ]*,?[\t\n\f\r ]*/,flagEx=/^[01]/,pathParams={z:[],h:[coordinateEx],v:[coordinateEx],m:[coordinateEx,coordinateEx],l:[coordinateEx,coordinateEx],t:[coordinateEx,coordinateEx],s:[coordinateEx,coordinateEx,coordinateEx,coordinateEx],q:[coordinateEx,coordinateEx,coordinateEx,coordinateEx],c:[coordinateEx,coordinateEx,coordinateEx,coordinateEx,coordinateEx,coordinateEx],a:[coordinateEx,coordinateEx,coordinateEx,flagEx,flagEx,coordinateEx,coordinateEx]};function parseSvg(e){if(!e)return;const t=[];let i=0,s;for(;i<e.length;){const n=commandEx.exec(e.slice(i));let r;if(n==null){if(!s){import_ag_charts_core15.Logger.warnOnce(`Invalid SVG path, error at index ${i}: Missing command.`);return}r=s}else r=n[1],i+=n[0].length;const a=parseSegment(r,e,i);if(!a)return;i=a[0],s=r,t.push(a[1])}return t}function parseSegment(e,t,i){const s=pathParams[e.toLocaleLowerCase()],n={command:e,params:[]};for(const r of s){const a=t.slice(i),h=r.exec(a);if(h!=null){n.params.push(parseFloat(h[0])),i+=h[0].length;const o=commaEx.exec(a.slice(h[0].length));o!=null&&(i+=o[0].length)}else{if(n.params.length===1)return[i,n];import_ag_charts_core15.Logger.warnOnce(`Invalid SVG path, error at index ${i}: No path segment parameters for command [${e}]`);return}}return[i,n]}function linearRoot(e,t){const i=-t/e;return e!==0&&i>=0&&i<=1?[i]:[]}function quadraticRoots(e,t,i,s=1e-6){if(Math.abs(e)<s)return linearRoot(t,i);const n=t*t-4*e*i,r=[];if(Math.abs(n)<s){const a=-t/(2*e);a>=0&&a<=1&&r.push(a)}else if(n>0){const a=Math.sqrt(n),h=(-t-a)/(2*e),o=(-t+a)/(2*e);h>=0&&h<=1&&r.push(h),o>=0&&o<=1&&r.push(o)}return r}function cubicRoots(e,t,i,s,n=1e-6){if(Math.abs(e)<n)return quadraticRoots(t,i,s,n);const r=t/e,a=i/e,h=s/e,o=(3*a-r*r)/9,c=(9*r*a-27*h-2*r*r*r)/54,l=o*o*o+c*c,d=1/3,u=[];if(l>=0){const f=Math.sqrt(l),g=Math.sign(c+f)*Math.pow(Math.abs(c+f),d),p=Math.sign(c-f)*Math.pow(Math.abs(c-f),d),y=Math.abs(Math.sqrt(3)*(g-p)/2),m=-d*r+(g+p);if(m>=0&&m<=1&&u.push(m),Math.abs(y)<n){const x=-d*r-(g+p)/2;x>=0&&x<=1&&u.push(x)}}else{const f=Math.acos(c/Math.sqrt(-o*o*o)),g=d*r,p=2*Math.sqrt(-o),y=p*Math.cos(d*f)-g,m=p*Math.cos(d*(f+2*Math.PI))-g,x=p*Math.cos(d*(f+4*Math.PI))-g;y>=0&&y<=1&&u.push(y),m>=0&&m<=1&&u.push(m),x>=0&&x<=1&&u.push(x)}return u}function segmentIntersection(e,t,i,s,n,r,a,h){const o=(i-e)*(h-r)-(s-t)*(a-n);if(o===0)return 0;const c=((a-n)*(t-r)-(e-n)*(h-r))/o,l=((i-e)*(t-r)-(s-t)*(e-n))/o;return c>=0&&c<=1&&l>=0&&l<=1?1:0}function cubicSegmentIntersections(e,t,i,s,n,r,a,h,o,c,l,d){let u=0;const f=c-d,g=l-o,p=o*(d-c)-c*(l-o),y=bezierCoefficients(e,i,n,a),m=bezierCoefficients(t,s,r,h),x=f*y[0]+g*m[0],S=f*y[1]+g*m[1],C=f*y[2]+g*m[2],P=f*y[3]+g*m[3]+p,w=cubicRoots(x,S,C,P);for(const b of w){const v=b*b,M=b*v,k=y[0]*M+y[1]*v+y[2]*b+y[3],T=m[0]*M+m[1]*v+m[2]*b+m[3];let F;o===l?F=(T-c)/(d-c):F=(k-o)/(l-o),F>=0&&F<=1&&u++}return u}function bezierCoefficients(e,t,i,s){return[-e+3*t-3*i+s,3*e-6*t+3*i,-3*e+3*t,e]}var import_ag_charts_core16=require("ag-charts-core");function evaluateBezier(e,t,i,s,n){return(1-n)**3*e+3*(1-n)**2*n*t+3*(1-n)*n**2*i+n**3*s}function splitBezier2D(e,t,i,s,n,r,a,h,o){const c=(1-o)*e+o*i,l=(1-o)*t+o*s,d=(1-o)*i+o*n,u=(1-o)*s+o*r,f=(1-o)*n+o*a,g=(1-o)*r+o*h,p=(1-o)*c+o*d,y=(1-o)*l+o*u,m=(1-o)*d+o*f,x=(1-o)*u+o*g,S=(1-o)*p+o*m,C=(1-o)*y+o*x;return[[{x:e,y:t},{x:c,y:l},{x:p,y},{x:S,y:C}],[{x:S,y:C},{x:m,y:x},{x:f,y:g},{x:a,y:h}]]}function calculateDerivativeExtrema(e,t,i,s){const n=-e+3*t-3*i+s,r=2*(e-2*t+i),a=-e+t;if(n===0){if(r!==0){const o=-a/r;if(o>0&&o<1)return[o]}return[]}const h=r*r-4*n*a;if(h>=0){const o=Math.sqrt(h),c=(-r+o)/(2*n),l=(-r-o)/(2*n);return[c,l].filter(d=>d>0&&d<1)}return[]}function bezier2DExtrema(e,t,i,s,n,r,a,h){const o=calculateDerivativeExtrema(e,i,n,a),c=calculateDerivativeExtrema(t,s,r,h);return[...o,...c]}function bezierCandidate(e,t,i){const s=evaluateBezier(e[0].x,e[1].x,e[2].x,e[3].x,.5),n=evaluateBezier(e[0].y,e[1].y,e[2].y,e[3].y,.5),r=Math.hypot(s-t,n-i),a=Math.min(Math.hypot(e[0].x-t,e[0].y-i),Math.hypot(e[1].x-t,e[1].y-i),Math.hypot(e[2].x-t,e[2].y-i),Math.hypot(e[3].x-t,e[3].y-i));return{points:e,distance:r,minDistance:a}}function bezier2DDistance(e,t,i,s,n,r,a,h,o,c,l=1){let u={value:bezierCandidate([{x:e,y:t},{x:i,y:s},{x:n,y:r},{x:a,y:h}],o,c),next:null},f;for(;u!=null;){const{points:g,distance:p,minDistance:y}=u.value;if(u=u.next,(f==null||p<f.distance)&&(f={distance:p,minDistance:y}),f!=null&&f.distance-y<=l)continue;const[m,x]=splitBezier2D(g[0].x,g[0].y,g[1].x,g[1].y,g[2].x,g[2].y,g[3].x,g[3].y,.5),S=[bezierCandidate(m,o,c),bezierCandidate(x,o,c)].sort(bezierCandidateCmp);u=(0,import_ag_charts_core16.insertListItemsSorted)(u,S,bezierCandidateCmp)}return f?.distance??1/0}var bezierCandidateCmp=(e,t)=>t.minDistance-e.minDistance,ExtendedPath2D=class{constructor(){this.path2d=new Path2D,this.previousCommands=[],this.previousParams=[],this.previousClosedPath=!1,this.commands=[],this.params=[],this.cx=NaN,this.cy=NaN,this.sx=NaN,this.sy=NaN,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.sx=e,this.sy=t,this.cx=e,this.cy=t,this.path2d.moveTo(e,t),this.commands.push(0),this.params.push(e,t)}lineTo(e,t){this.openedPath?(this.cx=e,this.cy=t,this.path2d.lineTo(e,t),this.commands.push(1),this.params.push(e,t)):this.moveTo(e,t)}cubicCurveTo(e,t,i,s,n,r){this.openedPath||this.moveTo(e,t),this.path2d.bezierCurveTo(e,t,i,s,n,r),this.commands.push(2),this.params.push(e,t,i,s,n,r)}closePath(){this.openedPath&&(this.cx=this.sx,this.cy=this.sy,this.sx=NaN,this.sy=NaN,this.path2d.closePath(),this.commands.push(3),this.openedPath=!1,this.closedPath=!0)}rect(e,t,i,s){this.moveTo(e,t),this.lineTo(e+i,t),this.lineTo(e+i,t+s),this.lineTo(e,t+s),this.closePath()}roundRect(e,t,i,s,n){n=Math.min(n,i/2,s/2),this.moveTo(e,t+n),this.arc(e+n,t+n,n,Math.PI,1.5*Math.PI),this.lineTo(e+n,t),this.lineTo(e+i-n,t),this.arc(e+i-n,t+n,n,1.5*Math.PI,2*Math.PI),this.lineTo(e+i,t+n),this.lineTo(e+i,t+s-n),this.arc(e+i-n,t+s-n,n,0,Math.PI/2),this.lineTo(e+i-n,t+s),this.lineTo(e+n,t+s),this.arc(e+ +n,t+s-n,n,Math.PI/2,Math.PI),this.lineTo(e,t+s-n),this.closePath()}ellipse(e,t,i,s,n,r,a,h=!1){const o=i,c=s/i,l=Math.cos(n),d=Math.sin(n),u=-c*d,f=c*l,g=o*Math.cos(r),p=o*Math.sin(r),y=e+l*g+u*p,m=t+d*g+f*p,x=(y-this.cx)**2+(m-this.cy)**2;this.openedPath?x>1e-6&&this.lineTo(y,m):this.moveTo(y,m);let S=h?-normalizeAngle360(r-a):normalizeAngle360(a-r);Math.abs(Math.abs(a-r)-2*Math.PI)<1e-6&&S<2*Math.PI&&(S+=2*Math.PI*(h?-1:1));const C=Math.max(Math.ceil(Math.abs(S)/(Math.PI/2)),1),P=S/C,w=4/3*Math.tan(P/4);for(let b=0;b<C;b+=1){const v=r+P*(b+0),M=r+P*(b+1),k=o*Math.sin(v),T=o*Math.cos(v),F=o*Math.sin(M),R=o*Math.cos(M),E=T-w*k,q=k+w*T,W=R+w*F,H=F-w*R,$=R,j=F;this.cubicCurveTo(e+l*E+u*q,t+d*E+f*q,e+l*W+u*H,t+d*W+f*H,e+l*$+u*j,t+d*$+f*j)}}arc(e,t,i,s,n,r){this.ellipse(e,t,i,i,0,s,n,r)}appendSvg(e){const t=parseSvg(e);if(t==null)retu