ag-charts-community
Version:
Advanced Charting / Charts supporting Javascript / Typescript / React / Angular / Vue
2 lines • 1.09 MB
JavaScript
var yh=Object.defineProperty,rf=Object.getOwnPropertyDescriptor,GA=Object.getOwnPropertyNames,HA=Object.prototype.hasOwnProperty,Zs=(i,t)=>{for(var e in t)yh(i,e,{get:t[e],enumerable:!0})},of=(i,t,e,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of GA(t))!HA.call(i,n)&&n!==e&&yh(i,n,{get:()=>t[n],enumerable:!(s=rf(t,n))||s.enumerable});return i},UA=(i,t,e)=>(of(i,t,"default"),e&&of(e,t,"default")),x=(i,t,e,s)=>{for(var n=s>1?void 0:s?rf(t,e):t,a=i.length-1,r;a>=0;a--)(r=i[a])&&(n=(s?r(t,e,n):r(n))||n);return s&&n&&yh(t,e,n),n},lf={ariaInitSeriesArea:"interactive chart",ariaAnnounceHoverDatum:"${datum}",ariaAnnounceChart:"chart, ${seriesCount}[number] series",ariaAnnounceStandaloneChart:"chart, ${caption}",ariaAnnounceHierarchyChart:"hierarchy chart, ${caption}",ariaAnnounceGaugeChart:"gauge chart, ${caption}",ariaAnnounceHierarchyDatum:"level ${level}[number], ${count}[number] children, ${description}",ariaAnnounceFlowProportionLink:"link ${index} of ${count}, from ${from} to ${to}, ${sizeName} ${size}",ariaAnnounceFlowProportionNode:"node ${index} of ${count}, ${description}",ariaAnnounceOrgChartLeaf:"${description}, level ${level}[number], ${posInSet}[number] of ${setSize}[number]",ariaAnnounceOrgChartParent:"${description}, level ${level}[number], ${posInSet}[number] of ${setSize}[number], ${collapsedState}, ${childCount}[number] children, press Enter or Space to toggle",ariaAnnounceOrgChartParentSingular:"${description}, level ${level}[number], ${posInSet}[number] of ${setSize}[number], ${collapsedState}, 1 child, press Enter or Space to toggle",ariaOrgChartCollapsed:"collapsed",ariaOrgChartExpanded:"expanded",ariaDescriptionLegendItem:"Press Space or Enter to toggle visibility",ariaLabelAddHorizontalLine:"Add Horizontal Line",ariaLabelAnnotationsToolbar:"Annotations",ariaLabelAnnotationOptionsToolbar:"Annotation Options",ariaLabelAnnotationSettingsDialog:"Annotation Settings",ariaLabelColor:"Color",ariaLabelColorPicker:"Color picker",ariaLabelColorPickerAlpha:"Transparency",ariaLabelColorPickerHue:"Hue",ariaLabelColorPickerMultiColor:"Multi Color",ariaLabelColorPickerPalette:"Palette",ariaLabelFinancialCharts:"Financial Charts",ariaLabelGaugeTarget:"Target",ariaLabelGaugeValue:"Value",ariaLabelLegend:"Legend",ariaLabelLegendPagination:"Legend Pagination",ariaLabelLegendPagePrevious:"Previous Legend Page",ariaLabelLegendPageNext:"Next Legend Page",ariaLabelLegendItem:"${label}, Legend item ${index}[number] of ${count}[number]",ariaLabelLegendItemUnknown:"Unknown legend item",ariaLabelNavigator:"Navigator",ariaLabelNavigatorRange:"Range",ariaLabelScrollbarHorizontal:"X-axis scrollbar",ariaLabelScrollbarVertical:"Y-axis scrollbar",ariaLabelNavigatorMinimum:"Minimum",ariaLabelNavigatorMaximum:"Maximum",ariaLabelRangesToolbar:"Ranges",ariaLabelSettingsTabBar:"Settings",ariaLabelZoomToolbar:"Zoom",ariaRoleDescription2DSlider:"2D slider",ariaValueColorPalette:"s ${s}[percent0to2dp], v ${v}[percent0to2dp]",ariaValueColorPaletteFirstV:"v ${v}[percent0to2dp], s ${s}[percent0to2dp]",ariaValuePanRange:"${min}[percent0to2dp] to ${max}[percent0to2dp]",iconAltTextLineStyleSolid:"Solid",iconAltTextLineStyleDashed:"Long-dashed",iconAltTextLineStyleDotted:"Short-dashed",iconAltTextPositionTop:"Top",iconAltTextPositionCenter:"Center",iconAltTextPositionBottom:"Bottom",iconAltTextAlignLeft:"Left",iconAltTextAlignCenter:"Center",iconAltTextAlignRight:"Right",iconAltTextClose:"Close",overlayLoadingData:"Loading data...",overlayNoData:"No data to display",overlayNoVisibleSeries:"No visible series",overlayUnsupportedBrowser:"Incompatible browser version. Please upgrade your browser.",seriesHistogramTooltipFrequency:"Frequency",seriesHistogramTooltipSum:"${yName} (sum)",seriesHistogramTooltipCount:"${yName} (count)",seriesHistogramTooltipMean:"${yName} (mean)",toolbarSeriesTypeDropdown:"Chart Type",toolbarSeriesTypeOHLC:"OHLC",toolbarSeriesTypeHLC:"HLC",toolbarSeriesTypeHighLow:"High Low",toolbarSeriesTypeCandles:"Candles",toolbarSeriesTypeHollowCandles:"Hollow Candles",toolbarSeriesTypeLine:"Line",toolbarSeriesTypeLineWithMarkers:"Line with Markers",toolbarSeriesTypeStepLine:"Step Line",toolbarAnnotationsTrendLine:"Trend Line",toolbarAnnotationsFibonacciRetracement:"Fib Retracement",toolbarAnnotationsFibonacciRetracementTrendBased:"Fib Trend Based",toolbarAnnotationsHorizontalLine:"Horizontal Line",toolbarAnnotationsVerticalLine:"Vertical Line",toolbarAnnotationsParallelChannel:"Parallel Channel",toolbarAnnotationsDisjointChannel:"Disjoint Channel",toolbarAnnotationsClearAll:"Clear All",toolbarAnnotationsFillColor:"Fill Color",toolbarAnnotationsLineColor:"Line Color",toolbarAnnotationsLineStyle:"Line Style",toolbarAnnotationsLineStrokeWidth:"Line Stroke Width",toolbarAnnotationsSettings:"Settings",toolbarAnnotationsTextColor:"Text Color",toolbarAnnotationsTextSize:"Text Size",toolbarAnnotationsLock:"Lock",toolbarAnnotationsUnlock:"Unlock",toolbarAnnotationsDelete:"Delete",toolbarAnnotationsDragHandle:"Drag Toolbar",toolbarAnnotationsLineAnnotations:"Trend Lines",toolbarAnnotationsFibonacciAnnotations:"Fibonacci",toolbarAnnotationsTextAnnotations:"Text Annotations",toolbarAnnotationsShapeAnnotations:"Arrows",toolbarAnnotationsMeasurerAnnotations:"Measurers",toolbarAnnotationsCallout:"Callout",toolbarAnnotationsComment:"Comment",toolbarAnnotationsNote:"Note",toolbarAnnotationsText:"Text",toolbarAnnotationsArrow:"Arrow",toolbarAnnotationsArrowUp:"Arrow Up",toolbarAnnotationsArrowDown:"Arrow Down",toolbarAnnotationsDateRange:"Date Range",toolbarAnnotationsPriceRange:"Price Range",toolbarAnnotationsDatePriceRange:"Date and Price",toolbarAnnotationsQuickDatePriceRange:"Measure",toolbarRange1Month:"1M",toolbarRange1MonthAria:"1 month",toolbarRange3Months:"3M",toolbarRange3MonthsAria:"3 months",toolbarRange6Months:"6M",toolbarRange6MonthsAria:"6 months",toolbarRangeYearToDate:"YTD",toolbarRangeYearToDateAria:"Year to date",toolbarRange1Year:"1Y",toolbarRange1YearAria:"1 year",toolbarRangeAll:"All",toolbarRangeAllAria:"All",toolbarRangeSelectRange:"Select range",toolbarRangeSelectRangeAria:"Select range",toolbarZoomZoomOut:"Zoom out",toolbarZoomZoomIn:"Zoom in",toolbarZoomPanLeft:"Pan left",toolbarZoomPanRight:"Pan right",toolbarZoomPanStart:"Pan to the start",toolbarZoomPanEnd:"Pan to the end",toolbarZoomReset:"Reset the zoom",contextMenuDownload:"Download",contextMenuToggleSeriesVisibility:"Toggle Visibility",contextMenuToggleOtherSeries:"Toggle Other Series",contextMenuZoomToCursor:"Zoom to here",contextMenuPanToCursor:"Pan to here",contextMenuResetZoom:"Reset zoom",dialogHeaderChannel:"Channel",dialogHeaderLine:"Line",dialogHeaderFibonacciRange:"Fib Retracement",dialogHeaderDateRange:"Date Range",dialogHeaderPriceRange:"Price Range",dialogHeaderDatePriceRange:"Date and Price",dialogHeaderText:"Text",dialogInputAlign:"Align",dialogInputColorPicker:"Color",dialogInputColorPickerAltText:"Text Color",dialogInputFillColorPicker:"Fill",dialogInputFillColorPickerAltText:"Fill Color",dialogInputExtendChannelStart:"Extend channel start",dialogInputExtendChannelEnd:"Extend channel end",dialogInputExtendLineStart:"Extend line start",dialogInputExtendLineEnd:"Extend line end",dialogInputExtendAbove:"Extend above",dialogInputExtendBelow:"Extend below",dialogInputExtendLeft:"Extend left",dialogInputExtendRight:"Extend right",dialogInputReverse:"Reverse",dialogInputShowFill:"Show Fill",dialogInputFontSize:"Size",dialogInputFontSizeAltText:"Font Size",dialogInputLineStyle:"Dash",dialogInputPosition:"Position",dialogInputStrokeWidth:"Weight",dialogInputStrokeWidthAltText:"Line Weight",dialogInputFibonacciBands:"Bands",dialogInputFibonacciBandsAltText:"Fibonacci Bands",inputTextareaPlaceholder:"Add Text",measurerDateRangeBars:"${value}[number] bars",measurerPriceRangeValue:"${value}[number]",measurerPriceRangePercent:"${value}[percent]",measurerVolume:"Vol ${value}",tooltipPaginationStatus:"${index}[number] of ${count}[number]"},jA=void 0,WA=void 0,$A=void 0,KA=void 0,cf=(i=>(i.POINTER="pointer",i.NODE="node",i.CHART="chart",i))(cf||{}),hf=(i=>(i.TOP="top",i.RIGHT="right",i.BOTTOM="bottom",i.LEFT="left",i.TOP_RIGHT="top-right",i.BOTTOM_RIGHT="bottom-right",i.BOTTOM_LEFT="bottom-left",i.TOP_LEFT="top-left",i.CENTER="center",i))(hf||{}),YA=void 0,ZA=void 0,XA=void 0,qA=void 0;import{Logger as JA}from"ag-charts-core";function df(i,t,e,s){return{unit:i,step:t,epoch:e,utc:s,every(n){return df(this.unit,(this.step??1)*n,this.epoch,this.utc)}}}var uf={};function Ae(i,t=1,e,s=!1){JA.warnOnce("time import is deprecated, use object notation instead");const n=`${i}:${t}:${e?.getTime()??0}:${s}`;let a=uf[n];return a==null&&(a=df(i,t,e,s),uf[n]=a),a}var QA={get millisecond(){return Ae("millisecond")},get second(){return Ae("second")},get minute(){return Ae("minute")},get hour(){return Ae("hour")},get day(){return Ae("day")},get monday(){return Ae("day",7,new Date(1970,0,5))},get tuesday(){return Ae("day",7,new Date(1970,0,6))},get wednesday(){return Ae("day",7,new Date(1970,0,7))},get thursday(){return Ae("day",7,new Date(1970,0,1))},get friday(){return Ae("day",7,new Date(1970,0,2))},get saturday(){return Ae("day",7,new Date(1970,0,3))},get sunday(){return Ae("day",7,new Date(1970,0,4))},get month(){return Ae("month")},get year(){return Ae("year")},get utcMillisecond(){return Ae("millisecond",1,void 0,!0)},get utcSecond(){return Ae("second",1,void 0,!0)},get utcMinute(){return Ae("minute",1,void 0,!0)},get utcHour(){return Ae("hour",1,void 0,!0)},get utcDay(){return Ae("day",1,void 0,!0)},get utcMonth(){return Ae("month",1,void 0,!0)},get utcYear(){return Ae("year",1,void 0,!0)}};import{Debug as bh,MementoCaretaker as eC,ModuleRegistry as pf,deepClone as ea,deepFreeze as tC,enterpriseRegistry as ur,jsonWalk as iC,strictObjectKeys as sC}from"ag-charts-core";import{ActionOnSet as cs,AgDocument as nC,AsyncAwaitQueue as gf,ChartAxisDirection as ta,ChartUpdateType as B,CleanupRegistry as aC,Color as ff,Debug as vh,Logger as Xs,ModuleRegistry as qs,ModuleType as pr,Padding as rC,Property as Di,ProxyProperty as xh,ZIndexMap as Ho,callWithContext as oC,createId as lC,enterpriseRegistry as mf,entries as Sh,getWindow as cC,isFiniteNumber as yf,isInputPending as hC,jsonApply as dC,mergeDefaults as Js,pause as bf,roundTo as uC,toPlainText as pC}from"ag-charts-core";import{boxContains as gC,boxesEqual as fC,clamp as vf,nearestSquared as mC}from"ag-charts-core";var Uo=Symbol("interpolate"),jo=i=>i[Uo]!=null,yC=(()=>{var i=class dr{constructor(e,s,n,a){this.x=e,this.y=s,this.width=n,this.height=a}static fromObject({x:e,y:s,width:n,height:a}){return new dr(e,s,n,a)}static merge(e){let s=1/0,n=1/0,a=-1/0,r=-1/0;for(const o of e)o.x<s&&(s=o.x),o.y<n&&(n=o.y),dt(o.x,o.width)>a&&(a=dt(o.x,o.width)),dt(o.y,o.height)>r&&(r=dt(o.y,o.height));return new dr(s,n,a-s,r-n)}static nearestBox(e,s,n){return mC(e,s,n)}toDOMRect(){return{x:this.x,y:this.y,width:this.width,height:this.height,top:this.y,left:this.x,right:dt(this.x,this.width),bottom:dt(this.y,this.height),toJSON(){return{}}}}clone(){const{x:e,y:s,width:n,height:a}=this;return new dr(e,s,n,a)}equals(e){return fC(this,e)}containsPoint(e,s){return gC(this,e,s)}intersectsWith(e){return!(this.x+this.width<=e.x||e.x+e.width<=this.x||this.y+this.height<=e.y||e.y+e.height<=this.y)}intersection(e){const s=Math.max(this.x,e.x),n=Math.max(this.y,e.y),a=Math.min(dt(this.x,this.width),dt(e.x,e.width)),r=Math.min(dt(this.y,this.height),dt(e.y,e.height));if(!(s>a||n>r))return new dr(s,n,a-s,r-n)}collidesBBox(e){return this.x<dt(e.x,e.width)&&dt(this.x,this.width)>e.x&&this.y<dt(e.y,e.height)&&dt(this.y,this.height)>e.y}computeCenter(){return{x:this.x+this.width/2,y:this.y+this.height/2}}isFinite(){return Number.isFinite(this.x)&&Number.isFinite(this.y)&&Number.isFinite(this.width)&&Number.isFinite(this.height)}distanceSquared(e,s){if(this.containsPoint(e,s))return 0;const n=e-vf(this.x,e,dt(this.x,this.width)),a=s-vf(this.y,s,dt(this.y,this.height));return n*n+a*a}shrink(e,s){if(typeof e=="number")this.applyMargin(e,s);else for(const n of Object.keys(e)){const a=e[n];typeof a=="number"&&this.applyMargin(a,n)}return this.width<0&&(this.width=0),this.height<0&&(this.height=0),this}grow(e,s){if(typeof e=="number")this.applyMargin(-e,s);else for(const n of Object.keys(e)){const a=e[n];typeof a=="number"&&this.applyMargin(-a,n)}return this}applyMargin(e,s){switch(s){case"top":this.y+=e;case"bottom":this.height-=e;break;case"left":this.x+=e;case"right":this.width-=e;break;case"vertical":this.y+=e,this.height-=e*2;break;case"horizontal":this.x+=e,this.width-=e*2;break;case void 0:this.x+=e,this.y+=e,this.width-=e*2,this.height-=e*2;break}}translate(e,s){return this.x+=e,this.y+=s,this}[Uo](e,s){return new dr(this.x*(1-s)+e.x*s,this.y*(1-s)+e.y*s,this.width*(1-s)+e.width*s,this.height*(1-s)+e.height*s)}};return i.zero=Object.freeze(new i(0,0,0,0)),i.NaN=Object.freeze(new i(Number.NaN,Number.NaN,Number.NaN,Number.NaN)),i})(),_=yC;function dt(i,t){return i===-1/0&&t===1/0?1/0:i+t}import{clamp as bC,toIterable as vC}from"ag-charts-core";import{getOffscreenCanvas as xf}from"ag-charts-core";import{Debug as xC}from"ag-charts-core";function Sf({context:i,pixelRatio:t,width:e,height:s}){i.save();try{i.resetTransform(),i.clearRect(0,0,Math.ceil(e*t),Math.ceil(s*t))}finally{i.restore()}}function If(i){if(xC.check("canvas")){const t=i.save.bind(i),e=i.restore.bind(i);let s=0;Object.assign(i,{save(){t(),s++},restore(){if(s===0)throw new Error("AG Charts - Unable to restore() past depth 0");e(),s--},verifyDepthZero(){if(s!==0)throw new Error(`AG Charts - Save/restore depth is non-zero: ${s}`)}})}}function Df(i,t,e){return[Math.floor(i*e),Math.floor(t*e)]}var Ih;function SC(){const i=xf();return Ih??(Ih=new i(1,1)),Ih}var Dh=class{constructor(i){const{width:t,height:e,pixelRatio:s,willReadFrequently:n=!1}=i;this.width=t,this.height=e,this.pixelRatio=s;const[a,r]=Df(t,e,s),o=xf();this.canvas=new o(a,r),this.context=this.canvas.getContext("2d",{willReadFrequently:n}),this.context.setTransform(s,0,0,s,0,0),If(this.context)}drawImage(i,t=0,e=0){return i.drawImage(this.canvas,t,e)}transferToImageBitmap(){return this.canvas.width<1||this.canvas.height<1?SC().transferToImageBitmap():this.canvas.transferToImageBitmap()}resize(i,t,e){if(!(i>0&&t>0))return;const{canvas:s,context:n}=this;if(i!==this.width||t!==this.height||e!==this.pixelRatio){const[a,r]=Df(i,t,e);s.width=a,s.height=r}n.setTransform(e,0,0,e,0,0),this.width=i,this.height=t,this.pixelRatio=e}clear(){Sf(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{DeclaredSceneChangeDetection as Mf,Logger as Mh,createId as IC,createSvgElement as Af,objectsEqual as DC}from"ag-charts-core";var Ah=(i,t)=>Math.sign(i-t);function Cf(i,t){if(typeof i=="number"&&typeof t=="number")return Ah(i,t);const e=typeof i=="number"?[i]:i,s=typeof t=="number"?[t]:t,n=Math.min(e.length,s.length);for(let a=0;a<n;a+=1){const r=Ah(e[a],s[a]);if(r!==0)return r}return Ah(e.length,s.length)}import{SceneChangeDetection as Z}from"ag-charts-core";var Tf=(i=>(i[i.All=0]="All",i[i.None=1]="None",i))(Tf||{}),MC=5,AC=(()=>{var i=class ef{constructor(e){this.serialNumber=ef._nextSerialNumber++,this.childNodeCounts={groups:0,nonGroups:0,thisComplexity:0,complexity:0},this.id=IC(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=e?.name,this.tag=e?.tag??Number.NaN,this.zIndex=e?.zIndex??0,this.scene=e?.scene,(e?.debugDirty??ef._debugEnabled)&&(this._debugDirtyProperties=new Map([["__first__",[]]]))}static toSVG(e,s,n){const a=e?.toSVG();if(a==null||!a.elements.length&&!a.defs?.length)return;const r=Af("svg");if(r.setAttribute("width",String(s)),r.setAttribute("height",String(n)),r.setAttribute("viewBox",`0 0 ${s} ${n}`),r.setAttribute("overflow","visible"),a.defs?.length){const o=Af("defs");o.append(...a.defs),r.append(o)}return r.append(...a.elements),r.outerHTML}static*extractBBoxes(e,s){for(const n of e)if(!s||n.visible&&!n.transitionOut){const a=n.getBBox();a&&(yield a)}}get datum(){return this._datum}set datum(e){this._datum!==e&&(this._previousDatum=this._datum,this._datum=e)}get previousDatum(){return this._previousDatum}get unsafeNonNullDatum(){return this.datum}get unsafeDatum(){return this.datum}set unsafeDatum(e){this.datum=e}get unsafePreviousDatum(){return this.previousDatum}get layerManager(){return this.scene?.layersManager}get imageLoader(){return this.scene?.imageLoader}closestDatum(){for(const{datum:e}of this.traverseUp(!0))if(e!=null)return e}unsafeClosestDatum(){return this.closestDatum()}preRender(e,s=1){if(this.childNodeCounts.groups=0,this.childNodeCounts.nonGroups=1,this.childNodeCounts.complexity=s,this.childNodeCounts.thisComplexity=s,this.batchLevel>0||this.batchDirty)throw new Error("AG Charts - illegal rendering state; batched update in progress");return this.childNodeCounts}isolatedRender(e){e.ctx.save();try{this.render(e)}catch(s){const n=s.errorCount??1;if(n>=MC)throw s.errorCount=n,s;Mh.warnOnce("Error during rendering",s,s.stack)}finally{e.ctx.restore()}}render(e){const{stats:s}=e;if(this.debugDirtyProperties(),e.debugNodeSearch){const n=this.name??this.id;e.debugNodeSearch.some(a=>typeof a=="string"?a===n:a.test(n))&&(e.debugNodes[this.name??this.id]=this)}s&&(s.nodesRendered++,s.opsPerformed+=this.childNodeCounts.thisComplexity)}setScene(e){this.scene=e}*traverseUp(e){e&&(yield this);let s=this.parentNode;for(;s;)yield s,s=s.parentNode}isRoot(){return!this.parentNode}removeChild(e){throw new Error(`AG Charts - internal error, unknown child node ${e.name??e.id} in $${this.name??this.id}`)}remove(){this.parentNode?.removeChild(this)}destroy(){this.parentNode&&this.remove()}batchedUpdate(e){this.batchLevel++;try{e()}finally{this.batchLevel--,this.batchLevel===0&&this.batchDirty&&(this.markDirty(),this.batchDirty=!1)}}setProperties(e){this.batchLevel++;try{const s=this,n=e,a=Object.keys(n);for(let r=0,o=a.length;r<o;r++){const l=a[r];s[l]=n[l]}}finally{this.batchLevel--,this.batchLevel===0&&this.batchDirty&&(this.markDirty(),this.batchDirty=!1)}return this}setPropertiesWithKeys(e,s){this.batchLevel++;try{const n=this,a=e;for(let r=0,o=s.length;r<o;r++){const l=s[r];n[l]=a[l]}}finally{this.batchLevel--,this.batchLevel===0&&this.batchDirty&&(this.markDirty(),this.batchDirty=!1)}return this}containsPoint(e,s){return!1}pickNode(e,s){if(!(!this.visible||this.pointerEvents===1)&&this.containsPoint(e,s))return this}pickNodes(e,s,n=[]){return!this.visible||this.pointerEvents===1||this.containsPoint(e,s)&&n.push(this),n}getBBox(){return this.cachedBBox??(this.cachedBBox=Object.freeze(this.computeBBox())),this.cachedBBox}computeBBox(){}onChangeDetection(e){this.markDirty(e)}markDirtyChildrenOrder(){this.cachedBBox=void 0}markDirty(e){if(this.batchLevel>0){this.batchDirty=!0;return}e!=null&&this._debugDirtyProperties&&this.markDebugProperties(e),this.cachedBBox=void 0,this.parentNode?.markDirty()}markDebugProperties(e){const s=this._debugDirtyProperties?.get(e)??[],n=new Error("Stack trace for property change tracking").stack?.split(`
`).filter(a=>a!=="Error"&&!a.includes(".markDebugProperties")&&!a.includes(".markDirty")&&!a.includes("Object.assign ")&&!a.includes(`${this.constructor.name}.`))??"unknown";s.push(n[0].replace(" at ","").trim()),this._debugDirtyProperties?.set(e,s)}debugDirtyProperties(){if(this._debugDirtyProperties!=null){if(!this._debugDirtyProperties.has("__first__"))for(const[e,s]of this._debugDirtyProperties.entries())s.length>1&&Mh.logGroup(`Property changed multiple times before render: ${this.constructor.name}.${e} (${s.length}x)`,()=>{for(const n of s)Mh.log(n)});this._debugDirtyProperties.clear()}}static handleNodeZIndexChange(e){e.onZIndexChange()}onZIndexChange(){this.parentNode?.markDirtyChildrenOrder()}resolveFont(){}toSVG(){}};return i.className="AbstractNode",i._nextSerialNumber=0,i._debugEnabled=!1,x([Mf()],i.prototype,"visible",2),x([Mf({equals:DC,changeCb:i.handleNodeZIndexChange})],i.prototype,"zIndex",2),i})(),zi=AC;import{DeclaredSceneChangeDetection as Gi,DeclaredSceneObjectChangeDetection as Ch,SceneArrayChangeDetection as CC,SceneObjectChangeDetection as Lf,TRIPLE_EQ as TC,boxesEqual as LC,clamp as NC,generateUUID as Th,isGradientFill as Lh,isImageFill as Nf,isPatternFill as kf,isString as kC,objectsEqual as Wo}from"ag-charts-core";import{createSvgElement as OC,normalizeAngle360FromDegrees as wC}from"ag-charts-core";import{createSvgElement as EC}from"ag-charts-core";import{Color as Nh,Logger as kh,clamp as RC}from"ag-charts-core";var $o=class{ticks(i,t,e){}niceDomain(i,t=this.domain){return t}get bandwidth(){}get step(){}get inset(){}},gr=(i,t)=>{const e=Symbol(String(t));i[e]=void 0,Object.defineProperty(i,t,{get(){return this[e]},set(s){this[e]!==s&&(this[e]=s,this.invalid=!0)},enumerable:!0,configurable:!1})};import{clamp as Of,readIntegratedWrappedValue as wf}from"ag-charts-core";function PC(i,t,e){if(e==null||e[0]===0&&e[1]===1)return;const s=Of(0,Math.floor(e[0]*i.length),i.length),n=Of(0,Math.ceil(e[1]*i.length),i.length),a=t?i.length-n:s,r=t?i.length-s:n;return[a,r]}function Ef(i,t,e){const s=PC(i,t,e);if(s==null)return{ticks:i,count:i.length,firstTickIndex:0};const[n,a]=s;return{ticks:i.slice(n,a),count:i.length,firstTickIndex:n}}function Ko(i){const t=wf(i.at(0)),e=wf(i.at(-1));return t!=null&&e!=null?[t,e]:[void 0,void 0]}var Rf=i=>{const t=Nh.fromString(i),[e,s,n]=Nh.RGBtoOKLCH(t.r,t.g,t.b);return{l:e,c:s,h:n,a:t.a}},Oh=1e-6,Pf=i=>i.c<Oh||i.l<Oh||i.l>1-Oh,_C=(i,t,e)=>{e=RC(0,e,1);let s;if(Pf(i))s=t.h;else if(Pf(t))s=i.h;else{const o=i.h;let l=t.h;const c=t.h-i.h;c>180?l-=360:c<-180&&(l+=360),s=o*(1-e)+l*e}const n=i.c*(1-e)+t.c*e,a=i.l*(1-e)+t.l*e,r=i.a*(1-e)+t.a*e;return Nh.fromOKLCH(a,n,s,r)},fr=(()=>{var i=class extends $o{constructor(){super(...arguments),this.type="color",this.defaultTickCount=0,this.invalid=!0,this.domain=[0,1],this.range=["red","blue"],this.mode="continuous",this.parsedRange=this.range.map(Rf)}update(){const{domain:t,range:e}=this;t.length<2&&(kh.warnOnce("`colorDomain` should have at least 2 values."),t.length===0?t.push(0,1):t.length===1&&t.push(t[0]+1));for(let n=1;n<t.length;n++){const a=t[n-1],r=t[n];if(a>r){kh.warnOnce("`colorDomain` values should be supplied in ascending order."),t.sort((o,l)=>o-l);break}}const s=this.mode==="discrete"?t.length-1:t.length;if(e.length<s)for(let n=e.length;n<s;n++)e.push(e.length>0?e[0]:"black");this.parsedRange=this.range.map(Rf)}normalizeDomains(...t){return{domain:t.map(e=>e.domain).flat(),animatable:!0}}toDomain(){}convert(t){this.refresh();const{domain:e,range:s,parsedRange:n}=this,a=e[0],r=e.at(-1),o=s[0],l=s.at(-1);if(t<=a)return o;if(t>=r)return l;let c,h;if(e.length===2){const p=(t-a)/(r-a),g=1/(s.length-1);c=s.length<=2?0:Math.min(Math.floor(p*(s.length-1)),s.length-2),h=(p-c*g)/g}else{for(c=0;c<e.length-2&&!(t<e[c+1]);c++);const p=e[c],g=e[c+1];h=(t-p)/(g-p)}if(this.mode==="discrete")return s[c];const d=n[c],u=n[c+1];return _C(d,u,h).toRgbaString()}invert(){}getDomainMinMax(){return Ko(this.domain)}refresh(){this.invalid&&(this.invalid=!1,this.update(),this.invalid&&kh.warnOnce("Expected update to not invalidate scale"))}};return x([gr],i.prototype,"domain",2),x([gr],i.prototype,"range",2),x([gr],i.prototype,"mode",2),i})(),wh=class{constructor(i,t=[],e){this.colorSpace=i,this.stops=t,this.bbox=e,this._cache=void 0}createGradient(i,t,e){const s=this.bbox??t;if(!s.isFinite())return;if(this._cache?.ctx===i&&this._cache.bbox.equals(s))return this._cache.gradient;const{stops:n,colorSpace:a}=this;if(n.length===0)return;if(n.length===1)return n[0].color;let r=this.createCanvasGradient(i,s,e);if(r==null)return;const o=a==="oklch",l=.05;let c=n[0];r.addColorStop(c.stop,c.color);for(let h=1;h<n.length;h+=1){const d=n[h];if(o){const u=new fr;u.domain=[c.stop,d.stop],u.range=[c.color,d.color];for(let p=c.stop+l;p<d.stop;p+=l)r.addColorStop(p,u.convert(p)??"transparent")}r.addColorStop(d.stop,d.color),c=d}return"createPattern"in r&&(r=r.createPattern()),this._cache={ctx:i,bbox:s,gradient:r},r}toSvg(i){const t=this.bbox??i,e=this.createSvgGradient(t);for(const{stop:s,color:n}of this.stops){const a=EC("stop");a.setAttribute("offset",`${s}`),a.setAttribute("stop-color",`${n}`),e.appendChild(a)}return e}},FC=class extends wh{constructor(i,t,e=0,s){super(i,t,s),this.angle=e}createCanvasGradient(i,t,e){const{angle:n}=this,a=wC(n+-90),r=e?.centerX??t.x+t.width*.5,o=e?.centerY??t.y+t.height*.5;return i.createConicGradient(a,r,o)}createSvgGradient(i){return OC("linearGradient")}};import{createSvgElement as VC,normalizeAngle360FromDegrees as BC}from"ag-charts-core";var zC=class extends wh{constructor(i,t,e=0,s){super(i,t,s),this.angle=e}getGradientPoints(i){const{angle:e}=this,s=BC(e+90),n=Math.cos(s),a=Math.sin(s),r=i.width,o=i.height,l=i.x+r*.5,c=i.y+o*.5,h=Math.hypot(o,r)/2,d=Math.atan2(o,r);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 p=h*Math.abs(Math.cos(u-d));return{x0:l+n*p,y0:c+a*p,x1:l-n*p,y1:c-a*p}}createCanvasGradient(i,t){const{x0:e,y0:s,x1:n,y1:a}=this.getGradientPoints(t);if(!(Number.isNaN(e)||Number.isNaN(s)||Number.isNaN(n)||Number.isNaN(a)))return i.createLinearGradient(e,s,n,a)}createSvgGradient(i){const{x0:t,y0:e,x1:s,y1:n}=this.getGradientPoints(i),a=VC("linearGradient");return a.setAttribute("x1",String(t)),a.setAttribute("y1",String(e)),a.setAttribute("x2",String(s)),a.setAttribute("y2",String(n)),a.setAttribute("gradientUnits","userSpaceOnUse"),a}};import{createSvgElement as GC}from"ag-charts-core";var HC=class extends wh{constructor(i,t,e){super(i,t,e)}createCanvasGradient(i,t,e){const s=e?.centerX??t.x+t.width*.5,n=e?.centerY??t.y+t.height*.5,a=e?.innerRadius??0,r=e?.outerRadius??Math.hypot(t.width*.5,t.height*.5)/Math.SQRT2;return i.createRadialGradient(s,n,a,s,n,r)}createSvgGradient(i){const t=i.x+i.width*.5,e=i.y+i.height*.5,s=GC("radialGradient");return s.setAttribute("cx",String(t)),s.setAttribute("cy",String(e)),s.setAttribute("r",String(Math.hypot(i.width*.5,i.height*.5)/Math.SQRT2)),s.setAttribute("gradientUnits","userSpaceOnUse"),s}};import{BaseProperties as _f,PropertiesArray as UC,Property as Qs,discreteColorStops as Ff,resolveStopPositions as jC}from"ag-charts-core";var Vf=(()=>{var i=class extends _f{constructor(){super(...arguments),this.color="black"}};return x([Qs],i.prototype,"stop",2),x([Qs],i.prototype,"color",2),x([Qs],i.prototype,"name",2),i})(),Eh=(()=>{var i=class extends _f{constructor(){super(...arguments),this.fills=new UC(Vf),this.mode="continuous"}};return x([Qs],i.prototype,"fills",2),x([Qs],i.prototype,"domain",2),x([Qs],i.prototype,"mode",2),x([Qs],i.prototype,"missingDataFill",2),i})();function WC(i,t){const e=t==="discrete"?1:0,s=i.map((n,a,{length:r})=>({stop:(a+e)/(r-1+e),color:n}));return t==="discrete"?Ff(s):s}function Bf(i,t,e,s="continuous"){const n=i.map(u=>typeof u=="string"?{color:u}:u);if(n.length===0)return WC(t,s);const a=Math.min(...e),r=Math.max(...e),l=jC(n,a,r,s==="discrete");let c=n.find(u=>u.color!=null)?.color,h;const d=n.map((u,p)=>{let g=u?.color;const f=Math.max(0,Math.min(1,(l[p]-a)/(r-a)));return g!=null?c=g:c==null?(h==null&&(h=new fr,h.domain=[0,1],h.range=t),g=h.convert(f)):g=c,{stop:f,color:g}});return s==="discrete"?Ff(d):d}import{Logger as $C,createSvgElement as Rh,getDOMMatrix as KC,normalizeAngle360FromDegrees as YC}from"ag-charts-core";var ZC=class{constructor(i,t){this.imageLoader=i,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(i,t,e,s){if(!t)return null;const[n,a]=this.getSize(t.width,t.height,e,s);return n<1||a<1?($C.warnOnce("Image fill is too small to render, ignoring."),null):i.createPattern(t,this.repeat)}getSize(i,t,e,s){const{fit:n}=this;let a=i,r=t,o=1;const l=e/s,c=i/t;return n==="stretch"||i===0||t===0?(a=e,r=s):n==="contain"?o=c>l?e/i:s/t:n==="cover"&&(o=c>l?s/t:e/i),[Math.max(1,a*o),Math.max(1,r*o)]}setImageTransform(i,t){if(typeof i=="string")return;const{url:e,rotation:s,width:n,height:a}=this,r=this.imageLoader?.loadImage(e);if(!r)return;const o=YC(s),l=Math.cos(o),c=Math.sin(o),[h,d]=this.getSize(r.width,r.height,n??t.width,a??t.height),u=h/r.width,p=d/r.height,g=t.x+t.width/2,f=t.y+t.height/2,m=l*h-c*d,y=c*h+l*d,b=m/2,v=y/2,S=KC();i?.setTransform(new S([l*u,c*p,-c*u,l*p,g-b,f-v]))}createPattern(i,t,e,s){const n=this.width??t,a=this.height??e,r=this._cache;if(r?.ctx===i&&r.width===n&&r.height===a)return r.pattern;const o=this.imageLoader?.loadImage(this.url,s),l=this.createCanvasImage(i,o,n,a);if(l!=null)return this._cache={ctx:i,pattern:l,width:n,height:a},l}toSvg(i,t){const{url:e,rotation:s,backgroundFill:n,backgroundFillOpacity:a}=this,{x:r,y:o,width:l,height:c}=i,h=Rh("pattern");h.setAttribute("viewBox",`0 0 ${l} ${c}`),h.setAttribute("x",String(r)),h.setAttribute("y",String(o)),h.setAttribute("width",String(l)),h.setAttribute("height",String(c)),h.setAttribute("patternUnits","userSpaceOnUse");const d=Rh("rect");d.setAttribute("x","0"),d.setAttribute("y","0"),d.setAttribute("width",String(l)),d.setAttribute("height",String(c)),d.setAttribute("fill",n),d.setAttribute("fill-opacity",String(a)),h.appendChild(d);const u=Rh("image");return u.setAttribute("href",e),u.setAttribute("x","0"),u.setAttribute("y","0"),u.setAttribute("width",String(l)),u.setAttribute("height",String(c)),u.setAttribute("preserveAspectRatio","none"),u.setAttribute("transform",`scale(${1/t}) rotate(${s}, ${l/2}, ${c/2})`),h.appendChild(u),h}};import{Logger as XC,createSvgElement as Ph,getDOMMatrix as qC,normalizeAngle360FromDegrees as JC}from"ag-charts-core";import{bezier2DDistance as QC,bezier2DExtrema as eT,evaluateBezier as zf,getPath2D as Gf,lineDistanceSquared as Hf,normalizeAngle360 as Uf}from"ag-charts-core";import{Logger as jf}from"ag-charts-core";var tT=/^[\t\n\f\r ]*([achlmqstvz])[\t\n\f\r ]*/i,le=/^[+-]?((\d*\.\d+)|(\d+\.)|(\d+))(e[+-]?\d+)?/i,iT=/[\t\n\f\r ]*,?[\t\n\f\r ]*/,Wf=/^[01]/,sT={z:[],h:[le],v:[le],m:[le,le],l:[le,le],t:[le,le],s:[le,le,le,le],q:[le,le,le,le],c:[le,le,le,le,le,le],a:[le,le,le,Wf,Wf,le,le]};function nT(i){if(!i)return;const t=[];let e=0,s;for(;e<i.length;){const n=tT.exec(i.slice(e));let a;if(n==null){if(!s){jf.warnOnce(`Invalid SVG path, error at index ${e}: Missing command.`);return}a=s}else a=n[1],e+=n[0].length;const r=aT(a,i,e);if(!r)return;e=r[0],s=a,t.push(r[1])}return t}function aT(i,t,e){const s=sT[i.toLocaleLowerCase()],n={command:i,params:[]};for(const a of s){const r=t.slice(e),o=a.exec(r);if(o!=null){n.params.push(Number.parseFloat(o[0])),e+=o[0].length;const l=iT.exec(r.slice(o[0].length));l!=null&&(e+=l[0].length)}else{if(n.params.length===1)return[e,n];jf.warnOnce(`Invalid SVG path, error at index ${e}: No path segment parameters for command [${i}]`);return}}return[e,n]}function rT(i,t){const e=-t/i;return i!==0&&e>=0&&e<=1?[e]:[]}function oT(i,t,e,s=1e-6){if(Math.abs(i)<s)return rT(t,e);const n=t*t-4*i*e,a=[];if(Math.abs(n)<s){const r=-t/(2*i);r>=0&&r<=1&&a.push(r)}else if(n>0){const r=Math.sqrt(n),o=(-t-r)/(2*i),l=(-t+r)/(2*i);o>=0&&o<=1&&a.push(o),l>=0&&l<=1&&a.push(l)}return a}function lT(i,t,e,s,n=1e-6){if(Math.abs(i)<n)return oT(t,e,s,n);const a=t/i,r=e/i,o=s/i,l=(3*r-a*a)/9,c=(9*a*r-27*o-2*a*a*a)/54,h=l*l*l+c*c,d=1/3,u=[];if(h>=0){const p=Math.sqrt(h),g=Math.sign(c+p)*Math.pow(Math.abs(c+p),d),f=Math.sign(c-p)*Math.pow(Math.abs(c-p),d),m=Math.abs(Math.sqrt(3)*(g-f)/2),y=-d*a+(g+f);if(y>=0&&y<=1&&u.push(y),Math.abs(m)<n){const b=-d*a-(g+f)/2;b>=0&&b<=1&&u.push(b)}}else{const p=Math.acos(c/Math.sqrt(-l*l*l)),g=d*a,f=2*Math.sqrt(-l),m=f*Math.cos(d*p)-g,y=f*Math.cos(d*(p+2*Math.PI))-g,b=f*Math.cos(d*(p+4*Math.PI))-g;m>=0&&m<=1&&u.push(m),y>=0&&y<=1&&u.push(y),b>=0&&b<=1&&u.push(b)}return u}function mr(i,t,e,s,n,a,r,o){const l=(e-i)*(o-a)-(s-t)*(r-n);if(l===0)return 0;const c=((r-n)*(t-a)-(i-n)*(o-a))/l,h=((e-i)*(t-a)-(s-t)*(i-n))/l;return c>=0&&c<=1&&h>=0&&h<=1?1:0}function cT(i,t,e,s,n,a,r,o,l,c,h,d){let u=0;const p=c-d,g=h-l,f=l*(d-c)-c*(h-l),m=$f(i,e,n,r),y=$f(t,s,a,o),b=p*m[0]+g*y[0],v=p*m[1]+g*y[1],S=p*m[2]+g*y[2],I=p*m[3]+g*y[3]+f,D=lT(b,v,S,I);for(const M of D){const A=M*M,C=M*A,T=m[0]*C+m[1]*A+m[2]*M+m[3],L=y[0]*C+y[1]*A+y[2]*M+y[3];let k;l===h?k=(L-c)/(d-c):k=(T-l)/(h-l),k>=0&&k<=1&&u++}return u}function $f(i,t,e,s){return[-i+3*t-3*e+s,3*i-6*t+3*e,-3*i+3*t,i]}var ia=class{constructor(){this.previousCommands=[],this.previousParams=[],this.previousClosedPath=!1,this.commands=[],this.params=[],this.commandsLength=0,this.paramsLength=0,this.cx=Number.NaN,this.cy=Number.NaN,this.sx=Number.NaN,this.sy=Number.NaN,this.openedPath=!1,this.closedPath=!1;const i=Gf();this.path2d=new i}isEmpty(){return this.commandsLength===0}isDirty(){return this.closedPath!==this.previousClosedPath||this.previousCommands.length!==this.commandsLength||this.previousParams.length!==this.paramsLength||this.previousCommands.toString()!==this.commands.slice(0,this.commandsLength).toString()||this.previousParams.toString()!==this.params.slice(0,this.paramsLength).toString()}getPath2D(){return this.path2d}moveTo(i,t){this.openedPath=!0,this.sx=i,this.sy=t,this.cx=i,this.cy=t,this.path2d.moveTo(i,t),this.commands[this.commandsLength++]=0,this.params[this.paramsLength++]=i,this.params[this.paramsLength++]=t}lineTo(i,t){this.openedPath?(this.cx=i,this.cy=t,this.path2d.lineTo(i,t),this.commands[this.commandsLength++]=1,this.params[this.paramsLength++]=i,this.params[this.paramsLength++]=t):this.moveTo(i,t)}cubicCurveTo(i,t,e,s,n,a){this.openedPath||this.moveTo(i,t),this.path2d.bezierCurveTo(i,t,e,s,n,a),this.commands[this.commandsLength++]=2,this.params[this.paramsLength++]=i,this.params[this.paramsLength++]=t,this.params[this.paramsLength++]=e,this.params[this.paramsLength++]=s,this.params[this.paramsLength++]=n,this.params[this.paramsLength++]=a}closePath(){this.openedPath&&(this.cx=this.sx,this.cy=this.sy,this.sx=Number.NaN,this.sy=Number.NaN,this.path2d.closePath(),this.commands[this.commandsLength++]=3,this.openedPath=!1,this.closedPath=!0)}rect(i,t,e,s){this.moveTo(i,t),this.lineTo(i+e,t),this.lineTo(i+e,t+s),this.lineTo(i,t+s),this.closePath()}roundRect(i,t,e,s,n){n=Math.min(n,e/2,s/2),this.moveTo(i,t+n),this.arc(i+n,t+n,n,Math.PI,1.5*Math.PI),this.lineTo(i+n,t),this.lineTo(i+e-n,t),this.arc(i+e-n,t+n,n,1.5*Math.PI,2*Math.PI),this.lineTo(i+e,t+n),this.lineTo(i+e,t+s-n),this.arc(i+e-n,t+s-n,n,0,Math.PI/2),this.lineTo(i+e-n,t+s),this.lineTo(i+n,t+s),this.arc(i+ +n,t+s-n,n,Math.PI/2,Math.PI),this.lineTo(i,t+s-n),this.closePath()}ellipse(i,t,e,s,n,a,r,o=!1){const l=e,c=s/e,h=Math.cos(n),d=Math.sin(n),u=-c*d,p=c*h,g=l*Math.cos(a),f=l*Math.sin(a),m=i+h*g+u*f,y=t+d*g+p*f,b=(m-this.cx)**2+(y-this.cy)**2;this.openedPath?b>1e-6&&this.lineTo(m,y):this.moveTo(m,y);let v=o?-Uf(a-r):Uf(r-a);Math.abs(Math.abs(r-a)-2*Math.PI)<1e-6&&v<2*Math.PI&&(v+=2*Math.PI*(o?-1:1));const S=Math.max(Math.ceil(Math.abs(v)/(Math.PI/2)),1),I=v/S,D=4/3*Math.tan(I/4);for(let M=0;M<S;M+=1){const A=a+I*(M+0),C=a+I*(M+1),T=l*Math.sin(A),L=l*Math.cos(A),k=l*Math.sin(C),O=l*Math.cos(C),E=L-D*T,N=T+D*L,R=O+D*k,P=k-D*O,w=O,F=k;this.cubicCurveTo(i+h*E+u*N,t+d*E+p*N,i+h*R+u*P,t+d*R+p*P,i+h*w+u*F,t+d*w+p*F)}}arc(i,t,e,s,n,a){this.ellipse(i,t,e,e,0,s,n,a)}appendSvg(i){const t=nT(i);if(t==null)return!1;let e=0,s=0,n,a,r=0,o=0;for(const{command:l,params:c}of t){n??(n=c[0]),a??(a=c[1]);const h=l===l.toLowerCase(),d=h?n:0,u=h?a:0;switch(l.toLowerCase()){case"m":this.moveTo(d+c[0],u+c[1]),n=d+c[0],a=u+c[1],e=n,s=a;break;case"c":this.cubicCurveTo(d+c[0],u+c[1],d+c[2],u+c[3],d+c[4],u+c[5]),r=d+c[2],o=u+c[3],n=d+c[4],a=u+c[5];break;case"s":this.cubicCurveTo(n+n-r,a+a-o,d+c[0],u+c[1],d+c[2],u+c[3]),r=d+c[0],o=u+c[1],n=d+c[2],a=u+c[3];break;case"q":this.cubicCurveTo((d+2*c[0])/3,(u+2*c[1])/3,(2*c[0]+c[2])/3,(2*c[1]+c[3])/3,c[2],c[3]),r=c[0],o=c[1],n=c[2],a=c[3];break;case"t":this.cubicCurveTo((n+2*(n+n-r))/3,(a+2*(a+a-o))/3,(2*(n+n-r)+c[0])/3,(2*(a+a-o)+c[1])/3,c[0],c[1]),r=n+n-r,o=a+a-o,n=c[0],a=c[1];break;case"a":this.svgEllipse(n,a,c[0],c[1],c[2]*Math.PI/180,c[3],c[4],d+c[5],u+c[6]),n=d+c[5],a=u+c[6];break;case"h":this.lineTo(d+c[0],a),n=d+c[0];break;case"l":this.lineTo(d+c[0],u+c[1]),n=d+c[0],a=u+c[1];break;case"v":this.lineTo(n,u+c[0]),a=u+c[0];break;case"z":this.closePath(),n=e,a=s;break;default:throw new Error(`Could not translate command '${l}' with '${c.join(" ")}'`)}}return!0}svgEllipse(i,t,e,s,n,a,r,o,l){e=Math.abs(e),s=Math.abs(s);const c=(i-o)/2,h=(t-l)/2,d=Math.sin(n),u=Math.cos(n),p=u*c+d*h,g=-d*c+u*h,f=p/e,m=g/s;let y=f*f+m*m,b=(i+o)/2,v=(t+l)/2,S=0,I=0;y>=1?(y=Math.sqrt(y),e*=y,s*=y):(y=Math.sqrt(1/y-1),a===r&&(y=-y),S=y*e*m,I=-y*s*f,b+=u*S-d*I,v+=d*S+u*I);const D=Math.atan2((g-I)/s,(p-S)/e),M=Math.atan2((-g-I)/s,(-p-S)/e)-D,A=D+M,C=!!(1-r);this.ellipse(b,v,e,s,n,D,A,C)}clear(i){i?(this.previousCommands=this.commands.slice(0,this.commandsLength),this.previousParams=this.params.slice(0,this.paramsLength),this.previousClosedPath=this.closedPath,this.commands=[],this.params=[],this.commandsLength=0,this.paramsLength=0):(this.commandsLength=0,this.paramsLength=0);const t=Gf();this.path2d=new t,this.openedPath=!1,this.closedPath=!1}isPointInPath(i,t){const e=this.commands,s=this.params,n=this.commandsLength,a=-1e4,r=-1e4;let o=Number.NaN,l=Number.NaN,c=0,h=0,d=0;for(let u=0,p=0;u<n;u++)switch(e[u]){case 0:d+=mr(o,l,c,h,a,r,i,t),c=s[p++],o=c,h=s[p++],l=h;break;case 1:d+=mr(c,h,s[p++],s[p++],a,r,i,t),c=s[p-2],h=s[p-1];break;case 2:d+=cT(c,h,s[p++],s[p++],s[p++],s[p++],s[p++],s[p++],a,r,i,t),c=s[p-2],h=s[p-1];break;case 3:d+=mr(o,l,c,h,a,r,i,t);break}return d%2===1}distanceSquared(i,t){let e=1/0;const s=this.commands,n=this.params,a=this.commandsLength;let r=Number.NaN,o=Number.NaN,l=0,c=0;for(let h=0,d=0;h<a;h++)switch(s[h]){case 0:l=r=n[d++],c=o=n[d++];break;case 1:{const u=l,p=c;l=n[d++],c=n[d++],e=Hf(i,t,u,p,l,c,e);break}case 2:{const u=l,p=c,g=n[d++],f=n[d++],m=n[d++],y=n[d++];l=n[d++],c=n[d++],e=QC(u,p,g,f,m,y,l,c,i,t)**2;break}case 3:e=Hf(i,t,l,c,r,o,e);break}return e}toSVG(i=(t,e)=>({x:t,y:e})){const t=[],{commands:e,params:s}=this,n=(r,o)=>{t.push(r);for(let l=0;l<o;l+=2){const{x:c,y:h}=i(s[a++],s[a++]);t.push(c,h)}};let a=0;for(let r=0;r<this.commandsLength;r++)switch(e[r]){case 0:n("M",2);break;case 1:n("L",2);break;case 2:n("C",6);break;case 3:n("Z",0);break}return t.join(" ")}computeBBox(){const{commands:i,params:t}=this;let[e,s,n,a]=[1/0,1/0,-1/0,-1/0],[r,o]=[Number.NaN,Number.NaN],[l,c]=[Number.NaN,Number.NaN];const h=(u,p)=>{e=Math.min(p,e),s=Math.min(u,s),n=Math.max(u,n),a=Math.max(p,a),r=u,o=p};let d=0;for(let u=0;u<this.commandsLength;u++)switch(i[u]){case 0:h(t[d++],t[d++]),l=r,c=o;break;case 1:h(t[d++],t[d++]);break;case 2:{const g=r,f=o,m=t[d++],y=t[d++],b=t[d++],v=t[d++],S=t[d++],I=t[d++],D=eT(g,f,m,y,b,v,S,I);for(const M of D){const A=zf(g,m,b,S,M),C=zf(f,y,v,I,M);h(A,C)}h(S,I);break}case 3:h(l,c),l=Number.NaN,c=Number.NaN;break}return new _(s,e,n-s,a-e)}};import{toRadians as Yo}from"ag-charts-core";var Kf=1e-8;function Yf(i,t){const e=t*i,s=e-Math.floor(e),n=Math.abs(s-.5)<Kf?e+Kf:e;return Math.round(n)/i}function Ge(i,t,e){const s=Yf(i,t);return e==null?s:e===0?0:e<1?hT(i,e):Yf(i,e+t)-s}function Zf(i,t){return Math.floor(t*i)/i}function hT(i,t){return Math.ceil(t*i)/i}function _h(i,t,e){const{width:s,height:n,padding:a,strokeWidth:r}=t,o=s/2,l=n/2,c=Math.max(1,s-a-r/2),h=Math.max(1,n-a-r/2);let d=!1;for(const[u,p]of e){const g=o+(u-.5)*c,f=l+(p-.5)*h;d?i.lineTo(g,f):i.moveTo(g,f),d=!0}i.closePath()}var Xf={circles(i,{width:t,strokeWidth:e,padding:s}){const n=t/2,a=Math.max(1,n-s-e/2);i.arc(n,n,a,0,Math.PI*2)},squares(i,{width:t,height:e,pixelRatio:s,padding:n,strokeWidth:a}){const r=n+a/2;i.moveTo(Ge(s,r),Ge(s,r)),i.lineTo(Ge(s,t-r),Ge(s,r)),i.lineTo(Ge(s,t-r),Ge(s,e-r)),i.lineTo(Ge(s,r),Ge(s,e-r)),i.closePath()},triangles(i,t){_h(i,t,[[.5,0],[1,1],[0,1]])},diamonds(i,t){_h(i,t,[[.5,0],[1,.5],[.5,1],[0,.5]])},stars(i,{width:t,height:e,padding:s}){const a=Math.max(1,(t-s)/2),r=a/2,o=Math.PI/2;for(let l=0;l<5*2;l++){const c=l%2===0?a:r,h=l*Math.PI/5-o,d=t/2+Math.cos(h)*c,u=e/2+Math.sin(h)*c;i.lineTo(d,u)}i.closePath()},hearts(i,{width:t,height:e,padding:s}){const n=Math.max(1,t/4-s/2),a=t/2,r=e/2+n/2;i.arc(a-n,r-n,n,Yo(130),Yo(330)),i.arc(a+n,r-n,n,Yo(220),Yo(50)),i.lineTo(a,r+n),i.closePath()},crosses(i,t){_h(i,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"(i,{width:t,height:e,pixelRatio:s,strokeWidth:n}){const a=Ge(s,t/2)-n%2/2;i.moveTo(a,0),i.lineTo(a,e)},"horizontal-lines"(i,{width:t,height:e,pixelRatio:s,strokeWidth:n}){const a=Ge(s,e/2)-n%2/2;i.moveTo(0,a),i.lineTo(t,a)},"forward-slanted-lines"(i,{width:t,height:e,strokeWidth:s}){const n=Math.atan2(e,t),a=s*Math.cos(n),r=s*Math.sin(n);i.moveTo(-a,r),i.lineTo(a,-r),i.moveTo(-a,e+r),i.lineTo(t+a,-r),i.moveTo(t-a,e+r),i.lineTo(t+a,e-r)},"backward-slanted-lines"(i,{width:t,height:e,strokeWidth:s}){const n=Math.atan2(e,t),a=s*Math.cos(n),r=s*Math.sin(n);i.moveTo(t-a,-r),i.lineTo(t+a,r),i.moveTo(-a,-r),i.lineTo(t+a,e+r),i.moveTo(-a,e-r),i.lineTo(a,e+r)}},dT=class{constructor(i){this._cache=void 0,this.width=Math.max(i?.width??10,1),this.height=Math.max(i?.height??10,1),this.fill=i.fill??"none",this.fillOpacity=i.fillOpacity??1,this.backgroundFill=i.backgroundFill??"none",this.backgroundFillOpacity=i.backgroundFillOpacity??1,this.stroke=i.stroke??"black",this.strokeOpacity=i.strokeOpacity??1,this.strokeWidth=i.strokeWidth??1,this.padding=i.padding??1,this.pattern=i.pattern??"forward-slanted-lines",this.rotation=i.rotation??0,this.scale=i.scale??1,this.path=i.path}getPath(i){const{pattern:t,width:e,height:s,padding:n,strokeWidth:a,path:r}=this,o=new ia;let l=Xf[t]!=null;return r&&l&&(l=!o.appendSvg(r)),l&&Xf[t](o,{width:e,height:s,pixelRatio:i,strokeWidth:a,padding:n}),o}renderStroke(i,t){const{stroke:e,strokeWidth:s,strokeOpacity:n}=this;s&&(t.strokeStyle=e,t.lineWidth=s,t.globalAlpha=n,t.stroke(i))}renderFill(i,t){const{fill:e,fillOpacity:s}=this;e!=="none"&&(t.fillStyle=e,t.globalAlpha=s,t.fill(i))}createCanvasPattern(i,t){const{width:e,height:s,scale:n,backgroundFill:a,backgroundFillOpacity:r}=this;if(e*n<1||s*n<1)return XC.warnOnce("Pattern fill is too small to render, ignoring."),null;const o=new Dh({width:e,height:s,pixelRatio:t*n}),l=o.context;a!=="none"&&(l.fillStyle=a,l.globalAlpha=r,l.fillRect(0,0,e,s));const c=this.getPath(t).getPath2D();this.renderFill(c,l),this.renderStroke(c,l);const h=i.createPattern(o.canvas,"repeat");return this.setPatternTransform(h,t),o.destroy(),h}setPatternTransform(i,t,e=0,s=0){if(i==null)return;const n=JC(this.rotation),a=1/t,r=Math.cos(n)*a,o=Math.sin(n)*a,l=qC();i.setTransform(new l([r,o,-o,r,e,s]))}createPattern(i,t){if(this._cache?.ctx===i&&this._cache.pixelRatio===t)return this._cache.pattern;const e=this.createCanvasPattern(i,t);if(e!=null)return this._cache={ctx:i,pattern:e,pixelRatio:t},e}toSvg(){const{width:i,height:t,fill:e,fillOpacity:s,backgroundFill:n,backgroundFillOpacity:a,stroke:r,strokeWidth:o,strokeOpacity:l,rotation:c,scale:h}=this,d=Ph("pattern");d.setAttribute("viewBox",`0 0 ${i} ${t}`),d.setAttribute("width",String(i)),d.setAttribute("height",String(t)),d.setAttribute("patternUnits","userSpaceOnUse");const u=Ph("rect");u.setAttribute("x","0"),u.setAttribute("y","0"),u.setAttribute("width",String(i)),u.setAttribute("height",String(t)),u.setAttribute("fill",n),u.setAttribute("fill-opacity",String(a)),d.appendChild(u);const p=Ph("path");return p.setAttribute("fill",e),p.setAttribute("fill-opacity",String(s)),p.setAttribute("stroke-opacity",String(l)),p.setAttribute("stroke",r),p.setAttribute("stroke-width",String(o)),p.setAttribute("transform",`rotate(${c}) scale(${h})`),p.setAttribute("d",this.getPath(1).toSVG()),d.appendChild(p),d}};function qf(i,t){const{fontStyle:e,fontWeight:s,fontSize:n,fontFamily:a}=t;e&&i.setAttribute("font-style",e),s&&i.setAttribute("font-weight",String(s)),n!=null&&i.setAttribute("font-size",String(n)),a&&i.setAttribute("font-family",a)}function uT(i,t){const{stroke:e,strokeWidth:s,strokeOpacity:n}=t;e&&i.setAttribute("stroke",e),s!=null&&i.setAttribute("stroke-width",String(s)),n!=null&&i.setAttribute("stroke-opacity",String(n))}function pT(i,t){const{lineDash:e,lineDashOffset:s}=t;if(e?.some(n=>n!==0)){const n=e.length%2===1?[...e,...e]:e;i.setAttribute("stroke-dasharray",n.join(" ")),s!=null&&i.setAttribute("stroke-dashoffset",String(s))}}var gT=(()=>{var i=class extends zi{constructor(){super(...arguments),this.drawingMode="overlay",this.fillOpacity=1,this.strokeOpacity=1,this.fill="black",this.strokeWidth=0,this.lineDashOffset=0,this.opacity=1}getGradient(e){if(Lh(e))return this.createGradient(e)}createGradient(e){const{colorSpace:s="rgb",gradient:n="linear",colorStops:a,rotation:r=0,reverse:o=!1}=e;if(a==null)return;let l=Bf(a,["black"],[0,1]);switch(o&&(l=l.map(c=>({color:c.color,stop:1-c.stop})).reverse()),n){case"linear":return new zC(s,l,r);case"radial":return new HC(s,l);case"conic":return new FC(s,l,r)}}getPattern(e){if(kf(e))return this.createPattern(e)}createPattern(e){return new dT(e)}getImage(e){if(Nf(e))return this.createImage(e)}createImage(e){return new ZC(this.imageLoader,e)}onFillChange(){typeof this.fill=="object"&&Wo(this._cachedFill??{},this.fill)||(this.fillGradient=this.getGradient(this.fill),this.fillPattern=this.getPattern(this.fill),this.fillImage=this.getImage(this.fill),this._cachedFill=this.fill)}onStrokeChange(){this.strokeGradient=this.getGradient(this.stroke)}align(e,s){return Ge(this.layerManager?.canvas?.pixelRatio??1,e,s)}markDirty(e){super.markDirty(e),this.cachedDefaultGradientFillBBox=void 0}fillStroke(e,s){this.__drawingMode==="cutout"&&(e.globalCompositeOperation="destination-out",this.executeFill(e,s),e.globalCompositeOperation="source-over"),this.renderFill(e,s),this.renderStroke(e,s)}renderFill(e,s){const{__fill:n,__fillOpacity:a=1,fillImage:r}=this;if(n!=null&&n!=="none"&&a>0){const o=e.globalAlpha;r&&(e.globalAlpha=r.backgroundFillOpacity,e.fillStyle=r.backgroundFill,this.executeFill(e,s),e.globalAlpha=o),this.applyFillAndAlpha(e),this.applyShadow(e),this.executeFill(e,s),e.globalAlpha=o,this.fillShadow?.enabled&&(e.shadowColor="rgba(0, 0, 0, 0)")}}executeFill(e,s){s?e.fill(s):e.fill()}applyFillAndAlpha(e){const{__fill:s,fillGradient:n,fillPattern:a,fillImage:r,__fillOpacity:o=1,__opacity:l=1}=this,c=l*o;if(c!==1&&(e.globalAlpha*=c),n){const{fillBBox:h=this.getDefaultGradientFillBBox()??this.getBBox(),fillParams:d}=this;e.fillStyle=n.createGradient(e,h,d)??"black"}else if(a){const{x:h,y:d}=this.getBBox(),u=this.layerManager?.canvas?.pixelRatio??1,p=a.createPattern(e,u);a.setPatternTransform(p,u,h,d),p?e.fillStyle=p:(e.fillStyle=a.fill,e.globalAlpha*=a.fillOpacity)}else if(r){const h=this.getBBox(),d=r.createPattern(e,h.width,h.height,this);r.setImageTransform(d,h),e.fillStyle=d??"transparent"}else e.fillStyle=typeof s=="string"?s:"black"}applyStrokeAndAlpha(e){const{__stroke:s,__strokeOpacity:n=1,strokeGradient:a,__opacity:r=1}=this;e.strokeStyle=a?.createGradient(e,this.getBBox())??(typeof s=="string"?s:void 0)??"black";const o=r*n;o!==1&&(e.globalAlpha*=o)}applyShadow(e){const s=this.layerManager?.canvas.pixelRatio??1,{__fillShadow:n}=this;n?.enabled&&(e.shadowColor=n.color,e.shadowOffsetX=n.xOffset*s,e.shadowOffsetY=n.yOffset*s,e.shadowBlur=n.blur*s)}renderStroke(e,s){const{__stroke:n,__strokeWidth:a=0,__strokeOpacity:r=1,__lineDash:o,__lineDashOffset:l,__lineCap:c,__lineJoin:h,__miterLimit:d}=this;if(n!=null&&n!=="none"&&a>0&&r>0){const{globalAlpha:u}=e;this.applyStrokeAndAlpha(e),e.lineWidth=a,o&&e.setLineDash(o),l&&(e.lineDashOffset=l),c&&(e.lineCap=c),h&&(e.lineJoin=h),d!=null&&(e.miterLimit=d),this.executeStroke(e,s),e.globalAlpha=u}}executeStroke(e,s){s?e.stroke(s):e.stroke()}getDefaultGradientFillBBox(){return this.cachedDefaultGradientFillBBox??(this.cachedDefaultGradientFillBBox=Object.freeze(this.computeDefaultGradientFillBBox())),this.cachedDefaultGradientFillBBox}computeDefaultGradientFillBBox(){}containsPoint(e,s){return this.isPointInPath(e,s)}applySvgFillAttributes(e,s){const{fill:n,fillOpacity:a}=this;if(typeof n=="string")e.setAttribute("fill",n);else if(Lh(n)&&this.fillGradient){s??(s=[]);const r=this.fillGradient.toSvg(this.fillBBox??this.getBBox()),o=Th();r.setAttribute("id",o),s.push(r),e.setAttribute("fill",`url(#${o})`)}else if(kf(n)&&this.fillPattern){s??(s=[]);const r=this.fillPattern.toSvg(),o=Th();r.setAttribute("id",o),s.push(r),e.setAttribute("fill",`url(#${o})`)}else if(Nf(n)&&this.fillImage){s??(s=[]);const r=this.layerManager?.canvas?.pixelRatio??1,o=this.fillImage.toSvg(this.getBBox(),r),l=Th();o.setAttribute("id",l),s.push(o),e.setAttribute("fill",`url(#${l})`)}else e.setAttribute("fill","none");return e.setAttribute("fill-opacity",String(a)),s}applySvgStrokeAttributes(e){const{stroke:s,strokeOpacity:n,strokeWidth:a,lineDash:r,lineDashOffset:o}=this;uT(e,{stroke:kC(s)?s:void 0,strokeOpacity:n,strokeWidth:a}),pT(e,{lineDash:r,lineDashOffset:o})}static handleFillChange(e){e.onFillChange()}static handleStrokeChange(e){e.onStrokeChange()}setStyleProperties(e,s,n){const a=e?.opacity??1,r=e?.fill,o=(e?.fillOpacity??1)*a,l=(e?.strokeOpacity??1)*a,c=e?.strokeWidth??0,h=e?.lineDashOffset??0;let d=!1;this.__fillOpacity!==o&&(this.__fillOpacity=o,d=!0),this.__strokeOpacity!==l&&(this.__strokeOpacity=l,d=!0),this.__strokeWidth!==c&&(this.__strokeWidth=c,d=!0),this.__lineDashOffset!==h&&(this.__lineDashOffset=h,d=!0),this.__lineDash!==e?.lineDash&&(this.__lineDash=e?.lineDash,d=!0),this.setFillProperties(r,s,n),r!==this.fill&&(this.fill=