1"use strict";(globalThis.webpackChunkpoodle=globalThis.webpackChunkpoodle||[]).push([[93],{Vwos(e,t,i){i.d(t,{A9:()=>OM,Di:()=>NS,GT:()=>cM,Gq:()=>$M,Hj:()=>RM,JC:()=>bS,JK:()=>HM,SF:()=>YS,T9:()=>Kv,UV:()=>EM,ZK:()=>TM,bI:()=>Wv,e8:()=>pM,i8:()=>zM,jc:()=>VM,m:()=>JS,n1:()=>wm,pP:()=>FM,sy:()=>n.syG,uB:()=>Mv,ui:()=>km,wO:()=>Yv,xv:()=>Ot});i("19CV"),i("4fTp"),i("WFxX"),i("g6Bo"),i("ezUZ"),i("d5A/"),i("pPCv"),i("+Qw0"),i("RhNM"),i("01Te"),i("Wd41"),i("VkU2"),i("IHgz"),i("EaqF"),i("VaRY"),i("p5S9"),i("9km/"),i("zEmq"),i("x6/l"),i("d0Mj"),i("3A/4"),i("oNPk");var n=i("zlFw"),s={};i.r(s),i.d(s,{AGGREGATION_INDEX_SELECTED:()=>n.OFF,AGGREGATION_INDEX_UNSET:()=>n.IXQ,AGGREGATION_INDEX_X_MAX:()=>n.IXP,AGGREGATION_INDEX_X_MIN:()=>n.qbB,AGGREGATION_INDEX_Y_MAX:()=>n.BNK,AGGREGATION_INDEX_Y_MIN:()=>n.jBM,AGGREGATION_MAX_POINTS:()=>n.ujG,AGGREGATION_MIN_RANGE:()=>n.gjy,AGGREGATION_SPAN:()=>n.kmN,AGGREGATION_THRESHOLD:()=>n.n9_,AbstractModuleInstance:()=>n.UbG,ActionOnSet:()=>n.mBh,AgDocument:()=>n.G8T,AsyncAwaitQueue:()=>n.iNx,BASE_FONT_SIZE:()=>n.Efy,BLOCK_IMAGE_SPACING:()=>n.Ob_,BREAK_TRANSFORM_CHAIN:()=>n.bDc,BaseProperties:()=>n.XPE,Bitfield:()=>n.ys5,Border:()=>n.VHq,CANVAS_HEIGHT:()=>n.psk,CANVAS_TO_BUFFER_DEFAULTS:()=>n.xQc,CANVAS_WIDTH:()=>n.cOG,CARTESIAN_AXIS_TYPE:()=>n.uCf,CARTESIAN_POSITION:()=>n.v9C,CSS_GENERIC_FAMILIES:()=>n.dRv,CallbackCache:()=>n.WIG,ChangeDetectableProperties:()=>n.zey,ChartAxisDirection:()=>n.tv$,ChartUpdateType:()=>n.GvF,CleanupRegistry:()=>n._uV,Color:()=>n.Q1f,ConfiguredCanvasMixin:()=>n.ORG,DEFAULT_ANNOTATION_HANDLE_FILL:()=>n.nW0,DEFAULT_ANNOTATION_STATISTICS_COLOR:()=>n.KCM,DEFAULT_ANNOTATION_STATISTICS_DIVIDER_STROKE:()=>n.Fn1,DEFAULT_ANNOTATION_STATISTICS_DOWN_FILL:()=>n.Xg7,DEFAULT_ANNOTATION_STATISTICS_DOWN_STROKE:()=>n.wAP,DEFAULT_ANNOTATION_STATISTICS_FILL:()=>n.w9K,DEFAULT_ANNOTATION_STATISTICS_STROKE:()=>n.lO7,DEFAULT_CAPTION_ALIGNMENT:()=>n.fH_,DEFAULT_CAPTION_LAYOUT_STYLE:()=>n.ILz,DEFAULT_FIBONACCI_STROKES:()=>n.fsm,DEFAULT_FINANCIAL_CHARTS_ANNOTATION_BACKGROUND_FILL:()=>n.zVM,DEFAULT_FINANCIAL_CHARTS_ANNOTATION_COLOR:()=>n.oC3,DEFAULT_MARKERLESS_LABEL_GAP:()=>n.Olx,DEFAULT_POLAR_SERIES_STROKE:()=>n.iKe,DEFAULT_SHADOW_COLOUR:()=>n.KU9,DEFAULT_SPARKLINE_CROSSHAIR_STROKE:()=>n.kOz,DEFAULT_TEXTBOX_COLOR:()=>n.vjx,DEFAULT_TEXTBOX_FILL:()=>n.xFO,DEFAULT_TEXTBOX_STROKE:()=>n.U4X,DEFAULT_TEXT_ANNOTATION_COLOR:()=>n.yQs,DEFAULT_TOOLBAR_POSITION:()=>n.QJY,DIRECTION_SWAP_AXES:()=>n.QTQ,Debug:()=>n.yar,DebugMetrics:()=>n.Xjz,DeclaredSceneChangeDetection:()=>n.M7D,DeclaredSceneObjectChangeDetection:()=>n.HvY,EllipsisChar:()=>n.GBn,ErrorType:()=>n.Byv,EventEmitter:()=>n.bkB,FILL_GRADIENT_BLANK_DEFAULTS:()=>n.Xaq,FILL_GRADIENT_CONIC_SERIES_DEFAULTS:()=>n.vr$,FILL_GRADIENT_LINEAR_DEFAULTS:()=>n.Euh,FILL_GRADIENT_LINEAR_HIERARCHY_DEFAULTS:()=>n.mPJ,FILL_GRADIENT_LINEAR_KEYED_DEFAULTS:()=>n.Rs9,FILL_GRADIENT_LINEAR_SINGLE_DEFAULTS:()=>n.dHK,FILL_GRADIENT_RADIAL_DEFAULTS:()=>n.o76,FILL_GRADIENT_RADIAL_REVERSED_DEFAULTS:()=>n.pRl,FILL_GRADIENT_RADIAL_REVERSED_SERIES_DEFAULTS:()=>n.p3y,FILL_GRADIENT_RADIAL_SERIES_DEFAULTS:()=>n.cEq,FILL_IMAGE_BLANK_DEFAULTS:()=>n.Wx1,FILL_IMAGE_DEFAULTS:()=>n.pwE,FILL_PATTERN_BLANK_DEFAULTS:()=>n.Tmp,FILL_PATTERN_DEFAULTS:()=>n.eu4,FILL_PATTERN_HIERARCHY_DEFAULTS:()=>n.yms,FILL_PATTERN_KEYED_DEFAULTS:()=>n.$8e,FILL_PATTERN_SINGLE_DEFAULTS:()=>n.JyQ,FONT_SIZE:()=>n.SG9,FONT_SIZE_RATIO:()=>n.q8q,Graph:()=>n.TS0,IS_DARK_THEME:()=>n.oxB,InterpolationProperties:()=>n._eL,LABEL_BOXING_DEFAULTS:()=>n.mgV,LABEL_BOXING_TOP_LEVEL_DEFAULTS:()=>n.VTt,LABEL_OVERFLOW_ALWAYS_SHOW:()=>n.O2O,LABEL_OVERFLOW_DEFAULTS:()=>n.F$C,LABEL_PLACEMENT_STYLE_DEFAULTS:()=>n.KVS,LEGEND_CONTAINER_THEME:()=>n._n,LRUCache:()=>n.qKc,LineSplitter:()=>n.g3U,Logger:()=>n.VyI,LtrEmbedding:()=>n.Wv_,MARKER_SERIES_HIGHLIGHT_STYLE:()=>n.U3R,MULTI_SERIES_HIGHLIGHT_STYLE:()=>n.fil,MementoCaretaker:()=>n.OQ$,ModuleRegistry:()=>n.syG,ModuleScope:()=>n.JjJ,ModuleType:()=>n.nR2,ObserveChanges:()=>n.SY0,PALETTE_ALT_DOWN_FILL:()=>n.v48,PALETTE_ALT_DOWN_STROKE:()=>n.AmB,PALETTE_ALT_NEUTRAL_FILL:()=>n.yYi,PALETTE_ALT_NEUTRAL_STROKE:()=>n.HVx,PALETTE_ALT_UP_FILL:()=>n.W_3,PALETTE_ALT_UP_STROKE:()=>n.Ra$,PALETTE_DOWN_FILL:()=>n.P04,PALETTE_DOWN_STROKE:()=>n.qvb,PALETTE_NEUTRAL_FILL:()=>n.olo,PALETTE_NEUTRAL_STROKE:()=>n.ThM,PALETTE_UP_FILL:()=>n.ENk,PALETTE_UP_STROKE:()=>n.JsB,PART_WHOLE_HIGHLIGHT_STYLE:()=>n.dUR,POLAR_AXIS_SHAPE:()=>n.Xk0,POLAR_AXIS_TYPE:()=>n.QYe,Padding:()=>n.Yqy,ParallelStateMachine:()=>n._ui,PolarZIndexMap:()=>n.$5h,PopDirectionalFormatting:()=>n.ddp,PropertiesArray:()=>n.F_c,Property:()=>n.mAP,ProxyOnWrite:()=>n.rtC,ProxyProperty:()=>n.i1O,ProxyPropertyOnWrite:()=>n.s8C,ReactiveState:()=>n.vKy,SAFE_FILLS_OPERATION:()=>n.Hsq,SAFE_FILL_OPERATION:()=>n.alK,SAFE_RANGE2_OPERATION:()=>n.Mg2,SAFE_STROKE_FILL_OPERATION:()=>n.HHJ,SEGMENTATION_DEFAULTS:()=>n.IgM,SERIES_SELECTION_THEME:()=>n.zg6,SINGLE_SERIES_HIGHLIGHT_STYLE:()=>n.CFZ,SKIP_JS_BUILTINS:()=>n.jD8,ScaleAlignment:()=>n.w8L,SceneArrayChangeDetection:()=>n.Haz,SceneChangeDetection:()=>n.k8u,SceneObjectChangeDetection:()=>n.Tou,SceneRefChangeDetection:()=>n.$aV,SeriesContentZIndexMap:()=>n.fUl,SeriesZIndexMap:()=>n.qw7,SimpleCache:()=>n.N7u,SpanJoin:()=>n.Dl4,SpatialIndex:()=>n.rxg,StateMachine:()=>n.Z37,StateMachineProperty:()=>n.m9s,TRIPLE_EQ:()=>n.EJX,TextMeasurer:()=>n.Wa7,TickIntervals:()=>n._ZY,TrimCharsRegex:()=>n.ZOm,TrimEdgeGuard:()=>n.DRK,UNIT_MAX:()=>n.Oxg,UNIT_MIN:()=>n.eKe,UnknownError:()=>n.Bk6,ValidationError:()=>n.yI4,Vec2:()=>n.ZY9,Vec4:()=>n.Zbg,Vertex:()=>n.LiA,WeakCache:()=>n.laH,ZIndexMap:()=>n.Dcv,absValue:()=>n.IbQ,addEscapeEventListener:()=>n.LLE,addFakeTransformToInstanceProperty:()=>n.IFU,addMouseCloseListener:()=>n.FQL,addObserverToInstanceProperty:()=>n.FAe,addOverrideFocusVisibleEventListener:()=>n.yB$,addTouchCloseListener:()=>n.Jc$,addTransformToInstanceProperty:()=>n.hZK,addValues:()=>n.mlo,aggregationBucketForDatum:()=>n.JGt,aggregationDatumMatchesIndex:()=>n.Vnh,aggregationDomain:()=>n.HBB,aggregationIndexForXRatio:()=>n.XBY,aggregationRangeFittingPoints:()=>n.OLL,aggregationXRatioForDatumIndex:()=>n.qUX,aggregationXRatioForXValue:()=>n.mYB,ambientLog:()=>n.tDR,ambientLogger:()=>n.tr_,and:()=>n.Uo6,angleBetween:()=>n.s57,angularPadding:()=>n.IUw,anyOverlap:()=>n.S2m,appendEllipsis:()=>n.iNG,applyBarLabelOrientation:()=>n.she,applyPlacedBarLabelVisibility:()=>n.HkM,applySkiaPatches:()=>n.jME,applyStyledMarkerSize:()=>n.N3b,arcDistanceSquared:()=>n.fh7,areScalingEqual:()=>n.wo0,array:()=>n.YOg,arrayLength:()=>n.O9d,arrayOf:()=>n.jk9,arrayOfDefs:()=>n.J$N,arraysEqual:()=>n.r1i,assignIfNotStrictlyEqual:()=>n.STs,attachDescription:()=>n.W$8,attachListener:()=>n.yE,autoSizedLabelOptionsDefs:()=>n.TLF,bakedLabelObstacles:()=>n.ZKh,barHighlightOptionsDef:()=>n.TaA,barLabelObstacles:()=>n.Amh,barLabelOrientation:()=>n.afe,barLabelPropsRouteThroughEngine:()=>n.qpr,barLabelPropsUsePositionedCandidates:()=>n.fD2,barLabelResolvesOrientation:()=>n.fjG,barLabelResolvesPlacement:()=>n.yy6,barLabelRotation:()=>n.qlQ,barLabelRoutesThroughEngine:()=>n.hqp,barLabelUsesPositionedCandidates:()=>n.Yfy,bezier2DDistance:()=>n.vgR,bezier2DExtrema:()=>n.YZY,bigIntAggregationExtent:()=>n.szN,blockStripHeight:()=>n.RlK,blockStripWidth:()=>n.UhS,boolean:()=>n.zMY,borderOptionsDef:()=>n.QQ,boxCollides:()=>n.$ZB,boxContains:()=>n.JF9,boxEmpty:()=>n.fa1,boxesEqual:()=>n.ca$,buildBarLabelData:()=>n.AEW,buildBarLabelDatum:()=>n.FIO,buildBarPositionedLabelDatum:()=>n.Nv9,buildDateFormatter:()=>n.f6S,cachedTextMeasurer:()=>n.K$y,calcLineHeight:()=>n.VKS,calculatePlacement:()=>n.ePN,callWithContext:()=>n.cVk,callback:()=>n.E2r,callbackDefs:()=>n.YIG,callbackOf:()=>n.R3$,canRenderTextOffscreen:()=>n.zEw,ceilTo:()=>n.nHZ,checkDatum:()=>n.iru,circularSliceArray:()=>n.XKp,clamp:()=>n.qE8,clampArray:()=>n.jVD,clipLines:()=>n.U_K,clipSpanX:()=>n.hKy,coerceIso8601Date:()=>n.e8I,coerceTextValue:()=>n.GIY,collapseSpanToPoint:()=>n.ru5,collectAggregationLevels:()=>n.ubx,collectSparseSelection:()=>n.Vom,collisionOptionsDef:()=>n.W9P,color:()=>n.yWT,colorOrRef:()=>n.aXB,colorScaleOptionsDef:()=>n.pRw,colorStopsOrderValidator:()=>n.hzM,colorUnion:()=>n.JpK,commonChartOptionsDefs:()=>n.Qi6,commonSeriesOptionsDefs:()=>n.XxK,commonSeriesThemeableOptionsDefs:()=>n.sPu,compactAggregationIndices:()=>n.THQ,compareDates:()=>n.H$f,computeColorBins:()=>n.ZpP,computeExtremesAggregation:()=>n.fq3,computeExtremesAggregationPartial:()=>n.EXR,constant:()=>n.dYl,contextMenuItemsArray:()=>n.qRQ,countFractionDigits:()=>n.o3B,countLines:()=>n.lty,createAggregationIndices:()=>n.iPk,createBigIntBins:()=>n.cpn,createBigIntTickBins:()=>n.jjO,createBigIntTicks:()=>n.ozM,createButton:()=>n.TfM,createCanvasContext:()=>n.k5z,createCheckbox:()=>n.GGi,createDynamicContext:()=>n.Xlx,createElement:()=>n.na4,createElementId:()=>n.wWH,createIcon:()=>n.wti,createId:()=>n.sX_,createIdsGenerator:()=>n.Iig,createNumberFormatter:()=>n.ORH,createScopedCache:()=>n.Z6N,createSelect:()=>n.HnG,createStyleElement:()=>n.aBg,createSvgElement:()=>n.FJ6,createTextArea:()=>n.jal,createTicks:()=>n.np_,date:()=>n.p6U,dateToNumber:()=>n.nnz,dateTruncationForDomain:()=>n.pm8,datesSortOrder:()=>n.Q06,debounce:()=>n.sg1,decodeIntervalValue:()=>n.txz,deepClone:()=>n.Go6,deepFreeze:()=>n.olf,defaultEpoch:()=>n.v4Y,defined:()=>n.swK,definedZoomState:()=>n.af4,deprecated:()=>n.ioo,deprecatedValue:()=>n.DhX,deriveNormalizedStops:()=>n.kXN,diffArrays:()=>n.E3_,discreteColorStops:()=>n.CRU,distribute:()=>n.mnw,downloadUrl:()=>n.Isv,dropFirstWhile:()=>n.nmo,dropLastWhile:()=>n.xAp,durationDay:()=>n.NmG,durationHour:()=>n.JJy,durationMinute:()=>n.rR5,durationMonth:()=>n.PvU,durationSecond:()=>n.Ttm,durationWeek:()=>n.Fqr,durationYear:()=>n.MPX,easeIn:()=>n.a6C,easeInOut:()=>n.am_,easeInOutQuad:()=>n.dVq,easeInQuad:()=>n.Dos,easeOut:()=>n.vTE,easeOutQuad:()=>n.WDn,encodedToTimestamp:()=>n.crw,ensureEpochColumn:()=>n.Odr,enterprise:()=>n.s2x,enterpriseRegistry:()=>n.dC9,entries:()=>n.jOZ,epochColumnForTimeScale:()=>n.QP0,errorBarOptionsDefs:()=>n.MnY,errorBarThemeableOptionsDefs:()=>n.dV6,estimateTickCount:()=>n.NKs,evaluateBezier:()=>n.z90,every:()=>n.Si_,expandLegendPosition:()=>n.Zz1,extent:()=>n.Xxv,extractDecoratedProperties:()=>n.Szu,extractDomain:()=>n.aX5,fillCssOptionsDef:()=>n.qDt,fillGradientDefaults:()=>n.wiP,fillImageDefaults:()=>n.Zdq,fillOptionsDef:()=>n.Fup,fillPatternDefaults:()=>n.GYY,findDiscreteColorBinLabel:()=>n.zP6,findLargestFittingFontSize:()=>n.lIG,findLargestFittingStep:()=>n.bCV,findLargestFontSizeDescending:()=>n.sH7,findMaxIndex:()=>n.I5B,findMaxValue:()=>n.F4U,findMinIndex:()=>n.S3I,findMinMax:()=>n.uYy,findMinValue:()=>n.rkG,findRangeExtent:()=>n.DuJ,first:()=>n.$1N,firstCandidate:()=>n.YGA,fitLabelText:()=>n.HRu,fitLabelTextAutoSize:()=>n.xBv,fitLabelTextOrOverflow:()=>n.IK$,fitLabelTextOrOverflowAutoSize:()=>n.YTK,fitLabelTextToRegion:()=>n.GYJ,flush:()=>n.bX,focusCursorAtEnd:()=>n.VED,fontFamilyFull:()=>n.jjy,fontOptionsDef:()=>n.LVV,fontWeight:()=>n.Wyg,fontWithSize:()=>n.lad,forceLtrNumbers:()=>n.Un7,forceLtrNumbersIn:()=>n.xpk,formatColorBinLabel:()=>n.SWA,formatColorScaleBinLabel:()=>n.s1K,formatNumber:()=>n.ZVp,formatObjectValidator:()=>n.ZI_,formatPercent:()=>n.l9T,formatValue:()=>n.Fl2,fromPairs:()=>n.Cr,generateUUID:()=>n.lkB,geoJson:()=>n.eWm,getAngleRatioRadians:()=>n.zp8,getAttribute:()=>n.D$r,getDOMMatrix:()=>n.Wse,getDocument:()=>n.YEm,getElementBBox:()=>n.Cn9,getEpochColumn:()=>n.ur2,getIconClassNames:()=>n.YE8,getImage:()=>n.QpR,getLastFocus:()=>n.DTD,getMaxInnerRectSize:()=>n.WTq,getMidpointsForIndices:()=>n.kRS,getMinOuterRectSize:()=>n.Jlv,getOffscreenCanvas:()=>n.yIC,getPath:()=>n.Yn5,getPath2D:()=>n.w6e,getPrevNextKeys:()=>n.tFZ,getResizeObserver:()=>n.NQR,getSequentialColors:()=>n._uB,getTickTimeInterval:()=>n.M2I,getWindow:()=>n.zkX,googleFont:()=>n.DKO,gradientColorStops:()=>n.LXq,gradientLegendOptionsDefs:()=>n.enB,gradientStrict:()=>n.MPH,graphemeSegments:()=>n.WzD,greaterThan:()=>n.MM$,gridCellSize:()=>n.UpF,groupBy:()=>n.$zQ,guardTextEdges:()=>n.dkg,hasNoModifiers:()=>n.yFN,hasRealChars:()=>n.OQU,hasRequiredInPath:()=>n.ehc,highlightOptionsDef:()=>n.qze,htmlElement:()=>n.Sc7,imageBoxAroundBaseline:()=>n.Bcy,imageSegmentBox:()=>n.kF$,inRange:()=>n.r4$,initRovingTabIndex:()=>n.jgH,insertListItemsSorted:()=>n.nXd,insetBox:()=>
1n.Vp2,insetBoxXY:()=>n.U$B,insetFitRegion:()=>n.Hn4,insideBarContainer:()=>n.bRJ,insideBarRegion:()=>n.gEE,insideBarValueInsets:()=>n.Djl,instanceOf:()=>n.hR_,interpolationOptionsDefs:()=>n.h0L,intervalAgo:()=>n.DjU,intervalCeil:()=>n.Z8P,intervalEpoch:()=>n.Nam,intervalExtent:()=>n.WCd,intervalFloor:()=>n.qpA,intervalHierarchy:()=>n.fQz,intervalMilliseconds:()=>n.UQv,intervalNext:()=>n.lyf,intervalPrevious:()=>n.ZMr,intervalRange:()=>n.tUW,intervalRangeCount:()=>n.QFm,intervalRangeNumeric:()=>n.CMD,intervalRangeStartIndex:()=>n.Fun,intervalStep:()=>n.SBk,intervalUnit:()=>n.u1v,invalidateEpochColumn:()=>n.LW,inverseEaseOut:()=>n.DMO,isArray:()=>n.cyL,isBetweenAngles:()=>n.tF8,isBigInt:()=>n.sI5,isBlockBoundary:()=>n.Yzf,isBoolean:()=>n.Lmq,isButtonClickEvent:()=>n.d8p,isColor:()=>n._o_,isContinuous:()=>n.QQF,isDate:()=>n.$PY,isDecoratedObject:()=>n.Neb,isDefined:()=>n.O9V,isDenseInterval:()=>n.bVu,isDirectionNeutral:()=>n.bTN,isDirectionRtl:()=>n._gn,isDocumentFragment:()=>n.K8K,isElement:()=>n.vqL,isEmptyObject:()=>n.RIy,isEnumKey:()=>n.BlP,isEnumValue:()=>n.Xlo,isErased:()=>n.FNX,isFiniteNumber:()=>n.BfI,isFiniteNumericValue:()=>n.kuK,isFunction:()=>n.Tnt,isGradientFill:()=>n.MBc,isGradientFillArray:()=>n.DdV,isGradientOrPatternFill:()=>n.pB1,isHTMLElement:()=>n.sby,isHtmlElement:()=>n.uEe,isISO8601:()=>n.p1d,isImageFill:()=>n.BF9,isInputPending:()=>n.UWw,isInteger:()=>n.FqJ,isKeyOf:()=>n.bXA,isLogLevel:()=>n.nfz,isNegative:()=>n.cIo,isNode:()=>n.Lln,isNumber:()=>n.EtT,isNumberEqual:()=>n.YXt,isNumberObject:()=>n.JR6,isNumericValue:()=>n.zZm,isObject:()=>n.Gvm,isObjectLike:()=>n.Z4x,isObjectWithProperty:()=>n.NdZ,isObjectWithStringProperty:()=>n.efk,isPatternFill:()=>n.EDy,isPlainObject:()=>n.QdQ,isPointLabelDatum:()=>n.y43,isProperties:()=>n._a8,isRegExp:()=>n.gdm,isScaleValid:()=>n.z1w,isSegmentTruncated:()=>n.a0u,isString:()=>n.KgX,isStringFillArray:()=>n._JH,isStringObject:()=>n.DGK,isSymbol:()=>n.Bmc,isTextTruncated:()=>n.KQS,isTimeInterval:()=>n.bnk,isTimeIntervalUnit:()=>n.H2A,isTruncated:()=>n.pQy,isUnitTimeCategoryScaling:()=>n.$uD,isUnsupportedColorFormat:()=>n._As,isValidDate:()=>n.vdg,isValidNumberFormat:()=>n.t$7,iterate:()=>n.nlf,joinFormatted:()=>n.lp6,jsonDiff:()=>n.G4M,jsonPropertyCompare:()=>n.lCp,jsonWalk:()=>n.mfG,kebabCase:()=>n.kW4,keptCharacters:()=>n.ftt,labelAutoFontSizeOptionsDefs:()=>n.QB3,labelBoxOptionsDef:()=>n.lb7,labelCollisionFitOptionsDefs:()=>n.iIr,labelCollisionPlacementDef:()=>n.npH,labelFitOptionsDefs:()=>n.mrm,labelFootprintBox:()=>n.TB$,labelGlyphCentre:()=>n.s8j,labelOrientationDef:()=>n.cDl,labelPlacementStyleDefs:()=>n.$VX,labelPlacementStyleOptionsDef:()=>n.asp,labelTextAtShrinkRatio:()=>n.hu9,legendOptionsDefs:()=>n._LU,legendPositionValidator:()=>n.BXc,lessThan:()=>n.XeB,lessThanOrEqual:()=>n.Aus,levenshteinDistance:()=>n.bUc,lineDashOptionsDef:()=>n.mLn,lineDistanceSquared:()=>n.h6n,lineHighlightOptionsDef:()=>n.Kq8,lineSegmentOptions:()=>n._L,lineSegmentation:()=>n.DBR,linear:()=>n.sns,linearGaugeSeriesOptionsDef:()=>n.BbD,linearGaugeSeriesThemeableOptionsDef:()=>n.qr,linearGaugeTargetOptionsDef:()=>n.lJ1,linearPoints:()=>n.DGc,listDecoratedProperties:()=>n.fWL,lowestGranularityForInterval:()=>n.nhz,lowestGranularityUnitForTicks:()=>n._cn,lowestGranularityUnitForValue:()=>n.DSS,makeAccessibleClickListener:()=>n.Hki,mapValues:()=>n.LGi,markerOptionsDefs:()=>n.$2g,markerStyleOptionsDefs:()=>n.AE2,maskFitRegion:()=>n.OcC,maxValue:()=>n.cGV,measureLabelText:()=>n.kzl,measurePlacedLabel:()=>n.Wkl,measureTextSegments:()=>n.wEO,memo:()=>n.ph$,merge:()=>n.h1I,mergeArrayDefaults:()=>n.qNV,mergeDefaults:()=>n.HFk,mergeDefaultsShallowOperations:()=>n.pej,minValue:()=>n.Wwf,modulus:()=>n.GTV,multiSeriesHighlightOptionsDef:()=>n.wxv,narrowAggregationX:()=>n.g3H,narrowBigIntColumn:()=>n.Rp1,narrowBigIntColumnByOffset:()=>n.v$,narrowBigIntColumnRelative:()=>n.X_t,narrowToNumber:()=>n.cS7,nearestSquared:()=>n.KpM,nearestSquaredInContainer:()=>n.mA_,nextPowerOf2:()=>n.Myt,niceBigIntDomain:()=>n.hLv,niceTicksDomain:()=>n._hN,nonNegativeInteger:()=>n.dvT,normalisedExtentWithMetadata:()=>n.Myf,normalisedTimeExtentWithMetadata:()=>n.XKY,normalizeAngle180:()=>n.KVy,normalizeAngle360:()=>n.YcT,normalizeAngle360FromDegrees:()=>n.JJe,normalizeAngle360Inclusive:()=>n.I5e,number:()=>n.aig,numberFormatValidator:()=>n.Hg5,numberMin:()=>n.wvA,numberRange:()=>n.fNL,numericValue:()=>n.r3t,object:()=>n.Ikc,objectsEqual:()=>n.DH9,objectsEqualWith:()=>n.t6W,optionsDefs:()=>n.fd6,or:()=>n.or,orientationAngles:()=>n.Thr,overflowStrategy:()=>n.y7D,padding:()=>n.Msk,paddingOptions:()=>n.Ib,parseColor:()=>n.H0q,parseNumberFormat:()=>n.sAu,partialAssign:()=>n.tbn,pause:()=>n.v7K,pick:()=>n.UpN,pickDirectionZoom:()=>n.gMZ,placeLabels:()=>n.$6F,placedLabelFit:()=>n.lIw,placedSeriesLabelOptionsDefs:()=>n.jjq,populateBucketSelectedFromSparse:()=>n.S6A,populateBucketSelectedFromSparseSplit:()=>n.s5l,positiveNumber:()=>n.LyW,positiveNumberNonZero:()=>n.MX6,positiveNumericValue:()=>n.Y6k,positiveNumericValueNonZero:()=>n.NlA,preserveArabicJoining:()=>n.$8B,previousPowerOf2:()=>n.s29,probedFitRegion:()=>n.i9m,radialGaugeSeriesOptionsDef:()=>n.bfJ,radialGaugeSeriesThemeableOptionsDef:()=>n.YdT,radialGaugeTargetOptionsDef:()=>n.lIt,range:()=>n.y17,rangeValidator:()=>n.YXx,ratio:()=>n.CGN,readIntegratedWrappedValue:()=>n.SXH,record:()=>n.g1P,rectLabelObstacles:()=>n.TSE,regionTextCapacity:()=>n.weC,regionWidthAt:()=>n.WXi,required:()=>n.mw3,rescaleSpan:()=>n.ES1,rescaleVisibleRange:()=>n.TnJ,resetIds:()=>n.qDM,resolveLabelFit:()=>n.A_g,resolveLabelFitDescriptors:()=>n.MPT,resolveMinimumFontSize:()=>n.bJZ,resolvePadding:()=>n.Q1u,resolveSeriesLabelDefaults:()=>n.wSY,resolveStopPositions:()=>n.rRI,resolveTextAlign:()=>n.vDS,reversePush:()=>n.nVd,rotatePoint:()=>n.sR8,rotatedGlyphDrift:()=>n.baU,rotatedLabelInset:()=>n.jH0,roundTo:()=>n.GBz,safeCall:()=>n.UFo,sectorLabelContainer:()=>n.QI3,seedEpochColumnIdentity:()=>n.Dpz,seedNumericColumnIdentity:()=>n.Rfy,selectionContainmentValidator:()=>n.t5w,selectionOptionsDef:()=>n.ct0,seriesLabelOptionsDefs:()=>n.gfe,seriesTooltipRangeValidator:()=>n.cmH,setAttribute:()=>n.Bqc,setAttributes:()=>n.Wpy,setDocument:()=>n._9u,setElementBBox:()=>n.ksX,setElementStyle:()=>n.EMg,setElementStyles:()=>n._Pz,setPath:()=>n.SOl,setWindow:()=>n.d16,shadowOptionsDefs:()=>n.zd9,shallowClone:()=>n.yGp,shapeHighlightOptionsDef:()=>n.Dgf,shapeSegmentOptions:()=>n.BHv,shapeSegmentation:()=>n.i_e,shapeSelectionOptionsDef:()=>n.DJB,shapeValidator:()=>n.YRd,signedPadding:()=>n.Ia$,signedPaddingOptions:()=>n.SQ,simpleColorUnion:()=>n.rTu,simpleMemorize:()=>n.FAd,simpleMemorize2:()=>n.XB6,smoothPoints:()=>n.kNJ,solveBezier:()=>n.D83,sortAndUniqueDates:()=>n.a$r,sortBasedOnArray:()=>n.EGs,spanRange:()=>n.gUy,splitBezier2D:()=>n.ypg,stepPoints:()=>n.kxA,stopPageScrolling:()=>n.hcQ,strictObjectKeys:()=>n.vIl,strictUnion:()=>n.$_4,string:()=>n.YjP,stringLength:()=>n.OEe,stringifyValue:()=>n.ngZ,strokeOptionsDef:()=>n.AFh,subtractValues:()=>n.Vz0,textAlign:()=>n.JhA,textOrSegments:()=>n.JwX,textWrap:()=>n.IQA,themeOperator:()=>n.I_s,throttle:()=>n.nFR,tickFormat:()=>n.Vr1,tickStep:()=>n.sG5,timeInterval:()=>n.f$c,timeIntervalUnit:()=>n.fyz,timeValueToNumber:()=>n.Hre,toArray:()=>n.$rL,toCanvasTextBaseline:()=>n.amv,toClippedCanvasPoint:()=>n.LYQ,toCurrentPoint:()=>n.pmA,toDegrees:()=>n.xWn,toFontString:()=>n.q2v,toIterable:()=>n.iNY,toNumber:()=>n.Roz,toNumberOrUndefined:()=>n.iud,toPlainText:()=>n.boc,toRadians:()=>n.ehJ,toTextString:()=>n.i$,toTimeInterval:()=>n.q8s,toZoomState:()=>n.M7G,toolbarButtonOptionsDefs:()=>n.Kj1,tooltipOptionsDefs:()=>n.cUy,tooltipOptionsDefsWithArea:()=>n.pRZ,transformIntegratedCategoryValue:()=>n.vq9,trapezoidBandRect:()=>
1n.g0D,trapezoidBox:()=>n.Ocl,trapezoidExtentAcross:()=>n.MYX,trapezoidFitRegion:()=>n.SXo,trapezoidOverlapsBox:()=>n.sbr,truncateLine:()=>n.rTr,typeUnion:()=>n.ist,undocumented:()=>n._Le,undocumentedLabelFitOptionsDefs:()=>n.H6P,undocumentedThemeOptions:()=>n.fs4,unguardTextEdges:()=>n.wUm,union:()=>n.KCZ,unionOrArray:()=>n.Ueb,unionSymbol:()=>n.ieU,unique:()=>n.AmM,validate:()=>n.tfT,verticalAlign:()=>n.whe,withFitRegion:()=>n.eyx,withTimeout:()=>n.wjz,without:()=>n.FFB,wrapLines:()=>n.MTZ,wrapText:()=>n.C1g,wrapTextOrSegments:()=>n.rHj,wrapTextSegments:()=>n.kNh,writeLabelBoxCentre:()=>n.CaF,zeroLike:()=>n.s1j});var a=Object.defineProperty,o=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,l=Object.prototype.hasOwnProperty,h=(e,t)=>{for(var i in t)a(e,i,{get:t[i],enumerable:!0})},c=(e,t,i,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let s of r(t))l.call(e,s)||s===i||a(e,s,{get:()=>t[s],enumerable:!(n=o(t,s))||n.enumerable});return e},d=(e,t,i,n)=>{for(var s,r=n>1?void 0:n?o(t,i):t,l=e.length-1;l>=0;l--)(s=e[l])&&(r=(n?s(t,i,r):s(r))||r);return n&&r&&a(t,i,r),r},u={ariaInitSeriesArea:"interactive chart",ariaAnnounceHoverDatum:"${datum}",ariaAnnounceSelectedItem:"selected",ariaAnnounceUnselectedItem:"unselected",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",ariaAnnounceOrgChartParentSingular:"${description}, level ${level}[number], ${posInSet}[number] of ${setSize}[number], ${collapsedState}, 1 child",ariaOrgChartCollapsed:"collapsed",ariaOrgChartExpanded:"expanded",ariaDescriptionExpandNode:"Press ALT DOWN to expand this node",ariaDescriptionCollapseNode:"Press ALT UP to collapse this node",ariaDescriptionToggleNode:"Press Space or Enter to expand or collapse this node",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.",overlayValidation:"Validation issues",overlayValidationSummary:"AG Charts found ${summary}",overlayValidationErrorCountSingular:"${count}[number] error",overlayValidationErrorCount:"${count}[number] errors",overlayValidationWarningCountSingular:"${count}[number] warning",overlayValidationWarningCount:"${count}[number] warnings",overlayValidationDeprecationCountSingular:"${count}[number] deprecation",overlayValidationDeprecationCount:"${count}[number] deprecations",overlayValidationErrorsHeading:"Errors (${count}[number])",overlayValidationWarningsHeading:"Warnings (${count}[number])",overlayValidationDeprecationsHeading:"Deprecations (${count}[number])",overlayValidationCopy:"Copy",overlayValidationCopied:"Copied",overlayValidationDismiss:"Dismiss",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]"};var p=Symbol("interpolate"),g=e=>null!=e[p],m=(()=>{var e=class e{constructor(e,t,i,n){this.x=e,this.y=t,this.width=i,this.height=n}static fromObject({x:t,y:i,width:n,height:s}){return new e(t,i,n,s)}static merge(t){let i=1/0,n=1/0,s=-1/0,a=-1/0;for(const e of t)e.x<i&&(i=e.x),e.y<n&&(n=e.y),y(e.x,e.width)>
1s&&(s=y(e.x,e.width)),y(e.y,e.height)>a&&(a=y(e.y,e.height));return new e(i,n,s-i,a-n)}static nearestBox(e,t,i){return(0,n.KpM)(e,t,i)}toDOMRect(){return{x:this.x,y:this.y,width:this.width,height:this.height,top:this.y,left:this.x,right:y(this.x,this.width),bottom:y(this.y,this.height),toJSON:()=>({})}}clone(){const{x:t,y:i,width:n,height:s}=this;return new e(t,i,n,s)}equals(e){return(0,n.ca$)(this,e)}containsPoint(e,t){return(0,n.JF9)(this,e,t)}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(t){const i=Math.max(this.x,t.x),n=Math.max(this.y,t.y),s=Math.min(y(this.x,this.width),y(t.x,t.width)),a=Math.min(y(this.y,this.height),y(t.y,t.height));if(!(i>s||n>a))return new e(i,n,s-i,a-n)}collidesBBox(e){return this.x<y(e.x,e.width)&&y(this.x,this.width)>e.x&&this.y<y(e.y,e.height)&&y(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,t){if(this.containsPoint(e,t))return 0;const i=e-(0,n.qE8)(this.x,e,y(this.x,this.width)),s=t-(0,n.qE8)(this.y,t,y(this.y,this.height));return i*i+s*s}shrink(e,t){if("number"==typeof e)this.applyMargin(e,t);else for(const t of Object.keys(e)){const i=e[t];"number"==typeof i&&this.applyMargin(i,t)}return this.width<0&&(this.width=0),this.height<0&&(this.height=0),this}grow(e,t){if("number"==typeof e)this.applyMargin(-e,t);else for(const t of Object.keys(e)){const i=e[t];"number"==typeof i&&this.applyMargin(-i,t)}return this}clip(e){const t=n.Zbg.from(this),i=n.Zbg.from(e??this);return this.x=Math.max(t.x1,i.x1),this.y=Math.max(t.y1,i.y1),this.width=Math.min(t.x2,i.x2)-this.x,this.height=Math.min(t.y2,i.y2)-this.y,this}applyMargin(e,t){switch(t){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-=2*e;break;case"horizontal":this.x+=e,this.width-=2*e;break;case void 0:this.x+=e,this.y+=e,this.width-=2*e,this.height-=2*e}}translate(e,t){return this.x+=e,this.y+=t,this}[p](t,i){return new e(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)}};return e.zero=Object.freeze(new e(0,0,0,0)),e.NaN=Object.freeze(new e(Number.NaN,Number.NaN,Number.NaN,Number.NaN)),e})();function y(e,t){return e===-1/0&&t===1/0?1/0:e+t}var f;function x(e,t){const i=t*e,n=i-Math.floor(i),s=Math.abs(n-.5)<1e-8?i+1e-8:i;return Math.round(s)}function b(e,t){return x(e,t)/e}function v(e,t){return t%2==0?x(1,e):x(1,e-.5)+.5}function S(e,t,i){const n=b(e,t);return null==i?n:0===i?0:i<1?function(e,t){return Math.ceil(t*e)/e}(e,i):b(e,i+t)-n}function M(e,t){return Math.floor(t*e)/e}function k({context:e,pixelRatio:t,width:i,height:n}){e.save();try{e.resetTransform(),e.clearRect(0,0,Math.ceil(i*t),Math.ceil(n*t))}finally{e.restore()}}function D(e){if(n.yar.check("canvas")){const t=e.save.bind(e),i=e.restore.bind(e);let n=0;Object.assign(e,{save(){t(),n++},restore(){if(0===n)throw new Error("AG Charts - Unable to restore() past depth 0");i(),n--},verifyDepthZero(){if(0!==n)throw new Error(`AG Charts - Save/restore depth is non-zero: ${n}`)}})}}function w(e,t,i){return[x(i,e),x(i,t)]}var I=class{constructor(e){const{width:t,height:i,pixelRatio:s,willReadFrequently:a=!1}=e;this.width=t,this.height=i,this.pixelRatio=s;const[o,r]=w(t,i,s),l=(0,n.yIC)();this.canvas=new l(o,r),this.context=this.canvas.getContext("2d",{willReadFrequently:a}),this.context.setTransform(s,0,0,s,0,0),D(this.context)}drawImage(e,t=0,i=0){return e.drawImage(this.canvas,t,i)}transferToImageBitmap(){return this.canvas.width<1||this.canvas.height<1?function(){const e=(0,n.yIC)();
1return f??(f=new e(1,1)),f}().transferToImageBitmap():this.canvas.transferToImageBitmap()}resize(e,t,i){if(!(e>0&&t>0))return;const{canvas:n,context:s}=this;if(e!==this.width||t!==this.height||i!==this.pixelRatio){const[s,a]=w(e,t,i);n.width=s,n.height=a}s.setTransform(i,0,0,i,0,0),this.width=e,this.height=t,this.pixelRatio=i}clear(){k(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)}},A=(e,t)=>Math.sign(e-t);function C(e,t){if("number"==typeof e&&"number"==typeof t)return A(e,t);const i="number"==typeof e?[e]:e,n="number"==typeof t?[t]:t,s=Math.min(i.length,n.length);for(let e=0;e<s;e+=1){const t=A(i[e],n[e]);if(0!==t)return t}return A(i.length,n.length)}var N=(e=>(e[e.All=0]="All",e[e.None=1]="None",e))(N||{}),L=(()=>{var e=class e{constructor(t){this.serialNumber=e._nextSerialNumber++,this.childNodeCounts={groups:0,nonGroups:0,thisComplexity:0,complexity:0},this.id=(0,n.sX_)(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??Number.NaN,this.zIndex=t?.zIndex??0,this.scene=t?.scene,(t?.debugDirty??e._debugEnabled)&&(this._debugDirtyProperties=new Map([["__first__",[]]]))}static toSVG(e,t,i){const s=e?.toSVG();if(null==s||!s.elements.length&&!s.defs?.length)return;const a=(0,n.FJ6)("svg");if(a.setAttribute("width",String(t)),a.setAttribute("height",String(i)),a.setAttribute("viewBox",`0 0 ${t} ${i}`),a.setAttribute("overflow","visible"),s.defs?.length){const e=(0,n.FJ6)("defs");e.append(...s.defs),a.append(e)}return a.append(...s.elements),a.outerHTML}static*extractBBoxes(e,t){for(const i of e)if(!t||i.visible&&!i.transitionOut){const e=i.getBBox();e&&(yield e)}}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(null!=e)return e}unsafeClosestDatum(){return this.closestDatum()}preRender(e,t=1){if(this.childNodeCounts.groups=0,this.childNodeCounts.nonGroups=1,this.childNodeCounts.complexity=t,this.childNodeCounts.thisComplexity=t,this.batchLevel>0||this.batchDirty)throw new Error("AG Charts - illegal rendering state; batched update in progress");return this.childNodeCounts}isolatedRender(e){const t=e.currentFont;e.ctx.save();try{this.render(e)}catch(t){const i=t.errorCount??1;if(i>=5)throw t.errorCount=i,t;e.logger.warnOnce("Error during rendering",t,t.stack)}finally{e.ctx.restore(),e.currentFont=t}}render(e){const{stats:t}=e;if(this.debugDirtyProperties(e.logger),e.debugNodeSearch){const t=this.name??this.id;e.debugNodeSearch.some((e=>"string"==typeof e?e===t:e.test(t)))&&(e.debugNodes[this.name??this.id]=this)}t&&(t.nodesRendered++,t.opsPerformed+=this.childNodeCounts.thisComplexity)}setScene(e){this.scene=e}*traverseUp(e){e&&(yield this);let t=this.parentNode;for(;t;)yield t,t=t.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--,0===this.batchLevel&&this.batchDirty&&(this.markDirty(),this.batchDirty=!1)}}setProperties(e){this.batchLevel++;try{const t=this,i=e,n=Object.keys(i);for(let e=0,s=n.length;e<s;e++){const s=n[e];t[s]=i[s]}}finally{this.batchLevel--,0===this.batchLevel&&this.batchDirty&&(this.markDirty(),this.batchDirty=!1)}return this}setPropertiesWithKeys(e,t){this.batchLevel++;try{const i=this,n=e;for(let e=0,s=t.length;e<s;e++){const s=t[e];i[s]=n[s]}}finally{this.batchLevel--,0===this.batchLevel&&this.batchDirty&&(this.markDirty(),this.batchDirty=!1)}return this}containsPoint(e,t){return!1}distanceSquared(e,t){return 1/0}pickNode(e,t){if(this.visible&&1!==this.pointerEvents)return this.containsPoint(e,t)?this:void 0}pickNodes(e,t,i=[]){return this.visible&&1!==this.pointerEvents?(this.containsPoint(e,t)&&i.push(this),i):i}getBBox(){return this.cachedBBox??(this.cachedBBox=Object.freeze(this.computeBBox())),this.cachedBBox}serialize(){return{type:"node",props:this.serializeProps()}}serializeProps(){return{visible:this.visible}}computeBBox(){}onChangeDetection(e){this.markDirty(e)}markDirtyChildrenOrder(){this.cachedBBox=void 0}markDirty(e){this.batchLevel>0?this.batchDirty=!0:(null!=e&&this._debugDirtyProperties&&this.markDebugProperties(e),this.cachedBBox=void 0,this.parentNode?.markDirty())}markDebugProperties(e){const t=this._debugDirtyProperties?.get(e)??[],i=new Error("Stack trace for property change tracking").stack?.split("\n").filter((e=>!("Error"===e||e.includes(".markDebugProperties")||e.includes(".markDirty")||e.includes("Object.assign ")||e.includes(`${this.constructor.name}.`))))??"unknown";t.push(i[0].replace(" at ","").trim()),this._debugDirtyProperties?.set(e,t)}debugDirtyProperties(e){if(null!=this._debugDirtyProperties){if(!this._debugDirtyProperties.has("__first__"))for(const[t,i]of this._debugDirtyProperties.entries())i.length>1&&e.logGroup(`Property changed multiple times before render: ${this.constructor.name}.${t} (${i.length}x)`,(()=>{for(const t of i)e.log(t)}));this._debugDirtyProperties.clear()}}static handleNodeZIndexChange(e){e.onZIndexChange()}onZIndexChange(){this.parentNode?.markDirtyChildrenOrder()}resolveFont(){}toSVG(){}};return e.className="AbstractNode",e._nextSerialNumber=0,e._debugEnabled=!1,d([(0,n.M7D)()],e.prototype,"visible",2),d([(0,n.M7D)({equals:n.DH9,changeCb:e.handleNodeZIndexChange})],e.prototype,"zIndex",2),e})(),P=L,T=class{constructor(){this.logger=n.tr_}invertWithPercentage(e){return this.invert(e,!0)}
1snapshotDomain(){return this.domain}restoreDomain(e){this.domain=e}get domainMin(){return this.getDomainMinMax()[0]}get domainMax(){return this.getDomainMinMax()[1]}ticks(e,t,i){}niceDomain(e,t=this.domain){return t}get bandwidth(){}get step(){}get inset(){}},O=(e,t)=>{const i=Symbol(String(t));e[i]=void 0,Object.defineProperty(e,t,{get(){return this[i]},set(e){this[i]!==e&&(this[i]=e,this.invalid=!0)},enumerable:!0,configurable:!1})};function R(e,t,i){const s=function(e,t,i){if(null==i||0===i[0]&&1===i[1])return;const s=(0,n.qE8)(0,Math.floor(i[0]*e.length),e.length),a=(0,n.qE8)(0,Math.ceil(i[1]*e.length),e.length);return[t?e.length-a:s,t?e.length-s:a]}(e,t,i);if(null==s)return{ticks:e,count:e.length,firstTickIndex:0};const[a,o]=s;return{ticks:e.slice(a,o),count:e.length,firstTickIndex:a}}function E(e){const t=(0,n.SXH)(e.at(0)),i=(0,n.SXH)(e.at(-1));return null!=t&&null!=i?[t,i]:[void 0,void 0]}var z=e=>{const t=n.Q1f.fromString(e),[i,s,a]=n.Q1f.RGBtoOKLCH(t.r,t.g,t.b);return{l:i,c:s,h:a,a:t.a}},B=1e-6,F=e=>e.c<B||e.l<B||e.l>1-B,V=(()=>{var e=class extends T{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(z),this.convertCache=new Map}update(){this.convertCache.clear();const{domain:e,range:t}=this;e.length<2&&(this.logger.warnOnce("`colorDomain` should have at least 2 values."),0===e.length?e.push(0,1):1===e.length&&e.push(e[0]+1));for(let t=1;t<e.length;t++){if(e[t-1]>e[t]){this.logger.warnOnce("`colorDomain` values should be supplied in ascending order."),e.sort(((e,t)=>e-t));break}}const i="discrete"===this.mode?e.length-1:e.length;if(t.length<i)for(let e=t.length;e<i;e++)t.push(t.length>0?t[0]:"black");this.parsedRange=this.range.map(z)}normalizeDomains(...e){return{domain:e.flatMap((e=>e.domain)),animatable:!0}}toDomain(){}convert(e){this.refresh();const t=(0,n.Roz)(e),i=this.convertCache.get(t);if(void 0!==i)return i;const s=this.computeColor(t);return this.convertCache.size<4096&&this.convertCache.set(t,s),s}computeColor(e){const{domain:t,range:i,parsedRange:s}=this,a=t[0],o=t.at(-1),r=i[0],l=i.at(-1);if(e<=a)return r;if(e>=o)return l;let h,c;if(2===t.length){const t=(e-a)/(o-a),n=1/(i.length-1);h=i.length<=2?0:Math.min(Math.floor(t*(i.length-1)),i.length-2),c=(t-h*n)/n}else{for(h=0;h<t.length-2&&!(e<t[h+1]);h++);const i=t[h];c=(e-i)/(t[h+1]-i)}if("discrete"===this.mode)return i[h];return((e,t,i)=>{let s;if(i=(0,n.qE8)(0,i,1),F(e))s=t.h;else if(F(t))s=e.h;else{const n=e.h;let a=t.h;const o=t.h-e.h;o>180?a-=360:o<-180&&(a+=360),s=n*(1-i)+a*i}const a=e.c*(1-i)+t.c*i,o=e.l*(1-i)+t.l*i,r=e.a*(1-i)+t.a*i;return n.Q1f.fromOKLCH(o,a,s,r)})(s[h],s[h+1],c).toRgbaString()}invert(){}getDomainMinMax(){return E(this.domain)}refresh(){this.invalid&&(this.invalid=!1,this.update(),this.invalid&&this.logger.warnOnce("Expected update to not invalidate scale"))}};return d([O],e.prototype,"domain",2),d([O],e.prototype,"range",2),d([O],e.prototype,"mode",2),e})(),$=class{constructor(e,t=[],i){this.colorSpace=e,this.stops=t,this.bbox=i,this._cache=void 0}createGradient(e,t,i){const n=this.bbox??t;if(!n.isFinite())return;if(this._cache?.ctx===e&&this._cache.bbox.equals(n))return this._cache.gradient;const{stops:s,colorSpace:a}=this;if(0===s.length)return;if(1===s.length)return s[0].color;let o=this.createCanvasGradient(e,n,i);if(null==o)return;const r="oklch"===a;let l=s[0];o.addColorStop(l.stop,l.color);for(let e=1;e<s.length;e+=1){const t=s[e];if(r){const e=new V;e.domain=[l.stop,t.stop],e.range=[l.color,t.color];for(let i=l.stop+.05;i<t.stop;i+=.05)o.addColorStop(i,e.convert(i)??"transparent")}o.addColorStop(t.stop,t.color),l=t}return"createPattern"in o&&(o=o.createPattern()),this._cache={ctx:e,bbox:n,gradient:o},o}toSvg(e){const t=this.bbox??e,i=this.createSvgGradient(t);for(const{stop:e,color:t}of this.stops){const s=(0,n.FJ6)("stop");s.setAttribute("offset",`${e}`),s.setAttribute("stop-color",`${t}`),i.appendChild(s)}return i}},H=class extends ${constructor(e,t,i=0,n){super(e,t,n),this.angle=i}createCanvasGradient(e,t,i){const{angle:s}=this,a=(0,n.JJe)(s+-90),o=i?.centerX??t.x+.5*t.width,r=i?.centerY??t.y+.5*t.height;return e.createConicGradient(a,o,r)}createSvgGradient(e){return(0,n.FJ6)("linearGradient")}},j=class extends ${constructor(e,t,i=0,n){super(e,t,n),this.angle=i}getGradientPoints(e){const{angle:t}=this,i=(0,n.JJe)(t+90),s=Math.cos(i),a=Math.sin(i),o=e.width,r=e.height,l=e.x+.5*o,h=e.y+.5*r,c=Math.hypot(r,o)/2,d=Math.atan2(r,o);let u;u=i<Math.PI/2?i:i<Math.PI?Math.PI-i:i<1.5*Math.PI?i-Math.PI:2*Math.PI-i;const p=c*Math.abs(Math.cos(u-d));return{x0:l+s*p,y0:h+a*p,x1:l-s*p,y1:h-a*p}}createCanvasGradient(e,t){const{x0:i,y0:n,x1:s,y1:a}=this.getGradientPoints(t);if(!(Number.isNaN(i)||Number.isNaN(n)||Number.isNaN(s)||Number.isNaN(a)))return e.createLinearGradient(i,n,s,a)}createSvgGradient(e){const{x0:t,y0:i,x1:s,y1:a}=this.getGradientPoints(e),o=(0,n.FJ6)("linearGradient");return o.setAttribute("x1",String(t)),o.setAttribute("y1",String(i)),o.setAttribute("x2",String(s)),o.setAttribute("y2",String(a)),o.setAttribute("gradientUnits","userSpaceOnUse"),o}},W=class extends ${constructor(e,t,i){super(e,t,i)}createCanvasGradient(e,t,i){const n=i?.centerX??t.x+.5*t.width,s=i?.centerY??t.y+.5*t.height,a=i?.innerRadius??0,o=i?.outerRadius??Math.hypot(.5*t.width,.5*t.height)/Math.SQRT2;return e.createRadialGradient(n,s,a,n,s,o)}createSvgGradient(e){const t=e.x+.5*e.width,i=e.y+.5*e.height,s=(0,n.FJ6)("radialGradient");return s.setAttribute("cx",String(t)),s.setAttribute("cy",String(i)),s.setAttribute("r",String(Math.hypot(.5*e.width,.5*e.height)/Math.SQRT2)),s.setAttribute("gradientUnits","userSpaceOnUse"),s}},_=(()=>{var e=class extends n.XPE{constructor(){super(...arguments),this.color="black"}};return d([n.mAP],e.prototype,"stop",2),d([n.mAP],e.prototype,"color",2),d([n.mAP],e.prototype,"name",2),e})(),G=(()=>{var e=class extends n.XPE{constructor(){super(...arguments),this.fills=new n.F_c(_),this.mode="continuous"}};return d([n.mAP],e.prototype,"fills",2),d([n.mAP],e.prototype,"domain",2),d([n.mAP],e.prototype,"mode",2),d([n.mAP],e.prototype,"missingDataFill",2),e})();function K(e,t,i,s="continuous"){const a=e.map((e=>"string"==typeof e?{color:e}:e));if(0===a.length)return function(e,t){const i="discrete"===t?1:0,s=e.map(((e,t,{length:n})=>({stop:(t+i)/(n-1+i),color:e})));return"discrete"===t?(0,n.CRU)(s):s}(t,s);const o=Math.min(...i),r=Math.max(...i),l="discrete"===s,h=(0,n.rRI)(a,o,r,l);let c,d=a.find((e=>null!=e.color))?.color;const u=a.map(((e,i)=>{let n=e?.color;const s=Math.max(0,Math.min(1,(h[i]-o)/(r-o)));return null!=n?d=n:null==d?(null==c&&(c=new V,c.domain=[0,1],c.range=t),n=c.convert(s)):n=d,{stop:s,color:n}}));return"discrete"===s?(0,n.CRU)(u):u}var Y=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,n,s){if(!t)return null;const[a,o]=this.getSize(t.width,t.height,i,n);return a<1||o<1?(s.warnOnce("Image fill is too small to render, ignoring."),null):e.createPattern(t,this.repeat)}getSize(e,t,i,n){const{fit:s}=this;let a=e,o=t,r=1;const l=i/n,h=e/t;return"stretch"===s||0===e||0===t?(a=i,o=n):"contain"===s?r=h>l?i/e:n/t:"cover"===s&&(r=h>l?n/t:i/e),[Math.max(1,a*r),Math.max(1,o*r)]}setImageTransform(e,t){if("string"==typeof e)return;const{url:i,rotation:s,width:a,height:o}=this,r=this.imageLoader?.loadImage(i);if(!r)return;const l=(0,n.JJe)(s),h=Math.cos(l),c=Math.sin(l),[d,u]=this.getSize(r.width,r.height,a??t.width,o??t.height),p=d/r.width,g=u/r.height,m=t.x+t.width/2,y=t.y+t.height/2,f=(h*d-c*u)/2,x=(c*d+h*u)/2,b=(0,n.Wse)();e?.setTransform(new b([h*p,c*g,-c*p,h*g,m-f,y-x]))}createPattern(e,t,i,n,s){const a=this.width??t,o=this.height??i,r=this._cache;
1if(r?.ctx===e&&r.width===a&&r.height===o)return r.pattern;const l=this.imageLoader?.loadImage(this.url,n),h=this.createCanvasImage(e,l,a,o,s);return null!=h?(this._cache={ctx:e,pattern:h,width:a,height:o},h):void 0}toSvg(e,t){const{url:i,rotation:s,backgroundFill:a,backgroundFillOpacity:o}=this,{x:r,y:l,width:h,height:c}=e,d=(0,n.FJ6)("pattern");d.setAttribute("viewBox",`0 0 ${h} ${c}`),d.setAttribute("x",String(r)),d.setAttribute("y",String(l)),d.setAttribute("width",String(h)),d.setAttribute("height",String(c)),d.setAttribute("patternUnits","userSpaceOnUse");const u=(0,n.FJ6)("rect");u.setAttribute("x","0"),u.setAttribute("y","0"),u.setAttribute("width",String(h)),u.setAttribute("height",String(c)),u.setAttribute("fill",a),u.setAttribute("fill-opacity",String(o)),d.appendChild(u);const p=(0,n.FJ6)("image");return p.setAttribute("href",i),p.setAttribute("x","0"),p.setAttribute("y","0"),p.setAttribute("width",String(h)),p.setAttribute("height",String(c)),p.setAttribute("preserveAspectRatio","none"),p.setAttribute("transform",`scale(${1/t}) rotate(${s}, ${h/2}, ${c/2})`),d.appendChild(p),d}},U=/^[\t\n\f\r ]*([achlmqstvz])[\t\n\f\r ]*/i,X=/^[+-]?((\d*\.\d+)|(\d+\.)|(\d+))(e[+-]?\d+)?/i,Z=/[\t\n\f\r ]*,?[\t\n\f\r ]*/,q=/^[01]/,Q={z:[],h:[X],v:[X],m:[X,X],l:[X,X],t:[X,X],s:[X,X,X,X],q:[X,X,X,X],c:[X,X,X,X,X,X],a:[X,X,X,q,q,X,X]};function J(e,t,i){const s=Q[e.toLocaleLowerCase()],a={command:e,params:[]};for(const o of s){const s=t.slice(i),r=o.exec(s);if(null==r)return 1===a.params.length?[i,a]:void n.tDR.warnOnce(`Invalid SVG path, error at index ${i}: No path segment parameters for command [${e}]`);{a.params.push(Number.parseFloat(r[0])),i+=r[0].length;const e=Z.exec(s.slice(r[0].length));null!=e&&(i+=e[0].length)}}return[i,a]}function ee(e,t,i,n,s=1e-6){if(Math.abs(e)<s)return function(e,t,i,n=1e-6){if(Math.abs(e)<n)return function(e,t){const i=-t/e;return 0!==e&&i>=0&&i<=1?[i]:[]}(t,i);const s=t*t-4*e*i,a=[];if(Math.abs(s)<n){const i=-t/(2*e);i>=0&&i<=1&&a.push(i)}else if(s>0){const i=Math.sqrt(s),n=(-t-i)/(2*e),o=(-t+i)/(2*e);n>=0&&n<=1&&a.push(n),o>=0&&o<=1&&a.push(o)}return a}(t,i,n,s);const a=t/e,o=i/e,r=(3*o-a*a)/9,l=(9*a*o-27*(n/e)-2*a*a*a)/54,h=r*r*r+l*l,c=1/3,d=[];if(h>=0){const e=Math.sqrt(h),t=Math.sign(l+e)*Math.pow(Math.abs(l+e),c),i=Math.sign(l-e)*Math.pow(Math.abs(l-e),c),n=Math.abs(Math.sqrt(3)*(t-i)/2),o=-c*a+(t+i);if(o>=0&&o<=1&&d.push(o),Math.abs(n)<s){const e=-c*a-(t+i)/2;e>=0&&e<=1&&d.push(e)}}else{const e=Math.acos(l/Math.sqrt(-r*r*r)),t=c*a,i=2*Math.sqrt(-r),n=i*Math.cos(c*e)-t,s=i*Math.cos(c*(e+2*Math.PI))-t,o=i*Math.cos(c*(e+4*Math.PI))-t;n>=0&&n<=1&&d.push(n),s>=0&&s<=1&&d.push(s),o>=0&&o<=1&&d.push(o)}return d}function te(e,t,i,n,s,a,o,r){const l=(i-e)*(r-a)-(n-t)*(o-s);if(0===l)return 0;const h=((o-s)*(t-a)-(e-s)*(r-a))/l,c=((i-e)*(t-a)-(n-t)*(e-s))/l;return h>=0&&h<=1&&c>=0&&c<=1?1:0}function ie(e,t,i,n,s,a,o,r,l,h,c,d){let u=0;const p=h-d,g=c-l,m=l*(d-h)-h*(c-l),y=ne(e,i,s,o),f=ne(t,n,a,r),x=ee(p*y[0]+g*f[0],p*y[1]+g*f[1],p*y[2]+g*f[2],p*y[3]+g*f[3]+m);for(const e of x){const t=e*e,i=e*t,n=y[0]*i+y[1]*t+y[2]*e+y[3],s=f[0]*i+f[1]*t+f[2]*e+f[3];let a;a=l===c?(s-h)/(d-h):(n-l)/(c-l),a>=0&&a<=1&&u++}return u}function ne(e,t,i,n){return[3*t-e-3*i+n,3*e-6*t+3*i,-3*e+3*t,e]}var se=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 e=(0,n.w6e)();this.path2d=new e}isEmpty(){return 0===this.commandsLength}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(e,t){this.openedPath=!0,this.sx=e,this.sy=t,this.cx=e,this.cy=t,this.path2d.moveTo(e,t),this.commands[this.commandsLength++]=0,this.params[this.paramsLength++]=e,this.params[this.paramsLength++]=t}lineTo(e,t){this.openedPath?(this.cx=e,this.cy=t,this.path2d.lineTo(e,t),this.commands[this.commandsLength++]=1,this.params[this.paramsLength++]=e,this.params[this.paramsLength++]=t):this.moveTo(e,t)}cubicCurveTo(e,t,i,n,s,a){this.openedPath||this.moveTo(e,t),this.path2d.bezierCurveTo(e,t,i,n,s,a),this.commands[this.commandsLength++]=2,this.params[this.paramsLength++]=e,this.params[this.paramsLength++]=t,this.params[this.paramsLength++]=i,this.params[this.paramsLength++]=n,this.params[this.paramsLength++]=s,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(e,t,i,n){this.moveTo(e,t),this.lineTo(e+i,t),this.lineTo(e+i,t+n),this.lineTo(e,t+n),this.closePath()}roundRect(e,t,i,n,s){s=Math.min(s,i/2,n/2),this.moveTo(e,t+s),this.arc(e+s,t+s,s,Math.PI,1.5*Math.PI),this.lineTo(e+s,t),this.lineTo(e+i-s,t),this.arc(e+i-s,t+s,s,1.5*Math.PI,2*Math.PI),this.lineTo(e+i,t+s),this.lineTo(e+i,t+n-s),this.arc(e+i-s,t+n-s,s,0,Math.PI/2),this.lineTo(e+i-s,t+n),this.lineTo(e+s,t+n),this.arc(e+ +s,t+n-s,s,Math.PI/2,Math.PI),this.lineTo(e,t+n-s),this.closePath()}ellipse(e,t,i,s,a,o,r,l=!1){const h=i,c=s/i,d=Math.cos(a),u=Math.sin(a),p=-c*u,g=c*d,m=h*Math.cos(o),y=h*Math.sin(o),f=e+d*m+p*y,x=t+u*m+g*y,b=(f-this.cx)**2+(x-this.cy)**2;this.openedPath?b>1e-6&&this.lineTo(f,x):this.moveTo(f,x);let v=l?-(0,n.YcT)(o-r):(0,n.YcT)(r-o);Math.abs(Math.abs(r-o)-2*Math.PI)<1e-6&&v<2*Math.PI&&(v+=2*Math.PI*(l?-1:1));const S=Math.max(Math.ceil(Math.abs(v)/(Math.PI/2)),1),M=v/S,k=4/3*Math.tan(M/4);for(let i=0;i<S;i+=1){const n=o+M*(i+0),s=o+M*(i+1),a=h*Math.sin(n),r=h*Math.cos(n),l=h*Math.sin(s),c=h*Math.cos(s),m=r-k*a,y=a+k*r,f=c+k*l,x=l-k*c,b=c,v=l;
vendor: 7,743 bytes, line 1
1this.cubicCurveTo(e+d*m+p*y,t+u*m+g*y,e+d*f+p*x,t+u*f+g*x,e+d*b+p*v,t+u*b+g*v)}}arc(e,t,i,n,s,a){this.ellipse(e,t,i,i,0,n,s,a)}appendSvg(e){const t=function(e){if(!e)return;const t=[];let i,s=0;for(;s<e.length;){const a=U.exec(e.slice(s));let o;if(null==a){if(!i)return void n.tDR.warnOnce(`Invalid SVG path, error at index ${s}: Missing command.`);o=i}else o=a[1],s+=a[0].length;const r=J(o,e,s);if(!r)return;s=r[0],i=o,t.push(r[1])}return t}(e);if(null==t)return!1;let i,s,a=0,o=0,r=0,l=0;for(const{command:e,params:n}of t){i??(i=n[0]),s??(s=n[1]);const t=e===e.toLowerCase(),h=t?i:0,c=t?s:0;switch(e.toLowerCase()){case"m":this.moveTo(h+n[0],c+n[1]),i=h+n[0],s=c+n[1],a=i,o=s;break;case"c":this.cubicCurveTo(h+n[0],c+n[1],h+n[2],c+n[3],h+n[4],c+n[5]),r=h+n[2],l=c+n[3],i=h+n[4],s=c+n[5];break;case"s":this.cubicCurveTo(i+i-r,s+s-l,h+n[0],c+n[1],h+n[2],c+n[3]),r=h+n[0],l=c+n[1],i=h+n[2],s=c+n[3];break;case"q":this.cubicCurveTo((h+2*n[0])/3,(c+2*n[1])/3,(2*n[0]+n[2])/3,(2*n[1]+n[3])/3,n[2],n[3]),r=n[0],l=n[1],i=n[2],s=n[3];break;case"t":this.cubicCurveTo((i+2*(i+i-r))/3,(s+2*(s+s-l))/3,(2*(i+i-r)+n[0])/3,(2*(s+s-l)+n[1])/3,n[0],n[1]),r=i+i-r,l=s+s-l,i=n[0],s=n[1];break;case"a":this.svgEllipse(i,s,n[0],n[1],n[2]*Math.PI/180,n[3],n[4],h+n[5],c+n[6]),i=h+n[5],s=c+n[6];break;case"h":this.lineTo(h+n[0],s),i=h+n[0];break;case"l":this.lineTo(h+n[0],c+n[1]),i=h+n[0],s=c+n[1];break;case"v":this.lineTo(i,c+n[0]),s=c+n[0];break;case"z":this.closePath(),i=a,s=o;break;default:throw new Error(`Could not translate command '${e}' with '${n.join(" ")}'`)}}return!0}svgEllipse(e,t,i,n,s,a,o,r,l){i=Math.abs(i),n=Math.abs(n);const h=(e-r)/2,c=(t-l)/2,d=Math.sin(s),u=Math.cos(s),p=u*h+d*c,g=-d*h+u*c,m=p/i,y=g/n;let f=m*m+y*y,x=(e+r)/2,b=(t+l)/2,v=0,S=0;f>=1?(f=Math.sqrt(f),i*=f,n*=f):(f=Math.sqrt(1/f-1),a===o&&(f=-f),v=f*i*y,S=-f*n*m,x+=u*v-d*S,b+=d*v+u*S);const M=Math.atan2((g-S)/n,(p-v)/i),k=M+(Math.atan2((-g-S)/n,(-p-v)/i)-M),D=!!(1-o);this.ellipse(x,b,i,n,s,M,k,D)}clear(e){e?(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=(0,n.w6e)();this.path2d=new t,this.openedPath=!1,this.closedPath=!1}isPointInPath(e,t){const i=this.commands,n=this.params,s=this.commandsLength,a=-1e4,o=-1e4;let r=Number.NaN,l=Number.NaN,h=0,c=0,d=0;for(let u=0,p=0;u<s;u++)switch(i[u]){case 0:d+=te(r,l,h,c,a,o,e,t),h=n[p++],r=h,c=n[p++],l=c;break;case 1:d+=te(h,c,n[p++],n[p++],a,o,e,t),h=n[p-2],c=n[p-1];break;case 2:d+=ie(h,c,n[p++],n[p++],n[p++],n[p++],n[p++],n[p++],a,o,e,t),h=n[p-2],c=n[p-1];break;case 3:d+=te(r,l,h,c,a,o,e,t)}return d%2==1}distanceSquared(e,t){let i=1/0;const s=this.commands,a=this.params,o=this.commandsLength;let r=Number.NaN,l=Number.NaN,h=0,c=0;for(let d=0,u=0;d<o;d++)switch(s[d]){case 0:h=r=a[u++],c=l=a[u++];break;case 1:{const s=h,o=c;h=a[u++],c=a[u++],i=(0,n.h6n)(e,t,s,o,h,c,i);break}case 2:{const s=h,o=c,r=a[u++],l=a[u++],d=a[u++],p=a[u++];h=a[u++],c=a[u++],i=(0,n.vgR)(s,o,r,l,d,p,h,c,e,t)**2;break}case 3:i=(0,n.h6n)(e,t,h,c,r,l,i)}return i}toSVG(e=(e,t)=>({x:e,y:t})){const t=[],{commands:i,params:n}=this,s=(i,s)=>{t.push(i);for(let i=0;i<s;i+=2){const{x:i,y:s}=e(n[a++],n[a++]);t.push(i,s)}};let a=0;for(let e=0;e<this.commandsLength;e++){switch(i[e]){case 0:s("M",2);break;case 1:s("L",2);break;case 2:s("C",6);break;case 3:s("Z",0)}}return t.join(" ")}computeBBox(){const{commands:e,params:t}=this;let[i,s,a,o]=[1/0,1/0,-1/0,-1/0],[r,l]=[Number.NaN,Number.NaN],[h,c]=[Number.NaN,Number.NaN];const d=(e,t)=>{i=Math.min(t,i),s=Math.min(e,s),a=Math.max(e,a),o=Math.max(t,o),r=e,l=t};let u=0;for(let i=0;i<this.commandsLength;i++){switch(e[i]){case 0:d(t[u++],t[u++]),h=r,c=l;break;case 1:d(t[u++],t[u++]);break;case 2:{const e=r,i=l,s=t[u++],a=t[u++],o=t[u++],h=t[u++],c=t[u++],p=t[u++],g=(0,n.YZY)(e,i,s,a,o,h,c,p);for(const t of g){d((0,n.z90)(e,s,o,c,t),(0,n.z90)(i,a,h,p,t))}d(c,p);break}case 3:d(h,c),h=Number.NaN,c=Number.NaN}}return new m(s,i,a-s,o-i)}flatten(e=16){const{commands:t,params:i}=this,s=[];let a=[],o=Number.NaN,r=Number.NaN,l=Number.NaN,h=Number.NaN;const c=(e,t)=>{a.push({x:e,y:t}),o=e,r=t};let d=0;for(let u=0;u<this.commandsLength;u++)switch(t[u]){case 0:a.length>0&&s.push(a),a=[],c(i[d++],i[d++]),l=o,h=r;break;case 1:c(i[d++],i[d++]);break;case 2:{const[t,s]=[o,r],a=i[d++],l=i[d++],h=i[d++],u=i[d++],p=i[d++],g=i[d++];for(let i=1;i<=e;i++){const o=i/e;c((0,n.z90)(t,a,h,p,o),(0,n.z90)(s,l,u,g,o))}break}case 3:Number.isNaN(l)||c(l,h)}return a.length>0&&s.push(a),s}};function ae(e,t,i){const{width:n,height:s,padding:a,strokeWidth:o}=t,r=n/2,l=s/2,h=Math.max(1,n-a-o/2),c=Math.max(1,s-a-o/2);let d=!1;for(const[t,n]of i){const i=r+(t-.5)*h,s=l+(n-.5)*c;d?e.lineTo(i,s):e.moveTo(i,s),d=!0}e.closePath()}var oe={circles(e,{width:t,strokeWidth:i,padding:n}){const s=t/2,a=Math.max(1,s-n-i/2);e.arc(s,s,a,0,2*Math.PI)},squares(e,{width:t,height:i,pixelRatio:n,padding:s,strokeWidth:a}){const o=s+a/2;e.moveTo(S(n,o),S(n,o)),e.lineTo(S(n,t-o),S(n,o)),e.lineTo(S(n,t-o),S(n,i-o)),e.lineTo(S(n,o),S(n,i-o)),e.closePath()},triangles(e,t){ae(e,t,[[.5,0],[1,1],[0,1]])},diamonds(e,t){ae(e,t,[[.5,0],[1,.5],[.5,1],[0,.5]])},stars(e,{width:t,height:i,padding:n}){const s=Math.max(1,(t-n)/2),a=s/2,o=Math.PI/2;for(let n=0;n<10;n++){const r=n%2==0?s:a,l=n*Math.PI/5-o,h=t/2+Math.cos(l)*r,c=i/2+Math.sin(l)*r;e.lineTo(h,c)}e.closePath()},hearts(e,{width:t,height:i,padding:s}){const a=Math.max(1,t/4-s/2),o=t/2,r=i/2+a/2;e.arc(o-a,r-a,a,(0,n.ehJ)(130),(0,n.ehJ)(330)),e.arc(o+a,r-a,a,(0,n.ehJ)(220),(0,n.ehJ)(50)),e.lineTo(o,r+a),e.closePath()},crosses(e,t){ae(e,t,[[.25,0],[.5,.25],[.75,0],[1,.25],[.75,.5],[1,.75],[.75,1],[.5,.75],[.25,1],[0,.75],[.25,.5],[0,.25]])},"vertical-lines"(e,{width:t,height:i,pixelRatio:n,strokeWidth:s}){const a=S(n,t/2)-s%2/2;e.moveTo(a,0),e.lineTo(a,i)},"horizontal-lines"(e,{width:t,height:i,pixelRatio:n,strokeWidth:s}){const a=S(n,i/2)-s%2/2;e.moveTo(0,a),e.lineTo(t,a)},"forward-slanted-lines"(e,{width:t,height:i,strokeWidth:n}){const s=Math.atan2(i,t),a=n*Math.cos(s),o=n*Math.sin(s);e.moveTo(-a,o),e.lineTo(a,-o),e.moveTo(-a,i+o),e.lineTo(t+a,-o),e.moveTo(t-a,i+o),e.lineTo(t+a,i-o)},"backward-slanted-lines"(e,{width:t,height:i,strokeWidth:n}){const s=Math.atan2(i,t),a=n*Math.cos(s),o=n*Math.sin(s);e.moveTo(t-a,-o),e.lineTo(t+a,o),e.moveTo(-a,-o),e.lineTo(t+a,i+o),e.moveTo(-a,i-o),e.lineTo(a,i+o)}},re=class{constructor(e){this._cache=void 0,this.width=Math.max(e?.width??10,1),this.height=Math.max(e?.height??10,1),this.fill=e.fill??"none",this.fillOpacity=e.fillOpacity??1,this.backgroundFill=e.backgroundFill??"none",this.backgroundFillOpacity=e.backgroundFillOpacity??1,this.stroke=e.stroke??"black",this.strokeOpacity=e.strokeOpacity??1,this.strokeWidth=e.strokeWidth??1,this.padding=e.padding??1,this.pattern=e.pattern??"forward-slanted-lines",this.rotation=e.rotation??0,this.scale=e.scale??1,this.path=e.path}getPath(e){const{pattern:t,width:i,height:n,padding:s,strokeWidth:a,path:o}=this,r=new se;let l=null!=oe[t];return o&&l&&(l=!r.appendSvg(o)),l&&oe[t](r,{width:i,height:n,pixelRatio:e,strokeWidth:a,padding:s}),r}renderStroke(e,t){const{stroke:i,strokeWidth:n,strokeOpacity:s}=this;n&&(t.strokeStyle=i,t.lineWidth=n,t.globalAlpha=s,t.stroke(e))}renderFill(e,t){const{fill:i,fillOpacity:n}=this;"none"!==i&&(t.fillStyle=i,t.globalAlpha=n,t.fill(e))}createCanvasPattern(e,t,i){const{width:n,height:s,scale:a,backgroundFill:o,backgroundFillOpacity:r}=this;if(n*a<1||s*a<1)return i.warnOnce("Pattern fill is too small to render, ignoring."),null;const l=new I({width:n,height:s,pixelRatio:t*a}),h=l.context;
1"none"!==o&&(h.fillStyle=o,h.globalAlpha=r,h.fillRect(0,0,n,s));const c=this.getPath(t).getPath2D();this.renderFill(c,h),this.renderStroke(c,h);const d=e.createPattern(l.canvas,"repeat");return this.setPatternTransform(d,t),l.destroy(),d}setPatternTransform(e,t,i=0,s=0){if(null==e)return;const a=(0,n.JJe)(this.rotation),o=1/t,r=Math.cos(a)*o,l=Math.sin(a)*o,h=(0,n.Wse)();e.setTransform(new h([r,l,-l,r,i,s]))}createPattern(e,t,i){if(this._cache?.ctx===e&&this._cache.pixelRatio===t)return this._cache.pattern;const n=this.createCanvasPattern(e,t,i);return null!=n?(this._cache={ctx:e,pattern:n,pixelRatio:t},n):void 0}toSvg(){const{width:e,height:t,fill:i,fillOpacity:s,backgroundFill:a,backgroundFillOpacity:o,stroke:r,strokeWidth:l,strokeOpacity:h,rotation:c,scale:d}=this,u=(0,n.FJ6)("pattern");u.setAttribute("viewBox",`0 0 ${e} ${t}`),u.setAttribute("width",String(e)),u.setAttribute("height",String(t)),u.setAttribute("patternUnits","userSpaceOnUse");const p=(0,n.FJ6)("rect");p.setAttribute("x","0"),p.setAttribute("y","0"),p.setAttribute("width",String(e)),p.setAttribute("height",String(t)),p.setAttribute("fill",a),p.setAttribute("fill-opacity",String(o)),u.appendChild(p);const g=(0,n.FJ6)("path");return g.setAttribute("fill",i),g.setAttribute("fill-opacity",String(s)),g.setAttribute("stroke-opacity",String(h)),g.setAttribute("stroke",r),g.setAttribute("stroke-width",String(l)),g.setAttribute("transform",`rotate(${c}) scale(${d})`),g.setAttribute("d",this.getPath(1).toSVG()),u.appendChild(g),u}};function le(e,t){const{fontStyle:i,fontWeight:n,fontSize:s,fontFamily:a}=t;i&&e.setAttribute("font-style",i),n&&e.setAttribute("font-weight",String(n)),null!=s&&e.setAttribute("font-size",String(s)),a&&e.setAttribute("font-family",a)}var he=(()=>{var e=class extends P{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((0,n.MBc)(e))return this.createGradient(e)}createGradient(e){const{colorSpace:t="rgb",gradient:i="linear",colorStops:n,rotation:s=0,reverse:a=!1}=e;if(null==n)return;let o=K(n,["black"],[0,1]);switch(a&&(o=o.map((e=>({color:e.color,stop:1-e.stop}))).reverse()),i){case"linear":return new j(t,o,s);case"radial":return new W(t,o);case"conic":return new H(t,o,s)}}getPattern(e){if((0,n.EDy)(e))return this.createPattern(e)}createPattern(e){return new re(e)}getImage(e){if((0,n.BF9)(e))return this.createImage(e)}createImage(e){return new Y(this.imageLoader,e)}onFillChange(){"object"==typeof this.fill&&(0,n.DH9)(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,t){return S(this.layerManager?.canvas?.pixelRatio??1,e,t)}alignCentre(e,t,i){return function(e,t,i,n={start:0,length:0}){const s=x(e,i);if(s<=1)return n.start=S(e,t),n.length=S(e,t,i),n;const a=v((t+i/2)*e,s)-s/2;return n.start=a/e,n.length=s/e,n}(this.layerManager?.canvas?.pixelRatio??1,e,t,i)}centreSnapApplies(e){return function(e,t){return x(e,t)>1}(this.layerManager?.canvas?.pixelRatio??1,e)}serializeProps(){return{...super.serializeProps(),opacity:this.opacity,drawingMode:this.drawingMode,hasFill:null!=this.fill,hasStroke:null!=this.stroke}}markDirty(e){super.markDirty(e),this.cachedDefaultGradientFillBBox=void 0}fillStroke(e,t,i,n,s){"cutout"===this.__drawingMode&&(e.globalCompositeOperation="destination-out",this.executeFill(e,i),e.globalCompositeOperation="source-over"),this.renderFill(e,t,i,n,s),this.renderStroke(e,i,n)}renderFill(e,t,i,n,s){const{__fill:a,__fillOpacity:o=1,fillImage:r}=this;if(null!=a&&"none"!==a&&o>0){const a=e.globalAlpha;r&&(e.globalAlpha=r.backgroundFillOpacity,e.fillStyle=r.backgroundFill,this.executeFill(e,i),e.globalAlpha=a),this.applyFillAndAlpha(e,t,n,s),this.applyShadow(e),this.executeFill(e,i),e.globalAlpha=a,this.fillShadow?.enabled&&(e.shadowColor="rgba(0, 0, 0, 0)")}}executeFill(e,t){t?e.fill(t):e.fill()}applyFillAndAlpha(e,t,i,n){const{__fill:s,fillGradient:a,fillPattern:o,fillImage:r,__fillOpacity:l=1,__opacity:h=1}=this,c=h*l;if(1!==c&&(e.globalAlpha*=c),a){const t=n??this.fillBBox??this.getDefaultGradientFillBBox()??i??this.getBBox(),{fillParams:s}=this;e.fillStyle=a.createGradient(e,t,s)??"black"}else if(o){const{x:n,y:s}=i??this.getBBox(),a=this.layerManager?.canvas?.pixelRatio??1,r=o.createPattern(e,a,t);o.setPatternTransform(r,a,n,s),r?e.fillStyle=r:(e.fillStyle=o.fill,e.globalAlpha*=o.fillOpacity)}else if(r){const n=i??this.getBBox(),s=r.createPattern(e,n.width,n.height,this,t);r.setImageTransform(s,n),e.fillStyle=s??"transparent"}else e.fillStyle="string"==typeof s?s:"black"}applyStrokeAndAlpha(e,t){const{__stroke:i,__strokeOpacity:n=1,strokeGradient:s,__opacity:a=1}=this;e.strokeStyle=s?.createGradient(e,t??this.getBBox())??("string"==typeof i?i:void 0)??"black";const o=a*n;1!==o&&(e.globalAlpha*=o)}applyShadow(e){const t=this.layerManager?.canvas.pixelRatio??1,{__fillShadow:i}=this;i?.enabled&&(e.shadowColor=i.color,e.shadowOffsetX=i.xOffset*t,e.shadowOffsetY=i.yOffset*t,e.shadowBlur=i.blur*t)}renderStroke(e,t,i){const{__stroke:n,__strokeWidth:s=0,__strokeOpacity:a=1,__lineDash:o,__lineDashOffset:r,__lineCap:l,__lineJoin:h,__miterLimit:c}=this;if(null!=n&&"none"!==n&&s>0&&a>0){const{globalAlpha:n}=e;this.applyStrokeAndAlpha(e,i),e.lineWidth=s,o&&e.setLineDash(o),r&&(e.lineDashOffset=r),l&&(e.lineCap=l),h&&(e.lineJoin=
1h),null!=c&&(e.miterLimit=c),this.executeStroke(e,t),e.globalAlpha=n}}executeStroke(e,t){t?e.stroke(t):e.stroke()}getDefaultGradientFillBBox(){return this.cachedDefaultGradientFillBBox??(this.cachedDefaultGradientFillBBox=Object.freeze(this.computeDefaultGradientFillBBox())),this.cachedDefaultGradientFillBBox}computeDefaultGradientFillBBox(){}containsPoint(e,t){return this.isPointInPath(e,t)}applySvgFillAttributes(e,t){const{fill:i,fillOpacity:s}=this;if("string"==typeof i)e.setAttribute("fill",i);else if((0,n.MBc)(i)&&this.fillGradient){t??(t=[]);const i=this.fillGradient.toSvg(this.fillBBox??this.getBBox()),s=(0,n.lkB)();i.setAttribute("id",s),t.push(i),e.setAttribute("fill",`url(#${s})`)}else if((0,n.EDy)(i)&&this.fillPattern){t??(t=[]);const i=this.fillPattern.toSvg(),s=(0,n.lkB)();i.setAttribute("id",s),t.push(i),e.setAttribute("fill",`url(#${s})`)}else if((0,n.BF9)(i)&&this.fillImage){t??(t=[]);const i=this.layerManager?.canvas?.pixelRatio??1,s=this.fillImage.toSvg(this.getBBox(),i),a=(0,n.lkB)();s.setAttribute("id",a),t.push(s),e.setAttribute("fill",`url(#${a})`)}else e.setAttribute("fill","none");return e.setAttribute("fill-opacity",String(s)),t}applySvgStrokeAttributes(e){const{stroke:t,strokeOpacity:i,strokeWidth:s,lineDash:a,lineDashOffset:o}=this;!function(e,t){const{stroke:i,strokeWidth:n,strokeOpacity:s}=t;i&&e.setAttribute("stroke",i),null!=n&&e.setAttribute("stroke-width",String(n)),null!=s&&e.setAttribute("stroke-opacity",String(s))}(e,{stroke:(0,n.KgX)(t)?t:void 0,strokeOpacity:i,strokeWidth:s}),function(e,t){const{lineDash:i,lineDashOffset:n}=t;if(i?.some((e=>0!==e))){const t=i.length%2==1?[...i,...i]:i;e.setAttribute("stroke-dasharray",t.join(" ")),null!=n&&e.setAttribute("stroke-dashoffset",String(n))}}(e,{lineDash:a,lineDashOffset:o})}static handleFillChange(e){e.onFillChange()}static handleStrokeChange(e){e.onStrokeChange()}setStyleProperties(e,t,i){const n=e?.opacity??1,s=e?.fill,a=(e?.fillOpacity??1)*n,o=(e?.strokeOpacity??1)*n,r=e?.strokeWidth??0,l=e?.lineDashOffset??0;let h=!1;this.__fillOpacity!==a&&(this.__fillOpacity=a,h=!0),this.__strokeOpacity!==o&&(this.__strokeOpacity=o,h=!0),this.__strokeWidth!==r&&(this.__strokeWidth=r,h=!0),this.__lineDashOffset!==l&&(this.__lineDashOffset=l,h=!0),this.__lineDash!==e?.lineDash&&(this.__lineDash=e?.lineDash,h=!0),this.setFillProperties(s,t,i),s!==this.fill&&(this.fill=s),e?.stroke!==this.stroke&&(this.stroke=e?.stroke),h&&this.markDirty()}setFillProperties(e,t,i){const s=null!=t&&(0,n.MBc)(e)&&null!=e.bounds&&"item"!==e.bounds?t[e.bounds]:void 0;let a=!1;this.__fillBBox!==s&&(this.__fillBBox=s,a=!0),this.__fillParams!==i&&(this.__fillParams=i,a=!0),a&&(this.onFillChange(),this.markDirty())}};return d([(0,n.M7D)()],e.prototype,"drawingMode",2),d([(0,n.M7D)()],e.prototype,"fillOpacity",2),d([(0,n.M7D)()],e.prototype,"strokeOpacity",2),d([(0,n.HvY)({equals:n.DH9,changeCb:e.handleFillChange})],e.prototype,"fill",2),d([(0,n.Tou)({equals:n.DH9,changeCb:e.handleStrokeChange})],e.prototype,"stroke",2),d([(0,n.M7D)()],e.prototype,"strokeWidth",2),d([(0,n.Haz)()],e.prototype,"lineDash",2),d([(0,n.M7D)()],e.prototype,"lineDashOffset",2),d([(0,n.M7D)()],e.prototype,"lineCap",2),d([(0,n.M7D)()],e.prototype,"lineJoin",2),d([(0,n.M7D)()],e.prototype,"miterLimit",2),d([(0,n.M7D)({convertor:e=>(0,n.qE8)(0,e??1,1)})],e.prototype,"opacity",2),d([(0,n.Tou)({equals:n.EJX,checkDirtyOnAssignment:!0})],e.prototype,"fillShadow",2),d([(0,n.HvY)({equals:n.ca$,changeCb:e=>e.onFillChange()})],e.prototype,"fillBBox",2),d([(0,n.HvY)({equals:n.DH9,changeCb:e=>e.onFillChange()})],e.prototype,"fillParams",2),e})(),ce=he,de=[1,0,0,1,0,0],ue=class e{get e(){return[...this.elements]}constructor(e=de){this.elements=[...e]}setElements(e){const t=this.elements;return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],this}get identity(){const e=this.elements;return(0,n.YXt)(e[0],1)&&(0,n.YXt)(e[1],0)&&(0,n.YXt)(e[2],0)&&(0,n.YXt)(e[3],1)&&(0,n.YXt)(e[4],0)&&(0,n.YXt)(e[5],0)}AxB(e,t,i){const n=e[0]*t[0]+e[2]*t[1],s=e[1]*t[0]+e[3]*t[1],a=e[0]*t[2]+e[2]*t[3],o=e[1]*t[2]+e[3]*t[3],r=e[0]*t[4]+e[2]*t[5]+e[4],l=e[1]*t[4]+e[3]*t[5]+e[5];(i=i??e)[0]=n,i[1]=s,i[2]=a,i[3]=o,i[4]=r,i[5]=l}multiplySelf(e){return this.AxB(this.elements,e.elements),this}multiply(t){const i=[Number.NaN,Number.NaN,Number.NaN,Number.NaN,Number.NaN,Number.NaN];return t instanceof e?this.AxB(this.elements,t.elements,i):this.AxB(this.elements,[t.a,t.b,t.c,t.d,t.e,t.f],i),new e(i)}preMultiplySelf(e){return this.AxB(e.elements,this.elements,this.elements),this}inverse(){const t=this.elements;let i=t[0],n=t[1],s=t[2],a=t[3];const o=t[4],r=t[5],l=1/(i*a-n*s);return i*=l,n*=l,s*=l,a*=l,new e([a,-n,-s,i,s*r-a*o,n*o-i*r])}invertSelf(){const e=this.elements;let t=e[0],i=e[1],n=e[2],s=e[3];const a=e[4],o=e[5],r=1/(t*s-i*n);return t*=r,i*=r,n*=r,s*=r,e[0]=s,e[1]=-i,e[2]=-n,e[3]=t,e[4]=n*o-s*a,e[5]=i*a-t*o,this}transformPoint(e,t){const i=this.elements;return{x:e*i[0]+t*i[2]+i[4],y:e*i[1]+t*i[3]+i[5]}}transformBBox(e,t){const i=this.elements,n=i[0],s=i[1],a=i[2],o=i[3],r=.5*e.width,l=.5*e.height,h=e.x+r,c=e.y+l,d=Math.abs(r*n)+Math.abs(l*a),u=Math.abs(r*s)+Math.abs(l*o);return t??(t=new m(0,0,0,0)),t.x=h*n+c*a+i[4]-d,t.y=h*s+c*o+i[5]-u,t.width=d+d,t.height=u+u,t}toContext(e){if(this.identity)return;const t=this.elements;e.transform(t[0],t[1],t[2],t[3],t[4],t[5])}static updateTransformMatrix(e,t,i,n,s,a,o){const r=t,l=i;let h,c;1===r&&1===l?(h=0,c=0):(h=o?.scalingCenterX??0,c=o?.scalingCenterY??0);const d=n,u=Math.cos(d),p=Math.sin(d);let g,m;0===d?(g=0,m=0):(g=o?.rotationCenterX??0,m=o?.rotationCenterY??0);const y=s,f=a,x=h*(1-r)-g,b=c*(1-l)-m;return e.setElements([u*r,p*r,-p*l,u*l,u*x-p*b+g+y,p*x+u*b+m+f]),e}};function pe(e){return me(e.constructor)}var ge=Symbol("isMatrixTransform");function me(e){return!0===e[ge]}function ye(e){var t;const i=e;if(me(e))return e;const s=Symbol("matrix_combined_transform");class a extends i{constructor(){super(...arguments),this[t]=new ue,this._dirtyTransform=!0}onChangeDetection(e){super.onChangeDetection(e),this._dirtyTransform=!0,this.batchLevel>0||this.markDirty("transform")}updateMatrix(e){}computeTransformMatrix(){this._dirtyTransform&&(this[s].setElements(de),this.updateMatrix(this[s]),this._dirtyTransform=!1)}toParent(e){return this.computeTransformMatrix(),this[s].identity?e.clone():this[s].transformBBox(e)}toParentPoint(e,t){return this.computeTransformMatrix(),this[s].identity?{x:e,y:t}:this[s].transformPoint(e,t)}fromParent(e){return this.computeTransformMatrix(),this[s].identity?e.clone():this[s].inverse().transformBBox(e)}fromParentPoint(e,t){return this.computeTransformMatrix(),this[s].identity?{x:e,y:t}:this[s].inverse().transformPoint(e,t)}computeBBox(){const e=super.computeBBox();return e?this.toParent(e):e}computeBBoxWithoutTransforms(){return super.computeBBox()}pickNode(e,t){return({x:e,y:t}=this.fromParentPoint(e,t)),super.pickNode(e,t)}pickNodes(e,t,i){return({x:e,y:t}=this.fromParentPoint(e,t)),super.pickNodes(e,t,i)}distanceSquared(e,t){return({x:e,y:t}=this.fromParentPoint(e,t)),super.distanceSquared(e,t)}render(e){this.computeTransformMatrix();const{ctx:t}=e,i=this[s];let n=!1;try{i.identity||(t.save(),n=!0,i.toContext(t)),super.render(e)}
1finally{n&&t.restore()}}toSVG(){this.computeTransformMatrix();const e=super.toSVG(),t=this[s];if(t.identity||null==e)return e;const i=(0,n.FJ6)("g");i.append(...e.elements);const[a,o,r,l,h,c]=t.e;return i.setAttribute("transform",`matrix(${a} ${o} ${r} ${l} ${h} ${c})`),{elements:[i],defs:e.defs}}}return t=s,a[ge]=!0,a}function fe(e){var t;const i=e,s=Symbol("matrix_rotation");class a extends(ye(i)){constructor(){super(...arguments),this[t]=new ue,this.rotationCenterX=0,this.rotationCenterY=0,this.rotation=0}serialize(){const e=super.serialize();return e.props.rotation=this.rotation,e}updateMatrix(e){super.updateMatrix(e);const{rotation:t,rotationCenterX:i,rotationCenterY:n}=this;0!==t&&(ue.updateTransformMatrix(this[s],1,1,t,0,0,{rotationCenterX:i,rotationCenterY:n}),e.multiplySelf(this[s]))}}return t=s,d([(0,n.k8u)()],a.prototype,"rotationCenterX",2),d([(0,n.k8u)()],a.prototype,"rotationCenterY",2),d([(0,n.k8u)()],a.prototype,"rotation",2),a}function xe(e){var t;const i=e,s=Symbol("matrix_scale");class a extends(ye(i)){constructor(){super(...arguments),this[t]=new ue,this.scalingX=1,this.scalingY=1,this.scalingCenterX=0,this.scalingCenterY=0}serialize(){const e=super.serialize();return e.props.scalingX=this.scalingX,e.props.scalingY=this.scalingY,e}updateMatrix(e){super.updateMatrix(e);const{scalingX:t,scalingY:i,scalingCenterX:n,scalingCenterY:a}=this;1===t&&1===i||(ue.updateTransformMatrix(this[s],t,i,0,0,0,{scalingCenterX:n,scalingCenterY:a}),e.multiplySelf(this[s]))}resetScalingProperties(e,t,i,n){this.__scalingX=e,this.__scalingY=t,this.__scalingCenterX=i,this.__scalingCenterY=n,this.onChangeDetection("scaling")}}return t=s,d([(0,n.k8u)()],a.prototype,"scalingX",2),d([(0,n.k8u)()],a.prototype,"scalingY",2),d([(0,n.k8u)()],a.prototype,"scalingCenterX",2),d([(0,n.k8u)()],a.prototype,"scalingCenterY",2),a}function be(e){var t;const i=e,s=Symbol("matrix_translation");class a extends(ye(i)){constructor(){super(...arguments),this[t]=new ue,this.translationX=0,this.translationY=0}serialize(){const e=super.serialize();return e.props.translationX=this.translationX,e.props.translationY=this.translationY,e}updateMatrix(e){super.updateMatrix(e);const{translationX:t,translationY:i}=this;0===t&&0===i||(ue.updateTransformMatrix(this[s],1,1,0,t,i),e.multiplySelf(this[s]))}}return t=s,d([(0,n.k8u)()],a.prototype,"translationX",2),d([(0,n.k8u)()],a.prototype,"translationY",2),a}var ve,Se,Me=class{static fromCanvas(e,t){const i=[];for(const t of e.traverseUp())pe(t)&&i.unshift(t);for(const e of i)t=e.fromParent(t);return pe(e)&&(t=e.fromParent(t)),t}static toCanvas(e,t){null==t?t=e.getBBox():pe(e)&&(t=e.toParent(t));for(const i of e.traverseUp())pe(i)&&(t=i.toParent(t));return t}static fromCanvasPoint(e,t){let{canvasX:i,canvasY:n}=t;const s=[];for(const t of e.traverseUp())pe(t)&&s.unshift(t);for(const e of s)({x:i,y:n}=e.fromParentPoint(i,n));return pe(e)&&({x:i,y:n}=e.fromParentPoint(i,n)),{x:i,y:n}}static toCanvasPoint(e,t,i){pe(e)&&({x:t,y:i}=e.toParentPoint(t,i));for(const n of e.traverseUp())pe(n)&&({x:t,y:i}=n.toParentPoint(t,i));return{canvasX:t,canvasY:i}}},ke=(()=>{var e=class e extends P{constructor(e){super(e),this.childNodes=new Set,this.dirty=!1,this.dirtyZIndex=!1,this.clipRect=void 0,this.opacity=1,this._childFontDirty=!0,this.layer=void 0,this.image=void 0,this._lastWidth=Number.NaN,this._lastHeight=Number.NaN,this._lastDevicePixelRatio=Number.NaN,this.isContainerNode=!0,this.renderToOffscreenCanvas=!0===e?.renderToOffscreenCanvas,this.optimizeForInfrequentRedraws=!0===e?.optimizeForInfrequentRedraws}static is(t){return t instanceof e}static computeChildrenBBox(e,t=!0){return m.merge(P.extractBBoxes(e,t))}static compareChildren(e,t){return C(e.__zIndex,t.__zIndex)||e.serialNumber-t.serialNumber}serialize(){return{type:"group",props:this.serializeProps()}}serializeProps(){return{...super.serializeProps(),opacity:this.opacity}}get useOffscreenCanvas(){return this.renderToOffscreenCanvas&&(0,n.zEw)()}containsPoint(e,t){return!0}computeBBox(){return e.computeChildrenBBox(this.children())}computeSafeClippingBBox(e){const t=this.computeBBox();
1if(!0!==t?.isFinite())return;let i=0;for(const e of this.descendants())e instanceof ce&&(i=Math.max(i,e.strokeWidth));const n=Math.max(1,i/2*4),{canvasX:s,canvasY:a}=Me.toCanvasPoint(this,0,0),o=M(e,s+t.x-n)-s,r=M(e,a+t.y-n)-a,l=Math.ceil(t.x+t.width-o+n),h=Math.ceil(t.y+t.height-r+n);return new m(o,r,l,h)}prepareSharedCanvas(e,t,i){return ve?.pixelRatio===i?ve.resize(e,t,i):ve=new I({width:e,height:t,pixelRatio:i}),ve}setScene(e){const t=this.scene;super.setScene(e),this.layer&&t&&t!==e&&(t.layersManager.removeLayer(this.layer),this.layer=void 0);for(const t of this.children())t.setScene(e)}resolveFont(){if(!this.useOffscreenCanvas)return this.resolveChildFont()}resolveChildFont(){if(this._childFontDirty){this._cachedChildFont=void 0;for(const e of this.children()){const t=e.resolveFont();if(null!=t){this._cachedChildFont=t;break}}this._childFontDirty=!1}return this._cachedChildFont}markDirty(e){this.dirty=!0,this._childFontDirty=!0,super.markDirty(e)}markDirtyChildrenOrder(){super.markDirtyChildrenOrder(),this.dirtyZIndex=!0,this.markDirty()}append(e){for(const t of(0,n.iNY)(e))t.remove(),this.childNodes.add(t),t.parentNode=this,t.setScene(this.scene);this.markDirtyChildrenOrder(),this.markDirty()}appendChild(e){return this.append(e),e}removeChild(e){if(!this.childNodes?.delete(e))throw new Error(`AG Charts - internal error, unknown child node ${e.name??e.id} in $${this.name??this.id}`);e.parentNode=void 0,e.setScene(),this.markDirtyChildrenOrder(),this.markDirty()}clear(){for(const e of this.children())delete e.parentNode,e.setScene();this.childNodes?.clear(),this.markDirty()}pickNode(e,t){if(this.visible&&1!==this.pointerEvents&&this.containsPoint(e,t))if(null!=this.childNodes&&0!==this.childNodes.size){const i=[...this.children()];for(let n=i.length-1;n>=0;n--){const s=i[n].pickNode(e,t);if(null!=s)return s}}else if(!this.isContainerNode)return this}pickNodes(e,t,i=[]){if(!this.visible||1===this.pointerEvents||!this.containsPoint(e,t))return i;this.isContainerNode||i.push(this);for(const n of this.children())n.pickNodes(e,t,i);return i}isDirty(e){const{width:t,height:i,devicePixelRatio:n}=e,{dirty:s,layer:a}=this,o=null!=a&&(this._lastWidth!==t||this._lastHeight!==i),r=this._lastDevicePixelRatio!==n;return this._lastWidth=t,this._lastHeight=i,this._lastDevicePixelRatio=n,s||o||r}preRender(e){let t;if(this.dirty){t=super.preRender(e,0);for(const i of this.children()){const n=i.preRender(e);t.groups+=n.groups,t.nonGroups+=n.nonGroups,t.complexity+=n.complexity}t.groups+=1,t.nonGroups-=1}else t=this.childNodeCounts;return this.useOffscreenCanvas&&!this.optimizeForInfrequentRedraws&&t.nonGroups>0&&this.getVisibility()?null==this.layer&&(this.layer=this.layerManager?.addLayer({name:this.name}),this.dirty||(this.dirty=null!=this.layer)):null!=this.layer&&(this.layerManager?.removeLayer(this.layer),this.layer=void 0),t}render(e){const{layer:t,useOffscreenCanvas:i}=this,n={...e},s=this.isDirty(e);if(this.dirty=!1,!i)return this.renderInContext(n),void super.render(n);const{ctx:a,stats:o,devicePixelRatio:r}=e;let{image:l}=this;if(s){l?.bitmap.close(),l=void 0;const e=t?void 0:this.computeSafeClippingBBox(r),i=(e,...t)=>{const i=e.context;i.direction=n.direction,n.ctx=i,n.currentFont=void 0,e.clear(),i.save();try{i.setTransform(...t),i.globalAlpha=1,this.renderInContext(n)}finally{i.restore(),i.verifyDepthZero?.()}};if(t)i(t,a.getTransform());else if(e){const{x:t,y:n,width:s,height:a}=e,o=Math.floor(s*r),h=Math.floor(a*r);if(o>0&&h>0){const e=this.prepareSharedCanvas(s,a,r);i(e,r,0,0,r,-t*r,-n*r),l={bitmap:e.transferToImageBitmap(),x:t,y:n,width:s,height:a}}}this.image=l,o&&o.layersRendered++}else o&&o.layersSkipped++;const{globalAlpha:h}=a;if(a.globalAlpha=h*this.opacity,t){a.save();try{a.resetTransform(),t.drawImage(a)}finally{a.restore()}}else if(l){const{bitmap:e,x:t,y:i,width:n,height:s}=l;a.drawImage(e,0,0,n*r,s*r,t,i,n,s)}a.globalAlpha=h,super.render(n)}applyClip(e,t){const{x:i,y:n,width:s,height:a}=t;e.beginPath(),e.rect(i,n,s,a),e.clip()}renderInContext(t){const{ctx:i,stats:n}=t;this.dirtyZIndex&&(this.sortChildren(e.compareChildren),this.dirtyZIndex=!1),i.save();try{i.globalAlpha*=this.opacity;const e=this.resolveChildFont();null!=e&&t.currentFont!==e&&(i.font=e,t.currentFont=e),null!=this.clipRect&&(this.applyClip(i,this.clipRect),t.clipBBox=Me.toCanvas(this,this.clipRect));for(const e of this.children())e.visible?e.isolatedRender(t):n&&(n.nodesSkipped+=e.childNodeCounts.nonGroups+e.childNodeCounts.groups,n.opsSkipped+=e.childNodeCounts.complexity)}
1finally{i.restore()}}sortChildren(e){if(!this.childNodes)return;const t=[...this.childNodes].sort(e);this.childNodes.clear();for(const e of t)this.childNodes.add(e)}*children(){yield*this.childNodes}*excludeChildren(e){for(const t of this.children())(e.instance&&!(t instanceof e.instance)||e.name&&t.name!==e.name)&&(yield t)}*descendants(){for(const t of this.children())yield t,t instanceof e&&(yield*t.descendants())}setClipRect(e){this.clipRect=e?Me.fromCanvas(this,e):void 0}setClipRectCanvasSpace(e){this.clipRect=e}getVisibility(){for(const e of this.traverseUp(!0))if(!e.visible)return!1;return!0}toSVG(){if(!this.visible)return;const e=[],t=[];for(const i of this.children()){const n=i.toSVG();null!=n&&(t.push(...n.elements),null!=n.defs&&e.push(...n.defs))}return{elements:t,defs:e}}};return e.className="Group",d([(0,n.k8u)({convertor:e=>(0,n.qE8)(0,e,1)})],e.prototype,"opacity",2),e})(),De=xe(ke),we=be(ke),Ie=fe(be(ke)),Ae=class{constructor(){this.stats=new Map,this.lastLogTime=Date.now(),this.LOG_INTERVAL_MS=1e4,this.startPeriodicLogging()}startPeriodicLogging(){n.yar.check("scene:stats","scene:stats:verbose")&&(this.stopPeriodicLogging(),this.intervalId=setInterval((()=>{this.logAccumulatedStats()}),this.LOG_INTERVAL_MS))}stopPeriodicLogging(){this.intervalId&&(clearInterval(this.intervalId),this.intervalId=void 0)}recordTiming(e,t){const i=this.stats.get(e);i?(i.min=Math.min(i.min,t),i.max=Math.max(i.max,t),i.sum+=t,i.count+=1):this.stats.set(e,{min:t,max:t,sum:t,count:1})}recordTimings(e){for(const[t,i]of Object.entries(e))"start"!==t&&"number"==typeof i&&this.recordTiming(t,i)}logAccumulatedStats(){if(0===this.stats.size)return;const e=(Date.now()-this.lastLogTime)/1e3,t=Array.from(this.stats.keys()).sort(((e,t)=>"â±ï¸"===e?-1:"â±ï¸"===t?1:e.localeCompare(t))),i=[];for(const e of t){const t=this.stats.get(e),n=t.sum/t.count;i.push(`${e}[${t.min.toFixed(1)}/${n.toFixed(1)}/${t.max.toFixed(1)}]ms`)}const s=this.stats.get("â±ï¸"),a=s?.count??0;n.tDR.log(`ð Stats (${e.toFixed(0)}s, ${a} renders): ${i.join(" ")}`),this.stats.clear(),this.lastLogTime=Date.now()}destroy(){this.stopPeriodicLogging(),this.stats.clear()}},Ce=0;function Ne(e){for(const t of["B","KB","MB","GB"]){if(e<1536)return`${e.toFixed(1)}${t}`;e/=1024}return`${e.toFixed(1)}TB}`}function Le(e,t,i,s,a={},o=m.zero,r){if(!n.yar.check("scene:stats","scene:stats:verbose"))return;const{layersRendered:l=0,layersSkipped:h=0,nodesRendered:c=0,nodesSkipped:d=0,opsPerformed:u=0,opsSkipped:p=0}=s??{},g=performance.now(),{start:y,...f}=t,x=g-y,b=(Se??(Se=new Ae),Se);b.recordTimings(f),b.recordTiming("â±ï¸",x);const v=Object.entries(f).map((([e,t])=>Re(e,t))).filter((e=>null!=e)).join(" + "),S=Object.entries(a).map((([e,t])=>`${e}: ${JSON.stringify(t)}`)).join(" ; "),M=n.yar.check("scene:stats:verbose"),k=M?function(){if(!("memory"in performance))return;const{totalJSHeapSize:e,usedJSHeapSize:t,jsHeapSizeLimit:i}=performance.memory,n=[];for(const s of[t,e,i])"number"==typeof s&&n.push(Ne(s));return`Heap ${n.join(" / ")}`}():null,D=M?n.Xjz.flush():{},w=Object.entries(D),I=[],A=[];for(const[e,t]of w)e.endsWith(":aggregation")&&Array.isArray(t)?I.push(`${e.replace(":aggregation","")}(${t.join(",")})`):e.endsWith(":nodeData")&&"number"==typeof t&&A.push(`${e.replace(":nodeData","")}(${t})`);const C=I.length>0?`Aggregation: ${I.join(", ")}`:null,N=A.length>0?`NodeData: ${A.join(", ")}`:null,L=[`${Re("â±ï¸",y,g)} (${v})`,`${S}`,C,N,`Layers: ${M?Oe(l,h):e.size}`,M?`Nodes: ${Oe(c,d)}`:null,M?`Ops: ${Oe(u,p)}`:null,k].filter(n.KgX),P=new n.Wa7(i),T=new Map(L.map((e=>[e,P.measureText(e)]))),O=Math.max(...Array.from(T.values(),(e=>e.width))),R=function(e,t){let i=0;for(const n of e)i+=t(n);return i}(T.values(),(e=>e.height)),E=2+o.x;i.save();try{i.fillStyle=r?.background??"white",i.fillRect(E,0,O,R),i.fillStyle=r?.foreground??"black";let e=0;for(const[t,n]of T.entries())e+=n.height,i.fillText(t,E,e)}catch(e){n.tDR.warnOnce("Error during debug stats rendering",e)}finally{i.restore()}}function Pe(e,t){if(!n.yar.check(!0,"scene"))return{};let i=0;return{node:"json"===t?e.serialize():e,name:e.name??e.id,dirty:e instanceof ke?e.dirty:void 0,...Array.from(e instanceof ke?e.children():[],(e=>({child:e,tree:Pe(e,t)}))).reduce(((e,{child:t,tree:n})=>{let{name:s}=n;const{props:a}=t.serialize(),{visible:o,translationX:r,translationY:l,rotation:h,scalingX:c,scalingY:d}=a,u="opacity"in a?a.opacity:1;(!o||u<=0)&&(s=`(${s})`),ke.is(t)&&t.renderToOffscreenCanvas&&(s=`*${s}*`);const{zIndex:p}=t,g=Array.isArray(p)?`(${p.join(", ")})`:p,m=[`${(i++).toString().padStart(3,"0")}|`,`${s??"<unknown>"}`,`z: ${g}`,r&&`x: ${r}`,l&&`y: ${l}`,h&&`r: ${h}`,null!=c&&1!==c&&`sx: ${c}`,null!=d&&1!==d&&`sy: ${d}`].filter((e=>!!e)).join(" ");let y=m,f=1;for(;null!=e[y]&&f<100;)y=`${m} (${f++})`;return e[y]=n,e}),{})}}function Te(e){const t=e instanceof ke?e.dirty:void 0;if(!t)return{dirtyTree:{},paths:[]};const i=Array.from(e instanceof ke?e.children():[],(e=>Te(e))).filter((e=>e.paths.length>0)),n=ke.is(e)?e.name??e.id:e.id,s=i.length?i.flatMap((e=>e.paths)).map((e=>`${n}.${e}`)):[n];return{dirtyTree:{name:n,node:e,dirty:t,...i.map((e=>e.dirtyTree)).filter((e=>null!=e.dirty)).reduce(((e,t)=>(e[t.name??"<unknown>"]=t,e)),{})},paths:s}}function Oe(e,t){const i=e+t;return`${e} / ${i} (${Math.round(100*e/i)}%)`}function Re(e,t,i){const n=null==i?t:i-t;return`${e}: ${Math.round(100*n)/100}ms`}function Ee(e=!1){Se?!e&&Ce>0||(Se.destroy(),Se=void 0,e&&(Ce=0)):e&&(Ce=0)}
1var ze=class extends Error{constructor(e,t,i){super(e,i),this.source=t}};function Be(e){if(e instanceof ze)throw e}var Fe=class{constructor(){this.available=!0,this.acquireQueue=[]}acquire(e){return new Promise(((t,i)=>{this.acquireQueue.push([e,t,i]),this.available&&this.dispatchNext().catch(i)}))}async acquireImmediately(e){return!!this.available&&(await this.acquire(e),!0)}async waitForClearAcquireQueue(){return this.acquire((()=>Promise.resolve(void 0)))}async dispatchNext(){this.available=!1;let[e,t,i]=this.acquireQueue.shift()??[];for(;e;){try{await e(),t?.()}catch(e){i?.(e)}[e,t,i]=this.acquireQueue.shift()??[]}this.available=!0}};function Ve(e){return $e((function(e,t=0){if(0!==t)return setTimeout(e,t);queueMicrotask(e)}),e,(function(e){clearTimeout(e)}))}function $e(e,t,i){let n,s,a,o=0,r=!1;function l(){return r}function h(){r=!1,a=void 0,s?.(),s=void 0,n=void 0,o>0&&(a=e(c))}function c(){const e=o;o=0,r=!0;const i=t({count:e});i?i.then(h,h):h()}function d(e){s=e}return{schedule:function(t){0!==o||l()||(a=e(c,t)),o++},cancel:function(){null!=a&&i&&(i(a),a=void 0,o=0)},waitForCompletion:async function(){if(l())for(n??(n=new Promise(d));l();)await n}}}var He=(e,{x0:t,y0:i,x1:n,y1:s,cx:a,cy:o},r,l)=>{if(l&&e.moveTo(t,i),t!==n||i!==s){const l=Math.atan2(i-o,t-a),h=Math.atan2(s-o,n-a);e.arc(a,o,r,l,h)}else e.lineTo(t,i)},je=(()=>{var e=class extends ce{constructor(){super(...arguments),this._clipX=Number.NaN,this._clipY=Number.NaN,this.clip=!1,this._dirtyPath=!0,this.lastPixelRatio=Number.NaN}get path(){return this._path??(this._path=new se),this._path}set path(e){this._path=e}set clipX(e){this._clipX=e,this.dirtyPath=!0}set clipY(e){this._clipY=e,this.dirtyPath=!0}get serializedType(){return"path"}serialize(){return{type:this.serializedType,props:this.serializeProps(),svgPath:this.serializeSvgPath()}}serializeProps(){const e=this.getBBox();return{...super.serializeProps(),x:e?.x??Number.NaN,y:e?.y??Number.NaN,width:e?.width??Number.NaN,height:e?.height??Number.NaN,clip:this.clip,clipX:this._clipX,clipY:this._clipY}}serializeSvgPath(){return this._path?.toSVG()}set dirtyPath(e){this._dirtyPath!==e&&(this._dirtyPath=e,e&&this.markDirty("path"))}get dirtyPath(){return this._dirtyPath}checkPathDirty(){this._dirtyPath||(this.dirtyPath=this.path.isDirty()||(this.fillShadow?.isDirty()??!1)||(this._clipPath?.isDirty()??!1))}resetPathDirty(){this.path.clear(!0),this._dirtyPath=!1}isPathDirty(){return this.path.isDirty()}onChangeDetection(e){this._dirtyPath=!0,super.onChangeDetection(e)}computeBBox(){return this.updatePathIfDirty(),this.path.computeBBox()}isPointInPath(e,t){return this.updatePathIfDirty(),this.path.closedPath&&this.path.isPointInPath(e,t)}distanceSquared(e,t){return this.distanceSquaredTransformedPoint(e,t)}svgPathData(e){return this.updatePathIfDirty(),this.path.toSVG(e)}distanceSquaredTransformedPoint(e,t){return this.updatePathIfDirty(),this.path.closedPath&&this.path.isPointInPath(e,t)?0:this.path.distanceSquared(e,t)}isDirtyPath(){return!1}updatePath(){}updatePathIfDirty(){(this.dirtyPath||this.isDirtyPath())&&(this.updatePath(),this.dirtyPath=!1)}preRender(e){return e.devicePixelRatio!==this.lastPixelRatio&&(this.dirtyPath=!0),this.lastPixelRatio=e.devicePixelRatio,this.updatePathIfDirty(),super.preRender(e,this.pathComplexity())}pathComplexity(){return this.path.commands.length}render(e){const{ctx:t}=e;if(!this.clip||Number.isNaN(this._clipX)||Number.isNaN(this._clipY))this._clipPath=void 0,this.drawPath(t,e.logger);else{t.save();try{const i=this.strokeWidth/2;
1this._clipPath??(this._clipPath=new se),this._clipPath.clear(),this._clipPath.rect(-i,-i,this._clipX+i,this._clipY+i+i),t.clip(this._clipPath?.getPath2D()),this._clipX>0&&this._clipY>0&&this.drawPath(t,e.logger)}finally{t.restore()}}this.fillShadow?.markClean(),super.render(e)}drawPath(e,t){this.fillStroke(e,t,this.path.getPath2D())}toSVG(){if(!this.visible)return;const e=(0,n.FJ6)("path");e.setAttribute("d",this.svgPathData());const t=this.applySvgFillAttributes(e,[]);return this.applySvgStrokeAttributes(e),{elements:[e],defs:t}}};return e.className="Path",d([(0,n.k8u)()],e.prototype,"clip",2),d([(0,n.k8u)()],e.prototype,"clipX",1),d([(0,n.k8u)()],e.prototype,"clipY",1),e})();function We(e,t,i,s,a){let o=!1,r=!1,l=s-Math.sqrt(Math.max(a**2-i**2,0)),h=0,c=0,d=i-Math.sqrt(Math.max(a**2-s**2,0));return l>e?(o=!0,l=e,h=i-Math.sqrt(Math.max(a**2-(s-e)**2))):(0,n.YXt)(l,0)&&(l=0),d>t?(r=!0,c=s-Math.sqrt(Math.max(a**2-(i-t)**2)),d=t):(0,n.YXt)(d,0)&&(d=0),{leading0:l,leading1:h,trailing0:c,trailing1:d,leadingClipped:o,trailingClipped:r}}function _e(e,t,i,n,s,a,o){let{topLeft:r,topRight:l,bottomRight:h,bottomLeft:c}=a;const d=Math.max(r+c,l+h),u=Math.max(r+l,c+h);if(d<=0&&u<=0){if(null==o)e.rect(t,i,n,s);else{const a=Math.max(t,o.x),r=Math.min(t+n,o.x+o.width),l=Math.max(i,o.y),h=Math.min(i+s,o.y+o.height);e.rect(a,l,r-a,h-l)}return}if(null==o&&r===l&&r===h&&r===c)return void e.roundRect(t,i,n,s,r);if(n<0&&(t+=n,n=Math.abs(n)),s<0&&(i+=s,s=Math.abs(s)),n<=0||s<=0)return;if(null==o)o=new m(t,i,n,s);else{const e=Math.max(t,o.x),a=Math.min(t+n,o.x+o.width),r=Math.max(i,o.y),l=Math.min(i+s,o.y+o.height);o=new m(e,r,a-e,l-r)}const p=Math.max(d/s,u/n,1);p>1&&(r/=p,l/=p,h/=p,c/=p);let g,y,f,x,b=!0,v=!0,S=!0,M=!0;if(b){const e=We(o.height,o.width,Math.max(t+r-o.x,0),Math.max(i+r-o.y,0),r);e.leadingClipped&&(M=!1),e.trailingClipped&&(v=!1);g={x0:Math.max(o.x+e.leading1,o.x),y0:Math.max(o.y+e.leading0,o.y),x1:Math.max(o.x+e.trailing1,o.x),y1:Math.max(o.y+e.trailing0,o.y),cx:t+r,cy:i+r}}if(v){const e=We(o.width,o.height,Math.max(i+l-o.y,0),Math.max(o.x+o.width-(t+n-l),0),l);e.leadingClipped&&(b=!1),e.trailingClipped&&(S=!1);y={x0:Math.min(o.x+o.width-e.leading0,o.x+o.width),y0:Math.max(o.y+e.leading1,o.y),x1:Math.min(o.x+o.width-e.trailing0,o.x+o.width),y1:Math.max(o.y+e.trailing1,o.y),cx:t+n-l,cy:i+l}}if(S){const e=We(o.height,o.width,Math.max(o.x+o.width-(t+n-h),0),Math.max(o.y+o.height-(i+s-h),0),h);e.leadingClipped&&(v=!1),e.trailingClipped&&(M=!1);f={x0:Math.min(o.x+o.width-e.leading1,o.x+o.width),y0:Math.min(o.y+o.height-e.leading0,o.y+o.height),x1:Math.min(o.x+o.width-e.trailing1,o.x+o.width),y1:Math.min(o.y+o.height-e.trailing0,o.y+o.height),cx:t+n-h,cy:i+s-h}}if(M){const e=We(o.width,o.height,Math.max(o.y+o.height-(i+s-c),0),Math.max(t+c-o.x,0),c);e.leadingClipped&&(S=!1),e.trailingClipped&&(b=!1);x={x0:Math.max(o.x+e.leading0,o.x),y0:Math.min(o.y+o.height-e.leading1,o.y+o.height),x1:Math.max(o.x+e.trailing0,o.x),y1:Math.min(o.y+o.height-e.trailing1,o.y+o.height),cx:t+c,cy:i+s-c}}let k=!1;b&&null!=g&&(He(e,g,r,!k),k||(k=!0)),v&&null!=y&&(He(e,y,l,!k),k||(k=!0)),S&&null!=f&&(He(e,f,h,!k),k||(k=!0)),M&&null!=x&&He(e,x,c,!k),e.closePath()}var Ge=(()=>{var e=class extends je{constructor(){super(...arguments),this.borderPath=new se,this.x=0,this.y=0,this.width=10,this.height=10,this.topLeftCornerRadius=0,this.topRightCornerRadius=0,this.bottomRightCornerRadius=0,this.bottomLeftCornerRadius=0,this.clipBBox=void 0,this.crisp=!1,this.crispCentreDirection=void 0,this.crispCentreScratch={start:0,length:0},this.lastUpdatePathStrokeWidth=this.__strokeWidth,this.effectiveStrokeWidth=this.__strokeWidth,this.hittester=super.isPointInPath.bind(this),this.distanceCalculator=super.distanceSquaredTransformedPoint.bind(this),this.microPixelEffectOpacity=1}serialize(){return{type:"rect",props:this.serializeProps(),svgPath:this.serializeSvgPath()}}serializeProps(){const{x:e,y:t,width:i,height:n,clipBBox:s}=this,a={...super.serializeProps(),x:e,y:t,width:i,height:n};return null!=s&&(a.clipX0=s.x,a.clipY0=s.y,a.clipX1=s.x+s.width,a.clipY1=s.y+s.height),a}set cornerRadius(e){this.topLeftCornerRadius=e,this.topRightCornerRadius=e,this.bottomRightCornerRadius=e,this.bottomLeftCornerRadius=e}isDirtyPath(){return this.lastUpdatePathStrokeWidth!==this.__strokeWidth||Boolean(this.path.isDirty()||this.borderPath.isDirty())}updatePath(){const{path:e,borderPath:t,__crisp:i,__topLeftCornerRadius:n,__topRightCornerRadius:s,__bottomRightCornerRadius:a,__bottomLeftCornerRadius:o}=this;let{__x:r,__y:l,__width:h,__height:c,__strokeWidth:d,__clipBBox:u}=this;const p=1/(this.layerManager?.canvas.pixelRatio??1);let g=1;if(e.clear(),t.clear(),0===h||0===c)return this.effectiveStrokeWidth=0,this.lastUpdatePathStrokeWidth=0,void(this.microPixelEffectOpacity=0);if(i){h<=p&&(g*=h/p),c<=p&&(g*=c/p);const e=this.__crispCentreDirection;if("x"===e?({start:r,length:h}=this.alignCentre(r,h,this.crispCentreScratch)):(h=this.align(r,h),r=this.align(r)),"
1y"===e?({start:l,length:c}=this.alignCentre(l,c,this.crispCentreScratch)):(c=this.align(l,c),l=this.align(l)),null==u)u=void 0;else if("x"===e){const{start:e,length:t}=this.alignCentre(u.x,u.width,this.crispCentreScratch);u=new m(e,this.align(u.y),t,this.align(u.y,u.height))}else if("y"===e){const{start:e,length:t}=this.alignCentre(u.y,u.height,this.crispCentreScratch);u=new m(this.align(u.x),e,this.align(u.x,u.width),t)}else u=new m(this.align(u.x),this.align(u.y),this.align(u.x,u.width),this.align(u.y,u.height))}if(d)if(h<p){const e=r+p/2;t.moveTo(e,l),t.lineTo(e,l+c),d=p,this.borderClipPath=void 0}else if(c<p){const e=l+p/2;t.moveTo(r,e),t.lineTo(r+h,e),d=p,this.borderClipPath=void 0}else if(d<h&&d<c){const i=d/2;r+=i,l+=i,h-=d,c-=d;const p=u?.clone().shrink(i),g={topLeft:n>0?n-d:0,topRight:s>0?s-d:0,bottomRight:a>0?a-d:0,bottomLeft:o>0?o-d:0};this.borderClipPath=void 0,h>0&&c>0&&(null==p||p?.width>0&&p?.height>0)&&(_e(e,r,l,h,c,g,p),_e(t,r,l,h,c,g,p))}else this.borderClipPath=this.borderClipPath??new se,this.borderClipPath.clear(),this.borderClipPath.rect(r,l,h,c),t.rect(r,l,h,c);else{const t={topLeft:n,topRight:s,bottomRight:a,bottomLeft:o};this.borderClipPath=void 0,_e(e,r,l,h,c,t,u)}if([n,s,a,o].every(Ke)){let e=function(e,t){return i.getBBox().distanceSquared(e,t)};const t=this.getBBox();this.hittester=t.containsPoint.bind(t);const i=this;this.distanceSquared=e}else this.hittester=super.isPointInPath,this.distanceCalculator=super.distanceSquaredTransformedPoint;this.effectiveStrokeWidth=d,this.lastUpdatePathStrokeWidth=d,this.microPixelEffectOpacity=g}computeBBox(){const{__x:e,__y:t,__width:i,__height:n,__clipBBox:s}=this;return s?.clone()??new m(e,t,i,n)}isPointInPath(e,t){return this.hittester(e,t)}get midPoint(){return{x:this.__x+this.__width/2,y:this.__y+this.__height/2}}setStaticProperties(e,t,i,n,s,a,o,r){this.__drawingMode=e,this.__topLeftCornerRadius=t,this.__topRightCornerRadius=i,this.__bottomRightCornerRadius=n,this.__bottomLeftCornerRadius=s,this.__visible=a,this.__crisp=o,this.__fillShadow=r,this.dirtyPath=!0,this.markDirty()}resetAnimationProperties(e,t,i,n,s,a){this.__x=e,this.__y=t,this.__width=i,this.__height=n,this.__opacity=s,this.__clipBBox=a,this.dirtyPath=!0,this.markDirty()}distanceSquared(e,t){return this.distanceCalculator(e,t)}applyFillAndAlpha(e,t,i,n){super.applyFillAndAlpha(e,t,i,n),e.globalAlpha*=this.microPixelEffectOpacity}applyStrokeAndAlpha(e){super.applyStrokeAndAlpha(e),e.globalAlpha*=this.microPixelEffectOpacity}renderStroke(e){const{stroke:t,effectiveStrokeWidth:i}=this;if(t&&i){const{globalAlpha:t}=e,{lineDash:n,lineDashOffset:s,lineCap:a,lineJoin:o,borderPath:r,borderClipPath:l}=this;l&&e.clip(l.getPath2D()),this.applyStrokeAndAlpha(e),e.lineWidth=i,n&&e.setLineDash(n),s&&(e.lineDashOffset=s),a&&(e.lineCap=a),o&&(e.lineJoin=o),e.stroke(r.getPath2D()),e.globalAlpha=t}}};return e.className="Rect",d([(0,n.M7D)()],e.prototype,"x",2),d([(0,n.M7D)()],e.prototype,"y",2),d([(0,n.M7D)()],e.prototype,"width",2),d([(0,n.M7D)()],e.prototype,"height",2),d([(0,n.M7D)()],e.prototype,"topLeftCornerRadius",2),d([(0,n.M7D)()],e.prototype,"topRightCornerRadius",2),d([(0,n.M7D)()],e.prototype,"bottomRightCornerRadius",2),d([(0,n.M7D)()],e.prototype,"bottomLeftCornerRadius",2),d([(0,n.M7D)({equals:n.ca$})],e.prototype,"clipBBox",2),d([(0,n.M7D)()],e.prototype,"crisp",2),d([(0,n.M7D)()],e.prototype,"crispCentreDirection",2),e})();function Ke(e){return 0===e}var Ye=(()=>{var e=class extends P{constructor(){super(...arguments),this.x=0,this.y=0,this.boxWidth=0,this.boxHeight=0,this.imageWidth=0,this.imageHeight=0,this.paddingTop=0,this.paddingRight=0,this.paddingBottom=0,this.paddingLeft=0,this.cornerRadius=0,this.opacity=1,this.url=""}setScene(e){null==e&&this.registeredLoader&&(this.registeredLoader.unregisterNode(this),this.registeredLoader=void 0),super.setScene(e)}destroy(){this.registeredLoader&&(this.registeredLoader.unregisterNode(this),this.registeredLoader=void 0),super.destroy()}render(e){const{ctx:t}=e,{x:i,y:n,boxWidth:s,boxHeight:a,cornerRadius:o,opacity:r}=this;if(s<=0||a<=0)return void super.render(e);const l=t.globalAlpha;if(t.globalAlpha=l*r,this.backgroundFill&&(this.tracePath(t,i,n,s,a,o),t.fillStyle=this.backgroundFill,t.fill()),this.url){const e=this.imageLoader;e!==this.registeredLoader&&(this.registeredLoader?.unregisterNode(this),this.registeredLoader=e);const r=e?.loadImage(this.url,this,{width:this.imageWidth,height:this.imageHeight});if(r){const e=i+this.paddingLeft,l=n+this.paddingTop,h=o>0;h&&(t.save(),this.tracePath(t,i,n,s,a,o),t.clip()),t.drawImage(r,e,l,this.imageWidth,this.imageHeight),h&&t.restore(
1)}}else e.logger.warnOnce(`Image segment has an empty url; rendering background only (${s}x${a} box).`);t.globalAlpha=l,super.render(e)}tracePath(e,t,i,n,s,a){e.beginPath();const o=Math.max(0,Math.min(a,n/2,s/2));0!==o?(e.moveTo(t+o,i),e.arcTo(t+n,i,t+n,i+s,o),e.arcTo(t+n,i+s,t,i+s,o),e.arcTo(t,i+s,t,i,o),e.arcTo(t,i,t+n,i,o),e.closePath()):e.rect(t,i,n,s)}computeBBox(){return new m(this.x,this.y,this.boxWidth,this.boxHeight)}};return d([(0,n.k8u)()],e.prototype,"x",2),d([(0,n.k8u)()],e.prototype,"y",2),d([(0,n.k8u)()],e.prototype,"boxWidth",2),d([(0,n.k8u)()],e.prototype,"boxHeight",2),d([(0,n.k8u)()],e.prototype,"imageWidth",2),d([(0,n.k8u)()],e.prototype,"imageHeight",2),d([(0,n.k8u)()],e.prototype,"paddingTop",2),d([(0,n.k8u)()],e.prototype,"paddingRight",2),d([(0,n.k8u)()],e.prototype,"paddingBottom",2),d([(0,n.k8u)()],e.prototype,"paddingLeft",2),d([(0,n.k8u)()],e.prototype,"cornerRadius",2),d([(0,n.k8u)()],e.prototype,"opacity",2),e})(),Ue=(()=>{var e=class e extends ce{constructor(t){super(t),this.generatingTextMap=!1,this.suppressedDirtyDuringGenerate=!1,this.x=0,this.y=0,this.lines=[],this.text=void 0,this.fontCache=void 0,this.fontSize=e.defaultFontSize,this.fontFamily="sans-serif",this.textAlign="start",this.textBaseline="alphabetic",this.boxPadding=0,this.trimText=t?.trimText??!0}serialize(){return{type:"text",props:this.serializeProps()}}serializeProps(){return{...super.serializeProps(),x:this.x,y:this.y,text:null==this.text?void 0:String(this.text)}}onTextChange(){if(this.richText?.clear(),this.textMap?.clear(),this.segmentMetrics=void 0,this.directed=void 0,(0,n.cyL)(this.text)){this.lines=[],this.richText??(this.richText=new ke),this.richText.parentNode=this,this.richText.setScene(this.scene);const t=[];for(const i of this.text)if("image"===i.type)t.push(new Ye);else for(const s of(0,n.i$)(i.text).split(n.g3U))s&&t.push(new e({trimText:!1}));this.richText.append(t)}else{this.richText&&(this.richText.parentNode=void 0,this.richText.setScene(),this.richText=void 0);const e=(0,n.i$)(this.text).split(n.g3U);this.lines=this.trimText?e.map((e=>e.trim())):e}}get font(){return this.fontCache??(this.fontCache=(0,n.q2v)(this)),this.fontCache}resolveFont(){if(this.hasRenderableText())return this.font}static measureBBox(t,i,s,a){if((0,n.cyL)(t)){const{font:o,lineHeight:r,textAlign:l,textBaseline:h}=a,{width:c,height:d,lineMetrics:u}=(0,n.wEO)(t,o),p=r?r*u.length:d,g=e.calcTopOffset(p,u[0],h),y=e.calcLeftOffset(c,l);return new m(i-y,s-g,c,p)}return e.computeBBox((0,n.i$)(t).split(n.g3U),i,s,a)}static computeBBox(t,i,s,a){const{font:o,lineHeight:r,textAlign:l,textBaseline:h,isRtl:c}=a,{width:d,height:u,lineMetrics:p}=(0,n.K$y)(o).measureLines(t),g=r?r*p.length:u,y=e.calcTopOffset(g,p[0],h),f=e.calcLeftOffset(d,l,c);return new m(i-f,s-y,d,g)}static calcTopOffset(e,t,i){switch(i){case"alphabetic":return t?.ascent??0;case"middle":return e/2;case"bottom":return e;default:return 0}}static calcSegmentedTopOffset(e,t,i){switch(i){case"alphabetic":return t[0]?.ascent??0;case"middle":{const i=t[0];return 1===t.length&&i.segments.length>0&&!i.blockImages?.length&&i.segments.every((e=>"image"!==e.type))?i.ascent+i.segments.reduce(((e,t)=>"image"===t.type?e:Math.min(e,(0,n.K$y)(t).baselineDistance("middle"))),0):e/2}case"bottom":return e;default:return 0}}static calcLeftOffset(e,t,i){switch(t&&(0,n.vDS)(t,i)){case"center":return.5*e;case"right":return e;default:return 0}}computeBBox(){return this.computeTextBBox()}computeTextBBox(){if(!this.hasRenderableText())return new m(this.x,this.y,0,0);if(this.generateTextMap(),this.textMap?.size&&(0,n.cyL)(this.text)){const t=m.merge(this.textMap.values()),{height:i,lineMetrics:n}=this.getSegmentMetrics(this.text);return t.x=this.x-e.calcLeftOffset(t.width,this.textAlign,this.scene?.isRtl),t.y=this.y-e.calcSegmentedTopOffset(i,n,this.textBaseline),null!=this.boxing&&t.grow(this.boxPadding),t}const t=this.scene?.isRtl,{x:i,y:s,lines:a,textBaseline:o,textAlign:r}=this,l=e.computeBBox(a,i,s,{font:this,textBaseline:o,textAlign:r,isRtl:t});return null!=this.boxing&&l.grow(this.boxPadding),l}getTextMeasureBBox(){return this.computeTextBBox()}getLineBoxes(){const t=this.getBBox(),{lineMetrics:i}
1=(0,n.cyL)(this.text)?this.getSegmentMetrics(this.text):(0,n.K$y)(this).measureLines(this.lines);if(i.length<=1)return[t];const s=null==this.boxing?void 0:(0,n.Q1u)(this.boxPadding),a=this.scene?.isRtl,o=i.length-1;let r=t.y+(s?.top??0);return i.map(((t,i)=>{const n=new m(this.x-e.calcLeftOffset(t.width,this.textAlign,a),r,t.width,t.height);return r+=t.height,null!=s&&n.grow({left:s.left,right:s.right,top:0===i?s.top:0,bottom:i===o?s.bottom:0}),n}))}getPlainText(){return(0,n.boc)(this.text)}isPointInPath(e,t){return this.getBBox()?.containsPoint(e,t)??!1}setScene(e){this.richText?.setScene(e),super.setScene(e)}generateTextMap(){if((0,n.cyL)(this.text)&&!this.textMap?.size){this.textMap??(this.textMap=new Map),this.generatingTextMap=!0,this.suppressedDirtyDuringGenerate=!1;try{this.buildTextMap(this.text)}finally{this.generatingTextMap=!1,this.suppressedDirtyDuringGenerate&&(this.suppressedDirtyDuringGenerate=!1,super.markDirty())}}}getSegmentMetrics(e){return this.segmentMetrics??(this.segmentMetrics=(0,n.wEO)(e,this)),this.segmentMetrics}buildTextMap(e){const t=this.richText.children(),{width:i,lineMetrics:n}=this.getSegmentMetrics(e),s=this.x-i/2;let a=0;for(let e=0;e<n.length;){const i=n[e];if(i.blockImages?.length){const o=i.blockRowSpan??1,r=this.layoutBlockRow(n,e,o,a,s,t);if(null==r)return;a=r,e+=o}else a=this.renderLine(i,this.x-i.width/2,a,t),e+=1}}layoutBlockRow(t,i,s,a,o,r){const l=t[i].blockImages,h=(0,n.UhS)(l),c=(0,n.RlK)(l);let d=0;for(let e=0;e<s;e++)d+=t[i+e].height;const u=Math.max(c,d);let p=o;for(let t=0;t<l.length;t++){const i=l[t],s=i.textMetrics,o=(0,n.amv)(i.verticalAlign)??"middle",h=e.calcAnchoredOffset(o,u,s.height),c=r.next().value;if(!c)return this.abandonTextMap(),null;e.applyImageSegment(c,i,p,a+h),this.textMap.set(c,c.getBBox()),p+=s.width+(t<l.length-1?n.Ob_:0)}const g=e.findFirstTextSegment(t,i,s),m=o+h+n.Ob_;let y=a+e.calcAnchoredOffset((0,n.amv)(g?.verticalAlign)??"alphabetic",u,d);for(let e=0;e<s;e++)y=this.renderLine(t[i+e],m,y,r);return a+u}static findFirstTextSegment(e,t,i){for(let n=0;n<i;n++){const i=e[t+n].segments.find((e=>"image"!==e.type));if(i)return i}}renderLine(t,i,s,a){const{height:o,ascent:r,textAscent:l,textDescent:h,segments:c}=t,d=s+r;let u=0;for(const t of c){const c=a.next().value;if(!c)return this.abandonTextMap(),s+o;if("image"===t.type){const s=t.textMetrics.width,a=t.textMetrics.height,{above:o}=(0,n.Bcy)((0,n.amv)(t.verticalAlign),a,l,h),r=c;e.applyImageSegment(r,t,i+u,d-o),this.textMap.set(r,r.getBBox()),u+=s;continue}const{color:p,textMetrics:g,verticalAlign:m,...y}=t,f=c,x=(0,n.amv)(m)??"alphabetic";f.x=i+u,f.y=e.calcSegmentY(x,s,r,o),f.setProperties({...y,textBaseline:x,fill:p??this.fill});const b=f.getBBox();this.textMap.set(f,b),u+=g.width}return s+o}abandonTextMap(){this.textMap?.clear(),this.segmentMetrics=void 0}static calcAnchoredOffset(e,t,i){const n=Math.max(0,t-i);switch(e){case"middle":return n/2;case"bottom":case"ideographic":case"alphabetic":return n;default:return 0}}static applyImageSegment(e,t,i,s){const{top:a,right:o,bottom:r,left:l}=(0,n.Q1u)(t.padding);e.x=i,e.y=s,e.boxWidth=t.textMetrics.width,e.boxHeight=t.textMetrics.height,e.imageWidth=t.width,e.imageHeight=t.height,e.paddingTop=a,e.paddingRight=o,e.paddingBottom=r,e.paddingLeft=l,e.cornerRadius=t.cornerRadius??0,e.backgroundFill=t.backgroundFill,e.url=t.url}static calcSegmentY(e,t,i,n){switch(e){case"top":case"hanging":return t;case"middle":return t+n/2;case"bottom":case"ideographic":return t+n;default:return t+i}}render(t){const{ctx:i,stats:s}=t;if(this.layerManager&&this.hasRenderableText()){if((0,n.cyL)(this.text)&&this.richText){this.generateTextMap();const s=this.richText.getBBox(),{width:a,height:o,lineMetrics:r}=this.getSegmentMetrics(this.text);let l=0;switch((0,n.vDS)(this.textAlign,"rtl"===t.direction)){case"left":l=a/2;break;case"right":l=a/-2}const h=this.y-e.calcSegmentedTopOffset(o,r,this.textBaseline);this.renderBoxing(t,s.clone().translate(l,h)),i.save(),i.translate(l,h),this.richText.opacity=this.opacity,this.richText.render(t),i.restore()}else this.renderText(t);if(e.debug.check()){const e=this.getBBox();i.lineWidth=this.textMap?.size?2:1,i.strokeStyle=this.textMap?.size?"blue":"red",i.strokeRect(e.x,e.y,e.width,e.height)}super.render(t)}else s&&(s.nodesSkipped+=1)}markDirty(e){if(!this.generatingTextMap)return this.textMap?.clear(),this.segmentMetrics=void 0,super.markDirty(e);this.suppressedDirtyDuringGenerate=!0}resolveDirected(){return this.directed??(this.directed=this.lines.every(n.bTN)?{direction:"ltr",lines:this.lines}:{direction:"rtl",lines:this.lines.map(n.Un7)}),this.directed}renderText(e){const{fill:t,stroke:i,strokeWidth:s,font:a,textAlign:o}=this;if(!((t||i&&s)&&this.layerManager))return super.render(e);const{ctx:r}=e;e.currentFont!==a&&(r.font=a,e.currentFont=a);const l="rtl"===e.direction,h=l?this.resolveDirected().direction:"ltr";r.direction!==h&&(r.direction=h),r.textAlign=(0,n.vDS)(o,l),this.renderBoxing(e),this.fillStroke(r,e.logger)}renderBoxing(t,i){if(!this.boxing)return;const n=i??e.computeBBox(this.lines,this.x,this.y,{font:this,lineHeight:this.lineHeight,textAlign:this.textAlign,textBaseline:this.textBaseline,isRtl:"rtl"===t.direction});if(0===n.width||0===n.height)return;const{x:s,y:a,width:o,height:r}=n.grow(this.boxPadding);this.boxing.opacity=this.opacity,this.boxing.x=s,this.boxing.y=a,this.boxing.width=o,this.boxing.height=r,this.boxing.preRender(t),this.boxing.render(t)}executeFill(e){this.renderLines(((t,i,n)=>e.fillText(t,i,n)))}executeStroke(e){this.renderLines(((t,i,n)=>e.strokeText(t,i,n)))}renderLines(e){const{x:t,y:i,lines:s}=this;if(!Number.isFinite(t)||!Number.isFinite(i))return;const a=(0,n.K$y)(this),{lineMetrics:o}=a.measureLines(s),{textBaseline:r,lineHeight:l=a.lineHeight()}=this;let h=0;"top"===r?h=o[0].ascent:"middle"!==r&&"bottom"!==r||(h=l*(1-s.length),"middle"===r?(h/=2,h-=a.baselineDistance(r)):h-=o[0].descent);const c=this.resolveDirected().lines;for(let n=0;n<o.length;n+=1)e(c?.[n]??o[n].text,t,i+h),h+=l}setFont(e){this.fontFamily=e.fontFamily,this.fontSize=e.fontSize,this.fontStyle=e.fontStyle,this.fontWeight=e.fontWeight}setAlign(e){this.textAlign=e.textAlign,this.textBaseline=e.textBaseline}setBoxing(e){const t=e.border?.enabled?e.border?.stroke:void 0;
1null!=e.fill||null!=t?(this.boxing??(this.boxing=new Ge({scene:this.scene})),this.boxing.fill=e.fill,this.boxing.fillOpacity=e.fillOpacity??1,this.boxing.cornerRadius=e.cornerRadius??0,this.boxing.stroke=t,this.boxing.strokeWidth=e.border?.strokeWidth??0,this.boxing.strokeOpacity=e.border?.strokeOpacity??1,this.boxPadding=e.padding??0):this.boxing&&(this.boxing.destroy(),this.boxing=void 0)}hasBoxing(){return null!=this.boxing}getBoxingProperties(){const{fill:e,fillOpacity:t,cornerRadius:i,stroke:n,strokeWidth:s,strokeOpacity:a}=this.boxing??{};return{border:{enabled:null!=n,stroke:n,strokeWidth:s,strokeOpacity:a},cornerRadius:i,fill:e,fillOpacity:t,padding:this.boxPadding}}toSVG(){if(!this.visible||!this.hasRenderableText())return;const e=this.text;if(null==e)return;const t=(0,n.FJ6)("text");if((0,n.cyL)(e))for(const i of e){if("image"===i.type){n.tDR.warnOnce("SVG export drops inline image segments; text content is preserved.");continue}const e=(0,n.FJ6)("tspan");le(e,{fontSize:i.fontSize??this.fontSize,fontFamily:i.fontFamily??this.fontFamily,fontWeight:i.fontWeight??this.fontWeight,fontStyle:i.fontStyle??this.fontStyle}),this.applySvgFillAttributes(e),e.textContent=(0,n.i$)(i.text),t.append(e)}else this.applySvgFillAttributes(t),le(t,this),t.setAttribute("text-anchor",{center:"middle",left:"start",right:"end",start:"start",end:"end"}[this.textAlign??"start"]),t.setAttribute("alignment-baseline",this.textBaseline),t.setAttribute("x",String(this.x)),t.setAttribute("y",String(this.y)),t.textContent=(0,n.i$)(e);return{elements:[t]}}hasRenderableText(){const{text:e}=this;return null!=e&&((0,n.cyL)(e)?e.length>0:""!==(0,n.i$)(e))}};return e.className="Text",e.debug=n.yar.create(!0,"scene:text"),e.defaultFontSize=10,d([(0,n.k8u)()],e.prototype,"x",2),d([(0,n.k8u)()],e.prototype,"y",2),d([(0,n.$aV)({changeCb:e=>e.onTextChange()})],e.prototype,"text",2),d([(0,n.k8u)({changeCb:e=>{e.fontCache=void 0}})],e.prototype,"fontStyle",2),d([(0,n.k8u)({changeCb:e=>{e.fontCache=void 0}})],e.prototype,"fontWeight",2),d([(0,n.k8u)({changeCb:e=>{e.fontCache=void 0}})],e.prototype,"fontSize",2),d([(0,n.k8u)({changeCb:e=>{e.fontCache=void 0}})],e.prototype,"fontFamily",2),d([(0,n.k8u)()],e.prototype,"textAlign",2),d([(0,n.k8u)()],e.prototype,"textBaseline",2),d([(0,n.k8u)()],e.prototype,"lineHeight",2),e})(),Xe=fe(Ue),Ze=fe(be(Ue)),qe=class extends n.UbG{constructor(e){super(),this.ctx=e,this.rectNode=new Ge,this.textNode=new Ue,this.node=this.createNode(),this.node.append([this.rectNode,this.textNode]),this.cleanup.register(e.scene.attachNode(this.node),e.eventsHub.on("layout:complete",(e=>this.onLayoutComplete(e))))}applyOptions(){const e=this.ctx.chartState.getValue("options","background");this.node.visible=e.visible,this.rectNode.fill=e.fill}createNode(){return new ke({name:"background",zIndex:n.Dcv.CHART_BACKGROUND})}onLayoutComplete(e){this.applyOptions();const{width:t,height:i}=e.chart;this.rectNode.width=t,this.rectNode.height=i}},Qe=class extends Array{destroy(){for(const e of this)e.destroy();this.length=0}findById(e){return this.find((t=>t.id===e))}matches(e){return this.length===Object.keys(e).length&&(0,n.Si_)(e,((e,t)=>(0,n.Gvm)(t)&&"type"in t&&this.findById(e)?.type===t.type))}getById(e){const t=this.findById(e);if(!t)throw new Error(`Could not find axis by id [${e}].`);return t}},Je=class extends Qe{get[n.tv$.X](){return this.getById(n.tv$.X)}get[n.tv$.Y](){return this.getById(n.tv$.Y)}perpendicular(e){return this[e.direction===n.tv$.X?n.tv$.Y:n.tv$.X]}},et=class extends Qe{get[n.tv$.Angle](){return this.getById(n.tv$.Angle)}
1get[n.tv$.Radius](){return this.getById(n.tv$.Radius)}},tt=class{constructor(){this.registeredListeners=new Map}addListener(e,t){const i={symbol:Symbol(e),handler:t};return this.registeredListeners.has(e)?this.registeredListeners.get(e).push(i):this.registeredListeners.set(e,[i]),()=>this.removeListener(i.symbol)}removeListener(e){for(const[t,i]of this.registeredListeners.entries()){const n=i.findIndex((t=>t.symbol===e));if(n>=0){i.splice(n,1),0===i.length&&this.registeredListeners.delete(t);break}}}dispatch(e,...t){for(const i of this.getListenersByType(e))try{i.handler(...t)}catch(e){Be(e),n.tDR.errorOnce(e)}}getListenersByType(e){return this.registeredListeners.get(e)??[]}destroy(){this.registeredListeners.clear()}},it={millisecond:"%H:%M:%S.%L",second:"%H:%M:%S",minute:"%H:%M",hour:"%H:%M",day:"%e",month:"%b",year:"%Y"},nt={millisecond:"%Y %b %e %H:%M:%S.%L",second:"%Y %b %e %H:%M:%S",minute:"%Y %b %e %H:%M",hour:"%Y %b %e %H:%M",day:"%Y %b %e",month:"%Y %b",year:"%Y"},st={year:0,month:1,day:2,hour:3,minute:4,second:5,millisecond:6},at=/%[-_0]?L/,ot=/%[-_0]?S/,rt=/%[-_0]?M/,lt=/%[-_0]?[HI]/,ht=/^%[-_0]?[de]$/,ct=/^%[-_0]?[Bbm]$/,dt=/^%[-_0]?[Yy]$/;var ut=class e extends tt{constructor(){super(...arguments),this.formats=new Map,this.dateFormatter=(0,n.XB6)(((t,i,n,s,a)=>{const o=e.mergeSpecifiers(t,i)??it;return e.getFormatter("date",o,n,s,{truncateDate:a})})),this.formatter=void 0}static mergeSpecifiers(...e){let t;for(const i of e)t=(0,n.QdQ)(i)&&(0,n.QdQ)(t)?{...t,...i}:i;return t}static getFormatter(e,t,i,s="long",{truncateDate:a}={}){if((0,n.QdQ)(t)){if("date"!==e)return void n.tDR.warn("Date formatter configuration is not supported for non-date types.");i??(i="millisecond");const o="component"===s?t?.[i]??it[i]:function(e,t,i){if("string"==typeof e)return e;e??(e=it);const{millisecond:n=it.millisecond,second:s=it.second,minute:a=it.minute,hour:
1o=it.hour,day:r=it.day,month:l=it.month,year:h=it.year}=e,c=st[t],d=nt[t],u=i?st[i]:-1;if(u<st.year&&c>=st.year&&!dt.test(h)||u<st.month&&c>=st.month&&!ct.test(l)||u<st.day&&c>=st.day&&!ht.test(r))return d;let p,g;switch(t){case"year":return h;case"month":return u<st.year?`${l} ${h}`:l;case"day":return u<st.year?`${l} ${r} ${h}`:`${l} ${r}`;case"hour":p=o;break;case"minute":p=a;break;case"second":p=s;break;case"millisecond":p=n;break;default:return d}return c>=st.hour&&!lt.test(p)||c>=st.minute&&!rt.test(p)||c>=st.second&&!ot.test(p)||c>=st.millisecond&&!at.test(p)?d:(u<st.year?g=`${l} ${r} ${h}`:u<st.month&&(g=`${l} ${r}`),g?`${p} ${g}`:p)}(t,i,a);return(0,n.f6S)(o)}switch(e){case"number":{const e=(0,n.sAu)(t);if(null==e)return;return(0,n.ORH)(e)}case"date":return(0,n.f6S)(t);case"category":return e=>t.replace("%s",String(e))}}setFormatter(e){this.formatter!==e&&(this.formatter=e,this.formats.clear(),this.dateFormatter.reset(),this.dispatch("format-changed"))}format(t,i,{specifier:s,truncateDate:a,allowNull:o}={}){if(null==i.value&&!o)return;const{formatter:r}=this;if(null==r)return;if("function"==typeof r){const e=t(r,i);return null==e?void 0:String(e)}const l=r[i.property];if(null==l)return;if("function"==typeof l){const e=t(l,i);return null==e?e:(0,n.i$)(e)}if("date"===i.type){const{unit:e,style:t}=i,n=this.dateFormatter(l,s,e,t,a);return n?.(i.value)}const h=s??l;if("string"!=typeof h)return;let c=this.formats.get(h);return null==c&&(c=e.getFormatter(i.type,h),this.formats.set(h,c)),c?.(i.value,"number"===i.type?i.fractionDigits:void 0)}defaultFormat(e,{specifier:t,truncateDate:i}={}){const{formatter:s}=this,a="function"==typeof s?void 0:s?.[e.property];switch(e.type){case"date":{const{unit:n,style:s}=e,o=null!=a&&"function"!=typeof a?a:void 0,r=this.dateFormatter(o,t,n,s,i);return r?.(e.value)??String(e.value)}case"number":return(0,n.Fl2)(e.value,e.fractionDigits);case"category":if(null==e.value)return"";if(Array.isArray(e.value)){const{value:t,depth:i}=e,n=null==i?-1:t.length-i-1;return n>=0&&n<t.length?t[n]??"":t.join(" - ")}return"string"==typeof e.value?e.value:"number"==typeof e.value?(0,n.Fl2)(e.value):String(e.value)}}},pt=(()=>{var e=class{constructor(){this.enabled=!0}};return d([n.mAP],e.prototype,"enabled",2),d([n.mAP],e.prototype,"stroke",2),d([n.mAP],e.prototype,"strokeWidth",2),d([n.mAP],e.prototype,"strokeOpacity",2),e})(),gt=(()=>{var e=class{};return d([n.mAP],e.prototype,"enabled",2),d([n.mAP],e.prototype,"stroke",2),d([n.mAP],e.prototype,"strokeWidth",2),d([n.mAP],e.prototype,"strokeOpacity",2),e})(),mt=(()=>{var e=class extends n.XPE{};return d([n.mAP],e.prototype,"markers",2),d([n.mAP],e.prototype,"labels",2),d([n.mAP],e.prototype,"seriesItems",2),d([n.mAP],e.prototype,"seriesArea",2),e})(),yt=(()=>{var e=class extends n.XPE{constructor(){super(...arguments),this.alwaysShow=!0,this.collideWith=new mt}resolveCollideWith(){const{markers:e,labels:t,seriesItems:i,seriesArea:n}=this.collideWith;return{marker:e??!0,label:t??!0,seriesItem:i??!1,seriesArea:n??!0}}};return d([n.mAP],e.prototype,"threshold",2),d([n.mAP],e.prototype,"alwaysShow",2),d([n.mAP],e.prototype,"collideWith",2),e})(),ft=(()=>{var e=class extends n.XPE{constructor(){super(...arguments),this.border=new pt}};return d([n.mAP],e.prototype,"border",2),d([n.mAP],e.prototype,"color",2),d([n.mAP],e.prototype,"cornerRadius",2),d([n.mAP],e.prototype,"fill",2),d([n.mAP],e.prototype,"fillOpacity",2),d([n.mAP],e.prototype,"fontStyle",2),d([n.mAP],e.prototype,"fontWeight",2),d([n.mAP],e.prototype,"fontSize",2),d([n.mAP],e.prototype,"fontFamily",2),d([n.mAP],e.prototype,"padding",2),e})(),xt=(()=>{var e=class extends n.XPE{constructor(){super(...arguments),this.border=new gt}};return d([n.mAP],e.prototype,"color",2),d([n.mAP],e.prototype,"fill",2),d([n.mAP],e.prototype,"fillOpacity",2),d([n.mAP],e.prototype,"cornerRadius",2),d([n.mAP],e.prototype,"padding",2),d([n.mAP],e.prototype,"border",2),e})(),bt=(()=>{var e=class extends ft{constructor(){super(...arguments),this.enabled=!1,this.collision=new yt,this._cachedFormatter=void 0}formatValue(e,t,i,s){const{formatter:a,format:o}=this;let r;if(null!=a&&(r??(r=e(a,s))),null!=o){let e=this._cachedFormatter;e?.type===t&&e?.format===o||(e={type:t,format:o,formatter:ut.getFormatter(t,o)},this._cachedFormatter=e),r??(r=e.formatter?.(i))}return null==r||(0,n.cyL)(r)?r:String(r)}};return d([n.mAP],e.prototype,"enabled",2),d([n.mAP],e.prototype,"collision",2),d([n.mAP],e.prototype,"orientation",2),d([n.mAP],e.prototype,"maxWidth",2),d([n.mAP],e.prototype,"maxHeight",2),d([n.mAP],e.prototype,"wrapping",2),d([n.mAP],e.prototype,"truncate",2),d([n.mAP],e.prototype,"minimumFontSize",2),d([n.mAP],e.prototype,"formatter",2),d([n.mAP],e.prototype,"format",2),d([n.mAP],e.prototype,"itemStyler",2),e})(),vt=(()=>{var e=class extends bt{constructor(){super(...arguments),this.insideStyle=new xt,this.outsideStyle=new xt}};return d([n.mAP],e.prototype,"placement",2),d([n.mAP],e.prototype,"spacing",2),d([n.mAP],e.prototype,"insideStyle",2),d([n.mAP],e.prototype,"outsideStyle",2),e})();function St(e){const t=function(e){const{enabled:t=!1,stroke:i}=e?.border??{};return null!=e?.fill||t&&null!=i}(e)?e?.padding:null;if(null==t)return{bottom:0,left:0,right:0,top:0};if("number"==typeof t)return{bottom:t,left:t,right:t,top:t};{const{bottom:e=0,left:i=0,right:n=0,top:s=0}=t;return{bottom:e,left:i,right:n,top:s}}}function Mt(e,t){if(null==t)return e;const i=(0,n.HFk)(t,e);return i.border=(0,n.HFk)(t.border,e.border),i}function kt(e){const t=St(e),i=function(e){const{enabled:t=!1,stroke:i,strokeWidth:n=0}=e?.border??{};return t&&null!=i?n/2:0}(e);return 0===i?t:{bottom:t.bottom+i,left:t.left+i,right:t.right+i,top:t.top+i}}function Dt(e){if(!e.enabled)return{bottom:0,left:0,right:0,top:0};const t=kt(Mt(e,e.insideStyle)),i=kt(Mt(e,e.outsideStyle));return{bottom:Math.max(t.bottom,i.bottom),left:Math.max(t.left,i.left),right:Math.max(t.right,i.right),top:Math.max(t.top,i.top)}}function wt(e,t){return kt(Mt(e,t))}function It(e,t){if(!e.enabled)return{x:0,y:0};const i=Dt(e),n=function(e,t){return St(Mt(e,t))}(e,t);
1return{x:n.left+(i.left+i.right-n.left-n.right)/2,y:n.top+(i.top+i.bottom-n.top-n.bottom)/2}}function At(e){const{left:t,top:i}=kt(e);return{x:t,y:i}}function Ct(e){return{fontSize:e.fontSize??n.SG9.SMALLER,fontStyle:e.fontStyle,fontWeight:e.fontWeight,fontFamily:e.fontFamily??"sans-serif"}}var Nt=(()=>{var e=class{constructor(e,t){this.ctx=e,this.key=t,this.id=(0,n.sX_)(this),this.node=new Xe({zIndex:1}).setProperties({visible:!1,textAlign:"center",pointerEvents:1}),this.truncated=!1}get opts(){return this.ctx.chartState.getValue("options",this.key)??{}}get enabled(){return this.opts.enabled??!1}get text(){return this.opts.text}get padding(){return"number"==typeof this.opts.padding?this.opts.padding:0}get boxPadding(){return St(this.opts)}get contentPadding(){return(0,n.Q1u)(this.opts.padding)}applyToNode(){const e=this.opts,{node:t}=this;t.visible=e.enabled??!1,t.text=e.text,t.textAlign=e.textAlign??"center",t.fontStyle=e.fontStyle,t.fontWeight=e.fontWeight,t.fontSize=e.fontSize??n.SG9.SMALLER,t.fontFamily=e.fontFamily??"sans-serif",t.fill=e.color,t.setBoxing({fill:e.fill,fillOpacity:e.fillOpacity,cornerRadius:e.cornerRadius,padding:e.padding,border:e.border})}registerInteraction(e,t){return e.eventsHub.on("layout:complete",(()=>this.updateA11yText(e,t)))}computeTextWrap(e,t){const i=this.opts,s=i.truncate??!0,{left:a,right:o,top:r,bottom:l}=this.contentPadding,h=s?e:1/0,c=s?t:1/0,d=Math.min(i.maxWidth??1/0,h)-(a+o),u=i.maxHeight??c-(r+l),p=i.text;if(!Number.isFinite(d)&&!Number.isFinite(u))return void(this.node.text=p);const g=Ct(i),m={maxWidth:d,maxHeight:u,wrapping:i.wrapping??"always",overflowStrategy:"ellipsis",minimumFontSize:i.minimumFontSize},{text:y,fontSize:f}=(0,n.xBv)(p??"",m,g);this.truncated=(0,n.cyL)(y)?y.some(n.a0u):(0,n.KQS)((0,n.i$)(y)),this.node.text=y,this.node.fontSize=f??g.fontSize}updateA11yText(e,t){const{proxyInteractionService:i}=e;if(!this.enabled||!this.text)return void this.destroyProxyText();const s=Me.toCanvas(this.node);if(!s)return;const{id:a}=this;null==this.proxyText&&(this.proxyText=i.createProxyElement({type:"text",domManagerId:a,where:t}),this.proxyTextListeners=[this.proxyText.addListener("contextmenu",(t=>this.handleContextMenu(e,t))),this.proxyText.addListener("click",(t=>{this.hasClickListener(e)&&this.handleClick(e,t)})),this.proxyText.addListener("dblclick",(t=>{this.hasClickListener(e)&&this.handleClick(e,t)})),this.proxyText.addListener("mousemove",(t=>this.handleMouseMove(e,t))),this.proxyText.addListener("mouseleave",(()=>this.handleTooltipHide(e))),this.proxyText.addListener("focus",(()=>this.handleFocus(e))),this.proxyText.addListener("blur",(()=>this.handleTooltipHide(e)))]),this.proxyText.setCursor(this.hasClickListener(e)?"pointer":void 0);const o=(0,n.boc)(this.text);o!==this.lastProxyTextContent&&(this.proxyText.textContent=o,this.lastProxyTextContent=o);const{lastProxyBBox:r}=this;s.x===r?.x&&s.y===r?.y&&s.width===r?.width&&s.height===r?.height||(this.proxyText.setBounds(s),this.lastProxyBBox={x:s.x,y:s.y,width:s.width,height:s.height})}getEffectiveTooltipVisible(){const e=this.opts.tooltip??{};return null!=e.visible?e.visible:null!=e.text||null!=e.renderer?"always":"auto"}getTooltipContent(e){const t=(0,n.boc)(this.text),i=this.opts.tooltip??{};if(null!=i.renderer){const s={text:t},a=(0,n.cVk)(e.chartService,i.renderer,s);if(""===a)return;if(null!=a)return{type:"raw",rawHtmlString:(0,n.i$)(a)}}return{type:"structured",title:i.text??t}}showTooltip(e,t,i){if(!this.enabled)return;const n=this.getEffectiveTooltipVisible();if("never"===n)return;if("auto"===n&&!this.truncated)return;const s=this.getTooltipContent(e);null!=s&&e.tooltipManager.updateTooltip(this.id,{canvasX:t,canvasY:i,showArrow:!1},[s])}eventToCanvas(e){const t=Me.toCanvas(this.node);return{canvasX:e.sourceEvent.offsetX+t.x,canvasY:e.sourceEvent.offsetY+t.y}}handleMouseMove(e,t){if(null==t)return;const{canvasX:i,canvasY:n}=this.eventToCanvas(t);this.showTooltip(e,i,n)}handleFocus(e){const t=Me.toCanvas(this.node).computeCenter();this.showTooltip(e,t.x,t.y)}handleTooltipHide(e){e.tooltipManager.removeTooltip(this.id,void 0,!0)}handleContextMenu(e,t){const{canvasX:i,canvasY:n}=this.eventToCanvas(t);
1e.contextMenuRegistry?.dispatchContext("caption",{widgetEvent:t,canvasX:i,canvasY:n},{captionType:this.key,text:this.text??""})}hasClickListener(e){const t=this.opts.listeners,i=e.chartService.listeners;return null!=t?.click||null!=t?.doubleClick||null!=i.captionClick||null!=i.captionDoubleClick}handleClick(e,t){if("keyboard"===t.device)return;const i="dblclick"===t.type,s={event:t.sourceEvent,captionType:this.key,text:this.text??""},{listeners:a}=this.opts,o=i?a?.doubleClick:a?.click;if(o){const t={type:i?"doubleClick":"click",...s};(0,n.cVk)(e.chartService,o,t)}const r=i?"captionDoubleClick":"captionClick";e.chartService.callListener({type:r,...s})}destroy(){this.destroyProxyText()}destroyProxyText(){if(null!=this.proxyText){for(const e of this.proxyTextListeners??[])e();this.proxyTextListeners=void 0,this.proxyText.destroy(),this.proxyText=void 0,this.lastProxyTextContent=void 0,this.lastProxyBBox=void 0}}};return e.className="ChartCaption",e})(),Lt=class{constructor(e){this.ctx=e,this.title=new Nt(e,"title"),this.subtitle=new Nt(e,"subtitle"),this.footnote=new Nt(e,"footnote")}positionCaptions({layoutBox:e}){const{title:t,subtitle:i,footnote:n}=this,s=e.height/10;for(const e of[t,i,n])e.applyToNode();t.enabled&&(this.positionCaption("top",t,e,s),this.shrinkLayoutByCaption("top",t,e)),i.enabled&&(this.positionCaption("top",i,e,s),this.shrinkLayoutByCaption("top",i,e)),n.enabled&&(this.positionCaption("bottom",n,e,s),this.shrinkLayoutByCaption("bottom",n,e))}positionAbsoluteCaptions(e){const{title:t,subtitle:i,footnote:s}=this,{rect:a}=e.series;for(const e of[t,i,s]){const t=e.opts;if("overlay"!==(t.layoutStyle??"block"))continue;const i=(0,n.vDS)(t.textAlign??"center",this.ctx.domManager.isRtl);if("left"===i)e.node.x=a.x+e.contentPadding.left;else if("right"===i){const t=e.node.getBBox(),i=e.contentPadding.right-e.boxPadding.right;e.node.x=a.x+a.width-t.width-i}}}computeX(e,t){return"left"===e?t.x:"right"===e?t.x+t.width:t.x+t.width/2}positionCaption(e,t,i,s){const a=t.opts,o=Ct(a),r=a.text,l=(0,n.vDS)(a.textAlign??"center",this.ctx.domManager.isRtl),{left:h,right:c,top:d,bottom:u}=t.contentPadding;let p=0;if("left"===l?p=h:"right"===l&&(p=-c),t.node.x=this.computeX(l,i)+p,t.node.y=i.y+("top"===e?d:i.height-u),t.node.textBaseline=e,!r)return;const g=(0,n.hu9)(r,a.minimumFontSize,o,0),m=(0,n.lad)(o,g.fontSize),{lineMetrics:y}=(0,n.cyL)(g.text)?(0,n.wEO)(g.text,m):(0,n.K$y)(m).measureLines((0,n.i$)(g.text)),f=Math.max(y[0].height,s);t.computeTextWrap(i.width,f)}shrinkLayoutByCaption(e,t,i){const s=t.opts;if("block"!==(s.layoutStyle??"block"))return;const a=t.node.getBBox().clone(),o=s.spacing??0;0===a.height&&(a.height=(0,n.K$y)(Ct(s)).lineHeight(),"bottom"===e&&(a.y-=a.height));const r=(0,n.cyL)(s.text),{top:l,bottom:h}=t.boxPadding;r&&0===l&&0===h&&"bottom"===e&&(a.y-=a.height),i.shrink("top"===e?Math.ceil(a.y-i.y+a.height+o):Math.ceil(i.y+i.height-a.y+o),e)}},Pt=["candlestick","hollow-candlestick","ohlc","line","step-line","hlc","high-low"],Tt=class{constructor(e,t){this.chartService=e,this.logger=t,this.mementoOriginatorKey="chartType"}createMemento(){let e=this.chartService.publicApi?.getOptions()?.chartType;return e??(e="candlestick"),e}guardMemento(e){return null==e||Pt.includes(e)}restoreMemento(e,t,i){if(null==i)return;const n={chartType:i};this.chartService.publicApi?.updateDelta(n).catch((e=>this.logger.error("error restoring state",e)))}},Ot="14.2.0",Rt=Symbol("previous-memento-not-found"),Et=class{constructor(e){this.history=[],this.historyIndex=-1,this.originators=new Map,this.clearState=new Map,this.maxHistoryLength=100,this.debug=n.yar.create(!0,"history"),this.cleanup=new n._uV,this.cleanup.register(e.eventsHub.on("series:undo",this.undo.bind(this)),e.eventsHub.on("series:redo",this.redo.bind(this)))}destroy(){this.cleanup.flush()}addMementoOriginator(e){this.originators.set(e.mementoOriginatorKey,e),this.clearState.set(e.mementoOriginatorKey,e.createMemento()),this.debugEvent("History add originator:",e.mementoOriginatorKey)}clear(){this.debug("History clear:",Object.keys(this.originators)),this.history=[],this.historyIndex=-1;for(const[e,t]of this.originators.entries())this.clearState.set(e,t.createMemento())}record(e,...t){this.historyIndex<this.history.length-1&&(this.history=this.history.slice(0,this.historyIndex+1)),this.history.length>this.maxHistoryLength&&(this.history=this.history.slice(-this.maxHistoryLength));const i=new Map;for(const e of t){if(!this.originators.has(e.mementoOriginatorKey))throw new Error(`Originator [${e.mementoOriginatorKey}] has not been added to the HistoryManager.`);i.set(e.mementoOriginatorKey,e.createMemento())}this.history.push({label:e,mementos:i}),this.historyIndex=this.history.length-1,this.debugEvent(`History record: [${e}]`)}undo(){const e=this.history[this.historyIndex];if(e){for(const t of e.mementos.keys()){const e=this.findPreviousMemento(t);
1if(e===Rt)throw new Error(`Could not find previous memento for [${t}].`);this.restoreMemento(t,e)}this.historyIndex-=1,this.debugEvent(`History undo: [${e.label}]`)}}redo(){const e=this.history[this.historyIndex+1];if(e){for(const[t,i]of e.mementos.entries())this.restoreMemento(t,i);this.historyIndex+=1,this.debugEvent(`History redo: [${e.label}]`)}}findPreviousMemento(e){for(let t=this.historyIndex-1;t>=0;t--)if(this.history[t].mementos.has(e))return this.history[t].mementos.get(e);return this.clearState.has(e)?this.clearState.get(e):Rt}restoreMemento(e,t){this.originators.get(e)?.restoreMemento(Ot,Ot,t)}debugEvent(...e){this.debug(...e,this.history.map(((e,t)=>t===this.historyIndex?`** ${e.label} **`:e.label)))}},zt=class{constructor(e){this.logger=e,this.caretaker=new n.OQ$(Ot),this.state=new Map}setState(e,t){(0,n.DH9)(this.state.get(e.mementoOriginatorKey),t)||this.setStateAndRestore(e,t)}setStateAndRestore(e,t){this.state.set(e.mementoOriginatorKey,t),this.restoreState(e)}restoreState(e){const{caretaker:t,state:i}=this;if(!i.has(e.mementoOriginatorKey))return;const n=i.get(e.mementoOriginatorKey);t.restore(this.logger,{version:t.version,[e.mementoOriginatorKey]:n},e)}},Bt=class{constructor(){this.cleanup=new n._uV,this.destroyed=!1}destroy(){this.cleanup.flush(),this.destroyed=!0}},Ft=class e{constructor(e,t,i){this.element=e,this.topTabGuard=t,this.bottomTabGuard=i,this.cleanup=new n._uV,this.guardTabIndex=0,this.hasFocus=!1,this.initTabGuard(this.topTabGuard,!1),this.initTabGuard(this.bottomTabGuard,!0),this.element.addEventListener("focus",(()=>this.onFocus()),{capture:!0}),this.element.addEventListener("blur",(e=>this.onBlur(e)),{capture:!0})}set tabIndex(e){this.guardTabIndex=e,0===this.guardTabIndex?this.setGuardIndices(void 0):this.hasFocus||this.setGuardIndices(this.guardTabIndex)}destroy(){this.cleanup.flush()}initTabGuard(e,t){this.cleanup.register((0,n.yE)(e,"focus",(()=>this.onTab(e,t))))}setGuardIndices(e){const t=e;(0,n.Bqc)(this.topTabGuard,"tabindex",t),(0,n.Bqc)(this.bottomTabGuard,"tabindex",t)}onFocus(){this.hasFocus=!0,0!==this.guardTabIndex&&this.setGuardIndices(0)}onBlur({relatedTarget:e}){const{topTabGuard:t,bottomTabGuard:i}=this;this.hasFocus=!1,0!==this.guardTabIndex&&e!==t&&e!==i&&this.setGuardIndices(this.guardTabIndex)}onTab(e,t){if(0!==this.guardTabIndex){let i;0===e.tabIndex?(i=this.findExitTarget(!t),this.setGuardIndices(this.guardTabIndex)):i=this.findEnterTarget(t),i?.focus()}}static queryFocusable(e,t){const i=e.ownerDocument.defaultView;return Array.from(e.querySelectorAll(t)).filter((e=>{if((0,n.sby)(e)){const t=i.getComputedStyle(e);return"none"!==t.display&&"none"!==t.visibility}return!1}))}findEnterTarget(t){const i=e.queryFocusable(this.element,'[tabindex="0"]');return i[t?i.length-1:0]}findExitTarget(t){const i=e.queryFocusable(this.element.ownerDocument.body,"[tabindex]").filter((e=>e.tabIndex>0)).sort(((e,t)=>e.tabIndex-t.tabIndex)),{before:n,after:s}=e.findBeforeAndAfter(i,this.guardTabIndex);return t?n:s}static findBeforeAndAfter(e,t){let i,n,s=0,a=e.length-1;for(;s<=a;){const o=Math.floor((s+a)/2),r=e[o].tabIndex;if(r===t){i=e[o-1]||void 0,n=e[o+1]||void 0;break}r<t?(i=e[o],s=o+1):(n=e[o],a=o-1)}return{before:i,after:n}}},Vt=n.yar.create(!0,"perf","opts");function $t(e,t,i="PerWindowRegistry"){const n=new Map;return{subscribe(s,a){let o=n.get(s);return null==o?(o=e(s),n.set(s,o),Vt(`[REGISTRY] ${i}`,"first-subscribe")):Vt(`[REGISTRY] ${i}`,"shared-subscribe"),o.subscribers.add(a),()=>{const e=n.get(s);null!=e&&(e.subscribers.delete(a),0===e.subscribers.size&&(n.delete(s),t(e),Vt(`[REGISTRY] ${i}`,"last-unsubscribe")))}},snapshot:e=>[...e.subscribers],get:e=>n.get(e)}}function Ht(e){const t=e.window.matchMedia?.(`(resolution: ${e.pixelRatio}dppx)`);e.mediaQuery=t,t?.addEventListener("change",e.mediaQueryListener)}function jt(e){e.mediaQuery?.removeEventListener("change",e.mediaQueryListener),e.mediaQuery=void 0}var Wt=$t((e=>{const t={window:e,pixelRatio:e.devicePixelRatio,mediaQuery:void 0,subscribers:new Set,mediaQueryListener:function(i){if(!i.matches){t.pixelRatio=e.devicePixelRatio,jt(t),Ht(t);for(const e of Wt.snapshot(t))e(t.pixelRatio)}}};return Ht(t),t}),jt,"PixelRatioObserver.shared");var _t=class{constructor(e,t,i=!1){this.agDocument=e,this.callback=t,this.shared=i,this.devicePixelRatioMediaQuery=void 0,this.sharedUnsubscribe=void 0,this.devicePixelRatioListener=e=>{e.matches||(this.devicePixelRatio=this.agDocument.devicePixelRatio,this.unregisterDevicePixelRatioListener(),this.registerDevicePixelRatioListener(),this.callback(this.pixelRatio))},this.devicePixelRatio=e.devicePixelRatio}get pixelRatio(){return this.devicePixelRatio}observe(){this.shared?this.observeShared():this.registerDevicePixelRatioListener()}disconnect(){this.shared?(this.sharedUnsubscribe?.(),this.sharedUnsubscribe=void 0):this.unregisterDevicePixelRatioListener()}observeShared(){if(null!=this.sharedUnsubscribe)return;const{window:e}=this.agDocument;this.sharedUnsubscribe=function(e,t,i){const n=Wt.get(e);return null!=n&&n.pixelRatio!==t&&(n.pixelRatio=t,jt(n),Ht(n)),Wt.subscribe(e,i)}(e,this.devicePixelRatio,(e=>{this.devicePixelRatio=e,this.callback(e)}))}unregisterDevicePixelRatioListener(){this.devicePixelRatioMediaQuery?.removeEventListener("change",this.devicePixelRatioListener),this.devicePixelRatioMediaQuery=void 0}registerDevicePixelRatioListener(){const e=this.agDocument.matchMedia(`(resolution: ${this.pixelRatio}dppx)`);e?.addEventListener("change",this.devicePixelRatioListener),this.devicePixelRatioMediaQuery=e}},Gt=class{constructor(e,t="normal"){let i;this.elements=new Map,this.documentReady=!1,this.queuedObserveRequests=[],this.onLoad=()=>{this.documentReady=!0;for(const[e,t,i]of this.queuedObserveRequests)this.observe(e,t,i);this.queuedObserveRequests=[],this.observeWindow()},this.resizeObserver=e.createResizeObserver((e=>{for(const{target:t,contentRect:{width:i,height:n}}of e){const e=this.elements.get(t);this.checkSize(e,t,i,n)}})),this.pixelRatioObserver=new _t(e,(()=>{clearTimeout(i),i=setTimeout((()=>
1this.checkPixelRatio()),0)}),"minimal"===t),this.documentReady=e.isReady(),this.documentReady?this.observeWindow():this.removeLoadListener=e.attachListener("load",this.onLoad)}destroy(){this.removeLoadListener?.(),this.removeLoadListener=void 0,this.resizeObserver?.disconnect(),this.resizeObserver=void 0,this.pixelRatioObserver?.disconnect(),this.pixelRatioObserver=void 0}observeWindow(){this.pixelRatioObserver?.observe()}checkPixelRatio(){const e=this.pixelRatioObserver?.pixelRatio??1;for(const[t,i]of this.elements)if(null!=i.size&&i.size.pixelRatio!==e){const{width:n,height:s}=i.size;i.size={width:n,height:s,pixelRatio:e},i.cb(i.size,t)}}checkSize(e,t,i,n){if(!e)return;const s=e.size;if(void 0===s||Math.round(i)!==Math.round(s.width)||Math.round(n)!==Math.round(s.height)){const s=this.pixelRatioObserver?.pixelRatio??1;e.size={width:i,height:n,pixelRatio:s},e.cb(e.size,t)}}observe(e,t,i){if(!this.documentReady)return void this.queuedObserveRequests.push([e,t,i]);this.elements.has(e)?this.removeFromQueue(e):this.resizeObserver?.observe(e);const n={cb:t};this.elements.set(e,n),i?.skipInitialRead||this.readSize(n,e)}readSize(e,t){const i=t.ownerDocument.defaultView?.getComputedStyle(t),n=t.clientWidth-(Number.parseFloat(i?.paddingLeft??"0")+Number.parseFloat(i?.paddingRight??"0")),s=t.clientHeight-(Number.parseFloat(i?.paddingTop??"0")+Number.parseFloat(i?.paddingBottom??"0"));(n>0||s>0)&&this.checkSize(e,t,n,s)}refresh(e){const t=this.elements.get(e);t&&this.readSize(t,e)}unobserve(e){this.resizeObserver?.unobserve(e),this.elements.delete(e),this.removeFromQueue(e),this.elements.size||this.destroy()}removeFromQueue(e){this.queuedObserveRequests=this.queuedObserveRequests.filter((([t])=>t!==e))}},Kt=class extends Map{constructor(e,t){super(),this.defaultValue=e,this.defaultState=t}set(e,t){return this.delete(e),void 0!==t&&super.set(e,t),delete this.cachedState,delete this.cachedValue,this}delete(e){return delete this.cachedState,delete this.cachedValue,super.delete(e)}lock(e,t){this.locked={key:e,value:t},delete this.cachedState,delete this.cachedValue}unlock(e){this.locked?.key===e&&(this.locked=void 0,delete this.cachedState,delete this.cachedValue)}isLocked(){return void 0!==this.locked}stateId(){return this.locked?this.locked.key:(this.cachedState??(this.cachedState=Array.from(this.keys()).pop()??this.defaultState),this.cachedState)}stateValue(){return this.locked?this.locked.value:(this.cachedValue??(this.cachedValue=Array.from(this.values()).pop()??this.defaultValue),this.cachedValue)}},Yt=["translate"],Ut=new Set(["updatePending","animating","sceneRenders","animationTimeMs"]),Xt=class{constructor(e,t){this.element=e,this.cache={},this.pendingWrites=new Map,this.deferredMode=t?.deferredMode,this.sizeMonitor=t?.sizeMonitor,this.skipInitialRead=t?.skipInitialRead??!1}get isConnected(){return this.element.isConnected}scheduleFlush(){this.deferredMode?this.deferredMode.scheduleFlush():this.flush()}contains(e){return this.element.contains(e)}addEventListener(e,t,i){this.element.addEventListener(e,t,i)}removeEventListener(e,t,i){this.element.removeEventListener(e,t,i)}get innerHTML(){return this.pendingWrites?this.cache.innerHTML??"":this.element.innerHTML}changed(e,t){return this.cache[e]!==t&&(this.cache[e]=t,!0)}invalidate(e){delete this.cache[e]}setProperty(e,t){const i=`p:${e}`;this.changed(i,t)&&(Yt.includes(e)?this.element.style.setProperty(e,t):(this.pendingWrites.set(i,(()=>{this.element.style.setProperty(e,t)})),this.scheduleFlush()))}toggleClass(e,t){const i=`c:${e}`;this.changed(i,t)&&(this.pendingWrites.set(i,(()=>{this.element.classList.toggle(e,t)})),this.scheduleFlush())}setAttr(e,t){const i=`a:${e}`;this.changed(i,t)&&(this.pendingWrites.set(i,(()=>{null==t?this.element.removeAttribute(e):this.element.setAttribute(e,t)})),this.scheduleFlush())}setData(e,t){const i=`d:${e}`;if(this.changed(i,t)){if(Ut.has(e))return void(this.element.dataset[e]=t);this.pendingWrites.set(i,(()=>{this.element.dataset[e]=t})),this.scheduleFlush()}}getData(e){const t=`d:${e}`;return this.pendingWrites?this.cache[t]:this.element.dataset[e]}setInnerHTML(e){return!!this.changed("innerHTML",e)&&(this.pendingWrites.set("innerHTML",(()=>{this.element.innerHTML=e})),this.scheduleFlush(),this.invalidate("contentStyles"),!0)}setContentStyles(e){if(this.changed("contentStyles",JSON.stringify(e))){const t=()=>{const t=this.element.firstElementChild??this.element;Object.assign(t.style,e)};this.pendingWrites.set("contentStyles",t),this.scheduleFlush()}}flush(){if(this.pendingWrites){for(const e of this.pendingWrites.values())e();this.pendingWrites.clear()}}flushKey(e){const t=this.pendingWrites.get(e);t&&(t(),this.pendingWrites.delete(e))}togglePopover(e){e?this.changed("popover",!0)&&(this.pendingWrites.set("popover",(()=>{this.element.togglePopover(!0)})),this.scheduleFlush()):(this.pendingWrites.delete("popover"),this.changed("popover",!1)&&this.element.togglePopover(!1))}replaceChildren(...e){this.element.replaceChildren(...e),this.invalidate("innerHTML")}set innerText(e){this.element.innerText=e,this.invalidate("innerHTML")}
1addResizeListener(e){const{sizeMonitor:t,element:i,skipInitialRead:n}=this;if(null==t)throw new Error("AG Charts - addResizeListener requires a SizeMonitor");return t.observe(i,(t=>e(t)),{skipInitialRead:n}),()=>t.unobserve(i)}reset(){this.cache={}}},Zt=["styles","canvas","canvas-background","canvas-center","canvas-container","canvas-overlay","canvas-proxy","series-area","tooltip-container","style-sensors"],qt=new Set(["styles","canvas-container","canvas","tooltip-container"]),Qt="ag-charts-wrapper--safe-horizontal",Jt="ag-charts-wrapper--safe-vertical",ei=new Map([["styles",{childElementType:"style"}],["canvas",{childElementType:"canvas"}],["canvas-proxy",{childElementType:"div"}],["canvas-overlay",{childElementType:"div"}],["canvas-center",{childElementType:"div"}],["series-area",{childElementType:"div"}],["tooltip-container",{childElementType:"div"}]]);var ti={x:0,y:0,width:0,height:0,top:0,bottom:0,left:0,right:0,toJSON:()=>ti};function ii(e,t){const i=(0,n.na4)("div");return i.className="ag-charts-tab-guard",e.insertAdjacentElement(t,i),i}var ni=$t((e=>{const{document:t}=e,i={window:e,document:t,subscribers:new Set,onScrollResize:function(){for(const e of ni.snapshot(i))e.invalidateRects()},onFullscreen:function(){for(const e of ni.snapshot(i))e.invalidateAll()}};return e.addEventListener("scroll",i.onScrollResize,{capture:!0,passive:!0}),e.addEventListener("resize",i.onScrollResize,{capture:!0,passive:!0}),t.addEventListener("fullscreenchange",i.onFullscreen),i}),(e=>{e.window.removeEventListener("scroll",e.onScrollResize,{capture:!0}),e.window.removeEventListener("resize",e.onScrollResize,{capture:!0}),e.document.removeEventListener("fullscreenchange",e.onFullscreen)}),"DOMManager.globalListeners"),si=(()=>{var e=class e extends Bt{constructor(e,t,i,s,a,o,r="normal",l){super(),this.eventsHub=e,this.styleNonce=t,this.agDocument=i,this.styleContainer=a,this.skipCss=o,this.mode=r,this.cssVariables=l,this.anchorName=`--${(0,n.sX_)(this)}`,this.styles=new Map,this.pendingContainer=void 0,this.container=void 0,this.shadowDocumentRoot=void 0,this.cssVariableWatchers=new Set,this.shadowCssVariableWatchers=new Set,this.lastThemeParameters=void 0,this.lastThemeParameterCount=0,this.initiallyConnected=void 0,this.containerSize=void 0,this.cursorState=new Kt("default"),this._lastCursor="default",this._cursorLocked=!1,this._lastCenterSize=void 0,this.deferredProxies=new Map,this.deferredMode={scheduleFlush:this.scheduleFlush.bind(this)},this.minWidth=0,this.minHeight=0,this.autoWidth=!0,this.autoHeight=!0,this._isRtl=!1,this._deferring=!1,this.onAttachTransition=()=>{!0===this.container?.isConnected&&this.updateStylesLocation()},this.sizeMonitor=new Gt(i,r),this.element=this.initDOM(),this.element.style.cursor="default",this.elementProxy=new Xt(this.element,{deferredMode:this.deferredMode}),this.rootElements=this.initRootElements(),this.rootElements.canvas.element.style.setProperty("anchor-name",this.anchorName),this.sizeMonitor.observe(this.rootElements.canvas.element,(()=>this.invalidateRectCaches()),{skipInitialRead:"minimal"===this.mode});let h=!1;if(this.observer=function(e,t,i){const n=e.createIntersectionObserver((e=>{for(const n of e)n.target===t&&i(n.intersectionRatio)}),{root:t});return n?.observe(t),n}(i,this.element,(e=>{0!==e||h||this.eventsHub.emit("dom:hidden",null),h=0===e})),this.setSizeOptions(),this.updateContainerSize(),this.addStyles("ag-charts-community",'
vendor: 57,087 bytes, line 1
1.ag-charts-wrapper,.ag-charts-wrapper:after,.ag-charts-wrapper:before,.ag-charts-wrapper *,.ag-charts-wrapper *:after,.ag-charts-wrapper *:before{box-sizing:border-box}.ag-charts-wrapper{--align-items: center;--justify-content: center;position:relative;user-select:none;-webkit-user-select:none;-webkit-tap-highlight-color:rgba(0,0,0,0)}.ag-charts-wrapper--cursor-locked .ag-charts-proxy-elem{cursor:inherit!important}.ag-charts-wrapper--safe-horizontal{--justify-content: flex-start}.ag-charts-wrapper--safe-vertical{--align-items: flex-start}.ag-charts-tab-guard{width:0;height:0;position:absolute;pointer-events:none}.ag-charts-canvas-background{position:absolute}.ag-charts-canvas-center{position:absolute;touch-action:auto;pointer-events:auto;display:flex;align-items:var(--align-items);justify-content:var(--justify-content)}.ag-charts-canvas-container,.ag-charts-canvas{position:relative;user-select:none;-webkit-user-select:none}.ag-charts-canvas-container>*,.ag-charts-canvas>*{pointer-events:none}.ag-charts-canvas canvas{display:block}.ag-charts-series-area{outline:none;pointer-events:auto;position:absolute}.ag-charts-swapchain{top:0;left:0;outline:none;opacity:0;pointer-events:none;position:absolute;width:100%;height:100%}.ag-charts-swapchain:focus-visible{opacity:1}.ag-charts-canvas-proxy,.ag-charts-canvas-overlay{position:absolute;inset:0;pointer-events:none;user-select:none;-webkit-user-select:none}.ag-charts-canvas-overlay>*{position:absolute;pointer-events:auto}.ag-charts-canvas-overlay>[role=presentation]{left:0}.ag-charts-style-sensors{visibility:hidden;position:absolute}.ag-charts-theme-default,.ag-charts-theme-default-dark{--ag-charts-accent-color: #2196f3;--ag-charts-background-color: #fff;--ag-charts-border-color: #dddddd;--ag-charts-border-radius: 4px;--ag-charts-chart-background-color: #fff;--ag-charts-chart-padding: 20px;--ag-charts-focus-color: #e4f2fe;--ag-charts-focus-shadow: 0 0 0 3px #2196f3;--ag-charts-foreground-color: #181d1f;--ag-charts-font-family: "IBM Plex Sans", -apple-system, "system-ui", "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;--ag-charts-font-size: 12px;--ag-charts-font-weight: 400;--ag-charts-popup-shadow: 0 0 16px rgba(0, 0, 0, .15);--ag-charts-subtle-text-color: #8c8c8c;--ag-charts-text-color: #181d1f;--ag-charts-chrome-background-color: #fafafa;--ag-charts-chrome-font-family: "IBM Plex Sans", -apple-system, "system-ui", "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;--ag-charts-chrome-font-size: 12px;--ag-charts-chrome-font-weight: 400;--ag-charts-chrome-subtle-text-color: #8c8c8c;--ag-charts-chrome-text-color: #181d1f;--ag-charts-button-background-color: #fff;--ag-charts-button-border-color: #dddddd;--ag-charts-button-border-radius: 4px;--ag-charts-button-border-width: 1px;--ag-charts-button-font-weight: normal;--ag-charts-button-text-color: inherit;--ag-charts-input-background-color: #fff;--ag-charts-input-border-color: #dddddd;--ag-charts-input-border-radius: 4px;--ag-charts-input-border-width: 1px;--ag-charts-input-text-color: #181d1f;--ag-charts-menu-background-color: #fafafa;--ag-charts-menu-border-color: #dddddd;--ag-charts-menu-border-radius: 4px;--ag-charts-menu-border-width: 1px;--ag-charts-menu-text-color: #181d1f;--ag-charts-panel-background-color: #fafafa;--ag-charts-panel-text-color: #181d1f;--ag-charts-tooltip-background-color: #fafafa;--ag-charts-tooltip-border-color: #dddddd;--ag-charts-tooltip-border-radius: 4px;--ag-charts-tooltip-border-width: 1px;--ag-charts-tooltip-text-color: #181d1f;--ag-charts-tooltip-subtle-text-color: #8c8c8c;--ag-charts-crosshair-label-background-color: #fafafa;--ag-charts-crosshair-label-text-color: #181d1f;--ag-charts-spacing: 4px;--ag-charts-icon-size: 16px;--ag-charts-input-focus-border-color: var(--ag-charts-accent-color);--ag-charts-input-focus-text-color: var(--ag-charts-accent-color);--ag-charts-input-disabled-background-color: color-mix( in srgb, var(--ag-charts-chrome-background-color), var(--ag-charts-foreground-color) 6% );--ag-charts-input-disabled-border-color: var(--ag-charts-border-color);--ag-charts-input-disabled-text-color: color-mix( in srgb, var(--ag-charts-chrome-background-color), var(--ag-charts-input-text-color) 50% );--ag-charts-input-placeholder-text-color: color-mix( in srgb, var(--ag-charts-input-background-color), var(--ag-charts-input-text-color) 60% );--ag-charts-button-focus-background-color: color-mix( in srgb, var(--ag-charts-button-background-color), var(--ag-charts-accent-color) 12% );--ag-charts-button-focus-border-color: var(--ag-charts-accent-color);--ag-charts-button-focus-text-color: var(--ag-charts-accent-color);--ag-charts-button-disabled-background-color: color-mix( in srgb, var(--ag-charts-chrome-background-color), var(--ag-charts-foreground-color) 6% );--ag-charts-button-disabled-border-color: var(--ag-charts-border-color);--ag-charts-button-disabled-text-color: color-mix( in srgb, var(--ag-charts-chrome-background-color), var(--ag-charts-chrome-text-color) 50% );--ag-charts-checkbox-background-color: color-mix( in srgb, var(--ag-charts-background-color), var(--ag-charts-foreground-color) 35% );--ag-charts-checkbox-checked-background-color: var(--ag-charts-accent-color);--ag-charts-chrome-font-size-small: var(--ag-charts-chrome-font-size);--ag-charts-chrome-font-size-medium: calc(var(--ag-charts-chrome-font-size) * (13 / 12));--ag-charts-chrome-font-size-large: calc(var(--ag-charts-chrome-font-size) * (14 / 12));--ag-charts-border-width: 1px;--ag-charts-border: var(--ag-charts-border-width) solid var(--ag-charts-border-color);--ag-charts-focus-border: 1px solid var(--ag-charts-accent-color);--ag-charts-focus-border-shadow: 0 0 0 3px color-mix(in srgb, transparent, var(--ag-charts-accent-color) 20%);--ag-charts-layer-menu: 6;--ag-charts-layer-ui-overlay: 5;--ag-charts-layer-tooltip: 4;--ag-charts-layer-toolbar: 3;--ag-charts-layer-crosshair: 2;--ag-charts-layer-annotations: 1}.ag-chart-canvas-wrapper .ag-charts-theme-default{--ag-charts-border-radius: var(--ag-border-radius, 4px);--ag-charts-border: var(--ag-borders-critical, solid 1px) var(--ag-charts-border-color);--ag-charts-focus-shadow: var(--ag-focus-shadow, 0 0 0 3px var(--ag-charts-accent-color));--ag-charts-focus-border-shadow: var( --ag-focus-shadow, 0 0 0 3px color-mix(in srgb, transparent, var(--ag-charts-accent-color) 20%) )}.ag-charts-icon{display:block;width:20px;height:20px;speak:none;speak:never;mask:var(--icon) center / contain no-repeat;background-color:currentColor;transition:background-color .25s ease-in-out}.ag-charts-icon-align-center{--icon: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBmaWxsPSIjMDAwIiBkPSJNNyAxMGg2djFIN3pNNCA3aDEydjFINHptMSA2aDEwdjFINXoiLz48L3N2Zz4=)}.ag-charts-icon-align-left{--icon: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBmaWxsPSIjMDAwIiBkPSJNNCAxMGg2djFINHptMC0zaDEydjFINHptMCA2aDEwdjFINHoiLz48L3N2Zz4=)}.ag-charts-icon-align-right{--icon: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBmaWxsPSIjMDAwIiBkPSJNMTAgMTBoNnYxaC02ek00IDdoMTJ2MUg0em0yIDZoMTB2MUg2eiIvPjwvc3ZnPg==)}.ag-charts-icon-arrow-drawing{--icon: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTTE1LjI5MyA0LjVIMTIuNXYtMUgxN3Y0aC0xVjUuMjA3bC05LjY0NiA5LjY0Ny0uNzA4LS43MDh6IiBmaWxsPSIjMDAwIi8+PHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik03IDE2YTIuNSAyLjUgMCAxIDEtNSAwIDIuNSAyLjUgMCAwIDEgNSAwbS0yLjUgMS41YTEuNSAxLjUgMCAxIDAgMC0zIDEuNSAxLjUgMCAwIDAgMCAzIiBmaWxsPSIjMDAwIi8+PC9zdmc+)}.ag-charts-icon-arrow-down-drawing{--icon: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik02IDhMMS41IDhMMTAgMThMMTguNSA4TDE0IDhMMTQgM0w2IDNMNiA4Wk03IDRMNyA5SDMuNjYyNDRMMTAgMTYuNDU2TDE2LjMzNzYgOUwxMyA5TDEzIDRMNyA0WiIgZmlsbD0iYmxhY2siLz4KPC9zdmc+Cg==)}.ag-charts-icon-arrow-up-drawing{--icon: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0xNCAxMkgxOC41TDEwIDJMMS41IDEySDZMNi4wMDAwMiAxN0gxNFYxMlpNMTMgMTZWMTFIMTYuMzM3NkwxMCAzLjU0NDA1TDMuNjYyNDQgMTFIN0w3LjAwMDAyIDE2SDEzWiIgZmlsbD0iYmxhY2siLz4KPC9zdmc+Cg==)}.ag-charts-icon-callout-annotation{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzAwMCIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNMyA0LjVBMS41IDEuNSAwIDAgMSA0LjUgM2gxMUExLjUgMS41IDAgMCAxIDE3IDQuNXY4YTEuNSAxLjUgMCAwIDEtMS41IDEuNWgtNC41MTRhMjYgMjYgMCAwIDAtMi4wMTcgMS41NGwtLjMxNC4yNmMtLjU1LjQ1Ny0xLjExNS45MjYtMS43NiAxLjQtLjY2OS40OTEtMS41NjItLjAxMi0xLjU2Mi0uOFYxNEg0LjVBMS41IDEuNSAwIDAgMSAzIDEyLjV6TTQuNSA0YS41LjUgMCAwIDAtLjUuNXY4YS41LjUgMCAwIDAgLjUuNWgxLjgzM3YzLjM3MmEzNiAzNiAwIDAgMCAxLjY3OC0xLjMzOGwuMzItLjI2NWEyNiAyNiAwIDAgMSAyLjIyNS0xLjY4NWwuMTI2LS4wODRIMTUuNWEuNS41IDAgMCAwIC41LS41di04YS41LjUgMCAwIDAtLjUtLjV6IiBjbGlwLXJ1bGU9ImV2ZW5vZGQiLz48L3N2Zz4=)}.ag-charts-icon-candlestick-series{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzEzMTcyMiIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNNyAxdjNoMnYxMkg3djNINnYtM0g0VjRoMlYxek01IDVoM3YxMEg1ek0xMSAxNFY2aDJWMy4yNWgxVjZoMnY4aC0ydjIuNzVoLTFWMTR6bTEtN2gzdjZoLTN6IiBjbGlwLXJ1bGU9ImV2ZW5vZGQiLz48L3N2Zz4=)}.ag-charts-icon-chevron-filled-down{--icon: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAxNiAxNiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBkPSJNMy42NjcgNS4zMzQgOCAxMC42NjdsNC4zMzQtNS4zMzN6IiBmaWxsPSIjMTgxZDFmIi8+PC9zdmc+)}.ag-charts-icon-chevron-right{--icon: url(data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgMjAgMjAiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik03LjQ3IDUuNDdhLjc1Ljc1IDAgMCAxIDEuMDYgMGw0IDRhLjc1Ljc1IDAgMCAxIDAgMS4wNmwtNCA0YS43NS43NSAwIDAgMS0xLjA2LTEuMDZMMTAuOTQgMTAgNy40NyA2LjUzYS43NS43NSAwIDAgMSAwLTEuMDYiIGZpbGw9IiMwMDAiLz48L3N2Zz4=)}.ag-charts-icon-close{--icon: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBkPSJtNSA1IDEwIDEwTTUgMTUgMTUgNSIgc3Ryb2tlPSIjMDAwIi8+PC9zdmc+)}.ag-charts-icon-comment-annotation{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzAwMCIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNNy41MTMgMy45OTVhNi41IDYuNSAwIDAgMSA2LjA5OCAxMS40MWMtLjU4OC4zOTMtMS4yMTcuNTM2LTEuODI5LjU4NWExMyAxMyAwIDAgMS0xLjI3LjAxN0EyNyAyNyAwIDAgMCAxMCAxNkg0LjVhLjUuNSAwIDAgMS0uNS0uNVYxMHEwLS4yNDctLjAwNy0uNTEzYy0uMDA4LS40MTYtLjAxNi0uODU3LjAxNy0xLjI2OS4wNS0uNjEyLjE5Mi0xLjI0LjU4NS0xLjgzYTYuNSA2LjUgMCAwIDEgMi45MTgtMi4zOTNtMy41Ni42MWE1LjUgNS41IDAgMCAwLTUuNjQ2IDIuMzRjLS4yNjYuMzk3LS4zNzkuODQyLS40MiAxLjM1NC0uMDMuMzYtLjAyMi43MTgtLjAxNSAxLjEwOFE1IDkuNjg5IDUgMTB2NWg1cS4zMTEuMDAxLjU5My4wMDhjLjM5LjAwNy43NDcuMDE1IDEuMTA4LS4wMTUuNTEyLS4wNDEuOTU3LS4xNTQgMS4zNTUtLjQyYTUuNSA1LjUgMCAwIDAtMS45ODMtOS45NjciIGNsaXAtcnVsZT0iZXZlbm9kZCIvPjwvc3ZnPg==)}.ag-charts-icon-crosshair-add-line{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzAwMCIgZD0iTTEwIDUuNWEuNS41IDAgMCAxIC41LjV2My41aDMuODc1YS41LjUgMCAwIDEgMCAxSDEwLjV2NC4yNWEuNS41IDAgMSAxLTEgMFYxMC41SDUuNjI1YS41LjUgMCAxIDEgMC0xSDkuNVY2YS41LjUgMCAwIDEgLjUtLjUiLz48L3N2Zz4=)}.ag-charts-icon-date-range-drawing{--icon: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBkPSJNMiAyaDF2MTZIMnptMTUgMGgxdjE2aC0xeiIgZmlsbD0iIzE4MUQxRiIvPjxwYXRoIGQ9Ik0xMy4xNTcgMTFINXYtMWg3Ljc5M0wxMSA4LjIwN2wuNzA3LS43MDcgMy4xODIgMy4xODItMy4xODIgMy4xODItLjcwNy0uNzA3eiIgZmlsbD0iIzAwMCIvPjwvc3ZnPg==)}.ag-charts-icon-date-price-range-drawing{--icon: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBkPSJNMyAySDJ2MTZoMXptMy41MDcgNC44OUw4LjUgNC44OTVWMTBINXYxaDMuNXY3aDF2LTdoNS4wODhsLTEuOTU3IDEuOTU3LjcwNy43MDcgMy4xODItMy4xODJMMTMuMzM4IDcuM2wtLjcwNy43MDdMMTQuNjI0IDEwSDkuNVY0LjkzMmwxLjk1NyAxLjk1Ny43MDctLjcwN0w4Ljk4MiAzIDUuOCA2LjE4MnoiIGZpbGw9IiMxODFEMUYiLz48L3N2Zz4=)}.ag-charts-icon-delete{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzEzMTcyMiIgZD0iTTguNDk2IDguOTk2QS41LjUgMCAwIDEgOSA5LjQ5MnY0YS41LjUgMCAxIDEtMSAuMDA4di00YS41LjUgMCAwIDEgLjQ5Ni0uNTA0TTEyIDkuNWEuNS41IDAgMCAwLTEgMHY0YS41LjUgMCAwIDAgMSAweiIvPjxwYXRoIGZpbGw9IiMxMzE3MjIiIGZpbGwtcnVsZT0iZXZlbm9kZCIgZD0iTTYgNVYzLjVBMi41IDIuNSAwIDAgMSA4LjUgMWgzQTIuNSAyLjUgMCAwIDEgMTQgMy41VjVoMi44MzNhLjUuNSAwIDAgMSAwIDFIMTV2MTAuMjVjMCAuNDE1LS4wNjYuODYzLS4zIDEuMjIxLS4yNTcuMzk0LS42NzIuNjEyLTEuMi42MTJoLTdjLS41MjggMC0uOTQzLS4yMTgtMS4yLS42MTItLjIzNC0uMzU4LS4zLS44MDYtLjMtMS4yMjFWNkgzLjMzM2EuNS41IDAgMCAxIDAtMXptMS0xLjVBMS41IDEuNSAwIDAgMSA4LjUgMmgzQTEuNSAxLjUgMCAwIDEgMTMgMy41VjVIN3pNNiAxNi4yNVY2aDh2MTAuMjVjMCAuMzM1LS4wNTkuNTU0LS4xMzguNjc1LS4wNTUuMDg1LS4xNC4xNTgtLjM2Mi4xNThoLTdjLS4yMjIgMC0uMzA3LS4wNzMtLjM2Mi0uMTU4LS4wOC0uMTIxLS4xMzgtLjM0LS4xMzgtLjY3NSIgY2xpcC1ydWxlPSJldmVub2RkIi8+PC9zdmc+)}.ag-charts-icon-disjoint-channel,.ag-charts-icon-disjoint-channel-drawing{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzEzMTcyMiIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNMTkuMDI4IDE3LjQ2YTIuMjUgMi4yNSAwIDAgMC00LjA5Mi0xLjg1bC05LjUxMS0yLjM3OGEyLjI1IDIuMjUgMCAxIDAtLjIyNS45NzRsOS40NzUgMi4zNjlhMi4yNTEgMi4yNTEgMCAwIDAgNC4zNTMuODg2bS0xLjY2Mi0xLjk2NWExLjI1IDEuMjUgMCAxIDEtLjg4NSAyLjMzOCAxLjI1IDEuMjUgMCAwIDEgLjg4NS0yLjMzOE00LjM0MyAxMy42NjlhMS4yNSAxLjI1IDAgMSAwLTIuMzM4LS44ODUgMS4yNSAxLjI1IDAgMCAwIDIuMzM4Ljg4NU0zLjk3IDguNzY5YTIuMjUgMi4yNSAwIDAgMCAxLjQ1NS0yLjExbDkuNTExLTIuMzc4YTIuMjUgMi4yNSAwIDEgMC0uMjYtLjk2NUw1LjIgNS42ODVhMi4yNSAyLjI1IDAgMSAwLTEuMjMgMy4wODRtLjM3My0yLjU0N2ExLjI1IDEuMjUgMCAxIDEtMi4zMzguODg1IDEuMjUgMS4yNSAwIDAgMSAyLjMzOC0uODg1bTEzLjc1LTMuNDM4YTEuMjUgMS4yNSAwIDEgMS0yLjMzOC44ODUgMS4yNSAxLjI1IDAgMCAxIDIuMzM4LS44ODUiIGNsaXAtcnVsZT0iZXZlbm9kZCIvPjwvc3ZnPg==)}.ag-charts-icon-drag-handle{--icon: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48Y2lyY2xlIGN4PSI1Ljc1IiBjeT0iNy43NSIgcj0iLjc1IiBmaWxsPSIjMDAwIiBmaWxsLW9wYWNpdHk9Ii41Ii8+PGNpcmNsZSBjeD0iOS43NSIgY3k9IjcuNzUiIHI9Ii43NSIgZmlsbD0iIzAwMCIgZmlsbC1vcGFjaXR5PSIuNSIvPjxjaXJjbGUgY3g9IjEzLjc1IiBjeT0iNy43NSIgcj0iLjc1IiBmaWxsPSIjMDAwIiBmaWxsLW9wYWNpdHk9Ii41Ii8+PGNpcmNsZSBjeD0iMTMuNzUiIGN5PSIxMS43NSIgcj0iLjc1IiBmaWxsPSIjMDAwIiBmaWxsLW9wYWNpdHk9Ii41Ii8+PGNpcmNsZSBjeD0iOS43NSIgY3k9IjExLjc1IiByPSIuNzUiIGZpbGw9IiMwMDAiIGZpbGwtb3BhY2l0eT0iLjUiLz48Y2lyY2xlIGN4PSI1Ljc1IiBjeT0iMTEuNzUiIHI9Ii43NSIgZmlsbD0iIzAwMCIgZmlsbC1vcGFjaXR5PSIuNSIvPjwvc3ZnPg==)}.ag-charts-icon-fibonacci-retracement-drawing{--icon: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBmaWxsPSIjMDAwIiBkPSJNMiA1aDEydjFIMnoiLz48Y2lyY2xlIGN4PSIxNS43NSIgY3k9IjUuNSIgcj0iMS43NSIgc3Ryb2tlPSIjMDAwIi8+PGNpcmNsZSBjeD0iNC4yNSIgY3k9IjE0LjUiIHI9IjEuNzUiIHN0cm9rZT0iIzAwMCIvPjxwYXRoIGZpbGw9IiMwMDAiIGQ9Ik0xOCAxNUg2di0xaDEyem0wLTQuNUgydi0xaDE2eiIvPjwvc3ZnPg==)}.ag-charts-icon-fibonacci-retracement-trend-based-drawing{--icon: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBmaWxsPSIjMDAwIiBkPSJtNC45OTYgMTIuNjc0IDMuMjkxLTUuNzQzLjg2OC40OTctMy4yOTEgNS43NDN6Ii8+PGNpcmNsZSBjeD0iOS43NSIgY3k9IjUuNSIgcj0iMS43NSIgc3Ryb2tlPSIjMDAwIi8+PGNpcmNsZSBjeD0iNC4zNTEiIGN5PSIxNC41IiByPSIxLjc1IiBzdHJva2U9IiMwMDAiLz48cGF0aCBmaWxsPSIjMDAwIiBkPSJNMTggNmgtN1Y1aDd6bTAgNC41aC03di0xaDd6bTAgNC41SDZ2LTFoMTJ6Ii8+PC9zdmc+)}.ag-charts-icon-fill-color{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzAwMCIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJtOC4wNzEgNC4wNi0uOTI0LS45MjQuNzA3LS43MDcgNy4yODggNy4yODgtNC45NSA0Ljk1YTMuNSAzLjUgMCAwIDEtNC45NSAwbC0xLjQxNC0xLjQxNGEzLjUgMy41IDAgMCAxIDAtNC45NXptLjcwNy43MDhMNC41MzYgOS4wMWEyLjUgMi41IDAgMCAwIDAgMy41MzZMNS45NSAxMy45NmEyLjUgMi41IDAgMCAwIDMuNTM1IDBsNC4yNDMtNC4yNDN6bTYuOSA3LjIwMi0uMzQ1LjM2My0uMzQ0LS4zNjNhLjUuNSAwIDAgMSAuNjg4IDBtLS4zNDUgMS4wOGE4IDggMCAwIDAtLjI4LjMyMyA0LjMgNC4zIDAgMCAwLS40MDkuNTgyYy0uMTEzLjIwMS0uMTQ0LjMyNi0uMTQ0LjM3OGEuODMzLjgzMyAwIDAgMCAxLjY2NyAwYzAtLjA1Mi0uMDMxLS4xNzctLjE0NC0uMzc4YTQuMyA0LjMgMCAwIDAtLjQxLS41ODIgOCA4IDAgMCAwLS4yOC0uMzIybS0uMzQ0LTEuMDguMzQ0LjM2My4zNDQtLjM2My4wMDIuMDAyLjAwNC4wMDQuMDEzLjAxMmE2IDYgMCAwIDEgLjIwNi4yMDhjLjEzMS4xMzYuMzA4LjMyNy40ODUuNTQ1LjE3Ni4yMTUuMzYzLjQ2Ny41MDcuNzI0LjEzNy4yNDMuMjczLjU1My4yNzMuODY4YTEuODMzIDEuODMzIDAgMSAxLTMuNjY3IDBjMC0uMzE1LjEzNi0uNjI1LjI3My0uODY4LjE0NC0uMjU3LjMzLS41MDkuNTA3LS43MjRhOSA5IDAgMCAxIC42NDUtLjcwOGwuMDQ2LS4wNDUuMDEzLS4wMTIuMDA0LS4wMDR6IiBjbGlwLXJ1bGU9ImV2ZW5vZGQiLz48L3N2Zz4=)}.ag-charts-icon-high-low-series{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzEzMTcyMiIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNNyA0aDJ2MTJINFY0aDNNNSA1aDN2MTBINXpNMTEgMTRWNmg1djhoLTVtMS03aDN2NmgtM3oiIGNsaXAtcnVsZT0iZXZlbm9kZCIvPjwvc3ZnPg==)}.ag-charts-icon-hlc-series{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzEzMTcyMiIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJtMTguMTYzIDEuODM3LTUuMzM0IDExLjYyMUw2Ljk1NyA4LjEybC00LjE5OSA5LjYyMi0uOTE2LS40IDQuNzU2LTEwLjlMMTIuNDkgMTEuOCAxNy4yNTQgMS40MnoiIGNsaXAtcnVsZT0iZXZlbm9kZCIvPjxwYXRoIGZpbGw9IiMwMDAiIGZpbGwtb3BhY2l0eT0iLjQiIGZpbGwtcnVsZT0iZXZlbm9kZCIgZD0iTTUuODI1IDIuNzA0LjU1IDEzLjc4NWwuOTAyLjQzIDQuNzI0LTkuOTE5IDYuMDM0IDUuMDI5IDMuMjU1LTguMTQtLjkyOC0uMzctMi43NDUgNi44NnptNy44NTIgMTQuNjM2IDUuNzgtMTMuMTM5LS45MTUtLjQwMi01LjIxOSAxMS44Ni02LjAwNS01LjUwNC0zLjI3OCA3LjY0OC45Mi4zOTQgMi43MjItNi4zNTJ6IiBjbGlwLXJ1bGU9ImV2ZW5vZGQiLz48L3N2Zz4=)}.ag-charts-icon-hollow-candlestick-series{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzEzMTcyMiIgZmlsbC1vcGFjaXR5PSIuMTUiIGQ9Ik01IDVoM3YxMEg1eiIvPjxwYXRoIGZpbGw9IiMxMzE3MjIiIGZpbGwtcnVsZT0iZXZlbm9kZCIgZD0iTTcgMXYzaDJ2MTJIN3YzSDZ2LTNINFY0aDJWMXpNNSA1aDN2MTBINXptNyAyaDN2NmgtM3ptLTEgN1Y2aDJWMy4yNWgxVjZoMnY4aC0ydjIuNzVoLTFWMTR6IiBjbGlwLXJ1bGU9ImV2ZW5vZGQiLz48L3N2Zz4=)}.ag-charts-icon-horizontal-line,.ag-charts-icon-horizontal-line-drawing{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzEzMTcyMiIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNLjUgOS41aDcuMzA2YTIuMjUgMi4yNSAwIDAgMSA0LjM4OCAwSDE5LjV2MWgtNy4zMDZhMi4yNSAyLjI1IDAgMCAxLTQuMzg4IDBILjV6bTkuNSAxLjc1YTEuMjUgMS4yNSAwIDEgMCAwLTIuNSAxLjI1IDEuMjUgMCAwIDAgMCAyLjUiIGNsaXAtcnVsZT0iZXZlbm9kZCIvPjwvc3ZnPg==)}.ag-charts-icon-line-color{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzAwMCIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNMTQuMjQyIDIuNzIyYy0uNjEyIDAtMS4yLjI0My0xLjYzMi42NzVsLTEuMzQzIDEuMzQ0YS41LjUgMCAwIDAtLjExMi4xMTJMNC4wNSAxMS45NTljLS4yMDcuMjA3LS4zNi40Ni0uNDQ2Ljc0di4wMDFsLS42OSAyLjc2N3YuMDAyYS44Mi44MiAwIDAgMCAxLjAyMiAxLjAyMWguMDAybDIuNjM0LS44MjJjLjI4LS4wODUuNTM0LS4yMzcuNzQtLjQ0M2w3LjEwNy03LjEwOGEuNS41IDAgMCAwIC4xMTItLjExMmwxLjM0My0xLjM0M2EyLjMwOCAyLjMwOCAwIDAgMC0xLjYzMi0zLjk0TTE0LjEyMiA3bDEuMDQ0LTEuMDQ1YTEuMzA4IDEuMzA4IDAgMSAwLTEuODQ5LTEuODVMMTIuMjcxIDUuMTV6bS0yLjU1OC0xLjE0Mi02LjgwNyA2LjgwOWEuOC44IDAgMCAwLS4xOTYuMzI1bC0uNzUgMi40NjggMi40Ny0uNzQ5YS44LjggMCAwIDAgLjMyNS0uMTk0bDYuODA4LTYuODF6IiBjbGlwLXJ1bGU9ImV2ZW5vZGQiLz48L3N2Zz4=)}.ag-charts-icon-line-series{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzEzMTcyMiIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJtMTcuMzYyIDQuODczLTQuNTk0IDYuNjU0LTQuODUtMy4zMTctNC4yNTEgNi45NzctLjg1NC0uNTJMNy42MTIgNi43OWw0Ljg5OSAzLjM1IDQuMDI4LTUuODM2eiIgY2xpcC1ydWxlPSJldmVub2RkIi8+PC9zdmc+)}.ag-charts-icon-line-style-dashed{--icon: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBmaWxsPSIjMDAwIiBkPSJNMiA5aDR2MUgyem0xMiAwaDR2MWgtNHpNOCA5aDR2MUg4eiIvPjwvc3ZnPg==)}.ag-charts-icon-line-style-dotted{--icon: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48Y2lyY2xlIGN4PSIyLjUiIGN5PSI5LjUiIHI9Ii41IiBmaWxsPSIjMDAwIi8+PGNpcmNsZSBjeD0iNC41IiBjeT0iOS41IiByPSIuNSIgZmlsbD0iIzAwMCIvPjxjaXJjbGUgY3g9IjYuNSIgY3k9IjkuNSIgcj0iLjUiIGZpbGw9IiMwMDAiLz48Y2lyY2xlIGN4PSI4LjUiIGN5PSI5LjUiIHI9Ii41IiBmaWxsPSIjMDAwIi8+PGNpcmNsZSBjeD0iMTAuNSIgY3k9IjkuNSIgcj0iLjUiIGZpbGw9IiMwMDAiLz48Y2lyY2xlIGN4PSIxMi41IiBjeT0iOS41IiByPSIuNSIgZmlsbD0iIzAwMCIvPjxjaXJjbGUgY3g9IjE0LjUiIGN5PSI5LjUiIHI9Ii41IiBmaWxsPSIjMDAwIi8+PGNpcmNsZSBjeD0iMTYuNSIgY3k9IjkuNSIgcj0iLjUiIGZpbGw9IiMwMDAiLz48L3N2Zz4=)}.ag-charts-icon-line-style-solid{--icon: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBmaWxsPSIjMDAwIiBkPSJNMiA5aDE2djFIMnoiLz48L3N2Zz4=)}.ag-charts-icon-line-with-markers-series{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzEzMTcyMiIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJtMTguMTk4IDQuODg4LTMuNTU2IDQuOTE4YTIuMjUgMi4yNSAwIDEgMS0zLjg2Ni43NWwtMS40MzItLjlhMi4yNCAyLjI0IDAgMCAxLTIuMDA5LjQzNWwtMy44MjggNi40MjgtLjg2LS41MTJMNi40NSA5LjYyM2EyLjI1IDIuMjUgMCAxIDEgMy41MS0uNzYxbDEuMzI5LjgzNWEyLjI0IDIuMjQgMCAwIDEgMi41NTctLjQ5N2wzLjU0Mi00Ljg5OHptLTQuOTYgNS4xNTNhMS4yNSAxLjI1IDAgMSAwLS42NCAyLjQxOSAxLjI1IDEuMjUgMCAwIDAgLjY0LTIuNDE5TTkuMSA4LjMyMXEuMDY2LS4xOTIuMDY3LS40MDRhMS4yNSAxLjI1IDAgMSAwLS4wNjcuNDA0IiBjbGlwLXJ1bGU9ImV2ZW5vZGQiLz48L3N2Zz4=)}.ag-charts-icon-lock,.ag-charts-icon-locked{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzAwMCIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNMTAuMjA3IDMuNzY0YTIuODk0IDIuODk0IDAgMCAwLTIuODk1IDIuODk0VjloNS43ODlWNi42NThhMi44OTQgMi44OTQgMCAwIDAtMi44OTUtMi44OTRNMTQuMSA5VjYuNjU4YTMuODk0IDMuODk0IDAgMSAwLTcuNzg5IDB2Mi4zNDlBMi41IDIuNSAwIDAgMCA0IDExLjV2M0EyLjUgMi41IDAgMCAwIDYuNSAxN2g4YTIuNSAyLjUgMCAwIDAgMi41LTIuNXYtM0EyLjUgMi41IDAgMCAwIDE0LjUgOXpNNi41IDEwQTEuNSAxLjUgMCAwIDAgNSAxMS41djNBMS41IDEuNSAwIDAgMCA2LjUgMTZoOGExLjUgMS41IDAgMCAwIDEuNS0xLjV2LTNhMS41IDEuNSAwIDAgMC0xLjUtMS41eiIgY2xpcC1ydWxlPSJldmVub2RkIi8+PC9zdmc+)}.ag-charts-icon-measurer-drawing{--icon: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0ibTQuNDYxIDEyLjcxIDEuNTMyLTEuNTMxIDEuNDE0IDEuNDE0LjcwNy0uNzA3TDYuNyAxMC40NzJsMS41MzItMS41MzMgMiAyIC43MDctLjcwNy0yLTIgNi4wMS02LjAxIDIuODMgMi44MjhMNS4wNSAxNy43NzggMi4yMjIgMTQuOTVsMS41MzItMS41MzIgMS40MTQgMS40MTQuNzA3LS43MDd6TS44MDggMTQuOTVsLjcwNy0uNzA3TDE0LjI0MyAxLjUxNWwuNzA3LS43MDcuNzA3LjcwNyAyLjgyOCAyLjgyOC43MDcuNzA3LS43MDcuNzA3TDUuNzU3IDE4LjQ4NWwtLjcwNy43MDctLjcwNy0uNzA3LTIuODI4LTIuODI4em0xMS4wNzgtNi44MzVMMTAuNDcgNi43bC43MDctLjcwNyAxLjQxNSAxLjQxNHptLjgyNC0zLjY1NCAxIDEgLjcwOC0uNzA3LTEtMXoiIGZpbGw9IiMxODFEMUYiLz48L3N2Zz4=)}.ag-charts-icon-note-annotation{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzAwMCIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNMyA0LjVBMS41IDEuNSAwIDAgMSA0LjUgM2gxMUExLjUgMS41IDAgMCAxIDE3IDQuNXY4YTEuNSAxLjUgMCAwIDEtMS41IDEuNWgtMy4yMWwtMS40NjkgMi41N2ExIDEgMCAwIDEtMS42ODIuMDg1TDcuMjQzIDE0SDQuNUExLjUgMS41IDAgMCAxIDMgMTIuNXpNNC41IDRhLjUuNSAwIDAgMC0uNS41djhhLjUuNSAwIDAgMCAuNS41aDMuMjU3bDIuMTk2IDMuMDc0TDExLjcxIDEzaDMuNzlhLjUuNSAwIDAgMCAuNS0uNXYtOGEuNS41IDAgMCAwLS41LS41eiIgY2xpcC1ydWxlPSJldmVub2RkIi8+PHBhdGggZmlsbD0iIzAwMCIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNNi41IDYuNUEuNS41IDAgMCAxIDcgNmg2YS41LjUgMCAwIDEgMCAxSDdhLjUuNSAwIDAgMS0uNS0uNU02LjUgOS41QS41LjUgMCAwIDEgNyA5aDZhLjUuNSAwIDAgMSAwIDFIN2EuNS41IDAgMCAxLS41LS41IiBjbGlwLXJ1bGU9ImV2ZW5vZGQiLz48L3N2Zz4=)}.ag-charts-icon-ohlc-series{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzEzMTcyMiIgZD0iTTEzIDExaC0zdi0xaDNWM2gxdjJoNHYxaC00djExaC0xek02IDE3di0yaDN2LTFINlY0SDV2MUgydjFoM3YxMXoiLz48L3N2Zz4=)}.ag-charts-icon-pan-end{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzAwMCIgZD0ibTYuNjQ2IDEzLjgxMy0uMzUzLjM1NC43MDcuNzA3LjM1NC0uMzU0ek0xMS4xNjYgMTBsLjM1NC4zNTQuMzU0LS4zNTQtLjM1NC0uMzU0ek03LjM1NSA1LjQ4IDcgNS4xMjZsLS43MDcuNzA3LjM1My4zNTR6bTAgOS4wNCA0LjE2Ni00LjE2Ni0uNzA3LS43MDgtNC4xNjcgNC4xNjd6bTQuMTY2LTQuODc0TDcuMzU0IDUuNDhsLS43MDguNzA3IDQuMTY3IDQuMTY3ek0xMy4wODMgNXYxMGgxVjV6Ii8+PC9zdmc+)}.ag-charts-icon-pan-left{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzAwMCIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNMTIuNzkgNS44MzMgOC42MjUgMTBsNC4xNjYgNC4xNjctLjcwNy43MDdMNy4yMSAxMGw0Ljg3My00Ljg3NHoiIGNsaXAtcnVsZT0iZXZlbm9kZCIvPjwvc3ZnPg==)}.ag-charts-icon-pan-right{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzAwMCIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNNy4yMSAxNC4xNjcgMTEuMzc2IDEwIDcuMjEgNS44MzNsLjcwNy0uNzA3TDEyLjc5IDEwbC00Ljg3MyA0Ljg3NHoiIGNsaXAtcnVsZT0iZXZlbm9kZCIvPjwvc3ZnPg==)}.ag-charts-icon-pan-start{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzAwMCIgZD0iTTYgNXYxMGgxVjV6TTkuNjI0IDEwbDQuMTY2LTQuMTY3LS43MDctLjcwN0w4LjIxIDEwbDQuODc0IDQuODc0LjcwNy0uNzA3eiIvPjwvc3ZnPg==)}.ag-charts-icon-parallel-channel,.ag-charts-icon-parallel-channel-drawing{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzEzMTcyMiIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNMTcuNzIgNS4zMzFBMi4yNSAyLjI1IDAgMSAwIDE0LjcwNSAzLjZsLTkuNDkgNC41NjJhMi4yNSAyLjI1IDAgMSAwIC4yMDkgMS4wMWw5LjY2Mi00LjY0NmEyLjI1IDIuMjUgMCAwIDAgMi42MzQuODA1bS4zNzMtMi41NDdhMS4yNSAxLjI1IDAgMSAxLTIuMzM4Ljg4NSAxLjI1IDEuMjUgMCAwIDEgMi4zMzgtLjg4NU00LjM0MyA4LjY3YTEuMjUgMS4yNSAwIDEgMS0yLjMzOC44ODUgMS4yNSAxLjI1IDAgMCAxIDIuMzM4LS44ODVNNS4zMDcgMTYuNzI4YTIuMjUgMi4yNSAwIDEgMS0uNTI1LS44NThsOS45MjMtNC43N2EyLjI1IDIuMjUgMCAxIDEgLjM4MS45MjZ6bS0uOTY0LjI3NGExLjI1IDEuMjUgMCAxIDEtMi4zMzguODg1IDEuMjUgMS4yNSAwIDAgMSAyLjMzOC0uODg1bTEzLjAyMy01LjEwNmExLjI1IDEuMjUgMCAxIDAtLjg4NS0yLjMzOSAxLjI1IDEuMjUgMCAwIDAgLjg4NSAyLjMzOSIgY2xpcC1ydWxlPSJldmVub2RkIi8+PC9zdmc+)}.ag-charts-icon-position-bottom{--icon: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBmaWxsPSIjMDAwIiBmaWxsLW9wYWNpdHk9Ii4yNSIgZD0iTTMgMTBoMTR2MUgzem0zLTNoOHYxSDZ6Ii8+PHBhdGggZmlsbD0iIzAwMCIgZD0iTTYgMTNoOHYxSDZ6Ii8+PC9zdmc+)}.ag-charts-icon-position-center{--icon: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBmaWxsPSIjMDAwIiBkPSJNMyAxMGgxNHYxSDN6Ii8+PHBhdGggZmlsbD0iIzAwMCIgZmlsbC1vcGFjaXR5PSIuMjUiIGQ9Ik02IDdoOHYxSDZ6bTAgNmg4djFINnoiLz48L3N2Zz4=)}.ag-charts-icon-position-top{--icon: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBmaWxsPSIjMDAwIiBmaWxsLW9wYWNpdHk9Ii4yNSIgZD0iTTMgMTBoMTR2MUgzeiIvPjxwYXRoIGZpbGw9IiMwMDAiIGQ9Ik02IDdoOHYxSDZ6Ii8+PHBhdGggZmlsbD0iIzAwMCIgZmlsbC1vcGFjaXR5PSIuMjUiIGQ9Ik02IDEzaDh2MUg2eiIvPjwvc3ZnPg==)}.ag-charts-icon-price-label-annotation{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzAwMCIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNNC41IDNBMS41IDEuNSAwIDAgMCAzIDQuNVYxM2ExLjUgMS41IDAgMCAwIDEuNSAxLjVoLjgzM3YuMDU3Yy4yNDItLjI5OS41OTctLjUwMyAxLS41NDhWMTMuNUg0LjVBLjUuNSAwIDAgMSA0IDEzVjQuNWEuNS41IDAgMCAxIC41LS41aDExYS41LjUgMCAwIDEgLjUuNXY4YS41LjUgMCAwIDEtLjUuNWgtNC44MThsLS4xMjYuMDg0YTI2IDI2IDAgMCAwLTIuMjI1IDEuNjg1bC0uMzIuMjY1LS4wNjguMDU2YTEuNSAxLjUgMCAwIDEtMi42MDkgMS4zNTRjLjAzMy43NjMuOTA1IDEuMjM4IDEuNTYuNzU2LjY0Ni0uNDc0IDEuMjEtLjk0MyAxLjc2MS0xLjRsLjMxMy0uMjZBMjYgMjYgMCAwIDEgMTAuOTg2IDE0SDE1LjVhMS41IDEuNSAwIDAgMCAxLjUtMS41di04QTEuNSAxLjUgMCAwIDAgMTUuNSAzeiIgY2xpcC1ydWxlPSJldmVub2RkIi8+PHBhdGggZmlsbD0iIzEzMTcyMiIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNOC43MTYgMTQuODE1YTIuMjUgMi4yNSAwIDEgMS00LjIxIDEuNTkzIDIuMjUgMi4yNSAwIDAgMSA0LjIxLTEuNTkzbS0xLjY2MiAxLjk2NmExLjI1IDEuMjUgMCAxIDAtLjg4NS0yLjMzOSAxLjI1IDEuMjUgMCAwIDAgLjg4NSAyLjMzOSIgY2xpcC1ydWxlPSJldmVub2RkIi8+PC9zdmc+)}.ag-charts-icon-price-range-drawing{--icon: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBkPSJNOS4wNDYgMTVWNS44NzdoLjk0MlYxNXoiIGZpbGw9IiMxODFEMUYiLz48cGF0aCBkPSJNOS4wNDYgMTVWNS44NzdoLjk0MlYxNXoiIGZpbGw9IiMxODFEMUYiLz48cGF0aCBkPSJNOS41IDYuMjI4IDcuMTY3IDguMzc2IDYuNSA3Ljc2MiA5LjUgNWwzIDIuNzYyLS42NjcuNjE0eiIgZmlsbD0iIzAwMCIvPjxwYXRoIGQ9Ik0yIDE4di0xaDE2djF6TTIgM1YyaDE2djF6IiBmaWxsPSIjMTgxRDFGIi8+PC9zdmc+)}.ag-charts-icon-reset{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzAwMCIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNMTIuMDQgNC40NDVhNS44MSA1LjgxIDAgMCAwLTcuMjU3IDIuNDUzLjUuNSAwIDAgMS0uODY1LS41MDJBNi44MSA2LjgxIDAgMSAxIDMgOS44MTNhLjUuNSAwIDAgMSAxIDAgNS44MSA1LjgxIDAgMSAwIDguMDQtNS4zNjgiIGNsaXAtcnVsZT0iZXZlbm9kZCIvPjxwYXRoIGZpbGw9IiMwMDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIgZD0iTTQuMjg5IDMuMDAyYS41LjUgMCAwIDEgLjUuNXYyLjY1NWgyLjY1NWEuNS41IDAgMCAxIDAgMUg0LjI5YS41LjUgMCAwIDEtLjUtLjVWMy41MDJhLjUuNSAwIDAgMSAuNS0uNSIgY2xpcC1ydWxlPSJldmVub2RkIi8+PC9zdmc+)}.ag-charts-icon-settings{--icon: url(data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgMjAgMjAiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSIgc3R5bGU9ImZpbGwtcnVsZTpldmVub2RkIj48cGF0aCBkPSJNMTAgMTNhMyAzIDAgMSAwIDAtNiAzIDMgMCAwIDAgMCA2bTAtMWEyIDIgMCAxIDEtLjAwMS0zLjk5OUEyIDIgMCAwIDEgMTAgMTIiLz48cGF0aCBkPSJNMi4zMSAxNC4zNDVjLS44MTctMS40OTEuMDI3LTIuNDk5LjQ3NC0yLjg2NS41MzEtLjQzNC45NjktLjM2NS45NzItMS40OC0uMDAzLTEuMTE1LS40NDEtMS4wNDYtLjk3Mi0xLjQ4MS0uNDU0LS4zNzEtMS4zMTctMS40MDUtLjQzNC0yLjkzNmwuMDA1LS4wMDljLjg4NC0xLjUyIDIuMjA3LTEuMjkgMi43NTUtMS4wODMuNjQxLjI0My44MDEuNjU2IDEuNzY4LjEwMS45NjQtLjU2LjY4Ni0uOTA0Ljc5Ni0xLjU4Mi4wOTQtLjU3OC41NTktMS44NDMgMi4zMjYtMS44NDNoLjAxYzEuNzU5LjAwNSAyLjIyMiAxLjI2NiAyLjMxNiAxLjg0My4xMS42NzgtLjE2OCAxLjAyMi43OTYgMS41ODIuOTY3LjU1NSAxLjEyNy4xNDIgMS43NjgtLjEwMS41NDktLjIwOCAxLjg3Ni0uNDM4IDIuNzYgMS4wOTJzLjAyIDIuNTY1LS40MzQgMi45MzZjLS41MzEuNDM1LS45NjkuMzY2LS45NzIgMS40ODEuMDAzIDEuMTE1LjQ0MSAxLjA0Ni45NzIgMS40OC40NTQuMzcyIDEuMzE3IDEuNDA2LjQzNCAyLjkzN2wtLjAwNS4wMDljLS44ODQgMS41Mi0yLjIwNyAxLjI5LTIuNzU1IDEuMDgzLS42NDEtLjI0My0uODAxLS42NTYtMS43NjgtLjEwMS0uOTY0LjU2LS42ODYuOTA0LS43OTYgMS41ODEtLjA5NC41NzktLjU1OSAxLjg0NC0yLjMyNiAxLjg0NGgtLjAxYy0xLjc1OS0uMDA1LTIuMjIyLTEuMjY2LTIuMzE2LTEuODQ0LS4xMS0uNjc3LjE2OC0xLjAyMS0uNzk2LTEuNTgxLS45NjctLjU1NS0xLjEyNy0uMTQyLTEuNzY4LjEwMS0uNTQ5LjIwOC0xLjg3Ni40MzgtMi43Ni0xLjA5MmwtLjAyLS4wMzZ6TTkuOTg0IDIuMTYySDEwYzEuMzU1IDAgMS4zNDIgMS4wMzkgMS4zNTMgMS40MjUuMDA4LjMxMi4wNCAxLjE2IDEuMjU5IDEuODcybC4wMTUuMDA4YzEuMjI1LjcgMS45NzYuMzA0IDIuMjUxLjE1NS4zMzctLjE4MyAxLjIyNi0uNzExIDEuOTAyLjQ0NWwuMDA4LjAxNGMuNjc4IDEuMTczLS4yMjkgMS42ODItLjU1OCAxLjg4NC0uMjY2LjE2My0uOTg0LjYxNS0uOTkxIDIuMDI3di4wMTZjLjAwNyAxLjQxMi43MjUgMS44NjQuOTkxIDIuMDI3LjMyOC4yMDEgMS4yMjkuNzA3LjU2NiAxLjg3bC0uMDA4LjAxNGMtLjY3NyAxLjE3NC0xLjU3MS42NDMtMS45MS40NTktLjI3NS0uMTQ5LTEuMDI2LS41NDUtMi4yNTEuMTU0bC0uMDE1LjAwOWMtMS4yMTkuNzEyLTEuMjUxIDEuNTYtMS4yNTkgMS44NzItLjAxMS4zODYuMDAyIDEuNDI1LTEuMzUzIDEuNDI1cy0xLjM0Mi0xLjAzOS0xLjM1My0xLjQyNWMtLjAwOC0uMzEyLS4wNC0xLjE2LTEuMjU5LTEuODcybC0uMDE1LS4wMDljLTEuMjI1LS42OTktMS45NzYtLjMwMy0yLjI1MS0uMTU0LS4zMzYuMTgzLTEuMjE5LjcwNi0xLjg5NC0uNDMybC0uMDE2LS4wMjdjLS42NzgtMS4xNzQuMjI5LTEuNjgyLjU1OC0xLjg4NC4yNjYtLjE2My45ODQtLjYxNS45OTEtMi4wMjd2LS4wMTZjLS4wMDctMS40MTItLjcyNS0xLjg2NC0uOTkxLTIuMDI3LS4zMjgtLjIwMS0xLjIyOS0uNzA3LS41NjYtMS44N2wuMDA4LS4wMTRjLjY3Ny0xLjE3NCAxLjU3MS0uNjQzIDEuOTEtLjQ1OS4yNzUuMTQ5IDEuMDI2LjU0NSAyLjI1MS0uMTU1bC4wMTUtLjAwOGMxLjIxOS0uNzEyIDEuMjUxLTEuNTYgMS4yNTktMS44NzIuMDEtLjM4NC0uMDAyLTEuNDE3IDEuMzM3LTEuNDI1Ii8+PC9zdmc+)}.ag-charts-icon-step-line-series{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzE4MUQxRiIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNNiA0aDV2OGgzVjhoNXYxaC00djRoLTVWNUg3djEwSDJ2LTFoNHoiIGNsaXAtcnVsZT0iZXZlbm9kZCIvPjwvc3ZnPg==)}.ag-charts-icon-text-annotation{--icon: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik00IDRIMTZWN0gxNVY1SDEwLjVWMTVIMTRWMTZINlYxNUg5LjVWNUg1VjdINFY0WiIgZmlsbD0iYmxhY2siLz4KPC9zdmc+Cg==)}.ag-charts-icon-trend-line,.ag-charts-icon-trend-line-drawing{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzEzMTcyMiIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNNS4zMTQgMTAuOTM4YTIuMjUgMi4yNSAwIDEgMSAuMDEtMWg5LjM1MmEyLjI1IDIuMjUgMCAxIDEgLjAxIDF6bS0yLjE4OS43MjlhMS4yNSAxLjI1IDAgMSAwIDAtMi41IDEuMjUgMS4yNSAwIDAgMCAwIDIuNW0xMy43NSAwYTEuMjUgMS4yNSAwIDEgMCAwLTIuNSAxLjI1IDEuMjUgMCAwIDAgMCAyLjUiIGNsaXAtcnVsZT0iZXZlbm9kZCIvPjwvc3ZnPg==)}.ag-charts-icon-unlock,.ag-charts-icon-unlocked{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzAwMCIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNMTAuNjUxIDMuNWEyLjg5NCAyLjg5NCAwIDAgMC0yLjg5NCAyLjg5NFY5SDE0LjVhMi41IDIuNSAwIDAgMSAyLjUgMi41djNhMi41IDIuNSAwIDAgMS0yLjUgMi41aC04QTIuNSAyLjUgMCAwIDEgNCAxNC41di0zQTIuNSAyLjUgMCAwIDEgNi41IDloLjI1N1Y2LjM5NGEzLjg5NCAzLjg5NCAwIDEgMSA3Ljc4OSAwIC41LjUgMCAwIDEtMSAwQTIuODk0IDIuODk0IDAgMCAwIDEwLjY1IDMuNU02LjUgMTBBMS41IDEuNSAwIDAgMCA1IDExLjV2M0ExLjUgMS41IDAgMCAwIDYuNSAxNmg4YTEuNSAxLjUgMCAwIDAgMS41LTEuNXYtM2ExLjUgMS41IDAgMCAwLTEuNS0xLjV6IiBjbGlwLXJ1bGU9ImV2ZW5vZGQiLz48L3N2Zz4=)}.ag-charts-icon-vertical-line,.ag-charts-icon-vertical-line-drawing{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzEzMTcyMiIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNMTAuNSA3LjgwNmEyLjI1IDIuMjUgMCAwIDEgMCA0LjM4OFYxOS41aC0xdi03LjMwNmEyLjI1IDIuMjUgMCAwIDEgMC00LjM4OFYuNWgxem0tLjUuOTQ0YTEuMjUgMS4yNSAwIDEgMSAwIDIuNSAxLjI1IDEuMjUgMCAwIDEgMC0yLjUiIGNsaXAtcnVsZT0iZXZlbm9kZCIvPjwvc3ZnPg==)}.ag-charts-icon-zoom-in{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzAwMCIgZD0iTTEwIDUuNWEuNS41IDAgMCAxIC41LjV2My41aDMuODc1YS41LjUgMCAwIDEgMCAxSDEwLjV2NC4yNWEuNS41IDAgMSAxLTEgMFYxMC41SDUuNjI1YS41LjUgMCAxIDEgMC0xSDkuNVY2YS41LjUgMCAwIDEgLjUtLjUiLz48L3N2Zz4=)}.ag-charts-icon-zoom-out{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzAwMCIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNNS41IDEwYS41LjUgMCAwIDEgLjUtLjVoOGEuNS41IDAgMCAxIDAgMUg2YS41LjUgMCAwIDEtLjUtLjUiIGNsaXAtcnVsZT0iZXZlbm9kZCIvPjwvc3ZnPg==)}.ag-charts-icon-zoom-in-alt{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIiBzdHJva2U9ImN1cnJlbnRDb2xvciIgc3Ryb2tlLXdpZHRoPSIyIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiIGNsYXNzPSJsdWNpZGUgbHVjaWRlLXpvb20taW4iPjxjaXJjbGUgY3g9IjExIiBjeT0iMTEiIHI9IjgiLz48bGluZSB4MT0iMjEiIHgyPSIxNi42NSIgeTE9IjIxIiB5Mj0iMTYuNjUiLz48bGluZSB4MT0iMTEiIHgyPSIxMSIgeTE9IjgiIHkyPSIxNCIvPjxsaW5lIHgxPSI4IiB4Mj0iMTQiIHkxPSIxMSIgeTI9IjExIi8+PC9zdmc+)}.ag-charts-icon-zoom-out-alt{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIiBzdHJva2U9ImN1cnJlbnRDb2xvciIgc3Ryb2tlLXdpZHRoPSIyIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiIGNsYXNzPSJsdWNpZGUgbHVjaWRlLXpvb20tb3V0Ij48Y2lyY2xlIGN4PSIxMSIgY3k9IjExIiByPSI4Ii8+PGxpbmUgeDE9IjIxIiB4Mj0iMTYuNjUiIHkxPSIyMSIgeTI9IjE2LjY1Ii8+PGxpbmUgeDE9IjgiIHgyPSIxNCIgeTE9IjExIiB5Mj0iMTEiLz48L3N2Zz4=)}.ag-charts-input{--input-layer-active: 1;--input-layer-focus: 2;--input-padding: calc(var(--ag-charts-spacing) * 2);--input-padding-large: calc(var(--ag-charts-spacing) * 2.5);color:var(--ag-charts-input-text-color);font-family:var(--ag-charts-chrome-font-family);font-size:var(--ag-charts-chrome-font-size-large);transition-duration:.25s;transition-property:none;transition-timing-function:ease-out}.ag-charts-input:focus-visible{outline:var(--ag-charts-focus-border);box-shadow:var(--ag-charts-focus-border-shadow);z-index:var(--input-layer-focus)}.ag-charts-button{background:var(--ag-charts-button-background-color);border-color:var(--ag-charts-button-border-color);border-radius:var(--ag-charts-button-border-radius);border-style:solid;border-width:var(--ag-charts-button-border-width);color:var(--ag-charts-button-text-color);cursor:pointer;padding:var(--input-padding);transition-property:background,border-color}.ag-charts-button:hover{background:var(--ag-charts-focus-color)}.ag-charts-button:has(.ag-charts-icon){padding:2px}.ag-charts-checkbox{--checkbox-transition-duration: .1s;appearance:none;background:var(--ag-charts-checkbox-background-color);border-radius:calc(var(--ag-charts-input-border-radius) * 9);cursor:pointer;height:18px;margin:0;transition-duration:var(--checkbox-transition-duration);transition-property:margin;width:29px}.ag-charts-checkbox:before{display:block;background:var(--ag-charts-input-background-color);border-radius:calc(var(--ag-charts-input-border-radius) * 7);content:" ";height:14px;margin:2px;transition-duration:var(--checkbox-transition-duration);transition-property:margin;transition-timing-function:var(--ag-charts-input-transition-easing);width:14px}.ag-charts-checkbox:checked{background:var(--ag-charts-checkbox-checked-background-color)}.ag-charts-checkbox:checked:before{margin-inline-start:13px}.ag-charts-select{background:var(--ag-charts-input-background-color);border-color:var(--ag-charts-input-border-color);border-radius:var(--ag-charts-input-border-radius);border-style:solid;border-width:var(--ag-charts-input-border-width);padding:3px 2px 4px;font-size:inherit}.ag-charts-textarea{--textarea-line-height: 1.38;background:var(--ag-charts-input-background-color);border-color:var(--ag-charts-input-border-color);border-radius:var(--ag-charts-input-border-radius);border-style:solid;border-width:var(--ag-charts-input-border-width);line-height:var(--textarea-line-height);font-family:var(--ag-charts-chrome-font-family);font-size:var(--ag-charts-chrome-font-size-large);padding:var(--input-padding-large) var(--input-padding)}.ag-charts-textarea::placeholder{color:var(--ag-charts-input-placeholder-text-color)}.ag-charts-proxy-container{pointer-events:none;position:absolute}.ag-charts-proxy-legend-toolbar{pointer-events:auto}.ag-charts-proxy-legend-toolbar>div[role=listitem]{pointer-events:none}.ag-charts-proxy-elem{-webkit-appearance:none;appearance:none;background:none;border:none;color:#0000;overflow:hidden;pointer-events:auto;position:absolute}.ag-charts-proxy-elem::-moz-range-thumb,.ag-charts-proxy-elem::-moz-range-track{opacity:0}.ag-charts-proxy-elem::-webkit-slider-runnable-track,.ag-charts-proxy-elem::-webkit-slider-thumb{opacity:0}.ag-charts-proxy-elem[data-focus-override=true],.ag-charts-proxy-elem:focus-visible{outline:var(--ag-charts-focus-border);box-shadow:var(--ag-charts-focus-border-shadow)}.ag-charts-proxy-elem[data-focus-override=false]{outline:none;box-shadow:none}.ag-charts-proxy-elem svg{display:block}.ag-charts-proxy-scrollbar-slider:focus-visible{outline:none;box-shadow:none}.ag-charts-proxy-scrollbar-thumb-focus{border:var(--ag-charts-focus-border);box-shadow:var(--ag-charts-focus-border-shadow);box-sizing:border-box;opacity:0;pointer-events:none}.ag-charts-proxy-scrollbar-slider:focus-visible~.ag-charts-proxy-scrollbar-thumb-focus{opacity:1}.ag-charts-focus-indicator{position:absolute;display:block;pointer-events:none;user-select:none;-webkit-user-select:none;width:100%;height:100%}.ag-charts-focus-indicator>div{position:absolute;outline:solid 1px var(--ag-charts-chrome-background-color);box-shadow:var(--ag-charts-focus-shadow)}.ag-charts-focus-indicator>svg{width:100%;height:100%;fill:none;overflow:visible}.ag-charts-focus-svg-outer-path{stroke:var(--ag-charts-chrome-background-color);stroke-width:4px}.ag-charts-focus-svg-inner-path{stroke:var(--ag-charts-accent-color);stroke-width:2px}.ag-charts-overlay{color:#181d1f;pointer-events:none}.ag-charts-overlay.ag-charts-dark-overlay{color:#fff}.ag-charts-overlay--loading{color:#8c8c8c}.ag-charts-overlay__loading-background{background:#fff;pointer-events:none}.ag-charts-overlay.ag-charts-dark-overlay .ag-charts-overlay__loading-background{background:#192232}.ag-charts-validation-overlay{pointer-events:none;box-sizing:border-box;display:flex;align-items:center;justify-content:center;width:100%;height:100%;padding:12px;text-align:left;font-family:var(--ag-charts-font-family);font-size:var(--ag-charts-font-size)}.ag-charts-validation-overlay__panel{pointer-events:auto;user-select:text;-webkit-user-select:text;box-sizing:border-box;display:flex;flex-direction:column;max-width:min(640px,100%);max-height:100%;overflow:hidden;color:#181d1f;background:#fff;border:2px solid #d36f78;border-radius:6px;box-shadow:0 1px 4px 1px #00000040}.ag-charts-overlay.ag-charts-dark-overlay .ag-charts-validation-overlay__panel{color:#fff;background:#192232;border-color:#a94750;box-shadow:0 1px 4px 1px #00000080}.ag-charts-validation-overlay__header{display:flex;flex:none;align-items:center;gap:8px;padding:10px 12px;color:#cc222b}.ag-charts-overlay.ag-charts-dark-overlay .ag-charts-validation-overlay__header{color:#ff5c66}.ag-charts-validation-overlay__summary{flex:1;font-weight:700}.ag-charts-validation-overlay__actions{display:flex;flex-shrink:0;gap:4px}.ag-charts-validation-overlay__button{pointer-events:auto;cursor:pointer;padding:2px 8px;border:1px solid rgba(0,0,0,.2);border-radius:4px;background:#fff;color:#181d1f;font:inherit}.ag-charts-validation-overlay__button:hover{background:#0000000f}.ag-charts-overlay.ag-charts-dark-overlay .ag-charts-validation-overlay__button{border-color:#ffffff40;background:#192232;color:#fff}.ag-charts-overlay.ag-charts-dark-overlay .ag-charts-validation-overlay__button:hover{background:#ffffff1f}.ag-charts-validation-overlay__dismiss{display:flex;align-items:center;justify-content:center;width:24px;height:24px;padding:0;border-color:transparent;background:transparent;color:#181d1f;font-size:18px;line-height:1}.ag-charts-overlay.ag-charts-dark-overlay .ag-charts-validation-overlay__dismiss{background:transparent;color:#fff}.ag-charts-validation-overlay__body{display:flex;flex:1 1 auto;flex-direction:column;gap:16px;min-height:0;padding:12px;overflow:auto}.ag-charts-validation-overlay__section{display:flex;flex-direction:column;gap:12px}.ag-charts-validation-overlay__section-heading{margin:0;font-weight:700}.ag-charts-validation-overlay__divider{margin:0;border:none;border-top:1px solid rgba(0,0,0,.15)}.ag-charts-overlay.ag-charts-dark-overlay .ag-charts-validation-overlay__divider{border-top-color:#fff3}.ag-charts-validation-overlay__entry{display:flex;flex-direction:column;gap:6px;padding-inline-start:8px;border-inline-start:3px solid rgba(0,0,0,.2)}.ag-charts-validation-overlay__entry--error{border-inline-start-color:#cc222b}.ag-charts-validation-overlay__entry--warning{border-inline-start-color:#d98300}.ag-charts-validation-overlay__entry--deprecation{border-inline-start-color:#6b6b6b}.ag-charts-overlay.ag-charts-dark-overlay .ag-charts-validation-overlay__entry--error{border-inline-start-color:#ff5c66}.ag-charts-overlay.ag-charts-dark-overlay .ag-charts-validation-overlay__entry--warning{border-inline-start-color:#f0a94b}.ag-charts-overlay.ag-charts-dark-overlay .ag-charts-validation-overlay__entry--deprecation{border-inline-start-color:#9aa0a6}.ag-charts-validation-overlay__message{margin:0;line-height:1.5}.ag-charts-validation-overlay__term,.ag-charts-validation-overlay__code{font-family:monospace;background:#0000000f}.ag-charts-overlay.ag-charts-dark-overlay .ag-charts-validation-overlay__term,.ag-charts-overlay.ag-charts-dark-overlay .ag-charts-validation-overlay__code{background:#ffffff1f}.ag-charts-validation-overlay__term{padding:0 3px;border-radius:3px}.ag-charts-validation-overlay__code{margin:0;max-height:50vh;padding:8px;border:1px solid rgba(0,0,0,.15);border-radius:4px;font-size:.85em;white-space:pre-wrap;overflow:auto}.ag-charts-overlay.ag-charts-dark-overlay .ag-charts-validation-overlay__code{border-color:#fff3}.ag-charts-tooltip{--tooltip-arrow-size: 8px;--tooltip-row-spacing: 8px;--tooltip-column-spacing: 16px;position:fixed;inset:unset;margin:0;padding:0;overflow:visible;top:var(--top, 0px);left:var(--left, 0px);width:max-content;max-width:100%;font-family:var(--ag-charts-chrome-font-family);font-size:var(--ag-charts-chrome-font-size);font-weight:var(--ag-charts-chrome-font-weight);color:var(--ag-charts-tooltip-text-color);background:var(--ag-charts-tooltip-background-color);border-color:var(--ag-charts-tooltip-border-color);border-radius:var(--ag-charts-tooltip-border-radius);border-style:solid;border-width:var(--ag-charts-tooltip-border-width);box-shadow:var(--ag-charts-popup-shadow)}.ag-charts-tooltip--compact .ag-charts-tooltip-content{--tooltip-row-spacing: 2px;--tooltip-column-spacing: 8px;padding:3px 6px}.ag-charts-tooltip--arrow-top:before,.ag-charts-tooltip--arrow-right:before,.ag-charts-tooltip--arrow-bottom:before,.ag-charts-tooltip--arrow-left:before{content:"";position:absolute;display:block;width:var(--tooltip-arrow-size);height:var(--tooltip-arrow-size);border:inherit;border-bottom-color:transparent;border-right-color:transparent;background:inherit;clip-path:polygon(0 0,100% 0,100% 1px,1px 100%,0 100%)}.ag-charts-tooltip--arrow-top:before{bottom:100%;left:50%;transform:translate(-50%) translateY(calc(var(--tooltip-arrow-size) * .5)) rotate(45deg)}.ag-charts-tooltip--arrow-bottom:before{top:100%;left:50%;transform:translate(-50%) translateY(calc(var(--tooltip-arrow-size) * -.5)) rotate(225deg)}.ag-charts-tooltip--arrow-left:before{right:100%;top:50%;transform:translateY(-50%) translate(calc(var(--tooltip-arrow-size) * .5)) rotate(315deg)}.ag-charts-tooltip--arrow-right:before{left:100%;top:50%;transform:translateY(-50%) translate(calc(var(--tooltip-arrow-size) * -.5)) rotate(135deg)}.ag-charts-tooltip--no-interaction{pointer-events:none;user-select:none;-webkit-user-select:none}.ag-charts-tooltip--wrap-always{overflow-wrap:break-word;word-break:break-word;hyphens:none}.ag-charts-tooltip--wrap-hyphenate{overflow-wrap:break-word;word-break:break-word;hyphens:auto}.ag-charts-tooltip--wrap-on-space{overflow-wrap:normal;word-break:normal}.ag-charts-tooltip--wrap-never{white-space:nowrap}.ag-charts-tooltip-heading,.ag-charts-tooltip-title,.ag-charts-tooltip-label,.ag-charts-tooltip-value{overflow:hidden;text-overflow:ellipsis}.ag-charts-tooltip-content{display:grid;grid:auto-flow minmax(1em,auto) / 1fr;padding:8px 12px;gap:var(--tooltip-row-spacing)}.ag-charts-tooltip-content:has(.ag-charts-tooltip-symbol){grid:auto-flow minmax(1em,auto) / auto 1fr}.ag-charts-tooltip-heading{grid-column:1 / -1}.ag-charts-tooltip-symbol{grid-column:1 / 2;place-self:center}.ag-charts-tooltip-symbol svg{display:block}.ag-charts-tooltip-title{grid-column:-2 / -1}.ag-charts-tooltip-row{grid-column:1 / -1;display:flex;gap:var(--tooltip-column-spacing);align-items:baseline;justify-content:space-between;overflow:hidden}.ag-charts-tooltip-row--inline{grid-column:-2 / -1}.ag-charts-tooltip-label{flex:1;min-width:0}.ag-charts-tooltip-value{min-width:0}.ag-charts-tooltip-footer{grid-column:1 / -1;color:var(--ag-charts-tooltip-subtle-text-color);text-align:center}.ag-charts-popover{position:absolute;border-color:var(--ag-charts-border-color);border-radius:var(--ag-charts-border-radius);border-style:solid;border-width:var(--ag-charts-border-width);background:var(--ag-charts-panel-background-color);color:var(--ag-charts-chrome-text-color);font-family:var(--ag-charts-chrome-font-family);font-size:var(--ag-charts-chrome-font-size);font-weight:var(--ag-charts-chrome-font-weight);box-shadow:var(--ag-charts-popup-shadow);z-index:var(--ag-charts-layer-ui-overlay)}.ag-charts-menu{--item-padding: 6px 12px;--icon-color: var(--ag-charts-menu-text-color);display:grid;grid:auto-flow auto / 1fr;column-gap:12px;font-size:var(--ag-charts-chrome-font-size)}.ag-charts-menu:has(.ag-charts-menu__icon,.ag-charts-menu__row--stroke-width-visible){grid:auto-flow auto / auto 1fr}.ag-charts-menu__row--stroke-width-visible:before{content:"";height:var(--strokeWidth);width:12px;background:var(--icon-color)}.ag-charts-menu__row--stroke-width-visible[aria-disabled=true]:before{filter:grayscale(1);opacity:.5}.ag-charts-menu__row{display:grid;grid-column:1 / -1;grid-template-columns:subgrid;align-items:center;padding:var(--item-padding)}.ag-charts-menu__row:not(.ag-charts-menu__row--active){cursor:pointer}.ag-charts-menu__row:first-child{border-top-left-radius:inherit;border-top-right-radius:inherit}.ag-charts-menu__row:last-child{border-bottom-left-radius:inherit;border-bottom-right-radius:inherit}.ag-charts-menu__row:focus{background:var(--ag-charts-focus-color)}.ag-charts-menu__row:focus-visible{outline:var(--ag-charts-focus-border);box-shadow:var(--ag-charts-focus-border-shadow);z-index:var(--ag-charts-layer-menu)}.ag-charts-menu__row--active{--icon-color: var(--ag-charts-accent-color);background:var(--ag-charts-focus-color);color:var(--ag-charts-accent-color)}.ag-charts-menu__row[aria-disabled=true]{background:var(--ag-charts-button-disabled-background-color);color:var(--ag-charts-button-disabled-text-color);cursor:default}.ag-charts-menu__label{grid-column:-1 / span 1;text-wrap:nowrap}.ag-charts-toolbar{--toolbar-size: 34px;--toolbar-border-radius: var(--ag-charts-button-border-radius);--toolbar-button-background-color: var(--ag-charts-chrome-background-color);--toolbar-button-border-color: var(--ag-charts-button-border-color);--toolbar-button-border-width: var(--ag-charts-button-border-width);--toolbar-button-gap: 0;--toolbar-button-padding: 6px;--toolbar-button-text-color: var(--ag-charts-button-text-color);--toolbar-button-background-color--active: var(--ag-charts-focus-color);--toolbar-button-border-color--active: var(--ag-charts-accent-color);--toolbar-button-text-color--active: var(--ag-charts-accent-color);--toolbar-button-background-color--disabled: var(--ag-charts-button-disabled-background-color);--toolbar-button-border-color--disabled: var(--toolbar-button-border-color);--toolbar-button-text-color--disabled: var(--ag-charts-button-disabled-text-color);--toolbar-button-background-color--hover: var(--ag-charts-focus-color);--toolbar-button-border-color--hover: var(--toolbar-button-border-color);--toolbar-button-text-color--hover: var(--toolbar-button-text-color);align-items:center;display:flex;flex-wrap:nowrap;gap:var(--toolbar-button-gap);position:absolute}.ag-charts-toolbar__button{align-items:center;background:var(--toolbar-button-background-color);border-color:var(--toolbar-button-border-color);border-style:solid;border-width:var(--toolbar-button-border-width);color:var(--toolbar-button-text-color);cursor:pointer;display:flex;font-family:var(--ag-charts-chrome-font-family);font-size:var(--ag-charts-chrome-font-size-medium);font-weight:var(--ag-charts-chrome-font-weight);justify-content:center;min-height:var(--toolbar-size);min-width:var(--toolbar-size);padding:var(--toolbar-button-padding);position:relative;transition:background-color .25s ease-in-out,border-color .25s ease-in-out,color .25s ease-in-out;white-space:nowrap}.ag-charts-toolbar__button:hover{background:var(--toolbar-button-background-color--hover);border-color:var(--toolbar-button-border-color--hover);color:var(--toolbar-button-text-color--hover);z-index:1}.ag-charts-toolbar__button:focus-visible{outline:var(--ag-charts-focus-border);box-shadow:var(--ag-charts-focus-border-shadow);z-index:calc(var(--ag-charts-layer-ui-overlay) + 1)}.ag-charts-toolbar__button--active,.ag-charts-toolbar__button--active:hover{background:var(--toolbar-button-background-color--active);border-color:var(--toolbar-button-border-color--active);color:var(--toolbar-button-text-color--active);z-index:2}.ag-charts-toolbar__button[aria-disabled=true]{background:var(--toolbar-button-background-color--disabled);border-color:var(--toolbar-button-border-color--disabled);color:var(--toolbar-button-text-color--disabled);cursor:default}.ag-charts-toolbar--horizontal{flex-direction:row;.ag-charts-toolbar__button{border-inline-end-width:0}.ag-charts-toolbar__button--first{border-end-start-radius:var(--toolbar-border-radius);border-start-start-radius:var(--toolbar-border-radius);margin:0}.ag-charts-toolbar__button--last{border-end-end-radius:var(--toolbar-border-radius);border-start-end-radius:var(--toolbar-border-radius);border-inline-end-width:var(--toolbar-button-border-width);margin-inline-end:0}.ag-charts-toolbar__button:hover:not(.ag-charts-toolbar__button--active)+.ag-charts-toolbar__button:not(.ag-charts-toolbar__button--active){border-inline-start-color:var(--toolbar-button-border-color--hover)}.ag-charts-toolbar__button--active+.ag-charts-toolbar__button{border-inline-start-color:var(--toolbar-button-border-color--active)}}.ag-charts-toolbar--vertical{flex-direction:column;.ag-charts-toolbar__button{margin:-1px 0 0;max-width:100%}.ag-charts-toolbar__button--first{border-start-start-radius:var(--ag-charts-button-border-radius);border-start-end-radius:var(--ag-charts-button-border-radius);margin:0}.ag-charts-toolbar__button--last{border-end-start-radius:var(--ag-charts-button-border-radius);border-end-end-radius:var(--ag-charts-button-border-radius)}}.ag-charts-toolbar__icon+.ag-charts-toolbar__label{margin-inline-start:calc(var(--ag-charts-spacing) * 2)}.ag-charts-toolbar__label+.ag-charts-toolbar__icon{margin-inline-start:calc(var(--ag-charts-spacing) * 2)}.ag-charts-toolbar__icon,.ag-charts-toolbar__label{pointer-events:none}.ag-charts-floating-toolbar{border:none;display:flex;.ag-charts-toolbar{align-items:unset;position:unset}}.ag-charts-floating-toolbar__drag-handle{align-items:center;background:var(--ag-charts-chrome-background-color);border-color:var(--ag-charts-border-color);border-style:solid;border-width:var(--ag-charts-border-width);border-end-start-radius:var(--ag-charts-button-border-radius);border-start-start-radius:var(--ag-charts-button-border-radius);border-inline-end-width:0;cursor:grab;display:flex;justify-content:center;min-width:24px;padding-inline-start:0;padding-inline-end:0}.ag-charts-floating-toolbar__drag-handle--dragging{cursor:grabbing}
1\n'),this.setContainer(s),this.cleanup.register((0,n.hcQ)(this.element)),this.setupGlobalListeners(),this.updateCSSVariableWatchers(l),"normal"===this.mode){const e=this.rootElements["canvas-center"].element;if(null==e)throw new Error("Error initializing tab guards");const t=ii(e,"beforebegin"),i=ii(e,"afterend");this.tabGuards=new Ft(e,t,i)}}initDOM(){if("normal"===this.mode){const e=(0,n.na4)("div");return e.innerHTML='<div role="presentation" class="ag-charts-wrapper ag-charts-styles" data-ag-charts><div role="presentation" class="ag-charts-canvas-center"><div role="presentation" class="ag-charts-canvas-container"><div role="presentation" class="ag-charts-canvas-background" aria-hidden="true"></div><div role="presentation" class="ag-charts-canvas" aria-hidden="true"></div><div role="figure" class="ag-charts-canvas-proxy"><div role="presentation" class="ag-charts-series-area"></div></div><div role="presentation" class="ag-charts-canvas-overlay ag-charts-tooltip-container"></div></div></div><div class="ag-charts-style-sensors"></div></div>',e.firstChild}const e=(0,n.na4)("div");e.role="presentation",e.dataset.agCharts="",e.classList.add("ag-charts-wrapper");const t=(0,n.na4)("div");return e.appendChild(t),t.role="presentation",t.classList.add("ag-charts-series-area"),e}initRootElements(){const{mode:e,element:t}=this,i={};for(const s of Zt){const a=`ag-charts-${s}`;let o;if(o="normal"===e?t.classList.contains(a)?t:t.getElementsByClassName(a)[0]:qt.has(s)?t:t.getElementsByClassName(a)[0]??(0,n.na4)("div"),null==o)throw new Error(`AG Charts - unable to find DOM element ${a}`);i[s]={element:o,children:new Map,listeners:[]}}return i}detachFromContainer(){null!=this.container&&this.sizeMonitor.unobserve(this.container),this.element.remove()}destroy(){super.destroy(),this.observer?.unobserve(this.element),this.disconnectAttachObservers(),this.sizeMonitor.unobserve(this.rootElements.canvas.element),this.container&&this.sizeMonitor.unobserve(this.container),this.pendingContainer=void 0;for(const e of Object.values(this.rootElements)){for(const t of e.children.values())t.parentNode===e.element&&t.remove();e.element.remove()}this.element.remove()}scheduleFlush(){this._deferring||null==this._pendingFlush&&(this._pendingFlush=setTimeout((()=>{this._pendingFlush=void 0,this._deferring||this.flushDeferredProxies()})))}flushDeferredProxies(){null!=this._pendingFlush&&(clearTimeout(this._pendingFlush),this._pendingFlush=void 0),this.elementProxy.flush();for(const e of this.deferredProxies.values())e.flush();this.updateStylesLocation(),"minimal"!==this.mode&&null!=this.pendingContainer&&this.pendingContainer!==this.container&&(0===e.batchedUpdateContainer.length&&setTimeout(this.applyBatchedUpdateContainer.bind(this),0),e.batchedUpdateContainer.push(this))}
1applyBatchedUpdateContainer(){for(const t of e.batchedUpdateContainer)t.destroyed||t.updateContainer();e.batchedUpdateContainer.splice(0)}disconnectAttachObservers(){this.attachObserver?.disconnect(),this.attachObserver=void 0,this.attachIntersectionObserver?.disconnect(),this.attachIntersectionObserver=void 0}observeAttachTransition(e){this.disconnectAttachObservers(),"minimal"!==this.mode&&!1===this.initiallyConnected&&(this.attachObserver=this.agDocument.createMutationObserver(this.onAttachTransition),this.attachObserver?.observe(e.ownerDocument.documentElement,{childList:!0,subtree:!0}),this.attachIntersectionObserver=this.agDocument.createIntersectionObserver((e=>{e.some((e=>e.isIntersecting))&&this.onAttachTransition()})),this.attachIntersectionObserver?.observe(e))}updateStylesLocation(){if(!0!==this.initiallyConnected&&!1!==this.container?.isConnected){this.disconnectAttachObservers(),this.shadowDocumentRoot=this.getShadowDocumentRoot(this.container),this.initiallyConnected=!0;for(const e of this.rootElements.styles.children.keys())this.removeChild("styles",e);for(const[e,t]of this.styles)this.addStyles(e,t);null!=this.container&&this.sizeMonitor.refresh(this.container)}}setSizeOptions(e=300,t=300,i,n){const{style:s}=this.element;this.minWidth=i??e,this.minHeight=n??t,this.autoWidth=null==i,this.autoHeight=null==n,s.minWidth=`${this.minWidth}px`,s.minHeight=`${this.minHeight}px`,this.updateContainerClassName()}updateContainerSize(){const e=null==this.containerSize?"hidden":"",t=this.containerSize?`${Math.floor(this.containerSize.width??0)}px`:"",i=this.containerSize?`${Math.floor(this.containerSize.height??0)}px`:"",n=this._lastCenterSize;if(n?.visibility!==e||n?.width!==t||n?.height!==i){this._lastCenterSize={visibility:e,width:t,height:i};const{style:n}=this.rootElements["canvas-center"].element;n.visibility=e,n.width=t,n.height=i}this.updateContainerClassName()}setTabGuardIndex(e){this.tabGuards&&(this.tabGuards.tabIndex=e)}setContainer(e){e!==this.container&&(this.pendingContainer=e,"minimal"!==this.mode&&null!=this.container||this.updateContainer())}updateContainer(){const{pendingContainer:e}=this;if(null==e||e===this.container)return;if(this.container&&(this.element.remove(),this.sizeMonitor.unobserve(this.container)),null!=this.shadowDocumentRoot)for(const e of this.rootElements.styles.children.keys())this.removeChild("styles",e);this.container=e,this.pendingContainer=void 0,this.agDocument.setContainer(e);const t=this.shadowDocumentRoot?.getRootNode();this.shadowDocumentRoot=this.getShadowDocumentRoot(e),this.shadowDocumentRoot?.getRootNode()!==t&&this.shadowCssVariableWatchers.clear(),this.initiallyConnected=e.isConnected,this.observeAttachTransition(e);for(const[e,t]of this.styles)this.addStyles(e,t);e.appendChild(this.element),this.sizeMonitor.observe(e,(e=>{this.containerSize=e,this.updateContainerSize(),this.invalidateRectCaches(),this.eventsHub.emit("dom:resize",null)}),{skipInitialRead:"minimal"===this.mode}),this.invalidateAllCaches(),this.updateRtl(),this.eventsHub.emit("dom:container-change",null)}setThemeClass(e){for(const t of Array.from(this.element.classList))t.startsWith("ag-charts-theme-")&&t!==e&&this.element.classList.remove(t);this.element.classList.add(e)}setThemeParameters(e){const t=Object.keys(e).length;if(e===this.lastThemeParameters&&t===this.lastThemeParameterCount)return;this.lastThemeParameters=e,this.lastThemeParameterCount=t;const i={};
1for(const[t,s]of(0,n.jOZ)(e))if((0,n.Gvm)(s))for(const[e,a]of(0,n.jOZ)(s))i[`${t}${e[0].toUpperCase()}${e.slice(1)}`]=a;else i[t]=s;this.setCSSVariables("--ag-charts",void 0,void 0,i),this.eventsHub.emit("theme:params-change",null)}setModuleCSSVariables(e,t,i,n,s){this.setCSSVariables(`--ag-charts-${e}`,t,i,n,s)}setCSSVariables(e,t,i,s,a){for(const[o,r]of(0,n.jOZ)(s)){let n=`${r}`;if(!Number.isNaN(Number(r))&&(o.endsWith("Size")||o.endsWith("Radius")||o.endsWith("Width")||a?.includes(o)))n=`${r}px`;else if(o.endsWith("Border")&&"boolean"==typeof r){this.element.style.setProperty(this.formatCSSVariableKey(e,t,`${o}Color`,i),r?"var(--ag-charts-border-color)":"none"),this.element.style.setProperty(this.formatCSSVariableKey(e,t,`${o}Width`,i),r?"var(--ag-charts-border-width)":"0");continue}this.element.style.setProperty(this.formatCSSVariableKey(e,t,o,i),n)}}formatCSSVariableKey(e,t,i,s){return`${e}${t?"__":""}${t??""}-${(0,n.kW4)(i)}${s?"--":""}${s??""}`}updateCanvasLabel(e){(0,n.Bqc)(this.rootElements["canvas-proxy"].element,"aria-label",e)}getEventElement(e,t){return["focus","blur","keydown","keyup"].includes(t)?this.rootElements["series-area"].element:e}addEventListener(e,t,i){const s=this.getEventElement(this.element,e);return(0,n.yE)(s,e,t,i)}removeEventListener(e,t,i){this.getEventElement(this.element,e).removeEventListener(e,t,i)}getBoundingClientRect(){return this._cachedCanvasRect??(this._cachedCanvasRect=this.rootElements.canvas.element.getBoundingClientRect()),this._cachedCanvasRect}getCanvasScale(){if(null!=this._cachedCanvasScale)return this._cachedCanvasScale;const e=this.getBoundingClientRect(),t=this.rootElements.canvas.element,i=t.clientWidth,n=t.clientHeight,s=i>0&&e.width>0?e.width/i:1,a=n>0&&e.height>0?e.height/n:1;return this._cachedCanvasScale={scaleX:s,scaleY:a},this._cachedCanvasScale}getOverlayClientRect(){const{innerWidth:e,innerHeight:t}=this.agDocument,i=new m(0,0,e,t),n=this.getRawOverlayClientRect();return i.intersection(n)?.toDOMRect()??ti}getVisibleChartRect(){if(void 0!==this._cachedVisibleChartRect)return this._cachedVisibleChartRect;const e=this.findScrollableContainer();if(null==e)return this._cachedVisibleChartRect=null,null;const t=m.fromObject(this.getBoundingClientRect()),i=m.fromObject(e.getBoundingClientRect());return this._cachedVisibleChartRect=t.intersection(i)?.toDOMRect()??ti,this._cachedVisibleChartRect}findScrollableContainer(){if(void 0!==this._cachedScrollableContainer)return this._cachedScrollableContainer;let e=this.element;const t=this.element.getRootNode()?.fullscreenElement;for(;null!=e;){let i;if(null!=t&&e===t)i=!0;else{const t=e.computedStyleMap?.(),n=t?.get("overflow-y")?.toString();i="auto"===n||"scroll"===n}if(i)return this._cachedScrollableContainer=e,e;e=e.parentElement}return this._cachedScrollableContainer=null,null}popoverSupported(){const e=this.agDocument.window.HTMLElement;return"function"==typeof e?.prototype?.togglePopover}getRawOverlayClientRect(){if(null!=this._cachedRawOverlayRect)return this._cachedRawOverlayRect;const e=this.popoverSupported()?null:this.findScrollableContainer();if(null!=e)return this._cachedRawOverlayRect=m.fromObject(e.getBoundingClientRect()),this._cachedRawOverlayRect;if(null!=this.shadowDocumentRoot)return this._cachedRawOverlayRect=m.fromObject(this.shadowDocumentRoot.getBoundingClientRect()),this._cachedRawOverlayRect;const{innerWidth:t,innerHeight:i}=this.agDocument;return this._cachedRawOverlayRect=new m(0,0,t,i),this._cachedRawOverlayRect}getShadowDocumentRoot(e=this.container){const t=e?.ownerDocument?.body??this.agDocument.body;for(;null!=e;){if(e===t)return;if((0,n.K8K)(e.parentNode))return e;e=e.parentNode}}getParent(e){return this.rootElements[e].element}getChildBoundingClientRect(e){const{children:t}=this.rootElements[e],i=[];for(const e of t.values())i.push(m.fromObject(e.getBoundingClientRect()));return m.merge(i)}isManagedChildDOMElement(e,t,i){const{children:n}=this.rootElements[t],s=n?.get(i);return null!=s&&e.contains(s)}contains(e,t){return null==t?this.element.contains(e):this.rootElements[t].element.contains(e)}addStyles(t,i){const s="data-ag-charts";if(this.styles.set(t,i),null==this.container)return;if(this.skipCss)return;const a=e=>e.getAttribute(s)===t,o=e=>{const t=new Set(["TITLE","META"]);let i,o=!0;for(const n of e.children)if(o&&t.has(n.tagName))i=n;else{if(o=!1,a(n))return;n.hasAttribute(s)&&(i=n)}const r=(0,n.aBg)(this.styleNonce);
1return null==i?e.prepend(r):e.insertBefore(r,i.nextSibling),r};let r;if(this.styleContainer)r=o(this.styleContainer);else if(!1===this.initiallyConnected)r=this.addChild("styles",t);else if(null==this.shadowDocumentRoot){const{head:i}=this.agDocument;let n=e.headStyles.get(i);null==n&&(n=new Set,e.headStyles.set(i,n)),n.has(t)||(r=o(i),n.add(t))}else r=this.addChild("styles",t);null==r||a(r)||(r.setAttribute(s,t),r.innerHTML=i)}removeStyles(e){this.removeChild("styles",e)}updateCursor(e,t){this.cursorState.set(e,t),this.applyCursor()}lockCursor(e,t){this.cursorState.lock(e,t),this.applyCursor()}unlockCursor(e){this.cursorState.unlock(e),this.applyCursor()}applyCursor(){const e=this.cursorState.stateValue();e!==this._lastCursor&&(this._lastCursor=e,this.element.style.cursor=e);const t=this.cursorState.isLocked();t!==this._cursorLocked&&(this._cursorLocked=t,this.element.classList.toggle("ag-charts-wrapper--cursor-locked",t))}getCursor(){return this.element.style.cursor}get isRtl(){return this._isRtl}setEnableRtl(e){this.enableRtl=e,this.updateRtl()}updateRtl(){const e=this.enableRtl??("minimal"!==this.mode&&(0,n._gn)(this.container??this.pendingContainer));e!==this._isRtl&&(this._isRtl=e,this.element.dir=e?"rtl":"ltr",this.eventsHub.emit("rtl:change",null))}addChild(e,t,i,s){const{element:a,children:o,listeners:r}=this.rootElements[e];if(!o)throw new Error("AG Charts - unable to create DOM elements after destroy()");if(o.has(t))return o.get(t);const{childElementType:l="div"}=ei.get(e)??{};if(i&&i.tagName.toLowerCase()!==l.toLowerCase())throw new Error("AG Charts - mismatching DOM element type");const h=i??(0,n.na4)(l);for(const[e,t,i]of r)h.addEventListener(e,t,i);if(o.set(t,h),"style"===l&&null!=this.styleNonce&&(h.nonce=this.styleNonce),s){const e=a.querySelector(s.query);if(null==e)throw new Error(`AG Charts - addChild query failed ${s.query}`);e.insertAdjacentElement(s.where,h)}else a?.appendChild(h);return h}addProxyChild(e,t){const i=this.addChild(e,t),n="minimal"===this.mode;return new Xt(i,{sizeMonitor:this.sizeMonitor,skipInitialRead:n})}addDeferredProxyChild(e,t){const i=this.addChild(e,t),n="minimal"===this.mode,s=new Xt(i,{deferredMode:this.deferredMode,sizeMonitor:this.sizeMonitor,skipInitialRead:n});return this.deferredProxies.set(`${e}:${t}`,s),s}setDeferring(e){"minimal"!==this.mode&&(this._deferring=e,e||this.flushDeferredProxies())}removeChild(e,t){const{children:i}=this.rootElements[e];i&&(i.get(t)?.remove(),i.delete(t),this.deferredProxies.delete(`${e}:${t}`))}incrementDataCounter(e){const t=this.elementProxy.getData(e)??"0";this.elementProxy.setData(e,String(Number(t)+1))}setDataBoolean(e,t){this.elementProxy.setData(e,String(t))}setDataNumber(e,t){this.elementProxy.setData(e,String(t))}getDocument(){return this.agDocument}invalidateRectCaches(){this._cachedCanvasRect=void 0,this._cachedCanvasScale=void 0,this._cachedRawOverlayRect=void 0,this._cachedVisibleChartRect=void 0}invalidateAllCaches(){this.invalidateRectCaches(),this._cachedScrollableContainer=void 0}setupGlobalListeners(){const e=this.element.ownerDocument,t=e.defaultView;if(null==t)return;if("minimal"===this.mode){const e=ni.subscribe(t,{invalidateRects:()=>this.invalidateRectCaches(),invalidateAll:()=>this.invalidateAllCaches()});return void this.cleanup.register(e)}const i=()=>this.invalidateRectCaches();this.element.addEventListener("pointerenter",i),this.cleanup.register((()=>this.element.removeEventListener("pointerenter",i)));const n=()=>this.invalidateRectCaches(),s=()=>this.invalidateAllCaches();t.addEventListener("scroll",n,{capture:!0,passive:!0}
1),t.addEventListener("resize",n,{capture:!0,passive:!0}),e.addEventListener("fullscreenchange",s),this.cleanup.register((()=>{t.removeEventListener("scroll",n,{capture:!0}),t.removeEventListener("resize",n,{capture:!0}),e.removeEventListener("fullscreenchange",s)}))}updateCSSVariableWatchers(e){if(e)if(this.shadowDocumentRoot)this.updateCSSVariableWatchersShadowDOM(e);else for(const t of(0,n.vIl)(e)){const e=t.slice(4,-1);if(this.cssVariableWatchers.has(e))continue;this.cssVariableWatchers.add(e);const i=(0,n.aBg)(this.styleNonce);i.dataset.variableName=e,i.textContent=`@property ${e} { syntax: '<color>'; inherits: true; initial-value: transparent; }`,this.element.prepend(i);const s=(0,n.na4)("div");s.style.setProperty("transition",`${e} 1ms`,"important"),this.rootElements["style-sensors"].element.appendChild(s);const a=()=>{this.eventsHub.emit("chart:request-refresh",null)};s.addEventListener("transitionend",a),this.cleanup.register((()=>{s.removeEventListener("transitionend",a),s.remove(),i.remove()}))}}updateCSSVariableWatchersShadowDOM(e){const t=this.shadowDocumentRoot?.getRootNode();if(t&&"addEventListener"in t){if(0===this.shadowCssVariableWatchers.size){const e=()=>{this.eventsHub.emit("chart:request-refresh",null)};t.addEventListener("transitionend",e),this.cleanup.register((()=>{t.removeEventListener("transitionend",e)}))}for(const i of(0,n.vIl)(e)){const e=i.slice(4,-1);if(this.shadowCssVariableWatchers.has(e))continue;this.shadowCssVariableWatchers.add(e);const s=(0,n.na4)("div");s.style.color=i,s.style.setProperty("transition","color 1ms","important"),s.dataset.variableName=e,t.prepend(s)}}}updateContainerClassName(){const{element:e,containerSize:t,minWidth:i,minHeight:n,autoWidth:s,autoHeight:a}=this;e.classList.toggle(Qt,null!=t&&(s||i>=t.width)),e.classList.toggle(Jt,null!=t&&(a||n>=t.height))}};return e.className="DOMManager",e.batchedUpdateContainer=[],e.headStyles=new WeakMap,e})();function ai(e,t,i){const{offsetX:n,offsetY:s,clientX:a,clientY:o}=t,{currentX:r,currentY:l}=li.calcCurrentXY(i,t);return{type:e,device:"mouse",offsetX:n,offsetY:s,clientX:a,clientY:o,currentX:r,currentY:l,sourceEvent:t}}function oi(e,t,i){return{type:e,sourceEvent:t}}var ri=(()=>({change:{isNative:!0,allocator:(e,t)=>({type:"change",sourceEvent:e})},blur:{isNative:!0,allocator:(e,t)=>({type:"blur",sourceEvent:e})},focus:{isNative:!0,allocator:(e,t)=>({type:"focus",sourceEvent:e})},keydown:{isNative:!0,allocator:e=>({type:"keydown",sourceEvent:e})},keyup:{isNative:!0,allocator:e=>({type:"keyup",sourceEvent:e})},contextmenu:{isNative:!0,allocator:(e,t)=>ai("contextmenu",e,t)},click:{isNative:!0,allocator:(e,t)=>ai("click",e,t)},dblclick:{isNative:!0,allocator:(e,t)=>ai("dblclick",e,t)},mouseenter:{isNative:!0,allocator:(e,t)=>ai("mouseenter",e,t)},mousemove:{isNative:!0,allocator:(e,t)=>ai("mousemove",e,t)},mouseleave:{isNative:!0,allocator:(e,t)=>ai("mouseleave",e,t)},wheel:{isNative:!0,allocator(e,t){const{offsetX:i,offsetY:n,clientX:s,clientY:a}=e,{currentX:o,currentY:r}=li.calcCurrentXY(t,e),l=0===e.deltaMode?.01:1;let h=e.deltaX*l,c=e.deltaY*l;return 0===Math.abs(e.deltaX)&&e.shiftKey&&([h,c]=[c,h]),{type:"wheel",offsetX:i,offsetY:n,clientX:s,clientY:a,currentX:o,currentY:r,deltaX:h,deltaY:c,sourceEvent:e}}},touchstart:{isNative:!0,allocator:(e,t)=>oi("touchstart",e)},touchmove:{isNative:!0,allocator:(e,t)=>oi("touchmove",e)},touchend:{isNative:!0,allocator:(e,t)=>oi("touchend",e)},touchcancel:{isNative:!0,allocator:(e,t)=>oi("touchcancel",e)},"drag-start":void 0,"drag-move":void 0,"drag-end":void 0,"collapse-widget":void 0,"expand-widget":void 0,"expand-controlled-widget":void 0}))(),li=class{static alloc(e,t,i){return(0,ri[e].allocator)(t,i)}static isHTMLEvent(e){const t=ri;return!0===t[e]?.isNative}static calcCurrentXY(e,t){const i=e.getBoundingClientRect(),n=e.clientWidth,s=e.clientHeight,a=i.width>0&&n>0?n/i.width:1,o=i.height>0&&s>0?s/i.height:1;return{currentX:(t.clientX-i.x)*a,currentY:(t.clientY-i.y)*o}}},hi=class{constructor(){this.widgetListeners={},this.sourceListeners={}}initSourceHandler(e,t){this.sourceListeners??(this.sourceListeners={}),this.sourceListeners[e]=t}lazyGetWidgetListeners(e,t){var i;if(!(e in(this.sourceListeners??{}))){const i=i=>{const n=li.alloc(e,i,t.getElement());
1this.dispatch(e,t,n)},n={};(e.startsWith("touch")||"wheel"===e)&&(n.passive=!1),this.initSourceHandler(e,i),t.getElement().addEventListener(e,i,n)}return this.widgetListeners??(this.widgetListeners={}),(i=this.widgetListeners)[e]??(i[e]=[]),this.widgetListeners[e]}add(e,t,i){this.lazyGetWidgetListeners(e,t).push(i)}remove(e,t,i){const n=this.lazyGetWidgetListeners(e,t),s=n.indexOf(i);s>-1&&n.splice(s,1)}destroy(e){if(this.widgetListeners=void 0,this.sourceListeners){for(const[t,i]of(0,n.jOZ)(this.sourceListeners))e.getElement().removeEventListener(t,i);this.sourceListeners=void 0}}dispatch(e,t,i){for(const n of this.widgetListeners?.[e]??[])n(i,t)}},ci=class{constructor(e,t,i,s){this.glob=e,this.self=t,this.cleanup=new n._uV,this.mousemove=e=>{this.glob.globalMouseDragCallbacks?.mousemove(e)},this.mouseup=e=>{0===e.button&&(this.glob.globalMouseDragCallbacks?.mouseup(e),this.destroy())};const{mousemove:a,mouseup:o}=this,r=s.view;this.cleanup.register((0,n.yE)(r,"mousemove",a,{capture:!0}),(0,n.yE)(r,"mouseup",o,{capture:!0})),t.mouseDragger=this,e.globalMouseDragCallbacks=i,e.globalMouseDragCallbacks.mousedown(s)}destroy(){this.cleanup.flush(),this.glob.globalMouseDragCallbacks=void 0,this.self.mouseDragger=void 0}};var di=!1,ui=class{constructor(e,t,i,s,a){this.glob=e,this.self=t,this.initialTouch=s,this.target=a,this.cleanup=new n._uV,this.longTapInterrupted=!1,this.longtap=()=>{const{target:e,initialTouch:t}=this;if(!this.longTapInterrupted){const i=new n._uV;e.dispatchEvent(new TouchEvent("touchcancel",{touches:[t],bubbles:!0})),di=!0;const s=e=>e.preventDefault(),a=e=>{di=!1,e.preventDefault(),i.flush()};i.register((0,n.yE)(e,"touchmove",s,{passive:!1}),(0,n.yE)(e,"touchend",a,{passive:!1}),(0,n.yE)(e,"touchcancel",a,{passive:!1}));const{clientX:o,clientY:r}=t,l=new PointerEvent("contextmenu",{bubbles:!0,cancelable:!0,view:e.ownerDocument.defaultView,clientX:o,clientY:r,pointerType:"touch"});e.dispatchEvent(l)}},this.touchmove=e=>{const{glob:t,self:i,initialTouch:n}=this,s=this.findInitialFinger(e.targetTouches);null!=s&&(this.longTapInterrupted=this.longTapInterrupted||function(e,t){const i=e.clientX-t.clientX,n=e.clientY-t.clientY;return i*i+n*n}(n,s)>100,i.dragTouchEnabled&&t.globalTouchDragCallbacks?.touchmove(e,s))},this.touchend=e=>{this.longTapInterrupted=!0;const t=this.findInitialFinger(e.changedTouches,e.touches);null!=t&&this.glob.globalTouchDragCallbacks?.touchend(e,t),this.destroy()},this.longtapTimer=setTimeout(this.longtap,500);const{touchmove:o,touchend:r}=this;this.cleanup.register((0,n.yE)(a,"touchmove",o,{passive:!1}),(0,n.yE)(a,"touchstart",r,{passive:!1}),(0,n.yE)(a,"touchend",r,{passive:!1}),(0,n.yE)(a,"touchcancel",r,{passive:!1})),t.touchDragger=this,e.globalTouchDragCallbacks=i}destroy(){clearTimeout(this.longtapTimer),this.cleanup.flush(),this.glob.globalTouchDragCallbacks=void 0,this.self.touchDragger=void 0}findInitialFinger(...e){const t=e.flatMap((e=>Array.from(e)));return Array.from(t).find((e=>e.identifier===this.initialTouch.identifier))}};function pi(e,t,i){const n=i.pageX-t.pageX,s=i.pageY-t.pageY,a=t.currentX+n,o=t.currentY+s;return{type:e,device:"mouse",offsetX:t.offsetX+n,offsetY:t.offsetY+s,clientX:i.clientX,clientY:i.clientY,currentX:a,currentY:o,originDeltaX:n,originDeltaY:s,sourceEvent:i}}function gi(e,t){const i=e.getElement(),n=i.getBoundingClientRect(),s=i.clientWidth,a=i.clientHeight,o=n.width>0&&s>0?s/n.width:1,r=n.height>0&&a>0?a/n.height:1;return{offsetX:(t.clientX-n.x)*o,offsetY:(t.clientY-n.y)*r}}function mi(e,t,i,n){const s=n.pageX-t.pageX,a=n.pageY-t.pageY,o=t.currentX+s,r=t.currentY+a;return{type:e,device:"touch",offsetX:t.offsetX+s,offsetY:t.offsetY+a,clientX:n.clientX,clientY:n.clientY,currentX:o,currentY:r,originDeltaX:s,originDeltaY:a,sourceEvent:i}}var yi={},fi=class{constructor(e){this.dispatchCallback=e,this.dragTouchEnabled=!0}destroy(){this.dragTriggerRemover?.(),this.dragTriggerRemover=void 0,this.listeners?.clear(),this.mouseDragger?.destroy(),this.touchDragger?.destroy()}getListenerSet(e){this.listeners??(this.listeners=new Map);let t=this.listeners.get(e);return void 0===t&&(t=new Set,this.listeners.set(e,t)),t}add(e,t,i){switch(this.getListenerSet(e).add(i),e){case"drag-start":case"drag-move":case"drag-end":this.registerDragTrigger(t)}}remove(e,t,i){this.getListenerSet(e).delete(i)}registerDragTrigger(e){if(null==this.dragTriggerRemover){const t=e.getElement(),i=new n._uV;i.register((0,n.yE)(t,"mousedown",(t=>this.triggerMouseDrag(e,t))),(0,n.yE)(t,"touchstart",(t=>this.triggerTouchDrag(e,t)),{passive:!1})),this.dragTriggerRemover=()=>i.flush()}}triggerMouseDrag(e,t){if(0===t.button){if(null==t.view){const i=e.getElement().ownerDocument.defaultView;t=new i.MouseEvent(t.type,{...t,view:i})}this.startMouseDrag(e,t)}}startMouseDrag(e,t){const{currentX:i,currentY:s}=li.calcCurrentXY(e.getElement(),t),a={pageX:Number.NaN,pageY:Number.NaN,offsetX:Number.NaN,offsetY:Number.NaN,currentX:i,currentY:s};(0,n.tbn)(["pageX","pageY","offsetX","offsetY"],a,t);const o={mousedown:t=>{const i=pi("drag-start",a,t);this.dispatch("drag-start",e,i)},mousemove:t=>{const i=pi("drag-move",a,t);this.dispatch("drag-move",e,i)},mouseup:t=>{const i=pi("drag-end",a,t);this.dispatch("drag-end",e,i),this.endDrag(e,i)}};this.mouseDragger=function(e,t,i,n){if(null==e.globalMouseDragCallbacks)return new ci(e,t,i,n)}(yi,this,o,t)}endDrag(e,{sourceEvent:t,clientX:i,clientY:s}){const a=e.getElement(),o=a.getBoundingClientRect();(0,n.JF9)(o,i,s)||(a.dispatchEvent(new MouseEvent("mouseleave",t)),t.target?.dispatchEvent(new MouseEvent("mouseenter",t)))}triggerTouchDrag(e,t){const i=t.targetTouches[0];1===t.targetTouches.length&&null!=i&&this.startOneFingerTouch(e,t,i)}startOneFingerTouch(e,t,i){const{currentX:s,currentY:a}=li.calcCurrentXY(e.getElement(),i),o={pageX:Number.NaN,pageY:Number.NaN,currentX:s,currentY:a,...gi(e,i)};(0,n.tbn)(["pageX","pageY"],o,i);const r={touchmove:(t,i)=>{const n=mi("drag-move",o,t,i);this.dispatch("drag-move",e,n)},touchend:(t,i)=>{const n=mi("drag-end",o,t,i);this.dispatch("drag-end",e,n)}},l=e.getElement();this.touchDragger=function(e,t,i,n,s){if(null==e.globalTouchDragCallbacks&&!di)return new ui(e,t,i,n,s)}(yi,this,r,i,l);const h=mi("drag-start",o,t,i);this.dispatch("drag-start",e,h)}dispatch(e,t,i){for(const n of this.getListenerSet(e))n(i,t);this.dispatchCallback(e,i)}},xi=class{constructor(e){this.elem=e}setBounds(e){(0,n.ksX)(this.elemContainer??this.elem,e)}getBounds(){return(0,n.Cn9)(this.elemContainer??this.elem)}static setElementContainer(e,t){const i=e.getBounds();(0,n.ksX)(t,i),(0,n._Pz)(e.elem,{width:"100%",height:"100%"}),e.elem.remove(),e.elemContainer=t,e.elemContainer.replaceChildren(e.elem)}},bi=class extends xi{constructor(){super(...arguments),this.index=Number.NaN,this.children=[]}set id(e){(0,n.Bqc)(this.elem,"id",e)}get id(){return(0,n.D$r)(this.elem,"id")}getElement(){return this.elem}getBoundingClientRect(){return this.elem.getBoundingClientRect()}get clientWidth(){return this.elem.clientWidth}get clientHeight(){return this.elem.clientHeight}destroy(){this.destroyListener?.(),this.destroyListener=void 0,this.remove();for(const e of this.children)e.parent=void 0,e.destroy();this.children.length=0,this.destructor(),this.internalListener?.de
1stroy(),this.htmlListener?.destroy(this)}remove(){this.elem.remove(),this.elemContainer?.remove(),this.parent?.removeChildWidget(this)}setHidden(e){(0,n.EMg)(this.elem,"display",e?"none":void 0)}isHidden(){const{defaultView:e}=this.elem.ownerDocument;return"none"===e?.getComputedStyle(this.elem).display}setCursor(e){(0,n.EMg)(this.elem,"cursor",e)}setTextContent(e){this.elem.textContent=e??null}setAriaDescribedBy(e){(0,n.Bqc)(this.elem,"aria-describedby",e)}setAriaHidden(e){(0,n.Bqc)(this.elem,"aria-hidden",e)}setAriaLabel(e){(0,n.Bqc)(this.elem,"aria-label",e)}setAriaExpanded(e){(0,n.Bqc)(this.elem,"aria-expanded",e)}setAriaControls(e){(0,n.Bqc)(this.elem,"aria-controls",e)}setAriaHasPopup(e){(0,n.Bqc)(this.elem,"aria-haspopup",e)}setInnerHTML(e){this.elem.innerHTML=e}setPointerEvents(e){(0,n.EMg)(this.elem,"pointer-events",e)}setTouchAction(e){this.elem.style.touchAction=null==e?"":e}setCSSVariable(e,t){this.elem.style.setProperty(e,t)}isDisabled(){return(0,n.D$r)(this.elem,"aria-disabled",!1)}hasPopup(){const e=(0,n.D$r)(this.elem,"aria-haspopup");return void 0!==e&&"false"!==e}parseFloat(e){return""===e?0:Number.parseFloat(e)}cssLeft(){return this.parseFloat(this.elem.style.left)}cssTop(){return this.parseFloat(this.elem.style.top)}cssWidth(){return this.parseFloat(this.elem.style.width)}cssHeight(){return this.parseFloat(this.elem.style.height)}focus(e){this.elem.focus(e)}setFocusOverride(e){(0,n.Bqc)(this.elem,"data-focus-override",e)}setPreventsDefault(e){(0,n.Bqc)(this.elem,"data-preventdefault",e)}setTabIndex(e){(0,n.Bqc)(this.elem,"tabindex",e)}addChild(e){this.addChildToDOM(e,this.getBefore(e)),this.children.push(e),e.index=this.children.length-1,e.parent=this,this.onChildAdded(e)}removeChildWidget(e){const t=this.children.indexOf(e);this.children.splice(t,1),this.removeChildFromDOM(e),this.onChildRemoved(e)}moveChild(e,t){e.domIndex!==t&&(e.domIndex=t,this.removeChildFromDOM(e),this.addChildToDOM(e,this.getBefore(e)))}addClass(...e){this.elem.classList.add(...e)}removeClass(...e){this.elem.classList.remove(...e)}toggleClass(e,t){this.elem.classList.toggle(e,t)}appendOrInsert(e,t){t?t.getElement().insertAdjacentElement("beforebegin",e):this.elem.appendChild(e)}addChildToDOM(e,t){this.appendOrInsert(e.getElement(),t)}removeChildFromDOM(e){e.getElement().remove()}onChildAdded(e){}onChildRemoved(e){}getBefore({domIndex:e}){if(void 0!==e)return this.children.filter((t=>void 0!==t.domIndex&&t.domIndex>e)).reduce(((e,t)=>!e||t.domIndex<e.domIndex?t:e),void 0)}addListener(e,t){return li.isHTMLEvent(e)?(this.htmlListener??(this.htmlListener=new hi),this.htmlListener.add(e,this,t)):(this.internalListener??(this.internalListener=new fi(this.onDispatch.bind(this))),this.internalListener.add(e,this,t)),()=>this.removeListener(e,t)}removeListener(e,t){li.isHTMLEvent(e)?this.htmlListener?.remove(e,this,t):null!=this.htmlListener&&this.internalListener?.remove(e,this,t)}setDragTouchEnabled(e){this.internalListener??(this.internalListener=new fi(this.onDispatch.bind(this))),this.internalListener.dragTouchEnabled=e}onDispatch(e,t){if(!t.sourceEvent?.bubbles)return;let{parent:i}=this;for(;null!=i;){const{internalListener:n}=i;if(null!=n){const s={...t,...li.calcCurrentXY(i.getElement(),t)};n.dispatch(e,i,s)}i=i.parent}}},vi=class extends bi{constructor(e){super(e)}destructor(){}},Si=class extends vi{constructor(){super((0,n.na4)("div"))}},Mi=class extends bi{constructor(){super((0,n.na4)("div")),this.textElement=(0,n.FJ6)("text"),this.textElement.role="presentation",this.svgElement=(0,n.FJ6)("svg"),this.svgElement.appendChild(this.textElement),this.svgElement.style.width="100%",this.svgElement.style.opacity="0",this.svgElement.role="presentation",this.elem.appendChild(this.svgElement),this.elem.role="presentation"}set textContent(e){this.textElement.textContent=e;const t=this.textElement,i=t.getBBox?.();i&&this.svgElement.setAttribute("viewBox",`${i.x} ${i.y} ${i.width} ${i.height}`)}get textContent(){return this.textElement.textContent}destructor(){}},ki=class{constructor(e,t){this.getDispatcher=t,this.onExpanded=()=>{this.controller.setAriaExpanded(!0);const e=this.getDispatcher();
1if(e&&this.controls){const t={type:"expand-controlled-widget",controlled:this.controls};e.dispatch("expand-controlled-widget",this.controller,t)}},this.onCollapsed=e=>{this.controller.setAriaExpanded(!1),"0"===e.mode&&this.controller.focus()},e.setAriaExpanded(!1),this.controller=e}destroy(){this.controls?.collapse({mode:"2"}),this.setControlled(void 0)}setControlled(e){this.controls&&(this.controls.removeListener("expand-widget",this.onExpanded),this.controls.removeListener("collapse-widget",this.onCollapsed)),this.controls=e,this.controls&&(this.controller.setAriaControls(this.controls.id),this.controls.addListener("expand-widget",this.onExpanded),this.controls.addListener("collapse-widget",this.onCollapsed))}getControlled(){return this.controls}expandControlled(e){this.controller.isDisabled()||this.controls?.expand({controller:this.controller,sourceEvent:void 0,overrideFocusVisible:e?.overrideFocusVisible})}};function Di(e){return(0,n.d8p)(e.sourceEvent)}var wi=class extends bi{constructor(e,t){super(e),(0,n.Bqc)(this.elem,"role",t),this.setEnabled(!0),this.addKeyboardClickBinding(Di)}lazyControllerImpl(){return this.controllerImpl??(this.controllerImpl=new ki(this,(()=>this.internalListener))),this.controllerImpl}destructor(){this.controllerImpl?.destroy()}addKeyboardClickBinding(e){this.addListener("keydown",(t=>{const{sourceEvent:i}=t;e(t)&&(i.preventDefault(),this.htmlListener?.dispatch("click",this,{type:"click",device:"keyboard",sourceEvent:i}))}))}setEnabled(e){(0,n.Bqc)(this.elem,"aria-disabled",!e)}setControlled(e){return this.lazyControllerImpl().setControlled(e)}getControlled(){return this.lazyControllerImpl().getControlled()}expandControlled(e){return this.lazyControllerImpl().expandControlled(e)}addListener(e,t){return super.addListener(e,((i,n)=>{("click"!==e&&"dblclick"!==e||!this.isDisabled())&&t(i,n)}))}},Ii=class extends wi{constructor(){super((0,n.na4)("button"))}},Ai=class extends bi{constructor(){super((0,n.na4)("div")),(0,n.Bqc)(this.elem,"role","group")}destructor(){}},Ci=class extends bi{constructor(e,t){super((0,n.na4)("div")),this.focusedChildIndex=0,this.onChildFocus=(e,t)=>{const i=this.children[this.focusedChildIndex];this.focusedChildIndex=t.index,i?.setTabIndex(-1),t.setTabIndex(0)},this.onChildKeyDown=(e,t)=>{const i=this.orientation,s=(0,n._gn)(this.elem);let a,o;"both"===i?(a=(0,n.tFZ)("horizontal",s),o=(0,n.tFZ)("vertical")):(a=(0,n.tFZ)(i,s),o=void 0);let r=-1;if((0,n.yFN)(e.sourceEvent)){const i=e.sourceEvent.key;i===a.nextKey||i===o?.nextKey?r=t.index+1:i!==a.prevKey&&i!==o?.prevKey||(r=t.index-1)}this.children[r]?.focus()},(0,n.Bqc)(this.elem,"role",t),this.orientation=e}get orientation(){return(0,n.D$r)(this.elem,"aria-orientation")??"both"}set orientation(e){(0,n.Bqc)(this.elem,"aria-orientation","both"===e?void 0:e)}focus(){this.children[this.focusedChildIndex]?.focus()}clear(){this.focusedChildIndex=0;for(const e of this.children)this.removeChildListeners(e),e.parent=void 0;this.elem.textContent="",this.children.length=0}addChildListeners(e){e.addListener("focus",this.onChildFocus),e.addListener("keydown",this.onChildKeyDown)}removeChildListeners(e){e.removeListener("focus",this.onChildFocus),e.removeListener("keydown",this.onChildKeyDown)}onChildAdded(e){this.addChildListeners(e),e.setTabIndex(1===this.children.length?0:-1)}onChildRemoved(e){this.removeChildListeners(e);const{focusedChildIndex:t,children:i}=this,n=t===e.index;for(let e=0;e<i.length;e++){const n=i[e];n.index===t&&(this.focusedChildIndex=e),n.index=e}if(n){const e=i[t]??i[t-1];e?(this.focusedChildIndex=e.index,e.setTabIndex(0)):this.focusedChildIndex=0}}};function Ni(e){const t=e.getElement();t.parentElement?t.parentElement.remove():t.remove()}var Li=class extends Ci{constructor(){super("both","list"),this.setHidden(!0)}destructor(){for(const e of this.children)Ni(e)}addChildToDOM(e,t){const i=(0,n.na4)("div");(0,n.Bqc)(i,"role","listitem"),(0,n.EMg)(i,"position","absolute"),bi.setElementContainer(e,i),this.appendOrInsert(i,t),this.setHidden(!1)}removeChildFromDOM(e){Ni(e),this.setHidden(0===this.children.length)}setHidden(e){0===this.children.length&&(e=!0),super.setHidden(e)}},Pi=(()=>{var e=class e extends bi{constructor(){super((0,n.na4)("input")),this._step=e.STEP_ONE,this.orientation="both"}get step(){return this._step}set step(e){this._step=e,this.getElement().step=e.attributeValue}get keyboardStep(){return this._keyboardStep?.step??this._step}set keyboardStep(e){if(e!==this._keyboardStep?.step&&(void 0!==this._keyboardStep&&(this.removeListener("keydown",this._keyboardStep.onKeyDown),this.removeListener("keyup",this._keyboardStep.onKeyUp),this.removeListener("blur",this._keyboardStep.onBlur),this._keyboardStep=void 0),void 0!==e)){const t=()=>this.getElement().step=e.attributeValue,i=()=>this.getElement().step=this._step.attributeValue;this._keyboardStep={step:e,onKeyDown:t,onKeyUp:i,onBlur:i},this.addListener("keydown",this._keyboardStep.onKeyDown),this.addListener("keyup",this._keyboardStep.onKeyUp),this.addListener("blur",this._keyboardStep.onBlur)}}get orientation(){return(0,n.D$r)(this.elem,"aria-orientation")??"both"}set orientation(t){(0,n.Bqc)(this.elem,"aria-orientation","both"===t?void 0:t),e.registerDefaultPreventers(this,t)}destructor(){}clampValueRatio(e,t){const i=this.getValueRatio(),s=(0,n.qE8)(e,i,t);return s!==i&&this.setValueRatio(s),s}setValueRatio(e,t){const{divider:i}=this.step,s=Math.round(1e4*e)/i,{ariaValueText:a=(0,n.l9T)(s/i)}=t??{},o=this.getElement();o.value=`${s}`,o.ariaValueText=a,o.ariaValueNow=`${s}`}getValueRatio(){return this.getElement().valueAsNumber/this.step.divider}static registerDefaultPreventers(t,i){"both"===i?t.removeListener("keydown",e.onKeyDown):t.addListener("keydown",e.onKeyDown)}static onKeyDown(e,t){let i=[];const{orientation:n}=t;"horizontal"===n?i=["ArrowUp","ArrowDown"]:"vertical"===n&&(i=["ArrowLeft","ArrowRight"]),i.includes(e.sourceEvent.code)&&e.sourceEvent.preventDefault()}};return e.STEP_ONE={attributeValue:"1",divider:1},e.STEP_HUNDRETH={attributeValue:"0.01",divider:100},e})(),Ti=Pi,Oi=class extends Ii{constructor(){super(),(0,n.Bqc)(this.elem,"role","switch"),this.setChecked(!1)}setChecked(e){(0,n.Bqc)(this.elem,"aria-checked",e)}},Ri=class extends Ci{constructor(e="horizontal"){super(e,"toolbar")}destructor(){}};function Ei(e,t){return t.params?.type===e}function zi(e){const t={params:e,result:void 0};return t.result=function(e){if("button"===e)return new Ii;if("slider"===e)return new Ti;if("toolbar"===e)return new Ri;if("group"===e)return new Ai;if("list"===e)return new Li;if("region"===e)return new vi((0,n.na4)("div"));if("axis"===e)return new Si;if("text"===e)return new Mi;if("listswitch"===e)return new Oi;throw new Error("AG Charts - error allocating meta")}(t.params.type),t}var Bi=class{constructor(e){this.ctx=e,this.cleanup=new n._uV}destroy(){this.cleanup.flush()}addLocalisation(e){e(),this.cleanup.register(this.ctx.eventsHub.on("locale:change",e))}createProxyContainer(e){const t=zi(e),{params:i,result:n}=t,s=n.getElement();this.ctx.domManager.addChild("canvas-proxy",i.domManagerId,s),s.classList.add(...i.classList,"ag-charts-proxy-container"),s.role=i.role??i.type,Ei("toolbar",t)&&(t.result.orientation=t.params.orientation);const{ariaLabel:a}=i;return a&&this.addLocalisation((()=>{s.ariaLabel=this.ctx.localeManager.t(a.id,a.params)})),n}createProxyElement(e){const t=zi(e);if(Ei("button",t)){const{params:e,result:i}=t,n=i.getElement();if(this.initInteract(e,i),"string"==typeof e.textContent)n.textContent=e.textContent;else{const{textContent:t}=e;this.addLocalisation((()=>{n.textContent=this.ctx.localeManager.t(t.id,t.params)}))}this.setParent(t.params,t.result)}if(Ei("slider",t)){const{params:e,result:i}=t,n=i.getElement();this.initInteract(e,i),n.type="range",n.role=e.role??"presentation",n.style.margin="0px",this.addLocalisation((()=>{n.ariaLabel=this.ctx.localeManager.t(e.ariaLabel.id,e.ariaLabel.params)})),this.setParent(t.params,t.result)}if(Ei("text",t)){const{params:e,result:i}=t;this.initElement(e,i),this.setParent(t.params,t.result)}if(Ei("listswitch",t)){const{params:e,result:i}=t;this.initInteract(e,i),i.setTextContent(e.textContent),i.setChecked(e.ariaChecked),i.setAriaDescribedBy(e.ariaDescribedBy),this.setParent(t.params,t.result)}if(Ei("region",t)){const{params:e,result:i}=t,n=i.getElement();this.initInteract(e,i),n.role=e.role??"region",this.setParent(t.params,t.result)}if(Ei("axis",t)){const{params:e,result:i}=t,n=i.getElement();this.initInteract(e,i),n.role=e.role??"region",this.setParent(t.params,t.result)}return t.result}initElement(e,t){const i=t.getElement();return(0,n.EMg)(i,"cursor",e.cursor),i.classList.toggle("ag-charts-proxy-elem",!0),e.classList?.length&&i.classList.add(...e.classList),i}initInteract(e,t){const{tabIndex:i,domIndex:n}=e,s=this.initElement(e,t);void 0!==i&&(s.tabIndex=i),void 0!==n&&(t.domIndex=n)}setParent(e,t){if("parent"in e)e.parent?.addChild(t);else{const i={where:e.where,query:".ag-charts-series-area"};this.ctx.domManager.addChild("canvas-proxy",e.domManagerId,t.getElement(),i),t.destroyListener=()=>{this.ctx.domManager.removeChild("canvas-proxy",e.domManagerId)}}}},Fi=/\$\{(\w+)}(?:\[(\w+)])?/gi,Vi=(()=>({number:new Intl.NumberFormat("en-US"),percent:new Intl.NumberFormat("en-US",{style:"percent",minimumFractionDigits:2,maximumFractionDigits:2}),percent0to2dp:new Intl.NumberFormat("en-US",{style:"percent",minimumFractionDigits:0,maximumFractionDigits:2}),date:new Intl.DateTimeFormat("en-US",{dateStyle:"full"}),time:new Intl.DateTimeFormat("en-US",{timeStyle:"full"}),datetime:new Intl.DateTimeFormat("en-US",{dateStyle:"full",timeStyle:"full"})}))();var $i=class{constructor(e,t){this.eventsHub=e,this.localeText=void 0,this.getLocaleText=void 0,this.defaultMessageFormatter=function(e){return({defaultValue:t,variables:i})=>t?.replaceAll(Fi,((t,n,s)=>{const a=i[n],o=null==s?null:Vi[s];return null!=s&&null==o&&e.warnOnce(`Format style [${s}] is not supported`),null!=o?o.format(a):"number"==typeof a?Vi.number.format(a):a instanceof Date?Vi.datetime.format(a):String(a)}))}(t)}setLocaleText(e){this.localeText!==e&&(this.localeText=e,this.eventsHub.emit("locale:change",null))}setLocaleTextFormatter(e){this.getLocaleText=e,this.getLocaleText!==e&&(this.getLocaleText=e,this.eventsHub.emit("locale:change",null))}t(e,t={}){const{localeText:i=u,getLocaleText:n}=this,s=i[e];return String(n?.({key:e,defaultValue:s,variables:t})??this.defaultMessageFormatter({key:e,defaultValue:s,variables:t})??e)}},Hi=class{constructor(e){this.width=600,this.height=300,this.direction="ltr";const{width:t,height:i,willReadFrequently:n=!1}=e;this.element=e.canvasElement,this.pixelRatio=e.pixelRatio,this.element.style.display="block",this.element.style.width=(t??this.width)+"px",this.element.style.height=(i??this.height)+"px",this.element.width=x(this.pixelRatio,t??this.width),this.element.height=x(this.pixelRatio,i??this.height),this.context=this.element.getContext("2d",{willReadFrequently:n}
1),this.context.direction=this.direction,this.resize(t??this.width,i??this.height,this.pixelRatio),D(this.context)}drawImage(e,t=0,i=0){return e.drawImage(this.context.canvas,t,i)}toDataURL(e){return this.element.toDataURL(e)}resize(e,t,i){if(!(e>0&&t>0))return;const{element:n,context:s}=this;n.width=x(i,e),n.height=x(i,t),s.setTransform(i,0,0,i,0,0),n.style.width=e+"px",n.style.height=t+"px",this.width=e,this.height=t,this.pixelRatio=i}setDirection(e){this.direction=e?"rtl":"ltr",this.element.dir=this.direction,this.context.direction=this.direction}clear(){k(this)}destroy(){this.element.remove(),this.element.width=0,this.element.height=0,this.context.clearRect(0,0,0,0),Object.freeze(this)}reset(){this.context.reset(),this.context.verifyDepthZero?.(),this.context.direction=this.direction}},ji=class extends n.bkB{constructor(){super(...arguments),this.cache=new Map,this.imageLoadingCount=0,this.destroyed=!1}loadImage(e,t,i){const s=function(e,t){return t?`${e}@${t.width}x${t.height}`:e}(e,i),a=this.cache.get(s);if(a?.image)return a.image;if(null!=a&&t)return void a.nodes.add(t);if(!t)return;const o={image:void 0,nodes:new Set([t]),blobUrl:void 0};this.cache.set(s,o),this.imageLoadingCount++;const r=()=>{null!=o.blobUrl&&(URL.revokeObjectURL(o.blobUrl),o.blobUrl=void 0)},l=t=>{if(this.destroyed)r();else{o.image=t;for(const e of o.nodes)e.markDirty();o.nodes.clear(),this.imageLoadingCount--,r(),this.emit("image-loaded",{uri:e})}},h=()=>{this.destroyed?r():(this.imageLoadingCount--,o.nodes.clear(),r(),this.cache.delete(s),this.emit("image-error",{uri:e}))};this.resolveSource(e,i).then((e=>{if(this.destroyed)return void(null!=e.blobUrl&&URL.revokeObjectURL(e.blobUrl));null!=e.blobUrl&&(o.blobUrl=e.blobUrl);const t=new((0,n.QpR)());t.onload=()=>l(t),t.onerror=h,t.src=e.src})).catch(h)}unregisterNode(e){for(const t of this.cache.values())t.nodes.delete(e)}async resolveSource(e,t){if(!t||"function"!=typeof fetch||"undefined"==typeof Blob)return{src:e};const i=function(e,t){const i=e.search(/[?#]/),n=i>=0?e.slice(0,i):e;return n.toLowerCase().endsWith(t)}(e,".svg"),n=e.startsWith("data:image/svg");if(!i&&!n)return{src:e};try{const i=await fetch(e,{mode:"cors"}),n=i.headers.get("content-type")??"",s=n.startsWith("image/")||n.startsWith("application/"),a=n.includes("svg");if(s&&!a)return{src:e};const o=await i.text();if(!a&&!function(e){return Wi.test(e)}(o))return{src:e};const r=function(e,t,i){if("undefined"==typeof DOMParser||"undefined"==typeof XMLSerializer)return;try{const n=(new DOMParser).parseFromString(e,"image/svg+xml").documentElement;if("svg"!==n?.tagName.toLowerCase())return;const s=Gi(n,"width"),a=Gi(n,"height");if(s&&a)return;return s||n.setAttribute("width",String(t)),a||n.setAttribute("height",String(i)),(new XMLSerializer).serializeToString(n)}catch{return}}(o,t.width,t.height);if(!r)return{src:e};const l=new Blob([r],{type:"image/svg+xml"}),h=URL.createObjectURL(l);return{src:h,blobUrl:h}}catch{return{src:e}}}waitingToLoad(){return this.imageLoadingCount>0}destroy(){this.destroyed=!0;for(const e of this.cache.values())e.nodes.clear(),null!=e.blobUrl&&(URL.revokeObjectURL(e.blobUrl),e.blobUrl=void 0);this.cache.clear()}};var Wi=/^\uFEFF?\s{0,32}(?:<\?xml[^>]{0,256}\?>\s{0,32})?(?:<!DOCTYPE[^>]{0,256}>\s{0,32})?<svg[\s>]/i;var _i=/^\s{0,8}\+?(\d{1,6}(?:\.\d{1,6})?(?:e[+-]?\d{1,3})?)\s{0,8}(?:px|pt|cm|mm|in|pc|q)?\s{0,8}$/i;function Gi(e,t){const i=e.getAttribute(t);if(null==i)return!1;const n=_i.exec(i);return!!n&&Number.parseFloat(n[1])>0}var Ki=class{constructor(e){this.canvas=e,this.debug=n.yar.create(!0,"scene"),this.layersMap=new Map,this.nextLayerId=0}get size(){return this.layersMap.size}resize(e,t,i){this.canvas.resize(e,t,i);for(const{canvas:n}of this.layersMap.values())n.resize(e,t,i)}addLayer(e){const{width:t,height:i,pixelRatio:n}=this.canvas,{name:s}=e,a=new I({width:t,height:i,pixelRatio:n});return this.layersMap.set(a,{id:this.nextLayerId++,name:s,canvas:a}),this.debug("Scene.addLayer() - layers",this.layersMap),a}removeLayer(e){this.layersMap.has(e)&&(this.layersMap.delete(e),e.destroy(),this.debug("Scene.removeLayer()
1- layers",this.layersMap))}clear(){for(const e of this.layersMap.values())e.canvas.destroy();this.layersMap.clear()}},Yi=(()=>{var e=class extends n.bkB{constructor(e,t=n.tr_){super(),this.logger=t,this.debug=n.yar.create(!0,"scene"),this.id=(0,n.sX_)(this),this.imageLoader=new ji,this.root=null,this.pendingSize=null,this.isDirty=!1,this.direction="ltr",this.cleanup=new n._uV,this.updateDebugFlags(),this.canvas=new Hi(e),this.layersManager=new Ki(this.canvas),this.cleanup.register(this.imageLoader.on("image-loaded",(()=>{this.emit("scene-changed",{})})),this.imageLoader.on("image-error",(({uri:e})=>{this.logger.warnOnce(`Unable to load image ${e}`)})))}setLogger(e){this.logger=e}waitingForUpdate(){return this.imageLoader?.waitingToLoad()??!1}get width(){return this.pendingSize?.[0]??this.canvas.width}get height(){return this.pendingSize?.[1]??this.canvas.height}get pixelRatio(){return this.pendingSize?.[2]??this.canvas.pixelRatio}get isRtl(){return"rtl"===this.direction}setContainer(e){const{element:t}=this.canvas;return t.remove(),e.appendChild(t),this}setRoot(e){return this.root===e||(this.isDirty=!0,this.root?.setScene(),this.root=e,e&&(e.visible=!0,e.setScene(this))),this}updateDebugFlags(){n.yar.inDevelopmentMode((()=>P._debugEnabled=!0))}clearCanvas(){this.canvas.clear()}attachNode(e){return this.appendChild(e),()=>e.remove()}appendChild(e){return this.root?.appendChild(e),this}removeChild(e){return e.remove(),this}download(e,t){(0,n.Isv)(this.canvas.toDataURL(t),e?.trim()??"image")}getDataURL(e){return this.canvas.toDataURL(e)}resize(e,t,i){return e=Math.round(e),t=Math.round(t),i??(i=this.pixelRatio),e>0&&t>0&&(e!==this.width||t!==this.height||i!==this.pixelRatio)&&(this.pendingSize=[e,t,i],this.isDirty=!0,!0)}setDirection(e){this.direction=e?"rtl":"ltr",this.canvas.setDirection(e)}updateBaseFont(){const e=this.root?.resolveFont();null!=e&&e!==this._contextFont&&(this._baseFont=e,this.pendingSize||(this.canvas.context.font=e,this._contextFont=e))}applyPendingResize(){return!!this.pendingSize&&(this.layersManager.resize(...this.pendingSize),this.pendingSize=null,this._contextFont=void 0,null!=this._baseFont&&(this.canvas.context.font=this._baseFont,this._contextFont=this._baseFont),!0)}render(e){const{debugSplitTimes:t={start:performance.now()},extraDebugStats:i,seriesRect:s,debugColors:a}=e??{},{canvas:o,canvas:{context:r}={},root:l,width:h,height:c,pixelRatio:d}=this;if(!r)return;const u=n.yar.check("scene:stats","scene:stats:verbose");u&&this.ensureDebugStatsRegistration();const p=performance.now(),g=this.applyPendingResize();if(l&&!l.visible)return void(this.isDirty=!1);let m;if(l instanceof ke&&(m=l.dirty),null!=l&&!1===m&&!this.isDirty)return this.debug.check()&&this.debug("Scene.render() - no-op",{tree:Pe(l,"console")}),void(u&&Le(this.layersManager,t,r,void 0,i,s,a));const y={ctx:r,direction:this.direction,width:h,height:c,devicePixelRatio:d,logger:this.logger,debugNodes:{},currentFont:this._contextFont};n.yar.check("scene:stats:verbose")&&(y.stats={layersRendered:0,layersSkipped:0,nodesRendered:0,nodesSkipped:0,opsPerformed:0,opsSkipped:0}),function(e){const t=(0,n.$rL)((0,n.zkX)("agChartsSceneDebug")),i=[];for(const e of t)"layout"===e?i.push("seriesRoot","legend","root",/Axis-\d+-axis/):i.push(e);e.debugNodeSearch=i}(y);let f=!1;if((!1!==m||g)&&(f=!0,o.clear()),l&&n.yar.check("scene:dirtyTree")){const{dirtyTree:e,paths:t}=Te(l);n.yar.create("scene:dirtyTree")("Scene.render() - dirtyTree",{dirtyTree:e,paths:t})}if(l&&f){if(l.visible&&l.preRender(y),this.debug.check()){const e=Pe(l,"console");this.debug("Scene.render() - before",{canvasCleared:f,tree:e})}if(l.visible)try{r.save(),l.render(y),r.restore()}catch(e){throw this.canvas.reset(),e}}t["âï¸"]=performance.now()-p,r.verifyDepthZero?.(),this.isDirty=!1,u&&Le(this.layersManager,t,r,y.stats,i,s,a),function(e,t){e.save();try{for(const[i,s]of Object.entries(t)){const t=Me.toCanvas(s);t?(e.globalAlpha=.8,e.strokeStyle="red",e.lineWidth=1,e.strokeRect(t.x,t.y,t.width,t.height),e.fillStyle="red",e.strokeStyle="white",e.font="16px sans-serif",e.textBaseline="top",e.textAlign="left",e.lineWidth=2,e.strokeText(i,t.x,t.y,t.width),e.fillText(i,t.x,t.y,t.width)):n.tDR.log(`Scene.render() - no bbox for debugged node [${i}].`)}}catch(e){n.tDR.warnOnce("Error during debug rendering",e)}
1finally{e.restore()}}(r,y.debugNodes),l&&this.debug.check()&&this.debug("Scene.render() - after",{tree:Pe(l,"console"),canvasCleared:f})}ensureDebugStatsRegistration(){if(this.releaseDebugStats)return;const e=function(){Ce++;let e=!1;return()=>{e||0===Ce||(e=!0,0==--Ce&&Ee())}}(),t=()=>{e(),this.releaseDebugStats=void 0};this.releaseDebugStats=t,this.cleanup.register(t)}toSVG(){const{root:e,width:t,height:i}=this;if(null!=e)return P.toSVG(e,t,i)}strip(){const{context:e,pixelRatio:t}=this.canvas;e.setTransform(t,0,0,t,0,0),this.layersManager.clear(),this.setRoot(null),this.isDirty=!1,this.clear()}destroy(){null!=this.canvas&&(this.strip(),this.canvas.destroy(),this.imageLoader.destroy(),this.cleanup.flush(),Ee(),Object.assign(this,{canvas:void 0}))}};return e.className="Scene",e})(),Ui=class{constructor(e,t){this.eventsHub=e,this.sceneRoot=t,this.axes=new Map,this.axisGridGroup=new ke({name:"Axes-Grids",zIndex:n.Dcv.AXIS_GRID}),this.axisGroup=new ke({name:"Axes",zIndex:n.Dcv.AXIS}),this.axisLabelGroup=new ke({name:"Axes-Labels",zIndex:n.Dcv.SERIES_LABEL}),this.axisOverlayLowGroup=new ke({name:"Axes-Overlay-Low",zIndex:n.Dcv.SERIES_CROSSLINE_RANGE}),this.axisOverlayMidGroup=new ke({name:"Axes-Overlay-Mid",zIndex:n.Dcv.SERIES_CROSSLINE_LINE}),this.axisOverlayHighGroup=new ke({name:"Axes-Overlay-High",zIndex:n.Dcv.SERIES_LABEL}),this.sceneRoot.appendChild(this.axisGroup),this.sceneRoot.appendChild(this.axisGridGroup),this.sceneRoot.appendChild(this.axisLabelGroup),this.sceneRoot.appendChild(this.axisOverlayLowGroup),this.sceneRoot.appendChild(this.axisOverlayMidGroup),this.sceneRoot.appendChild(this.axisOverlayHighGroup)}updateAxes(e,t){const i={axisNode:this.axisGroup,gridNode:this.axisGridGroup,labelNode:this.axisLabelGroup,overlayLowNode:this.axisOverlayLowGroup,overlayMidNode:this.axisOverlayMidGroup,overlayHighNode:this.axisOverlayHighGroup};for(const n of e)t.includes(n)||(n.detachAxis(i),n.destroy());for(const n of t)e?.includes(n)||n.attachAxis(i);this.axes.clear();for(const e of t){const t=e.createAxisContext();this.axes.has(t.direction)?this.axes.get(t.direction)?.push(t):this.axes.set(t.direction,[t])}this.eventsHub.emit("axis:change",null)}getAxisIdContext(e){for(const[,t]of this.axes)for(const i of t)if(i.axisId===e)return i}getAxisContext(e){return this.axes.get(e)??[]}setRemappedAxisKeys(e){this.remappedAxisKeys=e}getRemappedAxisId(e){return this.remappedAxisKeys?.get(e)}destroy(){this.axes.clear(),this.axisGroup.remove(),this.axisGridGroup.remove()}};function Xi(e){return Array.isArray(e)&&e.length>0}var Zi=class{constructor(){this.requests=[]}add(e){this.requests.push(e)}claim(e,t){const i=this.requests.indexOf(e);return-1===i||t&&i!==this.requests.length-1?(this.requests=this.requests.filter((t=>t!==e)),!1):(this.requests=this.requests.slice(i+1),!0)}},qi=(()=>{var e=class{constructor(e,t,i,s){this.eventsHub=e,this.caller=t,this.animationManager=i,this.logger=s,this.dispatchOnlyLatest=!0,this.dispatchThrottle=0,this.requestThrottle=300,this.isLoadingInitialData=!1,this.fetchPending=!1,this.inFlightCount=0,this.isForcedLoadingData=void 0,this.primaryRequests=new Zi,this.requestCounter=0,this.pendingData=void 0,this.lastDispatchedData=void 0,this.debug=n.yar.create(!0,"data-model","data-source"),this.throttledFetch=this.createThrottledFetch(this.requestThrottle),this.throttledDispatch=this.createThrottledDispatch(this.dispatchThrottle),this._secondaryLoaders=[]}updateCallback(e){"function"==typeof e&&(this.debug("DataService - updated data source callback"),this.dataSourceCallback=e,this.isLoadingInitialData=!0,this.animationManager.skip(),this.eventsHub.emit("data:source-change",null))}clearCallback(){this.dataSourceCallback=void 0}load(e,t){const{pendingData:i}=this;if(null!=i&&(null==i.params.windowStart&&null==i.params.windowEnd||i.params.windowStart?.valueOf()===e.windowStart?.valueOf()&&i.params.windowEnd?.valueOf()===e.windowEnd?.valueOf())){const e=this.requestCounter++;return this.isLoadingInitialData=!1,void this.dispatch(e,i.data,t)}this.fetchPending=!0,this.eventsHub.emit("chart:request-update",{type:n.GvF.PERFORM_LAYOUT}),this.throttledFetch(e,t)}registerSecondaryLoader(e,t,i){return this._secondaryLoaders.push({source:e,triggers:t,callback:i,requests:new Zi}),()=>{this._secondaryLoaders=this._secondaryLoaders.filter((e=>e.callback!==i))}}isLazy(){return null!=this.dataSourceCallback}isLoading(){return null!=this.isForcedLoadingData?this.isForcedLoadingData:this.isLazy()&&(this.isLoadingInitialData||this.fetchPending||this.inFlightCount>0)}setForcedLoading(e){this.isForcedLoadingData=e}async getData(){const{latestRequest:e}=this;if(e)return await e.fetchRequest,this.lastDispatchedData}
1restoreData(e){this.pendingData=e}createThrottledFetch(e){return(0,n.nFR)(((e,t)=>this.fetch(e,t).catch((e=>this.logger.error("callback failed",e)))),e,{leading:!1,trailing:!0})}createThrottledDispatch(e){return(0,n.nFR)(((e,t,i)=>this.dispatch(e,t,i)),e,{leading:!0,trailing:!0})}dispatch(e,t,i){this.debug(`DataService - dispatching 'data-load' | ${e}`),this.eventsHub.emit("data:load",{data:t,requestId:i})}async fetch(e,t){this.fetchPending=!1,this.inFlightCount++;try{await this.fetchAndDispatch(e,t)}finally{this.inFlightCount--}}async fetchAndDispatch(e,t){"context"in this.caller&&(e.context=this.caller.context);const i=Promise.resolve().then((async()=>{if(!this.dataSourceCallback)throw new Error("DataService - [dataSource.getData] callback not initialised");const t=this.requestCounter++;this.debug(`DataService - requesting | ${t}`);const{response:i,threw:n}=await this.performFetch(e,t);return this.isLoadingInitialData=!1,{id:t,response:i,threw:n}})),s=[];if(null!=e.source&&this.dataSourceCallback)for(const t of this._secondaryLoaders){if(!t.triggers.includes(e.source))continue;const i=this.performFetch({...e,source:t.source},t.source);t.requests.add(i),s.push(i.then((({response:e})=>({secondary:t,request:i,response:e}))))}this.latestRequest={params:e,fetchRequest:i},this.primaryRequests.add(i);const a=await Promise.all(s);for(const{secondary:e,request:t,response:i}of a)e.requests.claim(t,this.dispatchOnlyLatest)&&Xi(i)&&e.callback(i);const{id:o,response:r,threw:l}=await i;this.primaryRequests.claim(i,this.dispatchOnlyLatest)?Xi(r)?(this.lastDispatchedData={params:e,data:r},this.throttledDispatch(o,r,t)):(l||Array.isArray(r)||this.logger.warnOnce(`DataService - [dataSource.getData] returned an invalid value \`${(0,n.ngZ)(r,50)}\`; expecting an array, ignoring.`),this.eventsHub.emit("data:error",{requestId:t})):this.debug(`DataService - discarding stale request | ${o}`)}async performFetch(e,t){if(!this.dataSourceCallback)return{response:void 0,threw:!1};let i,n=!1;try{const n=performance.now();i=await this.dataSourceCallback(e),this.debug(`DataService - response | ${performance.now()-n}ms | ${t}`)}catch(e){n=!0,this.debug(`DataService - request failed | ${t}`),this.logger.warnOnce(`DataService - request failed | [${e}]`)}return{response:i,threw:n}}};return d([(0,n.mBh)({newValue(e){this.throttledDispatch=this.createThrottledDispatch(e)}})],e.prototype,"dispatchThrottle",2),d([(0,n.mBh)({newValue(e){this.throttledFetch=this.createThrottledFetch(e)}})],e.prototype,"requestThrottle",2),e})(),Qi=class{constructor(e){this.ctx=e,this.observers=[],this.destroyed=!1,this.pendingFontLoad=!1,this.cleanup=[],this.confirmedFontSpecs=new Set,this.flushFontLoad=()=>{this.destroyed||!this.pendingFontLoad||this.ctx.animationManager.isActive()||(this.pendingFontLoad=!1,n.K$y.clear(),this.ctx.eventsHub.emit("font:load",null))},this.onFontSetChange=()=>{this.confirmedFontSpecs.clear()},this.cleanup.push(e.animationManager.addListener("animation-stop",this.flushFontLoad),e.eventsHub.on("update:complete",this.flushFontLoad))}notifyFontLoad(){this.pendingFontLoad=!0,this.flushFontLoad()}updateFonts(e){if(e&&0!==e.size){this.loadFonts(e);for(const t of e)this.observeFontStatus(t)}}waitForFonts(e){if(!e||0===e.size)return;const t=(0,n.YEm)("fonts");if(null==t)return;this.watchFontSet(t);const i=[];for(const n of e)if(!this.confirmedFontSpecs.has(n))try{t.check(n)?this.confirmedFontSpecs.add(n):i.push(t.load(n))}catch{}0!==i.length&&Promise.allSettled(i).then((()=>{this.destroyed||this.notifyFontLoad()}))}watchFontSet(e){this.watchedFontSet!==e&&"addEventListener"in e&&(this.unwatchFontSet(),this.confirmedFontSpecs.clear(),this.watchedFontSet=e,e.addEventListener("loadingdone",this.onFontSetChange),e.addEventListener("loadingerror",this.onFontSetChange))}unwatchFontSet(){this.watchedFontSet?.removeEventListener("loadingdone",this.onFontSetChange),this.watchedFontSet?.removeEventListener("loadingerror",this.onFontSetChange),this.watchedFontSet=void 0}destroy(){this.destroyed=!0;for(const e of this.observers)e.disconnect();this.observers=[];for(const e of this.cleanup)e();this.cleanup.length=0,this.unwatchFontSet()}loadFonts(e){const t=Array.from(e).map((e=>encodeURIComponent(e))),i=":wght@100;200;300;400;500;600;700;800;900",n=`${i}&family=`,s=`@import url('https://fonts.googleapis.com/css2?family=${t.join(n)}${i}&display=swap');\n`;this.ctx.domManager.addStyles(`google-font-${t.join("-")}`,s)}observeFontStatus(e){const t=(0,n.NQR)();if(void 0===t)return;const i=this.ctx.domManager.getDocument().createElement("div",{position:"absolute",top:"0",margin:"0",padding:"0",overflow:"hidden",visibility:"hidden",
1width:"auto",maxWidth:"none",fontSynthesis:"none",fontFamily:e,fontSize:"16px",whiteSpace:"nowrap"});i.textContent="UVWxyz",this.ctx.domManager.addChild("canvas-container",`font-check-${encodeURIComponent(e)}`,i);const s=new t((e=>{const t=e?.at(0)?.contentBoxSize.at(0)?.inlineSize;null!=t&&t>0&&this.notifyFontLoad()}));s.observe(i),this.observers.push(s)}},Ji={enabled:n.zMY,text:n.YjP,padding:n.Ia$,border:n.QQ,cornerRadius:n.aig,...n.LVV,...n.Fup};Ji.overflow=(0,n._Le)((0,n.KCZ)("pad-chart","realign-text","clip-text"));var en={enabled:n.zMY,...n.AFh,...n.mLn},tn={click:n.E2r,doubleClick:n.E2r},nn={...en,fill:n.aXB,fillOpacity:n.CGN},sn={...Ji,positionAngle:n.aig};function an(e,t){const i={id:n.YjP,listeners:tn,...en,label:t};return(0,n.ist)({line:{value:(0,n.mw3)(e),...i},range:{range:(0,n.mw3)((0,n.Uo6)((0,n.jk9)(e),(0,n.O9d)(2,2))),fill:n.aXB,fillOpacity:n.CGN,...i}},"cross-line options")}var on=(()=>({...Ji,position:(0,n.KCZ)("top","left","right","bottom","top-left","top-right","bottom-left","bottom-right","inside","inside-left","inside-right","inside-top","inside-bottom","inside-top-left","inside-bottom-left","inside-top-right","inside-bottom-right"),rotation:n.aig}))();on.reserveSpace=(0,n._Le)(n.zMY);var rn=an(n.swK,on),ln=(()=>({enabled:n.zMY,rotation:n.aig,textAlign:n.JhA,verticalAlign:n.whe,avoidCollisions:n.zMY,minSpacing:n.LyW,spacing:n.LyW,formatter:(0,n.R3$)(n.JwX),itemStyler:(0,n.YIG)({...n.LVV,...n.lb7,spacing:n.aig}),...n.LVV,...n.lb7}))(),hn={autoRotate:n.zMY,autoRotateAngle:n.aig,wrapping:n.IQA,truncate:n.zMY,...ln},cn={format:n.Hg5,...hn},dn=(()=>({format:(0,n.or)(n.YjP,n.Ikc),...hn}))(),un={enabled:n.zMY,width:n.LyW,size:n.LyW,stroke:n.aXB},pn={enabled:n.zMY,label:dn,tick:un},gn=(()=>({values:(0,n.jk9)(n.swK),minSpacing:n.LyW}))(),mn=(()=>({reverse:n.zMY,gridLine:{enabled:n.zMY,width:n.LyW,style:(0,n.J$N)({fill:n.aXB,fillOpacity:n.LyW,stroke:(0,n.or)(n.aXB,n.I_s),strokeWidth:n.LyW,lineDash:(0,n.jk9)(n.LyW)},"a grid-line style object array")},interval:gn,label:ln,line:{enabled:n.zMY,width:n.LyW,stroke:n.aXB},tick:un,context:()=>!0}))();mn.layoutConstraints=(0,n._Le)({stacked:(0,n.mw3)(n.zMY),align:(0,n.mw3)((0,n.KCZ)("start","end")),unit:(0,n.mw3)((0,n.KCZ)("percent","px")),width:(0,n.mw3)(n.LyW)});var yn=(()=>({enabled:n.zMY,text:n.JwX,spacing:n.LyW,maxWidth:n.LyW,maxHeight:n.LyW,wrapping:(0,n.KCZ)("never","always","hyphenate","on-space"),truncate:n.zMY,formatter:(0,n.R3$)(n.JwX),...n.LVV}))(),fn=(()=>({...yn,orientation:(0,n.KCZ)("horizontal","vertical","vertical-reversed")}))(),xn=(()=>({...mn,title:fn,crossAt:{value:(0,n.mw3)((0,n.or)(n.r3t,n.p6U,n.YjP,(0,n.jk9)(n.YjP))),sticky:n.zMY,titlePlacement:(0,n.KCZ)("crossing","edge"),labelPlacement:(0,n.KCZ)("crossing","edge"),crosshairLabelPlacement:(0,n.KCZ)("crossing","edge")},crossLines:(0,n.J$N)(rn,"a cross-line options array"),position:(0,n.KCZ)("top","right","bottom","left"),thickness:n.LyW,maxThicknessRatio:n.CGN,listeners:{click:n.E2r,doubleClick:n.E2r,crossLineClick:n.E2r,crossLineDoubleClick:n.E2r}}))();xn.title._enabledFromTheme=(0,n._Le)(n.zMY);var bn={enabled:n.zMY,...n.Fup,...n.AFh,...n.mLn};function vn(e,t){const i={enabled:n.zMY,xOffset:n.aig,yOffset:n.aig,formatter:(0,n.R3$)(n.YjP),renderer:(0,n.R3$)((0,n.or)(n.YjP,n.aig,n.p6U,(0,n.fd6)({text:n.YjP,color:n.aXB,backgroundColor:n.aXB,opacity:n.CGN},"crosshair label renderer result object")))};let s;return e&&(s={...i,format:t?(0,n.or)(n.YjP,(0,n.fd6)({millisecond:n.YjP,second:n.YjP,hour:n.YjP,day:n.YjP,month:n.YjP,year:n.YjP})):n.YjP}),{enabled:n.zMY,snap:n.zMY,label:s??i,...n.AFh,...n.mLn}}function Sn(e,t){return{min:(0,n.Uo6)(e,(0,n.XeB)("max")),max:(0,n.Uo6)(e,(0,n.MM$)("min")),preferredMin:(0,n.Uo6)(e,(0,n.XeB)("preferredMax"),(0,n.XeB)("max")),preferredMax:(0,n.Uo6)(e,(0,n.MM$)("preferredMin"),(0,n.MM$)("min")),nice:n.zMY,interval:{step:t?(0,n.or)(n.MX6,n.fyz,n.f$c):n.NlA,values:(0,n.jk9)(e),minSpacing:(0,n.Uo6)(n.LyW,(0,n.XeB)("maxSpacing")),maxSpacing:(0,n.Uo6)(n.LyW,(0,n.MM$)("minSpacing"))}}}var Mn=(()=>({step:(0,n.or)(n.MX6,n.fyz,n.f$c),values:(0,n.jk9)((0,n.or)(n.aig,n.p6U)),minSpacing:(0,n.Uo6)(n.LyW,(0,n.XeB)("maxSpacing")),maxSpacing:(0,n.Uo6)(n.LyW,(0,n.MM$)("minSpacing")),placement:(0,n.KCZ)("on","between")}))(),kn=(()=>({...xn,type:(0,n.dYl)("category"),label:hn,paddingInner:n.CGN,paddingOuter:n.CGN,groupPaddingInner:n.CGN,crosshair:vn(),bandAlignment:(0,n.KCZ)("justify","start","center","end"),bandHighlight:bn,interval:{...gn,placement:(0,n.KCZ)("on","between")},skipNullBars:n.zMY}))(),Dn=(()=>({...xn,type:(0,n.dYl)("grouped-category"),label:hn,crosshair:vn(),bandHighlight:bn,paddingInner:n.CGN,groupPaddingInner:n.CGN,depthOptions:(0,n.J$N)({label:{enabled:n.zMY,avoidCollisions:n.zMY,wrapping:(0,n.KCZ)("never","always","hyphenate","on-space"),truncate:n.zMY,rotation:n.aig,spacing:n.aig,...n.LVV,...n.lb7},tick:{enabled:n.zMY,stroke:n.aXB,width:n.LyW}},"depth options objects array")}))(),wn=(()=>({...xn,...Sn(n.r3t),type:(0,n.dYl)("number"),label:cn,crosshair:vn(!0),crossLines:(0,n.J$N)(an(n.r3t,on),"a cross-line options array")}))(),In=(()=>({...xn,...Sn(n.r3t),type:(0,n.dYl)("log"),base:(0,n.Uo6)(n.MX6,(0,n.W$8)((e=>1!==e),"not equal to 1")),label:cn,crosshair:vn(!0),crossLines:(0,n.J$N)(an(n.r3t,on),"a cross-line options array")}))(),An=(()=>({...xn,...Sn((0,n.or)(n.aig,n.p6U),!0),type:(0,n.dYl)("time"),label:dn,parentLevel:pn,crosshair:vn(!0,!0),crossLines:(0,n.J$N)(an((0,n.or)(n.r3t,n.p6U),on),"a cross-line options array")}))(),Cn=(()=>({...xn,type:(0,n.dYl)("unit-time"),unit:(0,n.or)(n.f$c,n.fyz),label:dn,parentLevel:pn,paddingInner:n.CGN,paddingOuter:n.CGN,groupPaddingInner:n.CGN,crosshair:vn(!0,!0),bandAlignment:(0,n.KCZ)("justify","start","center","end"),bandHighlight:bn,skipNullBars:n.zMY,min:(0,n.Uo6)((0,n.or)(n.aig,n.p6U),(0,n.XeB)("max")),max:(0,n.Uo6)((0,n.or)(n.aig,n.p6U),(0,n.MM$)("min")),preferredMin:(0,n.Uo6)((0,n.or)(n.aig,n.p6U),(0,n.XeB)("preferredMax"),(0,n.XeB)("max")),preferredMax:(0,n.Uo6)((0,n.or)(n.aig,n.p6U),(0,n.MM$)("preferredMin"),(0,n.MM$)("min")),interval:Mn,crossLines:(0,n.J$N)(an((0,n.or)(n.r3t,n.p6U),on),"a cross-line options array")}))(),Nn=(()=>({...xn,type:(0,n.dYl)("ordinal-time"),paddingInner:n.CGN,paddingOuter:n.CGN,groupPaddingInner:n.CGN,label:dn,parentLevel:pn,interval:Mn,crosshair:vn(!0,!0),crossLines:(0,n.J$N)(an((0,n.or)(n.r3t,n.p6U),on),"a cross-line options array"),bandHighlight:bn,bandAlignment:(0,n.KCZ)("justify","start","center","end"),skipNullBars:n.zMY}))(),Ln=(()=>({...mn,...Sn(n.r3t),type:(0,n.dYl)("angle-number"),crossLines:(0,n.J$N)(an(n.r3t,Ji),"a cross-line options array"),startAngle:n.aig,endAngle:n.aig,label:{...ln,orientation:(0,n.KCZ)("fixed","parallel","perpendicular"),format:n.Hg5}}))();
1Ln.shape=(0,n.KCZ)("polygon","circle");var Pn=(()=>({...mn,type:(0,n.dYl)("angle-category"),shape:(0,n.KCZ)("polygon","circle"),crossLines:(0,n.J$N)(an(n.swK,Ji),"a cross-line options array"),startAngle:n.aig,endAngle:n.aig,paddingInner:n.CGN,groupPaddingInner:n.CGN,label:{...ln,orientation:(0,n.KCZ)("fixed","parallel","perpendicular")}}))();Pn.innerRadiusRatio=n.CGN;var Tn=(()=>({...mn,...Sn(n.r3t),type:(0,n.dYl)("radius-number"),shape:(0,n.KCZ)("polygon","circle"),positionAngle:n.aig,innerRadiusRatio:n.CGN,title:yn,crossLines:(0,n.J$N)(an(n.r3t,sn),"a cross-line options array"),label:{...ln,format:n.Hg5}}))(),On=(()=>({...mn,type:(0,n.dYl)("radius-category"),positionAngle:n.aig,innerRadiusRatio:n.CGN,paddingInner:n.CGN,paddingOuter:n.CGN,groupPaddingInner:n.CGN,label:ln,title:yn,crossLines:(0,n.J$N)(an(n.swK,sn),"a cross-line options array")}))();On.shape=(0,n.KCZ)("polygon","circle");var Rn=(0,n.wxv)(n.Dgf,n.Dgf),En=(0,n.YIG)({...n.AFh,...n.Fup,...n.mLn,marker:n.AE2}),zn={showInMiniChart:n.zMY,connectMissingData:n.zMY,interpolation:n.h0L,label:n.jjq,styler:En,marker:n.$2g,tooltip:n.pRZ,shadow:n.zd9,...n.sPu,...n.Fup,...n.AFh,...n.mLn,highlight:Rn,segmentation:n.i_e},Bn=(()=>({...zn,...n.XxK,highlight:Rn,type:(0,n.mw3)((0,n.dYl)("area")),xKey:(0,n.mw3)(n.YjP),yKey:(0,n.mw3)(n.YjP),xKeyAxis:n.YjP,yKeyAxis:n.YjP,xName:n.YjP,yName:n.YjP,legendItemName:n.YjP,stacked:n.zMY,stackGroup:n.YjP,normalizedTo:n.aig}))();Bn.selectedKey=(0,n._Le)(n.YjP);var Fn=(0,n.wxv)(n.TaA,n.TaA),Vn=(0,n.YIG)({...n.Fup,...n.AFh,...n.mLn,cornerRadius:n.LyW}),$n=(()=>({direction:(0,n.KCZ)("horizontal","vertical"),showInMiniChart:n.zMY,cornerRadius:n.LyW,styler:Vn,itemStyler:Vn,crisp:n.zMY,label:{...n.gfe,...n.iIr,...n.QB3,...n.$VX,placement:(0,n.Ueb)("inside-center","inside-start","inside-end","outside-start","outside-end","beside-before-start","beside-before-center","beside-before-end","beside-after-start","beside-after-center","beside-after-end"),orientation:n.cDl,spacing:n.LyW},errorBar:n.dV6,shadow:n.zd9,tooltip:n.cUy,...n.sPu,highlight:Fn,...n.Fup,...n.AFh,...n.mLn,segmentation:n.i_e,width:n.MX6,widthRatio:n.CGN}))();$n.sparklineMode=(0,n._Le)(n.zMY);var Hn=(()=>({...$n,...n.XxK,highlight:Fn,type:(0,n.mw3)((0,n.dYl)("bar")),xKey:(0,n.mw3)(n.YjP),yKey:(0,n.mw3)(n.YjP),xKeyAxis:n.YjP,yKeyAxis:n.YjP,xName:n.YjP,yName:n.YjP,direction:(0,n.KCZ)("horizontal","vertical"),grouped:n.zMY,stacked:n.zMY,stackGroup:n.YjP,normalizedTo:n.aig,legendItemName:n.YjP,errorBar:n.MnY}))();Hn.yFilterKey=(0,n._Le)(n.YjP),Hn.pickOutsideVisibleMinorAxis=(0,n._Le)(n.zMY),Hn.focusPriority=(0,n._Le)(n.aig),Hn.simpleItemStyler=(0,n._Le)(n.E2r);var jn=(()=>({title:n.YjP,sizeDomain:(0,n.Uo6)((0,n.jk9)(n.r3t),(0,n.O9d)(2,2)),minSize:n.LyW,maxSize:n.LyW,showInMiniChart:n.zMY,label:n.jjq,tooltip:n.cUy,styler:(0,n.YIG)({...(0,n.FFB)(n.$2g,["size"]),minSize:n.LyW,maxSize:n.LyW}),maxRenderedItems:n.aig,...n.sPu,...(0,n.FFB)(n.$2g,["enabled","size"]),highlight:(0,n.wxv)(n.Dgf,n.Dgf),colorScale:(0,n.s2x)(n.pRw)}))(),Wn=(()=>({...jn,...n.XxK,type:(0,n.mw3)((0,n.dYl)("bubble")),xKey:(0,n.mw3)(n.YjP),yKey:(0,n.mw3)(n.YjP),sizeKey:(0,n.mw3)(n.YjP),labelKey:n.YjP,colorKey:(0,n.s2x)(n.YjP),xName:n.YjP,yName:n.YjP,sizeName:n.YjP,labelName:n.YjP,colorName:(0,n.s2x)(n.YjP),legendItemName:n.YjP,xKeyAxis:n.YjP,yKeyAxis:n.YjP,highlight:(0,n.wxv)(n.Dgf,n.Dgf)}))();Wn.selectedKey=(0,n._Le)(n.YjP);var _n=(0,n.YIG)({...n.Fup,...n.AFh,...n.mLn,cornerRadius:n.LyW}),Gn=(()=>({showInMiniChart:n.zMY,cornerRadius:n.LyW,styler:_n,itemStyler:_n,label:{...n.gfe,...n.iIr,...n.QB3,...n.$VX,placement:(0,n.Ueb)("inside-center","inside-start","inside-end","outside-start","outside-end"),spacing:n.LyW,orientation:n.cDl},tooltip:n.cUy,shadow:n.zd9,...n.sPu,...n.Fup,...n.AFh,...n.mLn,highlight:(0,n.wxv)(n.Dgf,n.Dgf),areaPlot:n.zMY,aggregation:(0,n.KCZ)("count","sum","mean"),bins:(0,n.jk9)((0,n.jk9)(n.aig)),binCount:n.LyW}))(),Kn=(()=>({...n.XxK,...Gn,type:(0,n.mw3)((0,n.dYl)("histogram")),xKey:(0,n.mw3)(n.YjP),yKey:n.YjP,xKeyAxis:n.YjP,yKeyAxis:n.YjP,xName:n.YjP,yName:n.YjP,getItemId:(0,n.R3$)(n.YjP)}))(),Yn=(0,n.wxv)(n.Dgf,n.Kq8),Un=(0,n.YIG)({...n.AFh,...n.mLn,marker:n.AE2}),Xn={title:n.YjP,showInMiniChart:n.zMY,connectMissingData:n.zMY,interpolation:n.h0L,label:n.jjq,styler:Un,marker:n.$2g,tooltip:n.cUy,errorBar:n.dV6,...n.sPu,...n.AFh,...n.mLn,highlight:Yn,segmentation:n.DBR};Xn.sparklineMode=(0,n._Le)(n.zMY);var Zn=(()=>({...Xn,...n.XxK,highlight:Yn,type:(0,n.mw3)((0,n.dYl)("line")),xKey:(0,n.mw3)(n.YjP),yKey:(0,n.mw3)(n.YjP),xKeyAxis:n.YjP,yKeyAxis:n.YjP,xName:n.YjP,yName:n.YjP,stacked:n.zMY,stackGroup:n.YjP,normalizedTo:n.aig,legendItemName:n.YjP,errorBar:n.MnY}))();Zn.selectedKey=(0,n._Le)(n.YjP),Zn.pickOutsideVisibleMinorAxis=(0,n._Le)(n.zMY),Zn.focusPriority=(0,n._Le)(n.aig);var qn=(()=>({title:n.YjP,showInMiniChart:n.zMY,label:n.jjq,tooltip:n.cUy,errorBar:n.dV6,styler:(0,n.YIG)(n.$2g),maxRenderedItems:n.aig,...n.sPu,...(0,n.FFB)(n.$2g,["enabled"]),highlight:(0,n.wxv)(n.Dgf,n.Dgf),colorScale:(0,n.s2x)(n.pRw)}))(),Qn=(()=>({...qn,...n.XxK,type:(0,n.mw3)((0,n.dYl)("scatter")),xKey:(0,n.mw3)(n.YjP),yKey:(0,n.mw3)(n.YjP),labelKey:n.YjP,colorKey:(0,n.s2x)(n.YjP),xName:n.YjP,yName:n.YjP,labelName:n.YjP,colorName:(0,n.s2x)(n.YjP),legendItemName:n.YjP,xKeyAxis:n.YjP,yKeyAxis:n.YjP,errorBar:n.MnY,highlight:(0,n.wxv)(n.Dgf,n.Dgf)}))();Qn.selectedKey=(0,n._Le)(n.YjP);var Jn=(0,n.wxv)(n.Dgf,n.Dgf),es=(()=>({...(0,n.ct0)(n.Dgf)}))();es.selectedOffset=(0,n._Le)(n.aig);var ts=(()=>({...n.sPu,radiusMin:n.LyW,radiusMax:n.LyW,rotation:n.aig,outerRadiusOffset:n.aig,outerRadiusRatio:n.CGN,hideZeroValueSectorsInLegend:n.zMY,sectorSpacing:n.LyW,cornerRadius:n.LyW,itemStyler:(0,n.YIG)({...n.Fup,...n.AFh,...n.mLn,cornerRadius:n.LyW}),title:{enabled:n.zMY,text:n.YjP,showInLegend:n.zMY,spacing:n.LyW,...n.LVV},calloutLabel:{enabled:n.zMY,offset:n.aig,minAngle:n.LyW,avoidCollisions:n.zMY,...n.mrm,...n.QB3,formatter:(0,n.R3$)(n.JwX),format:n.YjP,itemStyler:(0,n.YIG)({enabled:n.zMY,...n.lb7,...n.LVV}),...n.lb7,...n.LVV},sectorLabel:{enabled:n.zMY,positionOffset:n.aig,positionRatio:n.CGN,...n.mrm,...n.QB3,formatter:(0,n.R3$)(n.JwX),format:n.YjP,itemStyler:(0,n.YIG)({enabled:n.zMY,...n.lb7,...n.LVV}),...n.lb7,...n.LVV},calloutLine:{colors:(0,n.jk9)(n.aXB),length:n.LyW,strokeWidth:n.LyW,itemStyler:(0,n.YIG)({color:n.aXB,length:n.LyW,strokeWidth:n.LyW})},fills:(0,n.jk9)(n.JpK),strokes:(0,n.jk9)(n.aXB),tooltip:n.cUy,shadow:n.zd9,highlight:Jn,selection:es,...n.mLn,...(0,n.FFB)(n.Fup,["fill"]),...(0,n.FFB)(n.AFh,["stroke"])}))(),is=(()=>({...ts,...n.XxK,type:(0,n.mw3)((0,n.dYl)("pie")),angleKey:(0,n.mw3)(n.YjP),radiusKey:n.YjP,calloutLabelKey:n.YjP,sectorLabelKey:n.YjP,legendItemKey:n.YjP,angleName:n.YjP,radiusName:n.YjP,calloutLabelName:n.YjP,sectorLabelName:n.YjP,highlight:Jn,selection:es}))();is.angleFilterKey=(0,n._Le)(n.YjP),is.defaultColorRange=(0,n._Le)((0,n.jk9)((0,n.jk9)(n.yWT))),is.defaultPatternFills=(0,n._Le)((0,n.jk9)(n.yWT)),is.title._enabledFromTheme=(0,n._Le)(n.zMY),is.calloutLabel._enabledFromTheme=(0,n._Le)(n.zMY),is.sectorLabel._enabledFromTheme=(0,n._Le)(n.zMY),is.angleKeyAxis=(0,n._Le)(n.YjP),is.radiusKeyAxis=(0,n._Le)(n.YjP);var ns={...ts,innerRadiusOffset:n.aig,innerRadiusRatio:n.CGN,innerCircle:{fill:n.JpK,fillOpacity:n.CGN}
1,innerLabels:{spacing:n.LyW,...n.LVV,...n.lb7}},ss=(()=>({...ns,...is,type:(0,n.mw3)((0,n.dYl)("donut")),innerLabels:(0,n.J$N)({text:(0,n.mw3)(n.JwX),spacing:n.LyW,...n.LVV,...n.lb7},"inner label options array")}))();ss.angleFilterKey=(0,n._Le)(n.YjP);var as=(()=>({lineStyle:(0,n.KCZ)("solid","dashed","dotted"),...n.mLn}))(),os={...n.Fup,...n.AFh,...n.mLn},rs={visible:n.zMY,locked:n.zMY,readOnly:n.zMY,handle:os,...n.LVV},ls=(()=>({position:(0,n.KCZ)("top","center","bottom"),alignment:(0,n.KCZ)("left","center","right"),...n.LVV}))(),hs=(()=>({position:(0,n.KCZ)("top","inside","bottom"),alignment:(0,n.KCZ)("left","center","right"),...n.LVV}))(),cs={enabled:n.zMY,cornerRadius:n.LyW,padding:n.Msk,...n.LVV,...n.Fup,...n.AFh,...n.mLn},ds={visible:n.zMY,...as,...n.AFh},us={divider:n.AFh,...n.Fup,...n.AFh,...n.LVV},ps={handle:os,statistics:us,...as,...n.Fup,...n.AFh},gs={visible:n.zMY,locked:n.zMY,readOnly:n.zMY,extendStart:n.zMY,extendEnd:n.zMY,handle:os,text:ls,...as,...n.AFh},ms={visible:n.zMY,locked:n.zMY,readOnly:n.zMY,axisLabel:cs,handle:os,text:ls,...as,...n.AFh},ys={visible:n.zMY,locked:n.zMY,readOnly:n.zMY,extendStart:n.zMY,extendEnd:n.zMY,handle:os,text:hs,background:n.Fup,...as,...n.AFh},fs={...ys},xs={...ys,middle:ds},bs=(()=>({label:n.LVV,showFill:n.zMY,isMultiColor:n.zMY,strokes:(0,n.jk9)(n.aXB),rangeStroke:n.aXB,bands:(0,n.KCZ)(4,6,10),...gs}))(),vs={...n.Fup,...n.AFh,...rs},Ss={...n.Fup,...n.AFh,...rs},Ms={...n.Fup,...n.AFh,...rs,background:{...n.Fup,...n.AFh}},ks={visible:n.zMY,locked:n.zMY,readOnly:n.zMY,handle:os,...n.Fup},Ds={visible:n.zMY,locked:n.zMY,readOnly:n.zMY,extendStart:n.zMY,extendEnd:n.zMY,handle:os,text:ls,background:n.Fup,statistics:us,...as,...n.AFh},ws={visible:n.zMY,up:ps,down:ps},Is=(()=>({enabled:n.zMY,axesButtons:{enabled:n.zMY,axes:(0,n.KCZ)("x","y","xy")},toolbar:{enabled:n.zMY,padding:n.LyW,buttons:(0,n.J$N)({...n.Kj1,value:(0,n.KCZ)("line-menu","fibonacci-menu","text-menu","shape-menu","measurer-menu","line","horizontal-line","vertical-line","parallel-channel","disjoint-channel","fibonacci-retracement","fibonacci-retracement-trend-based","text","comment","callout","note","clear")},"annotation toolbar buttons array")},optionsToolbar:{enabled:n.zMY,buttons:(0,n.jk9)((0,n.or)((0,n.fd6)({...n.Kj1,type:(0,n.KCZ)("button"),value:(0,n.mw3)((0,n.KCZ)("line-stroke-width","line-style-type","line-color","fill-color","text-color","text-size","delete","settings"))}),(0,n.fd6)({...n.Kj1,type:(0,n.mw3)((0,n.KCZ)("switch")),value:(0,n.mw3)((0,n.KCZ)("lock")),checkedOverrides:n.Kj1})))}}))();Is.data=(0,n._Le)(n.YOg),Is.xKey=(0,n._Le)(n.YjP),Is.volumeKey=(0,n._Le)(n.YjP),Is.snap=(0,n._Le)(n.zMY);var As={...n.Fup,...n.AFh,opacity:n.CGN},Cs={...n.Fup,...n.AFh,...n.mLn,opacity:n.CGN},Ns={...n.Fup,...n.AFh,...n.mLn,cornerRadius:n.LyW,whisker:{...n.AFh,...n.mLn},cap:{lengthRatio:n.CGN}},Ls={...Ns,opacity:n.CGN},Ps=(0,n.YIG)({...n.Fup,...n.AFh,...n.mLn,cornerRadius:n.LyW,whisker:{...n.AFh,...n.mLn},cap:{lengthRatio:n.CGN}}),Ts=(()=>({direction:(0,n.KCZ)("horizontal","vertical"),showInMiniChart:n.zMY,styler:Ps,itemStyler:Ps,tooltip:n.cUy,...n.sPu,...Ns,highlight:(0,n.wxv)(Ls,Ls),segmentation:n.i_e,width:n.MX6,widthRatio:n.CGN}))(),Os={cornerRadius:n.LyW,wick:{...n.AFh,...n.mLn},...n.Fup,...n.AFh,...n.mLn},Rs={...Os,opacity:n.CGN},Es=(()=>({item:{up:Os,down:Os},itemStyler:(0,n.YIG)({...n.Fup,...n.AFh,...n.mLn,cornerRadius:n.LyW,wick:{...n.AFh,...n.mLn}}),showInMiniChart:n.zMY,tooltip:n.cUy,...n.sPu,highlight:(0,n.wxv)(Rs,Rs)}))(),zs=(()=>({fills:(0,n.jk9)(n.JpK),strokes:(0,n.jk9)(n.aXB),label:{spacing:n.LyW,maxWidth:n.LyW,...n.gfe},link:{tension:n.CGN,itemStyler:(0,n.YIG)({...n.Fup,...n.AFh,...n.mLn,tension:n.CGN}),...n.Fup,...n.AFh,...n.mLn},node:{width:n.LyW,spacing:n.LyW,cornerRadius:n.LyW,itemStyler:(0,n.YIG)({...n.Fup,...n.AFh,...n.mLn,cornerRadius:n.LyW}),...n.Fup,...n.AFh,...n.mLn},tooltip:n.cUy,...n.sPu}))();Object.assign(zs.label,(0,n.FFB)(n.H6P,["maxWidth"]));var Bs=(0,n.Ueb)("inside-center","inside-start","inside-end","inside-before","inside-after","outside-start","outside-end","outside-before","outside-after"),Fs=(0,n.Ueb)("start-before","start-center","start-after","middle-before","middle-center","middle-after","end-before","end-center","end-after",(0,n.DhX)("before","Use `start-center` instead."),(0,n.DhX)("middle","Use `middle-center` instead."),(0,n.DhX)("after","Use `end-center` instead.")),Vs=(()=>({direction:(0,n.KCZ)("horizontal","vertical"),fills:(0,n.jk9)(n.JpK),strokes:(0,n.jk9)(n.aXB),label:{...n.gfe,...n.i
1Ir,placement:Fs,spacing:n.LyW},stageLabel:{placement:(0,n.KCZ)("before","after"),format:n.Hg5,...ln},tooltip:n.cUy,...(0,n.FFB)(n.sPu,["showInLegend"]),...(0,n.FFB)(n.Fup,["fill"]),...(0,n.FFB)(n.AFh,["stroke"]),...n.mLn,highlight:(0,n.qze)(n.Kq8)}))(),$s=(()=>({direction:(0,n.KCZ)("horizontal","vertical"),fills:(0,n.jk9)(n.JpK),strokes:(0,n.jk9)(n.aXB),itemStyler:(0,n.YIG)({...n.Fup,...n.AFh,...n.mLn}),spacingRatio:n.CGN,cornerRadius:n.LyW,crisp:n.zMY,dropOff:{enabled:n.zMY,...n.Fup,...n.AFh,...n.mLn},stageLabel:{placement:(0,n.KCZ)("before","after"),format:n.Hg5,...ln},label:{...n.gfe,...n.iIr,...n.$VX,placement:Bs,spacing:n.LyW},tooltip:n.cUy,shadow:n.zd9,...(0,n.FFB)(n.sPu,["showInLegend"]),...(0,n.FFB)(n.Fup,["fill"]),...(0,n.FFB)(n.AFh,["stroke"]),...n.mLn}))(),Hs=(()=>({title:n.YjP,textAlign:(0,n.ioo)(n.JhA,"Use `label.textAlign` instead."),verticalAlign:(0,n.ioo)((0,n.KCZ)("top","middle","bottom"),"Use `label.verticalAlign` instead."),itemPadding:n.LyW,cornerRadius:n.LyW,itemStyler:(0,n.YIG)({...n.Fup,...n.AFh}),showInMiniChart:n.zMY,label:{...n.TLF,textAlign:n.JhA,verticalAlign:(0,n.KCZ)("top","middle","bottom"),itemStyler:(0,n.YIG)({enabled:n.zMY,...n.lb7,...n.LVV,textAlign:n.JhA,verticalAlign:(0,n.KCZ)("top","middle","bottom")})},tooltip:n.cUy,colorScale:n.pRw,...n.sPu,...n.AFh}))(),js=(()=>({showInMiniChart:n.zMY,itemStyler:(0,n.YIG)({...n.AFh,...n.mLn}),item:{up:{...n.AFh,...n.mLn},down:{...n.AFh,...n.mLn}},tooltip:n.cUy,...n.sPu,highlight:(0,n.wxv)(n.Kq8,n.Kq8)}))(),Ws=(()=>({colorScale:n.pRw,minStrokeWidth:n.LyW,maxStrokeWidth:n.LyW,itemStyler:(0,n.YIG)({...n.AFh,...n.mLn}),sizeDomain:(0,n.Uo6)((0,n.jk9)(n.Y6k),(0,n.O9d)(2,2)),label:{...n.gfe,...n.iIr},tooltip:n.cUy,...n.sPu,...n.AFh,...n.mLn,highlight:(0,n.wxv)(n.Kq8,n.Kq8)}))(),_s={...n.AFh,...n.mLn},Gs=(()=>({colorScale:n.pRw,minSize:n.LyW,maxSize:n.LyW,sizeDomain:(0,n.Uo6)((0,n.jk9)(n.Y6k),(0,n.O9d)(2,2)),label:{placement:n.npH,spacing:n.LyW,...n.gfe,...n.iIr},tooltip:n.cUy,...n.sPu,...(0,n.FFB)(n.$2g,["enabled"]),highlight:(0,n.wxv)(n.Dgf,n.Dgf)}))(),Ks=(()=>({colorScale:n.pRw,padding:n.LyW,itemStyler:(0,n.YIG)({...n.Fup,...n.AFh,...n.mLn}),label:n.TLF,tooltip:n.cUy,...n.sPu,...n.Fup,...n.AFh,...n.mLn,highlight:(0,n.wxv)(n.Dgf,n.Dgf)}))(),Ys={...n.sPu,...n.Fup,...n.AFh,...n.mLn},Us=(0,n.YIG)({...n.Fup,...n.AFh,...n.mLn,cornerRadius:n.LyW}),Xs=(()=>({cornerRadius:n.LyW,styler:Us,itemStyler:Us,label:n.gfe,tooltip:n.cUy,...n.sPu,...n.Fup,...n.AFh,...n.mLn,highlight:(0,n.wxv)(n.TaA,n.TaA)}))(),Zs=(()=>({direction:(0,n.KCZ)("down","left","right","up"),depthSpacing:n.aig,innerSpacing:n.aig,outerSpacing:n.aig,verticalSpacing:(0,n.ioo)(n.aig,"Use `depthSpacing` instead.")}))(),qs=(()=>({...n.sPu,...Zs,direction:(0,n.KCZ)("horizontal","vertical"),reverse:n.zMY,expander:n.swK,layout:n.swK,link:n.swK,node:n.swK,tooltip:n.cUy}))(),Qs=(()=>({direction:(0,n.KCZ)("horizontal","vertical"),aspectRatio:n.LyW,spacing:n.LyW,reverse:n.zMY,itemStyler:(0,n.YIG)({...n.Fup,...n.AFh,...n.mLn}),fills:(0,n.jk9)(n.JpK),strokes:(0,n.jk9)(n.aXB),label:{...n.gfe,...n.iIr,...n.$VX,placement:Bs,spacing:n.LyW},stageLabel:{spacing:n.LyW,placement:(0,n.KCZ)("before","after"),...n.gfe},tooltip:n.cUy,shadow:n.zd9,...n.sPu,...(0,n.FFB)(n.Fup,["fill"]),...(0,n.FFB)(n.AFh,["stroke"]),...n.mLn}))(),Js=(()=>({connectMissingData:n.zMY,marker:n.$2g,styler:(0,n.YIG)({marker:n.AE2,...n.Fup,...n.AFh,...n.mLn}),label:{...n.gfe},tooltip:n.cUy,...n.sPu,...n.Fup,...n.AFh,...n.mLn,highlight:(0,n.wxv)(n.Dgf,n.Dgf)}))();Object.assign(Js.label,n.H6P);var ea=(()=>({connectMissingData:n.zMY,marker:n.$2g,styler:(0,n.YIG)({marker:n.AE2,...n.AFh,...n.mLn}),label:{...n.gfe},tooltip:n.cUy,...n.sPu,...n.AFh,...n.mLn,highlight:(0,n.wxv)(n.Dgf,n.Kq8)}))();Object.assign(ea.label,n.H6P);var ta=(()=>({cornerRadius:n.LyW,styler:Us,itemStyler:Us,label:n.gfe,tooltip:n.cUy,...n.sPu,...n.Fup,...n.AFh,...n.mLn,highlight:(0,n.wxv)(n.TaA,n.TaA)}))(),ia=(()=>({cornerRadius:n.LyW,columnWidthRatio:n.CGN,maxColumnWidthRatio:n.CGN,styler:Us,itemStyler:Us,label:n.gfe,tooltip:n.cUy,...n.sPu,...n.Fup,...n.AFh,...n.mLn,highlight:(0,n.wxv)(n.TaA,n.TaA)}))(),na={marker:n.$2g,...n.AFh,...n.mLn},sa={marker:{enabled:n.zMY,...n.AE2},...n.AFh,...n.mLn},aa={marker:n.AE2,...n.AFh,...n.mLn},oa=(0,n.Ueb)("inside","outside"),ra=(0,n.Ueb)("inside-start","inside-center","inside-end","outside-start","outside-end"),la=(()=>({showInMiniChart:n.zMY,connectMissingData:n.zMY,interpolation:n.h0L,label:{...n.gfe,...n.i
1Ir,...n.$VX,placement:oa,spacing:n.LyW},tooltip:n.cUy,shadow:n.zd9,...n.sPu,...n.Fup,...na,item:{low:{...sa},high:{...sa}},styler:(0,n.YIG)({...n.Fup,item:{low:{...aa},high:{...aa}}}),highlight:(0,n.wxv)(n.Dgf,n.Dgf),segmentation:n.i_e,invertedStyle:{enabled:n.zMY,...n.Fup}}))(),ha=(0,n.YIG)({...n.Fup,...n.AFh,...n.mLn,cornerRadius:n.LyW}),ca=(()=>({direction:(0,n.KCZ)("horizontal","vertical"),grouped:n.zMY,showInMiniChart:n.zMY,cornerRadius:n.LyW,styler:ha,itemStyler:ha,label:{...n.gfe,...n.iIr,...n.QB3,...n.$VX,placement:oa,orientation:n.cDl,spacing:n.LyW},tooltip:n.cUy,shadow:n.zd9,...n.sPu,...n.Fup,...n.AFh,...n.mLn,highlight:(0,n.wxv)(n.TaA,n.TaA),segmentation:n.i_e,width:n.MX6,widthRatio:n.CGN}))(),da=(()=>({fills:(0,n.jk9)(n.JpK),strokes:(0,n.jk9)(n.aXB),label:{...n.gfe,spacing:n.LyW,placement:(0,n.KCZ)("left","right","center"),edgePlacement:(0,n.KCZ)("inside","outside")},link:{itemStyler:(0,n.YIG)({...n.Fup,...n.AFh,...n.mLn}),...n.Fup,...n.AFh,...n.mLn},node:{width:n.LyW,spacing:n.LyW,minSpacing:(0,n.Uo6)(n.LyW,(0,n.Aus)("spacing")),cornerRadius:n.LyW,alignment:(0,n.KCZ)("left","center","right","justify"),verticalAlignment:(0,n.KCZ)("top","bottom","center"),sort:(0,n.KCZ)("data","ascending","descending","auto"),itemStyler:(0,n.YIG)({...n.Fup,...n.AFh,...n.mLn}),...n.Fup,...n.AFh,...n.mLn},tooltip:n.cUy,...n.sPu}))();Object.assign(da.label,n.H6P);var ua=(()=>({fills:(0,n.jk9)(n.JpK),strokes:(0,n.jk9)(n.aXB),colorScale:n.pRw,sectorSpacing:n.LyW,cornerRadius:n.LyW,padding:n.LyW,innerRadiusRatio:n.CGN,innerRadiusSize:n.MX6,innerCircle:{fill:n.JpK,fillOpacity:n.CGN},innerLabels:{spacing:n.LyW,...n.LVV,...n.lb7},itemStyler:(0,n.YIG)({...n.Fup,...n.AFh}),label:{spacing:n.LyW,...n.TLF},secondaryLabel:n.TLF,tooltip:n.cUy,...(0,n.FFB)(n.sPu,["highlight","showInLegend"]),...(0,n.FFB)(n.Fup,["fill"]),...(0,n.FFB)(n.AFh,["stroke"]),highlight:{enabled:n.zMY,highlightedItem:As,highlightedBranch:As,unhighlightedItem:As,unhighlightedBranch:As}}))(),pa=(()=>({fills:(0,n.jk9)(n.JpK),strokes:(0,n.jk9)(n.aXB),colorScale:n.pRw,itemStyler:(0,n.YIG)({...n.Fup,...n.AFh}),group:{gap:n.LyW,padding:n.LyW,cornerRadius:n.LyW,fills:(0,n.jk9)(n.JpK),textAlign:n.JhA,interactive:n.zMY,highlight:{enabled:n.zMY,highlightedItem:As,unhighlightedItem:As},label:{...n.gfe,spacing:n.LyW},...n.Fup,...n.AFh},tile:{gap:n.LyW,padding:n.LyW,cornerRadius:n.LyW,textAlign:n.JhA,verticalAlign:(0,n.KCZ)("top","middle","bottom"),label:{...n.TLF,spacing:n.LyW},secondaryLabel:n.TLF,highlight:{enabled:n.zMY,highlightedItem:As,highlightedBranch:As,unhighlightedItem:As,unhighlightedBranch:As},selection:(0,n.ct0)(Cs),...n.Fup,...n.AFh},tooltip:n.cUy,...(0,n.FFB)(n.sPu,["highlight","selection","showInLegend"])}))(),ga=(()=>({name:n.YjP,cornerRadius:n.LyW,itemStyler:(0,n.YIG)({...n.Fup,...n.AFh,...n.mLn,cornerRadius:n.LyW}),label:{...n.gfe,...n.iIr,...n.QB3,...n.$VX,placement:ra,orientation:n.cDl,spacing:n.LyW},tooltip:n.cUy,shadow:n.zd9,...n.Fup,...n.AFh,...n.mLn}))(),ma=(()=>({direction:(0,n.KCZ)("horizontal","vertical"),showInMiniChart:n.zMY,item:{positive:ga,negative:ga,total:ga},line:{enabled:n.zMY,...n.AFh,...n.mLn},tooltip:n.cUy,width:n.MX6,widthRatio:n.CGN,...n.sPu}))(),ya=(0,n.fd6)({__type:(0,n.mw3)((0,n.dYl)("date")),value:(0,n.or)(n.YjP,n.aig)},"a serializable date object"),fa={width:n.LyW,height:n.LyW,grip:n.zMY,fill:n.aXB,stroke:n.aXB,strokeWidth:n.LyW,cornerRadius:n.LyW},xa=(()=>
1({enabled:n.zMY,height:n.LyW,spacing:n.LyW,cornerRadius:n.aig,mask:{fill:n.aXB,fillOpacity:n.CGN,stroke:n.aXB,strokeWidth:n.LyW},minHandle:fa,maxHandle:fa,miniChart:{enabled:n.zMY,padding:n.Msk,label:{enabled:n.zMY,avoidCollisions:n.zMY,spacing:n.LyW,format:n.Hg5,formatter:(0,n.R3$)(n.JwX),interval:{minSpacing:n.LyW,maxSpacing:n.LyW,values:n.YOg,step:n.aig},...n.LVV},series:n.swK}}))(),ba={...n.Fup,...n.AFh,...n.mLn,cornerRadius:n.LyW,opacity:n.CGN},va={...ba,minSize:n.LyW,hoverStyle:{fill:n.Fup.fill,stroke:n.AFh.stroke}},Sa=(()=>({enabled:n.zMY,thickness:n.LyW,spacing:n.LyW,tickSpacing:n.LyW,visible:(0,n.KCZ)("auto","always","never"),placement:(0,n.KCZ)("outer","inner"),track:ba,thumb:va}))(),Ma=(()=>({...Sa,position:(0,n.KCZ)("top","bottom")}))(),ka=(()=>({...Sa,position:(0,n.KCZ)("left","right")}))(),Da=(()=>({enabled:n.zMY,enableAxisScrolling:n.zMY,enableSeriesAreaScrolling:n.zMY,thickness:n.LyW,spacing:n.LyW,tickSpacing:n.LyW,visible:(0,n.KCZ)("auto","always","never"),placement:(0,n.KCZ)("outer","inner"),track:ba,thumb:va,horizontal:Ma,vertical:ka}))(),wa={...nn,label:on},Ia={axis:n.YjP,start:n.swK,end:n.swK},Aa=(()=>({...n.LVV,...n.Fup,border:n.QQ,cornerRadius:n.aig,enabled:n.zMY,padding:n.Msk,position:(0,n.KCZ)("top","left","right","bottom","left-top","right-top","left-bottom","right-bottom","inside","inside-left","inside-right","inside-top","inside-bottom","inside-top-left","inside-bottom-left","inside-top-right","inside-bottom-right","top-left","top-right","bottom-left","bottom-right"),rotation:n.aig,text:n.YjP,xOffset:n.aig,yOffset:n.aig}))(),Ca=(()=>({...n.Qi6,seriesArea:{border:n.QQ,clip:n.zMY,cornerRadius:n.aig,padding:(0,n.or)(n.I_s,n.Msk),backgroundRegions:(0,n.fd6)({...n.Fup,...n.AFh,xRange:Ia,yRange:Ia,label:Aa})}}))(),Na=(()=>({number:{...(0,n.FFB)(wn,["type","crossLines"]),top:(0,n.FFB)(wn,["type","crossLines","position"]),right:(0,n.FFB)(wn,["type","crossLines","position"]),bottom:(0,n.FFB)(wn,["type","crossLines","position"]),left:(0,n.FFB)(wn,["type","crossLines","position"]),crossLines:wa},log:{...(0,n.FFB)(In,["type","crossLines"]),top:(0,n.FFB)(In,["type","crossLines","position"]),right:(0,n.FFB)(In,["type","crossLines","position"]),bottom:(0,n.FFB)(In,["type","crossLines","position"]),left:(0,n.FFB)(In,["type","crossLines","position"]),crossLines:wa},category:{...(0,n.FFB)(kn,["type","crossLines"]),top:(0,n.FFB)(kn,["type","crossLines","position"]),right:(0,n.FFB)(kn,["type","crossLines","position"]),bottom:(0,n.FFB)(kn,["type","crossLines","position"]),left:(0,n.FFB)(kn,["type","crossLines","position"]),crossLines:wa},time:{...(0,n.FFB)(An,["type","crossLines"]),top:(0,n.FFB)(An,["type","crossLines","position"]),right:(0,n.FFB)(An,["type","crossLines","position"]),bottom:(0,n.FFB)(An,["type","crossLines","position"]),left:(0,n.FFB)(An,["type","crossLines","position"]),crossLines:wa},"unit-time":{...(0,n.FFB)(Cn,["type","crossLines"]),top:(0,n.FFB)(Cn,["type","crossLines","position"]),right:(0,n.FFB)(Cn,["type","crossLines","position"]),bottom:(0,n.FFB)(Cn,["type","crossLines","position"]),left:(0,n.FFB)(Cn,["type","crossLines","position"]),crossLines:wa},"grouped-category":{...(0,n.FFB)(Dn,["type"]),top:(0,n.FFB)(Dn,["type","position"]),right:(0,n.FFB)(Dn,["type","position"]),bottom:(0,n.FFB)(Dn,["type","position"]),left:(0,n.FFB)(Dn,["type","position"]),crossLines:wa},"ordinal-time":{...(0,n.FFB)(Nn,["type","crossLines"]),top:(0,n.FFB)(Nn,["type","crossLines","position"]),right:(0,n.FFB)(Nn,["type","crossLines","position"]),bottom:(0,n.FFB)(Nn,["type","crossLines","position"]),left:(0,n.FFB)(Nn,["type","crossLines","position"]),crossLines:wa}}))(),La=(()=>({"angle-category":{...(0,n.FFB)(Pn,["type","crossLines"]),crossLines:{...nn,label:Ji}},"angle-number":{...(0,n.FFB)(Ln,["type","crossLines"]),crossLines:{...nn,label:Ji}},"radius-category":{...(0,n.FFB)(On,["type","crossLines"]),crossLines:{...nn,label:sn}},"radius-number":{...(0,n.FFB)(Tn,["type","crossLines"]),crossLines:{...nn,label:sn}}}))(),Pa=(()=>({visible:(0,n._Le)(n.zMY)}))();function Ta(e,t){const i={};for(const n of Reflect.ownKeys(e))i[n]=t(e[n],n,e);return i}var Oa=Ta((()=>({common:{...n.Qi6,navigator:xa,scrollbar:Da,axes:{...Na,...La},annotations:{...Is,line:gs,"horizontal-line":ms,"vertical-line":ms,"disjoint-channel":fs,"parallel-channel":xs,"fibonacci-retracement":bs,"fibonacci-retracement-trend-based":bs,callout:vs,comment:Ss,note:Ms,text:rs,arrow:gs,"arrow-up":ks,"arrow-down":ks,"date-range":Ds,"price-range":Ds,"date-price-range":Ds,"quick-date-price-range":ws},chartToolbar:{enabled:n.zMY},initialState:{legend:(0,n.J$N)({visible:n.zMY,seriesId:n.YjP,itemId:n.YjP,legendItemName:n.YjP}
1,"legend state array"),zoom:{rangeX:{start:(0,n.or)(n.aig,ya),end:(0,n.or)(n.aig,ya)},rangeY:{start:(0,n.or)(n.aig,ya),end:(0,n.or)(n.aig,ya)},ratioX:{start:n.CGN,end:n.CGN},ratioY:{start:n.CGN,end:n.CGN},autoScaledAxes:(0,n.jk9)((0,n.dYl)("y"))}}},line:{...Ca,axes:Na,series:Xn,navigator:xa,scrollbar:Da,...Pa},scatter:{...Ca,axes:Na,series:qn,navigator:xa,scrollbar:Da,...Pa,paired:(0,n._Le)(n.zMY)},bubble:{...Ca,axes:Na,series:jn,navigator:xa,scrollbar:Da,...Pa},area:{...Ca,axes:Na,series:zn,navigator:xa,scrollbar:Da,...Pa},bar:{...Ca,axes:Na,series:$n,navigator:xa,scrollbar:Da,...Pa},"box-plot":{...Ca,axes:Na,series:Ts,navigator:xa,scrollbar:Da,...Pa},candlestick:{...Ca,axes:Na,series:Es,navigator:xa,scrollbar:Da,...Pa},"cone-funnel":{...Ca,axes:Na,series:Vs,navigator:xa,scrollbar:Da,...Pa},funnel:{...Ca,axes:Na,series:$s,navigator:xa,scrollbar:Da,...Pa},ohlc:{...Ca,axes:Na,series:js,navigator:xa,scrollbar:Da,...Pa},histogram:{...Ca,axes:(0,n.FFB)(Na,["category","grouped-category","unit-time","ordinal-time"]),series:Gn,navigator:xa,scrollbar:Da,...Pa},heatmap:{...Ca,axes:Na,series:Hs,navigator:xa,scrollbar:Da,...Pa},waterfall:{...Ca,axes:Na,series:ma,navigator:xa,scrollbar:Da,...Pa},"range-bar":{...Ca,axes:Na,series:ca,navigator:xa,scrollbar:Da,...Pa},"range-area":{...Ca,axes:Na,series:la,navigator:xa,scrollbar:Da,...Pa},donut:{...n.Qi6,series:ns,navigator:xa,...Pa},pie:{...n.Qi6,series:ts,navigator:xa,...Pa},"radar-line":{...n.Qi6,axes:La,series:ea,navigator:xa,...Pa},"radar-area":{...n.Qi6,axes:La,series:Js,navigator:xa,...Pa},"radial-bar":{...n.Qi6,axes:La,series:ta,navigator:xa,...Pa},"radial-column":{...n.Qi6,axes:La,series:ia,navigator:xa,...Pa},nightingale:{...n.Qi6,axes:La,series:Xs,navigator:xa,...Pa},sunburst:{...n.Qi6,series:ua,navigator:xa,...Pa},treemap:{...n.Qi6,series:pa,navigator:xa,...Pa},"map-shape":{...n.Qi6,series:Ks,navigator:xa,...Pa},"map-line":{...n.Qi6,series:Ws,navigator:xa,...Pa},"map-marker":{...n.Qi6,series:Gs,navigator:xa,...Pa},"map-shape-background":{...n.Qi6,series:Ys,navigator:xa,...Pa},"map-line-background":{...n.Qi6,series:_s,navigator:xa,...Pa},sankey:{...n.Qi6,series:da,navigator:xa,...Pa},chord:{...n.Qi6,series:zs,navigator:xa,...Pa},organization:{...n.Qi6,series:qs,navigator:xa,...Pa},pyramid:{...n.Qi6,series:Qs,navigator:xa,...Pa},"radial-gauge":{...n.Qi6,...n.YdT,targets:(0,n.FFB)(n.lIt,["value"]),tooltip:{...n.YdT.tooltip,...n.Qi6.tooltip}},"linear-gauge":{...n.Qi6,...n.qr,targets:(0,n.FFB)(n.lJ1,["value"]),tooltip:{...n.qr.tooltip,...n.Qi6.tooltip}}}))(),(function e(t,i){if((0,n.Bmc)(i))return t;if((0,n.Tnt)(t))return(0,n.or)(t,n.I_s,n.Bmc);if((0,n.Gvm)(t))return(0,n.or)((0,n.fd6)(n.ieU in t?Ta(t,(t=>(0,n.Gvm)(t)?Ta(t,e):t)):Ta(t,e)),n.I_s,n.Bmc);throw new Error(`Invalid theme override value: ${String(t)}`)})),Ra=(()=>({activeItem:{type:(0,n.mw3)((0,n.$_4)()("series-node","legend")),seriesId:n.YjP,itemId:(0,n.mw3)((0,n.or)(n.YjP,n.LyW))},frozen:n.zMY}))(),Ea=(0,n.jk9)((0,n.$_4)()("error","warning","deprecation"),"an array of validation severities ('error', 'warning' or 'deprecation')"),za=(()=>({mode:(0,n._Le)((0,n.KCZ)("integrated","standalone")),withinStudio:(0,n._Le)(n.zMY),loading:n.zMY,validations:{showOverlayOn:Ea,consoleOn:Ea,throwOn:Ea,issueRaised:n.E2r},container:n.Sc7,context:()=>!0,theme:n.swK,series:n.YOg,annotations:n.Ikc,navigator:n.Ikc,scrollbar:n.Ikc,initialState:{active:Ra,chartType:n.YjP,collapsed:(0,n.jk9)((0,n.or)(n.YjP,n.aig)),annotations:n.swK,legend:(0,n.J$N)({visible:n.zMY,seriesId:n.YjP,itemId:n.YjP,legendItemName:n.YjP},"legend state array"),legendPagination:n.dvT,zoom:n.swK}}))(),Ba=(()=>({...n.Qi6,...za,axes:n.Ikc,data:n.YOg,dataIdKey:n.YjP,seriesArea:{border:n.QQ,clip:n.zMY,cornerRadius:n.aig,padding:(0,n.or)(n.I_s,n.Msk),backgroundRegions:(0,n.s2x)((0,n.J$N)({...n.Fup,...n.AFh,xRange:Ia,yRange:Ia,label:Aa}))}}))(),Fa={...n.Qi6,...za,axes:n.Ikc,data:n.YOg,dataIdKey:n.YjP},Va={...n.Qi6,...za,data:n.YOg,dataIdKey:n.YjP,topology:n.eWm},$a={...n.Qi6,...za,data:n.YOg,dataIdKey:n.YjP},Ha=(e=>(e[e.Default=64]="Default",e[e.ZoomDrag=32]="ZoomDrag",e[e.Annotations=16]="Annotations",e[e.ContextMenu=8]="ContextMenu",e[e.Animation=4]="Animation",e[e.AnnotationsSelected=2]="AnnotationsSelected",e[e.Frozen=1]="Frozen",e[e.Hoverable=82]="Hoverable",e[e.Clickable=83]="Clickable",e[e.Focusable=69]="Focusable",e[e.Keyable=87]="Keyable",e[e.ContextMenuable=72]="ContextMenuable",e[e.AnnotationsMoveable=18]="AnnotationsMoveable",e[e.AnnotationsDraggable=114]="AnnotationsDraggable",e[e.ZoomDraggable=101]="ZoomDraggable",e[e.ZoomClickable=69]="ZoomClickable",e[e.ZoomWheelable=119]="ZoomWheelable",e[e.All=126]="All",e))(
1Ha||{}),ja=class{constructor(){this.stateQueue=68}pushState(e){this.stateQueue|=e}popState(e){this.stateQueue&=~e}isState(e){return Boolean(this.stateQueue&-this.stateQueue&e)}},Wa=class{constructor(e){this.mementoOriginatorKey="active",this.updateable=!0,this.didLayout=!1,this.pendingMemento=void 0,this.ctx=e;const t=e.eventsHub.on("update:pre-scene-render",(()=>{this.didLayout=!0;const{pendingMemento:i}=this;i&&(this.restoreMemento(i.version,i.mementoVersion,i.memento),this.pendingMemento=void 0,e.chartState.flushChanges("activeItem")),t()}))}isFrozen(){return this.ctx.interactionManager.isState(1)}clear(){return this.update(void 0,void 0)}update(e,t){return this.performUpdate("user-interaction",e,t,!1)}performUpdate(e,t,i,s){if(!this.updateable)return!1;const a=this.currentItem;let o=!1;if(s||!(0,n.DH9)(a,t)){const{frozen:n,activeItem:s}=this.createMementoWithItem(t),{datum:a,datums:r,itemType:l,totalValue:h}=i??{};this.ctx.chartService.callListener({type:"activeChange",source:e,frozen:n,activeItem:s,datum:a,...void 0===r?{}:{datums:r},...void 0===l?{}:{itemType:l},...void 0===h?{}:{totalValue:h},dataIdKey:i?.series.data?.dataIdKey,get defaultPrevented(){return o},preventDefault:()=>{o=!0}})}return o||(this.currentItem=t,this.ctx.chartState.setValue("activeItem",t)),o}createMemento(){return this.createMementoWithItem(this.currentItem)}createMementoWithItem(e){const t=this.isFrozen();switch(e?.type){case"series-node":case"legend":{const{type:i,seriesId:n,itemId:s}=e;return{frozen:t,activeItem:{type:i,seriesId:n,itemId:s}}}default:return{frozen:t}}}guardMemento(e,t){if(null==e)return!0;const i=(0,n.tfT)(e,za.initialState.active,"",{logger:this.ctx.logger});return t.push(...i.invalid.map((e=>e.toString()))),0===i.invalid.length}restoreMemento(e,t,i){if(!this.didLayout)return void(this.pendingMemento={version:e,mementoVersion:t,memento:i});this.updateable=!1;const[n,s]=this.performRestoration(i?.activeItem);this.updateable=!0;const a=this.isFrozen(),o=i?.frozen,r=void 0!==o&&a!==o;!0===o?this.ctx.interactionManager.pushState(1):!1===o&&this.ctx.interactionManager.popState(1),this.performUpdate("state-change",n,s,r)}performRestoration(e){let t=!1;let i;const n=void 0!==this.pendingMemento,s=this.ctx.chartService.id;return this.ctx.eventsHub.emit("active:load-memento",{initialState:n,chartId:s,activeItem:e,reject:()=>t=!0,setDatum:e=>i=e}),t?[void 0,void 0]:[e,i]}};function _a(e,t){if("string"==typeof e)try{e=n.Q1f.fromString(e)}catch{e=n.Q1f.fromArray([0,0,0])}if("string"==typeof t)try{t=n.Q1f.fromString(t)}catch{t=n.Q1f.fromArray([0,0,0])}return i=>n.Q1f.mix(e,t,i).toRgbaString()}var Ga=["initial","remove","update","add","trailing","end","none"],Ka={initial:{animationDuration:1,animationDelay:0},add:{animationDuration:.25,animationDelay:.75},remove:{animationDuration:.25,animationDelay:0},update:{animationDuration:.5,animationDelay:.25},trailing:{animationDuration:.2,animationDelay:1,skipIfNoEarlierAnimations:!0},end:{animationDelay:1.2,animationDuration:0,skipIfNoEarlierAnimations:!0},none:{animationDuration:0,animationDelay:0}};function Ya(e){return e.every((e=>e instanceof P))?{nodes:e,selections:[]}:{nodes:[],selections:e}}function Ua(e,t){return e===t||(Array.isArray(e)&&Array.isArray(t)?e.length===t.length&&e.every(((e,i)=>Ua(e,t[i]))):g(e)&&g(t)?e.equals(t):!(!(0,n.QdQ)(e)||!(0,n.QdQ)(t))&&(0,n.t6W)(e,t,Ua))}var Xa=class{constructor(e){this.isComplete=!1,this.elapsed=0,this.iteration=0,this.isPlaying=!1,this.isReverse=!1,this.id=e.id,this.groupId=e.groupId,this.autoplay=e.autoplay??!0,this.ease=e.ease??n.sns,this.phase=e.phase;const t=e.duration??Ka[this.phase].animationDuration;this.duration=t*e.defaultDuration,this.delay=(e.delay??0)*e.defaultDuration,this.onComplete=e.onComplete,this.onPlay=e.onPlay,this.onStop=e.onStop,this.onUpdate=e.onUpdate,this.interpolate=this.createInterpolator(e.from,e.to),this.from=e.from,!0===e.skip&&(this.onUpdate?.(e.to,!1,this),this.onStop?.(this),this.onComplete?.(this),this.isComplete=!0),!1!==e.collapsable&&(this.duration=this.checkCollapse(e,this.duration))}checkCollapse(e,t){return Ua(e.from,e.to)?0:t}play(e=!1){this.isPlaying||this.isComplete||(this.isPlaying=!0,this.onPlay?.(this),this.autoplay&&(this.autoplay=!1,e&&this.onUpdate?.(this.from,!0,this)))}stop(){this.isPlaying=!1,this.isComplete||(this.isComplete=!0,this.onStop?.(this))}update(e){if(this.isComplete)return e;!this.isPlaying&&this.autoplay&&this.play(!0);const t=this.elapsed;if(this.elapsed+=e,this.delay>this.elapsed)return 0;const i=this.interpolate(this.isReverse?1-this.delta:this.delta);this.onUpdate?.(i,!1,this);const n=this.delay+this.duration;return this.elapsed>=n?(this.stop(),this.isComplete=!0,this.onComplete?.(this),e-(n-t)):0}get delta(){return this.ease((0,n.qE8)(0,(this.elapsed-this.delay)/this.duration,1))}createInterpolator(e,t){if("object"!=typeof t||g(t))return this.interpolateValue(e,t);if(Array.isArray(t)){const i=[];for(let n=0;n<t.length;n++){const s=this.createInterpolator(e[n],t[n]);null!=s&&i.push(s)}return e=>{const t=[];for(const n of i)t.push(n(e));return t}}const i=[];for(const n of Object.keys(t)){const s=this.createInterpolator(e[n],t[n]);null!=s&&i.push([n,s])}return e=>{const t={};for(const[n,s]of i)t[n]=s(e);return t}}interpolateValue(e,t){if(null!=e&&null!=t){if(g(e))return i=>e[p](t,i);try{switch(typeof e){case"number":return function(e,t){return i=>Number(e)*(1-i)+Number(t)*i}(e,t);case"string":return _a(e,t);case"boolean":if(e===t)return()=>e;break;case"object":return()=>e;default:throw new Error(`Unable to interpolate values: ${e}, ${t}`)}}catch{}throw new Error(`Unable to interpolate values: ${e}, ${t}`)}}};function Za(e,t,i,n){return t<e.startIndex?(e.startIndex+=i,e.endIndex+=i,!1):!!(t<e.endIndex||t===e.endIndex&&n)&&(e.endIndex+=i,!0)}function qa(e,t,i){const n=t+i;if(n<=e.startIndex)return e.startIndex=Math.max(0,e.startIndex-i),e.endIndex=Math.max(e.startIndex,e.endIndex-i),!1;if(t>=e.endIndex)return!1;if(t<=e.startIndex&&n>=e.endIndex)e.startIndex=t,e.endIndex=t;else if(t<=e.startIndex){const i=n-e.startIndex,s=e.endIndex-e.startIndex;e.startIndex=t,e.endIndex=e.startIndex+Math.max(0,s-i)}else n>=e.endIndex?e.endIndex=Math.max(e.startIndex,t):e.endIndex=Math.max(e.startIndex,e.endIndex-i);return!0}function Qa(e,t){const i=Math.ceil(e/1e3);return Math.max(t,i)}function Ja(e,t){return Math.max(1,Math.ceil(e/t))}var eo=class{constructor(e={}){this.bands=[],this.dataSize=0,this.config={minDataSizeForBanding:e.minDataSizeForBanding??1e3,targetBandCount:e.targetBandCount??10,maxBandSize:e.maxBandSize??1/0,enableBanding:e.enableBanding??!0}}applyIndexMap(e){!function(e,t){!function(e,t){for(const i of t)i.insertCount>0&&e.handleInsertion(i.index,i.insertCount),i.deleteCount>0&&e.handleRemoval(i.index,i.deleteCount)}
1(e,t.spliceOps),t.updatedIndices.size>0&&function(e,t){for(const i of t)e.handleInsertion(i,0)}(e,t.updatedIndices)}(this,e)}initializeBands(e){this.dataSize=Math.max(0,e),this.bands=function(e,t,i){if(!t.enableBanding||e<t.minDataSizeForBanding)return[i(0,e)];const n=Ja(e,Qa(e,t.targetBandCount)),s=[];for(let t=0;t<e;t+=n){const a=Math.min(t+n,e);s.push(i(t,a))}return s}(this.dataSize,this.config,((e,t)=>this.createBand(e,t)))}getBandCount(){return this.bands.length}handleInsertion(e,t){if(this.dataSize+=t,0===this.bands.length)return void this.initializeBands(this.dataSize);const i=Qa(this.dataSize,this.config.targetBandCount),n=Ja(this.dataSize,i),s=Math.ceil(1.1*n);for(let i=0;i<this.bands.length;i++){const a=this.bands[i],o=i===this.bands.length-1;if(e===a.endIndex&&o&&t>0){a.endIndex-a.startIndex>=n?this.bands.push(this.createBand(e,e+t)):(a.endIndex+=t,a.isDirty=!0);break}if(Za(a,e,t,o)&&(a.isDirty=!0,t>0&&e<a.endIndex)){a.endIndex-a.startIndex>s&&this.splitBand(i,n)}}}handleRemoval(e,t){if(t<=0||0===this.bands.length)return;const i=Math.min(t,Math.max(0,this.dataSize-e));if(!(i<=0)){this.dataSize=Math.max(0,this.dataSize-i);for(const t of this.bands){qa(t,e,i)&&(t.isDirty=!0)}this.bands=this.bands.filter((e=>e.endIndex>e.startIndex))}}splitBand(e,t){const i=this.bands[e],n=i.endIndex-i.startIndex,s=Math.min(t,Math.floor(n/2)),a=i.startIndex+s,o=this.createBand(i.startIndex,a),r=this.createBand(a,i.endIndex);this.bands.splice(e,1,o,r)}getStats(){const e=this.bands.filter((e=>e.isDirty));return{totalBands:this.bands.length,dirtyBands:e.length,dataSize:this.dataSize}}markRangeDirty(e,t){for(const i of this.bands)e<i.endIndex&&t>i.startIndex&&(i.isDirty=!0)}},to=class e{constructor(e=!1){this.coerceDates=e,this.domain=new Set,this.dateTimestamps=new Set,this.hasDateValues=!1,this.sortedValues=null,this.sortOrder=void 0,this.isSortedUnique=!1}static is(t){return t instanceof e}setSortedUniqueMode(e,t){t&&(this.isSortedUnique=!0,this.sortOrder=e,this.sortedValues=[])}extend(e){this.coerceDates&&"string"==typeof e&&(e=(0,n.e8I)(e)),this.isSortedUnique&&this.sortedValues?(this.sortedValues.push(e),e instanceof Date&&(this.hasDateValues=!0)):e instanceof Date?(this.hasDateValues=!0,this.dateTimestamps.add(e.valueOf())):this.domain.add(e)}getDomain(){if(this.isSortedUnique&&this.sortedValues){let e=!1;return this.sortedValues.filter((t=>{if(null==t)return!e&&(e=!0,!0);if(t instanceof Date&&Number.isNaN(t.valueOf())){if(e)return!1;e=!0}return!0}))}if(this.hasDateValues){const e=Array.from(this.dateTimestamps,(e=>new Date(e)));return this.domain.size>0?[...e,...Array.from(this.domain)]:e}return Array.from(this.domain)}isDateDomain(){return this.hasDateValues}isSortedUniqueMode(){return this.isSortedUnique}getSortOrder(){return this.sortOrder}mergeFrom(e){if(this.isSortedUnique&&e.isSortedUnique&&this.sortOrder===e.sortOrder&&void 0!==this.sortOrder&&e.sortedValues)return e.hasDateValues&&(this.hasDateValues=!0),this.sortedValues??(this.sortedValues=[]),void this.sortedValues.push(...e.sortedValues);if(this.convertToSetMode(),e.hasDateValues&&(this.hasDateValues=!0),e.isSortedUnique&&e.sortedValues)for(const t of e.sortedValues)t instanceof Date?this.dateTimestamps.add(t.valueOf()):this.domain.add(t);else{for(const t of e.dateTimestamps)this.dateTimestamps.add(t);for(const t of e.domain)this.domain.add(t)}}convertToSetMode(){if(this.isSortedUnique){if(this.sortedValues){for(const e of this.sortedValues)e instanceof Date?this.dateTimestamps.add(e.valueOf()):this.domain.add(e);this.sortedValues=null}this.isSortedUnique=!1,this.sortOrder=void 0}}},io=class e{constructor(){this.domain=[1/0,-1/0]}static is(t){return t instanceof e}static extendDomain(e,t=[1/0,-1/0]){for(const i of e)"number"!=typeof i&&"bigint"!=typeof i||(i<t[0]&&(t[0]=i),i>t[1]&&(t[1]=i));return t}extend(e){const t=e;("number"==typeof t||"bigint"==typeof t||t instanceof Date)&&(this.domain[0]>t&&(this.domain[0]=t),this.domain[1]<t&&(this.domain[1]=t))}getDomain(){return[...this.domain]}},no=class extends eo{constructor(e,t={},i=!1){super(t),this.fullDomainCache=null,this.sortOrder=void 0,this.isUnique=!1,this.domainFactory=e,this.isDiscrete=i}get discrete(){return this.isDiscrete}setSortOrderMetadata(e,t){this.sortOrder=e,this.isUnique=t}createBand(e,t){const i=this.domainFactory();return this.isDiscrete&&void 0!==this.sortOrder&&this.isUnique&&to.is(i)&&i.setSortedUniqueMode(this.sortOrder,this.isUnique),{startIndex:e,endIndex:t,subDomain:i,isDirty:!0}}initializeBands(e){super.initializeBands(e),this.fullDomainCache=null}handleInsertion(e,t){super.handleInsertion(e,t),this.fullDomainCache=null}handleRemoval(e,t){super.handleRemoval(e,t),this.fullDomainCache=null}splitBand(e,t){this.bands.length>1&&super.splitBand(e,t)}markBandsDirty(e,t){this.markRangeDirty(e,t),this.fullDomainCache=null}markAllBandsDirty(){for(const e of this.bands)e.isDirty=!0;this.fullDomainCache=null}extendBandsFromData(e,t){const i=e.length;for(const n of this.bands){if(!n.isDirty)continue;const s=this.domainFactory();this.isDiscrete&&void 0!==this.sortOrder&&this.isUnique&&to.is(s)&&s.setSortedUniqueMode(this.sortOrder,this.isUnique),n.subDomain=s;const{startIndex:a,endIndex:o}=n;for(let s=a;s<o&&s<i;s++)t?.[s]||n.subDomain.extend(e[s]);n.isDirty=!1}this.fullDomainCache=null}getDirtyBands(){return this.bands.filter((e=>e.isDirty))}extend(e){this.markAllBandsDirty(),this.fullDomainCache=null}canUseSortedConcatenation(){if(!this.sortOrder||!this.isUnique||!this.isDiscrete)return!1;for(const e of this.bands){if(!to.is(e.subDomain))return!1;if(!e.subDomain.isSortedUniqueMode())return!1;if(e.subDomain.getSortOrder()!==this.sortOrder)return!1}return!0}concatenateSortedDomains(){const e=new to;e.setSortedUniqueMode(this.sortOrder,this.isUnique);for(const t of this.bands)to.is(t.subDomain)&&e.mergeFrom(t.subDomain);return e.getDomain()}deduplicateNulls(e){let t=!1;return e.filter((e=>{if(null==e)return!t&&(t=!0,!0);if(e instanceof Date&&Number.isNaN(e.valueOf())){if(t)return!1;t=!0}return!0}))}getDomain(){if(null!==this.fullDomainCache)return this.fullDomainCache;if(0===this.bands.length)return this.fullDomainCache=[],[];if(1===this.bands.length){const e=this.bands[0].subDomain.getDomain();return this.fullDomainCache=this.isDiscrete?this.deduplicateNulls(e):e,this.fullDomainCache}if(this.isDiscrete){const e=this.bands[0].subDomain;if(to.is(e))if(this.canUseSortedConcatenation())this.fullDomainCache=this.deduplicateNulls(this.concatenateSortedDomains());else{const e=new to;for(const t of this.bands)to.is(t.subDomain)&&e.mergeFrom(t.subDomain);this.fullDomainCache=this.deduplicateNulls(e.getDomain())}else{const e=new Set;for(const t of this.bands)for(const i of t.subDomain.getDomain())e.add(i);this.fullDomainCache=Array.from(e)}}else{let e,t;for(const i of this.bands){const n=i.subDomain.getDomain();if(2===n.length){const[i,s]=n;(void 0===e||null!=i&&null!=e&&i<e)&&(e=i),(void 0===t||null!=s&&null!=t&&s>t)&&(t=s)}}this.fullDomainCache=void 0!==e&&void 0!==t?[e,t]:[]}return this.fullDomainCache}getStats(){const e=this.bands.filter((e=>e.isDirty)).length,t=this.bands.reduce(((e,t)=>e+(t.endIndex-t.startIndex)),0);return{bandCount:this.bands.length,dirtyBandCount:e,averageBandSize:this.bands.length>0?t/this.bands.length:0,dataSize:this.dataSize}}};function so(e,t){return(0,n.mlo)(e,t)}function ao(e,t=[0,0]){for(const i of e)"number"!=typeof i&&"bigint"!=typeof i||(i<0&&(t[0]=so(t[0],i)),i>0&&(t[1]=so(t[1],i)));return t}function oo(e){return()=>{let t=0;return i=>"bigint"==typeof i?(t=so(t,e&&i<0n?0n:i),t):(0,n.BfI)(i)?(t=so(t,e?Math.max(0,i):i),t):i}}var ro="\0__AG_NULL__\0",lo="\0__AG_UNDEFINED__\0";function ho(e){return null===e?ro:void 0===e?lo:Array.isArray(e)?"["+e.map(ho).join(",")+"]":(0,n.Gvm)(e)?JSON.stringify(e):String(e)}function co(e){return e.map(ho).join("-")}function uo(e){if(null==e)return[];if(e.every((e=>"bigint"==typeof e)))return[...e];const t=e.map(Number);return t.every(Number.isFinite)?t:[]}function po(e){if(e.length<2)return[];const[t,i]=e;if("bigint"==typeof t&&"bigint"==typeof i)return[t<0n?t:0n,i>0n?i:0n];const n=Number(t),s=Number(i);return Number.isFinite(s-n)?[Math.min(n,0),Math.max(s,0)]:[]}function go(e,t){return t?.get(e.id)??0}function mo(e){return"scopes"in e&&Array.isArray(e.scopes)}function yo(e,t){const i=[];for(let n=0;n<e;n+=1)i[n]=t;return i}function fo(e){const t=new Set;for(const i of e.values())i&&t.add(i);return t}function xo(e,t,i=!1){const n=[];for(const s of e){const e=s?.[t];if(null==e&&!i)return;n.push(e)}return n}function bo(e){const t=[];let i,n=0;const s=/((?:(?:^|\.)\s*\w+|\[\s*(?:'(?:[^']|(?<!\\)\\')*'|"(?:[^"]|(?<!\\)\\")*"|-?\d+)\s*\])\s*)/g;for(;i=s.exec(e);){if(i.index!==n)return;n=i.index+i[0].length;const e=i[1].trim();if(e.startsWith("."))t.push(e.slice(1).trim());else if(e.startsWith("[")){const i=e.slice(1,-1).trim();i.startsWith("'")?t.push(i.slice(1,-1).replaceAll(/(?<!\\)\\'/g,"'")):i.startsWith('"')?t.push(i.slice(1,-1).replaceAll(/(?<!\\)\\"/g,'"')):t.push(i)}else t.push(e)}if(n===e.length)return t}function vo(e){return t=>{let i=t;for(const t of e)i=i[t];return i}}var So=class{constructor(e,t,i){this.ctx=e,this.scopeCacheManager=t,this.resolvers=i}aggregateUngroupedData(e){const t=this.ctx.aggregates.map((()=>
1[1/0,-1/0]));e.domain.aggValues=t;const{columns:i,dataSources:s}=e,a=(0,n.$1N)(s.keys()),o=e.keys.map((e=>e.get(a))),r=s.get(a)?.data??[],l=this.ctx.keys.some((e=>!0===e.allowNullKey));e.aggregation=r?.map(((e,n)=>{const s=[];for(const[e,a]of this.ctx.aggregates.entries()){const r=this.valueGroupIdxLookup(a);let h=a.groupAggregateFunction?.()??[1/0,-1/0];const c=r.map((e=>i[e][n])),d=xo(o,n,l),u=null==d?void 0:a.aggregateFunction(c,d);u&&(h=a.groupAggregateFunction?.(u,h)??io.extendDomain(u,h));const p=a.finalFunction?.(h)??h;s[e]=p,io.extendDomain(p,t[e])}return s}))}aggregateGroupedData(e){const t=this.ctx.aggregates.map((()=>[1/0,-1/0]));e.domain.aggValues=t;const{columns:i}=e;for(const[n,s]of this.ctx.aggregates.entries()){const a=this.valueGroupIdxLookup(s);for(let o=0;o<e.groups.length;o++){const r=e.groups[o];r.aggregation??(r.aggregation=[]);const l=r.keys;let h=s.groupAggregateFunction?.()??[1/0,-1/0];const c=Math.max(...a.map((e=>r.datumIndices[e]?.length??0)));for(let e=0;e<c;e++){const t=a.map((t=>{const n=r.datumIndices[t]?.[e];if(null==n)return;const s=this.resolvers.resolveAbsoluteIndex(o,n);return i[t][s]})),n=s.aggregateFunction(t,l);n&&(h=s.groupAggregateFunction?.(n,h)??io.extendDomain(n,h))}const d=s.finalFunction?.(h)??h;r.aggregation[n]=d,io.extendDomain(d,t[n])}}}postProcessGroups(e){const{groupProcessors:t}=this.ctx,{columnScopes:i,columns:s,invalidData:a,columnValueType:o}=e;for(const r of t){const t=this.valueGroupIdxLookup(r).filter((t=>"date"!==o?.[t]||(this.rejectDateStackColumn(e,t),!1))),l=r.adjust()();for(let i=0;i<e.groups.length;i++){l(s,t,e.groups[i],i)}for(const o of t){const t="category"===this.ctx.values[o].valueType,r=s[o],l=(0,n.$1N)(i[o]),h=a?.get(l),c=t?new to:new io;for(let e=0;e<r.length;e+=1)!0!==h?.[e]&&c.extend(r[e]);e.domain.values[o]=c.getDomain()}}}rejectDateStackColumn(e,t){const i=this.ctx.values[t],s=(0,n.$1N)(e.columnScopes[t]);this.ctx.logger.warnOnce(`Series "${String(s)}": column "${String(i.property)}" is date-typed; stacking is not meaningful for date data. The series renders empty; other series in this chart are unaffected.`);const a=e.columns[t];for(let e=0;e<a.length;e+=1)a[e]=void 0;e.domain.values[t]=[]}valueGroupIdxLookup(e){return this.scopeCacheManager.valueGroupIdxLookup(e)}},Mo=class{constructor(e){this.ctx=e}setupDomainForDefinition(e,t,i){const n="category"===e.valueType,s=!0===e.timeDomain;let a=t.get(e);return a||!1===this.ctx.bandingConfig?.enableBanding||(a=new no(n?()=>new to(s):()=>new io,this.ctx.bandingConfig,n),t.set(e,a)),a&&n&&a.setSortOrderMetadata(i?.sortOrder,i?.isUnique??!1),a||(n?new to(s):new io)}extendDomainFromData(e,t,i){if((e instanceof no?!e.discrete:io.is(e))&&(t=(0,n.Odr)(t)),e instanceof no)e.extendBandsFromData(t,i);else for(let n=0;n<t.length;n++)!0!==i?.[n]&&e.extend(t[n])}initializeBandedDomain(e,t,i){if(!(e instanceof no))return;const n=e.getStats(),s=0===n.bandCount||n.dataSize!==t;this.ctx.debug.check()&&s&&i&&this.ctx.debug(`Reinitializing bands for ${i}: bandCount=${n.bandCount}, dataSize=${n.dataSize}, dataLength=${t}`),s&&e.initializeBands(t)}},ko=Symbol("key-sort-orders"),Do=Symbol("column-sort-orders"),wo=Symbol("domain-ranges"),Io=Symbol("domain-bands"),Ao=Symbol("reducer-bands"),Co=Object.freeze([0]);function No(e,t){if("string"==typeof t)e.set(t,(e.get(t)??0)+1);else for(const i of t)e.set(i,(e.get(i)??0)+1)}function Lo(e,t){if(e.reusableResult.valid=!1,e.hasInvalidValue)return e.reusableResult.value=e.invalidValue,void e.domain.extend(e.invalidValue);if("integrated"!==e.mode){const i=`invalid value of type [${typeof t}] for [${e.def.scopes} / ${e.def.id}] ignored:`;e.logger.warnOnce(i,`[${t}]`)}e.reusableResult.value=void 0}function Po(e,t,i,n,s,a){return e&&t&&!1===e(i,n,s,a.logger)?(a.reusableResult.missing=!1,Lo(a,i),a.reusableResult):null}function To(e,t,i,n,s){s.missing=!e,e||t||No(i,n)}function Oo(e,t,i){return t.valid=!0,t.value=e,i.extend(e),t}var Ro=class{constructor(e){this.ctx=e}createProcessValueFn(e,t,i,n,s,a){const o={def:e,accessor:t,domain:i,reusableResult:n,processorFns:s,mode:this.ctx.mode};return("extend"===a?this.createSpecializedProcessValue(o,e.validation):null)??this.createGenericProcessValue(o,a)}createSpecializedProcessValue(e,t){return null!=e.def.forceValue?this.createSpecializedProcessValueForceValue(e):e.def.processor?this.createSpecializedProcessValueProcessor(e,t):t?"ke
1y"===e.def.type?this.createSpecializedProcessValueKeyValidation(e,t):this.createSpecializedProcessValueValueValidation(e,t):null}createValidationMeta(e){const{def:t,domain:i,reusableResult:n,mode:s}=e;return{reusableResult:n,hasInvalidValue:"invalidValue"in t,invalidValue:t.invalidValue,domain:i,def:t,mode:s,logger:this.ctx.logger}}createSpecializedProcessValueKeyValidation(e,t){const{def:i,accessor:n,domain:s,reusableResult:a}=e,o=i.property,r="missingValue"in i,l=i.missingValue,h=i.missing,c=i.allowNullKey??!1,d=this.createValidationMeta(e);if(n){const e=n;return function(i,n,o){let l;try{l=e(i)}catch{}const u=null!=l||c&&null==l;return!u||!c&&null==l||!1===t(l,i,n,d.logger)?(a.missing=!u,u||r||No(h,o),Lo(d,l),a):(a.missing=!1,a.valid=!0,a.value=l,s.extend(l),a)}}return function(e,i,n){const u=o in e,p=u?e[o]:l;return!u||!c&&null==p||!1===t(p,e,i,d.logger)?(a.missing=!u,u||r||No(h,n),Lo(d,p),a):(a.missing=!1,a.valid=!0,a.value=p,s.extend(p),a)}}createSpecializedProcessValueValueValidation(e,t){const{def:i,accessor:n,domain:s,reusableResult:a}=e,o=i.property,r="missingValue"in i,l=i.missingValue,h=i.missing,c=this.createValidationMeta(e);if(n){const e=n;return function(i,n,o){let l;try{l=e(i)}catch{}const d=null!=l,u=Po(t,d,l,i,n,c);return null!==u?u:(To(d,r,h,o,a),Oo(l,a,s))}}return function(e,i,n){const d=o in e,u=d?e[o]:l,p=Po(t,d,u,e,i,c);return null!==p?p:(To(d,r,h,n,a),Oo(u,a,s))}}createSpecializedProcessValueForceValue(e){const{def:t,accessor:i,domain:s,reusableResult:a}=e,o=t.property,r=t.forceValue;if(i){const e=i;return function(t,i,o){let l;try{l=e(t)}catch{}const h=null!=l&&(0,n.cIo)(l)?-1*r:r;return a.missing=!1,a.valid=!0,a.value=h,s.extend(h),a}}return function(e,t,i){const l=o in e,h=l?e[o]:void 0,c=l&&(0,n.cIo)(h)?-1*r:r;return a.missing=!1,a.valid=!0,a.value=c,s.extend(c),a}}createSpecializedProcessValueProcessor(e,t){const{def:i,accessor:n,domain:s,reusableResult:a,processorFns:o}=e,r=i.property,l="missingValue"in i,h=i.missingValue,c=i.missing,d=i.processor,u=this.createValidationMeta(e);if(n){const e=n;return function(n,r,h){let p;try{p=e(n)}catch{}const g=null!=p,m=Po(t,g,p,n,r,u);if(null!==m)return m;To(g,l,c,h,a);let y=o.get(i);return null==y&&(y=d(),o.set(i,y)),p=y(p,r),Oo(p,a,s)}}return function(e,n,p){const g=r in e;let m=g?e[r]:h;const y=Po(t,g,m,e,n,u);if(null!==y)return y;To(g,l,c,p,a);let f=o.get(i);return null==f&&(f=d(),o.set(i,f)),m=f(m,n),Oo(m,a,s)}}createGenericProcessValue(e,t){const{def:i,accessor:s,domain:a,processorFns:o}=e,r=i.property,l="missingValue"in i,h=i.missingValue,c=i.missing,d="extend"===t,u=e.reusableResult,p=this.createValidationMeta(e);return function(e,t,g){let m,y;if(s){try{m=s(e)}catch{}y=null!=m}else y=r in e,m=y?e[r]:h;if(null!=i.forceValue){m=y&&(0,n.cIo)(m)?-1*i.forceValue:i.forceValue,y=!0}To(y,l,c,g,u);const f=i.allowNullKey??!1;if("key"===i.type&&null==m&&!f)return Lo(p,m),u;const x=Po(i.validation,y,m,e,t,p);if(null!==x)return x;if(u.valid=!0,i.processor){let e=o.get(i);null==e&&(e=i.processor(),o.set(i,e)),m=e(m,t)}return d&&a.extend(m),u.value=m,u}}};function Eo(e,t){return!e||!t||0===e.length||0===t.length||e.some((e=>t.includes(e)))}function zo(e,t){if("category"===e.valueType)for(const i of t)if(i.property===e.property&&i.valueType===e.valueType&&Eo(i.scopes,e.scopes)&&i.validation===e.validation)return i}var Bo=class{constructor(e,t,i){this.ctx=e,this.initializer=t,this.scopeCacheManager=i,this.processValueFactory=new Ro(e)}recomputeDomains(e){const t=this.ctx.debug.check()?performance.now():0,i=e[Io];let s;const a=e[ko],o=this.setupDefinitionDomains(this.ctx.keys,i,a),r=new Map;for(const e of this.ctx.values){const t=zo(e,this.ctx.keys);t&&r.set(e,t)}const l=this.setupValueDomainsWithSharing(this.ctx.values,i,o,r),h=new Set;for(const[,e]of r){const t=o.get(e);t&&h.add(t)}this.initializeDomainBands(this.ctx.keys,o,(t=>{const i=e.keys[t];return Math.max(...Array.from(i.values()).map((e=>e.length)))}),(e=>String(e.property))),this.initializeDomainBands(this.ctx.values,l,(t=>e.columns[t].length),(e=>String(e.property)));const c=new Map;if(i.size>0){s={totalBands:0,dirtyBands:0,totalData:0};for(const e of i.values())if(e instanceof no){const t=e.getStats();c.set(e,t),s.totalBands+=t.bandCount,s.dirtyBands+=t.dirtyBandCount,s.totalData=Math.max(s.totalData,t.dataSize)}}if(this.extendDomainsFromData(this.ctx.keys,o,((t,i)=>e.keys[t]?.get(i)),(e=>e.scopes??[]),(t=>e.invalidKeys?.get(t))),this.extendDomainsFromData(this.ctx.values,l,((t,i)=>e.columns[t]),(e=>[(0,n.$1N)(e.scopes)]),(t=>e.invalidKeys?.get(t)),h),e.domain.keys=this.ctx.keys.map((function(e){const t=o.get(e),i=t.getDomain();return io.is(t)&&i[0]>i[1]?[]:i})),e.domain.values=this.ctx.values.map((function(e){const t=l.get(e),i=t.getDomain();return io.is(t)&&i[0]>i[1]?[]:i})),"grouped"===e.type&&(e.domain.groups=e.groups.map((e=>e.keys))),this.collectDomainBandingMetadata(e,o,l,i,c),this.ctx.debug.check()&&t>0){const e=performance.now()-t;if(s&&s.totalBands>0){const t=s.dirtyBands/s.totalBands,i=Math.round(t*s.totalData);this.ctx.debug(`recomputeDomains with banding: ${e.toFixed(2)}ms, bands: ${s.dirtyBands}/${s.totalBands} dirty, data scanned: ~${i}/${s.totalData} (${(100*t).toFixed(1)}%)`)}else this.ctx.debug(`recomputeDomains: ${e.toFixed(2)}ms (no banding)`)}}setupDefinitionDomains(e,t,i){const n=new Map;for(const[s,a]of e.entries()){const e=i?.get(s);n.set(a,this.initializer.setupDomainForDefinition(a,t,e))}return n}initializeDomainBands(e,t,i,n){for(const[s,a]of e.entries()){const e=t.get(a);if(!e)continue;const o=i(s);this.initializer.initializeBandedDomain(e,o,n(a))}}extendDomainsFromData(e,t,i,n,s,a){for(const[o,r]of e.entries()){const e=t.get(r);if(e&&!a?.has(e))for(const t of n(r)){if(!t)continue;const n=i(o,t);
1if(!n)continue;const a=s(t);this.initializer.extendDomainFromData(e,n,a)}}}setupValueDomainsWithSharing(e,t,i,n){const s=new Map;for(const a of e){const e=n.get(a);if(e){const t=i.get(e);if(t){s.set(a,t);continue}}s.set(a,this.initializer.setupDomainForDefinition(a,t))}return s}initDataDomainProcessor(e){const{keys:t,values:i}=this.ctx,s=new Set;for(const e of i)if(e.scopes)for(const t of e.scopes)s.add(t);const a=new Map,o=new Map;let r=!0;const l=()=>{for(const e of t)"category"===e.valueType?a.set(e,new to(!0===e.timeDomain)):a.set(e,new io);for(const e of i){const i=zo(e,t);if(i){const t=a.get(i);if(t){a.set(e,t),r&&(r=(e.scopes?.length??0)===s.size);continue}}"category"===e.valueType?a.set(e,new to(!0===e.timeDomain)):(a.set(e,new io),r&&(r=(e.scopes?.length??0)===s.size))}};l();const h=this.scopeCacheManager.buildAccessors((0,n.nlf)(t,i)),c=new WeakMap;for(const s of(0,n.nlf)(t,i)){const t=h.get(s.property),i=a.get(s),n={value:void 0,missing:!1,valid:!1},r=this.processValueFactory.createProcessValueFn(s,t,i,n,o,e);c.set(s,r)}function d(e){const t=c.get(e);if(!t)throw new Error("AG Charts - missing processValue function for definition");return t}return{dataDomain:a,processValue:function(e,t,i,n){return d(e)(t,i,n)},getProcessValue:d,initDataDomain:l,scopes:s,allScopesHaveSameDefs:r}}collectDomainBandingMetadata(e,t,i,n,s){e.optimizations??(e.optimizations={});const a=(e,t)=>e.map((e=>{const i=t.get(e),a=n.get(e),o=i instanceof no;let r,l;if(o||(r="category"===e.valueType?"discrete domain":"not configured"),o&&a){const e=s.get(a)??a.getStats(),t=e.bandCount>0?e.dirtyBandCount/e.bandCount:0;l={totalBands:e.bandCount,dirtyBands:e.dirtyBandCount,dataSize:e.dataSize,scanRatio:t}}return{property:String(e.property),applied:o,reason:r,stats:l}})),o=a(this.ctx.keys,t),r=a(this.ctx.values,i);e.optimizations.domainBanding={keyDefs:o,valueDefs:r}}};function Fo(e,t){let i;if("number"==typeof t)i=Number.isFinite(t)?t:void 0;else if("bigint"==typeof t)i=t;else if((0,n.p1d)(t)){const e=(0,n.Hre)(t);i=Number.isFinite(e)?e:void 0}else{const e=t?.valueOf?.();i="number"==typeof e&&Number.isFinite(e)?e:void 0}if(void 0===i)return;const{lastValue:s}=e;if(void 0!==s){if(i===s)e.isUnique=!1;else if(e.isOrdered){const t=i>s?1:-1;0===e.sortOrder?e.sortOrder=t:e.sortOrder!==t&&(e.isOrdered=!1)}e.lastValue=i}else e.lastValue=i}
1function Vo(e){return{sortOrder:e.isOrdered&&0!==e.sortOrder?e.sortOrder:void 0,isUnique:e.isUnique,isDirty:!1}}function $o(e,t){return("number"===e||"bigint"===e||"boolean"===e)&&typeof t===e}function Ho(e,t,i){const s=e.type;if($o(s,t))return s;const a=function(e){switch(typeof e){case"number":return"number";case"bigint":return"bigint";case"boolean":return"boolean";case"string":return(0,n.p1d)(e)?"date":"string";case"object":if(null==e)return;return e instanceof Date?"date":(0,n.JR6)(e)?"number":"object";default:return}}(t);if(null!=a){if(("string"===a||"date"===a&&"string"==typeof t)&&(e.sawString=!0),null==e.type||e.type===a)e.type=a;else if(Wo(e.type)||Wo(a)){jo(Wo(e.type)?a:e.type)||(e.mixedDateAtIndex??(e.mixedDateAtIndex=i)),e.type="date"}else jo(e.type)&&jo(a)&&(e.mixedAtIndex??(e.mixedAtIndex=i),e.type="mixed-numeric");return a}}function jo(e){return"number"===e||"bigint"===e||"mixed-numeric"===e}function Wo(e){return"date"===e}var _o=/(Z|[+-]\d{2}:\d{2})$/;function Go(e){return null!=e.explicit||null!=e.implicit}function Ko(e,t){if(!io.is(e))return;const i=(0,n.Odr)(t);for(let t=0;t<i.length;t++)e.extend(i[t])}function Yo(e,t,i){"string"==typeof t&&(_o.test(t)?e.explicit??(e.explicit={value:t,index:i}):e.implicit??(e.implicit={value:t,index:i}))}var Uo=class{constructor(e,t){this.ctx=e,this.domainManager=t}extractData(e){const{dataDomain:t,getProcessValue:i,allScopesHaveSameDefs:n}=this.domainManager.initDataDomainProcessor("extend"),{keys:s,values:a}=this.ctx,{invalidData:o,invalidKeys:r,invalidKeyCount:l,invalidDataCount:h,missingData:c,allKeyMappings:d,keySortOrders:u,keyHasIsoStrings:p}=this.extractKeys(s,e,i),{columns:g,columnScopes:m,columnNeedValueOf:y,columnValueType:f,columnHasIsoStrings:x,partialValidDataCount:b,maxDataLength:v}=this.extractValues(o,h,c,a,e,r,i);for(const[e,i]of a.entries())x[e]&&Ko(t.get(i),g[e]);for(const[e,i]of s.entries()){if(!p[e])continue;const n=t.get(i);for(const e of new Set(d.get(i)?.values()))Ko(n,e)}const S=e=>{const i=t.get(e),n=i.getDomain();return io.is(i)&&n[0]>n[1]?[]:n};return{type:"ungrouped",input:{count:v},scopes:new Set(e.keys()),dataSources:e,aggregation:void 0,keys:[...d.values()],columns:g,columnScopes:m,columnNeedValueOf:y,columnValueType:f,invalidKeys:r,invalidKeyCount:l,invalidData:o,invalidDataCount:h,missingData:c,domain:{keys:s.map(S),values:a.map(S)},defs:{allScopesHaveSameDefs:n,keys:s,values:a},partialValidDataCount:b,time:0,version:0,[wo]:new Map,[ko]:u,[Do]:new Map,[Io]:new Map,[Ao]:new Map}}extractKeys(e,t,i){const s=new Map,a=new Map,o=new Map,r=new Map,l=new Map,h=new Map,c=new Map,d=[];let u,p;const g=e.map((e=>i(e))),m=(e,t)=>{const i=p.get(e);u.set(t,u.get(i)),s.has(i)&&(s.set(t,s.get(i)),a.set(t,a.get(i)),r.set(t,r.get(i)))};for(const[i,y]of e.entries()){const{invalidValue:e,scopes:f}=y,x=g[i];u=new Map,p=new Map,h.set(y,u);const b={lastValue:void 0,sortOrder:0,isUnique:!0,isOrdered:!0},v={type:void 0,mixedAtIndex:void 0,mixedDateAtIndex:void 0,sawString:!1},S={explicit:void 0,implicit:void 0};for(const i of f??[]){const n=t.get(i)?.data??[];if(p.has(n)){m(n,i);continue}const h=[];let c,d;u.set(i,h),p.set(n,i);let g,y=0;for(let t=0;t<n.length;t++){if(null==n[t]||"object"!=typeof n[t]){c??(c=yo(n.length,!1)),d??(d=yo(n.length,!1)),y+=1,c[t]=!0,d[t]=!0,h.push(e);continue}const s=x(n[t],t,i);s.valid?(h.push(s.value),Fo(b,s.value),$o(v.type,s.value)||"date"!==Ho(v,s.value,t)||Yo(S,s.value,t)):(s.missing&&(g??(g=yo(n.length,!1))),h.push(e),c??(c=yo(n.length,!1)),d??(d=yo(n.length,!1)),y+=1,c[t]=!0,d[t]=!0)}c&&d&&(s.set(i,c),a.set(i,d),o.set(i,y),r.set(i,y)),g&&l.set(i,g)}if(c.set(i,Vo(b)),this.warnMixedTimezoneColumn(y.property,v.type,S,!0===y.timeDomain),d.push("date"===v.type&&Go(S)),!v.sawString)for(const e of u.values())(0,n.Dpz)(e)}return{invalidData:a,invalidKeys:s,invalidKeyCount:o,invalidDataCount:r,missingData:l,allKeyMappings:h,keySortOrders:c,keyHasIsoStrings:d}}markScopeDatumInvalid(e,t,i,n,s){for(const a of e){n.has(a)||(n.set(a,yo(t.length,!1)),s.set(a,0));const e=n.get(a);e[i]||(e[i]=!0,s.set(a,s.get(a)+1))}}markScopeDatumMissing(e,t,i,n){for(const s of e){n.has(s)||n.set(s,yo(t.length,!1));const e=n.get(s);e[i]||(e[i]=!0)}}extractValues(e,t,i,s,a,o,r){let l=0;const h=[],c=[],d=[],u=[],p=[];let g=0;const m=s.map((e=>r(e)));for(const[r,y]of s.entries()){const{invalidValue:s}=y,f=m[r];if(new Set(y.scopes.map((e=>a.get(e)))).size>1)throw new Error(`AG Charts - more than one data source for: ${JSON.stringify(y)}`);const x=new Set(y.scopes),b=(0,n.$1N)(y.scopes),v=a.get(b)?.data??[],S=new Array,M=o.get(b);let k=!1;const D={type:void 0,mixedAtIndex:void 0,mixedDateAtIndex:void 0,sawString:!1},w={explicit:void 0,implicit:void 0};for(let n=0;n<v.length;n++){if(null==v[n]||"object"!=typeof v[n]){this.markScopeDatumInvalid(y.scopes,v,n,e,t),S[n]=s;continue}const a=v[n],o=null!=M&&M[n],r=f(a,n,y.scopes);let h=r.value;o||!r.valid?this.markScopeDatumInvalid(y.scopes,v,n,e,t):r.missing?this.markScopeDatumMissing(y.scopes,v,n,i):$o(D.type,r.value)||"date"!==Ho(D,r.value,n)||Yo(w,r.value,n),o?h=s:r.valid||(l+=1,h=s),k||null==h||"object"!=typeof h||(k=!0),S[n]=h}"mixed-numeric"===D.type&&null!=D.mixedAtIndex&&this.warnMixedNumericColumn(b,y.property,D.mixedAtIndex),null!=D.mixedDateAtIndex&&this.warnMixedDateColumn(b,y.property,D.mixedDateAtIndex),this.warnMixedTimezoneColumn(y.property,D.type,w,!0===y.timeDomain),h.push(S),c.push(x),d.push(k),u.push(D.type),p.push("date"===D.type&&Go(w)),D.sawString||(0,n.Dpz)(S),"number"===D.type&&(0,n.Rfy)(S),g=Math.max(g,S.length)}return{columns:h,columnScopes:c,columnNeedValueOf:d,columnValueType:u,columnHasIsoStrings:p,partialValidDataCount:l,maxDataLength:g}}warnMixedNumericColumn(e,t,i){this.ctx.logger.warnOnce(`Series "${e}": column "${String(t)}" mixes 'number' and 'bigint' values (first detected at row ${i}); the bigints are narrowed to Number and may lose precision beyond ±(2^53 - 1) (Number.MAX_SAFE_INTEGER). Use one numeric type per column.`)}warnMixedDateColumn(e,t,i){this.ctx.logger.warnOnce(`Series "${e}": column "${String(t)}" mixes date/time values with non-date values (first detected at row ${i}). Each column must be uniformly typed; the non-date values cannot be placed on a time axis and may render at invalid positions.`)}warnMixedTimezoneColumn(e,t,i,n){const{explicit:s,implicit:a}=i;n&&"date"===t&&null!=s&&null!=a&&this.ctx.logger.warnOnce(`Time axis: column "${String(e)}
1" contains both timezone-explicit values (e.g. "${s.value}", row ${s.index}) and timezone-implicit values (e.g. "${a.value}", row ${a.index}). Ambiguous timezone semantics may produce unexpected positions â points without an explicit offset are interpreted as local time. Use explicit offsets (Z or ±HH:MM) for cross-environment determinism.`)}warnDataMissingProperties(e){if(0!==e.size)for(const t of(0,n.nlf)(this.ctx.keys,this.ctx.values))for(const[i,n]of t.missing){if(n<(e.get(i)?.data.length??1/0))continue;const s=null==i?"":` for ${i}`,a=`the key '${t.property}' was not found in any data element${s}.`;this.ctx.logger.warnOnce(a)}}},Xo=class{constructor(e){this.ctx=e}groupData(e,t){var i;const{keys:s,columns:a,columnScopes:o,invalidKeys:r,invalidData:l}=e,h=e.scopes,c=[],d=[],u=1!==h.size||null!=t?new Map:void 0;let p=!0,g=0;const m=h.size,y=this.groupBatches(h,a,o,s,l,r),f=y.length;if(this.ctx.debug?.check()&&!e.optimizations&&(e.optimizations={}),this.ctx.debug?.check()){const t=m>0?1-f/m:0;e.optimizations.batchMerging={originalBatchCount:m,mergedBatchCount:f,mergeRatio:t}}const x=1===y.length,b=Object.freeze(yo(y[0][1].length,Co));for(const[e,s,o,r,l,m]of y){const y=a[(0,n.$1N)(s)];for(let n=0;n<y.length;n++){if(!0===m?.[n])continue;const a=o.map((e=>e[n]));if(null==a||0===a.length)throw new Error("AG Charts - no keys found for scope(s): "+e.join(", "));const y=t?.(a)??a,f=null==u?void 0:co(y);let v,S,M=u?.get(f),k=!1;if(null==M?(v={keys:y,datumIndices:[],aggregation:[],validScopes:h},S=g++,M=[S,v],k=!0,u?.set(f,M),c.push(v.keys),d.push(v)):([S,v]=M,p=!1),!0===l?.[n]){v.validScopes===h&&(v.validScopes=new Set(h.values()));for(const e of r)v.validScopes.delete(e)}if(k&&n===S&&x)v.datumIndices=b;else{k||v.datumIndices!==b||(v.datumIndices=b.map((e=>[...e])));for(const e of s)(i=v.datumIndices)[e]??(i[e]=[]),v.datumIndices[e].push(n-S)}}}return{...e,type:"grouped",domain:{...e.domain,groups:c},groups:d,groupsUnique:p,optimizations:e.optimizations,[Io]:e[Io],[Ao]:e[Ao]}}groupBatches(e,t,i,n,s,a){const o=[],r=new Set;for(const l of e){const e=t.map(((e,t)=>t)).filter((e=>!r.has(e)&&i[e].has(l)));if(0===e.length)continue;for(const t of e)r.add(t);const h=new Set;for(const t of e)for(const e of i[t])h.add(e);const c=n.map((e=>e.get(l))).filter((e=>null!=e)),d=s?.get(l),u=a?.get(l);o.push([l,e,c,h,d,u])}return this.mergeCompatibleBatches(o)}areBatchesCompatible(e,t){const[,,i,,n,s]=e,[,,a,,o,r]=t;return i.every(((e,t)=>e===a[t]))&&s===r&&n===o}mergeCompatibleBatches(e){const t=[],i=new Set;for(let n=0;n<e.length;n++){if(i.has(n))continue;const[s,a,o,r,l,h]=e[n],c=[[s],[...a],o,new Set(r),l,h];this.findAndMergeCompatibleBatches(e,n,c,i),t.push(c),i.add(n)}return t}findAndMergeCompatibleBatches(e,t,i,n){const s=e[t];for(let a=t+1;a<e.length;a++){if(n.has(a))continue;const t=e[a],[o,r,,l]=t;if(this.areBatchesCompatible(s,t)){i[0].push(o),i[1].push(...r);for(const e of l)i[3].add(e);n.add(a)}}}};function Zo(e){return 0===e.removedIndices.size&&0===e.totalPrependCount&&e.totalAppendCount>0}function qo(e){return 0===e.removedIndices.size}function Qo(e){return 0===e.removedIndices.size&&0===e.totalPrependCount&&0===e.totalAppendCount&&e.spliceOps.every((e=>0===e.insertCount&&0===e.deleteCount))}function Jo(e){return e.removedIndices.size>0&&0===e.totalPrependCount&&0===e.totalAppendCount&&e.spliceOps.every((e=>0===e.insertCount))}function er(e){if(0===e.size)return 0;const t=Array.from(e).sort(((e,t)=>e-t));if(0!==t[0])return 0;for(let e=0;e<t.length;e++)if(t[e]!==e)return 0;return t.length}function tr(e){return function(e){return er(e.removedIndices)>0}(e)&&e.totalAppendCount>0&&0===e.totalPrependCount}var ir=class{constructor(e,t){this.indexMap=e,this.prependValues=t.prependValues,this.appendValues=t.appendValues,this.insertionValues=t.insertionValues}getRemovedIndices(){return Array.from(this.indexMap.removedIndices).sort(((e,t)=>e-t))}getUpdatedIndices(){return Array.from(this.indexMap.updatedIndices).sort(((e,t)=>e-t))}forEachPreservedIndex(e){const{originalLength:t,removedIndices:i,totalPrependCount:n}=this.indexMap;let s=0;const a=Array.from(i).sort(((e,t)=>e-t));let o=0;for(let r=0;r<t;r++){for(;o<a.length&&a[o]<r;)s++,o++;if(!i.has(r)){e(r,r+n-s)}}}getPrependedValues(){return this.prependValues}getAppendedValues(){return this.appendValues}getInsertionValues(){return this.insertionValues}applyToArray(e,t,i){const{spliceOps:n,finalLength:s,originalLength:a}=this.indexMap;
1if(a!==s||0!==n.length){for(const s of n){const n=s.insertCount>0?Array.from({length:s.insertCount},(function(e,i){return t(s.index+i)})):[],a=e.splice(s.index,s.deleteCount,...n);i&&a.length>0&&i(a,s)}e.length!==s&&(e.length=s)}}applyToTypedArray(e,t=0){const{finalLength:i,removedIndices:n,totalPrependCount:s,totalAppendCount:a,spliceOps:o}=this.indexMap;if(i===e.length&&0===n.size&&0===o.length)return e;const r=new Uint8Array(i);0!==t&&r.fill(t);let l=0;for(const e of o)l+=e.insertCount;if(l>s+a){const t=this.collectMidArrayInsertions();this.forEachPreservedIndex((function(i,n){let s=0;for(const e of t){if(!(e.destIndex<=n+s))break;s+=e.count}r[n+s]=e[i]}))}else{const t=n.size>0?Array.from(n).sort(((e,t)=>e-t)):[];let i=0,a=s;for(const n of t){const t=n-i;t>0&&(r.set(e.subarray(i,i+t),a),a+=t),i=n+1}const o=e.length-i;o>0&&r.set(e.subarray(i,i+o),a)}return r}collectMidArrayInsertions(){const{totalPrependCount:e,totalAppendCount:t,finalLength:i,spliceOps:n}=this.indexMap,s=i-t,a=[];for(const i of n)if(i.insertCount>0){if(0===i.deleteCount&&0===i.index&&i.insertCount===e)continue;if(0===i.deleteCount&&i.index===s&&i.insertCount===t)continue;a.push({destIndex:i.index,count:i.insertCount})}return a.sort(((e,t)=>e.destIndex-t.destIndex))}},nr=class extends eo{constructor(e={}){super(e),this.lastDirtyBandCount=0,this.lastScanRatio=0,this.statsCaptured=!1}createBand(e,t){return{startIndex:e,endIndex:t,cachedResult:void 0,isDirty:!0}}initializeBands(e){super.initializeBands(e),this.statsCaptured=!1}getBands(){return this.bands}evaluateFromData(e,t,i=!1){const n=e.reducer();for(const s of this.bands){if(i&&!s.isDirty)continue;const a=e.needsOverlap&&s.startIndex>0?Math.max(0,s.startIndex-1):s.startIndex,o=this.evaluateRange(e,n,t,a,s.endIndex);s.cachedResult=o,s.isDirty=!1}}getResult(e){const t=this.bands.map((e=>e.cachedResult));return e.combineResults(t)}evaluateRange(e,t,i,n,s){let a=e.initialValue;const{keyColumns:o,keysParam:r,rawData:l}=i,h=Math.min(s,l.length);for(let e=n;e<h;e+=1){for(let t=0;t<r.length;t++)r[t]=o[t]?.[e];a=t(a,r)}return a}captureStatsBeforeProcessing(){const e=this.bands.filter((e=>e.isDirty)),t=e.reduce(((e,t)=>e+(t.endIndex-t.startIndex)),0);this.lastDirtyBandCount=e.length,this.lastScanRatio=this.dataSize>0?t/this.dataSize:0,this.statsCaptured=!0}getStats(){const e=this.bands.filter((e=>!e.isDirty&&void 0!==e.cachedResult));let t,i;if(this.statsCaptured)t=this.lastDirtyBandCount,i=this.lastScanRatio;else{const e=this.bands.filter((e=>e.isDirty)),n=e.reduce(((e,t)=>e+(t.endIndex-t.startIndex)),0);t=e.length,i=this.dataSize>0?n/this.dataSize:0}return{totalBands:this.bands.length,dirtyBands:t,dataSize:this.dataSize,scanRatio:i,cacheHits:e.length}}},sr=class{constructor(e={}){this.bandingConfig=e}static evaluateRange(e,t,i,n,s){let a=e.initialValue;const{keyColumns:o,keysParam:r,rawData:l}=i,h=Math.min(s,l.length);for(let e=n;e<h;e+=1){for(let t=0;t<r.length;t++)r[t]=o[t]?.[e];a=t(a,r)}return a}evaluate(e,t,i={}){var n;const s=this.createContext(e,t);if(!s)return;t[n=Ao]??(t[n]=new Map);const a=t[Ao],o=e.property;let r=a.get(o);return r||(r=new nr(this.bandingConfig),a.set(o,r)),0===r.getBandCount()&&r.initializeBands(s.rawData.length),i.beforeEvaluate?.(r,s),r.captureStatsBeforeProcessing(),r.evaluateFromData(e,s,i.reuseCleanBands??!1),r.getResult(e)}
1applyIndexMap(e,t){const i=e[Ao];if(i)for(const e of i.values())e.applyIndexMap(t)}createContext(e,t){if("ungrouped"!==t.type)return;const i=mo(e)?e.scopes[0]:(0,n.$1N)(t.dataSources.keys());if(null==i)return;const s=t.dataSources.get(i)?.data??[],a=t.keys.map((e=>e.get(i))).filter((e=>null!=e)),o=a.map((()=>{}));return{scopeId:i,rawData:s,keyColumns:a,keysParam:o}}},ar=class{constructor(e,t){this.ctx=e,this.reducerManager=t}isReprocessingSupported(e){if("grouped"===e.type){if(!e.groupsUnique)return!1;if(1!==this.getUniqueDataSets(e).size)return!1;const t=(0,n.$1N)(e.scopes),i=e.invalidKeys?.get(t);if(i?.some((e=>e)))return!1}if(this.ctx.aggregates.length>0)return!1;if(this.ctx.reducers.some((e=>!0!==e.supportsBanding||"function"!=typeof e.combineResults)))return!1;return!this.ctx.processors.some((e=>void 0===e.incrementalCalculate))&&(!(this.ctx.propertyProcessors.length>0)&&this.ctx.groupProcessors.every((e=>e.supportsReprocessing??!1)))}reprocessData(e,t,i,n,s,a,o){const r=performance.now(),l=this.collectScopeChanges(e,t);if(0===l.size)return e;this.commitPendingTransactions(e,o);const h=this.buildDefinitionProcessors(this.ctx.keys,i),c=this.buildDefinitionProcessors(this.ctx.values,i),d=this.processAllInsertions(e,l,h,c);this.processAllUpdates(e,l,h,c,d),this.updateBandsForChanges(e,l);const u=this.transformKeysArrays(e,l,d);this.transformColumnsArrays(e,l,d),this.transformInvalidityArrays(e,l,d),this.reprocessBandedReducers(e,l),"grouped"===e.type&&(this.transformGroupsArray(e,l,d),this.ctx.groupProcessors.length>0&&n(e,l)),this.invalidateSortOrdersForChanges(e,l),s(e),this.reprocessProcessors(e),null!=e.reduced?.diff&&l.size>0&&this.generateDiffMetadata(e,l,u),this.updateProcessedDataMetadata(e);const p=performance.now();e.time=p-r,e.version+=1,a(e,"reprocess");const g=fo(l);return e.changeDescription=1===g.size?g.values().next().value:void 0,e}updateBandsForChanges(e,t){const i=e[Io];if(0===i.size)return;const n=fo(t);for(const e of n){const{indexMap:t}=e;for(const e of i.values())e.applyIndexMap(t)}}reprocessBandedReducers(e,t){if("ungrouped"!==e.type)return;const i=this.ctx.reducers.filter((e=>e.supportsBanding&&"function"==typeof e.combineResults));if(0!==i.length){e.reduced??(e.reduced={});for(const n of i){const i=this.reducerManager.evaluate(n,e,{reuseCleanBands:!0,beforeEvaluate:(e,i)=>{if(!i.scopeId)return;const n=t.get(i.scopeId);n&&e.applyIndexMap(n.indexMap)}});void 0!==i&&(e.reduced[n.property]=i)}}}collectScopeChanges(e,t){const i=new Map;for(const[n,s]of e.dataSources){const e=t?.get(s)??s.getChangeDescription();e&&i.set(n,e)}return i}commitPendingTransactions(e,t){const i=this.getUniqueDataSets(e);for(const e of i)e.commitPendingTransactions(t)}buildDefinitionProcessors(e,t){return e.map(((e,i)=>({def:e,index:i,processValue:t(e)})))}processAllInsertions(e,t,i,n){const s=new Map;for(const[a,o]of t){const t=e.dataSources.get(a);if(!t)continue;const r=this.processInsertionsOnce(a,o,t,i,n);s.set(a,r)}return s}processAllUpdates(e,t,i,n,s){for(const[a,o]of t){const t=e.dataSources.get(a);if(!t)continue;const r=o.getUpdatedIndices();if(0===r.length)continue;let l=s.get(a);l||(l=new Map,s.set(a,l));for(const e of r){if(e<0||e>=t.data.length)continue;const s=this.processDatum(t,e,a,i,n);s&&l.set(e,s)}}}processInsertionsOnce(e,t,i,n,s){const a=new Map,{finalLength:o}=t.indexMap;for(const r of t.indexMap.spliceOps)if(!(r.insertCount<=0))for(let t=0;t<r.insertCount;t++){const l=r.index+t;if(l<0||l>=o)continue;const h=this.processDatum(i,l,e,n,s);h&&a.set(l,h)}return a}processDatum(e,t,i,n,s){const a=e.data[t],o=new Map,r=new Map;let l=!1,h=!1,c=!1;if(null==a||"object"!=typeof a)l=!0,h=!0;else{for(const{index:e,def:s,processValue:r}of n){if(!s.scopes?.includes(i))continue;const n=r(a,t,i);o.set(e,{value:n.value,valid:n.valid}),n.valid||(l=!0)}for(const{index:e,def:n,processValue:o}of s){if(!n.scopes?.includes(i))continue;const s=o(a,t,n.scopes);r.set(e,{value:s.value,valid:s.valid}),s.valid||(h=!0),s.missing&&(c=!0)}}return{keys:o,values:r,hasInvalidKey:l,hasInvalidValue:h,hasMissingValue:c}}transformArraysWithCache(e,t,i,n,s,a){for(const[o,r]of e.entries())for(const e of s(r)){const s=t.get(e);if(!s)continue;const l=n(o,e);if(!l)continue;const h=i.get(e);this.applyChangeDescWithCache(s,l,h,((e,t)=>a(e,r,o)))}}transformKeysArrays(e,t,i){const n=new Map,s=e=>{let t=n.get(e);return t||(t={tuples:[]},n.set(e,t)),t},a=new WeakSet;for(const[o,r]of this.ctx.keys.entries())for(const l of r.scopes??[]){const h=t.get(l);if(!h)continue;const c=e.keys[o]?.get(l);if(!c)continue;if(a.has(c)){const t=Array.from(e.keys[o].entries()).find((([e,t])=>t===c))?.[0];t&&t!==l&&n.has(t)&&n.set(l,n.get(t));continue}a.add(c);const d=i.get(l),u=s(l);let p=0;this.applyChangeDescWithCache(h,c,d,(e=>{const t=e?.keys.get(o);
1return t?.valid?t.value:r.invalidValue}),(e=>{for(const t of e)u.tuples[p]||(u.tuples[p]=new Array(this.ctx.keys.length)),u.tuples[p][o]=t,p+=1}))}const o=new Map;for(const[e,{tuples:t}]of n){if(0===t.length)continue;const i=new Set;for(const n of t){const t=[];for(const[i,s]of n.entries()){const n=this.ctx.keys[i];n.scopes?.includes(e)&&t.push(s)}t.length>0&&i.add(co(t))}o.set(e,i)}return o}transformColumnsArrays(e,t,i){this.transformArraysWithCache(this.ctx.values,t,i,(t=>e.columns[t]),(e=>[(0,n.$1N)(e.scopes)]),((e,t,i)=>{if(e){if(e.hasInvalidKey)return t.invalidValue;const n=e.values.get(i);return n?.valid?n.value:t.invalidValue}return t.invalidValue}))}transformInvalidityMap(e,t,i,n){const s=new Set;for(const[a,o]of t){let t=e.get(a);if(!t){const s=i.get(a);if(!(s&&Array.from(s.values()).some(n)))continue;t=yo(o.indexMap.originalLength,!1),e.set(a,t)}if(s.has(t))continue;s.add(t);const r=i.get(a);this.applyChangeDescWithCache(o,t,r,((e,t)=>n(e)))}}transformInvalidityArrays(e,t,i){e.invalidKeys&&this.transformInvalidityMap(e.invalidKeys,t,i,(e=>e?.hasInvalidKey??!1)),e.invalidData&&this.transformInvalidityMap(e.invalidData,t,i,(e=>!!e&&(e.hasInvalidKey||e.hasInvalidValue))),e.missingData&&this.transformInvalidityMap(e.missingData,t,i,(e=>e?.hasMissingValue??!1))}applyChangeDescWithCache(e,t,i,s,a){const o=(0,n.ur2)(t),r=void 0!==o&&o===t;let l=!1;const h=(e,t)=>{const i=s(e,t);return r&&"string"==typeof i&&(l=!0),i};e.applyToArray(t,(e=>h(i?.get(e),e)),a);for(const n of e.getUpdatedIndices())n<0||n>=t.length||(t[n]=h(i?.get(n),n));void 0===o||r&&!l||(0,n.LW)(t)}transformGroupsArray(e,t,i){const s=(0,n.$1N)(e.scopes),a=t.get(s);if(!a)return;const o=i.get(s);for(const[,e]of o??[])if(e.hasInvalidKey)throw new Error("AG Charts - reprocessing grouped data with invalid keys not supported. This typically indicates a data quality issue that requires full reprocessing.");a.applyToArray(e.groups,(t=>this.createDataGroupForInsertion(t,e,s,o)));const r=a.getUpdatedIndices();if(r.length>0)for(const t of r)t<0||t>=e.groups.length||(e.groups[t]=this.createDataGroupForInsertion(t,e,s,o))}createDataGroupForInsertion(e,t,i,n){const s=[];for(const n of t.keys){const t=n.get(i);t&&s.push(t[e])}const a=t.groups[0],o=a?.datumIndices??Object.freeze(yo(t.columnScopes.length,Co)),r=n?.get(e);let l;return r?.hasInvalidValue??!1?(l=new Set(t.scopes),l.delete(i)):l=t.scopes,{keys:s,datumIndices:o,aggregation:[],validScopes:l}}generateDiffMetadata(e,t,i){const n=(t,i)=>{const n=[];for(const s of e.keys){const e=s.get(t);if(!e)return;n.push(e[i])}return n.length>0?co(n):void 0};for(const[a,o]of t){const t={changed:!0,added:new Set,removed:i.get(a)??new Set,updated:new Set,moved:new Set};for(const e of o.indexMap.spliceOps)if(e.insertCount>0)for(let i=0;i<e.insertCount;i++){const s=e.index+i,o=n(a,s);o&&t.added.add(o)}const{originalLength:r,totalPrependCount:l}=o.indexMap;if(Zo(o.indexMap));else if(0===(s=o.indexMap).removedIndices.size&&0===s.totalAppendCount&&s.totalPrependCount>0&&r>0)for(let e=l;e<l+r;e++){const i=n(a,e);i&&t.moved.add(i)}else if(qo(o.indexMap)&&l>0)for(let e=0;e<r;e++){const i=n(a,e+l);i&&t.moved.add(i)}else o.forEachPreservedIndex(((e,i)=>{if(e!==i){const e=n(a,i);e&&t.moved.add(e)}}));e.reduced.diff[a]=t}var s}updateProcessedDataMetadata(e){let t=0;for(const i of e.dataSources.values())t=Math.max(t,i.data.length);e.input.count=t;let i=0;for(const[t,n]of e.invalidData??new Map){const s=e.invalidKeys?.get(t);for(let e=0;e<n.length;e++)n[e]&&!s?.[e]&&(i+=1)}if(e.partialValidDataCount=i,this.recountInvalid(e.invalidKeys,e.invalidKeyCount),this.recountInvalid(e.invalidData,e.invalidDataCount),e.missingData)for(const[t,i]of e.missingData)i.includes(!1)||e.missingData.delete(t);this.invalidateCachesForChanges(e)}updateSortOrderForAppend(e,t,i){if(0===i.length)return;const n=e=>"number"==typeof e?e:e instanceof Date?e.valueOf():void 0;let s=n(t);const a=e.sortOrder;for(const t of i){const i=n(t);if(void 0===i)continue;if(void 0===s){s=i;continue}const o=i-s;if(0===o&&(e.isUnique=!1),void 0!==e.sortOrder){let t=0;o>0?t=1:o<0&&(t=-1),0!==t&&t!==a&&(e.sortOrder=void 0)}s=i}}updateKeySortOrdersForAppend(e,t){for(const[i,s]of e.keys.entries()){const a=e[ko].get(i);if(!a)continue;const o=(0,n.$1N)(s.values());if(!o||o.length<=t)continue;const r=t>0?o[t-1]:void 0,l=o.slice(t);this.updateSortOrderForAppend(a,r,l)}}invalidateSortOrdersForChanges(e,t){const i=fo(t);let n,s,a=!0,o=!1,r=!1;for(const e of i){const{indexMap:t}=e;Qo(t)||(Zo(t)?(o=!0,n=t.originalLength):Jo(t)||(tr(t)?(r=!0,s={originalLength:t.originalLength,removedCount:t.removedIndices.size}):a=!1))}a?o&&void 0!==n?this.updateKeySortOrdersForAppend(e,n):r&&s&&this.updateKeySortOrdersForRollingWindow(e,s):(e[ko].clear(),e[Do].clear())}updateKeySortOrdersForRollingWindow(e,t){const{originalLength:i,removedCount:s}=t;
1for(const[t,a]of e.keys.entries()){const o=e[ko].get(t);if(!o)continue;const r=(0,n.$1N)(a.values());if(!r||0===r.length)continue;const l=i-s,h=l>0?r[l-1]:void 0,c=r.slice(l);this.updateSortOrderForAppend(o,h,c)}}invalidateCachesForChanges(e){this.markDomainRangesDirty(e[wo])}markDomainRangesDirty(e){for(const t of e.values())t.isDirty=!0}recountInvalid(e,t){if(e&&t)for(const[i,n]of e){const s=n.filter(Boolean).length;0===s?(e.delete(i),t.delete(i)):t.set(i,s)}}reprocessProcessors(e){if(0!==this.ctx.processors.length){e.reduced??(e.reduced={});for(const t of this.ctx.processors){const i=e.reduced[t.property],n=t.incrementalCalculate?.(e,i)??t.calculate(e,i);e.reduced[t.property]=n}}}getUniqueDataSets(e){return new Set(e.dataSources.values())}},or=class e{constructor(t){this.isDirty=!1;const i=t.reduce(((e,t)=>Math.max(e,t.length)),0),{maxLevelSize:n,buffer:s}=e.createBuffer(i);this.maxLevelSize=n,this.buffer=s,this.dataLength=i,this.populateBuffer(t)}static computeMaxLevelSize(e){let t=1<<32-Math.clz32(e);return e===t/2&&(t>>>=1),t}static createBuffer(t){const i=e.computeMaxLevelSize(t);return{maxLevelSize:i,buffer:new Float64Array(2*(2*i-1)).fill(Number.NaN)}}populateBuffer(e){const{maxLevelSize:t,buffer:i}=this,n=t-1;for(const t of e){const e=t.length;for(let s=0;s<e;s+=1){const e=Number(t[s]);if(e!=e)continue;const a=n+s<<1,o=i[a],r=i[a+1];(o!=o||e<o)&&(i[a]=e),(r!=r||e>r)&&(i[a+1]=e)}}for(let e=t>>>1;e>=1;e>>>=1){const t=e-1;let n=t<<1,s=t+e<<1;for(let t=0;t<e;t+=1){const e=s+2,t=i[s],a=i[e];i[n]=a!=a||t<a?t:a;const o=i[s+1],r=i[e+1];i[n+1]=r!=r||o>r?o:r,n+=2,s+=4}}}rebuild(t){const i=t.reduce(((e,t)=>Math.max(e,t.length)),0);if(e.computeMaxLevelSize(i)===this.maxLevelSize)this.buffer.fill(Number.NaN);else{const{maxLevelSize:t,buffer:n}=e.createBuffer(i);this.maxLevelSize=t,this.buffer=n}this.dataLength=i,this.populateBuffer(t)}updateValue(e,t){const{maxLevelSize:i,buffer:n}=this,s=i+e-1,a=Math.trunc(2*s)+0,o=Math.trunc(2*s)+1;n[a]=Number.NaN,n[o]=Number.NaN;for(const e of t){const t=Number(e),i=n[a],s=n[o];(!Number.isFinite(i)||t<i)&&(n[a]=t),(!Number.isFinite(s)||t>s)&&(n[o]=t)}this.propagateUp(s)}updateValues(e){for(const{index:t,values:i}of e)this.updateValue(t,i)}propagateUp(e){const{buffer:t}=this;for(;e>0;){const i=Math.trunc((e-1)/2),n=2*i+1,s=2*i+2,a=t[Math.trunc(2*n)+0],o=t[Math.trunc(2*n)+1],r=t[Math.trunc(2*s)+0],l=t[Math.trunc(2*s)+1];t[Math.trunc(2*i)+0]=!Number.isFinite(r)||a<r?a:r,t[Math.trunc(2*i)+1]=!Number.isFinite(l)||o>l?o:l,e=i}}computeRangeInto(e,t,i,n,s,a,o){const r=s+a-1;if(r<t||s>=i)return o;if(s>=t&&r<i){const t=e[Math.trunc(2*n)+0],i=e[Math.trunc(2*n)+1];Number.isFinite(t)&&(o[0]=Math.min(o[0],t)),Number.isFinite(i)&&(o[1]=Math.max(o[1],i))}else a>1&&(n=Math.trunc(2*n),a=Math.trunc(a/2),this.computeRangeInto(e,t,i,Math.trunc(n+1),s,a,o),this.computeRangeInto(e,t,i,Math.trunc(n+2),s+a,a,o));return o}rangeBetween(e,t,i){const n=i??[0,0];if(e>t)return n[0]=Number.NaN,n[1]=Number.NaN,n;const{maxLevelSize:s,buffer:a}=this;return n[0]=1/0,n[1]=-1/0,this.computeRangeInto(a,e,t,0,0,s,n),n}getRange(e){const{buffer:t}=this,i=e??[0,0];return i[0]=t[0],i[1]=t[1],i}get range(){const{buffer:e}=this;return[e[0],e[1]]}get length(){return this.dataLength}};function rr(e,t){const i=e.length;if(e.length<=1)return 1;let s,a=0;for(let o=0;o<i;o++){const i=e[o];if(null==i)continue;let r=t?i.valueOf():i;if("string"==typeof r&&(0,n.p1d)(r)&&(r=(0,n.Hre)(r),!Number.isFinite(r)))return;if("number"!=typeof r&&"bigint"!=typeof r)return;if("number"==typeof r&&Number.isNaN(r))return;if(void 0!==s){let e=0;if(r>s?e=1:r<s&&(e=-1),0!==e){if(0!==a&&a!==e)return;a=e}}s=r}return 0===a?1:a}var lr=new Set(["number","bigint","mixed-numeric"]);function hr(e,t,i,n,s){null==n||function(e,t){switch(e){case"number":case"bigint":case"mixed-numeric":return lr.has(t)||"date"===t;case"date":return"date"===t||lr.has(t);case"string":return"string"===t||"object"===t;case"boolean":return"boolean"===t;case"object":return!0}}(i,n)||s.warnOnce(`column '${t}' for scope '${e.id}' was resolved as '${i}' but holds '${n}' values; check the series data types.`)}var cr=class{constructor(e){this.ctx=e,this.rangeBetweenBuffer=[0,0]}resolveMissingDataCount(e){let t=0;for(const i of this.ctx.values)t=Math.max(t,i.missing.get(e.id)??0);return t}resolveProcessedDataDefById(e,t){const i=this.ctx.scopeCache.get(e.id)?.get(t);if(!i)throw new Error(`AG Charts - didn't find property definition for [${t}
1, ${e.id}]`);return{index:i.index,def:i}}resolveProcessedDataIndexById(e,t){const i=this.ctx.scopeCache.get(e.id)?.get(t);if(!i)throw new Error(`AG Charts - didn't find property definition for [${t}, ${e.id}]`);return i.index}resolveKeysById(e,t,i){const n=this.resolveProcessedDataIndexById(e,t),s=i.keys[n];if(null==s)throw new Error(`AG Charts - didn't find keys for [${t}, ${e.id}]`);return s.get(e.id)}hasColumnById(e,t){return null!=this.ctx.scopeCache.get(e.id)?.get(t)}resolveColumnById(e,t,i,n){const s=this.resolveProcessedDataIndexById(e,t),a=i.columns?.[s];if(null==a)throw new Error(`AG Charts - didn't find column for [${t}, ${e.id}]`);return hr(e,t,n,i.columnValueType?.[s],this.ctx.logger),a}resolveColumnNeedsValueOf(e,t,i){const n=this.resolveProcessedDataIndexById(e,t);return i.columnNeedValueOf?.[n]??!0}resolveAbsoluteIndex(e,t){return e+t}getDomain(e,t,i,n){const s=this.getDomainsByType(i??"value",n);return s?.[this.resolveProcessedDataIndexById(e,t)]??[]}getDomainBetweenRange(e,t,[i,n],s){const a=t.map((t=>this.resolveProcessedDataIndexById(e,t))),o=s.input.count;if(i<=0&&n>=o){const e=s.domain.values;let t=1/0,i=-1/0;for(const n of a){const s=e[n];null!=s&&(s[0]<t&&(t=s[0]),s[1]>i&&(i=s[1]))}return this.rangeBetweenBuffer[0]=t,this.rangeBetweenBuffer[1]=i,this.rangeBetweenBuffer}const r=a.join(":"),l=s[wo],h=a.map((e=>s.columns[e]));let c=l.get(r);return null==c?(c=new or(h),l.set(r,c)):c.isDirty&&(c.rebuild(h),c.isDirty=!1),c.rangeBetween(i,n,this.rangeBetweenBuffer)}getSortOrder(e,t,i,s){const a=i.get(t);if(null==a||a.isDirty){const a=(0,n.ur2)(e),o={sortOrder:null!=a&&a!==e?rr(a,!1):rr(e,s)};return i.set(t,o),o.sortOrder}return a.sortOrder}getKeySortOrder(e,t,i){const n=this.resolveProcessedDataIndexById(e,t),s=i.keys[n]?.get(e.id);return s?this.getSortOrder(s,n,i[ko],!0):void 0}getKeySortEntry(e,t,i){const n=this.resolveProcessedDataIndexById(e,t),s=i[ko].get(n);return s?.isDirty?void 0:s}getColumnSortOrder(e,t,i){const n=this.resolveProcessedDataIndexById(e,t),s=i.columnNeedValueOf?.[n]??!0;return this.getSortOrder(i.columns[n],n,i[Do],s)}getDomainsByType(e,t){switch(e){case"key":return t.domain.keys;case"value":return t.domain.values;case"aggregate":return t.domain.aggValues;case"group-value-processor":return t.domain.groups;default:return null}}},dr=class{constructor(e){this.ctx=e}processScopeCache(){this.ctx.scopeCache.clear();for(const e of(0,n.nlf)(this.ctx.keys,this.ctx.values,this.ctx.aggregates))if(e.idsMap)for(const[t,i]of e.idsMap)for(const n of i)if(this.ctx.scopeCache.has(t)){if(this.ctx.scopeCache.get(t)?.has(n))throw new Error("duplicate definition ids on the same scope are not allowed.");this.ctx.scopeCache.get(t).set(n,e)}else this.ctx.scopeCache.set(t,new Map([[n,e]]))}valueGroupIdxLookup({matchGroupIds:e}){const t=[];for(const[i,n]of this.ctx.values.entries())(!e||n.groupId&&e.includes(n.groupId))&&t.pu
1sh(i);return t}valueIdxLookup(e,t){const i=null==e||0===e.length,n="string"==typeof t?t:t.id,s=this.ctx.values.reduce(((t,s,a)=>((null==s.scopes||i&&!s.scopes.length||s.scopes.some((t=>e?.includes(t))))&&(s.property===n||s.id===n||(t=>{if(t.idsMap)for(const[i,s]of t.idsMap)if(e?.includes(i)&&s.has(n))return!0;return!1})(s))&&t.push(a),t)),[]);if(0===s.length)throw new Error(`AG Charts - configuration error, unknown property ${JSON.stringify(t)} in scope(s) ${JSON.stringify(e)}`);return s}buildAccessors(e){const t=new Map;if(this.ctx.suppressFieldDotNotation)return t;for(const i of e){if(!(i.property.includes(".")||i.property.includes("[")))continue;const e=bo(i.property);if(null==e){this.ctx.logger.warnOnce("Invalid property path [%s]",i.property);continue}const n=vo(e);t.set(i.property,n)}return t}},ur=class{constructor(e,t,i="standalone",s=!1,a){this.opts=e,this.logger=t,this.mode=i,this.suppressFieldDotNotation=s,this.eventsHub=a,this.debug=n.yar.create(!0,"data-model"),this.scopeCache=new Map,this.keys=[],this.values=[],this.aggregates=[],this.groupProcessors=[],this.propertyProcessors=[],this.reducers=[],this.processors=[];let o=!0;for(const t of e.props){if("key"===t.type&&!o)throw new Error("AG Charts - internal config error: keys must come before values.");"value"===t.type&&o&&(o=!1)}const r=({matchGroupIds:e=[]})=>{for(const t of e)if(this.values.every((e=>e.groupId!==t)))throw new Error(`AG Charts - internal config error: matchGroupIds properties must match defined groups (${t}).`)},l=new Set,h=new Set;for(const t of e.props){const e="key"===t.type?l:h;if(mo(t)&&t.scopes)for(const i of t.scopes)e.add(i);switch(t.type){case"key":this.keys.push({...t,index:this.keys.length,missing:new Map});break;case"value":if(null==t.property)throw new Error(`AG Charts - internal config error: no properties specified for value definitions: ${JSON.stringify(t)}`);this.values.push({...t,index:this.values.length,missing:new Map});break;case"aggregate":r(t),this.aggregates.push({...t,index:this.aggregates.length});break;case"group-value-processor":r(t),this.groupProcessors.push({...t,index:this.groupProcessors.length});break;case"property-value-processor":this.propertyProcessors.push({...t,index:this.propertyProcessors.length});break;case"reducer":this.reducers.push({...t,index:this.reducers.length});break;case"processor":this.processors.push({...t,index:this.processors.length})}}if(this.opts.groupByKeys||null!=this.opts.groupByFn){const e=new Set(h.values());for(const t of l)e.delete(t);if(e.size>0)throw new Error(`AG Charts - scopes missing key for grouping, illegal configuration: ${[...e.values()]}`)}const c={keys:this.keys,values:this.values,aggregates:this.aggregates,groupProcessors:this.groupProcessors,propertyProcessors:this.propertyProcessors,reducers:this.reducers,processors:this.processors,debug:this.debug,logger:this.logger,mode:this.mode,bandingConfig:this.opts.domainBandingConfig,suppressFieldDotNotation:this.suppressFieldDotNotation,scopeCache:this.scopeCache};this.resolvers=new cr(c),this.scopeCacheManager=new dr(c),this.domainInitializer=new Mo(c),this.domainManager=new Bo(c,this.domainInitializer,this.scopeCacheManager),this.reducerManager=new sr(this.opts.domainBandingConfig),this.dataExtractor=new Uo(c,this.domainManager),this.dataGrouper=new Xo(c),this.aggregator=new So(c,this.scopeCacheManager,this.resolvers),this.incrementalProcessor=new ar(c,this.reducerManager)}resolveProcessedDataDefById(e,t){return this.resolvers.resolveProcessedDataDefById(e,t)}resolveProcessedDataIndexById(e,t){return this.resolvers.resolveProcessedDataIndexById(e,t)}resolveKeysById(e,t,i){return this.resolvers.resolveKeysById(e,t,i)}hasColumnById(e,t){return this.resolvers.hasColumnById(e,t)}resolveColumnById(e,t,i,n){return this.resolvers.resolveColumnById(e,t,i,n)}resolveColumnNeedsValueOf(e,t,i){return this.resolvers.resolveColumnNeedsValueOf(e,t,i)}resolveMissingDataCount(e){return this.resolvers.resolveMissingDataCount(e)}*forEachDatum(e,t,i,n){const s=t.columnScopes.findIndex((t=>t.has(e.id))),a=t.dataSources.get(e.id)?.data;for(const e of i.datumIndices[s]??[]){const t=this.resolvers.resolveAbsoluteIndex(n,e);yield a?.[t]}}getUniqueDataSets(e){return new Set(e.dataSources.values())}*forEachGroupDatum(e,t){const i=t.columnScopes.findIndex((t=>t.has(e.id))),n={groupIndex:0,columnIndex:i},s=[];for(const e of t.groups){n.group=e;for(const t of e.datumIndices[i]??s)n.datumIndex=this.resolvers.resolveAbsoluteIndex(n.groupIndex,t),yield n;n.groupIndex++}}getDomain(e,t,i,n){const s=this.resolvers.getDomain(e,t,i,n);if(s.length>0){if("key"===i){return{domain:s,sortMetadata:this.getKeySortMetadata(e,t,n)}}const a=this.getColumnSortOrder(e,t,n);if(null!=a)return{domain:s,sortMetadata:{sortOrder:a}}}return{domain:s}}getDomainBetweenRange(e,t,[i,n],s){return this.resolvers.getDomainBetweenRange(e,t,[i,n],s)}getKeySortOrder(e,t,i){return this.resolvers.getKeySortOrder(e,t,i)}getColumnSortOrder(e,t,i){return this.resolvers.getColumnSortOrder(e,t,i)}getKeySortMetadata(e,t,i){const n=this.resolvers.getKeySortEntry(e,t,i);if(null!=n?.sortOrder)return{sortOrder:n.sortOrder,isUnique:n.isUnique}}processData(e){const{opts:{groupByKeys:t,groupByFn:i},aggregates:n,groupProcessors:s,reducers:a,processors:o,propertyProcessors:r}=this,l=performance.now();if(t&&0===this.keys.length)return;let h=this.extractData(e);t?h=this.dataGrouper.groupData(h):i&&(h=this.dataGrouper.groupData(h,i(h))),s.length>0&&"grouped"===h.type&&this.aggregator.postProcessGroups(h),n.length>0&&"ungrouped"===h.type?this.aggregator.aggregateUngroupedData(h):n.length>0&&"grouped"===h.type&&this.aggregator.aggregateGroupedData(h),r.length>0&&this.postProcessProperties(h),a.length>0&&this.reduceData(h),o.length>0&&this.postProcessData(h),this.warnDataMissingProperties(e);const c=performance.now();return h.time=c-l,h.version+=1,this.collectOptimizationMetadata(h,"full-process"),this.debug.check()&&function(e,t){const i=(e,i)=>{i.length>0&&(t.log(`DataModel.processData() - ${e}`),t.table(i))};if(t.log("DataModel.processData() - processedData",e),i("Key Domains",e.domain.keys),i("Value Domains",e.domain.values),i("Aggregate Domains",e.domain.aggValues??[]),e.o
1ptimizations){t.log("DataModel.processData() - Optimization Summary");const i=e.optimizations;if(i.performance&&t.log(` Performance: ${i.performance.processingTime.toFixed(2)}ms (${i.performance.pathTaken})`),i.reprocessing){const e=i.reprocessing.applied?"â":"â",n=i.reprocessing.reason?` (${i.reprocessing.reason})`:"";t.log(` Reprocessing: ${e}${n}`)}if(i.domainBanding){const e=i.domainBanding.keyDefs.filter((e=>e.applied)),n=i.domainBanding.valueDefs.filter((e=>e.applied)),s=e.length+n.length,a=i.domainBanding.keyDefs.length+i.domainBanding.valueDefs.length;if(s>0){t.log(` Domain Banding: â (${s}/${a} definitions)`);for(const i of[...e,...n])if(i.stats){const e=(100*i.stats.scanRatio).toFixed(1);t.log(` ${i.property}: scanned ${i.stats.dirtyBands}/${i.stats.totalBands} bands (${e}%)`)}}else{const e=[...i.domainBanding.keyDefs.filter((e=>!e.applied)).map((e=>e.reason)),...i.domainBanding.valueDefs.filter((e=>!e.applied)).map((e=>e.reason))],n=[...new Set(e)].join(", ");t.log(` Domain Banding: â (${n})`)}}if(i.sharedDatumIndices){const e=i.sharedDatumIndices.applied?"â":"â",n=`${i.sharedDatumIndices.sharedGroupCount}/${i.sharedDatumIndices.totalGroupCount}`;t.log(` Shared DatumIndices: ${e} (${n} groups)`)}if(i.batchMerging){const e=(100*i.batchMerging.mergeRatio).toFixed(0),n=`${i.batchMerging.originalBatchCount} â ${i.batchMerging.mergedBatchCount}`;t.log(` Batch Merging: ${n} (${e}% reduction)`)}}}(h,this.logger),this.processScopeCache(),h}isReprocessingSupported(e){return this.incrementalProcessor.isReprocessingSupported(e)}reprocessData(e,t,i){if(!this.isReprocessingSupported(e)){this.debug.check()&&this.debug("Falling back to full reprocessing - incremental not supported for current configuration");const t=this.getUniqueDataSets(e);for(const e of t)e.commitPendingTransactions(i);return this.processData(e.dataSources)}const{getProcessValue:n}=this.initDataDomainProcessor("skip"),s=this.incrementalProcessor.reprocessData(e,t,n,this.reprocessGroupProcessors.bind(this),this.recomputeDomains.bind(this),this.collectOptimizationMetadata.bind(this),i),{diff:a}=s.reduced??{};return a&&this.eventsHub?.emit("datamodel:diff",{diff:a}),s}recomputeDomains(e){this.domainManager.recomputeDomains(e)}warnDataMissingProperties(e){this.dataExtractor.warnDataMissingProperties(e)}processScopeCache(){this.scopeCacheManager.processScopeCache()}valueGroupIdxLookup(e){return this.scopeCacheManager.valueGroupIdxLookup(e)}valueIdxLookup(e,t){return this.scopeCacheManager.valueIdxLookup(e,t)}extractData(e){return this.dataExtractor.extractData(e)}reprocessGroupProcessors(e,t){const{groupProcessors:i}=this,{columns:n}=e;for(const e of i)if(!e.supportsReprocessing)throw new Error("AG Charts - attempted to reprocess group processor that does not support reprocessing. This is an internal error that should not occur.");const s=fo(t);for(const t of i){const i=this.valueGroupIdxLookup(t),a=t.adjust()();for(const t of s){const{indexMap:s}=t;for(const t of s.spliceOps)if(t.insertCount>0)for(let s=0;s<t.insertCount;s++){const o=t.index+s;a(n,i,e.groups[o],o)}}}}postProcessProperties(e){for(const{adjust:t,property:i,scopes:n}of this.propertyProcessors)for(const s of this.valueIdxLookup(n,i))t()(e,s)}reduceData(e){e.reduced??(e.reduced={});for(const t of this.reducers)this.shouldUseReducerBanding(t,e)?e.reduced[t.property]=this.reduceWithBands(t,e):e.reduced[t.property]=this.reduceStandard(t,e)}shouldUseReducerBanding(e,t){return"ungrouped"===t.type&&!0===e.supportsBanding&&"function"==typeof e.combineResults}reduceWithBands(e,t){const i=this.reducerManager.evaluate(e,t,{reuseCleanBands:!1});return void 0===i?this.reduceStandard(e,t):i}reduceStandard(e,t){const i=e.reducer();if("grouped"===t.type){let n=e.initialValue;for(const e of t.groups)n=i(n,e.keys);return n}const s=mo(e)?e.scopes[0]:(0,n.$1N)(t.scopes);if(null==s)return e.initialValue;const a=t.dataSources.get(s)?.data??[],o=t.keys.map((e=>e.get(s))).filter((e=>null!=e)),r=o.map((()=>{}));return sr.evaluateRange(e,i,{rawData:a,keyColumns:o,keysParam:r},0,a.length)}postProcessData(e){e.reduced??(e.reduced={});for(const t of this.processors)e.reduced[t.property]=t.calculate(e,e.reduced[t.property]);const{diff:t}=e.reduced;t&&this.eventsHub?.emit("datamodel:diff",{diff:t})}initDataDomainProcessor(e){return this.domainManager.initDataDomainProcessor(e)}collectOptimizationMetadata(e,t){const i=e.optimizations?.domainBanding,s=e[Ao];this.reducers.length>0&&s&&this.collectReducerBandingMetadata(e,s);const a=e.optimizations?.reducerBanding;
1e.optimizations={performance:{processingTime:e.time,pathTaken:t},...i&&{domainBanding:i},...a&&{reducerBanding:a}};const o="reprocess"===t;let r;if(!this.isReprocessingSupported(e)){const t=[];if("grouped"===e.type){e.groupsUnique||t.push("groupsUnique=false");1!==this.getUniqueDataSets(e).size&&t.push("multiple data sources");const i=(0,n.$1N)(e.scopes),s=e.invalidKeys?.get(i);s?.some((e=>e))&&t.push("has invalid keys")}this.aggregates.length>0&&t.push("has aggregates"),this.reducers.some((e=>!e.supportsBanding))&&t.push("has reducers"),this.processors.some((e=>void 0===e.incrementalCalculate))&&t.push("has processors"),this.propertyProcessors.length>0&&t.push("has property processors"),r=t.length>0?t.join(", "):void 0}if(e.optimizations.reprocessing={applied:o,reason:r},"grouped"===e.type){let t=0;const i=e.groups[0];if(i){const n=i.datumIndices;for(const i of e.groups)i.datumIndices===n&&t++}e.optimizations.sharedDatumIndices={applied:t>0,sharedGroupCount:t,totalGroupCount:e.groups.length}}}collectReducerBandingMetadata(e,t){if(0===this.reducers.length)return;e.optimizations??(e.optimizations={});const i=[];for(const n of this.reducers){const s=t.get(n.property),a=this.shouldUseReducerBanding(n,e)&&null!=s;let o,r;a||(o=!0!==n.supportsBanding?"reducer does not support banding":"ungrouped"!==e.type?"grouped data not supported":void 0===n.combineResults?"missing combineResults function":"banding not applied"),a&&s&&(r=s.getStats()),i.push({property:String(n.property),applied:a,reason:o,stats:r})}e.optimizations.reducerBanding={reducers:i}}buildAccessors(e){return this.scopeCacheManager.buildAccessors(e)}};function pr(e,t,i){let s;for(const t of e)(0,n.kuK)(t)&&(s=null==s?t:i(s,t));return s??t}function gr(e){return e.input.count<=1e3}function mr(e){return null!=e&&(0,n.QQF)(e)}function yr(e,t,i,s){return null!=e&&(!(!(0,n.QQF)(e)&&!(0,n.p1d)(e))||("string"==typeof e&&s.warnOnce(`unsupported value [${e}
1] at row ${i??"?"} on a time axis; expected Date, epoch number/bigint, or strict ISO 8601 string (e.g. '2024-01-15', '2024-01-15T10:30:00Z'). The value is ignored.`),!1))}function fr(e){return null!=e}function xr(e){return!0}function br(e,t){switch(e){case"time":case"unit-time":case"ordinal-time":return yr;case"number":case"log":case"color":return mr;default:return t?xr:fr}}function vr(e){switch(e){case"number":case"log":case"time":case"color":return"range";default:return"category"}}function Sr(e){return"time"===e||"unit-time"===e||"ordinal-time"===e}function Mr(e,t,i={}){const n=i.allowNullKey??!1;return{property:e,type:"key",valueType:vr(t),timeDomain:Sr(t),validation:i.validation??br(t,n),...i}}function kr(e,t,i={}){const n=i.allowNullKey??!1;return{property:e,type:"value",valueType:vr(t),timeDomain:Sr(t),validation:i.validation??br(t,n),...i}}var Dr=function(e){return e};function wr(...e){const t=e.filter((e=>null!=e));return 0===t.length?()=>Dr:1===t.length?t[0]:function(){const e=t.map((e=>e()));return function(t,i){return e.reduce(((e,t)=>t(e,i)),t)}}}function Ir(e,t,i={}){const{onlyPositive:n,processor:s,...a}=i;return{...kr(e,t,a),processor:wr(s,oo(n))}}function Ar(e,t,i={}){return{...kr(e,t,i),processor:()=>{let e=0;return t=>{if("bigint"!=typeof t&&!(0,n.BfI)(t))return t;"bigint"==typeof t&&"bigint"!=typeof e&&(e=0n);const i=e;return e=so(e,t),i}}}}function Cr(e,t,i,n){return[kr(e,n,i),Gr(i.groupId,t,i.separateNegative),...null==i.rangeId?[]:[(s=i.rangeId,a=i.groupId,{id:s,matchGroupIds:[a],type:"aggregate",aggregateFunction:e=>io.extendDomain(e)})]];var s,a}function Nr(e){if("bigint"==typeof e)return e;if((0,n.p1d)(e))return(0,n.Hre)(e);const t=Number(e);return Number.isFinite(t)?t:void 0}function Lr(e,t){return(0,n.IbQ)((0,n.Vz0)(e,t))}var Pr={type:"reducer",property:"smallestKeyInterval",initialValue:1/0,reducer(){let e;return function(t,i){const n=Nr(i[0]),s=t??1/0;if(null==n)return s;const a=null==e?void 0:Lr(n,e);return e=n,null!=a&&a>0&&a<s?a:s}},supportsBanding:!0,combineResults:e=>pr(e,1/0,n.Wwf),needsOverlap:!0},Tr={type:"reducer",property:"largestKeyInterval",initialValue:-1/0,reducer(){let e;return function(t,i){const n=Nr(i[0]),s=t??-1/0;if(null==n)return s;const a=null==e?void 0:Lr(n,e);return e=n,null!=a&&a>0&&a>s?a:s}},supportsBanding:!0,combineResults:e=>pr(e,-1/0,n.cGV),needsOverlap:!0};function Or(e,t){return"bigint"==typeof e||"bigint"==typeof t?e<t?-1:e>t?1:0:e-t}var Rr={type:"processor",property:"sortedGroupDomain",calculate:function({domain:{groups:e}}){return e?.slice().sort(((e,t)=>{for(let i=0;i<e.length;i++){const n=Or(e[i],t[i]);if(0!==n)return n}return 0}))}};function Er({normaliseTo:e}){const t=(t,i)=>{if(0===i)return 0;const n=Number(t??0)*e/i;return n>=0?Math.min(e,n):Math.max(-e,n)};return()=>()=>(e,i,n,s)=>{const a=function(e,t,i,n){const s=[0,0];for(const a of t){const t=e[a],o=i.datumIndices[a];if(null!=o)for(const e of o){const i=t[n+e];if(null==i)continue;let a;a="number"==typeof i?i:"bigint"==typeof i?Number(i):Math.max(...i.map((e=>Number(e??0))));const o=a<0?0:1;s[o]=0===o?Math.min(s[o],a):Math.max(s[o],a)}}return Math.max(Math.abs(s[0]),s[1])}(e,i,n,s);for(const o of i){const i=n.datumIndices[o];if(null!=i)for(const n of i){const i=s+n,r=e[o],l=r[i];null!=l?r[i]=t(l,a):r[i]=void 0}}}}function zr(e,t){return{type:"group-value-processor",matchGroupIds:e,adjust:(0,n.ph$)({normaliseTo:t},Er)}}function Br({normaliseTo:e,zeroDomain:t,rangeMin:i,rangeMax:s}){const a=e[1]-e[0],o=function(i,n,s){const o=e[0]+(i-n)/s*a;return 0===s?t:o>=e[1]?e[1]:o<e[0]?e[0]:o};return function(){return function(t,a){let[r,l]=t.domain.values[a];null!=i&&(r=i),null!=s&&(l=s);const h=(0,n.cS7)(r),c=(0,n.cS7)(l)-h;t.domain.values[a]=[e[0],e[1]];const d=t.columns[a];for(let e=0;e<d.length;e+=1)d[e]=o((0,n.cS7)(d[e]),h,c)}}}function Fr(e,t,i,s,a){return{type:"property-value-processor",property:e,adjust:(0,n.ph$)({normaliseTo:t,rangeMin:s,rangeMax:a,zeroDomain:i},Br)}}function Vr([e,t,i]){return function(s,a){if(!0===a)return!0;const o=s.defs.values.findIndex((i=>i.scopes.includes(e)&&i.id===t)),r=s.defs.values.findIndex((t=>t.scopes.includes(e)&&t.id===i)),l=s.columns[o],h=s.columns[r];if(l.length!==h.length)return!0;for(let e=0;e<l.length;e++)if((0,n.IbQ)(h[e])>(0,n.IbQ)(l[e]))return!0;return!1}}function $r(e,t,i){let n=3;if("category"===e.valueType)return t.length<i.length&&(n&=-2),n;let s=null==i[0]?void 0:Nr(i[0]);for(let e=1;0!==n&&e<i.length;e++){const t=null==i[e]?void 0:Nr(i[e]);(void 0===t||void 0!==s&&s>t)&&(n&=-3),void 0!==t&&s===t&&(n&=-2),s=t}return n}function Hr(e){return function(t,i){if(!gr(t))return;const{keys:n,values:s}=t.defs,{input:a,domain:{values:o},columns:r}=t;let l=!0,h=!0;if(0!==a.count){const i=t[ko];for(let e=0;(l||h)&&e<n.length;e++){const s=n[e],a=i.get(e);if("category"===s.valueType){(t.domain.keys[e]?.length??0)<(t.keys[e]?.values().next().value?.length??0)&&(l=!1)}else a&&(!1===a.isUnique&&(l=!1),1!==a.sortOrder&&(h=!1))}if(e&&e.length>0){let t=3;for(let i=0;0!==t&&i<s.length;i++){const n=s[i];
1e.includes(n.id)&&(t&=$r(n,o[i],r[i]))}1&t||(l=!1),2&t||(h=!1)}}return{uniqueKeys:l,orderedKeys:h}}}function jr(){return{uniqueKeys:!0,orderedKeys:!1}}function Wr(e){return{type:"processor",property:"animationValidation",calculate:(0,n.ph$)(e,Hr),incrementalCalculate:jr}}function _r({mode:e,separateNegative:t}){return function(){return function(){return function(i,s,a,o){const r=[0,0];for(const l of s){const s=a.datumIndices[l];if(null==s)continue;const h=r[0],c=r[1],d=i[l];let u=!1;for(const i of s){const s=o+i,a=d[s],l="bigint"==typeof a;if(!l&&!(0,n.BfI)(a))continue;const p=t&&(l?a<0n:(0,n.cIo)(a)),g=p?h:c;if(d[s]="normal"===e?so(g,a):g,!u){r[p?0:1]=so(g,a),u=!0}}}}}}}function Gr(e,t,i=!1){return{type:"group-value-processor",matchGroupIds:[e],adjust:(0,n.ph$)({mode:t,separateNegative:i},_r),supportsReprocessing:!0}}function Kr(e){return e.id??e.property}function Yr(e,t,i,n,s){for(const{previousIndex:a,nextIndex:o}of i){const i=e[a],r=t[o];if(i[n]!==r[s])return!1}return!0}function Ur(e,t,i=!0){return{type:"processor",property:"diff",calculate(n,s){if(!gr(n))return{...s,[e]:{changed:!0,added:new Set,updated:new Set,removed:new Set,moved:new Set}};const a=new Map,o=new Map,r=new Map,l=new Map,h=t.keys.map((t=>t.get(e))),c=n.keys.map((t=>t.get(e))),d=t.columns,u=n.columns,p=function(e,t,i){const n=new Map,s=t.defs.values;for(let t=0;t<s.length;t+=1){const i=s[t];if(!1===i.scopes?.includes(e))continue;const a=Kr(i);if(n.has(a))return;n.set(a,t)}const a=[],o=i.defs.values;for(let t=0;t<o.length;t+=1){const i=o[t];if(!1===i.scopes?.includes(e))continue;const s=Kr(i),r=n.get(s);if(null==r)return;n.delete(s),a.push({previousIndex:r,nextIndex:t})}if(0===n.size)return a}(e,t,n);if(null==p)return s;const g=Math.max(t.input.count,n.input.count),m=n.defs.keys.some((e=>!0===e.allowNullKey));for(let e=0;e<g;e++){const s=e<t.input.count,g=e<n.input.count,y=s?xo(h,e,m):void 0,f=null==y?"":Xr(...y),x=g?xo(c,e,m):void 0,b=null==x?"":Xr(...x);if(g&&s&&f===b){Yr(d,u,p,e,e)||r.set(b,e);continue}const v=l.get(b);null!=v?(!i&&Yr(d,u,p,v,e)||(r.set(b,e),a.set(b,e)),l.delete(b)):g&&o.set(b,e);const S=o.get(f);null!=S?(!i&&Yr(d,u,p,S,e)||(r.set(f,e),a.set(f,e)),o.delete(f)):s&&(r.delete(f),l.set(f,e))}const y={changed:o.size>0||r.size>0||l.size>0,added:new Set(o.keys()),updated:new Set(r.keys()),removed:new Set(l.keys()),moved:new Set(a.keys())};return{...s,[e]:y}}}}function Xr(...e){if(1===e.length){const t=(0,n.vq9)(e[0]);if(null===t)return ro;if(void 0===t)return lo;if("boolean"==typeof t||"number"==typeof t||"string"==typeof t)return t}return e.map((e=>{const t=(0,n.vq9)(e);return null===t?ro:void 0===t?lo:t})).join("___")}var Zr=class{constructor(e,t){this.maxAnimationTime=e,this.logger=t,this.debug=n.yar.create(!0,"animation"),this.controllers=new Map,this.stoppedCbs=new Set,this.currentPhase=0,this.phases=new Map(Ga.map((e=>[e,[]]))),this.skipAnimations=!1,this.animationTimeConsumed=0,this.isReady=!1}get size(){return this.controllers.size}get consumedTimeMs(){return this.animationTimeConsumed}isActive(){return this.controllers.size>0}getActiveControllers(){return this.phases.get(Ga[this.currentPhase])??[]}checkOverlappingId(e){null!=e&&this.controllers.has(e)&&(this.controllers.get(e).stop(),this.debug(`Skipping animation batch due to update of existing animation: ${e}`),this.skip())}addAnimation(e){if(e.isComplete)return;if(Ga.indexOf(e.phase)<this.currentPhase)return this.debug("Skipping animation due to being for an earlier phase",e.id),void e.stop();this.controllers.set(e.id,e),this.phases.get(e.phase)?.push(e)}removeAnimation(e){this.controllers.delete(e.id);const t=this.phases.get(e.phase),i=t?.indexOf(e);null!=i&&i>=0&&t?.splice(i,1)}progress(e){if(!this.isReady)return;let t=0===e?.01:e;const i=()=>{const e=Ga[this.currentPhase];return{phaseControllers:[...this.getActiveControllers()],phase:e,phaseMeta:Ka[e]}};let{phase:n,phaseControllers:s,phaseMeta:a}=i();const o=()=>null==Ga[this.currentPhase],r=()=>{for(({phase:n,phaseControllers:s,phaseMeta:a}=i());!o()&&0===s.length;)this.currentPhase++,({phase:n,phaseControllers:s,phaseMeta:a}=i()),this.debug(`AnimationBatch - phase changing to ${n}`,{unusedTime:t},s)},l=this.controllers.size;this.debug(`AnimationBatch - ${e}ms; phase ${n} with ${s?.length} of ${l}`);do{const e=t,i=a.skipIfNoEarlierAnimations&&0===this.animationTimeConsumed;let n=0;for(const a of s)i?a.stop():t=Math.min(a.update(e),t),a.isComplete&&(n++,this.removeAnimation(a));this.animationTimeConsumed+=e-t,this.debug(`AnimationBatch - updated ${s.length} controllers; ${n} completed`,s),this.debug(`AnimationBatch - animationTimeConsumed: ${this.animationTimeConsumed}`),r()}while(t>0&&!o());this.animationTimeConsumed>this.maxAnimationTime&&(this.debug("Animation batch exceeded max animation time, skipping",[...this.controllers]),this.stop())}ready(){if(this.isReady)return;this.isReady=!0,this.debug(`AnimationBatch - ready; skipped: ${this.skipAnimations}`,[...this.controllers]);let e=!0;for(const[,t]of this.controllers)if(t.duration>0&&!0!==Ka[t.phase].skipIfNoEarlierAnimations){e=!1;break}if(!e)for(const[,e]of this.controllers)e.autoplay&&e.play(!0)}skip(e=!0){if(!1===this.skipAnimations&&!0===e){for(const e of this.controllers.values())e.stop();this.controllers.clear()}this.skipAnimations=e}play(){for(const e of this.controllers.values())e.play()}stop(){for(const e of this.controllers.values())try{e.stop(),this.removeAnimation(e)}catch(e){this.logger.error("Error during animation stop",e)}this.dispatchStopped()}stopByAnimationId(e){if(null!=e&&this.controllers.has(e)){const t=this.controllers.get(e);t&&(t.stop(),this.removeAnimation(t))}}stopByAnimationGroupId(e){for(const t of this.controllers.values())t.groupId===e&&this.stopByAnimationId(t.id)}dispatchStopped(){for(const e of this.stoppedCbs)e();this.stoppedCbs.clear()}isSkipped(){return this.skipAnimations}getRemainingTime(e){if(!this.isActive())return 0;let t=0;for(const[i,n]of this.phases)0!==n.length&&(null!=e&&e!==i||(t+=Math.max(...n.map((e=>e.isComplete?0:e.delay+e.duration-(e.elapsed??0))))));return t}destroy(){this.stop(),this.controllers.clear()}};function qr(e){return null==e||!Number.isNaN(e)&&e>=0&&e<=2}var Qr=class{constructor(e,t,i,s){this.agDocument=e,this.interactionManager=t,this.chartUpdateMutex=i,this.logger=s,this.defaultDuration=1e3,this.maxAnimatableItems=1e3,this.debug=n.yar.create(!0,"animation"),this.events=new n.bkB,this.rafAvailable="undefined"!=typeof requestAnimationFrame,this.isPlaying=!0,this.requestId=null,this.skipAnimations=!0,this.currentAnonymousAnimationId=0,this.cumulativeAnimationTime=0,this.batch=new Zr(1.5*this.defaultDuration,this.logger)}addListener(e,t){return this.events.on(e,t)}animate(e){const t=this.batch;try{t.checkOverlappingId(e.id)}catch(e){return void this.failsafeOnError(e)}let{id:i}=e;null==i&&(i=`__${this.currentAnonymousAnimationId}`,this.currentAnonymousAnimationId+=1);const n=this.isSkipped()&&!e.forceAnimation||"none"===e.phase;n&&this.debug("AnimationManager - skipping animation");const{delay:s,duration:a}=e;if(!qr(s))throw new Error(`Animation delay of ${s} is unsupported (${i})`);
1if(!qr(a))throw new Error(`Animation duration of ${a} is unsupported (${i})`);const o=new Xa({...e,id:i,skip:n,autoplay:!!this.isPlaying&&e.autoplay,phase:e.phase,defaultDuration:this.defaultDuration});if(!this.forceTimeJump(o,this.defaultDuration))return this.batch.addAnimation(o),o}play(){if(!this.isPlaying){this.isPlaying=!0,this.debug("AnimationManager.play()");try{this.batch.play()}catch(e){this.failsafeOnError(e)}this.requestAnimation()}}stop(){this.isPlaying=!1,this.cancelAnimation(),this.debug("AnimationManager.stop()"),this.batch.stop()}stopByAnimationId(e){try{this.batch.stopByAnimationId(e)}catch(e){this.failsafeOnError(e)}}stopByAnimationGroupId(e){try{this.batch.stopByAnimationGroupId(e)}catch(e){this.failsafeOnError(e)}}reset(){this.isPlaying?(this.stop(),this.play()):this.stop()}skip(e=!0){this.skipAnimations=e}isSkipped(){return!this.rafAvailable||this.skipAnimations||this.batch.isSkipped()}isActive(){return this.isPlaying&&this.batch.isActive()}getRemainingTime(e){return this.batch.getRemainingTime(e)}getCumulativeAnimationTime(){return this.cumulativeAnimationTime}skipCurrentBatch(){this.debug.check()&&this.debug("AnimationManager - skipCurrentBatch()",{stack:new Error("Stack trace for animation skip tracking").stack}),this.batch.skip()}isSkippingFrames(){return!0}scheduleAnimationFrame(e){this.requestId=this.agDocument.requestAnimationFrame((t=>{e(t).catch((e=>this.logger.error(e)))}))}forceTimeJump(e,t){return!1}requestAnimation(){if(!this.rafAvailable)return;if(!this.batch.isActive()||null!==this.requestId)return;let e;const t=async i=>{await this.debug.group("AnimationManager.onAnimationFrame()",(async()=>{const n=()=>{const t=i-(e??i);e=i,this.debug("AnimationManager",{controllersCount:this.batch.size,deltaTime:t}),this.interactionManager.pushState(4);try{this.batch.progress(t),this.cumulativeAnimationTime+=t}catch(e){this.failsafeOnError(e)}this.events.emit("animation-frame",{type:"animation-frame",deltaMs:t})};this.isSkippingFrames()?await this.chartUpdateMutex.acquireImmediately(n):await this.chartUpdateMutex.acquire(n),this.batch.isActive()?this.scheduleAnimationFrame(t):(this.batch.stop(),this.events.emit("animation-stop",{type:"animation-stop",deltaMs:this.batch.consumedTimeMs}))}))};this.events.emit("animation-start",{type:"animation-start",deltaMs:0}),this.scheduleAnimationFrame(t)}cancelAnimation(){null!==this.requestId&&(this.agDocument.cancelAnimationFrame(this.requestId),this.events.emit("animation-stop",{type:"animation-stop",deltaMs:this.batch.consumedTimeMs}),this.requestId=null,this.startBatch())}failsafeOnError(e,t=!0){this.logger.error("Error during animation, skipping animations",e),t&&this.cancelAnimation()}startBatch(e){this.debug(`AnimationManager - startBatch() with skipAnimations=${e}.`),this.reset(),this.batch.destroy(),this.batch=new Zr(1.5*this.defaultDuration,this.logger),!0===e&&this.batch.skip()}endBatch(){this.batch.isActive()?(this.batch.ready(),this.requestAnimation()):(this.interactionManager.popState(4),this.batch.isSkipped()&&this.batch.skip(!1))}onBatchStop(e){this.batch.stoppedCbs.add(e)}destroy(){this.stop(),this.events.clear()}},Jr=class{constructor(e,t){this.eventsHub=e,this.chartService=t,this.mementoOriginatorKey="collapsed",this.collapsedIds=new Set,this.getDatum={}}createMemento(){return Array.from(this.collapsedIds)}guardMemento(e){return null==e||Array.isArray(e)}restoreMemento(e,t,i){if(i){const e=Object.keys(this.getDatum).at(0);this.collapse(i,e,"api-call")}this.eventsHub.emit("collapsed:restore",{collapsed:this.createMemento()})}setSeriesGetDatumCallback(e,t){return this.getDatum[e]=t,()=>{delete this.getDatum[e]}}collapse(e,t,i){let n=!1;const s=new Set,a=[],o=[];for(const t of e){const e=!this.collapsedIds.has(t);e&&a.push(t),n||(n=e),s.add(t)}for(const e of this.collapsedIds){const t=!s.has(e);t&&o.push(e),n||(n=t)}return!this.callListener(a,o,t,i)&&this.applyChange(s,n)}collapseAppend(e,t,i){let n=!1;const s=new Set(this.collapsedIds),a=[];for(const t of e){const e=!s.has(t);e&&a.push(t),n||(n=e),s.add(t)}return!this.callListener(a,[],t,i)&&this.applyChange(s,n)}
1expand(e,t,i){let n=!1;const s=new Set(this.collapsedIds),a=[];for(const t of e){const e=s.has(t);e&&a.push(t),n||(n=e),s.delete(t)}return!this.callListener([],a,t,i)&&this.applyChange(s,n)}isCollapsed(e){return this.collapsedIds.has(e)}callListener(e,t,i,n){if(0===e.length&&0===t.length)return;let s=!1;const a=i?this.getDatum[i]:void 0;return this.chartService.callListener({type:"collapsedChange",source:n,get defaultPrevented(){return s},preventDefault:()=>{s=!0},collapsed:e.map((e=>({itemId:e,datum:a?a(e):null}))),expanded:t.map((e=>({itemId:e,datum:a?a(e):null})))}),s}applyChange(e,t){return!!t&&(this.collapsedIds=e,this.eventsHub.emit("collapsed:change",null),!0)}},el=(()=>{var e=class e{constructor(e){this.ctx=e,this.highlightStates=new Kt,this.highlightParts=new Map,this.pendingUnhighlights=new Map,this.unhighlightDelay=100,this.highlightInViewport=!0}updateHighlight(e,t,i=!1,n,s){const a=this.getActiveHighlight(),o=this.getActiveHighlightPart();if(null==t&&i&&this.unhighlightDelay>0){if(!this.pendingUnhighlights.has(e)){const t=Ve((()=>{this.applyPendingUnhighlight(e)}));this.pendingUnhighlights.set(e,{scheduler:t}),t.schedule(this.unhighlightDelay)}return}const r=this.pendingUnhighlights.get(e);r&&(r.scheduler.cancel(),this.pendingUnhighlights.delete(e)),t?this.highlightStates.set(e,t):this.highlightStates.delete(e),t&&null!=s?this.highlightParts.set(e,s):this.highlightParts.delete(e),this.maybeEmitChange(e,a,n,o)}maybeEmitChange(t,i,n,s){const a=this.getActiveHighlight(),o=this.getActiveHighlightPart(),r=!this.isEqual(a,i)||o!==s,l=n??(!!r||this.highlightInViewport);if(r||this.highlightInViewport!==l){const n=!1===a?.series?.isHighlightEnabled();this.highlightInViewport=l,this.ctx.chartState.setValue("highlight",a),this.ctx.eventsHub.emit(e.HIGHLIGHT_CHANGE_EVENT,{callerId:t,currentHighlight:a,previousHighlight:i,currentHighlightPart:o,previousHighlightPart:s,highlightSuppressed:n,highlightInViewport:l})}}applyPendingUnhighlight(e){if(!this.pendingUnhighlights.has(e))return;this.pendingUnhighlights.delete(e);const t=this.getActiveHighlight(),i=this.getActiveHighlightPart();this.highlightStates.delete(e),this.highlightParts.delete(e),this.maybeEmitChange(e,t,!0,i)}getActiveHighlight(){return this.highlightStates.stateValue()}getActiveHighlightPart(){const e=this.highlightStates.stateId();return null==e?void 0:this.highlightParts.get(e)}destroy(){for(const{scheduler:e}of this.pendingUnhighlights.values())e.cancel();this.pendingUnhighlights.clear(),this.highlightParts.clear()}isEqual(e,t){return e===t||null!=e&&e.series===t?.series&&this.idsMatch(e,t)&&this.pointsMatch(e,t)&&e.datum===t.datum}idsMatch(e,t){return null!=e.itemId&&null!=t.itemId&&e.itemId===t.itemId||null!=e.datumIndex&&null!=t.datumIndex&&(0,n.DH9)(e.datumIndex,t.datumIndex)}pointsMatch(e,t){return this.pointsAreEqual(e.point,t.point)&&this.pointsAreEqual(e.midPoint,t.midPoint)&&this.pointsAreEqual(e.xBar?.lowerPoint,t.xBar?.lowerPoint)&&this.pointsAreEqual(e.xBar?.upperPoint,t.xBar?.upperPoint)&&this.pointsAreEqual(e.yBar?.lowerPoint,t.yBar?.lowerPoint)&&this.pointsAreEqual(e.yBar?.upperPoint,t.yBar?.upperPoint)}pointsAreEqual(e,t){return e===t||void 0!==e&&e.x===t?.x&&e.y===t.y}};return e.HIGHLIGHT_CHANGE_EVENT="highlight:change",e})(),tl=(e=>(e[e.None=0]="None",e[e.Item=1]="Item",e[e.Series=2]="Series",e[e.OtherSeries=3]="OtherSeries",e[e.OtherItem=4]="OtherItem",e))(tl||{}),il=(e=>(e[e.None=0]="None",e[e.Item=1]="Item",e[e.OtherItem=2]="OtherItem",e[e.OtherSeries=3]="OtherSeries",e))(il||{}),nl=[0,1,2,3,4];function sl(e){switch(e){case 1:return"highlighted-item";case 4:return"unhighlighted-item";case 2:return"highlighted-series";case 3:return"unhighlighted-series";case 0:return"none";default:return e}}function al(e){switch(e){case 1:return"selected-item";case 2:return"unselected-item";case 3:return"unselected-series";case 0:return"none";case void 0:return;default:return e}}function ol(e){return void 0===e||0===e||2===e||3===e}function rl(e,t){return 1===e||1===t?1:void 0!==(i=t)&&0!==i?t:e;var i}var ll=(()=>{var e=class extends n.XPE{constructor(){super(...arguments),this.enabled=!0,this.range="tooltip",this.bringToFront=!0,this.highlightedItem={},this.unhighlightedItem={},this.highlightedSeries={},this.unhighlightedSeries={}}getStyle(e){const t=function(e){switch(e){case 1:return["highlightedItem","highlightedSeries"];case 4:return["unhighlightedItem","highlightedSeries"];case 2:return["highlightedSeries"];case 3:return["unhighlightedSeries"];case 0:return[]}}(e);return 0===t.length?{}:(0,n.HFk)(...t.map((e=>this[e])))}};return d([n.mAP],e.prototype,"enabled",2),d([n.mAP],e.prototype,"range",2),d([n.mAP],e.prototype,"bringToFront",2),d([n.mAP],e.prototype,"highlightedItem",2),d([n.mAP],e.prototype,"unhighlightedItem",2),d([n.mAP],e.prototype,"highlightedSeries",2),d([n.mAP],e.prototype,"unhighlightedSeries",2),e})(),hl=(()=>{var e=class extends n.XPE{constructor(){super(...arguments),this.enabled=!1,this.containment="any",this.selectedItem={},this.unselectedItem={},this.unselectedSeries={},this.selectedOffset=0}getStyle(e){const t=function(e){switch(e){case 1:return["selectedItem"];case 2:return["unselectedItem"];case 3:return["unselectedSeries"];case 0:return[];default:return e}}(e);return 0===t.length?{}:(0,n.HFk)(...t.map((e=>this[e])))}};return d([n.mAP],e.prototype,"enabled",2),d([n.mAP],e.prototype,"containment",2),d([n.mAP],e.prototype,"selectedItem",2),d([n.mAP],e.prototype,"unselectedItem",2),d([n.mAP],e.prototype,"unselectedSeries",2),d([n.mAP],e.prototype,"selectedOffset",2),e})(),cl=(()=>{var e=class extends n.XPE{constructor(){super(...arguments),this.fill="#c16068",this.fillOpacity=1,this.stroke="#874349",this.strokeWidth=2,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0}};return d([n.mAP],e.prototype,"start",2),d([n.mAP],e.prototype,"stop",2),d([n.mAP],e.prototype,"fill",2),d([n.mAP],e.prototype,"fillOpacity",2),d([n.mAP],e.prototype,"stroke",2),d([n.mAP],e.prototype,"strokeWidth",2),d([n.mAP],e.prototype,"strokeOpacity",2),d([n.mAP],e.prototype,"lineDash",2),d([n.mAP],e.prototype,"lineDashOffset",2),e})(),dl=(()=>{var e=class{constructor(){this.key="x",this.segments=new n.F_c(cl)}};return d([n.mAP],e.prototype,"enabled",2),d([n.mAP],e.prototype,"key",2),d([n.mAP],e.prototype,"segments",2),e})(),ul=(()=>{var e=class extends n.XPE{constructor(){super(...arguments),this.type="gradient",this.colorStops=[],this.bounds="item",this.gradient="linear",this.rotation=0,this.reverse=!1,this.colorSpace
1="rgb"}};return d([n.mAP],e.prototype,"type",2),d([n.mAP],e.prototype,"colorStops",2),d([n.mAP],e.prototype,"bounds",2),d([n.mAP],e.prototype,"gradient",2),d([n.mAP],e.prototype,"rotation",2),d([n.mAP],e.prototype,"reverse",2),d([n.mAP],e.prototype,"colorSpace",2),e})(),pl=(()=>{var e=class extends n.XPE{constructor(){super(...arguments),this.type="pattern",this.colorStops=[],this.bounds="item",this.gradient="linear",this.rotation=0,this.scale=1,this.reverse=!1,this.pattern="forward-slanted-lines",this.width=26,this.height=26,this.padding=6,this.fill="black",this.fillOpacity=1,this.backgroundFill="white",this.backgroundFillOpacity=1,this.stroke="black",this.strokeOpacity=1,this.strokeWidth=0}};return d([n.mAP],e.prototype,"type",2),d([n.mAP],e.prototype,"colorStops",2),d([n.mAP],e.prototype,"bounds",2),d([n.mAP],e.prototype,"gradient",2),d([n.mAP],e.prototype,"rotation",2),d([n.mAP],e.prototype,"scale",2),d([n.mAP],e.prototype,"reverse",2),d([n.mAP],e.prototype,"path",2),d([n.mAP],e.prototype,"pattern",2),d([n.mAP],e.prototype,"width",2),d([n.mAP],e.prototype,"height",2),d([n.mAP],e.prototype,"padding",2),d([n.mAP],e.prototype,"fill",2),d([n.mAP],e.prototype,"fillOpacity",2),d([n.mAP],e.prototype,"backgroundFill",2),d([n.mAP],e.prototype,"backgroundFillOpacity",2),d([n.mAP],e.prototype,"stroke",2),d([n.mAP],e.prototype,"strokeOpacity",2),d([n.mAP],e.prototype,"strokeWidth",2),e})(),gl=(()=>{var e=class extends n.XPE{constructor(){super(...arguments),this.type="image",this.url="",this.rotation=0,this.scale=1,this.backgroundFill="black",this.backgroundFillOpacity=1,this.repeat="no-repeat",this.fit="contain"}};return d([n.mAP],e.prototype,"type",2),d([n.mAP],e.prototype,"url",2),d([n.mAP],e.prototype,"rotation",2),d([n.mAP],e.prototype,"scale",2),d([n.mAP],e.prototype,"backgroundFill",2),d([n.mAP],e.prototype,"backgroundFillOpacity",2),d([n.mAP],e.prototype,"repeat",2),d([n.mAP],e.prototype,"fit",2),e})(),ml=(()=>{var e=class extends n.XPE{constructor(){super(...arguments),this.visible=!0,this.focusPriority=1/0,this.showInLegend=!0,this.cursor="default",this.nodeClickRange="exact",this.highlight=new ll,this.selection=new hl}handleUnknownProperties(e,t){"context"in t&&(this.context=t.context,e.delete("context")),"allowNullKeys"in t&&(this.allowNullKeys=t.allowNullKeys,e.delete("allowNullKeys"))}};return d([n.mAP],e.prototype,"id",2),d([n.mAP],e.prototype,"visible",2),d([n.mAP],e.prototype,"focusPriority",2),d([n.mAP],e.prototype,"showInLegend",2),d([n.mAP],e.prototype,"cursor",2),d([n.mAP],e.prototype,"nodeClickRange",2),d([n.mAP],e.prototype,"listeners",2),d([n.mAP],e.prototype,"highlight",2),d([n.mAP],e.prototype,"selection",2),e})();function yl(e){const t=e?.datumIndex;return"number"==typeof t&&!Number.isNaN(t)}function fl(e,t){if(0===t.length)return[!1,!1];const i=t[0],n=t.at(-1);if("string"==typeof i||null==i)return[e===i,e===n];if(null==e)return[!1,!1];const s=e.valueOf();if(null==i||null==n)return[!1,!1];let a=i.valueOf(),o=n.valueOf();return a>o&&([a,o]=[o,a]),[s===a,s===o]}function xl(e,t,i,n,s,a){const[o,r]=fl(t,a),[l,h]=fl(e,s);return{xKey:i,yKey:n,xValue:e,yValue:t,first:l,last:h,min:o,max:r}}function bl(e,t,[i,s],a){let o=(0,n.S3I)(0,t-1,(n=>{const s=1===e?n:t-n,o=a(s)?.[1]??Number.NaN;return!Number.isFinite(o)||o>=i}))??0,r=(0,n.I5B)(0,t-1,(i=>{const n=1===e?i:t-i,o=a(n)?.[0]??Number.NaN;return!Number.isFinite(o)||o<=s}))??t-1;return-1===e&&([o,r]=[t-r,t-o]),o=Math.max(o,0),r=Math.min(r+1,t),[o,r]}function vl(e,t,i){if(i){const{x:e,y:t,width:n,height:s}=i;return{canvasX:e+n/2,canvasY:t+s/2}}const n=t.yBar?.upperPoint??t.midPoint??e.datumMidPoint?.(t);if(n){const t=Me.toCanvasPoint(e.contentGroup,n.x,n.y);return{canvasX:Math.round(t.canvasX),canvasY:Math.round(t.canvasY)}}}function Sl(e){const t={};for(const i of nl)t[i]=e(void 0,!1,i,void 0,void 0);return t}function Ml(e,...t){const i={};for(const n of t??["default"])for(const t of nl){(i[n]??(i[n]={}))[t]=e(void 0,!1,t,n)}return i}function kl(e){return(e?.opacity??1)<1||(e?.fillOpacity??1)<1||(e?.strokeOpacity??1)<1}var Dl=new Map;function wl(e,t){return"cutout"!==e?e:function(e){if(null==e)return!1;const t=e.fill;if(!(0,n.KgX)(t))return!1;const i=t.trim(),s=i.toLowerCase();if("transparent"===s||"none"===s)return!1;let a=Dl.get(i);if(null==a){try{a=1===n.Q1f.fromString(i).a}catch{a=!1}Dl.set(i,a)}return a}(t)?"cutout":"overlay"}function Il(e,t,i){for(const n of t??[])switch(typeof e){case"string":if(n.itemId===e)return n;if(void 0===n.itemId&&void 0!==i){const t=n.datum?.[i];if(null!=t&&String(t)===e)return n}break;case"number":if(n.datumIndex===e)return n;if(void 0===n.itemId&&void 0!==i){const t=n.datum?.[i];if(t===e)return n}break;default:return e}}var Al=class{constructor(e,t,i,s){this.domManager=i,this.tooltip=s,this.stateTracker=new Kt,this.suppressState=new Kt(!1),this.appliedState=null,this.pendingRemovals=new Map,this.removeDelay=100,this.cleanup=new n._uV,this.cleanup.register(s.setup(t,i),e.on("dom:hidden",(()=>this.tooltip.hide())))}destroy(){for(const{scheduler:e}of this.pendingRemovals.values())e.cancel();this.pendingRemovals.clear(),this.cleanup.flush()}updateTooltip(e,t,i,n){const s=this.pendingRemovals.get(e);s&&(s.scheduler.cancel(),this.pendingRemovals.delete(e)),i??(i=this.stateTracker.get(e)?.content),this.stateTracker.set(e,{meta:t,content:i,pagination:n}),this.applyStates()}removeTooltip(e,t,i=!1){if(i&&this.removeDelay>0){const i=this.pendingRemovals.get(e);if(i)return void(t&&(i.lastMeta=t));const n=Ve((()=>{this.applyPendingRemoval(e)}));return this.pendingRemovals.set(e,{scheduler:n,lastMeta:t}),void n.schedule(this.removeDelay)}const n=this.pendingRemovals.get(e);n&&(n.scheduler.cancel(),this.pendingRemovals.delete(e)),this.stateTracker.delete(e),this.applyStates()}suppressTooltip(e){this.suppressState.set(e,!0)}unsuppressTooltip(e){this.suppressState.delete(e)}
1applyPendingRemoval(e){this.pendingRemovals.has(e)&&(this.pendingRemovals.delete(e),this.stateTracker.delete(e),this.applyStates())}applyStates(){const e=this.stateTracker.stateId(),t=e?this.stateTracker.get(e):void 0;if(this.suppressState.stateValue()||null==t?.meta||null==t?.content)return this.appliedState=null,void this.tooltip.hide();const i=this.domManager.getBoundingClientRect(),s="extended"===this.tooltip.bounds?this.domManager.getOverlayClientRect():i;if((0,n.DH9)(this.appliedState?.content,t?.content)&&(0,n.DH9)(this.appliedState?.pagination,t?.pagination)){const e=this.tooltip.isVisible();this.tooltip.show(s,i,t?.meta,null,void 0,e)}else this.tooltip.show(s,i,t?.meta,t?.content,t?.pagination);this.appliedState=t}static makeTooltipMeta(e,t,i,n){const{canvasX:s,canvasY:a}=e,o=t.properties.tooltip,{placement:r,anchorTo:l,xOffset:h,yOffset:c,offset:d}=o.position,u=vl(t,i,n);return{canvasX:s,canvasY:a,nodeCanvasX:u?.canvasX??s,nodeCanvasY:u?.canvasY??a,enableInteraction:o.interaction?.enabled??!1,showArrow:o.showArrow,position:{placement:r,anchorTo:l,xOffset:h,yOffset:c,offset:d}}}};function Cl(e,t){const{device:i,offsetX:n,offsetY:s,clientX:a,clientY:o,currentX:r,currentY:l,sourceEvent:h}=t;return{type:e,device:i,offsetX:n,offsetY:s,clientX:a,clientY:o,currentX:r,currentY:l,sourceEvent:h}}function Nl(e,t){return e*e+t*t>=9}var Ll=class{constructor(e){this.cleanup=new n._uV,this.events=new n.bkB,this.isDragging=!1,this.touch={distanceTravelledX:0,distanceTravelledY:0,clientX:0,clientY:0},this.cleanup.register(e.addListener("touchstart",this.onTouchStart.bind(this)),e.addListener("touchmove",this.onTouchMove.bind(this)),e.addListener("touchend",this.onTouchEnd.bind(this)),e.addListener("mousemove",this.onMouseMove.bind(this)),e.addListener("dblclick",this.onDblClick.bind(this)),e.addListener("drag-start",this.onDragStart.bind(this)),e.addListener("drag-move",this.onDragMove.bind(this)),e.addListener("drag-end",this.onDragEnd.bind(this)))}destroy(){this.cleanup.flush()}onTouchStart(e){const{clientX:t,clientY:i}=e.sourceEvent.targetTouches[0]??{clientX:1/0,clientY:1/0};this.touch.distanceTravelledX=0,this.touch.distanceTravelledY=0,this.touch.clientX=t,this.touch.clientY=i}onTouchMove(e){const{clientX:t,clientY:i}=e.sourceEvent.targetTouches[0]??{clientX:1/0,clientY:1/0};this.touch.distanceTravelledX+=Math.abs(this.touch.clientX-t),this.touch.distanceTravelledY+=Math.abs(this.touch.clientY-i),this.touch.clientX=t,this.touch.clientY=i}onTouchEnd(e){e.sourceEvent.preventDefault()}onMouseMove(e){this.events.emit("mousemove",e)}onDblClick(e){this.events.emit("dblclick",e)}onDragStart(e){this.dragStartEvent=e}onDragMove(e){null!=this.dragStartEvent&&Nl(e.originDeltaX,e.originDeltaY)&&(this.events.emit("drag-start",this.dragStartEvent),this.events.emit("drag-move",{...this.dragStartEvent,type:"drag-move"}),this.dragStartEvent=void 0,this.isDragging=!0),this.isDragging&&this.events.emit("drag-move",e)}onDragEnd(e){if(this.isDragging)return this.events.emit("drag-end",e),void(this.isDragging=!1);if("mouse"===e.device){const t=Cl("click",e);this.events.emit("click",t)}else if("touchend"===e.sourceEvent.type){if(Nl(this.touch.distanceTravelledX,this.touch.distanceTravelledY))return;const t=Cl("click",e);this.events.emit("click",t);const i=Date.now();if(void 0!==this.lastClick&&i-this.lastClick.time<=505&&function(e,t){const i=e.clientX-t.clientX,n=e.clientY-t.clientY;return i*i+n*n<900}(this.lastClick,e)){const t=Cl("dblclick",e);this.events.emit("dblclick",t),this.lastClick=void 0}else this.lastClick={time:i,clientX:e.clientX,clientY:e.clientY}}}},Pl=class extends vi{constructor(e){super(e)}addChildToDOM(){}removeChildFromDOM(){}},Tl=(()=>{var e=class e{constructor(e){this.ctx=e,this.entries=new Map}acquireTitle(e){const t=this.getEntry(e);return t.text||(t.text=this.ctx.proxyInteractionService.createProxyElement({type:"text",domManagerId:this.titleId(e),where:"afterend"}),t.textNested=!1,t.region&&this.nestTitle(e,t)),t.text}releaseTitle(e){const t=this.entries.get(e);t?.text&&(t.textNested&&t.region&&t.region.widget.removeChildWidget(t.text),t.text.destroy(),t.text=void 0,t.textNested=!1,this.pruneEntry(e,t))}acquireRegion(e){const t=this.getEntry(e);if(!t.region){const i=this.ctx.proxyInteractionService.createProxyElement({type:"axis",domManagerId:e,where:"afterend",role:"region"}),n=new Ll(i);t.region={widget:i,dragInterpreter:n},t.text&&!t.textNested&&this.nestTitle(e,t)}return t.region}releaseRegion(e){const t=this.entries.get(e);t?.region&&(t.text&&t.textNested&&this.unnestTitle(e,t),t.region.dragInterpreter.destroy(),t.region.widget.destroy(),t.region=void 0,this.pruneEntry(e,t))}setRegionBounds(e,t){const i=this.getEntry(e);i.regionBounds=t,i.region?.widget.setBounds(t),this.applyTitleBounds(i)}setTitleBounds(e,t){const i=this.getEntry(e);i.titleBounds=t,this.applyTitleBounds(i)}destroy(){for(const e of this.entries.values())e.text?.destroy(),e.regi
1on?.dragInterpreter.destroy(),e.region?.widget.destroy();this.entries.clear()}applyTitleBounds(e){const{text:t,titleBounds:i}=e;t&&i&&(e.textNested&&e.regionBounds?t.setBounds({x:i.x-e.regionBounds.x,y:i.y-e.regionBounds.y,width:i.width,height:i.height}):t.setBounds(i))}titleId(t){return`${t}${e.TITLE_ID_SUFFIX}`}getEntry(e){let t=this.entries.get(e);return t||(t={textNested:!1},this.entries.set(e,t)),t}nestTitle(e,t){t.region&&t.text&&(this.ctx.domManager.removeChild("canvas-proxy",this.titleId(e)),t.region.widget.addChild(t.text),t.textNested=!0,this.applyTitleBounds(t))}unnestTitle(e,t){t.region&&t.text&&(t.region.widget.removeChildWidget(t.text),this.ctx.domManager.addChild("canvas-proxy",this.titleId(e),t.text.getElement(),{where:"afterend",query:".ag-charts-series-area"}),t.textNested=!1,this.applyTitleBounds(t))}pruneEntry(e,t){t.region||t.text||this.entries.delete(e)}};return e.TITLE_ID_SUFFIX="__axis-title",e})(),Ol=class{constructor(e,t){const{domManager:i}=e;this.seriesWidget=new Pl(i.getParent("series-area")),this.chartWidget=new Pl(i.getParent("canvas-proxy")),this.containerWidget=new Pl(i.getParent("canvas-container")),this.containerWidget.addChild(this.chartWidget),this.chartWidget.addChild(this.seriesWidget),t.withDragInterpretation&&(this.seriesDragInterpreter=new Ll(this.seriesWidget)),this.axisWidgets=new Tl(e)}destroy(){this.axisWidgets.destroy(),this.seriesDragInterpreter?.destroy(),this.seriesWidget.destroy(),this.chartWidget.destroy(),this.containerWidget.destroy()}},Rl=(()=>{var e=class e extends T{constructor(t=[],i=[]){super(),this.range=i,this.defaultTickCount=e.defaultTickCount,this.defaultClamp=!1,this._domain=[],this.domainNeedsValueOf=!0,this.d0Cache=Number.NaN,this.d1Cache=Number.NaN,this.d0Big=void 0,this.d1Big=void 0,this.domain=t}static is(t){return t instanceof e}get domain(){return this._domain}set domain(e){if(!e||e.length<2)return this._domain=El(e),this.d0Big=this.d1Big=void 0,this.d0Cache=Number.NaN,void(this.d1Cache=Number.NaN);const t=e[0],i=e[1];if("bigint"==typeof t||"bigint"==typeof i)return this.d0Big="bigint"==typeof t?t:void 0,this.d1Big="bigint"==typeof i?i:void 0,this.domainNeedsValueOf=!1,this.d0Cache=Number(t),this.d1Cache=Number(i),void(this._domain=El(e));this.d0Big=this.d1Big=void 0,this._domain=El(e),this.domainNeedsValueOf=null!=t&&"object"==typeof t,this.domainNeedsValueOf?(this.d0Cache=t.valueOf(),this.d1Cache=i.valueOf()):(this.d0Cache=Number(t),this.d1Cache=Number(i))}normalizeDomains(...e){return Bl(...e)}calcBandwidth(e=1,t=1){const{domain:i}=this,n=this.getPixelRange();if(0===i.length)return n;let s=Math.abs(this.d1Cache-this.d0Cache)/Number(e)+1;if(0!==t){const e=Math.floor(n);s=Math.min(s,e)}return n/Math.max(1,s)}convert(e,t){const{domain:i}=this;if(!i||i.length<2||null==e)return Number.NaN;const{range:s}=this,a=t?.clamp??this.defaultClamp;if(null!=this.d0Big&&null!=this.d1Big&&null==this.transform&&("bigint"==typeof e||"number"==typeof e&&Number.isFinite(e)))return function(e,t,i,n,s){const a=n[0],o=n[1];if(s){if(e<(t<i?t:i))return a;if(e>(t<i?i:t))return o}if(t===i)return(a+o)/2;let r,l=0;if("number"==typeof e){const t=Math.trunc(e);r=BigInt(t),l=e-t}else r=e;if(0===l){if(r===t)return a;
1if(r===i)return o}const h=i-t,c=(r-t)*zl/h,d=Number(c)/Number(zl)+l/Number(h);return a+d*(o-a)}(e,this.d0Big,this.d1Big,s,a);let o,r=this.d0Cache,l=this.d1Cache;if(o="number"==typeof e?e:"bigint"==typeof e?Number(e):e.valueOf(),this.transform&&(r=this.transform(r),l=this.transform(l),o=this.transform(o)),a){const[e,t]=(0,n.uYy)([r,l]);if(o<e)return s[0];if(o>t)return s[1]}if(r===l)return(s[0]+s[1])/2;if(o===r)return s[0];if(o===l)return s[1];const h=s[0];return h+(o-r)/(l-r)*(s[1]-h)}convertClamped(e){const{d0Big:t,d1Big:i}=this;if("bigint"==typeof e&&null!=t&&null!=i){const s=(0,n.Wwf)(t,i),a=(0,n.cGV)(t,i);return this.convert((0,n.Wwf)(a,(0,n.cGV)(s,e)))}const{d0Cache:s,d1Cache:a}=this,o=Math.min(s,a),r=Math.max(s,a);return this.convert(Math.min(r,Math.max(o,(0,n.Roz)(e))))}invert(e,t){const{domain:i}=this;if(i.length<2)return;let n=this.d0Cache,s=this.d1Cache;this.transform&&(n=this.transform(n),s=this.transform(s));const{range:a}=this,[o,r]=a;let l;return l=o===r?this.toDomain((n+s)/2):this.toDomain(n+(e-o)/(r-o)*(s-n)),this.transformInvert?this.transformInvert(l):l}getDomainMinMax(){return E(this.domain)}snapshotDomain(){const e=this._domain.slice();return null!=this.d0Big&&(e[0]=this.d0Big),null!=this.d1Big&&(e[1]=this.d1Big),e}exactEndpoint(e){return(0===e?this.d0Big:this.d1Big)??this._domain[e]}startIsMin(){return this.exactEndpoint(0)<=this.exactEndpoint(1)}get domainMin(){return this._domain.length<2?this._domain.at(0):this.exactEndpoint(this.startIsMin()?0:1)}get domainMax(){return this._domain.length<2?this._domain.at(0):this.exactEndpoint(this.startIsMin()?1:0)}getPixelRange(){const[e,t]=this.range;return Math.abs(t-e)}};return e.defaultTickCount=5,e})();function El(e){return e.map((e=>"bigint"==typeof e?Number(e):e))}var zl=10n**12n;function Bl(...e){let t,i;for(const n of e)for(const e of n.domain)(void 0===t||e<t)&&(t=e),(void 0===i||e>i)&&(i=e);return null!=t&&null!=i?{domain:[t,i],animatable:!0}:{domain:[],animatable:!1}}var Fl=(()=>{var e=class e extends T{constructor(){super(...arguments),this.invalid=!0,this.range=[0,1],this.round=!1,this._bandwidth=1,this._step=1,this._inset=1,this._rawBandwidth=1,this._paddingInner=0,this._paddingOuter=0}static is(t){return t instanceof e}get bandwidth(){return this.refresh(),this._bandwidth}get step(){return this.refresh(),this._step}get inset(){return this.refresh(),this._inset}get rawBandwidth(){return this.refresh(),this._rawBandwidth}set padding(e){e=(0,n.qE8)(0,e,1),this._paddingInner=e,this._paddingOuter=e}get padding(){return this._paddingInner}set paddingInner(e){this.invalid=!0,this._paddingInner=(0,n.qE8)(0,e,1)}get paddingInner(){return this._paddingInner}set paddingOuter(e){this.invalid=!0,this._paddingOuter=(0,n.qE8)(0,e,1)}get paddingOuter(){return this._paddingOuter}getBandCountForUpdate(){return this.bands.length}refresh(){this.invalid&&(this.invalid=!1,this.update(),this.invalid&&this.logger.warnOnce("Expected update to not invalidate scale"))}convert(e,t){this.refresh();const i=this.findIndex(e,t?.alignment,t?.alignmentExclusive);return null==i||i<0||i>=this.getBandCountForUpdate()?Number.NaN:this.ordinalRange(i)}getDomainMinMax(){return E(this.domain)}invertNearestIndex(e,t="center"){this.refresh();const i=this.getBandCountForUpdate();if(0===i)return-1;let n=0,s=i-1,a=1/0,o=0;for(;n<=s;){const i=Math.trunc((s+n)/2),r=this.ordinalRange(i),l=r-e;if(0===l)return i;("center"===t||l<0)&&Math.abs(l)<a&&(a=Math.abs(l),o=i),r<e?n=i+1:s=i-1}return o}update(){const[e,t]=this.range;let{_paddingInner:i}=this;const{_paddingOuter:n}=this,s=this.getBandCountForUpdate();if(0===s)return;const a=t-e;let o;1===s?(i=0,o=a*(1-2*n)):o=a/Math.max(1,s-i+2*n);const r=this.round&&Math.floor(o)>0,l=r?Math.floor(o):o,h=e+(a-l*(s-i))/2;let c=l*(1-i);r&&(c=Math.round(c)),this._step=l,this._inset=h,this._bandwidth=c,this._rawBandwidth=o*(1-i)}ordinalRange(e){const{_inset:t,_step:i,range:s}=this,a=Math.min(s[0],s[1]),o=Math.max(s[0],s[1]);return(0,n.qE8)(a,t+i*e,o)}};return d([O],e.prototype,"range",2),d([O],e.prototype,"round",2),e})(),Vl=Fl;function $l(e,t=0,i=e.length-1){const n=i-t+1;if(!Number.isFinite(n)||n<2)return{isUniform:!1};if(t<0||i>=e.length)return{isUniform:!1};const s=Array.from({length:20},((e,i)=>t+Math.floor(i*(n-1)/19))),a=s.map((t=>e[t].valueOf())),o=(a.at(-1)-a[0])/(n-1);if(!Number.isFinite(o)||0===o)return{isUniform:!1};const r=Math.abs(.01*o);for(let e=1;e<a.length;e++){const t=s[e]-s[e-1],i=(a[e]-a[e-1])/t;if(Math.abs(i-o)>r)return{isUniform:!1}}return{isUniform:!0,interval:o}}var Hl=class e extends Vl{static is(t){return t instanceof e}toDomain(e){return new Date((0,n.Hre)(e))}get reversed(){const{domain:e}=this;return e.length>0&&e[0].valueOf()>e.at(-1).valueOf()}get numericBands(){return this.bands.map((e=>e.valueOf()))}convert(e,t){this.refresh(),e instanceof Date||(e=new Date((0,n.Hre)(e)));const{domain:i,reversed:s}=this,a=this.numericBands,o=a.length;if(i.length<=0)return Number.NaN;const r=this.ordinalRange(0),l=this.ordinalRange(o-1);if(0===o)return r;if(!0===t?.clamp){const{range:t}=this;if(e.valueOf()<a[0])return t[0];if(e.valueOf()>a.at(-1))return t[1]}if((t?.alignment??n.w8L.Leading)!==n.w8L.Interpolate){const i=super.convert(e,t);return s?l-(i-r):i}const h=e.valueOf();let c,d=this.findIndex(e)??0;s?(d=Math.min(Math.max(d,1),o-1),c=-1):(d=Math.min(Math.max(d,0),o-2),c=1);const u=a[d],p=a[d+c],g=this.ordinalRange(d),m=(h-u)/(p-u)*(this.ordinalRange(d+c)-g)+g;return s?l-(m-r):m}invert(e,t=!1){this.refresh();const{domain:i}=this;if(i.length<=0)return;const s=this.bands,a=this.getBandCountForUpdate(),o=i[0].valueOf()>i.at(-1).valueOf();let r;if(t)r=this.invertNearestIndex(e-this.bandwidth/2);else{r=(0,n.S3I)(0,a-1,(t=>this.ordinalRange(t)>=e))??a-1}return s[o?a-1-r:r]}getUniformityCache(e){}findIndex(e,t=n.w8L.Leading,i=!1){if(null==e)return;const s=this.numericBands,a=s.length;if(0===a)return;if(1===a)return 0;const o=e.valueOf();return t===n.w8L.Trailing!==i?(0,n.S3I)(0,a-1,(e=>s[e]>=o)):(0,n.I5B)(0,a-1,(e=>s[e]<=o))}},jl=(e=>(e[e.None=0]="None",e[e.WhenViewportTooSmallScaleXYProportionally=1]="WhenViewportTooSmallScaleXYProportionally",e[e.WhenViewportTooSmallScaleXYDisproportionally=2]="WhenViewportTooSmallScaleXYDisproportionally",e))(jl||{});function Wl(e,t,i,n,s){return t+(s-e)/(i-e)*(n-t)}function _l(e,t,i,n,s){return e+(i-e)/(n-t)*(s-t)}function Gl(e,t,i){return[_l(e,i.min,t,i.max,0),_l(e,i.min,t,i.max,1)]}function Kl(e,t){return{x:t.width>e.width,y:t.height>e.height}}function Yl(e,t,i,s,a,o){if(i<=a&&o<=s)return i;const r=a-i,l=o-s,h=Math.abs(r)<Math.abs(l)?r:l;return(0,n.qE8)(e,i+h,t)}function Ul(e,t,i,n){const s=function(e,t,i){const[n,s]=Gl(e.x1,e.x2,t),[a,o]=Gl(e.y1,e.y2,i);return{x1:n,x2:s,y1:a,y2:o}}(e,i,n);return{x:Yl(s.x1,s.x2,e.x1,e.x2,t.x1,t.x2),y:Yl(s.y1,s.y2,e.y1,e.y2,t.y1,t.y2)}}function Xl(e,t,i,s){switch(e){case 0:return function(e,t,i){return Zl({x:!1,y:!1},e,t,i)}(t,i,s);case 1:return function(e,t,i){const s=Kl(e,i);if(!s.x&&!s.y)return Zl(s,e,t,i);
1const a=i.width/e.width,o=i.height/e.height,r=Math.max(a,o),l=n.Zbg.from(i),h=(l.x1+l.x2)/2,c=(l.y1+l.y2)/2,d=e.width*r,u=e.height*r;return Zl({x:!1,y:!1},{x:h-d/2,y:c-u/2,width:d,height:u},t,i)}(t,i,s);case 2:return function(e,t,i){const n=Kl(e,i);return Zl(n,e,t,i)}(t,i,s);default:return e}}function Zl(e,t,i,s){const{x:a={min:0,max:1},y:o={min:0,max:1}}=i,r=n.Zbg.from(s),l=n.Zbg.from(t),h=Ul(l,r,a,o),c={x:e.x?{min:Wl(l.x1,a.min,l.x2,a.max,l.x1),max:Wl(l.x1,a.min,l.x2,a.max,l.x2)}:{min:Wl(l.x1,a.min,l.x2,a.max,h.x),max:Wl(l.x1,a.min,l.x2,a.max,h.x+t.width)},y:e.y?{min:Wl(l.y1,o.min,l.y2,o.max,l.y1),max:Wl(l.y1,o.min,l.y2,o.max,l.y2)}:{min:Wl(l.y1,o.min,l.y2,o.max,h.y),max:Wl(l.y1,o.min,l.y2,o.max,h.y+t.height)}},d=c.x.max-c.x.min,u=c.y.max-c.y.min;return c.x.min=(0,n.qE8)(0,c.x.min,1-d),c.x.max=c.x.min+d,c.y.min=(0,n.qE8)(0,c.y.min,1-u),c.y.max=c.y.min+u,c}function ql(e,t){const i=e?.valueOf(),s=t?.valueOf();return(0,n.zZm)(i)&&(0,n.zZm)(s)?i<s?[n.w8L.Leading,n.w8L.Trailing]:[n.w8L.Trailing,n.w8L.Leading]:[void 0,void 0]}var Ql=e=>(0,n.W$8)(((t,{options:i})=>!Rl.is(e?.scale)&&!Hl.is(e?.scale)||(null==t||null==i.end||t<i.end)),"to be less than end");function Jl(e,t){return e===t}function eh(e,t,i){const s=(0,n.vIl)(e),a=(0,n.vIl)(t);if(s.length!==a.length)return!1;for(const e of s)if(!a.includes(e))return!1;for(const n of s){const s=e[n],a=t[n];if(s!==a&&(null==s||s.direction!==a?.direction||!i(s.min,a.min)||!i(s.max,a.max)))return!1}return!0}function th(e){return{source:"user-interaction",sourceDetail:e}}function ih(e){return(0,n.zZm)(e)||(0,n.KgX)(e)||(0,n.$PY)(e)?{value:e,groupPercentage:0}:e??{value:void 0,groupPercentage:0}}function nh(e){return(0,n.Gvm)(e)&&"groupPercentage"in e}var sh=class extends Bt{constructor(e){super(),this.ctx=e,this.mementoOriginatorKey="zoom",this.axes=[],this.allAxes=[],this.didLayoutAxes=!1,this.restoreRequiredRangeIterations=0,this.independentAxes=!1,this.navigatorModule=!1,this.zoomModule=!1,this.debug=n.yar.create(!0,"zoom"),this.panToBBoxScalingMode=2,this.pendingMemento=void 0,this.cleanup.register(e.eventsHub.on("zoom:change-request",(e=>{this.constrainZoomToRequiredWidth(e)})),e.eventsHub.on("update:pre-series",(({requiredRangeRatio:e,requiredRangeDirection:t,requiredRange:i})=>{this.didLayoutAxes=!0;const{pendingMemento:n}=this;n?this.restoreMemento(n.version,n.mementoVersion,n.memento):this.restoreRequiredRange(e,t,i),this.updateZoom({source:"chart-update",sourceDetail:"unspecified"})})),e.eventsHub.on("update:complete",(({wasShortcut:e})=>{if(!e&&this.pendingZoomEventSource){const e=this.pendingZoomEventSource;this.ctx.chartService.callListener({type:"zoom",source:e,...this.getMementoRanges()}),this.pendingZoomEventSource=void 0}})))}get state(){const e=this.ctx.chartState.getValue("zoom"),t={};for(const i of this.allAxes){const s=this.axes.find((e=>e.id===i.id));let a,o;if(s)({min:a,max:o}=s.getZoom());else{const t=(0,n.gMZ)(e,i.direction);a=t?.min??0,o=t?.max??1}t[i.id]={min:a,max:o,direction:i.direction}}return t}set state(e){const t=new Set;for(const i of this.axes){const n=e[i.id];t.add(i.id),n&&i.setZoom({min:n.min,max:n.max})}const i=this.allAxes.filter((e=>!t.has(e.id)));if(0===i.length)return;const s={};for(const t of i){const i=e[t.id];i&&(s[t.id]=i)}const a=(0,n.M7G)(s);null!=a&&this.ctx.chartState.setValue("zoom",a)}toCoreZoomState(e){const t={};let i;const{state:s}=this;if(this.independentAxes){const e=this.getPrimaryAxisId(n.tv$.X),t=this.getPrimaryAxisId(n.tv$.Y);i=[],e&&i.push(e),t&&i.push(t)}else i=(0,n.vIl)(s);for(const n of i){const{direction:i}=s[n]??{};if(null!=i){const s=e[i];if(s){const{min:e,max:a}=s;t[n]={min:e,max:a,direction:i}}}}return t}createMemento(){return this.getMementoRanges()}guardMemento(e,t){if(null==e)return!0;if(!(0,n.Gvm)(e))return!1;const i=this.getPrimaryAxis(n.tv$.X),s=this.getPrimaryAxis(n.tv$.Y),a={rangeX:{start:Ql(i),end:n.swK},rangeY:{start:Ql(s),end:n.swK},ratioX:{start:n.swK,end:n.swK},ratioY:{start:n.swK,end:n.swK},autoScaledAxes:n.swK},{invalid:o}=(0,n.tfT)(e,a,"",{logger:this.ctx.logger});return!(o.length>0)||(t.push(...o.map(String)),!1)}restoreMemento(e,t,i){if(null==i)return;if(!this.axes||!this.didLayoutAxes)return void(this.pendingMemento={version:e,mementoVersion:t,memento:i});this.pendingMemento=void 0;const s=(0,n.af4)((0,n.M7G)(this.state));s.x=i?.rangeX?this.rangeToRatioDirection(n.tv$.X,i.rangeX)??{min:0,max:1}:i?.ratioX?{min:i.ratioX.start??0,max:i.ratioX.end??1}:{min:0,max:1};const{navigatorModule:a,zoomModule:o}=this;this.ctx.eventsHub.emit("zoom:load-memento",{zoom:s,memento:i,navigatorModule:a,zoomModule:o});const r=this.toCoreZoomState(s);this.writeInitialZoom((0,n.M7G)(r)),this.updateChanges({source:"state-change",sourceDetail
1:"internal-restoreMemento",changes:r,isReset:!1})}writeInitialZoom(e){const t=this.ctx.chartState.getValue("initialZoom");(0,n.DH9)(t,e)||this.ctx.chartState.setValue("initialZoom",e)}findAxis(e){for(const t of this.axes)if(t.id===e)return t}getAxes(){return this.axes}setAxes(e){const t=this.state,i=new Map;for(const e of this.axes)i.set(e.id,e.type);const{axes:n,allAxes:s}=this;n.length=0,s.length=0;for(const t of e)s.push({id:t.id,direction:t.direction}),"range"in t&&n.push(t);const a={...t};for(const e of n){const t=i.get(e.id);void 0!==t&&t!==e.type&&delete a[e.id]}const o=function(e,t){const i={};for(const{id:n,direction:s}of e){const{min:e,max:a}=t[n]??{min:0,max:1};i[n]={min:e,max:a,direction:s}}return i}(e,a);this.state=o,this.updateChanges({source:"chart-update",sourceDetail:"internal-setAxes",changes:o,isReset:!1})}setIndependentAxes(e=!0){this.independentAxes=e}setNavigatorEnabled(e=!0){this.navigatorModule=e}setZoomModuleEnabled(e=!0){this.zoomModule=e}isNavigatorEnabled(){return this.navigatorModule}isZoomEnabled(){return this.zoomModule}updateZoom({source:e,sourceDetail:t},i){const n=this.toCoreZoomState(i??{});return this.updateChanges({source:e,sourceDetail:t,changes:n,isReset:!1})}computeChangedAxesIds(e){const t=[],i=this.state;for(const s of(0,n.vIl)(e)){const n=e[s]??{min:0,max:1},a=i[s];a?.min===n.min&&a.max===n.max||t.push(s)}return t}updateChanges(e){const{source:t,sourceDetail:i,isReset:s,changes:a}=e;!function(e,t){for(const i of(0,n.vIl)(e)){const n=e[i];if(!n)continue;const{min:s,max:a}=n;(s<0||a>1)&&(t.warnOnce(`Attempted to update axis (${i}) zoom to an invalid ratio of [{ min: ${s}, max: ${a} }], expecting a ratio of 0 to 1. Ignoring.`),delete e[i])}}(a,this.ctx.logger);const o=this.computeChangedAxesIds(a),r=(0,n.Go6)(this.state),l=(0,n.Go6)(this.state);for(const e of o){const t=l[e];null!=t&&(t.min=a[e]?.min??0,t.max=a[e]?.max??1)}return this.state=l,this.dispatch(t,i,o,s,r)}resetZoom({source:e,sourceDetail:t}){const i=this.ctx.chartState.getValue("initialZoom"),s={};for(const e of this.allAxes){const t=(0,n.gMZ)(i,e.direction);s[e.id]=t?{min:t.min,max:t.max}:{min:0,max:1}}this.updateChanges({source:e,sourceDetail:t,changes:s,isReset:!0})}resetAxisZoom({source:e,sourceDetail:t},i){const s=this.allAxes.find((e=>e.id===i));if(!s)return;const a=this.ctx.chartState.getValue("initialZoom"),o=(0,n.gMZ)(a,s.direction),r=o?{min:o.min,max:o.max}:{min:0,max:1};this.updateChanges({source:e,sourceDetail:t,changes:{[i]:r},isReset:!0})}panToBBox(e,t){if(!this.isZoomEnabled()&&!this.isNavigatorEnabled())return!1;const i=(0,n.M7G)(this.state);if(void 0===i||!i.x&&!i.y)return!1;const{panToBBoxScalingMode:s}=this;if(!(e.width>0&&e.height>0&&(0!==s||Math.abs(t.width)<=Math.abs(e.width)&&Math.abs(t.height)<=Math.abs(e.height))))return this.ctx.logger.warnOnce("cannot pan to target BBox - chart too small?"),!1;const a=Xl(s,e,i,t),o=this.toCoreZoomState(a);return this.updateChanges({source:"user-interaction",sourceDetail:"internal-panToBBox",changes:o,isReset:!1})}fireZoomPanStartEvent(e){this.ctx.eventsHub.emit("zoom:pan-start",{callerId:e})}updateWith({source:e,sourceDetail:t},i,n){const s=this.getPrimaryAxis(i);if(!s)return;const a=s.scale.getDomainMinMax();if(!a)return;const[o,r]=s.visibleRange,l=this.getRange(s.id,{min:o,max:r});if(!l)return;const[h,c]=a,{start:d,end:u}=l,p=n({start:h,end:c,windowStart:d,windowEnd:u,source:e});if(!this.isValidUpdateWithResult(p))return void this.resetZoom({source:e,sourceDetail:t});const[g,m]=p,y=this.rangeToRatioAxis(s,{start:g,end:m});y&&this.updateChanges({source:e,sourceDetail:t,changes:{[i]:y},isReset:!1})}isValidUpdateWith(e,t,i){const n=this.getPrimaryAxis(e);if(!n)return!0;const s=n.scale.getDomainMinMax();if(!s)return!0;const[a,o]=n.visibleRange,r=this.getRange(n.id,{min:a,max:o});if(!r)return!0;const[l,h]=s,{start:c,end:d}=r,u=t({start:l,end:h,windowStart:c,windowEnd:d,source:i});if(!this.isValidUpdateWithResult(u))return!0;const[p,g]=u;let m=!0;return null!=p&&m&&(m=p>=l),null!=g&&m&&(m=g<=h),null!=p&&null!=g&&m&&(m=p<=g),m}getAxisZooms(){return this.state}getAxisZoom(e){return this.state[e]??{min:0,max:1}}getPrimaryAxisId(e){return this.getPrimaryAxis(e)?.id}getBoundSeries(){const e=this.getPrimaryAxis(n.tv$.X),t=this.getPrimaryAxis(n.tv$.Y);let i;
1if(this.independentAxes){const n=new Set(e?.boundSeries??[]),s=new Set(t?.boundSeries??[]);i=new Set;for(const e of n)s.has(e)&&i.add(e)}else i=new Set([...e?.boundSeries??[],...t?.boundSeries??[]]);return i}constrainZoomToItemCount(e,t,i){let s=[e.x.min,e.x.max],a=i?void 0:[e.y.min,e.y.max];for(const e of this.getBoundSeries()){const i=e.getZoomRangeFittingItems(s,a,t);null!=i&&(s=i.x,a=i.y)}const o={min:(0,n.qE8)(0,s[0],1),max:(0,n.qE8)(0,s[1],1)},r=a?{min:(0,n.qE8)(0,a[0],1),max:(0,n.qE8)(0,a[1],1)}:void 0;return(0,n.af4)({x:o,y:r})}isVisibleItemsCountAtLeast(e,t,i){const n=this.getBoundSeries(),s=[e.x.min,e.x.max],a=!i.includeYVisibleRange&&i.autoScaleYAxis?void 0:[e.y.min,e.y.max];let o=0;for(const e of n){const i=t-(o??0);if(o+=e.getVisibleItems(s,a,i),o>=t)return!0}return 0===n.size}getMementoRanges(){const e=(0,n.af4)((0,n.M7G)(this.state)),t={rangeX:this.getRangeDirection(n.tv$.X,e.x),rangeY:this.getRangeDirection(n.tv$.Y,e.y),ratioX:{start:e.x.min,end:e.x.max},ratioY:{start:e.y.min,end:e.y.max},autoScaledAxes:void 0};return this.ctx.eventsHub.emit("zoom:save-memento",{memento:t}),t}restoreRequiredRange(e,t,i){const{lastRestoredRequiredRange:s,lastRestoredRequiredRangeDirection:a}=this;this.lastRequiredRange!==i&&(this.lastRequiredRange=i,this.restoreRequiredRangeIterations=0);const o=Math.min(1,1/e);o<1&&(this.restoreRequiredRangeIterations+=1);if(t!==n.tv$.X&&t!==n.tv$.Y||a===t&&s===e||0===e&&(null==s||0===s)||this.restoreRequiredRangeIterations>1)return void(this.restoreRequiredRangeIterations=0);const r=this.getPrimaryAxisId(t);if(!r)return;const l=this.state[r]??{min:0,max:1};let h=0,c=1;t===n.tv$.X?(h=(0,n.qE8)(0,1-o,l.min),c=(0,n.qE8)(0,h+o,1)):(c=Math.min(1,l.max),h=c-o,h<0&&(c-=h,h=0),h=(0,n.qE8)(0,h,1),c=(0,n.qE8)(0,c,1)),this.lastRestoredRequiredRange=e,this.lastRestoredRequiredRangeDirection=t;const d={[t]:{min:h,max:c}},u=this.toCoreZoomState(d);this.writeInitialZoom((0,n.M7G)(u)),this.updateChanges({source:"state-change",sourceDetail:"internal-requiredWidth",changes:u,isReset:!1})}constrainZoomToRequiredWidth(e){if(null==this.lastRestoredRequiredRange||null==this.lastRestoredRequiredRangeDirection)return;const t=this.getPrimaryAxisId(this.lastRestoredRequiredRangeDirection);if(!t)return;const i=e.state[t],n=e.oldState[t];if(!i||!n)return;const s=i.max-i.min,a=1/this.lastRestoredRequiredRange;Math.abs(s-a)<1e-12||s<=a||e.constrainChanges({[t]:{direction:this.lastRestoredRequiredRangeDirection,min:n.min,max:n.min+a}})}dispatch(e,t,i,s,a){const{x:o,y:r}=(0,n.M7G)(this.state)??{},l=this.state;let h;const c=this.debug,d=this,u={source:e,sourceDetail:t,isReset:s,changedAxes:i,state:l,oldState:a,x:o,y:r,stateAsDefinedZoom:()=>(0,n.af4)((0,n.M7G)(u.state)),constrainZoom(e){this.constrainChanges(d.toCoreZoomState(e))},constrainChanges(e){c.check()&&c("ZoomManager.constrainChanges()",l,"->",e,(new Error).stack),h??(h=(0,n.Go6)(l));for(const t of(0,n.vIl)(e)){const i=e[t],n=h[t];i&&n&&(n.min=i.min,n.max=i.max)}u.state=h}};this.ctx.eventsHub.emit("zoom:change-request",u),h&&!eh(l,h,Jl)&&(this.state=h);const p=(0,n.M7G)(this.state);(0,n.DH9)(this.ctx.chartState.getValue("zoom"),p)||this.ctx.chartState.setValue("zoom",p);const g=!function(e,t){return eh(e,t,n.YXt)}(a,this.state);return g&&(this.ctx.eventsHub.emit("zoom:change-complete",{source:e,sourceDetail:t,x:p?.x}),this.pendingZoomEventSource=e),g}getRange(e,t){return this.getRangeAxis(this.findAxis(e),t)}getRangeDirection(e,t){return this.getRangeAxis(this.getPrimaryAxis(e),t)}getRangeAxis(e,t){if(!e)return;const i=this.getDomainPixelExtents(e);if(!i)return;const[n,s]=i;let a,o;return n<=s?(a=e.scale.invertWithPercentage(0),o=e.scale.invertWithPercentage(n+(s-n)*t.max)):(a=e.scale.invertWithPercentage(n-(n-s)*t.min),o=e.scale.invertWithPercentage(0)),{start:a,end:o}}rangeToRatioDirection(e,t){return this.rangeToRatioAxis(this.getPrimaryAxis(e),t)}rangeToRatioAxis(e,t){if(!e)return;const i=this.getDomainPixelExtents(e);if(!i)return;const[s,a]=i,{scale:o}=e,{start:r,end:l}=t,h=ih(r),c=ih(l),d=0===o.bandwidth?o.step??0:o.bandwidth??0,[u=n.w8L.Leading,p=n.w8L.Trailing]=ql(h.value,c.value);let g=s,m=a;if(null!=h.value&&(g=nh(r)?o.convert(h.value)+d*h.groupPercentage:o.convert(r,{alignment:u,alignmentExclusive:!0})),null!=c.value&&(m=nh(l)?o.convert(c.value)+d*c.groupPercentage:o.convert(l,{alignment:p,al
1ignmentExclusive:!0})+(o.bandwidth??0)),!(0,n.BfI)(g)||!(0,n.BfI)(m))return;const[y,f]=[Math.min(s,a),Math.max(s,a)];g=(0,n.qE8)(y,g,f),m=(0,n.qE8)(y,m,f);const x=a-s;if(0===x)return;const b=Math.abs((g-s)/x),v=Math.abs((m-s)/x);return b>=v?void 0:{min:b,max:v}}getPrimaryAxis(e){return this.axes?.find((t=>t.direction===e))}getDomainPixelExtents(e){const[t,i]=e.scale.range;if((0,n.BfI)(t)&&(0,n.BfI)(i))return[t,i]}isValidUpdateWithResult(e){return null!=e&&(!!Array.isArray(e)&&(!(e.length<1)&&e.every((e=>null==e||"number"==typeof e||(0,n.vdg)(e)))))}};function ah(e){return e.usesPlacedLabels}var oh=class{constructor(){this.labelData=new Map,this.sources=new Map}registerSource(e){this.sources.set(e.id,e)}unregisterSource(e,t){null!=t&&this.sources.get(e)!==t||this.sources.delete(e)}updateLabels(e,t,i=m.zero){const n={x:-t.left,y:-t.top,width:i.width+t.left+t.right,height:i.height+t.top+t.bottom},s=[...this.sources.values(),...e],a=s.filter(ah);if(0===a.length)return this.labelData.clear(),this.lastPlacementSignature=void 0,void(this.lastPlacedLabels=void 0);const o=function(e,t){let i="";for(const t of e)i+=`${t.id}:${t.nodeDataVersion};`;return`${i}|${t.x},${t.y},${t.width},${t.height}`}(s,n);let r=this.lastPlacedLabels;null!=r&&o===this.lastPlacementSignature||(r=this.computePlacement(a,s,n,i),this.lastPlacementSignature=o,this.lastPlacedLabels=r);for(const e of a)e.updatePlacedLabelData?.(r.get(e.id)??[],i)}computePlacement(e,t,i,s){const a=this.labelData;this.labelData=new Map;for(const t of e){const e=t.getLabelData(s);if(e.every(n.y43))this.labelData.set(t.id,{datums:e,defaults:t.getLabelDefaults?.(),resolveCandidateStyle:t.getLabelCandidateStyler?.(),resolveCandidate:t.getLabelCandidateResolver?.()});else{const e=a.get(t.id);null!=e&&this.labelData.set(t.id,e)}}const o=[];for(const e of t){const t=e.getLabelObstacles?.(s);if(null!=t)for(const e of t)o.push(e)}return(0,n.$6F)(this.labelData,i,5,o)}},rh=(e=>(e[e.Caption=0]="Caption",e[e.Legend=1]="Legend",e[e.ToolbarLeft=2]="ToolbarLeft",e[e.ToolbarBottom=3]="ToolbarBottom",e[e.Scrollbar=4]="Scrollbar",e[e.Navigator=5]="Navigator",e[e.Overlay=6]="Overlay",e))(rh||{}),lh=class{constructor(e){this.eventsHub=e,this.elements=new Map}registerElement(e,t){return this.elements.has(e)?this.elements.get(e).add(t):this.elements.set(e,new Set([t])),()=>this.elements.get(e)?.delete(t)}createContext(e,t){const i={width:e,height:t,layoutBox:new m(0,0,e,t),scrollbars:{}};for(const e of Object.values(rh)){if("number"!=typeof e)continue;const t=this.elements.get(e);if(t)for(const e of t)e(i)}return i}emitLayoutComplete({width:e,height:t},i){this.eventsHub.emit("layout:complete",{axes:i.axes??{},chart:{width:e,height:t},clipSeries:i.clipSeries??!1,series:i.series,layoutBox:i.layoutBox})}},hh=class{constructor(e){this.logger=e}updateCallback(e){this.resolvePartialCallback=e}resolvePartial(e,t,i,n){return this.resolvePartialCallback?.(this.logger,e,t,i,n)}},ch=class extends Vl{constructor(){super(...arguments),this.type="category",this.defaultTickCount=0,this._hasFixedWidth=!1,this._paddingInnerWidth=0,this._domain=[],this._bandRanges=new Map}set domain(e){this._domain!==e&&(0===e.length&&(this._bandRanges.clear(),this._hasFixedWidth=!1),this.invalid=!0,this._domain=e)}get domain(){return this._domain}get bands(){return this.domain}get paddingInnerWidth(){return this._hasFixedWidth?this._paddingInnerWidth:this.paddingInner*this._bandwidth}addBand(e,t,i){this._domain.push(this.getDomainValue(e,t)),this._bandRanges.has(e)||this._bandRanges.set(e,new Map),this._bandRanges.get(e).set(t,i),this._hasFixedWidth||(this._hasFixedWidth=null!=i),this.invalid=!0}getDomainValue(e,t){return`${e}-${t}`}findIndex(e){let t=0;for(const i of this._bandRanges.keys()){if(i===e)return t;t++}}convert(e){const{_bandwidth:t,_bandRanges:i,_inset:n,_paddingInnerWidth:s}=this;let a=n;const o=e.split("-"),r=Number(o[0]);if(!this._hasFixedWidth)return super.convert(r);for(let e=0;e<r;e++){const n=i.get(e);if(!n){a+=s;continue}let o=0;for(const e of n.values())o=Math.max(o,null==e?t:e);a+=o+s}return a}invert(e,t){}getBandCountForUpdate(){return this._bandRanges.size}
1update(){if(!this._hasFixedWidth)return super.update();const[e,t]=this.range;let{paddingInner:i}=this;const n=this.getBandCountForUpdate();if(0===n)return;let s=0,a=n,o=n;for(const e of this._bandRanges.values()){let t=0,i=!1;for(const n of e.values())null!=n?t=Math.max(t,n):i=!0;i?o-=1:(a-=1,s+=t)}1===n&&(i=0);const r=t-e,l=r/n*i,h=r-(s+l*(n-1));let c=e,d=a>0&&h>=0?h/a:r/n,u=d;o===n&&h>0&&(c+=h/2);this.round&&Math.floor(u)>0&&(u=Math.round(u)),h<0&&(d=0,u=0),this._inset=c,this._bandwidth=u,this._rawBandwidth=d,this._paddingInnerWidth=l}normalizeDomains(...e){return{domain:[],animatable:!1}}toDomain(e){}},dh=class{constructor(){this.groups=new Map,this.groupScales=new Map,this.datumValidKeys=new Map}registerSeries({internalId:e,seriesGrouping:t,visible:i,width:n,type:s}){if(!t)return;let a=this.groups.get(s);null==a&&(a=new Map,this.groups.set(s,a)),a.set(e,{grouping:t,visible:i,width:n})}updateSeries({internalId:e,seriesGrouping:t,visible:i,width:n,type:s}){if(!t)return;const a=this.groups.get(s)?.get(e);a&&(a.grouping=t,a.width=n,a.visible=i)}deregisterSeries({internalId:e,type:t}){this.datumValidKeys.delete(e);const i=this.groups.get(t);null!=i&&(i.delete(e),0===i.size&&this.groups.delete(t))}setSeriesDatumValidKeys(e,t){if(null==t)return void this.datumValidKeys.delete(e);const i=new Set;for(const e of t)i.add((0,n.nnz)(e));0===i.size?this.datumValidKeys.delete(e):this.datumValidKeys.set(e,i)}getVisiblePeerGroupIndex({type:e,seriesGrouping:t,visible:i}){if(!t)return{visibleGroupCount:i?1:0,visibleSameStackCount:i?1:0,index:0};const n=new Set,s=new Set,a=this.groups.get(e);for(const e of a?.values()??[])e.visible&&(n.add(e.grouping.groupIndex),e.grouping.groupIndex===t.groupIndex&&s.add(e.grouping.stackIndex));const o=Array.from(n);return o.sort(((e,t)=>e-t)),{visibleGroupCount:o.length,visibleSameStackCount:s.size,index:o.indexOf(t.groupIndex)}}getVisibleStackNeighbours({type:e,seriesGrouping:t}){let i=!1,n=!1;if(!t)return{before:i,after:n};const s=this.groups.get(e);for(const e of s?.values()??[])e.visible&&e.grouping.groupIndex===t.groupIndex&&(i||(i=e.grouping.stackIndex<t.stackIndex),n||(n=e.grouping.stackIndex>t.stackIndex));return{before:i,after:n}}updateGroupScale({type:e},t,i){const n=this.groupScales.get(e)??new ch;this.groupScales.set(e,n),n.domain=[];const s=this.groups.get(e);for(const e of s?.values()??[])e.visible&&n.addBand(e.grouping.groupIndex,e.grouping.stackIndex,e.width);0===n.domain.length&&n.addBand(0,0,void 0),n.range=[0,t],"grouped-category"===i.type?n.paddingInner=i.options.groupPaddingInner:"category"===i.type||"unit-time"===i.type?(n.paddingInner=i.options.groupPaddingInner,n.round=0!==n.padding):n.padding=0,n.update()}getGroupScale({type:e}){return this.groupScales.get(e)}getGroupBandWidth(e){const{seriesGrouping:t}=e;if(!t)return 0;const i=this.getGroupScale(e);if(!i)return 0;const n=this.groups.get(e.type);if(!n)return i.bandwidth;let s=0;for(const e of n.values())e.visible&&e.grouping.groupIndex===t.groupIndex&&(s=Math.max(s,e.width??i.bandwidth));return s||i.bandwidth}getGroupOffset(e){const{seriesGrouping:t}=e;if(!t)return 0;const i=this.getGroupScale(e);if(!i)return 0;const n=i.getDomainValue(t.groupIndex,t.stackIndex);return i.convert(n)}getStackOffset(e,t){const{seriesGrouping:i}=e;if(!i)return 0;const n=this.groups.get(e.type);if(!n)return 0;const s=this.getGroupScale(e);if(!s)return 0;if((i.stackCount??0)<1)return 0;let a=0;for(const e of n.values())e.visible&&e.grouping.groupIndex===i.groupIndex&&(a=Math.max(a,e.width??s.bandwidth));return 0===a?0:a/2-t/2}getDatumOffset(e,t){const i=this.groups.get(e.type);if(!e.visible||!e.seriesGrouping||!i)return 0;const s=(0,n.nnz)(t);if(!this.datumValidKeys.get(e.internalId)?.has(s))return 0;const a=new Set;for(const[e,t]of i)t.visible&&this.datumValidKeys.get(e)?.has(s)&&a.add(t.grouping.groupIndex);if(a.size===e.seriesGrouping?.groupCount)return 0;const o=this.groupScales.get(e.type),r=new Map,l=new Map;for(const[t,n]of i)t!==e.internalId&&n.visible&&(a.has(n.grouping.groupIndex)||(e.seriesGrouping.groupIndex<n.grouping.groupIndex?l.set(n.grouping.groupIndex,Math.max(n.width??o?.bandwidth??0,l.get(n.grouping.groupIndex)??0)):e.seriesGrouping.groupIndex>n.grouping.groupIndex&&r.set(n.grouping.groupIndex,Math.max(n.width??o?.bandwidth??0,r.get(n.grouping.groupIndex)??0))));let h=0;for(const[,e]of l)h+=e;for(const[,e]of r)h-=e;h/=2;const c=(o?.paddingInnerWidth??0)/2;return h+(l.size-r.size)*c}},uh=Object.freeze(["error","warning","deprecation"]),ph=Object.freeze([]),gh=Object.freeze([]),mh=["error","warning","deprecation"],yh={error:1,warning:2,deprecation:4};function fh(e){let t=0;for(const i of e)t|=yh[i];return t}function xh(e){return`${e.severity}:${e.message}`}function bh(e){if(!(0,n.Gvm)(e))return;const{validations:t}=e;return(0,n.Gvm)(t)?t:void 0}function vh(e,t){return(0,n.cyL)(e)&&e.every(n.nfz)?e:t}var Sh=new Set,Mh=0;var kh=class{constructor(e){this.cleanup=[],this.collection=new Map,this.passOf=new Map,this.raisedInPass=new Set,this.openPasses=[],this.showOverlayMask=0,this.throwMask=0,this.failFastSuppressed=0,this.dismissed=!1,this.told=new Set,this.pendingDispatch=[],this.dispatching=!1,this.reportingListenerError=!1,this.logger=e.logger,this.eventsHub=e.eventsHub,this.cleanup.push(this.logger.onIssue((e=>this.eventsHub.emit("validation:issue",e))),this.eventsHub.on("val
1idation:issue",(e=>this.onIssue(e)))),e.chartState&&this.cleanup.push(e.chartState.observe((e=>this.configure(e("options","validations")))))}destroy(){for(const e of this.cleanup)e();this.cleanup.length=0}configure(e){const t=(0,n.Gvm)(e)?e:void 0;this.logger.setEnabledLevels(vh(t?.consoleOn,uh)),this.throwMask=fh(vh(t?.throwOn,gh)),this.setShowOverlayOn(vh(t?.showOverlayOn,ph));const i=t?.issueRaised,s="function"==typeof i?i:void 0;s!==this.listener&&(this.listener=s,this.told.clear())}setShowOverlayOn(e){const t=fh(e);this.showOverlayMask!==t&&(this.showOverlayMask=t,this.eventsHub.emit("validation:change",null))}suspendFailFast(){return this.failFastSuppressed++,()=>this.failFastSuppressed--}get issues(){return[...this.collection.values()]}beginCycle(e,t=this){const i=new Set(this.collection.keys());if(t!==this&&t.listener===this.listener)for(const e of t.told)this.told.add(e);this.collection.clear(),this.passOf.clear(),this.raisedInPass.clear();const n=[];for(const t of e){const e=xh(t);this.collection.has(e)||(this.collection.set(e,t),this.told.has(e)||n.push(t))}this.sameKeys(i)||(this.dismissed=!1,this.eventsHub.emit("validation:change",null)),this.dispatch(n)}beginPass(e){this.openPasses.push(e);for(const[t,i]of this.passOf)i===e&&this.raisedInPass.delete(t)}endPass(e,t=!0){const i=this.openPasses.lastIndexOf(e);if(-1!==i&&this.openPasses.splice(i,1),!t)return;let n=!1;for(const[t,i]of this.passOf)i!==e||this.raisedInPass.has(t)||(this.passOf.delete(t),this.collection.delete(t),this.told.delete(t),n=!0);n&&this.eventsHub.emit("validation:change",null)}dismiss(){this.dismissed||(this.dismissed=!0,this.eventsHub.emit("validation:change",null))}hasVisibleIssues(){if(0===this.showOverlayMask||this.dismissed)return!1;for(const e of this.collection.values())if(this.showOverlayMask&yh[e.severity])return!0;return!1}getVisibleIssues(){const e={error:[],warning:[],deprecation:[]};for(const t of this.collection.values())this.showOverlayMask&yh[t.severity]&&e[t.severity].push(t);return e}sameKeys(e){if(e.size!==this.collection.size)return!1;for(const t of this.collection.keys())if(!e.has(t))return!1;return!0}onIssue(e){if(e.cause instanceof ze||this.reportingListenerError)return;const t=xh(e);if(!this.collection.has(t)){this.collection.set(t,e);const i=this.openPasses.at(-1);null!=i&&this.passOf.set(t,i),this.showOverlayMask&yh[e.severity]&&(this.dismissed=!1,this.eventsHub.emit("validation:change",null))}var i;if(this.passOf.has(t)&&this.raisedInPass.add(t),this.told.has(t)||this.dispatch([e]),!(this.failFastSuppressed>0)&&this.throwMask&yh[e.severity])throw new ze(`AG Charts - validations.throwOn: ${e.severity} - ${i=e.message,i.replace(/[,;]? ignoring\.$/i,"")}`,this,{cause:e.cause})}dispatch(e){const t=this.listener;if(null!=t&&0!==e.length&&(this.pendingDispatch.push(...e),!this.dispatching))if(Sh.has(t)||Mh>=32)this.pendingDispatch.length=0;else{this.dispatching=!0,Sh.add(t),Mh++;try{for(;this.pendingDispatch.length>0;){const e=this.pendingDispatch.shift(),{severity:i,message:n}=e;this.told.add(xh(e));try{t({severity:i,message:n})}catch(e){if(e instanceof ze&&e.source===this)throw e;this.reportListenerError(e)}}}finally{this.pendingDispatch.length=0,Mh--,Sh.delete(t),this.dispatching=!1}}}reportListenerError(e){this.reportingListenerError=!0;try{this.logger.error("validations.issueRaised threw an error",e)}finally{this.reportingListenerError=!1}}};var Dh=(()=>{var e=class extends n.XPE{constructor(){super(...arguments),this.enabled=!0,this.range="tooltip",this.mode="single",this.drawingMode="cutout"}};return d([n.mAP],e.prototype,"enabled",2),d([n.mAP],e.prototype,"range",2),d([n.mAP],e.prototype,"mode",2),d([n.mAP],e.prototype,"drawingMode",2),e})();function wh(e,t){if(e.size!==t.size)return!1;for(const i of e)if(!t.has(i))return!1;return!0}function Ih(e,t){if(null==e||null==t)return e===t;if(e.size!==t.size)return!1;for(const[i,n]of e){const e=t.get(i);if(null==e)return!1;if(!wh(n,e))return!1}return!0}function Ah(e,t){const{props:i,...s}=e,{props:a,...o}=t;return(0,n.DH9)(s,o)&&function(e,t){if(e.length!==t.length)return!1;for(let i=0;i<e.length;i+=1){const{type:s,idsMap:a,scopes:o,data:r,...l}
1=e[i],{type:h,idsMap:c,scopes:d,data:u,...p}=t[i];if(s!==h)return!1;if(o&&d&&!(0,n.r1i)(o,d))return!1;if(r&&u&&r!==u)return!1;if(!(0,n.DH9)(l,p)||!Ih(a,c))return!1}return!0}(i,a)}function Ch(e,t,i,s){return t===e.dataSet&&((0,n.r1i)(i,e.ids)&&Ah(s,e.opts))}function Nh(e){return e.filter((e=>"key"===e.type)).map((e=>e.property)).join(";")}var Lh=(()=>{var e=class e{constructor(e,t,i,s){this.mode=e,this.suppressFieldDotNotation=t,this.eventsHub=i,this.logger=s,this.debug=n.yar.create(!0,"data-model"),this.requested=[],this.status="setup",this.reprocessedIncrementally=!1}async request(e,t,i){if("setup"!==this.status)throw new Error("AG Charts - data request after data setup phase.");return new Promise(((n,s)=>{this.requested.push({id:e,opts:i,dataSet:t,resolve:n,reject:s})}))}execute(t,i){if("setup"!==this.status)throw new Error("AG Charts - data request after data setup phase.");this.status="executed";const s=new Map;for(const e of this.requested)e.dataSet.hasPendingTransactions()&&s.set(e.dataSet,e.dataSet.getChangeDescription()),e.dataSet.commitPendingTransactions(i);this.debug("DataController.execute() - requested",this.requested);const a=this.validateRequests(this.requested);this.debug("DataController.execute() - validated",a);const o=this.mergeRequested(a);this.debug("DataController.execute() - merged",o),this.debug.check()&&((0,n.zkX)().processedData=[]);const r=[];for(const{dataSet:l,ids:h,opts:c,resolves:d,rejects:u}of o){let o=function(e){return Ch(e,l,h,c)};const p=t?.find(o),g=(e,t)=>{if(this.debug.check()&&(0,n.zkX)("processedData").push(t),null!=t){r.push({opts:c,dataSet:l,dataLength:l.data.length,ids:h,dataModel:e,processedData:t});for(const i of d)i({dataModel:e,processedData:t})}else for(const e of u)e(new Error("AG Charts - no processed data generated"))},m=()=>{try{const e=new ur(c,this.logger,this.mode,this.suppressFieldDotNotation,this.eventsHub),t=new Map(a.map((e=>[e.id,e.dataSet]))),i=e.processData(t);return g(e,i),e}catch(e){for(const t of u)t(e)}};if(null==p){m();continue}const{dataModel:y,processedData:f}=p,x=s.get(l);if(f&&x&&y.isReprocessingSupported(f)){if(this.debug("DataController.execute() - reprocessing data",f,l),this.reprocessedIncrementally=!0,y.reprocessData(f,s,i),n.yar.check("data-model:reprocess-diff")){const t=new ur(c,this.logger,this.mode,this.suppressFieldDotNotation,this.eventsHub),i=new Map(a.map((e=>[e.id,e.dataSet]))),s=t.processData(i),o=JSON.parse(JSON.stringify(f,e.jsonReplacer)),r=JSON.parse(JSON.stringify(s,e.jsonReplacer));delete o.time,delete o.optimizations,delete r.time,delete r.optimizations;const l=(0,n.G4M)(r,o);l?(this.logger.log("â ï¸ DATA-MODEL REPROCESS DIFF DETECTED â ï¸"),this.logger.log("Difference between incremental update and full reprocess:"),this.logger.log(""),this.logger.log("BASELINE (full reprocess):"),this.logger.log(JSON.stringify(r,null,2)),this.logger.log(""),this.logger.log("REPROCESSED (incremental update):"),this.logger.log(JSON.stringify(o,null,2)),this.logger.log(""),this.logger.log("DIFF (what changed):"),this.logger.log(JSON.stringify(l,null,2))):this.logger.log("â
Data-model reprocess matches baseline (no diff)")}g(y,f)}else m()}return r}validateRequests(e){const t=[];for(const[i,n]of e.entries())i>0&&n.dataSet.data.length!==e[0].dataSet.data.length&&!1===n.opts.groupByData&&!1===n.opts.groupByKeys?n.reject(new Error("all series[].data arrays must be of the same length and have matching keys.")):t.push(n);return t}mergeRequested(t){const i=[];for(const n of t){const t=i.find(e.groupMatch(n));t?t.push(n):i.push([n])}return i.map(e.mergeRequests)}static groupMatch({dataSet:e,opts:t}){const{groupByData:i,groupByKeys:n=!1,groupByFn:s,props:a}=t,o=Nh(a);return([t])=>(!1===i||t.dataSet===e)&&(t.opts.groupByKeys??!1)===n&&t.opts.groupByFn===s&&Nh(t.opts.props)===o}static mergeRequests(t){const i={ids:[],rejects:[],resolves:[],dataSet:t[0].dataSet,opts:{...t[0].opts,props:[]}},n=new Map,s=new Map;let a=0;for(const o of t){const{id:t,dataSet:r,resolve:l,reject:h,opts:{props:c,...d}}=o;i.ids.push(t),i.rejects.push(h),i.resolves.push(l),i.dataSet??(i.dataSet=r),i.opts??(i.opts={...d,props:[]});for(const o of c){const l={...o,scopes:[t],data:r.data};let h;e.createIdsMap(t,l),e.crossScopeMergableTypes.has(l.type)?h=-1:s.has(r.data)?h=s.get(r.data):(h=a++,s.set(r.data,h));const c=`${l.type}-${h}-${l.groupId}`,d=n.get(c),u=d?.find((t=>e.deepEqual(t,l)));null!=d?null!=u?(null!=l.scopes&&(u.scopes??(u.scopes=[]),u.scopes.push(...l.scopes)),"key"!==u.type&&"value"!==u.type||!l.idsMap?.size||(u.idsMap??(u.idsMap=new Map),e.mergeIdsMap(l.idsMap,u.idsMap))):(i.opts.props.push(l),d.push(l)):(i.opts.props.push(l),n.set(c,[l]))}}return i}static mergeIdsMap(e,t){for(const[i,n]of e){const e=t.get(i);if(null==e)t.set(i,new Set(n));else for(const t of n)e.add(t)}}static createIdsMap(e,t){null!=t.id&&(t.idsMap??(t.idsMap=new Map),t.idsMap.has(e)?t.idsMap.get(e).add(t.id):t.idsMap.set(e,new Set([t.id])))}
1static deepEqual(t,i){if(t===i)return!0;if(t&&i&&"object"==typeof t&&"object"==typeof i){if(t.constructor!==i.constructor)return!1;let n,s;if(Array.isArray(t)){if(s=t.length,s!==i.length)return!1;for(n=s-1;n>=0;n--)if(!e.deepEqual(t[n],i[n]))return!1;return!0}const a=Object.keys(t);if(s=a.length,s!==Object.keys(i).length)return!1;for(n=s-1;n>=0;n--){const s=a[n];if(!(e.skipKeys.has(s)||Object.hasOwn(i,s)&&e.deepEqual(t[s],i[s])))return!1}return!0}return!1}static jsonReplacer(e,t){return t instanceof Map?{__type:"Map",value:Array.from(t.entries())}:t instanceof Set?{__type:"Set",value:Array.from(t)}:t}};return e.crossScopeMergableTypes=new Set(["key","group-value-processor"]),e.skipKeys=new Set(["id","idsMap","type","scopes","data"]),e})(),Ph=class e{constructor(e,t,i){this.data=e,this.logger=t,this.dataIdKey=i,this.pendingTransactions=[]}static empty(t,i){return new e([],t,i)}static wrap(t,i,n){return new e(t,i,n)}size(){return this.data.length}netSize(){if(!this.hasPendingTransactions())return this.data.length;const e=this.getChangeDescription();return e?e.indexMap.finalLength:this.data.length}getDatumAt(e){return this.data[e]}addTransaction(e){const t=this.normalizeTransaction(e);this.pendingTransactions.push(t),this.cachedChangeDescription=void 0}getIdArray(){if(null!=this.dataIdKey){if(void 0===this.idArrayCache){this.idArrayCache=[];for(let e=0;e<this.size();e++)this.idArrayCache.push(this.getIdValue(this.getDatumAt(e)))}return this.idArrayCache}}getItemIdFromIndex(e){const t=this.getDatumAt(e);return(t?this.getIdValue(t):void 0)??e}getIndexFromItemId(e){return"number"==typeof e?!Number.isInteger(e)||e<0||e>=this.size()?void 0:e:this.getIdToIndexMap().get(e)}normalizeTransaction(e){const{add:t,addIndex:i,prepend:n,append:s,remove:a,update:o}=e;if(void 0===t)return e;const r={remove:a,update:o};
1if(n&&(r.prepend=n),s&&(r.append=s),t&&t.length>0){const e=this.netSize();void 0===i||i>=e?r.append=s?[...s,...t]:t:0===i?r.prepend=n?[...t,...n]:t:r.insertions=[{index:i,items:t}]}return r}hasPendingTransactions(){return this.pendingTransactions.length>0}getPendingTransactionCount(){return this.pendingTransactions.length}commitPendingTransactions(e){if(null!=this.dataIdKey&&this.data.length>0&&this.getIdToIndexMap(),!this.hasPendingTransactions())return!1;const t=this.getChangeDescription();if(!t)return!1;const i=t.getPrependedValues(),n=t.getInsertionValues(),s=t.getAppendedValues(),a=[...i,...n,...s];let o=0;if(t.applyToArray(this.data,(function(e){if(o>=a.length)throw new Error(`AG Charts - Internal error: No insertion value found for index ${e}`);return a[o++]})),this.cachedPendingReplacements&&this.cachedPendingReplacements.size>0){const{updatedIndices:e}=t.indexMap;for(const t of e){const e=this.getIdValue(this.data[t]);void 0!==e&&this.cachedPendingReplacements.has(e)&&(this.data[t]=this.cachedPendingReplacements.get(e))}}if(this.pendingTransactions=[],this.cachedChangeDescription=void 0,this.cachedPendingReplacements=void 0,this.updateItemToIndexCache(t,s,i,n),this.updateIdToIndexCache(t,s,i,n),e?.onDataChange(t),this.idArrayCache){t.applyToArray(this.idArrayCache,(e=>this.getIdValue(this.data[e])));const{updatedIndices:e}=t.indexMap;for(const t of e)this.idArrayCache[t]=this.getIdValue(this.data[t])}return!0}updateItemToIndexCache(e,t,i,n){if(!this.itemToIndexCache)return;if(this.dataIdKey)return void(this.itemToIndexCache=void 0);const{indexMap:s}=e,{totalPrependCount:a,totalAppendCount:o,removedIndices:r}=s,l=r.size>0,h=n.length>0;if(!l&&0===a&&0===o&&!h)return;if(h)return void(this.itemToIndexCache=void 0);const c=er(r);if(l&&0===c)return void(this.itemToIndexCache=void 0);const d=this.itemToIndexCache,u=a-c;if(0!==u)for(const[e,t]of d)r.has(t)?d.delete(e):d.set(e,t+u);else if(l)for(const[e,t]of d)r.has(t)&&d.delete(e);for(let e=0;e<i.length;e++){const t=i[e];d.has(t)||d.set(t,e)}const p=s.finalLength-o;for(let e=0;e<t.length;e++){const i=t[e];d.has(i)||d.set(i,p+e)}}updateIdToIndexCache(e,t,i,n){if(!this.idToIndexCache)return;const{indexMap:s}=e,{totalPrependCount:a,totalAppendCount:o,removedIndices:r}=s,l=r.size>0,h=n.length>0;if(!l&&0===a&&0===o&&!h)return;if(h)return void(this.idToIndexCache=void 0);const c=er(r);if(l&&0===c)return void(this.idToIndexCache=void 0);const d=this.idToIndexCache,u=a-c;if(0!==u)for(const[e,t]of d)r.has(t)?d.delete(e):d.set(e,t+u);else if(l)for(const[e,t]of d)r.has(t)&&d.delete(e);for(let e=i.length-1;e>=0;e--){const t=this.getIdValue(i[e]);void 0!==t&&d.set(t,e)}const p=s.finalLength-o;for(let e=0;e<t.length;e++){const i=this.getIdValue(t[e]);void 0===i||d.has(i)||d.set(i,p+e)}}clearPendingTransactions(){const e=this.pendingTransactions.length;return this.pendingTransactions=[],this.cachedChangeDescription=void 0,this.cachedPendingReplacements=void 0,e}getPendingTransactions(){return[...this.pendingTransactions]}toJSON(){return this.data}getChangeDescription(){if(!this.hasPendingTransactions())return;if(this.cachedChangeDescription)return this.cachedChangeDescription;const{indexMap:e,prependValues:t,appendValues:i,insertionValues:n,pendingReplacements:s}=this.buildIndexMap(),a=new ir(e,{prependValues:t,appendValues:i,insertionValues:n});return this.cachedChangeDescription=a,this.cachedPendingReplacements=s,a}removeFromGroups(e,t){for(const i of e){let e=0;for(;e<i.length&&t.size>0;)t.has(i[e])?(t.delete(i[e]),i.splice(e,1)):e++;if(0===t.size)break}}buildIndexMap(){const e=this.data.length,t=this.collectTransactionEffects(),i=t.prependsList.flat(),n=t.appendsList.flat(),s=t.insertionsList.flat(),a=i.length,o=n.length,r=s.length,l=e-t.removedOriginalIndices.size,h=a+l+r+o,c=t.removedOriginalIndices.size>0?this.getSortedRemovedIndices(t.removedOriginalIndices):void 0,d=this.buildSpliceOperations(a,r,o,l,t.trackedInsertions,c?.desc,c?.asc),u=this.resolveUpdatedIndices(a,r,l,t.updateTracking,c?.asc,t.updatedOriginalIndices,t.trackedInsertions);return{indexMap:{originalLength:e,finalLength:h,spliceOps:d,removedIndices:t.removedOriginalIndices,updatedIndices:u,totalPrependCount:a,totalAppendCount:o},prependValues:i,appendValues:n,insertionValues:s,pendingReplacements:t.pendingReplacements}}getSortedRemovedIndices(e){const t=Array.from(e).sort(((e,t)=>e-t));return{asc:t,desc:[...t].reverse()}}collectTransactionEffects(){const e={prependsList:[],appendsList:[],insertionsList:[],trackedInsertions:[],removedOriginalIndices:new Set,updatedOriginalIndices:new Set,virtualLength:this.data.length};for(const t of this.pendingTransactions){const{prepend:i,append:n,insertions:s,remove:a,update:o}=t;this.applyPrepends(i,e),this.applyInsertions(s,e),this.applyAppends(n,e),this.applyRemovals(a,e),this.applyUpdates(o,e)}
1return{prependsList:e.prependsList,appendsList:e.appendsList,insertionsList:e.insertionsList,trackedInsertions:e.trackedInsertions,removedOriginalIndices:e.removedOriginalIndices,updatedOriginalIndices:e.updatedOriginalIndices,updateTracking:e.updateTracking,pendingReplacements:e.pendingReplacements}}applyPrepends(e,t){Array.isArray(e)&&0!==e.length&&(t.prependsList.unshift([...e]),t.virtualLength+=e.length)}applyInsertions(e,t){if(Array.isArray(e))for(const{index:i,items:n}of e)i>=0&&i<=t.virtualLength&&n.length>0&&(t.trackedInsertions.push({virtualIndex:i,items:[...n]}),t.insertionsList.push([...n]),t.virtualLength+=n.length)}applyAppends(e,t){Array.isArray(e)&&0!==e.length&&(t.appendsList.push([...e]),t.virtualLength+=e.length)}applyRemovals(e,t){Array.isArray(e)&&0!==e.length&&(this.dataIdKey?this.applyRemovalsById(e,t):this.applyRemovalsByRef(e,t))}applyRemovalsByRef(e,t){const i=new Set(e);if(this.removeFromGroups(t.prependsList,i),i.size>0&&this.removeFromGroups(t.insertionsList,i),t.trackedInsertions.length>0&&this.removeFromTrackedInsertions(e,t),i.size>0&&this.removeFromGroups(t.appendsList,i),i.size>0)for(let e=0;e<this.data.length&&i.size>0;e++){const n=this.data[e];i.has(n)&&(t.removedOriginalIndices.add(e),i.delete(n),t.virtualLength--)}i.size>0&&this.logger.warnOnce("applyTransaction() remove includes items not present in current data; ignoring missing items.")}
1applyRemovalsById(e,t){const i=new Set;for(const t of e){const e=this.getIdValue(t);void 0===e?this.logger.warnOnce(`applyTransaction() remove item is missing '${this.dataIdKey}' field; ignoring.`):i.add(e)}if(0!==i.size){if(this.removeFromGroupsById(t.prependsList,i),i.size>0&&this.removeFromGroupsById(t.insertionsList,i),t.trackedInsertions.length>0&&this.removeFromTrackedInsertionsById(e,t),i.size>0&&this.removeFromGroupsById(t.appendsList,i),i.size>0){const e=this.getIdToIndexMap();for(const n of i){const s=e.get(n);void 0!==s&&(t.removedOriginalIndices.add(s),t.virtualLength--,i.delete(n))}}i.size>0&&this.logger.warnOnce("applyTransaction() remove includes items not present in current data; ignoring missing items.")}}applyUpdates(e,t){Array.isArray(e)&&0!==e.length&&(this.dataIdKey?this.applyUpdatesById(e,t):this.applyUpdatesByRef(e,t))}applyUpdatesByRef(e,t){const i=new Set(e),n=this.collectUpdatedIndicesFromGroups(t.prependsList,i),s=i.size>0?this.collectUpdatedIndicesFromGroups(t.insertionsList,i):[],a=i.size>0?this.collectUpdatedIndicesFromGroups(t.appendsList,i):[];i.size>0&&this.collectUpdatedOriginalIndices(i,t),t.updateTracking={updatedPrependsIndices:n,updatedAppendsIndices:a,updatedInsertionsIndices:s},i.size>0&&this.logger.warnOnce("applyTransaction() update includes items not present in current data; ignoring missing items.")}
1applyUpdatesById(e,t){const i=new Map;for(const t of e){const e=this.getIdValue(t);void 0===e?this.logger.warnOnce(`applyTransaction() update item is missing '${this.dataIdKey}' field; ignoring.`):i.set(e,t)}if(0===i.size)return;const n=this.collectUpdatedIndicesFromGroupsById(t.prependsList,i),s=i.size>0?this.collectUpdatedIndicesFromGroupsById(t.insertionsList,i):[],a=i.size>0?this.collectUpdatedIndicesFromGroupsById(t.appendsList,i):[];i.size>0&&this.collectUpdatedOriginalIndicesById(i,t),t.updateTracking={updatedPrependsIndices:n,updatedAppendsIndices:a,updatedInsertionsIndices:s},i.size>0&&this.logger.warnOnce("applyTransaction() update includes items not present in current data; ignoring missing items.")}collectUpdatedIndicesFromGroups(e,t){if(0===t.size||0===e.length)return[];const i=[];let n=0;for(const s of e){for(const e of s)t.has(e)&&(i.push(n),t.delete(e)),n++;if(0===t.size)break}return i}getItemToIndexMap(){if(void 0===this.itemToIndexCache){this.itemToIndexCache=new Map;for(let e=0;e<this.data.length;e++)this.itemToIndexCache.has(this.data[e])||this.itemToIndexCache.set(this.data[e],e)}return this.itemToIndexCache}getIdValue(e){if(null==this.dataIdKey||null==e||"object"!=typeof e)return;const t=e[this.dataIdKey];return"string"==typeof t||"number"==typeof t&&!Number.isNaN(t)?t:void 0}getIdToIndexMap(){if(void 0===this.idToIndexCache){this.idToIndexCache=new Map;for(let e=0;e<this.data.length;e++){const t=this.getIdValue(this.data[e]);void 0!==t&&(this.idToIndexCache.has(t)?this.logger.warnOnce(`dataIdKey '${this.dataIdKey}' has duplicate value '${t}'; first occurrence used.`):this.idToIndexCache.set(t,e))}0===this.idToIndexCache.size&&this.data.length>0&&this.logger.warnOnce(`dataIdKey '${this.dataIdKey}' was not found on any data item.`)}return this.idToIndexCache}removeFromGroupsById(e,t){for(const i of e){let e=0;for(;e<i.length&&t.size>0;){const n=this.getIdValue(i[e]);void 0!==n&&t.has(n)?(t.delete(n),i.splice(e,1)):e++}if(0===t.size)break}}collectUpdatedIndicesFromGroupsById(e,t){if(0===t.size||0===e.length)return[];const i=[];let n=0;for(const s of e){for(let e=0;e<s.length;e++){const a=this.getIdValue(s[e]);void 0!==a&&t.has(a)&&(s[e]=t.get(a),i.push(n),t.delete(a)),n++}if(0===t.size)break}return i}collectUpdatedOriginalIndicesById(e,t){const i=this.getIdToIndexMap();for(const[n,s]of e){const a=i.get(n);void 0===a||t.removedOriginalIndices.has(a)||(t.updatedOriginalIndices.add(a),t.pendingReplacements??(t.pendingReplacements=new Map),t.pendingReplacements.set(n,s),e.delete(n))}}collectUpdatedOriginalIndices(e,t){const i=this.getItemToIndexMap();for(const n of e){const s=i.get(n);void 0===s||t.removedOriginalIndices.has(s)||(t.updatedOriginalIndices.add(s),e.delete(n))}}removeFromTrackedInsertions(e,t){for(let i=0;i<t.trackedInsertions.length;i++){const n=t.trackedInsertions[i],s=n.items.length,a=[];let o=0;for(;o<n.items.length;)e.includes(n.items[o])?(a.push(o+a.length),n.items.splice(o,1),t.virtualLength--):o++;a.length>0&&this.adjustLaterInsertionsAfterRemoval(t.trackedInsertions,i,n,s,a)}}removeFromTrackedInsertionsById(e,t){const i=new Set;for(const t of e){const e=this.getIdValue(t);void 0!==e&&i.add(e)}if(0!==i.size)for(let e=0;e<t.trackedInsertions.length;e++){const n=t.trackedInsertions[e],s=n.items.length,a=[];let o=0;for(;o<n.items.length;){const e=this.getIdValue(n.items[o]);void 0!==e&&i.has(e)?(a.push(o+a.length),n.items.splice(o,1),t.virtualLength--,i.delete(e)):o++}if(a.length>0&&this.adjustLaterInsertionsAfterRemoval(t.trackedInsertions,e,n,s,a),0===i.size)break}}adjustLaterInsertionsAfterRemoval(e,t,i,n,s){const a=s.length;for(let o=t+1;o<e.length;o++){const t=e[o];if(t.virtualIndex<=i.virtualIndex)continue;const r=Math.min(Math.max(t.virtualIndex-i.virtualIndex,0),n);let l=0;for(const e of s){if(!(e<r))break;l++}r===n&&(l=a),l>0&&(t.virtualIndex-=l)}}buildSpliceOperations(e,t,i,n,s,a,o){const r=[];if(e>0&&r.push({index:0,deleteCount:0,insertCount:e}),a&&a.length>0){let t=a[0],i=1;for(let n=1;n<a.length;n++){const s=a[n];a[n-1]-s==1?i++:(r.push({index:t-i+1+e,deleteCount:i,insertCount:0}),t=s,i=1)}r.push({index:t-i+1+e,deleteCount:i,insertCount:0})}if(s.length>0)for(const t of s){const i=this.countRemovalsBeforeIndex(o,e,t.virtualIndex),n=t.virtualIndex-i;r.push({index:n,deleteCount:0,insertCount:t.items.length})}return i>0&&r.push({index:e+n+t,deleteCount:0,insertCount:i}),r}countRemovalsBeforeIndex(e,t,i){if(!e||0===e.length)return 0;let n=0;for(const s of e){if(!(s+t<i))break;n++}return n}resolveUpdatedIndices(e,t,i,n,s,a,o){const r=new Set;if(n)for(const e of n.updatedPrependsIndices)r.add(e);if(a.size>0){const t=Array.from(a).sort(((e,t)=>e-t));let i=0;for(const n of t){if(s)for(;i<s.length&&s[i]<n;)i++;const t=s?i:0,a=n+e;let l=0;for(const e of o)e.virtualIndex<=a&&(l+=e.items.length);const h=n+e-t+l;r.add(h)}}if(n){const a=e+i+t;for(const e of n.updatedAppendsIndices)r.add(a+e);if(n.updatedInsertionsIndices.length>0&&o.length>0){let t=0;for(const i of o){const a=this.countRemovalsBeforeIndex(s,e,i.virtualIndex),o=i.virtualIndex-a;for(let e=0;e<i.items.length;e++)n.updatedInsertionsIndices.includes(t)&&r.add(o+e),t++}}}return r}};function Th(e,t,i){const n=new Ph([...t.data],i,t.dataIdKey);return e?.transferDataSet(n,t),n}function Oh(e,t,i,n,s){const a=new Ph(i,s,n);return t&&e?.transferDataSet(a,t),a}var Rh=(()=>{var e=class e{constructor(e){this.chart=e}subscribe(t=e.DEFAULT_GROUP){let i=this.get(t);
1return i||(i={members:new Set},e.chartsGroups.set(t,i)),i.members.add(this.chart),this}unsubscribe(t=e.DEFAULT_GROUP){const i=this.get(t);return i?.members.delete(this.chart),delete i?.domains?.x?.sources?.[this.chart.id],delete i?.domains?.y?.sources?.[this.chart.id],this}getChart(){return this.chart}getGroupState(t=e.DEFAULT_GROUP){return this.get(t)}getGroupMembers(t=e.DEFAULT_GROUP){const i=this.get(t);return i?Array.from(i.members):[]}getGroupSiblings(t=e.DEFAULT_GROUP){return this.getGroupMembers(t).filter((e=>e!==this.chart))}getGroupSyncMode(t=e.DEFAULT_GROUP){return this.getGroupMembers(t).some((e=>e.series.length>1))?"multi-series":"single-series"}get(t){return e.chartsGroups.get(t)}};return e.chartsGroups=new Map,e.DEFAULT_GROUP=Symbol("sync-group-default"),e})();function Eh(e){for(const{legendType:t,legend:i}of e)if("category"===t)return i}var zh=class{constructor(e){this.legend=e,this.mementoOriginatorKey="legendPagination"}createMemento(){return this.legend.pagination?.currentPage??0}guardMemento(e){return null==e||"number"==typeof e&&Number.isInteger(e)&&e>=0}restoreMemento(e,t,i){null!=i&&this.legend.restorePage?.(i)}},Bh={};h(Bh,{NODE_UPDATE_STATE_TO_PHASE_MAPPING:()=>Fh,fromToMotion:()=>Vh,staticFromToMotion:()=>$h});var Fh={added:"add",updated:"update",removed:"remove",unknown:"initial","no-op":"none"};function Vh(e,t,i,s,a,o,r){const{fromFn:l,toFn:h,applyFn:c=(e,t)=>e.setProperties(t)}=a,{nodes:d,selections:u}=Ya(s),p=(s,a)=>{let d,u=0,p=0;for(const g of a){const m=s[u]===g,y={last:p>=a.length-1,lastLive:u>=s.length-1,prev:a[p-1],prevFromProps:d,prevLive:s[u-1],next:a[p+1],nextLive:s[u+(m?1:0)]},f=`${e}_${t}_${g.id}`;i.stopByAnimationId(f);let x="unknown";m?o&&r&&(x=Hh(g,g.unsafeDatum,o,r)):x="removed",g.transitionOut="removed"===x;const{phase:b,start:v,finish:S,delay:M,duration:k,...D}=l(g,g.unsafeDatum,x,y),{phase:w,start:I,finish:A,delay:C,duration:N,...L}=h(g,g.unsafeDatum,x,y),P=null==S;i.animate({id:f,groupId:e,phase:b??w??"update",duration:k??N,delay:M??C,from:D,to:L,ease:n.vTE,collapsable:P,onPlay:()=>{const e={...v,...I,...D};c(g,e,"start")},onUpdate(e){c(g,e,"update")},onStop:()=>{const e={...v,...I,...D,...L,...S,...A};c(g,e,"end")}}),m&&u++,p++,d=D}};let g=0;for(const s of u){const a=s.nodes();p(a.filter((e=>!s.isGarbage(e))),a),i.animate({id:`${e}_${t}_selection_${g}`,groupId:e,phase:"end",from:0,to:1,ease:n.vTE,onStop(){s.cleanup()}}),g++}p(d,d)}function $h(e,t,i,s,a,o,r){const{nodes:l,selections:h}=Ya(s),{start:c,finish:d,phase:u}=r;i.animate({id:`${e}_${t}`,groupId:e,phase:u??"update",from:a,to:o,ease:n.vTE,onPlay:()=>{if(!c)return;const e=Object.keys(c);for(const t of l)t.setPropertiesWithKeys(c,e);for(const t of h){const i=t.nodes();t.batchedUpdate((function(){for(const t of i)t.setPropertiesWithKeys(c,e)}))}},onUpdate(e){const t=Object.keys(e);for(const i of l)i.setPropertiesWithKeys(e,t);for(const i of h){const n=i.nodes();i.batchedUpdate((function(){for(const i of n)i.setPropertiesWithKeys(e,t)}))}},onStop:()=>{const e={...o,...d},t=Object.keys(e);for(const i of l)i.setPropertiesWithKeys(e,t);for(const i of h){const n=i.nodes();i.batchedUpdate((function(){for(const i of n)i.setPropertiesWithKeys(e,t);i.cleanup()}))}}})}function Hh(e,t,i,n){const s=i(e,t);return n.added.has(s)?"added":n.removed.has(s)?"removed":null==e.previousDatum&&null!=e.datum?"added":null!=e.previousDatum&&null==e.datum?"removed":"updated"}var jh={};function Wh(e,t){const{nodes:i,selections:n}=Ya(e);for(const e of n){const i=e.nodes();e.batchedUpdate((function(){for(const e of i){const i=t(e,e.unsafeDatum);e.setProperties(i)}e.cleanup()}))}for(const e of i){const i=t(e,e.unsafeDatum);e.setProperties(i)}}h(jh,{resetMotion:()=>Wh});var _h=class e{constructor(e,t,i=!0){this.parentNode=e,this.autoCleanup=i,this.garbageBin=new Set,this._nodesMap=new Map,this._nodes=[],this.data=[],this.debug=n.yar.create(!0,"scene","scene:selections"),this.nodeFactory=Object.prototype.isPrototypeOf.call(P,t)?()=>new t:t}static select(t,i,n=!0){return new e(t,i,n)}static selectNoInference(t,i,n=!0){return new e(t,i,n)}static selectAll(e,t){const i=[],n=e=>{if(t(e)&&i.push(e),e instanceof ke)for(const t of e.children())n(t)};return n(e),i}static selectByClass(t,...i){return e.selectAll(t,(e=>i.some((t=>e instanceof t))))}static selectByTag(t,i){return e.selectAll(t,(e=>e.tag===i))}createNode(e,t,i){const n=this.nodeFactory(e);return n.datum=e,t?.(n),null==i?this._nodes.push(n):this._nodes.splice(i,0,n),this.parentNode.appendChild(n),n}update(e,t,i){if(this.garbageBin.size>
10&&this.debug("Selection - update() called with pending garbage",e),i&&0===this._nodesMap.size&&this._nodes.length>0)for(const e of this._nodes)this.garbageBin.add(e);if(!i&&this._nodesMap.size>0&&this._nodesMap.clear(),i){const n=new Map,s=new Map;for(let t=0;t<e.length;t++){let a=i(e[t]);if(n.has(a)){const e=(s.get(a)??0)+1;s.set(a,e),a=`${a}:${e}`}n.set(a,t)}for(const[t,i]of this._nodesMap.entries()){const s=n.get(i);null==s?this.garbageBin.add(t):(t.datum=e[s],this.garbageBin.delete(t),n.delete(i))}for(const[i,s]of n.entries()){const n=e[s];this._nodesMap.set(this.createNode(n,t,s),i)}}else{const i=Math.max(e.length,this.data.length);for(let n=0;n<i;n++)n>=e.length?this.garbageBin.add(this._nodes[n]):n>=this._nodes.length?this.createNode(e[n],t):(this._nodes[n].datum=e[n],this.garbageBin.delete(this._nodes[n]))}return this.data=e.slice(),this.autoCleanup&&this.cleanup(),this}cleanup(){if(0===this.garbageBin.size)return this;const e=this;return this._nodes=this._nodes.filter((function(t){return!e.garbageBin.has(t)||(e._nodesMap.delete(t),e.garbageBin.delete(t),t.destroy(),!1)})),this}clear(){this.update([]);for(const e of this._nodesMap.keys())this.garbageBin.add(e);return this._nodesMap.clear(),this}isGarbage(e){return this.garbageBin.has(e)}each(e){const t=this._nodes;return this.parentNode.batchedUpdate((function(){for(const i of t.entries())e(i[1],i[1].unsafeNonNullDatum,i[0])})),this}*[Symbol.iterator](){for(let e=0;e<this._nodes.length;e++){const t=this._nodes[e];yield{node:t,datum:t.unsafeNonNullDatum,index:e}}}select(t){return e.selectAll(this.parentNode,t)}selectByClass(t){return e.selectByClass(this.parentNode,t)}selectByTag(t){return e.selectByTag(this.parentNode,t)}nodes(){return this._nodes}at(e){return this._nodes.at(e)}get length(){return this._nodes.length}batchedUpdate(e){this.parentNode.batchedUpdate(e)}},Gh=(()=>{var e=class extends ce{constructor(e={}){super(e),this.x1=0,this.y1=0,this.x2=0,this.y2=0,this.fill=void 0,this.strokeWidth=1}set x(e){this.x1=e,this.x2=e}set y(e){this.y1=e,this.y2=e}serialize(){return{type:"line",props:this.serializeProps()}}serializeProps(){return{...super.serializeProps(),x1:this.x1,y1:this.y1,x2:this.x2,y2:this.y2}}get midPoint(){return{x:(this.x1+this.x2)/2,y:(this.y1+this.y2)/2}}computeBBox(){return new m(Math.min(this.x1,this.x2),Math.min(this.y1,this.y2),Math.abs(this.x2-this.x1),Math.abs(this.y2-this.y1))}isPointInPath(e,t){return(this.x1===this.x2||this.y1===this.y2)&&this.getBBox().clone().grow(this.strokeWidth/2).containsPoint(e,t)}distanceSquared(e,t){const{x1:i,y1:s,x2:a,y2:o}=this;return(0,n.h6n)(e,t,i,s,a,o,1/0)}render(e){const{ctx:t,devicePixelRatio:i}=e;let{x1:n,y1:s,x2:a,y2:o}=this;if(n===a){const e=v(n*i,Math.trunc(this.strokeWidth*i))/i;n=e,a=e}else if(s===o){const e=v(s*i,Math.trunc(this.strokeWidth*i))/i;s=e,o=e}t.beginPath(),t.moveTo(n,s),t.lineTo(a,o),this.fillStroke(t,e.logger),this.fillShadow?.markClean(),super.render(e)}toSVG(){if(!this.visible)return;const e=(0,n.FJ6)("line");return e.setAttribute("x1",String(this.x1)),e.setAttribute("y1",String(this.y1)),e.setAttribute("x2",String(this.x2)),e.setAttribute("y2",String(this.y2)),this.applySvgStrokeAttributes(e),{elements:[e]}}};return e.className="Line",d([(0,n.k8u)()],e.prototype,"x1",2),d([(0,n.k8u)()],e.prototype,"y1",2),d([(0,n.k8u)()],e.prototype,"x2",2),d([(0,n.k8u)()],e.prototype,"y2",2),e})(),Kh=(()=>{var e=class extends n.XPE{};return d([n.mAP],e.prototype,"visible",2),d([n.mAP],e.prototype,"text",2),d([n.mAP],e.prototype,"renderer",2),e})(),Yh=(()=>{var e=class extends n.XPE{constructor(){super(...arguments),this.id=(0,n.sX_)(this),this.node=new Xe({zIndex:1}).setProperties({textAlign:"center",pointerEvents:1}),this.enabled=!1,this.textAlign="center",this.fontSize=n.SG9.SMALLER,this.fontFamily="sans-serif",this.wrapping="always",this.truncate=!0,this.padding=0,this.layoutStyle="block",this.tooltip=new Kh,this.truncated=!1}registerInteraction(e,t){return this.a11yContext={moduleCtx:e,axisId:t},e.eventsHub.on("layout:complete",(()=>this.updateA11yText(e,t)))}computeTextWrap(e,t){const{text:i,padding:s,wrapping:a,truncate:o}=this,r=o?e:1/0,l=o?t:1/0,h=Math.min(this.maxWidth??1/0,r)-2*s,c=this.maxHeight??l-2*s,d={maxWidth:h,maxHeight:c,font:this,textWrap:a};if(!Number.isFinite(h)&&!Number.isFinite(c))return void(this.node.text=i);let u;(0,n.cyL)(i)?(u=(0,n.kNh)(i,d),this.truncated=u.some(n.a0u)):(u=(0,n.C1g)((0,n.i$)(i),d),this.truncated=(0,n.KQS)(u)),this.node.text=u}updateA11yText(e,t){if(!this.enabled||!this.text)return void this.destroyProxyText();const i=Me.toCanvas(this.node);
1if(!i)return;null==this.proxyText&&(this.proxyText=e.widgets.axisWidgets.acquireTitle(t),this.proxyTextListeners=[this.proxyText.addListener("mousemove",(t=>this.handleMouseMove(e,t))),this.proxyText.addListener("mouseleave",(()=>this.handleTooltipHide(e))),this.proxyText.addListener("focus",(()=>this.handleFocus(e))),this.proxyText.addListener("blur",(()=>this.handleTooltipHide(e)))]);const s=(0,n.boc)(this.text);s!==this.lastProxyTextContent&&(this.proxyText.textContent=s,this.lastProxyTextContent=s);const{lastProxyBBox:a}=this;i.x===a?.x&&i.y===a?.y&&i.width===a?.width&&i.height===a?.height||(e.widgets.axisWidgets.setTitleBounds(t,i),this.lastProxyBBox={x:i.x,y:i.y,width:i.width,height:i.height})}getEffectiveTooltipVisible(){const{visible:e,text:t,renderer:i}=this.tooltip;return null!=e?e:null!=t||null!=i?"always":"auto"}getTooltipContent(e){const t=(0,n.boc)(this.text),{renderer:i,text:s}=this.tooltip;if(null!=i){const s={text:t},a=(0,n.cVk)(e.chartService,i,s);if(""===a)return;if(null!=a)return{type:"raw",rawHtmlString:(0,n.i$)(a)}}return{type:"structured",title:s??t}}showTooltip(e,t,i){if(!this.enabled)return;const n=this.getEffectiveTooltipVisible();if("never"===n)return;if("auto"===n&&!this.truncated)return;const s=this.getTooltipContent(e);null!=s&&e.tooltipManager.updateTooltip(this.id,{canvasX:t,canvasY:i,showArrow:!1},[s])}handleMouseMove(e,t){if(null==t)return;const{x:i,y:n}=Me.toCanvas(this.node),s=t.sourceEvent.offsetX+i,a=t.sourceEvent.offsetY+n;this.showTooltip(e,s,a)}handleFocus(e){const t=Me.toCanvas(this.node);if(!t)return;const i=t.x+t.width/2,n=t.y+t.height/2;this.showTooltip(e,i,n)}handleTooltipHide(e){e.tooltipManager.removeTooltip(this.id,void 0,!0)}destroy(){this.destroyProxyText()}destroyProxyText(){if(null!=this.proxyText){for(const e of this.proxyTextListeners??[])e();this.proxyTextListeners=void 0,this.a11yContext?.moduleCtx.widgets.axisWidgets.releaseTitle(this.a11yContext.axisId),this.proxyText=void 0,this.lastProxyTextContent=void 0,this.lastProxyBBox=void 0}}};return e.className="Caption",d([n.mAP,(0,n.s8C)("node","visible")],e.prototype,"enabled",2),d([n.mAP,(0,n.s8C)("node")],e.prototype,"text",2),d([n.mAP,(0,n.s8C)("node")],e.prototype,"textAlign",2),d([n.mAP,(0,n.s8C)("node")],e.prototype,"fontStyle",2),d([n.mAP,(0,n.s8C)("node")],e.prototype,"fontWeight",2),d([n.mAP,(0,n.s8C)("node")],e.prototype,"fontSize",2),d([n.mAP,(0,n.s8C)("node")],e.prototype,"fontFamily",2),d([n.mAP,(0,n.s8C)("node","fill")],e.prototype,"color",2),d([n.mAP],e.prototype,"spacing",2),d([n.mAP],e.prototype,"maxWidth",2),d([n.mAP],e.prototype,"maxHeight",2),d([n.mAP],e.prototype,"wrapping",2),d([n.mAP],e.prototype,"truncate",2),d([n.mAP],e.prototype,"padding",2),d([n.mAP],e.prototype,"layoutStyle",2),d([n.mAP],e.prototype,"tooltip",2),e})(),Uh=class{constructor(){this.moduleMap=new Map,this._version=0}get version(){return this._version}modules(){return this.moduleMap.values()}addModule(e,t){if(this.moduleMap.has(e))throw new Error(`AG Charts - module already initialised: ${e}`);this.moduleMap.set(e,t),this._version++}removeModule(e){this.moduleMap.has(e)&&(this.moduleMap.get(e)?.destroy?.(),this.moduleMap.delete(e),this._version++)}getModule(e){return this.moduleMap.get(e)}isEnabled(e){return this.moduleMap.has(e)}mapModules(e){return Array.from(this.moduleMap.values(),e)}destroy(){for(const e of this.moduleMap.values())e?.destroy?.();this.moduleMap.clear()}};function Xh(){return{"component:year":void 0,"component:month":void 0,"component:day":void 0,"component:none":void 0,"long:year":void 0,"long:month":void 0,"long:day":void 0,"long:none":void 0}}function Zh(e){return e?1:-1}var qh={left:1,center:.5,right:0};var Qh={left:-.5,center:0,right:.5};function Jh(e,t){return null==t?0:Qh[t]*Math.abs(e)}var ec={left:0,center:.5,right:1},tc={top:-.5,middle:0,bottom:.5};var ic={top:0,middle:.5,bottom:1};function nc(e,t,i){return(ic[t]-ic[i])*e}function sc(e,t,i,n){const s=Math.cos(n),a=Math.sin(n),o=e.x-t,r=o+e.width,l=e.y-i,h=l+e.height,c={x0:1/0,x1:-1/0,y0:1/0,y1:-1/0};for(const[e,t]of[[o,l],[r,l],[r,h],[o,h]]){const i=e*s-t*a,n=e*a+t*s;c.x0=Math.min(c.x0,i),c.x1=Math.max(c.x1,i),c.y0=Math.min(c.y0,n),c.y1=Math.max(c.y1,n)}return c}function ac(e,t,i){return(ec[t]-ec[i])*e}function oc(e,t,i,s,a,o){const r=e?.formatter,l=e?.format,{type:h,value:c,domain:d,boundSeries:u}=s,p="number"===s.type?s.fractionDigits:void 0,g="date"===s.type?s.unit:void 0;let m;if(null!=r){const e="date"===s.type?s.step:void 0,t="number"===s.type?s.visibleDomain:void 0;m=i(r,{type:h,value:c,index:a,depth:o?.depth,domain:d,fractionDigits:p,unit:g,step:e,boundSeries:u,visibleDomain:t})}if(null!=l&&null==m){const{specifier:e,dateStyle:i="long",truncateDate:s}=o??{},a=`${i}:${s??"none"}`;let r=t[a];const d=ut.mergeSpecifiers(e,l);r?.type===h&&r?.unit===g&&(0,n.DH9)(r?.mergedFormat,d)||(r={type:h,mergedFormat:d,unit:g,formatter:ut.getFormatter(h,d,g,i,{truncateDate:s})},t[a]=r),m=r.formatter?.(c,p)}return null==m||(0,n.cyL)(m)?m:String(m)}var rc=(e=>(e[e.TickAndDomain=0]="TickAndDomain",e[e.TicksOnly=1]="TicksOnly",e[e.Off=2]="Off",e))(rc||{});var lc=2*Math.PI,hc=lc/2;function cc(e){const{min:t,max:i}=e,n=e=>e<t||e>i,s={fromFn(e,t,i){let{x1:s,x2:a,y1:o,y2:r}=e,l=e.opacity;return("added"===i||n(t.offset))&&(({x1:s,x2:a,y1:o,y2:r}=t),l=0),{x1:s,x2:a,y1:o,y2:r,opacity:l,phase:Fh[i]}},toFn(e,t,i){const{x1:n,x2:s,y1:a,y2:o}=t;let r=1;return"removed"===i&&(r=0),{x1:n,x2:s,y1:a,y2:o,opacity:r}},applyFn(e,t){e.setProperties(t),e.visible=!n(e.y)}},a={fromFn(e,t,i){const s=e.previousDatum??t;let{x:a,y:o,rotationCenterX:r,rotationCenterY:l,rotation:h}=s,c=e.opacity;return"removed"===i||n(s.y)?h=t.rotation:("added"===i||n(e.unsafeDatum.y))&&(({x:a,y:o,rotationCenterX:r,rotationCenterY:l,rotation:h}=t),c=0),{x:a,y:o,rotationCenterX:r,rotationCenterY:l,rotation:h,opacity:c,phase:Fh[i]}},toFn(e,t,i){const{x:n,y:s,rotationCenterX:a,rotationCenterY:o}=t;let r=0,l=1;var h,c;return"added"===i?r=t.rotation:"removed"===i?(l=0,r=t.rotation):(h=e.previousDatum?.rotation??t.rotation,c=t.rotation,r=Math.abs(c-h)<hc?c:h>c?c+lc:c-lc),{x:n,y:s,rotationCenterX:a,rotationCenterY:o,rotation:r,opacity:l,finish:{rotation:t.rotation}}}};return{tick:s,line:{fromFn(e,t){const{x1:i,x2:n,y1:s,y2:a}=e.unsafePreviousDatum??t;return{x1:i,x2:n,y1:s,y2:a,phase:Fh.updated}},toFn(e,t){const{x1:i,x2:n,y1:s,y2:a}=t;return{x1:i,x2:n,y1:s,y2:a}}},label:a,group:{fromFn(e,t){const{translationX:i,translationY:n}=e;return{translationX:i,translationY:n,phase:Fh.updated}},toFn(e,t){const{translationX:i,translationY:n}=t;return{translationX:i,translationY:n}}}}}function dc(){return(e,t)=>({x:t.x,y:t.y,rotationCenterX:t.rotationCenterX,rotationCenterY:t.rotationCenterY,rotation:t.rotation})}var uc=(e=>
1(e[e.TickLines=0]="TickLines",e[e.AxisLine=1]="AxisLine",e[e.TickLabels=2]="TickLabels",e))(uc||{});function pc(e,t){return e.domain===t.domain&&e.rangeExtent===t.rangeExtent&&e.nice[0]===t.nice[0]&&e.nice[1]===t.nice[1]&&e.gridLength===t.gridLength&&e.visibleRange[0]===t.visibleRange[0]&&e.visibleRange[1]===t.visibleRange[1]&&e.scrollbarKey===t.scrollbarKey&&e.initialPrimaryTickCount?.unzoomed===t.initialPrimaryTickCount?.unzoomed&&e.initialPrimaryTickCount?.zoomed===t.initialPrimaryTickCount?.zoomed}function gc(e,t,i){const s=e.bandwidth??0,a=((e.step??0)-s)/2,o=e.convert(i),r=o-a,l=o+s+a;return[o,(0,n.jVD)(r,t),(0,n.jVD)(l,t)]}var mc=(()=>{var e=class e{constructor(t,i,s,a){this.moduleCtx=t,this.scale=s,this.id="unknown",this.userKey="",this.nice=!0,this.mirrored=!1,this.parallel=!1,this.dataDomain={domain:[],clipped:!1},this.allowNull=!1,this.pickTickData=[],this.caption=new Yh,this._gridLength=0,this.gridPadding=0,this.seriesAreaPadding=0,this._layoutConstraints={stacked:!0,align:"justify",width:100,unit:"percent"},this.boundSeries=[],this.includeInvisibleDomains=!1,this.interactionEnabled=!0,this.axisGroup=new ke({name:`${this.id}-axis`}),this.tickLineGroup=this.axisGroup.appendChild(new Ie({name:`${this.id}-Axis-tick-lines`,zIndex:0})),this.tickLabelGroup=this.axisGroup.appendChild(new Ie({name:`${this.id}-Axis-tick-labels`,zIndex:2})),this.labelGroup=new ke({name:`${this.id}-Labels`,zIndex:n.Dcv.SERIES_ANNOTATION}),this.gridGroup=new we({name:`${this.id}-Axis-grid`,zIndex:n.Dcv.AXIS_GRID}),this.gridFillGroup=this.gridGroup.appendChild(new ke({name:`${this.id}-gridFills`})),this.gridLineGroup=this.gridGroup.appendChild(new ke({name:`${this.id}-gridLines`})),this.overlayLowGroup=new Ie({name:`${this.id}-Overlay-Low`,zIndex:n.Dcv.SERIES_CROSSLINE_RANGE}),this.overlayMidGroup=new Ie({name:`${this.id}-Overlay-Mid`,zIndex:n.Dcv.SERIES_CROSSLINE_LINE}),this.overlayHighGroup=new Ie({name:`${this.id}-Overlay-High`,zIndex:n.Dcv.SERIES_LABEL}),this.tickLabelGroupSelection=_h.select(this.tickLabelGroup,Ze,!1),this.formatterCache={"component:year":void 0,"component:month":void 0,"component:day":void 0,"component:none":void 0,"long:year":void 0,"long:month":void 0,"long:day":void 0,"long:none":void 0},this.defaultTickMinSpacing=e.defaultTickMinSpacing,this.translation={x:0,y:0},this.layout={label:{fractionDigits:0,spacing:5,format:void 0,boxOffset:0},labelThickness:0},this.axisContext=void 0,this.cleanup=new n._uV,this.isHovering=!1,this.range=[0,1],this.visibleRange=[0,1],this.animatable=!0,this.tickLayout=void 0,this.formatterBoundSeries=new n.laH((()=>{const{direction:e,boundSeries:t}=this;return(0,n.olf)(t.flatMap((t=>t.getFormatterContext(e))))})),this.pickComputationEnabled=!0,this.moduleMap=new Uh,this.id=i,this.options=a,s.logger=t.logger;const o=a.context;void 0!==o&&(this.context=o),this.syncOptionDerivedState(a),this.range=this.scale.range.slice(),this.cleanup.register(this.moduleCtx.widgets.containerWidget.addListener("mousemove",(e=>this.onMouseMove(e))),this.moduleCtx.widgets.containerWidget.addListener("mouseleave",(()=>this.endHovering())),this.moduleCtx.eventsHub.on("font:load",(()=>this.invalidateLayoutCache())))}get userListeners(){}get gridLength(){return this._gridLength}set gridLength(e){const t=this._gridLength;this._gridLength=e,t!==e&&this.onGridLengthChange(e,t)}get type(){return this.constructor.type??""}get layoutConstraints(){return this._layoutConstraints}get requiredRange(){return this._requiredRange}set requiredRange(e){this._requiredRange=e}get primaryLabel(){}get primaryTick(){}getLabelFormat(){}getPrimaryLabelFormat(){}isCategoryLike(){return!1}applyOptions(e){this.options=e,this.syncOptionDerivedState(e),this.invalidateLayoutCache()}syncOptionDerivedState(e){this.nice=e.nice??!0;const t=e.layoutConstraints;t&&(this._layoutConstraints={...this._layoutConstraints,...t})}resetAnimation(e){}onMouseMove(e){const t=this.tickLabelGroup.pickNode(e.currentX,e.currentY),i=t?.unsafeDatum,{textUntruncated:n}=i??{};n?(this.moduleCtx.tooltipManager.updateTooltip(this.id,{canvasX:e.currentX,canvasY:e.currentY,showArrow:!1}
1,[{type:"structured",title:n}]),this.isHovering=!0):this.endHovering()}endHovering(){this.isHovering&&(this.moduleCtx.tooltipManager.removeTooltip(this.id,void 0,!0),this.isHovering=!1)}destroy(){this.moduleMap.destroy(),this.moduleContext?.destroy(),this.cleanup.flush()}setScaleRange(e){const{range:t,scale:i}=this,n=(t[1]-t[0])/(e[1]-e[0]),s=n*e[0],a=t[0]-s;i.range=[a,a+n]}updateScale(){this.setScaleRange(this.visibleRange),this.notifyAxisPlugins("onScaleChange")}attachAxis(e){e.gridNode.appendChild(this.gridGroup),e.axisNode.appendChild(this.axisGroup),e.labelNode.appendChild(this.labelGroup),e.overlayLowNode.appendChild(this.overlayLowGroup),e.overlayMidNode.appendChild(this.overlayMidGroup),e.overlayHighNode.appendChild(this.overlayHighGroup)}detachAxis(){this.gridGroup.remove(),this.axisGroup.remove(),this.labelGroup.remove(),this.overlayLowGroup.remove(),this.overlayMidGroup.remove(),this.overlayHighGroup.remove()}attachLabel(e){this.labelGroup.append(e)}inRange(e,t=0){const[i,s]=(0,n.uYy)(this.range);return e>=i-t&&e<=s+t}getRangeOverflow(e){const{range:t,visibleRange:i}=this,s=(t[1]-t[0])/(i[1]-i[0]),[a,o]=(0,n.uYy)([t[0]-s*i[0],t[0]-s*i[0]+s]);return e<a?e-a:e>o?e-o:0}onGridLengthChange(e,t){t^e&&this.onGridVisibilityChange(),this.notifyAxisPlugins("onGridChange")}onGridVisibilityChange(){}update(){this.formatterBoundSeries.clear(),this.updatePosition(),this.updateSelections(),this.gridLineGroup.visible=this.options.gridLine.enabled&&!this.hasNoSeriesData(),this.updateLabels(),this.notifyAxisPlugins("onAxisUpdate")}getLabelStyles(e,t,i=this.options.label){const s={border:i.border,color:i.color,cornerRadius:i.cornerRadius,fill:i.fill,fillOpacity:i.fillOpacity,fontFamily:i.fontFamily,fontSize:i.fontSize,fontStyle:i.fontStyle,fontWeight:i.fontWeight,padding:i.padding,spacing:i.spacing};let a;if(i.itemStyler&&(a=this.cachedCallWithContext(i.itemStyler,{...e,...s})),null==a&&null==t)return s;const o=(0,n.HFk)(a,t,s);return{border:o.border,color:o.color,cornerRadius:o.cornerRadius,fill:o.fill,fillOpacity:o.fillOpacity,fontFamily:o.fontFamily,fontSize:o.fontSize,fontStyle:o.fontStyle,fontWeight:o.fontWeight,padding:o.padding,spacing:o.spacing}}getLabelBoxOffset(){return 0}getTickSize(e=this.options.tick){return e.enabled?e.size:0}getTickSpacing(e=this.options.tick){if(!e.enabled)return 0;const t=this.chartLayout?.scrollbars?.[this.id];return t?.enabled&&"inner"===t.placement?t.tickSpacing??0:0}processData(){this.invalidateLayoutCache();const{includeInvisibleDomains:e,boundSeries:t,direction:i}=this,n=(e?t:t.filter((e=>e.isEnabled()))).map((e=>e.getDomain(i)));this.setDomains(...n)}getDomainExtentsNice(){return[this.nice,this.nice]}setDomains(...e){let t,i;if(e.length>0){const n=this.scale.normalizeDomains(...e);t={domain:n.domain,sortMetadata:{sortOrder:1}},i=n.animatable}else t={domain:[]},i=!0;this.dataDomain=this.normaliseDataDomain(t),this.allowNull=this.dataDomain.domain.some((function(e){return null==e})),this.options.reverse&&(this.dataDomain={...this.dataDomain,domain:this.dataDomain.domain.toReversed()}),this.animatable=i}calculateDomain(e,t="none"){const{dataDomain:{domain:i},range:s,scale:a,gridLength:o}=this,r=(0,n.DuJ)(s),l=[0,1],h=this.getDomainExtentsNice();this.updateScale();const{unzoomedTickLayoutCache:c}=this;let d;if(null!=c&&pc(c,{domain:i,rangeExtent:r,nice:h,gridLength:o,visibleRange:l,initialPrimaryTickCount:e,scrollbarKey:t}))d=c.tickLayout;else{const n=a.range;this.setScaleRange([0,1]);const s=h.map((e=>e?0:2));d=this.calculateTickLayout(i,s,[0,1],e),a.range=n,this.unzoomedTickLayoutCache={domain:i,rangeExtent:r,nice:h,gridLength:o,visibleRange:l,initialPrimaryTickCount:e,scrollbarKey:t,tickLayout:d}}return this.updateScale(),a.domain=d.niceDomain,{unzoomedTickLayout:d,domain:a.domain}}calculateLayout(e,t){this.chartLayout=t;const i=this.getScrollbarLayoutCacheKey(t),{visibleRange:s}=this,a=0===s[0]&&1===s[1],{unzoomedTickLayout:o,domain:r}=this.calculateDomain(e,i),l=this.getDomainExtentsNice();let h;if(a)h=o;else{const{range:t,gridLength:a}=this,o=(0,n.DuJ)(t),c=l.map((e=>e?1:2)),{tickLayoutCache:d}=this;null!=d&&pc(d,{domain:r,rangeExtent:o,nice:l,gridLength:a,visibleRange:s,initialPrimaryTickCount:e,scrollbarKey:i}
1)?h=d.tickLayout:(h=this.calculateTickLayout(r,c,s,e),this.tickLayoutCache={domain:r,rangeExtent:o,nice:l,gridLength:a,visibleRange:s,initialPrimaryTickCount:e,scrollbarKey:i,tickLayout:h})}const{rawTickCount:c=0,fractionDigits:d,bbox:u}=h,p=o.rawTickCount??0,g=0!==c&&0!==p?{zoomed:c,unzoomed:p}:void 0;return this.tickLayout=h.layout,this.layout.label={fractionDigits:d,spacing:this.options.label.spacing,format:this.getLabelFormat(),boxOffset:this.getLabelBoxOffset()},this.notifyAxisPlugins("onAxisLayout"),{primaryTickCount:g,bbox:u}}invalidateLayoutCache(){this.unzoomedTickLayoutCache=void 0,this.tickLayoutCache=void 0,this.tickLayout=void 0}getScrollbarLayoutCacheKey(e){const t=e?.scrollbars?.[this.id];return t?.enabled?`${t.placement}:${t.spacing}:${t.thickness}:${t.tickSpacing}`:"none"}updatePosition(){const{gridGroup:e,overlayLowGroup:t,overlayMidGroup:i,overlayHighGroup:n,translation:s}=this,a=Math.floor(s.x),o=Math.floor(s.y);e.setProperties({translationX:a,translationY:o}),t.setProperties({translationX:a,translationY:o}),i.setProperties({translationX:a,translationY:o}),n.setProperties({translationX:a,translationY:o})}getOverlayGroup(e){return"low"===e?this.overlayLowGroup:"mid"===e?this.overlayMidGroup:this.overlayHighGroup}notifyAxisPlugins(e){for(const t of this.moduleMap.modules())t[e]?.()}tickFormatter(e,t,i,n,s,a="long"){const{moduleCtx:o}=this,r=this.options.label,{formatManager:l}=o,h=i?this.primaryLabel:void 0,c=this.tickFormatParams(e,t,n,s),d=this.formatterBoundSeries.get();let u,p,g;if("number"===c.type)u=c.fractionDigits;else if("date"===c.type){const{unit:e,step:t,epoch:i}=c;p={unit:e,step:t,epoch:i},g=c.truncateDate}const m=this.uncachedCallWithContext.bind(this),y={datum:void 0,seriesId:void 0,legendItemName:void 0,key:void 0,source:"axis-label",property:this.getFormatterProperty(),domain:e,boundSeries:d},f=h??r,x=this.getLabelFormat(),b=i?x:void 0,{allowNull:v}=this,S={specifier:ut.mergeSpecifiers(this.getPrimaryLabelFormat(),x),truncateDate:g,allowNull:v},M=this.formatterCache;return(e,t,i)=>{const n=this.datumFormatParams(e,y,u,p,a);return n.value=e,null!=i&&(n.depth=i),oc(f,M,m,n,t,{specifier:b,dateStyle:a,truncateDate:g,depth:i})??l.format(m,n,S)??l.defaultFormat(n,S)}}formatDatum(e,t,i,s,a,o,r,l,h,c,d){if(null==t&&!d)return"";const{moduleCtx:u,dataDomain:p}=this;l??(l=p.domain);const{formatManager:g}=u,m=this.formatterBoundSeries.get();let y;switch(i){case"crosshair":case"annotation-label":y=this.layout.label.fractionDigits+1;break;case"series-label":y=2;break;case"tooltip":y=3;break;case"legend-label":y=void 0}const f=this.datumFormatParams(t,{source:i,datum:o,seriesId:s,legendItemName:a,key:r,property:this.getFormatterProperty(),domain:l,boundSeries:m},y,void 0,"long"),{type:x,value:b}=f,v=this.createCallWithContext(e),S=h?.formatValue(v,x,b,c??f)??g.format(v,f,{allowNull:d})??(()=>{const e=null==this.options.label.formatter?void 0:this.resolveTickIdentity(b),t=null==e?.depth?void 0:e;return oc(this.options.label,this.formatterCache,v,f,t?.index??Number.NaN,t&&{depth:t.depth,dateStyle:void 0,truncateDate:void 0})})()??g.defaultFormat(f);return(0,n.cyL)(S)?S:String(S)}getBBox(){return this.axisGroup.getBBox()}getCanvasBounds(){return Me.toCanvas(this.axisGroup)}hasVisibleSeries(){return this.boundSeries.some((e=>e.isEnabled()))}hasNoSeriesData(){let e=0;for(const t of this.moduleCtx.chartService.series)if(t.isEnabled()){if(t.hasData)return!1;e++}return e>0}clipTickLines(e,t,i,n){this.tickLineGroup.setClipRect(new m(e,t,i,n))}clipGrid(e,t,i,n){this.gridGroup.setClipRect(new m(e,t,i,n))}getFormatterProperty(){const{direction:e,boundSeries:t}=this;let i=e;for(const n of t){const t=n.resolveKeyDirection(e);if(t!==e){i=t;break}}return i}getTitleFormatterParams(e){const{direction:t}=this,i=this.formatterBoundSeries.get(),n=this.options.title;return{domain:e,direction:t,boundSeries:i,defaultValue:n?.text}}normaliseDataDomain(e){return{domain:[...e.domain],clipped:!1}}setPickComputationEnabled(e){this.pickComputationEnabled=e}isPickComputationEnabled(){return this.pickComputationEnabled}getLayoutTranslation(){return this.translation}get continuous(){return Rl.is(this.scale)||Hl.is(this.scale)}getLayoutState(){return{id:this.id,rect:this.getBBox(),translation:this.getLayoutTranslation(),gridPadding:this.gridPadding,seriesAreaPadding:this.seriesAreaPadding,tickSize:this.getTickSize(),direction:this.direction,domain:this.dataDomain.domain,scale:this.scale,...this.layout}}getModuleMap(){return this.moduleMap}getUpdateTypeOnResize(){return n.GvF.PERFORM_LAYOUT}createModuleContext(){return this.axisContext??(this.axisContext=this.createAxisContext()),this.moduleContext??(this.moduleContext=this.moduleCtx.child().constant("parent",this.axisContext)),this.moduleContext}createAxisContext(){const e=this,{scale:t}=this;return{caller:this,get listeners(){return e.userListeners},axisId:this.id,get userAxisId(){return e.userKey}
1,axisType:this.type,scale:this.scale,direction:this.direction,continuous:this.continuous,get mirrored(){return e.mirrored},get reverse(){return e.options.reverse},get gridLength(){return e.gridLength},get gridPadding(){return e.gridPadding},get range(){return e.range},hasDefinedDomain:()=>this.hasDefinedDomain(),hasVisibleSeries:()=>this.hasVisibleSeries(),getCanvasBounds:()=>this.getCanvasBounds(),seriesKeyProperties:()=>this.boundSeries.reduce(((e,t)=>{const i=t.getKeyProperties(this.direction);for(const t of i)e.add(t);return e}),new Set),seriesIds:()=>this.boundSeries.map((e=>e.id)),scaleInvert:e=>t.invert(e,!0),formatScaleValue:(e,t,i)=>{const{allowNull:n}=this;return this.formatDatum(void 0,e,t,void 0,void 0,void 0,void 0,void 0,i,void 0,n)},attachLabel:e=>this.attachLabel(e),attachAxisOverlay:(e,t)=>this.getOverlayGroup(t).appendChild(e),inRange:(e,t)=>this.inRange(e,t),getRangeOverflow:e=>this.getRangeOverflow(e),pickValue:e=>this.pickValue(e),pickBand:e=>this.pickBand(e),measureBand:e=>this.measureBand(e)}}pickValue(e){const t=this.getLayoutTranslation(),i=e.canvasX-t.x,s=e.canvasY-t.y,a=this.isVertical(),o=a?s:i,r=Zh(this.mirrored)*(a?1:-1),l=Math.max(0,r*(a?i:s)),h=(c=this.scale,d=o,c.invert(d,!0));var c,d;const u=function(e,t){if(!Rl.is(e))return t;if("number"==typeof t){const[i,s]=[e.domainMin,e.domainMax];return(0,n.qE8)(i,t,s)}if("bigint"==typeof t){const[i,n]=[e.domainMin,e.domainMax];return t>n?n:t<i?i:t}if(t instanceof Date){const[i,s]=[e.domainMin,e.domainMax];return new Date((0,n.qE8)(i.getTime(),t.getTime(),s.getTime()))}return t}(this.scale,h),p=function(e){return e.domain}(this.scale);if(null==u||null==p)return;const g=this.resolvePickDatum(o,l),m=g?.index??-1;return{caller:this,axisId:this.userKey,value:u,index:m,depth:g?.depth,groupPercentage:this.pickGroupPercentage(u,o),direction:this.direction,boundSeries:this.formatterBoundSeries.get(),domain:p}}pickGroupPercentage(e,t){const{scale:i}=this;if(!Vl.is(i))return;const n=i.convert(e);if(!Number.isFinite(n))return;const s=0===i.bandwidth?i.step:i.bandwidth;return 0===s?0:(t-n)/s}setPickTickData(e,t=0){this.pickTickData=e.map((({index:e,translation:i,tick:n})=>({index:e-t,value:n,along:[i,i]})))}resolvePickDatum(e,t){let i,n=1/0;for(const s of this.pickTickData){if(null!=s.cross&&(t<s.cross[0]||t>s.cross[1]))continue;const[a,o]=s.along;if(e>=a&&e<=o)return s;const r=e<a?a-e:e-o;r<n&&(n=r,i=s)}return i}resolveTickIdentity(e){for(const t of this.pickTickData){if(null!=t.depth&&0!==t.depth)continue;if((0,n.cyL)(t.value)&&(0,n.cyL)(e)?(0,n.r1i)(t.value,e):t.value===e)return{index:t.index,depth:t.depth,formattedValue:t.formattedValue}}}pickBand(e){if(!Vl.is(this.scale))return;const{scale:t,range:i,id:n}=this,s=t.invert(this.isVertical()?e.y:e.x,!0),[a,o,r]=gc(t,i,s);return{id:n,value:s,band:[o,r],position:a}}measureBand(e){if(!Vl.is(this.scale))return;const[,t,i]=gc(this.scale,this.range,e);return{band:[t,i]}}isVertical(){return this.direction===n.tv$.Y}isReversed(){return this.options.reverse}cachedCallWithContext(e,t){const{callbackCache:i,chartService:n}=this.moduleCtx;return i.call([this,n],e,t)}uncachedCallWithContext(e,t){const{chartService:i}=this.moduleCtx;return(0,n.cVk)([this,i],e,t)}createCallWithContext(e){const{chartService:t}=this.moduleCtx;return(i,s)=>(0,n.cVk)([e,this,t],i,s)}};return e.defaultTickMinSpacing=50,e})(),yc=class e extends Vl{constructor(){super(...arguments),this.type="category",this.defaultTickCount=0,this.index=new Map,this.indexInitialized=!1,this._domain=[]}static is(t){return t instanceof e}set domain(e){this._domain!==e&&(this.invalid=!0,this._domain=e,this.index.clear(),this.indexInitialized=!1)}get domain(){return this._domain}get bands(){return this._domain}normalizeDomains(...e){let t;const i=new Set;let n=!0;for(const s of e){const e=s.domain;i.has(e)||(i.add(e),null==t?t=fc(e):(n&&(n=xc(e,t)),t=fc([...t,...e])))}return t??(t=[]),{domain:t,animatable:n}}toDomain(e){}invert(e,t=!1){this.refresh();const i=t?this.bandwidth/2:0,n=this.invertNearestIndex(Math.max(0,e-i));return t||e===this.ordinalRange(n)?this.domain[n]:void 0}invertWithPercentage(e){this.refresh();const t=this.invertNearestIndex(e,"left"),i=this.domain[t];if(null==i)return;const n=0===this.bandwidth?this.step:this.bandwidth,s=this.convert(i);return{value:i,groupPercentage:0===n?0:(e-s)/n}}ticks(e,t=this.domain,i){const{bands:s}=this;let{tickCount:a}=e;if(0===a){const e=s.length>1?1:0;return{ticks:s[e]?[s[e]]:[],count:void 0,firstTickIndex:e}}let o=null!=a&&0!==a?Math.trunc(s.length/a):1;if(o=(0,n.s29)(o),o<=1)return R(t,!1,i);a=Math.trunc(s.length/o);const r=o*a,l=(0,n.s29)(Math.trunc((s.length-r)/2)),h=(0,n.qE8)(0,Math.floor((i?.[0]??0)*s.length),s.length),c=(0,n.qE8)(0,Math.ceil((i?.[1]??1)*s.length),s.length),d=Math.floor((h-l)/o)*o+l,u=Math.ceil((c-l)/o)*o+l,p=[];for(let e=d;e<u;e+=o)e>=0&&e<s.length&&p.push(s[e]);let g=p.length>0?this.findIndex(p[0]):void 0;return null!=g&&(g=Math.floor((g-l)/o)),{ticks:p,count:void 0,firstTickIndex:g}}findIndex(e){const{index:t,indexInitialized:i}=this;if(!i){const{domain:e}=this;for(let i=0;i<e.length;
1i++)t.set((0,n.nnz)(e[i]),i);this.indexInitialized=!0}return t.get((0,n.nnz)(e))}};function fc(e){let t;const i=new Set;for(const s of e){const a=(0,n.nnz)(s),o=i.size;i.add(a);i.size!==o?t?.push(s):t??(t=e.slice(0,i.size))}return t??e}function xc(e,t){let i=-1;for(const n of e){const e=t.indexOf(n);if(-1===e)i=1/0;else{if(e<=i)return!1;i=e}}return!0}var bc=new Date(1970,0,4),vc=class e extends Rl{constructor(){super([],[0,1]),this.type="time"}static is(t){return t instanceof e}toDomain(e){return new Date(e)}convert(e,t){return super.convert(null==e?Number.NaN:(0,n.Hre)(e),t)}invert(e){return new Date(super.invert(e))}niceDomain(e,t=this.domain){if(t.length<2)return[];let[i,s]=t;const a=this.getPixelRange();for(let t=0;t<4;t++){const[t,o]=kc(i,s,e,a,this.logger);if((0,n.nnz)(i)===(0,n.nnz)(t)&&(0,n.nnz)(s)===(0,n.nnz)(o))break;i=t,s=o}return[i,s]}ticks(e,t=this.domain,i=[0,1],{extend:s=!1}={}){const{nice:a,interval:o,tickCount:r=Rl.defaultTickCount,minTickCount:l,maxTickCount:h}=e;if(t.length<2)return;const c=t.map(n.nnz),d=c[0],u=c.at(-1);if(null!=o){return{ticks:Mc({start:d,stop:u,interval:o,availableRange:this.getPixelRange(),visibleRange:i,extend:s,logger:this.logger})??Sc({start:d,stop:u,tickCount:r,minTickCount:l,maxTickCount:h,visibleRange:i,extend:s}),count:void 0}}if(a.every(Boolean)&&2===r)return{ticks:t,count:void 0};if(a.every(Boolean)&&1===r)return{ticks:t.slice(0,1),count:void 0};const p=(0,n.M2I)(d,u,r,l,h,{weekStart:bc});if(null==p)return;return{ticks:(0,n.tUW)(p,new Date(d),new Date(u),{visibleRange:i,extend:s}),count:void 0,firstTickIndex:(0,n.Fun)(p,new Date(d),new Date(u),{visibleRange:i,extend:s}),timeInterval:p}}};function Sc({start:e,stop:t,tickCount:i,minTickCount:s,maxTickCount:a,visibleRange:o,extend:r}){const l=(0,n.M2I)(e,t,i,s,a,{weekStart:bc});return l?(0,n.tUW)(l,new Date(e),new Date(t),{visibleRange:o,extend:r}):[]}function Mc({start:e,stop:t,interval:i,availableRange:s,visibleRange:a,extend:o,logger:r}){if(!i)return[];if("number"!=typeof i){const l=(0,n.tUW)(i,new Date(e),new Date(t),{visibleRange:a,extend:o});if((0,n.bVu)(l.length,s,r))return;return l}const l=Math.abs(i);if((0,n.bVu)(Math.abs(t-e)/l,s,r))return;const h=n._ZY.findLast((e=>l%e.duration==0));if(h){const{timeInterval:i,step:s,duration:r}=h,c={...i,step:s*(0,n.SBk)(i)*Math.round(l/r),epoch:(0,n.v4Y)(i,{weekStart:bc})};return(0,n.tUW)(c,new Date(e),new Date(t),{visibleRange:a,extend:o})}let c=new Date(Math.min(e,t));const d=new Date(Math.max(e,t)),u=[];for(;c<=d;)u.push(c),c=new Date(c),c.setMilliseconds(c.getMilliseconds()+l);return u}function kc(e,t,i,s,a){const{interval:o}=i,r=Math.min((0,n.nnz)(e),(0,n.nnz)(t)),l=Math.max((0,n.nnz)(e),(0,n.nnz)(t));let h;if(null!=o&&"number"!=typeof o)h=o;else{let e;"number"==typeof o&&(e=(l-r)/Math.max(o,1),(0,n.bVu)(e,s,a)&&(e=void 0)),e??(e=i.tickCount??Rl.defaultTickCount),h=(0,n.M2I)(r,l,e,i.minTickCount,i.maxTickCount,{weekStart:bc})}if(null==h)return[e,t];const c=(0,n.tUW)(h,new Date(r),new Date(l),{extend:!0});if(null==c||c.length<2)return[e,t];const d=c[0],u=c.at(-1);return e<=t?[d,u]:[u,d]}var Dc=class e extends Hl{constructor(){super(...arguments),this.type="ordinal-time",this.defaultTickCount=Rl.defaultTickCount,this._domain=[],this.isReversed=!1}static is(t){return t instanceof e}set domain(e){e!==this._domain&&(this.invalid=!0,this._domain=e,this._bands=void 0,this._numericBands=void 0,this._uniformityCache=void 0,this._uniformityCacheVisibleStart=void 0,this._uniformityCacheVisibleEnd=void 0,this._uniformityCacheVisible=void 0,this.isReversed=wc(e))}get domain(){return this._domain}get bands(){return this._bands??(this._bands=this.isReversed?this.domain.slice().reverse():this.domain),this._bands}get numericBands(){return this._numericBands??(this._numericBands=this.bands.map((e=>e.valueOf()))),this._numericBands}getUniformityCache(e){const{bands:t}=this,i=t.length;if(!e||0===e[0]&&1===e[1])return i>1e3&&void 0===this._uniformityCache&&(this._uniformityCache=$l(t)),this._uniformityCache;const n=Math.floor(e[0]*i),s=Math.min(Math.ceil(e[1]*i),i-1);if(void 0!==this._uniformityCacheVisible&&this._uniformityCacheVisibleStart===n&&this._uniformityCacheVisibleEnd===s)return this._uniformityCacheVisible;const a=$l(t,n,s);return this._uniformityCacheVisibleStart=n,this._uniformityCacheVisibleEnd=s,this._uniformityCacheVisible=a,a}normalizeDomains(...e){const t=e.filter((e=>e.domain.length>0));if(0===t.length)return{domain:[],animatable:!1};const i=t[0].domain,s=t.every((e=>e.domain===i));if(1===t.length||s){const e=t[0];let i,s=e.domain,a=!1;return void 0===e.sortMetadata?.sortOrder?i=(0,n.Q06)(s):(i=e.sortMetadata.sortOrder,a=e.sortMetadata.isUnique??!1),-1===i?s=s.slice().reverse():null==i&&(s=a?s.slice().sort(((e,t)=>e.valueOf()-t.valueOf())):(0,n.a$r)(s.slice())),{domain:s,animatable:!0}}return{domain:(0,n.a$r)(t.flatMap((e=>e.domain))),animatable:!0}}ticks(e,t,i=[0,1],{extend:s=!1,dropInitial:a=!1}={}){const{interval:o,maxTickCount:r,tickCount:l=r}=e,{bands:h,reversed:c}=this;if(!h.length)return;if(c&&(i=[1-i[1],1-i[0]]),this.refresh(),null==o){const{ticks:e,tickOffset:n,tickEvery:a}=this.getDefaultTicks(t,l,i,s);let o=e.length>0?this.findIndex(e[0]):void 0;return o=null==o?void 0:Math.floor((o-n)/a),{ticks:e,count:void 0,firstTickIndex:o}}let d,u;t&&t.length>=2?(d=t[0].valueOf(),u=t.at(-1).valueOf()):(d=h[0].valueOf(),u=h.at(-1).valueOf());const[p,g]=this.range,m=Mc({start:d,stop:u,interval:o,availableRange:Math.abs(g-p),visibleRange:i,extend:s,logger:this.logger})??this.getDefaultTicks(t,l,i,s).ticks,y=[];let f=-1;for(const e of m){const t=this.findIndex(e,n.w8L.Trailing)??-1,i=t===f;f=t,a&&0===t||-1===t||i||y.push(h[t])}return{ticks:y,count:void 0,firstTickIndex:void 0}}stepTicks(e,t,i=[0,1],n=!0){const s=t?this.bandDomainIndices(t):void 0,a=this.ticksEvery(s,i,e,0,!1),o=a.at(-1),r=n&&e>1?s?.[1]:void 0,l=null!=r&&null!=o?this.findIndex(o):void 0;return null!=l&&null!=r&&r-l<e&&a.pop(),a}bandCount(e=[0,1]){const{domain:t}=this,i=Math.floor(e[0]*t.length);return Math.ceil(e[1]*t.length)-i}getDefaultTicks(e,t,i,n){const{bands:s}=this,a=Math.ceil(s.length/t),o=Math.floor(a/2),r=e?this.bandDomainIndices(e):void 0;return{ticks:this.ticksEvery(r,i,a,o,n),tickOffset:o,tickEvery:a}}bandDomainIndices(e){const t=wc(e);return[this.findIndex(e[t?e.length-1:0],n.w8L.Trailing)??0,this.findIndex(e[t?0:e.length-1],n.w8L.Trailing)??this.bands.length-1]}ticksEvery([e,t]=[0,this.bands.length],i,n,s,a){const{bands:o}=this,r=e,l=t-e+1;let h,c=r+Math.floor(i[0]*l),d=r+Math.ceil(i[1]*l);
1if(a&&(c-=n,d+=n),c=Math.max(c,0),d=Math.min(d,o.length),n<=1)h=o.slice(c,d);else{h=[];for(let e=c;e<d;e+=1)(e-r+s)%n==0&&h.push(o[e])}return h}};function wc(e){return e.length>0&&e[0]>e.at(-1)}var Ic=5e7,Ac=class e extends Hl{constructor(){super(...arguments),this.type="unit-time",this.defaultTickCount=1/0,this._domain=[],this._bands=void 0}static is(t){return t instanceof e}static supportsInterval(e,t){return function(e,t,i){const s=(0,n.qpA)(t,e[0]),a=(0,n.qpA)(t,e[1]);return(0,n.QFm)(t,s,a,i)<=Ic}(e,t)}set domain(e){if(e===this._domain)return;const t=e.length===this._domain.length&&e.length>=2&&e[0].valueOf()===this._domain[0].valueOf()&&e[1].valueOf()===this._domain[1].valueOf();this._domain=e,t||this.invalidateCaches()}get domain(){return this._domain}get interval(){return this._interval}set interval(e){const t=null==e?void 0:(0,n.q8s)(e);this._interval?.unit===t?.unit&&this._interval?.step===t?.step||(this._interval=t,this.invalidateCaches())}invalidateCaches(){this._bands=void 0,this._numericBands=void 0,this._uniformityCache=void 0,this._domainBoundaries=void 0,this._bandRangeCache=void 0,this._encodedBands=void 0,this._encodingParams=void 0,this._linearParams=void 0}get bands(){if(void 0===this._bands)if(this.ensureEncodedBands(),null!=this._encodedBands&&null!=this._encodingParams){const e=this._encodingParams;this._bands=this._encodedBands.map((t=>(0,n.txz)(t,e)))}else this._bands=[];return this._bands}get numericBands(){if(void 0===this._numericBands)if(this.ensureEncodedBands(),null!=this._encodedBands&&null!=this._encodingParams){const e=this._encodingParams;this._numericBands=this._encodedBands.map((t=>(0,n.crw)(t,e)))}else this._numericBands=[];return this._numericBands}ensureEncodedBands(){if(void 0!==this._encodedBands)return;const{domain:e,interval:t}=this;if(e.length<2||null==t)return void(this._encodedBands=[]);const i=this.getCachedBandRange();if(null==i)return void(this._encodedBands=[]);const[s,a]=i,o={visibleRange:[0,1],extend:!1};if((0,n.QFm)(t,s,a,o)>Ic)return this.logger.warnOnce("the configured unit results in too many bands, ignoring. Supply a larger unit."),void(this._encodedBands=[]);const{encodedValues:r,encodingParams:l}=(0,n.CMD)(t,s,a,o);this._encodedBands=r,this._encodingParams=l}getBandCountForUpdate(){return this.ensureEncodedBands(),this._encodedBands?.length??0}getUniformityCache(e){const t=this.getBandCountForUpdate();if(!e||0===e[0]&&1===e[1]){if(t>1e3&&void 0===this._uniformityCache)if(this.ensureEncodedBands(),null!=this._encodingParams&&null!=this._encodedBands&&this._encodedBands.length>=2){const e=(0,n.crw)(this._encodedBands[0],this._encodingParams),t=(0,n.crw)(this._encodedBands[1],this._encodingParams);this._uniformityCache={isUniform:!0,interval:t-e}}else this._uniformityCache={isUniform:!1};return this._uniformityCache}if(this.ensureEncodedBands(),null!=this._encodingParams&&null!=this._encodedBands&&this._encodedBands.length>=2){const e=(0,n.crw)(this._encodedBands[0],this._encodingParams);return{isUniform:!0,interval:(0,n.crw)(this._encodedBands[1],this._encodingParams)-e}}return{isUniform:!1}}normalizeDomains(...e){return Bl(...e)}getCachedBandRange(){const{domain:e,interval:t}=this;if(!(e.length<2||null==t))return this._bandRangeCache??(this._bandRangeCache={start:(0,n.qpA)(t,e[0]),stop:(0,n.qpA)(t,e[1])}),[this._bandRangeCache.start,this._bandRangeCache.stop]}getDomainBoundaries(){const{interval:e}=this;if(null!=e){if(void 0===this._domainBoundaries){const t=this.getCachedBandRange();if(null==t)return;const[i,s]=t,a=Math.min(i.valueOf(),s.valueOf()),o=Math.max(i.valueOf(),s.valueOf()),r=(0,n.lyf)(e,new Date(o)).valueOf();this._domainBoundaries={d0:a,dNext:r}}return this._domainBoundaries}}getLinearParams(){if(void 0===this._linearParams&&(this.ensureEncodedBands(),null!=this._encodedBands&&null!=this._encodingParams&&this._encodedBands.length>=2)){const e=(0,n.crw)(this._encodedBands[0],this._encodingParams),t=(0,n.crw)(this._encodedBands[1],this._encodingParams);this._linearParams={firstBandTime:e,intervalMs:t-e}}return this._linearParams}isLinearUnit(){const e=this._encodingParams?.unit;return"millisecond"===e||"second"===e||"minute"===e||"hour"===e}findIndex(e,t=n.w8L.Leading){if(null==e)return;const i=this.getBandCountForUpdate();if(0===i)return;if(1===i)return 0;
1const s=this.getLinearParams();if(null==s||0===s.intervalMs)return super.findIndex(e,t);const{firstBandTime:a,intervalMs:o}=s,r=e.valueOf(),l=(r-a)/o;let h=t===n.w8L.Trailing?Math.ceil(l):Math.floor(l);if(h=Math.max(0,Math.min(h,i-1)),this.isLinearUnit()){if(t===n.w8L.Trailing){if(a+h*o<r&&h===i-1)return}else{if(a+h*o>r&&0===h)return}return h}const c=this.numericBands;if(t===n.w8L.Trailing){for(;h>0&&c[h-1]>=r;)h--;for(;h<i-1&&c[h]<r;)h++;if(c[h]<r)return}else{for(;h<i-1&&c[h+1]<=r;)h++;for(;h>0&&c[h]>r;)h--;if(c[h]>r)return}return h}convert(e,t){this.refresh(),e instanceof Date||(e=new Date((0,n.Hre)(e)));const{domain:i,interval:s}=this;if(i.length<2)return Number.NaN;if(!0!==t?.clamp&&null!=s){const i=this.getDomainBoundaries();if(null!=i){const s=e.valueOf();if(s<i.d0||s>=i.dNext)return super.convert(e,{...t,alignment:n.w8L.Interpolate})}}return super.convert(e,t)}ticks({interval:e},t=this.domain,i=[0,1]){const n=this.numericBands;if(0===n.length||t.length<2)return;const s=Math.min(t[0].valueOf(),t[1].valueOf()),a=Math.max(t[0].valueOf(),t[1].valueOf()),[o,r]=this.visibleBandRange(s,a,i);if(null==e)return{ticks:n.slice(o,r).map((e=>new Date(e))),count:void 0,firstTickIndex:o};const l=this.intervalCandidates(e,t,i),h=this.snapCandidatesToBands(l,n,o,r);return{ticks:h.map((e=>new Date(e))),count:h.length,firstTickIndex:o}}visibleBandRange(e,t,i){const s=this.numericBands,a=s.length;if(0===a)return[0,0];const o=t-e,r=e+i[0]*o,l=e+i[1]*o;return[(0,n.I5B)(0,a-1,(e=>s[e]<=r))??0,((0,n.S3I)(0,a-1,(e=>s[e]>=l))??a-1)+1]}intervalCandidates(e,t,i){return"number"!=typeof e?(0,n.tUW)(e,t[0],t[1],{extend:!0,visibleRange:i}).map((e=>e.valueOf())):this.numericBands}snapCandidatesToBands(e,t,i,s){const a=this.interval?(0,n.UQv)(this.interval):1/0,o=[];let r=-1;for(const l of e){if(l<t[i]||l>t[s-1]+a)continue;const e=(0,n.I5B)(i,s-1,(e=>t[e]<=l));null!=e&&e!==r&&l-t[e]<=a&&(o.push(t[e]),r=e)}return o}};function Cc(e,t,i,s,a){let[o,r]=(0,n.uYy)(t.map(Number));const l=Math.floor(i.unzoomed);if(l<=1){const[t,i]=function(e,t){let i=e,s=t,a=0;do{[i,s]=(0,n._hN)(i,s);const{ticks:e}=(0,n.np_)(i,s,5);if(e.length%2==1)return[i,s];i-=1,s+=1}while(a++<10);return[e,t]}(o,r),l=5*Math.pow(2,-Math.ceil(Math.log2(a[1]-a[0]))),{ticks:h}=(0,n.np_)(t,i,l,void 0,void 0,a),c=[e.toDomain(t),e.toDomain(i)];return s&&c.reverse(),{domain:c,ticks:h}}if(o===r){const e=Math.floor(Math.log10(o)),t=Math.pow(10,e),i=Math.min(t,1),n=l-1;o-=i*Math.floor(n/2),r=o+i*n}let h=o,c=r;h=function(e,t,i){e=Math.floor(e);const n=Math.abs(t-e)/(i-1),s=Math.floor(Math.log10(n)),a=Math.pow(10,s);return Math.floor(e/a)*a}(h,c,l);const d=function(e,t,i){const n=i-1,s=(t-e)/n;return function(e){const t=Math.floor(Math.log10(e)),i=Math.pow(10,t),n=e/i;return n>0&&n<=1?i:n>1&&n<=2?2*i:n>2&&n<=5?5*i:n>5&&n<=10?10*i:e}(s)}(h,c,l),u=l-1;c=h+u*d;const p=Math.floor(h/d)*d,g=Math.floor(c/d)*d;p<=o&&g>=r&&(h=p,c=g);const m=[e.toDomain(h),e.toDomain(c)];s&&m.reverse();const y=function(e){if(e<=1)return 1;const t=Math.floor(Math.log10(e)),i=Math.pow(10,t),n=e/i;return n>=5?5*i:n>=2?2*i:i}(Math.max(1,Math.floor(i.zoomed)-1)/u),f=function(e,t,i){const s=(0,n.o3B)(t),a=Math.pow(10,s),o=[];for(let n=0;n<i;n++){const i=e+t*n;o.push(Math.round(i*a)/a)}return o}(h,d/y,Math.min(u*y+1,Math.floor(i.zoomed)));return{domain:m,ticks:f}}var Nc=[1,2,3,4,6,8,9,10,12];function Lc(e,t=0){const i=[];for(const s of e){const{x:e,y:a,width:o,height:r}=s;if(i.some((i=>(0,n.$ZB)(i,e,a,o+t,r+t))))return!0;i.push(s)}return!1}function Pc(e,t,i,s){if(null==e)return t;if("number"!=typeof e){const a={...(0,n.q8s)(e),epoch:t[0]};return(0,n.tUW)(a,t[0],t[1],{visibleRange:i,extend:s})}const a=[],o=t[0].valueOf(),r=t[1].valueOf();for(let t=o;t<=r;t+=e)a.push(new Date(t));return a}function Tc(e,t){if(e.length!==t.length)return!1;for(let i=0;i<e.length;i+=1)if(e[i]?.valueOf()!==t[i]?.valueOf())return!1;return!0}function Oc(e,{niceDomain:t,rawTicks:i,rawFirstTickIndex:s=0,generatePrimaryTicks:a,primaryTicksIndices:o,alignment:r,fractionDigits:l,timeInterval:h}){const{scale:c,label:d,tickFormatter:u,inRange:p,isVertical:g,sizeLimit:m=1/0}=e,y=vc.is(c)||Hl.is(c),f=(0,n.K$y)(d),x=(0,n.Iig)(),b=[];return Rc(c,t,(()=>{const e=Vl.is(c)&&c.bandwidth||1/0,v=(c.bandwidth??0)/2,S=function(e,t,i,s,a,o,r){const l=t?"component":"long",h=t&&o?(0,n.fQz)(o):void 0,c=t?r(i,s,!0,a,h,l):null,d=e?r(i,s,!1,a,o,l):null;return(e,t,i)=>e?c?.(t,i)??String(t):null==d?"":d(t,i)??String(t)}(d.enabled,a,t,i,l,h,u);let M=g?m:e,k=g?e:m;if(d.rotation){const e=(0,n.WTq)(d.rotation,M,k);M=e.width,k=e.height}const D={font:d,maxWidth:M,maxHeight:k,overflow:d.truncate?"ellipsis":"hide",textWrap:d.wrapping??"never"};for(let e=0;e<i.length;e++){const t=i[e],a=c.convert(t,{alignment:r})+v;if(p&&!p(a))continue;const l=o?.has(e)??!1,h=S(l,t,e);let u=null;d.avoidCollisions&&(u=(0,n.rHj)(h,D)||null,u===n.GBn&&(u=null));const g=u??h,m=(0,n.cyL)(g),M=g!==h&&(m?(0,n.a0u)(g.at(-1)):(0,n.KQS)((0,n.i$)(g)));let k;if(y){const e=t?.valueOf();Number.isFinite(e)&&(k=x(`v:${e}`))}k??(k=x(`l:${m?(0,n.boc)(g.flat()):g}`)),b.push({tick:t,tickId:k,tickLabel:g,isPrimary:l,index:e+s,textUntruncated:M?(0,n.boc)(h):void 0,textMetrics:m?(0,n.wEO)(g,d):f.measureLines((0,n.i$)(g)),translation:Vl.is(c)?a:Math.floor(a)})}})),b}function Rc(e,t,i){const n=e.snapshotDomain();try{e.domain=t,i()}finally{e.restoreDomain(n)}}function Ec(e,t,i,n){return e&&!t?i*n==-1?"top":"bottom":"middle"}function zc(e,t,i,n,s){const a=t>0&&t<=Math.PI,o=i>0&&i<=Math.PI;if(e){if(!t&&!i)return"center";if(n*(a||o?-1:1)==-1)return"right"}else if(n*s==-1)return"right";return"left"}function Bc(e,t){if(null!=e)return"string"==typeof e?e:(0,n.QdQ)(e)&&null!=t?e[(0,n.u1v)(t)]:void 0}var Fc=new Date(1970,0,4);function Vc(e){const{label:t,parallel:i=!1,domain:s,axisRotation:a,labelOffset:o,sideFlag:r,labelBaseline:l,labelBandOffsets:h}=e,{defaultRotation:c,configuredRotation:d,parallelFlipFlag:u,regularFlipFlag:p}=function(e,t,i=0){const s=(0,n.JJe)(e),a=!s&&i>=0&&i<=Math.PI?-1:1,o=!s&&i-Math.PI/2>=0&&i-Math.PI/2<=Math.PI?-1:1;return{configuredRotation:s,defaultRotation:t?a*(Math.PI/2):0,parallelFlipFlag:a,regularFlipFlag:o}}(t.rotation,i,a),g=d+c,m=(s,a=0)=>{const c=t.minSpacing??(0===d&&0===a?10:0),m=g+a,y=St(t),f=Ec(i,d,r,u),x=h?.(s.ticks,d+a,zc(i,d,a,r,p),f);return Lc(function(e,t,i){const{niceDomain:s,ticks:a,timeInterval:o}=t;if(null==o)return[];const r=function(e){if(e.length<2)return 1/0;let t=0,i=e[0].translation;for(let n=1;n<e.length;n++){const s=e[n].translation,a=Math.abs(s-i);
1t=Math.max(t,a),i=s}return t}(a),{label:l,labelOffset:h,primaryLabel:c,domain:d}=e,{width:u,height:p}=function(e,t,i,s,a){const o=Bc(e.format,s);if(null==o)return{width:0,height:0};const r=(0,n.f6S)(o),l=s?(0,n.fQz)(s):void 0,h=Bc(t?.format,l),c=h?(0,n.f6S)(h):r,d=new Date(i[0]),u=new Date(i.at(-1)),p=l?(0,n.tUW)(l,new Date(i[0]),new Date(i.at(-1)),{extend:!0}):void 0;let g=0,m=0;if(null!=r){const t=St(e),i=t.left+t.right,o=t.top+t.bottom;let l,h;null!=p&&p.length>1?(l=p[0],h=p[1]):(l=d,h=u);const c=(0,n.tUW)(s,l,h,{limit:50});for(const e of c){const t=r(e),{width:n,height:s}=a.measureLines(t);g=Math.max(g,n+i),m=Math.max(m,s+o)}}if(null!=c&&null!=p){const e=St(t),i=e.left+e.right,n=e.top+e.bottom;for(const e of p){const t=c(e),{width:s,height:o}=a.measureLines(t);g=Math.max(g,s+i),m=Math.max(m,o+n)}}return{width:Math.ceil(g),height:Math.ceil(m)}}(l,c,s??d,o,(0,n.K$y)(l)),g=[];for(const e of[0,r]){const{x:t,y:s}=(0,n.sR8)(h,e,i);g.push({x:t,y:s,width:u,height:p})}return g}(e,s,m),c)||Lc(function(e,t,i,s,a,o){const r=[],l=s.left+s.right,h=s.top+s.bottom;for(let c=0;c<e.length;c+=1){const{tickLabel:d,textMetrics:u,translation:p}=e[c];if(!d)continue;const g=t-(o?.[c]??0),{x:m,y}=(0,n.sR8)(g,p,i),f=u.width+l,x=u.height+h,b=y+nc(u.height,"top",a)-s.top;r.push({x:m,y:b,width:f,height:x})}return r}(s.ticks,o,m,y,l??f,x),c)},{maxTickCount:y}=$c(e),f=function(e){if(e.interval?.values)return 2;if(null!=e.primaryTickCount)return 1;return 0}(e),x=t.enabled&&t.avoidCollisions,b=Number.isFinite(y)?y:10,v=x&&t.autoRotate&&null==t.rotation;let S=0,M=0,k=!0,D={tickDomain:[],niceDomain:s,ticks:[],rawTicks:[],rawTickCount:void 0,timeInterval:void 0,fractionDigits:0,rawFirstTickIndex:0};for(;k&&S<=b;)({tickData:D,index:S}=Hc(e,f,D,S)),M=v&&m(D,0)?(0,n.JJe)(t.autoRotateAngle??335):0,k=x&&m(D,M);return{tickData:D,textAlign:zc(i,d,M,r,p),textBaseline:Ec(i,d,r,u),rotation:d+M}}function $c({scale:e,domain:t,range:i,visibleRange:s,label:a,defaultTickMinSpacing:o,interval:r}){const{minSpacing:l,maxSpacing:h}=r??{},{defaultTickCount:c}=e,d=(0,n.DuJ)(i),u=(0,n.DuJ)(s),p=Dc.is(e);if(yc.is(e)||p&&t.length<1e3){const i=yc.is(e)?t.length:Math.min(t.length,Math.max(1,Math.floor(d/(u*o)))),n=Math.ceil(d/(u*a.fontSize));return{tickCount:Math.min(n,i),minTickCount:0,maxTickCount:i}}const g=(0,n.NKs)(d,u,l,h,c,o);return p&&(g.minTickCount=0),g}function Hc(e,t,i,n){const{step:s,values:a}=e.interval??{},{maxTickCount:o,minTickCount:r,tickCount:l}=$c(e),h=e=>Math.max(l-e,r),c=null==s&&null==a&&h(n)>r,d=i.rawTicks,u=l-r,p={minTickCount:r,maxTickCount:o,tickCount:h(n)};let g=jc(e,t,p);if(c&&Tc(g.rawTicks,d)){let i=n,s=u;for(;i<=s;){n=Math.trunc((i+s)/2),p.tickCount=h(n);const a=jc(e,t,p);Tc(a.rawTicks,d)?i=n+1:(g=a,s=n-1)}}const{tickDomain:m,niceDomain:y,rawTicks:f,rawTickCount:x,rawFirstTickIndex:b,generatePrimaryTicks:v,primaryTicksIndices:S,alignment:M,fractionDigits:k,timeInterval:D}=g;return{tickData:{tickDomain:m,niceDomain:y,rawTicks:f,rawTickCount:x,fractionDigits:k,timeInterval:D,rawFirstTickIndex:b??0,ticks:Oc(e,{niceDomain:y,rawTicks:f,rawFirstTickIndex:b,generatePrimaryTicks:v,primaryTicksIndices:S,alignment:M,fractionDigits:k,timeInterval:D})},index:n+1}}function jc(e,t,i){const{domain:s,reverse:a,visibleRange:o,scale:r,interval:l,primaryLabel:h,niceMode:c,primaryTickCount:d,minimumTimeGranularity:u}=e,p={nice:c.map((e=>0===e)),interval:l?.step,...i},g={...p,nice:c.map((e=>0===e||1===e))};let m;1===t&&null!=d&&s.length>0&&Rl.is(r)&&(m=Cc(r,s,d,a,o));const y=c.includes(0)?m?.domain??r.niceDomain(p,s):s;let f,x,b,v,S,M,k=y;const D=!0===h?.enabled&&null==g.interval;Rc(r,y,(()=>{switch(t){case 2:if(k=l.values,f=l.values,x=f.length,Dc.is(r)?M=n.w8L.Trailing:Ac.is(r)&&(M=n.w8L.Interpolate),Rl.is(r)){const[e,t]=(0,n.uYy)(y.map(Number));f=f.filter((i=>Number(i)>=e&&Number(i)<=t)).sort(((e,t)=>Number(e)-Number(t)))}break;case 1:if(m)f=m.ticks,x=m.ticks.length;else{const e=r.ticks(g,y,o);f=e?.ticks,x=e?.count}break;default:{const{tickCount:e,minTickCount:t,maxTickCount:s}=i;if(y.length>0&&null==g.interval&&(Ac.is(r)||D&&(vc.is(r)||Dc.is(r)))){const i=y,a=Math.min(i[0].valueOf(),i.at(-1).valueOf()),o=Math.max(i[0].valueOf(),i.at(-1).valueOf());v=(0,n.M2I)(a,o,e,t,s,{weekStart:null==h?Fc:void 0,primaryOnly:!0})}let l;Dc.is(r)?l=u:Ac.is(r)&&(l=r.interval),null!=l&&null!=v&&(0,n.UQv)(l)>=(0,n.UQv)(v)&&(v=l);const c=v?function(e,t,i,s,a,o,r,l){if(!vc.is(e)&&!Hl.is(e))return;const h=(0,n.fQz)(o);if(null==h)return;r&&(t=[1-t[1],1-t[0]]);const c=Math.min(e.domain[0].valueOf(),e.domain.at(-1).valueOf()),d=Math.max(e.domain[0].valueOf(),e.domain.at(-1).valueOf());let[u,p]=(0,n.WCd)(new Date(c),new Date(d),t);u=(0,n.qpA)(h,u),u.valueOf()>=c&&(u=(0,n.ZMr)(h,u)),p=(0,n.Z8P)(h,p),p.valueOf()<=d&&(p=(0,n.lyf)(h,p));const g=(0,n.tUW)(h,u,p),m=(0,n.UQv)(o),y=Dc.is(e),f={...a,interval:o},x=[];let b,v,S,M=0;if(Dc.is(e)){const a=(0,n.u1v)(o);v=null!=l&&(0,n.UQv)(l)>
1=(0,n.UQv)(a)?2:3,S=n.w8L.Trailing;const r=i/s,h=e.bandCount(t)/(18*r);M=Nc.findLast((e=>h>=e))??1}else Ac.is(e)&&(null==e.interval||(0,n.UQv)(e.interval)>=m)?v=1:(v=0,S=n.w8L.Interpolate);for(let t=0;t<g.length-1;t++){const i=g[t],s=g[t+1],a=0===t,o=t===g.length-2,r=s.valueOf()-i.valueOf(),l=[Math.max((c-i.valueOf())/r,0),Math.min((d-i.valueOf())/r,1)];let h;switch(v){case 0:h=Pc(f.interval,[i,s],l,!0);break;case 1:{const t=e.ticks(f,[i,s],l);h=t?.ticks??[];break}case 3:{const t=e.ticks(f,[i,s],l,{extend:!0,dropInitial:!0});h=t?.ticks??[];break}case 2:h=e.stepTicks(M,[i,s],void 0,!o)}if((0,n.nmo)(h,(e=>e.valueOf()<i.valueOf())),o||(0,n.xAp)(h,(e=>{switch(v){case 0:case 3:return e.valueOf()+m>s.valueOf();case 1:case 2:return e.valueOf()>=s.valueOf()}})),0===h.length)continue;const u=h[0],p=(0,n.H$f)(u,i);!(0===v?0===p:p<=m)||y&&a||(b??(b=new Set),b.add(x.length)),x.push(...h)}return 1===b?.size&&b.has(0)&&(b=void 0),{ticks:x,primaryTicksIndices:b,alignment:S}}(r,o,e,s,g,v,a,u):void 0;if(c)({ticks:f,primaryTicksIndices:S,alignment:M}=c);else{const e=Ac.is(r)&&null==g.interval&&null!=v?{...g,interval:v}:g,t=r.ticks(e,y,o);if(f=t?.ticks,x=t?.count,b=t?.firstTickIndex,vc.is(r)||Hl.is(r)){const e="number"==typeof g.interval?(0,n.nhz)(g.interval):g.interval;v??(v=e??t?.timeInterval)}}}}})),f??(f=[]);let w=0;for(const e of f){if("number"!=typeof e)continue;const t=(0,n.o3B)(e);t>w&&(w=t)}return D||(S=void 0),{tickDomain:k,niceDomain:y,rawTicks:f,rawTickCount:x,rawFirstTickIndex:b,generatePrimaryTicks:D,primaryTicksIndices:S,alignment:M,fractionDigits:w,timeInterval:v}}function Wc(e){return"left"===e?"vertical":"right"===e?"vertical-reversed":"horizontal"}function _c(e,t){return"horizontal"===t===("left"===e||"right"===e)}var Gc={top:"bottom",middle:"middle",bottom:"top"},Kc={horizontal:0,vertical:-Math.PI/2,"vertical-reversed":Math.PI/2};var Yc=class e extends mc{constructor(e,t,i,s){let a;super(e,t,i,s),this.crossAxisTranslation={x:0,y:0},this.titleThickness=0,this.minimumTimeGranularity=void 0,this.zoom={min:0,max:1},this.headingLabelGroup=this.axisGroup.appendChild(new we({name:`${this.id}-Axis-heading`})),this.lineNodeGroup=this.axisGroup.appendChild(new we({name:`${this.id}-Axis-line`})),this.lineNode=this.lineNodeGroup.appendChild(new Gh({zIndex:1})),this.tickLineGroupSelection=_h.select(this.tickLineGroup,Gh,!1),this.gridLineGroupSelection=_h.select(this.gridLineGroup,Gh,!1),this.gridFillGroupSelection=_h.select(this.gridFillGroup,Ge,!1),this.tempText=new Ze({debugDirty:!1}),this.tempCaption=new Yh,this.animationManager=e.animationManager,this.animationState=new n.Z37("empty",{empty:{update:{target:"ready",action:()=>this.resetSelectionNodes()},reset:"empty"},ready:{update:e=>this.animateReadyUpdate(e),resize:()=>this.resetSelectionNodes(),reset:"empty"}}),this.headingLabelGroup.appendChild(this.caption.node),this.cleanup.register(e.eventsHub.on("layout:complete",(e=>{const t=[e.chart.width,e.chart.height];null==a||(0,n.r1i)(t,a)||this.animationState.transition("resize"),a=t})),this.caption.registerInteraction(this.moduleCtx,this.id))}static is(t){return t instanceof e}get position(){return this.options.position}getZoom(){return this.zoom}setZoom(e){this.zoom={min:e.min,max:e.max}}get horizontal(){return"top"===this.position||"bottom"===this.position}resolveLabelTextAlign(e){return null==e?void 0:(0,n.vDS)(e,this.moduleCtx.domManager.isRtl)}onGridVisibilityChange(){}
1resetAnimation(e){"initial"===e&&this.animationState.transition("reset")}get direction(){return"top"===this.position||"bottom"===this.position?n.tv$.X:n.tv$.Y}get userListeners(){return this.options.listeners}createAxisContext(){const e=super.createAxisContext();return e.position=this.position,e}updateDirection(){switch(this.position){case"top":this.mirrored=!0,this.parallel=!0;break;case"right":this.mirrored=!0,this.parallel=!1;break;case"bottom":this.mirrored=!1,this.parallel=!0;break;case"left":this.mirrored=!1,this.parallel=!1}this.axisContext&&(this.axisContext.position=this.position,this.axisContext.direction=this.direction)}calculateLayout(e,t){return this.updateDirection(),super.calculateLayout(e,t)}calculateTickLayout(e,t,i,s){const a=Zh(this.mirrored),o=this.options.label,r=a*(this.getTickSize()+this.getTickSpacing()+o.spacing+this.seriesAreaPadding),l=this.chartLayout?.scrollbars?.[this.id],h=this.getScrollbarThickness(l);if(!(2!==t[0]||2!==t[1]||o.enabled||this.primaryLabel?.enabled||!1!==this.options.tick.enabled||this.primaryTick?.enabled||!1!==this.options.gridLine.enabled||this.isPickComputationEnabled())){const{bbox:t,spacing:i}=this.measureAxisLayout(e,[],[],l,h);this.setPickTickData([]);return{ticks:[],rawTickCount:0,tickDomain:e,niceDomain:e,fractionDigits:0,timeInterval:void 0,bbox:t,layout:{ticks:[],tickLines:[],gridLines:[],gridFills:[],labels:[],spacing:i}}}const{primaryLabel:c,scale:d,range:u,defaultTickMinSpacing:p,minimumTimeGranularity:g}=this,{interval:m,reverse:y}=this.options,f=Vc({label:o,parallel:this.parallel,scale:d,interval:m,primaryLabel:c,domain:e,range:u,reverse:y,niceMode:t,visibleRange:i,defaultTickMinSpacing:p,minimumTimeGranularity:g,sideFlag:a,labelOffset:r,primaryTickCount:s,axisRotation:this.horizontal?Math.PI/-2:0,isVertical:this.direction===n.tv$.Y,sizeLimit:this.chartLayout?.sizeLimit,inRange:e=>this.inRange(e,.001),labelBaseline:this.resolveLabelBaseline(o.verticalAlign),labelBandOffsets:this.bandFlushesLabels()?(e,t,i,n)=>this.measureLabelBandOffsets(e,{rotation:t,textAlign:i,textBaseline:n},h):void 0,tickFormatter:(...e)=>this.tickFormatter(...e)}),{tickData:x}=f;if((o?.avoidCollisions??!0)&&this.horizontal&&x.ticks.length>2&&(Rl.is(this.scale)||Hl.is(this.scale))){const e=this.resolveLabelTextAlign(o?.textAlign),t=e===f.textAlign?void 0:e,n=Jh(this.scale.bandwidth??0,e),s=e=>{const{leading:i,trailing:s}=function(e,t,i){if(null==i)return{leading:-e/2,trailing:e/2};const n=Math.cos(t),s=e*qh[i]*n,a=s-e*n;return{leading:Math.min(a,s),trailing:Math.max(a,s)}}(e,f.rotation,t);return{leading:i+n,trailing:s+n}},a=this.chartLayout?.padding.right??0,r=x.ticks.at(-1),l=0===i[0]&&1===i[1];null!=r?.tickLabel&&r.translation+s(r.textMetrics.width).trailing>u[1]+a&&(r.tickLabel=void 0,l&&(x.ticks[0].tickLabel=void 0));const h=x.ticks[0];null!=t&&null!=h?.tickLabel&&h.translation+s(h.textMetrics.width).leading<u[0]-(this.chartLayout?.padding.left??0)&&(h.tickLabel=void 0,l&&null!=r&&(r.tickLabel=void 0))}const{ticks:b,tickDomain:v,rawTicks:S,rawTickCount:M,fractionDigits:k,timeInterval:D,niceDomain:w,rawFirstTickIndex:I}=x;this.setPickTickData(b,I);const A=b.map((e=>this.getTickLabelProps(e,f,h)));this.alignLabelBands(b,A,f);const{position:C,gridPadding:N,gridLength:L}=this,P="bottom"===C||"right"===C?-1:1,T=P*N,O=P*(L+N),R=this.calculateGridLines(b,T,O),E=this.calculateGridFills(b,T,O),z=this.calculateTickLines(b,P,h),{bbox:B,spacing:F}=this.measureAxisLayout(v,b,A,l,h);return{ticks:S,rawTickCount:M,tickDomain:v,niceDomain:w,fractionDigits:k,timeInterval:D,bbox:B,layout:{ticks:b,gridLines:R,gridFills:E,tickLines:z,labels:A,spacing:F}}}calculateGridLines(e,t,i){return e.map(((n,s)=>this.calculateGridLine(n,s,t,i,e)))}calculateGridLine({index:e,tickId:t,translation:i},n,s,a,o){const{horizontal:r}=this,l=this.options.gridLine,[h,c,d,u]=r?[i,s,i,a]:[s,i,a,i],{style:p}=l,{stroke:g,strokeWidth:m=0,lineDash:y}=p[e%p.length]??{};return{tickId:t,offset:i,x1:h,y1:c,x2:d,y2:u,stroke:g,strokeWidth:m,lineDash:y}}calculateGridFills(e,t,i){const{horizontal:n,range:s,type:a}=this,o=[];if(0==e.length)return o;let r=0;const l=!n&&"unit-time"===a;if(l&&e[0].translation<s[0]||!l&&e[0].translation>s[0]){const n={tickId:`before:${e[0].tickId}`,translation:s[0]};o.push(this.calculateGridFill(n,-1,e[0].index,t,i,e)),r=1}return o.push(...e.map(((n,s)=>this.calculateGridFill(n,s,n.index+r,t,i,e)))),o}calculateGridFill({tickId:e,translation:t},i,n,s,a,o){const{horizontal:r,range:l}=this,h=this.options.gridLine,c=o[i+1],d=t,u=c?c.translation:l[1],[p,g,m,y]=r?[d,Math.max(s,a),u,Math.min(s,a)]:[Math.min(s,a),Math.min(d,u),Math.max(s,a),Math.max(d,u)],{fill:f,fillOpacity:x}=h.style[n%h.style.length]??{};return{tickId:e,x1:p,y1:g,x2:m,y2:y,fill:f,fillOpacity:x}}
1calculateTickLines(e,t,i=0){return e.map((n=>this.calculateTickLine(n,n.index,t,e,i)))}calculateTickLine({isPrimary:e,tickId:t,translation:i},n,s,a,o=0){const{horizontal:r,primaryTick:l}=this,h=this.options.tick,c=e&&l?l:h,d=this.getTickSize(c),u=-s*(o+this.getTickSpacing(c)),p=-s*d,[g,m,y,f]=r?[i,u,i,u+p]:[u,i,u+p,i],{stroke:x,width:b}=c;return{tickId:t,offset:i,x1:g,y1:m,x2:y,y2:f,stroke:x,strokeWidth:b,lineDash:void 0}}update(){this.updateDirection();const e=Array.from(this.tickLabelGroupSelection.nodes(),(e=>e.unsafeDatum.tickId));super.update();const{tickLayout:t}=this;if(this.updateTitle(this.scale.domain,this.resolveTitleSpacing(t?.spacing??0)),this.animatable||this.moduleCtx.animationManager.skipCurrentBatch(),t){const{ticks:i}=t;if(this.animationManager.isSkipped())this.resetSelectionNodes();else{const t=i.map((e=>e.tickId)),s=(0,n.E3_)(e,t);this.animationState.transition("update",s)}}const{enabled:i,stroke:s,width:a}=this.options.line;this.lineNode.setProperties({stroke:s,strokeWidth:i?a:0}),this.updateTickLines(),this.updateGridLines(),this.updateGridFills()}getAxisTransform(){return{completeTransform:{translationX:Math.floor(this.translation.x+this.crossAxisTranslation.x),translationY:Math.floor(this.translation.y+this.crossAxisTranslation.y)},positionOnlyTransform:{translationX:Math.floor(this.translation.x),translationY:Math.floor(this.translation.y)}}}getLayoutTranslation(){const{completeTransform:{translationX:e,translationY:t}}=this.getAxisTransform();return{x:e,y:t}}getLayoutState(){const e=super.getLayoutState(),t=this.isCrosshairLabelAtEdge()?{x:0,y:0}:{...this.crossAxisTranslation};return{...e,position:this.position,crosshairOffset:t}}updatePosition(){super.updatePosition();const{completeTransform:e,positionOnlyTransform:t}=this.getAxisTransform(),i=this.isLabelsAtEdge()?t:e;this.tickLineGroup.datum=i,this.tickLabelGroup.datum=i,this.lineNodeGroup.datum=e,this.headingLabelGroup.datum=this.isTitleAtEdge()?t:e}getCanvasBounds(){const e=this.isLabelsAtEdge();if(!e&&!this.isTitleAtEdge())return super.getCanvasBounds();const t=[this.tickLineGroup,this.tickLabelGroup];return e||t.push(this.lineNodeGroup),this.titleRendersWithLabels()&&t.push(this.headingLabelGroup),m.merge(t.map((e=>Me.toCanvas(e))))}setAxisVisible(e){this.tickLineGroup.visible=e&&(this.options.tick.enabled||(this.primaryTick?.enabled??!1)),this.tickLabelGroup.visible=e&&(this.options.label.enabled||(this.primaryTick?.enabled??!1)),this.lineNodeGroup.visible=e,this.headingLabelGroup.visible=e}getAxisLineCoordinates(){const{horizontal:e}=this,[t,i]=(0,n.uYy)(this.lineRange??this.range);return e?{x1:t,x2:i,y1:0,y2:0}:{x1:0,x2:0,y1:t,y2:i}}getTickLineBBox(e,t){const{translation:i}=e,{position:n,primaryTick:s}=this;let a=this.getTickSize();s?.enabled&&(a=Math.max(a,this.getTickSize(s)));const o="bottom"===n||"right"===n?-1:1,r=this.getTickSpacing(this.options.tick),l=-o*(t+r),h=l,c=l-o*(a+r),d=Math.min(h,c),u=Math.max(h,c);switch(n){case"top":case"bottom":return new m(i,d,0,u-d);case"left":case"right":return new m(d,i,u-d,0)}}lineNodeBBox(){const{position:e,seriesAreaPadding:t}=this,{y1:i,y2:n}=this.getAxisLineCoordinates(),s=n-i;switch(e){case"top":return new m(i,-t,s,t);case"bottom":return new m(i,0,s,t);case"left":return new m(-t,i,t,s);case"right":return new m(0,i,t,s)}}titleBBox(e,t){const{tempCaption:i}=this;return i.node.setProperties(this.titleProps(i,e,t)),this.wrapTitleText(i),i.node.getBBox()}wrapTitleText(e){const t=Math.abs(this.range[1]-this.range[0])||1/0,i=this.options.thickness??1/0,n=this.options.title.orientation??Wc(this.position);_c(this.position,n)?e.computeTextWrap(i,t):e.computeTextWrap(t,i)}getScrollbarThickness(e){return e?.enabled&&"inner"===e.placement?e.spacing+e.thickness:0}resolveScrollbarLayout(e,t){if(!e)return;const{position:i}=this,n="top"===i||"left"===i?-1:1;if("inner"===e.placement){const t=1===n?e.spacing:-e.spacing-e.thickness;return{...e,offset:t}}const s=1===n?t+e.spacing:-t-e.spacing-e.thickness;return{...e,offset:s}}applyScrollbarLayout(e,t,i){const n=this.resolveScrollbarLayout(i,t);let s=t;if(n){const{offset:t,thickness:i,placement:a}=n;"outer"===a&&(s+=n.spacing+i),this.horizontal?e.push(new m(0,t,0,i)):e.push(new m(t,0,i,0))}return{spacing:s,scrollbarLayout:n}}measureAxisLayout(e,t,i,s,a){const{primaryTick:o,primaryLabel:r,position:l,horizontal:h,seriesAreaPadding:c}=this,d=this.options.tick,u=this.options.label,p=this.options.title,g=[];if(g.push(this.lineNodeBBox()),d.enabled||o?.enabled)for(const e of t)g.push(this.getTickLineBBox(e,a));const{tempText:y}=this;if(u.enabled)for(const e of i){if(!e.visible)continue;y.setProperties(e);const t=y.getBBox();t&&g.push(t)}if(r?.enabled&&"bottom"===l){const e=2;if(g.push(new m(0,(0,n.VKS)(u.fontSize)+e,1,this.getTickSize(d)+this.getTickSpacing(d)+u.spacing+c)),null!=r.format){const{format:t}=r,i=((0,n.QdQ)(t)?Object.values(t):[t]).reduce(((e,t)=>Math.max(e,(0,n.lty)(t))),0);g.push(new m(0,this.getTickSize(o??d)+this.getTickSpacing(o??d)+r.spacing+c,1,i*(0,n.VKS)(r.fontSize)+e))}}const f=m.merge(g),x=h?f.height:f.width,{spacing:b,scrollbarLayout:v}=this.applyScrollbarLayout(g,x,s);if(this.layout.labelThickness=x,this.layout.scrollbar=v,this.titleThickness=0,p.enabled){const t=this.titleBBox(e,this.resolveTitleSpacing(b));g.push(t);const i=m.merge([this.lineNodeBBox(),t]);this.titleThickness=h?i.height:i.width}return{bbox:m.merge(g),spacing:b}}isTitleAtEdge(){return"edge"===this.options.crossAt?.titlePlacement}isLabelsAtEdge(){return"edge"===this.options.crossAt?.labelPlacement}isCrosshairLabelAtEdge(){return"edge"===(this.options.crossAt?.crosshairLabelPlacement??"edge")}crosshairLabelNeedsEdgeSpace(){return!!this.isCrosshairLabelAtEdge()&&!0===this.getModuleMap().getModule("crosshair")?.labelEnabled}titleRendersWithLabels(){return this.isTitleAtEdge()===this.isLabelsAtEdge()}resolveTitleSpacing(e){return this.titleRendersWithLabels()?e:0}getCrossAtThicknesses(){const e=this.isTitleAtEdge(),t=this.isLabelsAtEdge(),i=this.crosshairLabelNeedsEdgeSpace(),n=this.titleThickness,s=this.layout.labelThickness??0;
1return{atEdge:Math.max(e?n:0,t||i?s:0),atCrossing:Math.max(e?0:n,t?0:s)}}titleProps(e,t,i){const n=this.options.title;if(!n.enabled)return e.enabled=!1,{visible:!1,text:"",textAlign:"center",textBaseline:"bottom",x:0,y:0,rotationCenterX:0,rotationCenterY:0,rotation:0};e.enabled=!0,e.color=n.color,e.fontFamily=n.fontFamily,e.fontSize=n.fontSize,e.fontStyle=n.fontStyle,e.fontWeight=n.fontWeight,e.wrapping=n.wrapping,e.truncate=n.truncate,e.maxWidth=n.maxWidth,e.maxHeight=n.maxHeight;const{range:s}=this,a=(s[0]+s[1])/2,o=n.spacing+i;let r,l;switch(this.position){case"top":r=a,l=-o;break;case"bottom":r=a,l=o;break;case"left":r=-o,l=a;break;case"right":r=o,l=a}const{rotation:h,textAlign:c,textBaseline:d}=function(e,t){const i=Kc[t];if(_c(e,t)){let n;switch(e){case"left":n="right";break;case"right":n="left";break;case"top":n="vertical-reversed"===t?"right":"left";break;case"bottom":n="vertical-reversed"===t?"left":"right"}return{rotation:i,textAlign:n,textBaseline:"middle"}}let n;switch(e){case"top":n="bottom";break;case"bottom":n="top";break;case"left":n="vertical"===t?"bottom":"top";break;case"right":n="vertical-reversed"===t?"bottom":"top"}return{rotation:i,textAlign:"center",textBaseline:n}}(this.position,n.orientation??Wc(this.position)),{formatter:u=e=>e.defaultValue}=n,p=this.cachedCallWithContext(u,this.getTitleFormatterParams(t));return e.text=p,{visible:!0,text:p,textAlign:c,textBaseline:d,x:r,y:l,rotationCenterX:r,rotationCenterY:l,rotation:h}}labelBoxOffset(e){return-Zh(this.mirrored)*St(e)[this.position]}getLabelBoxOffset(){return this.labelBoxOffset(this.options.label)}getTickLabelProps(e,t,i){const{horizontal:n,primaryLabel:s,primaryTick:a,seriesAreaPadding:o,scale:r}=this,{tickId:l,tickLabel:h="",translation:c,isPrimary:d,textUntruncated:u}=e,p=d&&s?.enabled?s:this.options.label,g=d&&a?.enabled?a:this.options.tick,{rotation:m}=t,y=this.resolveLabelTextAlign(p.textAlign),f=y??t.textAlign,x=this.resolveLabelBaseline(p.verticalAlign)??t.textBaseline,{range:b}=r,v=Zh(this.mirrored);let S=v*(this.getTickSize(g)+this.getTickSpacing(g)+p.spacing+o+this.labelBoxOffset(p));i&&(S+=v*i);const M=""!==h,k=n?Jh(r.bandwidth??0,y):0,D=n?0:(w=r.bandwidth??0,null==(I=p.verticalAlign)?0:tc[I]*Math.abs(w));var w,I;const A=n?c+k:S,C=n?-S:c+D;return{...this.getLabelStyles({value:e.tick,formattedValue:h},void 0,p),tickId:l,rotation:m,text:h,textAlign:f,textBaseline:x,textUntruncated:u,visible:M,x:A,y:C,rotationCenterX:A,rotationCenterY:C,range:b}}resolveLabelBaseline(e){return null==e||this.horizontal||null!=this.scale.bandwidth?e:Gc[e]}bandFlushesLabels(){return this.horizontal&&(null!=this.options.label.verticalAlign||null!=this.primaryLabel?.verticalAlign)}measureLabelBandOffsets(e,t,i){const n=e.map((e=>this.getTickLabelProps(e,t,i))),s=n.map((e=>e.y));return this.alignLabelBands(e,n,t),n.map(((e,t)=>e.y-s[t]))}alignLabelBands(e,t,i){const n=this.options.label,{primaryLabel:s}=this;if(null==n.textAlign&&null==s?.textAlign&&null==n.verticalAlign&&null==s?.verticalAlign)return;const{rotation:a,textAlign:o,textBaseline:r}=i,{horizontal:l,tempText:h}=this,c=Zh(this.mirrored),d=s?.enabled??!1,u=0!==a;for(const i of[!1,!0]){const p=i?s:n,g=this.resolveLabelTextAlign(p?.textAlign),m=p?.verticalAlign,y=l?null!=m:null!=g,f=u&&!y&&(l?null!=g:null!=m);if(!y&&!f)continue;const x=St(p),b=[];let v,S,M=0;for(let n=0;n<t.length;n+=1){if((e[n].isPrimary&&d)!==i)continue;const s=t[n];if(!s.visible)continue;h.setProperties(s);const u=h.computeBBoxWithoutTransforms();if(null==u)continue;const p={x:u.x+x.left,y:u.y+x.top,width:u.width-x.left-x.right,height:u.height-x.top-x.bottom},y=sc(p,s.x,s.y,a);if(l&&null!=m){const e=sc({...p,x:null==g?p.x:p.x+ac(p.width,g,o),y:p.y+nc(p.height,m,r)},s.x,s.y,a),t=s.y+(-1===c?e.y0:e.y1);v??(v=t),v=-1===c?Math.min(v,t):Math.max(v,t)}b.push({datum:s,glyphBox:p,extent:y});const f=l?y.y1-y.y0:y.x1-y.x0;M=Math.max(M,f)}if(!(M<=0)){if(null!=v){const e=v-c*M;S={start:Math.min(v,e),end:Math.max(v,e)}}for(const{datum:e,glyphBox:t,extent:i}of b){if(f){l&&null!=g?(e.y+=this.getCrossAxisCorrection(e,t,i,a,g,o),e.rotationCenterY=e.y):l||null==m||(e.x+=this.getVerticalCrossAxisCorrection(e,t,i,a,this.resolveLabelBaseline(m),r),e.rotationCenterX=e.x);continue}if(null!=S){let t;t="top"===m?S.start-i.y0:"bottom"===m?S.end-i.y1:(S.start+S.end)/2-(i.y0+i.y1)/2,e.y=t,e.rotationCenterY=t;continue}const n=e.x,s=n+c*M,h=Math.min(n,s),d=Math.max(n,s);let u;
1u="left"===g?h-i.x0:"right"===g?d-i.x1:(h+d)/2-(i.x0+i.x1)/2,e.x=u,e.rotationCenterX=u}}}}getCrossAxisCorrection(e,t,i,n,s,a){const o=ac(t.width,s,a),r=sc({...t,x:t.x+o},e.x,e.y,n);return-1===Zh(this.mirrored)?r.y0-i.y0:r.y1-i.y1}getVerticalCrossAxisCorrection(e,t,i,n,s,a){const o=nc(t.height,s,a),r=sc({...t,y:t.y+o},e.x,e.y,n);return-1===Zh(this.mirrored)?r.x0-i.x0:r.x1-i.x1}updateSelections(){if(!this.tickLayout)return;const e=this.getAxisLineCoordinates(),{tickLines:t,gridLines:i,gridFills:n,labels:s}=this.tickLayout,a=e=>e.tickId;this.lineNode.datum=e,this.gridLineGroupSelection.update(this.options.gridLine.enabled?i:[],void 0,a),this.gridFillGroupSelection.update(this.options.gridLine.enabled?n:[],void 0,a),this.tickLineGroupSelection.update(t,void 0,a);const o=this.options.label.enabled||(this.primaryLabel?.enabled??!1);this.tickLabelGroupSelection.update(o?s:[],void 0,a)}updateGridLines(){this.gridLineGroupSelection.each(((e,t)=>{e.stroke=t.stroke,e.strokeWidth=t.strokeWidth,e.lineDash=t.lineDash}))}updateGridFills(){this.gridFillGroupSelection.each(((e,t)=>{e.fill=t.fill,e.fillOpacity=t.fillOpacity??1}))}updateTickLines(){this.tickLineGroupSelection.each(((e,t)=>{e.stroke=t.stroke,e.strokeWidth=t.strokeWidth,e.lineDash=t.lineDash}))}updateTitle(e,t){const{caption:i}=this,n=this.titleProps(i,e,t);i.node.visible=n.visible,i.node.text=n.text,i.node.textAlign=n.textAlign,i.node.textBaseline=n.textBaseline,i.node.datum=n,n.visible&&this.wrapTitleText(i)}updateLabels(){(this.options.label.enabled||(this.primaryLabel?.enabled??!1))&&this.tickLabelGroupSelection.each(((e,t)=>{e.fill=t.color,e.text=t.text,e.textBaseline=t.textBaseline,e.textAlign=t.textAlign??"center",e.pointerEvents=null==t.textUntruncated?1:0,e.setFont(t),e.setBoxing(t)}))}animateReadyUpdate(e){const{animationManager:t}=this.moduleCtx,i=cc(function(e){const[t,i]=(0,n.uYy)(e.range),s=Math.floor(t),a=Math.ceil(i);return{min:s,max:a,visible:s!==a}}(this));Vh(this.id,"axis-group",t,[this.lineNodeGroup,this.tickLabelGroup,this.tickLineGroup,this.headingLabelGroup],i.group),Vh(this.id,"line",t,[this.lineNode],i.line),Vh(this.id,"line-paths",t,[this.gridLineGroupSelection,this.tickLineGroupSelection],i.tick,((e,t)=>t.tickId),e),Vh(this.id,"tick-labels",t,[this.tickLabelGroupSelection],i.label,(e=>e.unsafeDatum.tickId),e),Vh(this.id,"title",t,[this.caption.node],i.label,(e=>e.unsafeDatum.tickId),e)}resetSelectionNodes(){Wh([this.lineNodeGroup,this.tickLabelGroup,this.tickLineGroup,this.headingLabelGroup],((e,t)=>({translationX:t.translationX,translationY:t.translationY}))),Wh([this.gridLineGroupSelection,this.tickLineGroupSelection],((e,t)=>{const{x1:i,x2:n,y1:s,y2:a}=t;return{x1:i,x2:n,y1:s,y2:a}})),Wh([this.gridFillGroupSelection],((e,t)=>{const{x1:i,x2:n,y1:s,y2:a}=t;return{x:i,y:s,width:n-i,height:a-s}})),Wh([this.tickLabelGroupSelection],((e,t)=>({x:t.x,y:t.y,rotationCenterX:t.rotationCenterX,rotationCenterY:t.rotationCenterY,rotation:t.rotation}))),Wh([this.caption.node],((e,t)=>({x:t.x,y:t.y,rotationCenterX:t.rotationCenterX,rotationCenterY:t.rotationCenterY,rotation:t.rotation}))),Wh([this.lineNode],((e,t)=>{const{x1:i,x2:n,y1:s,y2:a}=t;return{x1:i,x2:n,y1:s,y2:a}}))}},Uc=["right","top","left","bottom"];var Xc=["direction","xKey","yKey","sizeKey","angleKey","radiusKey","normalizedTo"];function Zc(e,t,i,s){const a=new Map,o=(e,t,i)=>{const n=(e=>{if(void 0===e)return Xc;if(a.has(e))return a.get(e);const t=s.getSeriesModule(e)?.matchingKeys??Xc;return a.set(e,t),t})(e),o=[e];for(const e of n)e in t&&null!=t[e]&&o.push(`${e}=${t[e]}`);return i?.seriesGrouping&&o.push(`seriesGrouping.groupId=${i?.seriesGrouping.groupId}`),o.join(";")},r=new Map;let l=0;for(const t of e){const e=o(t.type,t.properties,i?.[l]);r.has(e)||r.set(e,[]),r.get(e)?.push([t,l++])}const h=new Map;l=0;for(const e of t){const t=o(e.type,e,e);h.has(t)||h.set(t,[]),h.get(t)?.push([e,l++])}if(![...r.keys()].some((e=>h.has(e))))return{status:"no-overlap",oldKeys:r.keys(),newKeys:h.keys()};const c=[];for(const[e,t]of h.entries())for(const[s,a]of t){const t=r.get(e);if(null==t||t.length<1){c.push({opts:s,targetIdx:a,idx:a,status:"add"}),r.delete(e);continue}const[o,l]=t.shift(),h=i?.[l]??{},d=(0,n.G4M)(h,s??{}),{groupIndex:u,stackIndex:p}=d?.seriesGrouping??{};null!=u||null!=p?c.push({opts:s,series:o,diff:d,targetIdx:a,idx:l,status:"series-grouping"}):d?c.push({opts:s,series:o,diff:d,targetIdx:a,idx:l,status:"update"}):c.push({opts:s,series:o,targetIdx:a,idx:l,status:"no-op"}),0===t.length&&r.delete(e)}for(const e of r.values())for(const[t,i]of e)c.push({series:t,idx:i,targetIdx:-1,status:"remove"});return{status:"overlap",changes:c}}var qc=[["category","legend"],["gradient","gradientLegend"]],Qc=class extends Uh{*legends(){for(const[e,t]of qc){const i=this.getModule(t);i&&(yield{legendType:e,legend:i})}}selection(){return this.getModule("selection")}},Jc="ag-charts-overlay";function ed(e){switch(e){case"top":return"top";case"bottom":return"bottom";case"baseline":return"baseline";default:return"middle"}}var td=(()=>{var e=class extends n.XPE{constructor(e,t){super(),this.className=e,this.defaultMessageId=t,this.enabled=!0}getText(e){return(0,n.cyL)(this.text)?(0,n.boc)(this.text):this.rendererAsText?this.rendererAsText:e.t((0,n.i$)(this.text)||this.defaultMessageId)}getElement(e,t,i,s){this.content?.remove(),this.rendererAsText=void 0,this.focusBox=s;const a=this.renderer?(0,n.cVk)(e,this.renderer,{}):void 0,o=(0,n.GIY)(a);if("string"==typeof o||(0,n.sby)(o)){if((0,n.sby)(o))this.content=o;else{const e=(0,n.na4)("div");e.innerHTML=o;const{firstElementChild:t}=e;(0,n.sby)(t)&&1===e.childElementCount?this.content=t:this.content=e}this.rendererAsText=this.content?.textContent?.trim()}else{const e=(0,n.na4)("div",{display:"flex",alignItems:"center",justifyContent:"center",boxSizing:"border-box",height:"100%",margin:"8px",fontFamily:"var(--ag-charts-font-family)",fontSize:"var(--ag-charts-font-size)",fontWeight:"var(--ag-charts-font-weight)",color:"var(--ag-charts-text-color)"});if((0,n.cyL)(this.text)){const t=(0,n.na4)("div");for(const e of this.text){if("image"===e.type){this.appendImageSegment(t,e);continue}const i=(0,n.na4)("span",{color:e.color,fontSize:`${e.fontSize}px`,fontFamily:e.fontFamily??"inherit",fontWeight:String(e.fontWeight),fontStyle:e.fontStyle});i.innerText=(0,n.i$)(e.text),t.appendChild(i)}e.appendChild(t)}else e.innerText=this.getText(i);this.content=e,this.content.classList.add(this.className),t?.animate({from:0,to:1,id:"overlay",phase:"add",groupId:"opacity",onUpdate(t){e.style.opacity=String(t)},onStop(){e.style.opacity="1"}})}return this.content}appendImageSegment(e,t){const i=(0,n.na4)("img",function(e){const{top:t,right:i,bottom:s,left:a}=(0,n.Q1u)(e.padding);return{boxSizing:"border-box",objectFit:"contain",width:`${e.width}px`,height:`${e.height}px`,padding:`${t}px ${i}px ${s}px ${a}px`,verticalAlign:ed(e.verticalAlign),backgroundColor:e.backgroundFill??"",borderRadius:null==e.cornerRadius?"":`${e.cornerRadius}px`}}
1(t));i.src=t.url,i.alt=t.alt??"",e.appendChild(i)}reposition(e){this.content&&(this.focusBox=e)}removeElement(e=()=>this.content?.remove(),t){if(this.content){if(t){const{content:i}=this;t.animate({from:1,to:0,phase:"remove",id:"overlay",groupId:"opacity",onUpdate(e){i.style.opacity=String(e)},onStop(){e?.()}})}else e?.();this.content=void 0,this.focusBox=void 0}}};return d([n.mAP],e.prototype,"enabled",2),d([n.mAP],e.prototype,"text",2),d([n.mAP],e.prototype,"renderer",2),e})(),id=(()=>{var e=class extends n.XPE{constructor(){super(...arguments),this.darkTheme=!1,this.loading=new td("ag-charts-loading-overlay","overlayLoadingData"),this.noData=new td("ag-charts-no-data-overlay","overlayNoData"),this.noVisibleSeries=new td("ag-charts-no-visible-series","overlayNoVisibleSeries"),this.unsupportedBrowser=new td("ag-charts-unsupported-browser","overlayUnsupportedBrowser"),this.validation=new td("ag-charts-validation-overlay","overlayValidation")}getFocusInfo(e){for(const t of[this.validation,this.loading,this.noData,this.noVisibleSeries,this.unsupportedBrowser])if(void 0!==t.focusBox)return{text:t.getText(e),rect:t.focusBox}}destroy(){this.loading.removeElement(),this.noData.removeElement(),this.noVisibleSeries.removeElement(),this.unsupportedBrowser.removeElement(),this.validation.removeElement()}};return d([n.mAP],e.prototype,"darkTheme",2),d([n.mAP],e.prototype,"loading",2),d([n.mAP],e.prototype,"noData",2),d([n.mAP],e.prototype,"noVisibleSeries",2),d([n.mAP],e.prototype,"unsupportedBrowser",2),e})();var nd="ag-charts-validation-overlay",sd={error:"overlayValidationErrorsHeading",warning:"overlayValidationWarningsHeading",deprecation:"overlayValidationDeprecationsHeading"},ad={error:{one:"overlayValidationErrorCountSingular",other:"overlayValidationErrorCount"},warning:{one:"overlayValidationWarningCountSingular",other:"overlayValidationWarningCount"},deprecation:{one:"overlayValidationDeprecationCountSingular",other:"overlayValidationDeprecationCount"}};function od(e,t,i){const n=e.createElement("div",`${nd}__entry ${nd}__entry--${i}`),s=e.createElement("div",`${nd}__message`);if(function(e,t,i){const n=i.split("`");for(let i=0;i<n.length;i++){const s=n[i];if(""!==s)if(i%2==1){const i=e.createElement("code",`${nd}__term`);i.textContent=s,t.appendChild(i)}else t.appendChild(e.document.createTextNode(s))}}(e,s,t.message),n.appendChild(s),t.detail){const i=e.createElement("pre",`${nd}__code`);i.textContent=t.detail,n.appendChild(i)}return n}function rd({agDocument:e,localeManager:t,grouped:i,onDismiss:n}){const s=e.createElement("div",nd),a=e.createElement("div",`${nd}__panel`);a.addEventListener("contextmenu",(e=>e.preventDefault()));const o=e.createElement("div",`${nd}__header`),r=e.createElement("div",`${nd}__summary`);r.textContent=function(e,t){const i=[];for(const n of mh){const s=t[n].length;if(0===s)continue;const a=1===s?ad[n].one:ad[n].other;i.push(e.t(a,{count:s}))}return e.t("overlayValidationSummary",{summary:i.join(", ")})}(t,i),o.appendChild(r);const l=e.createElement("div",`${nd}__actions`),h=e.navigator?.clipboard;if(null!=h&&"function"==typeof h.writeText){const n=e.createElement("button",`${nd}__button ${nd}__copy`);n.type="button",n.textContent=t.t("overlayValidationCopy"),n.addEventListener("click",(()=>{h.writeText(function(e){const t=[];for(const i of mh)for(const n of e[i])t.push(`[${i}] ${n.message}`),n.detail&&t.push(n.detail);return t.join("\n")}(i)).then((()=>{n.textContent=t.t("overlayValidationCopied")})).catch((()=>{}))})),l.appendChild(n)}const c=e.createElement("button",`${nd}__button ${nd}__dismiss`);c.type="button",c.textContent="Ã",c.setAttribute("aria-label",t.t("overlayValidationDismiss")),c.setAttribute("title",t.t("overlayValidationDismiss")),c.addEventListener("click",(()=>n())),l.appendChild(c),o.appendChild(l),a.appendChild(o);const d=e.createElement("div",`${nd}__body`);let u=!1;for(const n of mh){const s=i[n];if(0===s.length)continue;u&&d.appendChild(e.createElement("hr",`${nd}__divider`)),u=!0;const a=e.createElement("div",`${nd}__section ${nd}__section--${n}`),o=e.createElement("div",`${nd}__section-heading`);o.textContent=t.t(sd[n],{count:s.length}),a.appendChild(o);for(const t of s)a.appendChild(od(e,t,n));d.appendChild(a)}return a.appendChild(d),s.appendChild(a),s}var ld=(()=>{var e=class extends n.XPE{constructor(e){super(),this.ctx=e,this.seriesAreaGroup=new ke({name:"series-area-container",zIndex:n.Dcv.SERIES_AREA_CONTAINER}),this.borderNode=this.seriesAreaGroup.appendChild(new Ge),this.border=new n.VHq(this.borderNode),this.cornerRadius=0,this.padding=new n.Yqy(0),this.cleanup=new n._uV,this.overlayGroup=new Ie({name:"SeriesArea-Overlay",zIndex:n.Dcv.SERIES_AREA_CONTAINER}),this.underlayGroup=new Ie({name:"SeriesArea-Underlay",zIndex:n.Dcv.SERIES_AREA_UNDERLAY}),this.borderNode.fill=void 0,this.cleanup.register(e.scene.attachNode(this.seriesAreaGroup),e.scene.attachNode(this.overlayGroup),e.scene.attachNode(this.underlayGroup),e.eventsHub.on("layout:complete",(e=>this.onLayoutComplete(e))))}destroy(){this.cleanup.flush()}getPadding(){const{border:e,padding:t}=this,i=e.enabled?e.strokeWidth:0;return{top:t.top+i,right:t.right+i,bottom:t.bottom+i,left:t.left+i}}applyOptions(){}update(e,t){this.onUpdate(t?.clone().translate(-e.x,-e.y))}onUpdate(e){}onLayoutComplete(e){const{x:t,y:i,width:n,height:s}=e.series.paddedRect;this.borderNode.x=t,this.borderNode.y=i,this.borderNode.width=n,this.borderNode.height=s;const{x:a,y:o}=e.series.rect;this.overlayGroup.translationX=a,this.overlayGroup.translationY=o,this.underlayGroup.translationX=a,this.underlayGroup.translationY=o}};return d([n.mAP],e.prototype,"backgroundRegions",2),d([n.mAP],e.prototype,"border",2),d([n.mAP],e.prototype,"clip",2),d([(0,n.s8C)("borderNode","cornerRadius"),n.mAP],e.prototype,"cornerRadius",2),d([n.mAP],e.prototype,"padding",2),e})();function hd(e,t){const{path:i,size:n}=e,{x:s,y:a}=e;i.clear();let o=!1;for(const[e,r]of t){const t=s+(e-.5)*n,l=a+(r-.5)*n;o?i.lineTo(t,l):i.moveTo(t,l),o=!0}i.closePath()}var cd={circle({path:e,x:t,y:i,size:n}){const s=n/2;e.arc(t,i,s,0,2*Math.PI),e.closePath()},cross(e){hd(e,[[.25,0],[.5,.25],[.75,0],[1,.25],[.75,.5],[1,.75],[.75,1],[.5,.75],[.25,1],[0,.75],[.25,.5],[0,.25]])},diamond(e){hd(e,[[.5,0],[1,.5],[.5,1],[0,.5]])},heart({path:e,x:t,y:i,size:s}){const a=s/4;i+=a/2,e.arc(t-a,i-a,a,(0,n.ehJ)(130),(0,n.ehJ)(330)),e.arc(t+a,i-a,a,(0,n.ehJ)(220),(0,n.ehJ)(50)),e.lineTo(t,i+a),e.closePath()},pin({path:e,x:t,y:i,size:n}){const s=.5,a=.5;
1e.moveTo(t+.391*n,i+(.391-a)*n),e.cubicCurveTo(t+.391*n,i+(.606-a)*n,t+0*n,i+.5*n,t+0*n,i+.5*n),e.cubicCurveTo(t+0*n,i+.5*n,t+-.391*n,i+(.606-a)*n,t+-.391*n,i+(.391-a)*n),e.cubicCurveTo(t+-.391*n,i+-.325*n,t+(.284-s)*n,i+-.5*n,t+0*n,i+-.5*n),e.cubicCurveTo(t+(.716-s)*n,i+-.5*n,t+.391*n,i+-.325*n,t+.391*n,i+(.391-a)*n),e.closePath()},plus(e){hd(e,[[1/3,0],[2/3,0],[2/3,1/3],[1,1/3],[1,2/3],[2/3,2/3],[2/3,1],[1/3,1],[1/3,2/3],[0,2/3],[0,1/3],[1/3,1/3]])},square({path:e,x:t,y:i,size:n}){const s=n/2;e.moveTo(t-s,i-s),e.lineTo(t+s,i-s),e.lineTo(t+s,i+s),e.lineTo(t-s,i+s),e.closePath()},star({path:e,x:t,y:i,size:n}){const s=n/2,a=s/2,o=Math.PI/2;for(let n=0;n<10;n++){const r=n%2==0?s:a,l=n*Math.PI/5-o,h=t+Math.cos(l)*r,c=i+Math.sin(l)*r;e.lineTo(h,c)}e.closePath()},triangle(e){hd(e,[[.5,0],[1,.87],[0,.87]])}},dd=new Map,ud=new WeakMap;function pd(e,t,i){const n=new se,s={path:n,x:0,y:0,size:t,pixelRatio:i};return"string"==typeof e?cd[e](s):e(s),n}function gd(e,t,i=1){if("string"==typeof e){const i=`${e}:${t}`;let n=dd.get(i);return void 0===n&&(dd.size>=1024&&dd.clear(),n=pd(e,t,1),dd.set(i,n)),n}if("function"==typeof e){let n=ud.get(e);void 0===n&&(n=new Map,ud.set(e,n));const s=`${t}:${i}`;let a=n.get(s);return void 0===a&&(n.size>=1024&&n.clear(),a=pd(e,t,i),n.set(s,a)),a}return pd("square",t,i)}var md=Object.freeze({x:.5,y:1}),yd=Object.freeze({x:.5,y:.5}),fd=new m(0,0,0,0),xd=new m(0,0,0,0);function bd(e){if(null==e)return 0;const{stroke:t,strokeWidth:i=0,strokeOpacity:n=1}=e;return null!=t&&"none"!==t&&i>0&&n>0?i/2:0}var vd=(()=>{var e=class extends je{constructor(){super(...arguments),this.shape="square",this.x=0,this.y=0,this.size=12,this.pickInflation=0}onChangeDetection(e){"__x"!==e&&"__y"!==e?super.onChangeDetection(e):this.markDirty(e)}isPointInPath(e,t){const{pickInflation:i}=this,n=i>0?i*(i+this.size):0;return this.distanceSquaredLocal(e,t)<=n}isPointInSharedPath(e,t){if(!this._sharedPath?.closedPath)return!1;const i=Sd.anchor(this.shape),n=e-this.x+(i.x-.5)*this.size,s=t-this.y+(i.y-.5)*this.size;return this._sharedPath.isPointInPath(n,s)}get midPoint(){return{x:this.x,y:this.y}}distanceSquared(e,t){return this.distanceSquaredLocal(e,t)}distanceSquaredLocal(e,t){const i=Sd.anchor(this.shape),n=e-this.x+(i.x-.5)*this.size,s=t-this.y+(i.y-.5)*this.size,a=this.size/2;return Math.max(n*n+s*s-a*a,0)}pathComplexity(){return this._sharedPath?.commands.length??0}updatePath(){const{shape:e,size:t}=this;if(null==e||!(t>0))return void(this._sharedPath=void 0);const i=this.layerManager?.canvas?.pixelRatio??1,n="square"===e?S(i,t):t;this._sharedPath=gd(e,n,i)}computeBBox(){const{x:e,y:t,size:i}=this,n=Sd.anchor(this.shape);return new m(e-i*n.x,t-i*n.y,i,i)}drawPath(e,t){if(void 0===this._sharedPath)return;const{shape:i,x:n,y:s,size:a}=this,o=Sd.anchor(i),r=n-(o.x-.5)*a,l=s-(o.y-.5)*a,h=this.layerManager?.canvas?.pixelRatio??1,c=("square"===i?S(h,a):a)/2,d="square"===i?S(h,r-c)+c:r,u="square"===i?S(h,l-c)+c:l,p=super.getBBox();let g;fd.x=p.x-d,fd.y=p.y-u,fd.width=p.width,fd.height=p.height;const m=this.__fillBBox;m&&(xd.x=m.x-d,xd.y=m.y-u,xd.width=m.width,xd.height=m.height,g=xd),e.save(),e.translate(d,u);try{this.fillStroke(e,t,this._sharedPath.getPath2D(),fd,g)}finally{e.restore()}}svgPathData(e){if(this.updatePathIfDirty(),void 0===this._sharedPath)return"";const{shape:t,x:i,y:n,size:s}=this,a=Sd.anchor(t),o=i-(a.x-.5)*s,r=n-(a.y-.5)*s;return e?this._sharedPath.toSVG(((t,i)=>e(t+o,i+r))):this._sharedPath.toSVG(((e,t)=>({x:e+o,y:t+r})))}executeFill(e,t){if(t)return super.executeFill(e,t)}executeStroke(e,t){if(t)return super.executeStroke(e,t)}};return d([(0,n.HvY)({equals:n.EJX})],e.prototype,"shape",2),d([(0,n.M7D)()],e.prototype,"x",2),d([(0,n.M7D)()],e.prototype,"y",2),d([(0,n.M7D)({convertor:Math.abs})],e.prototype,"size",2),e})(),Sd=(()=>class extends(fe(xe(be(vd)))){get serializedType(){return"marker"}static anchor(e){return"pin"===e?md:"function"==typeof e&&"anchor"in e?e.anchor:yd}constructor(e){super(e),null!=e?.shape&&(this.shape=e.shape)}resetAnimationProperties(e,t,i,n,s,a){const o=this.__size!==i;this.__x=e,this.__y=t,this.__size=i,this.__opacity=n,this.resetScalingProperties(s,a,e,t),o&&(this.dirtyPath=!0),this.markDirty()}setVisibilityAndPosition(e,t,i,n){let s=!1,a=!1;this.__visible!==e&&(this.__visible=e,s=!0),this.__shape!==t&&(this.__shape=t,s=!0,a=!0);const o=Math.abs(i);if(this.__size!==o&&(this.__size=o,s=!0,a=!0),n){const{x:e,y:t}=n;this.__x!==e&&(this.__x=e,s=!0),this.__y!==t&&(this.__y=t,s=!0),this.__scalingCenterX!==e&&(this.__scalingCenterX=e,s=!0),this.__scalingCenterY!==t&&(this.__scalingCenterY=t,s=!0)}s&&(a&&(this.dirtyPath=!0),this.markDirty())}})();function Md(e,t){if(void 0!==e.itemId)return e.itemId;if(void 0!==t){const i=e.datum?.[t];if(null!=i)return"number"==typeof i?i:String(i)}return"number"==typeof e.datumIndex?e.datumIndex:JSON.stringify(e.datumIndex)}function kd(e,t){return e.series===t.series&&(0,n.DH9)(e.datumIndex,t.datumIndex)}var Dd=class{constructor(e,t){this.activeManager=e,this.tooltipProperties=t,this.candidates=[],this.blockEntrance=!1,this.activationPrevented=!1}clear(){this.candidates.length=0,this.pendingPickedNodes=void 0}popPendingPickedNodes(){const e=this.pendingPickedNodes;return this.pendingPickedNodes=void 0,e}getActivationArgs(e){if(void 0===e)return[void 0,void 0];return[{type:"series-node",seriesId:e.series.id,itemId:Md(e,e.series.data?.dataIdKey)},e]}maybeActivate(e,t,i){if(this.blockEntrance)throw new Error("PickManager.maybeActivate is not re-entrant");try{this.activationPrevented=!1,this.blockEntrance=!0;const[n,s]=this.getActivationArgs(e);this.activeManager.update(n,s)?this.activationPrevented=!0:(this.active=e,t(i?.defaultCbArg))}finally{this.blockEntrance=!1}}
1onClearUI(){this.activeManager.clear(),this.clear()}onClearAPI(){this.clear()}onPickedNodesHighlight(e){if(void 0!==e){const t=this.active;if(this.tooltipProperties.pagination&&void 0!==t){const i=e.matches.find((e=>kd(e,t)));if(i)return i}}const t=e?.matches[0];return t}onPickedNodesTooltip(e){if(void 0!==e&&this.tooltipProperties.pagination){const t=this.active,i=e.matches.filter((e=>e.series.properties.tooltip.enabled??!0));this.candidates=i;let n=function(e,t){return null==t?-1:e.findIndex((e=>kd(e,t)))}(i,t);-1===n&&(n=0);return{active:i[n],paginationState:{index:n,length:i.length}}}const t=e?.matches[0];return{active:t}}onPickedNodesAPI(e){return this.pendingPickedNodes=e,e.matches[0]}onPickedNodesAPIDebounced(){return{active:this.onPickedNodesHighlight(this.popPendingPickedNodes())}}nextCandidate(){if(this.tooltipProperties.pagination){const{candidates:e}=this,t=this.active,i=null==t?-1:e.findIndex((e=>kd(e,t)));if(-1===i)return{active:void 0,paginationState:void 0};let n=i+1;n>=e.length&&(n=0);return{active:e[n],paginationState:{index:n,length:this.candidates.length}}}return{active:this.active}}wasActivationPrevented(){return this.activationPrevented}},wd=(()=>{var e=class extends n.zey{constructor(){super(...arguments),this.enabled=!0,this.shape="circle",this.size=0,this.fillOpacity=1,this.strokeWidth=1,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0}onChangeDetection(e){this._cachedStyle=void 0,super.onChangeDetection(e)}getStyle(){if(void 0!==this._cachedStyle)return this._cachedStyle;const{size:e,shape:t,fill:i,fillOpacity:n,stroke:s,strokeWidth:a,strokeOpacity:o,lineDash:r,lineDashOffset:l}=this,h={size:e,shape:t,fill:i,fillOpacity:n,stroke:s,strokeWidth:a,strokeOpacity:o,lineDash:r,lineDashOffset:l};return this._cachedStyle=h,h}getDiameter(){return this.size+this.strokeWidth}};return d([n.mAP,(0,n.k8u)()],e.prototype,"enabled",2),d([n.mAP,(0,n.Tou)({equals:n.EJX})],e.prototype,"shape",2),d([n.mAP,(0,n.k8u)()],e.prototype,"size",2),d([n.mAP,(0,n.Tou)({equals:n.DH9})],e.prototype,"fill",2),d([n.mAP,(0,n.k8u)()],e.prototype,"fillOpacity",2),d([n.mAP,(0,n.k8u)()],e.prototype,"stroke",2),d([n.mAP,(0,n.k8u)()],e.prototype,"strokeWidth",2),d([n.mAP,(0,n.k8u)()],e.prototype,"strokeOpacity",2),d([n.mAP],e.prototype,"lineDash",2),d([n.mAP],e.prototype,"lineDashOffset",2),d([n.mAP,(0,n.Tou)({equals:n.EJX})],e.prototype,"itemStyler",2),e})();function Id(e,t,i,s){if((0,n.MBc)(e))return{type:"gradient",gradient:e.gradient??t.gradient,colorStops:e.colorStops??t.colorStops,bounds:e.bounds??t.bounds,rotation:e.rotation??t.rotation,reverse:e.reverse??t.reverse,colorSpace:e.colorSpace??t.colorSpace};if((0,n.EDy)(e)){const t=e.pattern??i.pattern;let n=e.strokeWidth;"backward-slanted-lines"===t||"forward-slanted-lines"===t||"horizontal-lines"===t||"vertical-lines"===t?n??(n=i.strokeWidth):n??(n=0);return{type:"pattern",pattern:t,width:e.width??e.height??i.width,height:e.height??e.width??i.height,path:e.path,padding:e.padding??i.padding,fill:e.fill??i.fill,fillOpacity:e.fillOpacity??i.fillOpacity,backgroundFill:e.backgroundFill??i.backgroundFill,backgroundFillOpacity:e.backgroundFillOpacity??i.backgroundFillOpacity,stroke:e.stroke??i.stroke,strokeOpacity:e.strokeOpacity??i.strokeOpacity,strokeWidth:n,rotation:e.rotation??i.rotation,scale:e.scale??i.scale}}return(0,n.BF9)(e)?{type:"image",url:e.url,width:e.width,height:e.height,backgroundFill:e.backgroundFill??s.backgroundFill,backgroundFillOpacity:e.backgroundFillOpacity??s.backgroundFillOpacity,rotation:e.rotation??s.rotation,repeat:e.repeat??s.repeat,fit:e.fit??s.fit}:e}function Ad(e,t,i,s){return(0,n.MBc)(e?.fill)||(0,n.EDy)(e?.fill)||(0,n.BF9)(e?.fill)?{...e,fill:Id(e.fill,t,i,s)}:e}var Cd=(e=>(e[e.EXACT_SHAPE_MATCH=0]="EXACT_SHAPE_MATCH",e[e.NEAREST_NODE=1]="NEAREST_NODE",e[e.AXIS_ALIGNED=2]="AXIS_ALIGNED",e))(Cd||{}),Nd=class{constructor(e,t){this.series=e,this.seriesGrouping=t}};function Ld(e){switch(e){case"x":return n.tv$.X;case"y":return n.tv$.Y;case"angle":return n.tv$.Angle;case"radius":return n.tv$.Radius}}function Pd(e){switch(e){case n.tv$.X:return"x";case n.tv$.Y:return"y";case n.tv$.Angle:return"angle";case n.tv$.Radius:return"radius";default:return"x"}}var Td=(()=>{var e=class{constructor(e){this.cleanup=new n._uV,this.usesPlacedLabels=!1,this.alwaysClip=!1,this.supportsStandaloneZoom=!1,this.hasChangesOnHighlight=!1,this.hasChangesOnSelection=!1,this.seriesGrouping=void 0,this.internalId=(0,n.sX_)(this),this.contentGroup=new we({name:`${this.internalId}-content`,zIndex:n.qw7.ANY_CONTENT}),this.highlightGroup=new we({name:`${this.internalId}-highlight`,zIndex:n.qw7.ANY_CONTENT}),this.highlightNodeGroup=this.highlightGroup.appendChild(new ke({name:`${this.internalId}-highlight-node`})),this.highlightLabelGroup=this.highlightGroup.appendChild(new ke({name:`${this.internalId}-highlight-label`,zIndex:n.fUl.LABEL})),this.annotationGroup=new we({name:`${this.internalId}-annotation`}),this.labelGroup=new we({name:`${this.internalId}-series-labels`}),this.axes={},this.directions=[n.tv$.X,n.tv$.Y],this._nodeDataRefresh=!0,this._nodeDataVersion=0,this.processedDataUpdated=!0,this.moduleMap=new Uh,this._dataConnected=!0,this.datumCallbackCache=new Map,this.connectsToYAxis=!1,this.declarationOrder=-1,this._broughtToFront=!1,this.events=new n.bkB,this._pickNodeCache=new n.qKc(5);const{moduleCtx:t,pickModes:i,propertyKeys:s={},propertyNames:a={},canHaveAxes:o=!1,usesPlacedLabels:r=!1,alwaysClip:l=!1,supportsStandaloneZoom:h=!1}=e;this.ctx=t,this.propertyKeys=s,this.propertyNames=a,this.canHaveAxes=o,this.usesPlacedLabels=r,this.pickModes=i,this.alwaysClip=l,this.supportsStandaloneZoom=h,this.highlightLabelGroup.pointerEvents=1,this.cleanup.register(this.ctx.eventsHub.on("data:update",(e=>{this._dataConnected&&this.setChartData(e)})),this.ctx.eventsHub.on("highlight:change",(e=>this.onChangeHighlight(e))),this.events.on("data-selection-change",(()=>{this.hasChangesOnSelection=!0,this.bucketLookup?.refresh()})))}get pickModeAxis(){return"main"}get id(){return this.properties?.id??this.internalId}get type(){return this.constructor.type??""}get nodeDataRefresh(){return this._nodeDataRefresh}set nodeDataRefresh(e){this._nodeDataRefresh=e,e&&this._nodeDataVersion++}get nodeDataVersion(){return this._nodeDataVersion}get focusable(){return!0}get data(){return this._data??this._chartData}set visible(e){this.properties.visible=e,this.ctx.legendManager?.toggleItem(e,this.id),this.visibleMaybeChanged()}get visible(){return this.ctx.legendManager?.getSeriesEnabled(this.id)??this.properties.visible}get hasData(){const e=this.data;return null!=e&&e.netSize()>0}get tooltipEnabled(){return this.properties.tooltip?.enabled}onDataChange(){this.nodeDataRefresh=!0,this.processedDataUpdated=!0,this._pickNodeCache.clear()}setOptionsData(e){this._data=e,this.onDataChange()}isHighlightEnabled(){return this.properties.highlight.enabled}isSelectionEnabled(){return this.properties.selection.enabled}isDatumSelectable(e){return!0}setChartData(e){this._chartData=e,this.data===e&&this.onDataChange()}onSeriesGroupingChange(e,t){const{internalId:i,type:n,visible:s}=this;e&&this.ctx.seriesStateManager.deregisterSeries(this),t&&this.ctx.seriesStateManager.registerSeries({internalId:i,type:n,visible:s,seriesGrouping:t,width:"width"in this.properties?this.properties.width:0}),this.events.emit("grouping-changed",new Nd(this,t))}getBandScalePadding(){return{inner:1,outer:0}}attachSeries(e,t,i){e.appendChild(this.contentGroup),t.appendChild(this.highlightGroup),t.appendChild(this.labelGroup),i?.appendChild(this.annotationGroup)}detachSeries(e,t,i){this.contentGroup.remove(),this.highlightGroup.remove(),this.labelGroup.remove(),this.annotationGroup.remove()}setSeriesIndex(e,t=!1){const i=this.bringToFront();return!(!t&&e===this.declarationOrder&&i===this._broughtToFront)&&(this.declarationOrder=e,this._broughtToFront=i,this.setZIndex(i?Number.MAX_VALUE:e),this.events.emit("grouping-changed",new Nd(this,this.seriesGrouping)),!0)}setZIndex(e){this.contentGroup.zIndex=[n.qw7.ANY_CONTENT,e,n.fUl.FOREGROUND],this.highlightGroup.zIndex=[n.qw7.ANY_CONTENT,e,n.fUl.HIGHLIGHT],this.labelGroup.zIndex=[n.qw7.ANY_CONTENT,e,n.fUl.LABEL],this.annotationGroup.zIndex=e}renderToOffscreenCanvas(){return!1}disconnectData(){this._dataConnected=!1}reconnectData(){this._dataConnected=!0}hasHighlightOpacity(){if(!this.properties.highlight.enabled)return!1;const e=this.ctx.highlightManager.getActiveHighlight();if(null==e)return!1;if(!1===e.series?.isHighlightEnabled())return!1;const{unhighlightedItem:t,unhighlightedSeries:i}=this.properties.highlight;return kl(t)||kl(i)}getDrawingMode(e,t="cutout"){return e?t:this.hasHighlightOpacity()?this.ctx.chartService.highlight?.drawingMode??"overlay":"overlay"}getAnimationDrawingModes(){return{start:{drawingMode:"overlay"},finish:{drawingMode:this.getDrawingMode(!1)}}}updatedDomains(){}destroy(){this.cleanup.flush(),this.resetDatumCallbackCache(),this.ctx.seriesStateManager.deregisterSeries(this),this.moduleContext?.destroy()}getPropertyValues(e,t){const i=Ld(e),n=null==i?e:Pd(this.resolveKeyDirection(i)),s=t?.[n],a=[];if(!s)return a;const o=(...e)=>{for(const t of e)Array.isArray(t)?o(...t):"object"==typeof t?o(...Object.values(t)):a.push(t)};return o(...s.map((e=>this.properties[e]))),a}getKeyAxis(e){}getKeys(e){return this.getPropertyValues(Pd(e),this.propertyKeys)}getKeyProperties(e){return this.propertyKeys[this.resolveKeyDirection(e)]??[]}getNames(e){return this.getPropertyValues(Pd(e),this.propertyNames)}getFormatterContext(e){const{id:t}=this,i=this.getPropertyValues(e,this.propertyKeys),n=this.getPropertyValues(e,this.propertyNames),s=[];for(let e=0;e<i.length;e++)s.push({seriesId:t,key:i[e],name:n[e]});return s}resolveKeyDirection(e){return e}getDomain(e){const t=this.getSeriesDomain(e),i=this.moduleMap.mapModules((t=>t.getDomain(e))).flat();return 0===i.length?t:{domain:t.domain.concat(i)}}
1getRange(e,t){return this.getSeriesRange(e,t)}getMinimumRangeSeries(e){}getMinimumRangeChart(e){return 0}getZoomRangeFittingItems(e,t,i){}getVisibleItems(e,t,i){return 1/0}toCanvasFromMidPoint(e){const{x:t=0,y:i=0}=e.midPoint??{};return Me.toCanvasPoint(this.contentGroup,t,i)}markNodeDataDirty(){this.nodeDataRefresh=!0,this._pickNodeCache.clear(),this.visibleMaybeChanged()}visibleMaybeChanged(){const{internalId:e,seriesGrouping:t,type:i,visible:n}=this;this.ctx.seriesStateManager.updateSeries({internalId:e,type:i,visible:n,seriesGrouping:t,width:"width"in this.properties?this.properties.width:0})}getOpacity(){return this.properties.highlight?this.getSelectionStyle()?.opacity??this.getHighlightStyle().opacity??1:1}getHighlightState(e,t,i,n){if(!this.properties.highlight.enabled)return 0;if(t)return 1;if(null==e?.series)return 0;if(!1===e.series.isHighlightEnabled())return 0;if(this.isSeriesHighlighted(e,n)){return null==this.isItemHighlighted(e,i)?2:4}return null!=i&&this.getSharedCategoryMatch(e)===i?1:3}getSharedCategoryMatch(e){const{chartService:t}=this.ctx;if(null!=e&&"shared"===t.highlight?.mode&&null!=e.series&&this.isDatumHighlight(e)&&e.series!==this)return t.getSharedHighlightMatch?.(e.series,e.datumIndex,this)}getDataSelectionState(e){return this.ctx.dataSelectionService?.getDataSelectionState(this,e)}getDataCandidacyState(e){return this.ctx.dataSelectionService?.getDataCandidateState(this,e)}createBucketLookupFeature(){}ensureBucketLookupFeature(){if(void 0===this.bucketLookup){const e=this.createBucketLookupFeature();e&&(this.bucketLookup=e,e.refresh())}return this.bucketLookup}getHighlightStateString(e,t,i,n){return sl(this.getHighlightState(e,t,i,n))}getSelectionStateString(e,t){if(t??(t=this.getDataSelectionState(e)),void 0!==t)return al(t)}getCandidateStateString(e,t){if(t??(t=this.getDataCandidacyState(e)),void 0!==t)return al(t)}getCollapsedState(e){}onChangeHighlight(e){const t=e.previousHighlight,i=e.currentHighlight,s=this.getHighlightState(i),a=this.getHighlightState(t);this.setSeriesIndex(this.declarationOrder);const o=this.hasItemStylers();if(!o&&s===a){const e=2===s&&this.isDatumHighlight(i)!==this.isDatumHighlight(t),n=this.getSharedCategoryMatch(i)!==this.getSharedCategoryMatch(t);if(!e&&!n)return void(this.hasChangesOnHighlight=!1)}const{highlightedSeries:r,unhighlightedItem:l,unhighlightedSeries:h}=this.properties.highlight;this.hasChangesOnHighlight=o||!(0,n.RIy)(r)||!(0,n.RIy)(l)||!(0,n.RIy)(h)}bringToFront(){return!!this.hasDataSelection()||this.properties.highlight.enabled&&this.properties.highlight.bringToFront&&this.isSeriesHighlighted(this.ctx.highlightManager.getActiveHighlight())}isSeriesHighlighted(e,t){return!!this.properties.highlight.enabled&&e?.series===this}isItemHighlighted(e,t){if(null!=e&&!Number.isNaN(e.datumIndex)&&null!=t)return e.datumIndex===t}isDatumHighlight(e){return yl(e)}hasDataSelection(){return(this.ctx.dataSelectionService?.getDataSetSelection(this)?.getSelectedCount()??0)>0}getHighlightStyle(e,t,i,n){if(void 0===i){const s=this.ctx.highlightManager?.getActiveHighlight();i=this.getHighlightState(s,e,t,n)}return this.properties.highlight.getStyle(i)}getSelectionStyle(e,t,i){i??(i=this.getDataCandidacyState(e)),t??(t=this.getDataSelectionState(e));const n=rl(t,i);if(void 0!==n)return this.properties.selection.getStyle(n)}resolveMarkerDrawingModeForState(e,t){return wl(e,t)}filterItemStylerFillParams(e){return(0,n.MBc)(e)?(0,n.FFB)(e,["bounds","colorSpace","gradient","reverse"]):(0,n.EDy)(e)?(0,n.FFB)(e,["padding"]):e}getModuleTooltipParams(){return this.moduleMap.mapModules((e=>e.getTooltipParams())).reduce(((e,t)=>Object.assign(e,t)),{})}getDatumAriaMeta(e,t){}hasPickableNodeShapes(){return!0}pickNodes(e,t,i=!1){const{pickModes:n,pickModeAxis:s,visible:a,contentGroup:o}=this;if(!a||!o.visible)return;const r=!0===this.chart?.isMiniChart||this.hasPickableNodeShapes();let l=1/0;if("tooltip"===t||"highlight-tooltip"===t){const{tooltip:e}=this.properties;l="number"==typeof e.range?e.range:1/0,i||(i="exact"===e.range)}else if("event"===t||"context-menu"===t){const{nodeClickRange:e}=this.properties;l="number"==typeof e?e:1/0,"exact"!==e||r?i||(i="exact"===e):l=10}const h=n.filter((e=>!i||0===e)),{x:c,y:d}=e,u=JSON.stringify({x:c,y:d,maxDistance:l,selectedPickModes:h});if(this._pickNodeCache.has(u))return this._pickNodeCache.get(u);for(const t of h){let i;switch(t){case 0:{const t=this.pickNodesExactShape(e);0!==t.length&&(i=t);break}case 1:{const t=this.pickNodeClosestDatum(e),n=0===t?.distance?this.pickNodesExactShape(e):void 0;null!=n&&0!==n.length?i=n:t&&(i=[t]);break}case 2:{const t=null==s?void 0:this.pickNodeMainAxisFirst(e,"main-category"===s);null!=t&&(i=[t]);break}}if(i&&i[0].distance<=l)return this._pickNodeCache.set(u,{pickMode:t,picks:i})}return this._pickNodeCache.set(u,void 0)}pickNodesExactShape(e){const t=[];for(const i of this.contentGroup.pickNodes(e.x,e.y)){const e=i.unsafeClosestDatum(
1);"object"==typeof e&&null!=e&&!0!==e.missing&&t.push({datum:e,distance:0,target:i})}return t}pickNodeClosestDatum(e){throw new Error("AG Charts - Series.pickNodeClosestDatum() not implemented")}pickNodeNearestDistantObject(e,t){const{nearest:i,distanceSquared:s}=(0,n.KpM)(e.x,e.y,t),a=i?.unsafeClosestDatum();if(null!=i&&"object"==typeof a&&null!=a&&!0!==a.missing)return{datum:a,distance:Math.sqrt(s),target:i}}pickNodeMainAxisFirst(e,t){throw new Error("AG Charts - Series.pickNodeMainAxisFirst() not implemented")}hasBuiltinListener(e){return!1}getHighlightPart(e){}firesUserClickListeners(e){return!0}pickNodesInBBoxPredicate(){const{containment:e}=this.properties.selection;switch(e){case"any":return(e,t)=>{const i=Me.toCanvas(t);return(0,n.$ZB)(e,i.x,i.y,i.width,i.height)};case"all":return(e,t)=>{const i=Me.toCanvas(t);return(0,n.JF9)(e,i.x,i.y,i.width,i.height)};default:return e}}*pickNodesInBBox(e){const t=this.pickNodesInBBoxPredicate();yield*function*e(t,i){for(const n of t.children())if(n.visible&&1!==n.pointerEvents)if("object"==typeof n.datum&&null!=n.datum&&"datumIndex"in n.datum){const e=i(n);void 0!==e&&(yield e)}else n instanceof ke&&(yield*e(n,i))}(this.contentGroup,(i=>{if(t(e,i))return i.unsafeDatum}))}getLabelData(){return[]}getLabelDefaults(){}getLabelCandidateStyler(){}getLabelCandidateResolver(){}updatePlacedLabelData(e){}hasNodeClickListener(){const e=this.properties.listeners,t=this.ctx.chartService.listeners;return null!=e?.seriesNodeClick||null!=e?.seriesNodeDoubleClick||null!=t.seriesNodeClick||null!=t.seriesNodeDoubleClick}callListeners(e){const t=this.properties.listeners?.[e.type],i=this.ctx.chartService.listeners?.[e.type],s=[this.properties,this.ctx.chartService];return null!=t&&(0,n.cVk)(s,t,e),null!=i&&(0,n.cVk)(s,i,e),!!e.defaultPrevented}fireNodeClickEvent(e){return this.callListeners(this.createNodeEvent("seriesNodeClick",e))}fireNodeDoubleClickEvent(e){return this.callListeners(this.createNodeEvent("seriesNodeDoubleClick",e))}createNodeContextMenuActionEvent(e){return this.createNodeEvent("nodeContextMenuAction",e)}createNodeEvent(e,t){const{event:i,datums:n,winner:s,coordinates:a,otherHitParams:o}=t,r=n.map((t=>({...t.series.createNodeParams(t),type:e}))),l=null!=o&&o.length>0?[...r,...o]:r;let h=!1;return{...r[s],type:e,event:i,coordinates:a,allMatchedParams:l,get defaultPrevented(){return h},preventDefault:()=>{h=!0}}}createNodeParams(e){const t=this.data?.dataIdKey;return{datum:e.datum,datums:e.datums,totalValue:e.totalValue,seriesId:this.id,dataIdKey:t,itemId:Md(e,t),selectionState:this.getSelectionStateString(e.datumIndex),isCollapsed:null==e.itemId?void 0:this.getCollapsedState(e.itemId)}}onLegendInitialState(e,t){const{visible:i=!0,itemId:n,legendItemName:s}=t??{};this.toggleSeriesItem(i,e,n,s)}onLegendItemClick(e){const{enabled:t,itemId:i,series:n,legendType:s}=e,a="legendItemName"in this.properties?this.properties.legendItemName:void 0,o="legendItemKey"in this.properties?this.properties.legendItemKey:void 0,r=null!=a&&a===e.legendItemName;(n.id===this.id||r||null!=o)&&this.toggleSeriesItem(t,s,i,a,e)}onLegendItemDoubleClick(e){const{enabled:t,itemId:i,series:n,numVisibleItems:s,legendType:a}=e,o="legendItemName"in this.properties?this.properties.legendItemName:void 0,r="legendItemKey"in this.properties?this.properties.legendItemKey:void 0,l=null!=o&&o===e.legendItemName;n.id===this.id||l||null!=r?this.toggleSeriesItem(!0,a,i,o,e):t&&1===s?this.toggleSeriesItem(!0,a,void 0,o):this.toggleSeriesItem(!1,a,void 0,o)}toggleSeriesItem(e,t,i,n,s){const a=this.id;(e||"category"!==t)&&(this.visible=e),this.nodeDataRefresh=!0,this._pickNodeCache.clear();const o={type:"seriesVisibilityChange",seriesId:a,itemId:i,legendItemName:s?.legendItemName??n,visible:e};this.callListeners(o),this.events.emit("visibility-change",o),this.ctx.legendManager?.toggleItem(e,a,i,n)}isEnabled(){return this.visible}getModuleMap(){return this.moduleMap}createModuleContext(){return this.moduleContext??(this.moduleContext=this.ctx.child().constant("series",this)),this.moduleContext}getAxisValueText(e,t,i,n,s,a,o){const{id:r,properties:l}=this;return e.formatDatum(l,i,t,r,a,n,s,void 0,void 0,void 0,o)}getLabelText(e,t,i,n,s,a,o,r=!1){if(null==e&&!r)return"";const{axes:l,canHaveAxes:h,ctx:c,id:d,properties:u}=this,p="series-label",g="legendItemName"in u?u.legendItemName:void 0,m={seriesId:this.id,...o},y=h?Ld(n):void 0,f=null==y?void 0:l[this.resolveKeyDirection(y)];if(null!=f)return f.formatDatum(u,e,p,d,g,t,i,s,a,m,r);const{formatManager:x}=c,b=this.callWithContext.bind(this),v=t=>
1a.formatValue(b,t.type,t.value,m)??x.format(b,t)??(null==e?"":String(e)),S=this.getFormatterContext(n);switch(n){case"y":case"color":case"size":return v({type:"number",value:e,datum:t,seriesId:d,legendItemName:g,key:i,source:p,property:n,domain:s,boundSeries:S,fractionDigits:void 0,visibleDomain:void 0});case"x":case"radius":case"angle":case"label":case"secondaryLabel":case"calloutLabel":case"sectorLabel":case"legendItem":return v({type:"category",value:e,datum:t,seriesId:d,legendItemName:g,key:i,source:p,property:n,domain:s,boundSeries:S})}}getMarkerStyle(e,{datumIndex:t,datum:i,point:n},s,a,o={size:n?.size??e.size??0},r){const{itemStyler:l}=e,{highlightState:h,isHighlight:c=!1,checkForHighlight:d=!0,resolveMarkerSubPath:u=["marker"],resolveStyler:p=!1,hideWithSize0:g=!1}=a??{},m=a?.selectionState??this.getDataSelectionState(t),y=this.getDataCandidacyState(t);if(g&&ol(rl(m,y)))return{size:0};let f;const x=()=>f??(f=["series",`${this.declarationOrder}`,...u]);if(p){const e={permissivePath:!0},t=this.ctx.optionsGraphService.resolvePartial(x(),o,e);t&&(o={...t,size:t.size??o.size})}const b=d?this.getHighlightStyle(c,t,h):void 0;let v=function(e,t,i,n,s){return{size:e?.size??t?.size??i.size,shape:e?.shape??t?.shape??i.shape??n.shape??s?.shape,fill:e?.fill??t?.fill??i.fill??n.fill??s?.fill,fillOpacity:e?.fillOpacity??t?.fillOpacity??i.fillOpacity??n.fillOpacity??s?.fillOpacity,stroke:e?.stroke??t?.stroke??i.stroke??n.stroke??s?.stroke,strokeWidth:e?.strokeWidth??t?.strokeWidth??i.strokeWidth??n.strokeWidth??s?.strokeWidth,strokeOpacity:e?.strokeOpacity??t?.strokeOpacity??i.strokeOpacity??n.strokeOpacity??s?.strokeOpacity,lineDash:e?.lineDash??t?.lineDash??i.lineDash??n.lineDash??s?.lineDash,lineDashOffset:e?.lineDashOffset??t?.lineDashOffset??i.lineDashOffset??n.lineDashOffset??s?.lineDashOffset,opacity:e?.opacity??t?.opacity??s?.opacity}}(d&&this.isSelectionEnabled()?this.getSelectionStyle(t,m,y):void 0,b,o,e.getStyle(),r);if(l&&s){const e=void 0===h?this.getHighlightStateString(this.ctx.highlightManager?.getActiveHighlight(),c,t):sl(h),n=void 0===m?void 0:al(m),a=void 0===y?void 0:al(y),o=this.filterItemStylerFillParams(v.fill),r=this.cachedCallWithContext(l,{seriesId:this.id,...v,fill:o,...s,highlightState:e,selectionState:n,candidateState:a,datum:i});v=function(e,t){return null==e?t:{size:e.size??t.size,shape:e.shape??t.shape,fill:e.fill??t.fill,fillOpacity:e.fillOpacity??t.fillOpacity,stroke:e.stroke??t.stroke,strokeWidth:e.strokeWidth??t.strokeWidth,strokeOpacity:e.strokeOpacity??t.strokeOpacity,lineDash:e.lineDash??t.lineDash,lineDashOffset:e.lineDashOffset??t.lineDashOffset,opacity:e.opacity??t.opacity}}(this.ctx.optionsGraphService.resolvePartial(x(),r),v)}return v}applyMarkerStyle(e,t,i,n,s){const{shape:a,size:o=0,strokeWidth:r=0}=e,{applyPosition:l=!0,crossFilterSelected:h=!0,hideWithSize0:c,pickInflation:d=0}=s,u=this.visible&&(c||this.visible&&o>0&&i&&!Number.isNaN(i.x)&&!Number.isNaN(i.y));if(t.setStyleProperties(e,n),t.setVisibilityAndPosition(!!u,a,o,l?i:void 0),t.pickInflation=r>2*d?Math.max(d,bd(e)):d,h||(t.fillOpacity*=.25,t.strokeOpacity*=.125),"function"==typeof a&&!t.dirtyPath){t.path.clear(!0),t.updatePath(),t.checkPathDirty();const n=t.getBBox();if(null!=i&&n.isFinite()){const t=n.computeCenter(),[s,a]=["x","y"].map((n=>(e.strokeWidth??0)+Math.abs(t[n]-i[n])));i.focusSize=Math.max(n.width+s,n.height+a)}}}runMarkerStylePass(e,t,i,n){const{keyExtra:s,cacheable:a=!0,compute:o,apply:r}=n,l=a?new Map:null,h=this.ctx.highlightManager.getActiveHighlight(),c=this,d=c;e.each((function(n,a){if(e.isGarbage(n))return;const u=c.getHighlightState(h,t,a.datumIndex),p=c.getDataSelectionState(a.datumIndex),g=`${u}:${p??"-"}:${c.getDataCandidacyState(a.datumIndex)??"-"}${void 0===s?"":`:${s(a)}`}`;let m=l?.get(g);void 0===m&&(m=o(d,i,u,p,a),l?.set(g,m)),r(d,i,a,u,p,m)}))}getSeriesPlotRegion(){const e=this.chart?.seriesRect;if(null==e)return;const t=this.chart?.seriesAreaPadding;return{x:-(t?.left??0),y:-(t?.top??0),width:e.width+(t?.left??0)+(t?.right??0),height:e.height+(t?.top??0)+(t?.bottom??0)}}
1resolveLabelPlotRegion(e){return e.resolveCollideWith().seriesArea?this.getSeriesPlotRegion():void 0}get nodeDataDependencies(){return this._nodeDataDependencies??{seriesRectWidth:Number.NaN,seriesRectHeight:Number.NaN}}checkResize(e){const{width:t,height:i}=e??{width:Number.NaN,height:Number.NaN},s=e?{seriesRectWidth:t,seriesRectHeight:i}:void 0,a=null!=(0,n.G4M)(this.nodeDataDependencies,s);return a&&(this._nodeDataDependencies=s,this.markNodeDataDirty()),a}pickFocus(e){}pickViewportFocus(e){}mapFocusBBoxToPanTarget(e,t){return t}resetDatumCallbackCache(){this.datumCallbackCache.clear()}cachedDatumCallback(e,t){const{datumCallbackCache:i}=this,n=i.get(e);if(null!=n)return n;try{const n=t();return i.set(e,n),n}catch(e){Be(e),this.ctx.logger.error(String(e))}}cachedCallWithContext(e,t,i){return this.ctx.callbackCache.call([this.properties,this.ctx.chartService],e,t,i)}callWithContext(e,t){return(0,n.cVk)([this.properties,this.ctx.chartService],e,t)}formatTooltipWithContext(e,t,i){return e.formatTooltip([this.properties,this.ctx.chartService],t,i)}minTimeInterval(){}needsDataModelDiff(){return!this.ctx.animationManager.isSkipped()||!!this.chart?.flashOnUpdateEnabled}};return e.className="Series",e.assignCachedStyle=(e,t,i,n,s,a)=>{i.style=a},d([(0,n.mBh)({changeValue:function(e,t){this.onSeriesGroupingChange(t,e)}})],e.prototype,"seriesGrouping",2),e})(),Od=class{constructor(e){this.swapChain=e,this.focusVisibleStyle=!1,this.hasFocus=!1,this.div=(0,n.na4)("div"),this.svg=(0,n.FJ6)("svg"),this.outerPath=(0,n.FJ6)("path"),this.innerPath=(0,n.FJ6)("path"),this.svg.append(this.outerPath),this.svg.append(this.innerPath),this.outerPath.classList.add("ag-charts-focus-svg-outer-path"),this.innerPath.classList.add("ag-charts-focus-svg-inner-path"),this.element=(0,n.na4)("div","ag-charts-focus-indicator"),this.element.ariaHidden="true",this.element.append(this.svg),this.swapChain.addListener("swap",(e=>this.onSwap(e)))}clear(){}update(e,t,i){if(null!=t)if(e instanceof je){const i=(i,n)=>{let{canvasX:s,canvasY:a}=Me.toCanvasPoint(e,i,n);return s-=t.x??0,a-=t.y??0,{x:s,y:a}},n=e.svgPathData(i);this.outerPath.setAttribute("d",n),this.innerPath.setAttribute("d",n),this.show(this.svg)}else{let s;if(i){const i=Math.max(e.x-t.x,0),n=Math.max(e.y-t.y,0),a=Math.min(e.x+e.width-t.x,t.width),o=Math.min(e.y+e.height-t.y,t.height);s=new m(i,n,a-i,o-n)}else s=new m(e.x-t.x,e.y-t.y,e.width,e.height);(0,n.ksX)(this.div,s),this.show(this.div)}}onSwap(e){e!==this.element.parentElement&&(this.element.remove(),e.appendChild(this.element),this.overrideFocusVisible(this.focusVisible))}show(e){this.element.innerHTML="",this.element.append(e)}focus(e){this.focusVisible=e.focusVisible,this.hasFocus||(void 0!==e.focusVisible&&(this.hasFocus=!0),this.swapChain.focus(e))}overrideFocusVisible(e){this.focusVisible=e;const t=this.element.parentElement;t?.style.setProperty("opacity",{true:"1",false:"0",undefined:""}[`${e}`])}isFocusVisible(){return this.focusVisible??this.focusVisibleStyle}onFocus(){if(this.hasFocus)return this.isFocusVisible();this.overrideFocusVisible(void 0);const e=this.element.parentElement,t=this.element.ownerDocument.defaultView;return this.focusVisibleStyle=null!=e&&"1"===t.getComputedStyle(e).opacity,this.hasFocus=!0,this.focusVisibleStyle}onBlur(){this.overrideFocusVisible(void 0),this.focusVisibleStyle=!1,this.hasFocus=!1}},Rd=class{constructor(e,t,i,s){this.label1=e,this.label2=t,this.hasFocus=!1,this.skipDispatch=!1,this.listeners={blur:[],focus:[],swap:[]},this.onBlur=e=>((0,n.EMg)(e.target,"pointer-events",void 0),!this.skipDispatch&&this.dispatch("blur",e)),this.onFocus=e=>((0,n.EMg)(e.target,"pointer-events","auto"),!this.skipDispatch&&this.dispatch("focus",e)),(0,n.Bqc)(this.label1,"id",(0,n.wWH)()),(0,n.Bqc)(this.label2,"id",(0,n.wWH)()),(0,n.EMg)(this.label1,"display","none"),(0,n.EMg)(this.label2,"display","none"),this.label1.textContent=s,this.label2.textContent=s,this.activeAnnouncer=this.createAnnouncer(i),this.inactiveAnnouncer=this.createAnnouncer(i),(0,n.Bqc)(this.activeAnnouncer,"tabindex",0),this.label2.insertAdjacentElement("afterend",this.activeAnnouncer),this.label2.insertAdjacentElement("afterend",this.inactiveAnnouncer),this.swap(s)}createAnnouncer(e){const t=(0,n.na4)("div");return t.role=e,t.className="ag-charts-swapchain",t.addEventListener("blur",this.onBlur),t.addEventListener("focus",this.onFocus),t}destroy(){for(const e of[this.activeAnnouncer,this.inactiveAnnouncer])e.removeEventListener("blur",this.onBlur),e.removeEventListener("focus",this.onFocus),e.remove()}focus(e){this.focusOptions=e,this.activeAnnouncer.focus(e),this.focusOptions=void 0}update(e){this.skipDispatch=!0,this.swap(e),this.hasFocus&&this.activeAnnouncer.focus(this.focusOptions),this.skipDispatch=!1}addListener(e,t){if(this.listeners[e].push(t),"swap"===e){t(this.activeAnnouncer)}}dispatch(e,t){"focus"===e?this.hasFocus=!0:"blur"===e&&(this.hasFocus=!1);for(const i of this.listeners[e])i(t)}swap(e){const t=this.activeAnnouncer.tabIndex;this.label2.textContent=e,[this.inactiveAnnouncer,this.activeAnnouncer]=[this.activeAnnouncer,this.inactiveAnnouncer],[this.label1,this.label2]=[this.label2,this.label1],(0,n.Wpy)(this.inactiveAnnouncer,{"aria-labelledby":this.label1.id,"aria-hidden":!0,tabindex:void 0}),(0,n.Wpy)(this.activeAnnouncer,{"aria-labelledby":this.label1.id,"aria-hidden":!1,tabindex:t}),this.dispatch("swap",this.activeAnnouncer)}};function Ed(e,t){const i=Rl.is(t)||Hl.is(t);return(0,n.iru)(e,i)&&!Number.isNaN(t.convert(e,{clamp:!0}))}function zd(e){const t=e.bandwidth??0,i=e.step??0;return{bandwidth:t,rangePadding:Vl.is(e)?(i-t)/2:0}}function Bd(e){switch(e.type){case"line":return e.value;case"range":return e.range}}function Fd(e,t){const i=Bd(e);if(null==i)return!1;if("range"===e.type){const[e,n]=i;return Ed(e,t)&&Ed(n,t)}return Ed(i,t)}function Vd(e,t){const{callers:i,fn:s,params:a}=t;(0,n.cVk)(i,s,{...a,allMatchedParams:e})}var $d={arrowdown:{bindings:[{code:"ArrowDown",alt:!1,ctrlOrMeta:!1,shift:!1}]},arrowleft:{bindings:[{code:"ArrowLeft",alt:!1,ctrlOrMeta:!1,shift:!1}]},arrowright:{bindings:[{code:"ArrowRight",alt:!1,ctrlOrMeta:!1,shift:!1}]},arrowup:{bindings:[{code:"ArrowUp",alt:!1,ctrlOrMeta:!1,shift:!1}]},expand:{bindings:[{code:"ArrowDown",alt:!0,ctrlOrMeta:!1,shift:!1}]},collapse:{bindings:[{code:"ArrowUp",alt:!0,ctrlOrMeta:!1,shift:!1}]},home:{bindings:[{code:"Home"}]},end:{bindings:[{code:"End"}]},delete:{bindings:[{key:"Backspace"},{key:"Delete"}],activatesFocusIndicator:!1},redo:{bindings:[{key:"y",ctrlOrMeta:!0},{key:"z",ctrlOrMeta:!0,shift:!0}],activatesFocusIndicator:!1},undo:{bindings:[{key:"z",ctrlOrMeta:!0}],activatesFocusIndicator:!1},submit:{bindings:[{key:"Enter"},{code:"Enter"},{code:"Space"}]},zoomin:{bindings:[{key:"+"},{code:"ZoomIn"},{code:"Add"}],activatesFocusIndicator:!1},zoomout:{bindings:[{key:"-"},{code:"ZoomOut"},{code:"Substract"}],activatesFocusIndicator:!1},panxleft:{bindings:[{key:"PageUp"},{code:"PageUp"}],activatesFocusIndicator:!0},panxright:{bindings:[{key:"PageDown"},{code:"PageDown"}],activatesFocusIndicator:!0}};function Hd(e,t){return void 0===t||t===e}
1function jd(e,t){return Hd(e.ctrlKey||e.metaKey,t.ctrlOrMeta)&&Hd(e.altKey,t.alt)&&Hd(e.shiftKey,t.shift)}function Wd(e,t){for(const i of t){if("code"in i&&i.code===e.code&&jd(e,i))return!0;if("key"in i&&i.key===e.key&&jd(e,i))return!0}return!1}function _d({bounds:e}){return e instanceof m?e:null!=e?Me.toCanvas(e):m.NaN}function Gd(e,t,i){const{x:n,y:s}=function(e,t,i){const n=vl(e,i.datum,i.movedBounds);if(null!=n)return{x:n.canvasX,y:n.canvasY};const s=i.bounds;if(null!=s){if(s instanceof m){const{x:e,y:i}=s.computeCenter();return{x:t.x+e,y:t.y+i}}return Me.toCanvas(s).computeCenter()}}(e,t,i)??{};if(void 0!==n&&void 0!==s)return{type:"keyboard",canvasX:n,canvasY:s}}var Kd=class{constructor(e){this.agDocument=e,this.events=new n.bkB,this.x1=Number.NaN,this.y1=Number.NaN,this.x=Number.NaN,this.y=Number.NaN,this.vx=0,this.vy=0,this.t0=Number.NaN,this.animationFrameHandle=void 0}reset(){this.x=Number.NaN,this.y=Number.NaN,null!=this.animationFrameHandle&&(this.agDocument.cancelAnimationFrame(this.animationFrameHandle),this.animationFrameHandle=void 0)}update(e,t){if(Number.isNaN(this.x)||Number.isNaN(this.y))return this.x=e,this.y=t,this.vx=0,this.vy=0,this.emitUpdate(),void(null!=this.animationFrameHandle&&(this.agDocument.cancelAnimationFrame(this.animationFrameHandle),this.animationFrameHandle=void 0));this.x1=e,this.y1=t,this.t0=Date.now(),this.animationFrameHandle??(this.animationFrameHandle=this.agDocument.requestAnimationFrame(this.onFrame.bind(this)))}onFrame(){this.animationFrameHandle=void 0;const{x1:e,y1:t,t0:i}=this,n=Date.now(),s=n-i;this.t0=n;const a=.001,o=Math.trunc(Math.ceil(s/1));let{x:r,y:l,vx:h,vy:c}=this;for(let i=0;i<o;i+=1){h+=-(200*(r-e)+12*h)/.1*a,c+=-(200*(l-t)+12*c)/.1*a,r+=h*a,l+=c*a}Math.hypot(r-e,l-t)<.5?(this.x=this.x1,this.y=this.y1,this.vx=0,this.vy=0):(this.x=r,this.y=l,this.vx=h,this.vy=c,this.animationFrameHandle=this.agDocument.requestAnimationFrame(this.onFrame.bind(this))),this.emitUpdate()}emitUpdate(){this.events.emit("update",{x:this.x,y:this.y})}},Yd={left:-1,"top-left":-1,"bottom-left":-1,top:0,center:0,bottom:0,right:1,"top-right":1,"bottom-right":1},Ud={"top-left":-1,top:-1,"top-right":-1,left:0,center:0,right:0,"bottom-left":1,bottom:1,"bottom-right":1};function Xd(e){const{elementSize:t,anchorTo:i,placement:n,canvasX:s,canvasY:a,yOffset:o,xOffset:r,offset:l,canvasRect:h}=e,{width:c,height:d}=t,u={width:c,height:d};if("node"===i||"pointer"===i){const e=Yd[n],t=Ud[n];return u.top=a+o+d*(t-1)/2+l*t,u.left=s+r+c*(e-1)/2+l*e,u}switch(n){case"top":return u.top=o+l,u.left=h.width/2-c/2+r,u;case"right":return u.top=h.height/2-d/2+o,u.left=h.width-c+r-l,u;case"left":return u.top=h.height/2-d/2+o,u.left=r+l,u;case"bottom":return u.top=h.height-d+o-l,u.left=h.width/2-c/2+r,u;case"top-left":return u.top=o+l,u.left=r+l,u;case"top-right":return u.top=o+l,u.left=h.width-c+r-l,u;case"bottom-right":return u.top=h.height-d+o-l,u.left=h.width-c+r-l,u;case"bottom-left":return u.top=h.height-d+o-l,u.left=r+l,u}return u}var Zd=null;var qd="ag-charts-tooltip";function Qd(e,t){return function(e){const t=(0,n.boc)(e);return""===t?"":(Zd??(Zd=(0,n.na4)("div")),Zd.textContent=t,Zd.innerHTML.replaceAll("\n","<br>"))}((0,n.xpk)((0,n.boc)(t),e.isRtl))}function Jd(e){return null!=e&&(Array.isArray(e)?e.some((e=>"image"!==e.type&&Jd(e.text))):""!==(0,n.i$)(e).trim())}function eu(e,t=!1){return null==e?!t:"number"==typeof e&&!Number.isFinite(e)}function tu(e){return"raw"!==e.type&&(!(!e.data||0===e.data.length)&&e.data.every((e=>!0===e.missing)))}function iu(e){const t=[],i=new Map;for(const n of e)if(!tu(n))if("structured"===n.type){const{heading:e}=n,s=Jd(e)?i.get(e):void 0,a={type:"structured",heading:e,items:[n]};null==s?(i.set(e,a),t.push(a)):s.items.push(n)}else t.push(n);return t}function nu(e,t){const i=(0,n.YEm)().createElement("div");i.innerHTML=e;const s=i.textContent?.trim();return null==s?(t.warnOnce("cannot retrieve tooltip textContent (required for aria-label)"),""):s}function su(e,t,i,n){let s="";Jd(t)?(s+=`<span class="${qd}-label">${Qd(e,t)}</span>`,s+=" ",s+=`<span class="${qd}-value">${Qd(e,i)}</span>`):s+=`<span class="${qd}-label">${Qd(e,i)}</span>`;const a=[`${qd}-row`];return n&&a.push(`${qd}-row--inline`),s=`<div class="${a.join(" ")}">${s}</div>`,s}function au(e,t){let i="";if(t.data?.length&&t.data.every((e=>!0===e.missing)))return i;const s=Jd(t.title),a=!s&&1===t.data?.length,o=null==t.symbol?void 0:function(e,t,i=t*(5/3)){const n=new ke,s=Math.min(e.marker.strokeWidth??1,2),a=e.line?.enabled?Math.min(e.line.strokeWidth,2):0,o=Math.max(!1===e.marker.enabled?0:t,null==e.line?0:i),r=Math.max(!1===e.marker.enabled?0:t,a);if(e.line?.enabled){const{stroke:t,strokeOpacity:i,lineDash:s}=e.line,l=new Gh;
1l.x1=0,l.y1=r/2,l.x2=o,l.y2=r/2,l.stroke=t,l.strokeOpacity=i,l.strokeWidth=a,l.lineDash=s,n.append(l)}if(!1!==e.marker.enabled){const{shape:i,fill:a,fillOpacity:l,stroke:h,strokeOpacity:c,lineDash:d,lineDashOffset:u}=e.marker,p=new Sd;p.shape=i??"square",p.size=t,p.fill=a,p.fillOpacity=l??1,p.stroke=h,p.strokeOpacity=c??1,p.strokeWidth=s,p.lineDash=d,p.lineDashOffset=u??0;const g=Sd.anchor(i),m=o/2+(g.x-.5)*t,y=r/2+(g.y-.5)*t,f=t/(t+s);p.x=m,p.y=y,p.scalingCenterX=m,p.scalingCenterY=y,p.scalingX=f,p.scalingY=f,n.append(p)}return ke.toSVG(n,o,r)}(t.symbol,12);if(null!=o&&(s||t.data?.length)&&(i+=`<span class="${qd}-symbol">${o}</span>`),s&&(i+=`<span class="${qd}-title">${Qd(e,t.title)}</span>`,i+=" "),t.data)for(const s of t.data)!0!==s.missing&&(i+=su(e,s.label??s.fallbackLabel,(0,n.boc)(s.value),a),i+=" ");return i}function ou(e,t){const{localeManager:i}=e;if(null==i||1===t.length)return;const s=i.t("tooltipPaginationStatus",{index:t.index+1,count:t.length});return`<div class="${qd}-footer">${(0,n.xpk)(s,e.isRtl)}</div>`}function ru(e,t,i,s){const a=1===t.items.length?t.items[0]:void 0;let o,r,l;switch(i){case"compact":o=!0,r=(0,n.boc)(a?.title);break;case"single":const e=Jd(t.heading);o=null!=a&&(!e||null==a.title)&&1===a.data?.length&&null==a.data[0].label&&null!=a.data[0].value,l=(0,n.boc)(e?t.heading:a?.title);break;case"shared":o=!1}let h="";if(o&&null!=a){if(Jd(r)&&(h+=`<span class="${qd}-title">${Qd(e,r)}</span>`),a.data)for(const t of a.data)!0!==t.missing&&(h+=su(e,t.label??l,(0,n.boc)(t.value),!1),h+=" ")}else{Jd(t.heading)&&(h+=`<span class="${qd}-heading">${Qd(e,t.heading)}</span>`,h+=" ");for(const i of t.items)h+=au(e,i)}if(0===h.length)return;const c="compact"!==i&&null!=s?ou(e,s):void 0;return c+null&&(h+=c),h=`<div class="${qd}-content">${h.trimEnd()}</div>`,h}function lu(e,t,i,n){const s=iu(t);if(0!==s.length){if(1===s.length&&"structured"===s[0].type)return ru(e,s[0],i,n);{const t=s.map((t=>"structured"===t.type?ru(e,t,i):t.rawHtmlString));return null!=n&&t.push(function(e,t){const i=null==t?void 0:ou(e,t);return null==i?"":`<div class="${qd}-content">${i}</div>`}(e,n)??""),t.join("")}}}var hu={left:3,"top-left":void 0,"bottom-left":void 0,top:2,center:void 0,bottom:1,right:0,"top-right":void 0,"bottom-right":void 0},cu={top:2,bottom:2,left:1,right:1,"top-right":3,"top-left":3,"bottom-right":3,"bottom-left":3,center:0},du={pointer:["top","bottom","left","right"],node:["top","bottom","left","right"],chart:"top-left"},uu=(()=>{var e=class extends n.XPE{constructor(){super(...arguments),this.xOffset=0,this.yOffset=0}};return d([n.mAP],e.prototype,"xOffset",2),d([n.mAP],e.prototype,"yOffset",2),d([n.mAP],e.prototype,"offset",2),d([n.mAP],e.prototype,"anchorTo",2),d([n.mAP],e.prototype,"placement",2),e})(),pu=(()=>{var e=class extends n.XPE{constructor(e){super(),this.agDocument=e,this.enabled=!0,this.mode="single",this.delay=0,this.range=void 0,this.wrapping="hyphenate",this.position=new uu,this.pagination=!1,this.darkTheme=!1,this.bounds="extended",this.cleanup=new n._uV,this.springAnimation=new Kd(this.agDocument),this.enableInteraction=!1,this.wrapTypes=["always","hyphenate","on-space","never"],this._elementSize=void 0,this._showTimeout=void 0,this.arrowPosition=void 0,this._visible=!1,this.positionParams=void 0,this.localeManager=void 0,this.cleanup.register(this.springAnimation.events.on("update",(()=>{this.updateTooltipPosition()})))}get interactive(){return this.enableInteraction}setup(e,t){this.domManager=t,this.elementProxy=t.addDeferredProxyChild("tooltip-container",qd),this.elementProxy.toggleClass(qd,!0),this.elementProxy.setProperty("position-anchor",t.anchorName),this.elementProxy.setAttr("popover","manual");const i=this.elementProxy.addResizeListener((e=>{this._elementSize=e,this.updateTooltipPosition()}));return this.localeManager=e,()=>{t.removeChild("tooltip-container",qd),this.cleanup.flush(),i()}}isVisible(){return this._visible}contains(e){return this.elementProxy?.contains(e)??!1}updateTooltipPosition(){const{elementProxy:e,_elementSize:t,positionParams:i}=this;if(null==e||null==t||null==i)return;const{canvasRect:s,relativeRect:a,meta:o}=i,{x:r,y:l}=this.springAnimation,h=o.position?.anchorTo??"pointer";let c=o.position?.placement??du[h];Array.isArray(c)||(c=[c]);const d=o.position?.xOffset??0,u=o.position?.yOffset??0,p=o.position?.offset??12,g=a.x,m=a.y,y=a.width-t.width-1+g,f=a.height-t.height+m;let x,b,v=0,S=!1;do{x=c[v],v+=1;const e=Xd({elementSize:t,placement:x,anchorTo:h,canvasX:r,canvasY:l,yOffset:u,xOffset:d,offset:p,canvasRect:s});b=(0,n.ePN)(t.width,t.height,a,e),S=!1,1&cu[x]&&(S||(S=b.x<g||b.x>y)),2&cu[x]&&(S||(S=b.y<m||b.y>f))}while(v<c.length&&S);const M=(0,n.qE8)(g,b.x,y),k=(0,n.qE8)(m,b.y,f);S||(S=M!==b.x||k!==b.y);const D="chart"!==h&&!S&&!d&&!u,w=o.showArrow??this.showArrow??D;this.arrowPosition=w?hu[x]:void 0,this.updateClassModifiers(),e.setProperty("translate",`${M}px ${k}px`)}clampAnchorToVisibleChart(e,t,i){const s=this.domManager?.getVisibleChartRect();return null==s?{x:e,y:t}:{x:(0,n.qE8)(s.left-i.left,e,s.right-i.left),y:(0,n.qE8)(s.top-i.top,t,s.bottom-i.top)}}show(e,t,i,n,s,a=!1){const{elementProxy:o}=this;if(null!=o&&null!=n&&0!==n.length){const e=lu({localeManager:this.localeManager,isRtl:this.domManager?.isRtl??!1},n,this.mode,this.pagination?s:void 0);if(null==e)return o.setInnerHTML(""),void this.toggle(!1);o.setInnerHTML(e)}else if(null==o||""===o.innerHTML)return void this.toggle(!1);const r={x:e.x-t.x,y:e.y-t.y,width:e.width,height:e.height};this.positionParams={canvasRect:t,relativeRect:r,meta:i};const{scaleX:l,scaleY:h}=this.domManager?.getCanvasScale()??{scaleX:1,scaleY:1};switch(i.position?.anchorTo??"pointer"){case"node":{const{x:e,y:n}=this.clampAnchorToVisibleChart((i.nodeCanvasX??i.canvasX)*l,(i.nodeCanvasY??i.canvasY)*h,t);this.springAnimation.update(e,n);break}case"pointer":{const{x:e,y:n}=this.clampAnchorToVisibleChart(i.canvasX*l,i.canvasY*h,t);this.springAnimation.update(e,n);break}case"chart":this.springAnimation.reset()}this.enableInteraction=i.enableInteraction??!1,o.setProperty("pointer-events",this.enableInteraction?"auto":"none"),o.setAttr("aria-hidden",this.enableInteraction?null:"true"),o.setAttr("tabindex",this.enableInteraction?"-1":null),o.setProperty("--top",`${t.top}px`),o.setProperty("--left",`${t.left}px`),this.updateClassModifiers(),this.toggle(!0,a)}hide(){this.toggle(!1)}maybeEnterInteractiveTooltip({relatedTarget:e},t){const{interactive:i,interactiveLeave:s,enabled:a,elementProxy:o}=this;if(null==o)return!1;if(s)return!0;const r=i&&a&&this.isVisible()&&(0,n.Lln)(e)&&this.contains(e);return r&&(this.interactiveLeave={callback:t,listener:e=>{(null==e.relatedTarget||(0,n.Lln)(e.relatedTarget)&&!this.contains(e.relatedTarget))&&this.popInteractiveLeaveCallback()}},o.addEventListener("focusout",this.interactiveLeave.listener),o.addEventListener("mouseout",this.interactiveLeave.listener)),r}popInteractiveLeaveCallback(){const{interactiveLeave:e,elementProxy:t}=this;this.interactiveLeave=void 0,e&&(t&&(t.removeEventListener("focusout",e.listener),t.removeEventListener("mouseout",e.listener)),e.callback())}toggle(e,t=!1){const{delay:i}=this;e&&i>0&&!t?this._showTimeout??(this._showTimeout=setTimeout((()=>{this._showTimeout=void 0,this.toggleCallback(!0)}),i)):(clearTimeout(this._showTimeout),this._showTimeout=void 0,this.toggleCallback(e))}toggleCallback(e){this.elementProxy?.isConnected&&this._visible!==e&&(this._visible=e,this.elementProxy.togglePopover(e),e?this.updateTooltipPosition():(this.springAnimation.reset(),this.popInteractiveLeaveCallback(),this.elementProxy.reset()))}updateClassModifiers(){if(!this.elementProxy?.isConnected)return;const{elementProxy:e}=this,{enableInteraction:t,arrowPosition:i,mode:n,darkTheme:s,wrapping:a}=this,o=(t,i)=>e.toggleClass(`${qd}--${t}`,i);o("no-interaction",!t),o("arrow-top",1===i),o("arrow-right",3===i),o("arrow-bottom",2===i),o("arrow-left",0===i),o("compact","compact"===n),e.toggleClass("ag-charts-tooltip--dark",s);for(const t of this.wrapTypes)e.toggleClass(`${qd}--wrap-${t}`,t===a)}};return d([n.mAP],e.prototype,"enabled",2),d([n.mAP],e.prototype,"mode",2),d([n.mAP],e.prototype,"showArrow",2),d([n.mAP],e.prototype,"delay",2),d([n.mAP],e.prototype,"range",2),d([n.mAP],e.prototype,"wrapping",2),d([n.mAP],e.prototype,"position",2),d([n.mAP],e.prototype,"pagination",2),d([n.mAP],e.prototype,"darkTheme",2),d([n.mAP],e.prototype,"bounds",2),e})();var gu=(()=>{var e=class extends Bt{constructor(e){super(),this.chart=e,this.id=(0,n.sX_)(this),this.series=[],this.announceMode="when-changed",this.highlight={pendingHoverEvent:void 0,appliedHoverEvent:void 0,stashedHoverEvent:void 0},this.tooltip={lastHover:void 0},this.activeState={lastActive:void 0,highlightInViewport:!0},this._device="pointer",this.focus={initialized:!1,sortedSeries:[],series:void 0,seriesIndex:0,datumIndex:0,datum:void 0,pendingViewportFocus:void 0}
1,this.cachedTooltipContent=void 0,this.hoverScheduler=this.createHoverScheduler(),this.pickManager=new Dd(e.ctx.activeManager,e.tooltip);const t=e.ctx.localeManager.t("ariaInitSeriesArea"),i=e.ctx.domManager.addChild("series-area","series-area-aria-label1"),s=e.ctx.domManager.addChild("series-area","series-area-aria-label2");this.swapChain=new Rd(i,s,"img",t),this.swapChain.addListener("blur",(e=>this.onBlur(e))),this.swapChain.addListener("focus",(()=>this.onFocus())),"normal"===e.ctx.domManager.mode&&(this.focusIndicator=new Od(this.swapChain),this.focusIndicator.overrideFocusVisible("integrated"!==e.ctx.chartState.getValue("options","mode")&&void 0));const{seriesDragInterpreter:a,seriesWidget:o,containerWidget:r}=e.ctx.widgets;o.setTabIndex(-1),this.cleanup.register((()=>e.ctx.domManager.removeChild("series-area","series-area-aria-label1")),(()=>e.ctx.domManager.removeChild("series-area","series-area-aria-label2")),o.addListener("focus",(()=>this.focusIndicator?.focus({preventScroll:!0}))),o.addListener("mousemove",(e=>this.onHover(e,o))),o.addListener("wheel",(e=>this.onWheel(e))),o.addListener("mouseleave",(e=>this.onLeave(e))),o.addListener("keydown",(e=>this.onKeyDown(e))),o.addListener("contextmenu",((e,t)=>this.onContextMenu(e,t))),r.addListener("contextmenu",((e,t)=>this.onContextMenu(e,t))),r.addListener("click",((e,t)=>this.onClick(e,t))),r.addListener("dblclick",((e,t)=>this.onClick(e,t))),e.ctx.animationManager.addListener("animation-start",(()=>this.onAnimationStart())),e.ctx.eventsHub.on("active:load-memento",(e=>this.onActiveLoadMemento(e))),e.ctx.chartState.observe((e=>{const t=e("activeItem");"legend"===t?.type&&(this.clearStaleHighlightTooltip(),this.activeState.lastActive="legend")})),e.ctx.eventsHub.on("dom:resize",(()=>this.onResize())),e.ctx.eventsHub.on("dom:container-change",(()=>this.resetHoverScheduler())),e.ctx.eventsHub.on("highlight:change",(e=>this.changeHighlightDatum(e))),e.ctx.eventsHub.on("highlight:selection-updated",(e=>this.onHighlightSelectionUpdate(e))),e.ctx.eventsHub.on("layout:complete",(e=>this.layoutComplete(e))),e.ctx.eventsHub.on("update:pre-scene-render",(()=>this.preSceneRender())),e.ctx.eventsHub.on("update:complete",(()=>this.updateComplete())),e.ctx.eventsHub.on("zoom:change-complete",(e=>this.onZoomChangeComplete(e))),e.ctx.eventsHub.on("collapsed:change",(()=>{this.focusIndicator?.isFocusVisible()&&(this.announceMode="always")})),e.ctx.eventsHub.on("zoom:pan-start",(()=>this.clearAll())),e.ctx.eventsHub.on("legend:item-hover",(e=>this.onLegendHover(e)))),a&&this.cleanup.register(a.events.on("drag-move",(e=>this.onDragMove(e,o))),a.events.on("click",(e=>this.onClick(e,o))),a.events.on("dblclick",(e=>this.onClick(e,o))))}get bbox(){return(this.seriesRect??m.zero).clone()}setHoverDevice(e){"setState"!==e&&this.isState(1)||(this._device=e)}getHoverDevice(){return this._device}initFocus(e){if(!this.focus.initialized)switch(this.focus.initialized=!0,e){case"data-end":this.focus.datumIndex=Number.MAX_VALUE;break;case"viewport-start":case"viewport-end":this.focus.pendingViewportFocus=e}}isState(e){return this.chart.ctx.interactionManager.isState(e)}isIgnoredTouch(e){if("touch"!==e.device||"click"===e.type)return!1;const{dragAction:t}=this.chart.ctx.chartState.getValue("options","touch");return"hover"!==t&&("drag"!==t||!this.isState(18))}dataChanged(){var e;this.cachedTooltipContent=void 0,this.highlight.appliedHoverEvent&&((e=this.highlight).stashedHoverEvent??(e.stashedHoverEvent=this.highlight.appliedHoverEvent),this.clearHighlight()),"setState"!==this.getHoverDevice()&&(this.chart.ctx.tooltipManager.removeTooltip(this.id),this.focusIndicator?.clear())}preSceneRender(){null!=this.highlight.stashedHoverEvent&&(this.highlight.pendingHoverEvent=this.tooltip.lastHover??this.highlight.stashedHoverEvent,this.highlight.stashedHoverEvent=void 0,this.handleHoverHighlight(!0)),null!=this.tooltip.lastHover&&this.handleHoverTooltip(this.tooltip.lastHover,!0),"setState"===this.getHoverDevice()&&this.refreshSetState()}updateComplete(){const{pendingViewportFocus:e}=this.focus;e&&void 0!==this.focus.series?(this.focus.pendingViewportFocus=void 0,this.pickViewportFocus(e)):this.isState(69)&&this.focusIndicator?.isFocusVisible()&&("always"!==this.announceMode&&(this.announceMode="never"),this.refreshFocus())}update(e,t){this.chart.ctx.eventsHub.emit("chart:request-update",{type:e,opts:t})}seriesChanged(e){this.focus.sortedSeries=[...e].sort(((e,t)=>{let i=e.properties.focusPriority??1/0,n=t.properties.focusPriority??1/0;return i===n&&([i,n]=[e.declarationOrder,t.declarationOrder]),i<n?-1:i>n?1:0})),this.series=e}layoutComplete(e){this.seriesRect=e.series.rect,this.hoverRect=e.series.rect,this.chart.ctx.widgets.seriesWidget.setBounds(e.series.rect),"normal"===this.chart.ctx.domManager.mode&&this.chart.ctx.widgets.chartWidget.setBounds(e.chart)}onAnimationStart(){"setState"!==this.getHoverDevice()&&"legend"!==this.activeState.lastActive&&this.clearAll()}onResize(){const e=this.chart.ctx.highlightManager.getActiveHighlight();this.clearAll(),this.pickManager.wasActivationPrevented()&&void 0!==e&&(this.setHoverDevice("setState"),this.activeState.lastActive={itemId:Md(e),seriesId:e.series.id})}onZoomChangeComplete(e){this.clearAll(),this.focus.pendingViewportFocus=function(e){switch(e.sourceDetail){case"keyboard-page(1)":case"keyboard-page(-1)":return"viewport-start";case"keyboard-page(home)":return"data-start";case"keyboard-page(end)":return"data-end";default:return}}(e)}onContextMenu(e,t){const{sourceEvent:i}=e;if(i.currentTarget!=t.getElement())return;if(t!==this.chart.ctx.widgets.seriesWidget)return void this.onContainerContextMenu(e);let n,s=[];if(this.focusIndicator?.isFocusVisible()){const e=this.chart.ctx.highlightManager.getActiveHighlight();e&&(s=[e]),e&&this.seriesRect&&e.midPoint&&(n=Me.toCanvasPoint(e.series.contentGroup,e.midPoint.x,e.midPoint.y))}else if(this.isState(72)){const t=this.pickNodes({x:e.currentX,y:e.currentY},"context-menu");t&&(this.pickManager.maybeActivate(void 0,(()=>
1{this.chart.ctx.highlightManager.updateHighlight(this.id)})),s=t.matches)}this.clearAll();const a=e.currentX+t.cssLeft(),o=e.currentY+t.cssTop(),r=["series-area"],l={},h=function(e){const t=[];for(const{datumIndex:i,...n}of e)null!=i&&t.push({...n,datumIndex:i});return t}(s);h.length>0&&(r.push("series-node"),l["series-node"]=h);const c=this.collectContextMenuRegions(e,{canvasX:a,canvasY:o});c.axis&&(r.push("axis"),l.axis=c.axis),c.crossLine.length>0&&(r.push("cross-line"),l["cross-line"]=c.crossLine);let d="series-area";l["series-node"]?d="series-node":c.crossLine.length>0?d="cross-line":c.axis&&(d="axis"),this.chart.ctx.contextMenuRegistry?.dispatchContextRegions(d,r,l,{widgetEvent:e,canvasX:a,canvasY:o},n)}onContainerContextMenu(e){if(this.chart.ctx.widgets.seriesWidget.getElement().contains(e.sourceEvent.target))return;if(!this.isState(72))return;const{currentX:t,currentY:i}=e,n={widgetEvent:e,canvasX:t,canvasY:i},s=this.collectContextMenuRegions(e,n);s.crossLine.length>0?this.chart.ctx.contextMenuRegistry?.dispatchContext("cross-line",n,s.crossLine):this.chart.ctx.contextMenuRegistry?.dispatchContext("always",n,void 0)}collectContextMenuRegions(e,{canvasX:t,canvasY:i}){const n={canvasX:t,canvasY:i,widgetEvent:e,crossLine:[]};return this.chart.ctx.eventsHub.emit("series-area:contextmenu",n),n}onLeave(e){if(!this.isState(82))return;const t=e.sourceEvent.relatedTarget;"ag-charts-text-input__textarea"!==t?.className&&(this.maybeEnterInteractiveTooltip(e.sourceEvent)||(this.chart.ctx.domManager.updateCursor(this.id),"keyboard"!==this.getHoverDevice()&&this.clearAll(!0)))}onWheel(e){this.isState(82)&&(this.focusIndicator?.overrideFocusVisible(!1),this.setHoverDevice("pointer"))}onDragMove(e,t){this.isState(82)&&(this.focusIndicator?.overrideFocusVisible(!1),this.onHoverLikeEvent(e,t))}onHover(e,t){this.isState(83)&&this.onHoverLikeEvent(e,t)}onHoverLikeEvent(e,t){if(this.isIgnoredTouch(e))return;if("touch"===e.device&&"hover"===this.chart.ctx.chartState.getValue("options","touch").dragAction&&e.sourceEvent.preventDefault(),t!==this.chart.ctx.widgets.seriesWidget)return;let i;if(this.tooltip.lastHover=e,this.setHoverDevice("pointer"),this.highlight.pendingHoverEvent=e,this.hoverScheduler.schedule(),this.isState(65)){const{currentX:t,currentY:n}=e;i=this.pickNodes({x:t,y:n},"event");const s=i?.matches,a=s?.[0];a?.series.isSelectionEnabled()&&a?.series.isDatumSelectable(a.datumIndex)||a?.series.hasNodeClickListener()||a?.series.hasBuiltinListener(i?.target)||null!=s&&s.length>1&&this.chart.tooltip.pagination?this.chart.ctx.domManager.updateCursor(this.id,"pointer"):this.chart.ctx.domManager.updateCursor(this.id)}const n=Boolean(i?.matches.length);this.emitSeriesAreaHoverEvent(e,n)}onClick(e,t){if("keyboard"===e.device)return;if(t===this.chart.ctx.widgets.seriesWidget&&this.chart.ctx.animationManager.isActive()&&this.chart.ctx.animationManager.skipCurrentBatch(),"touch"===e.device&&t===this.chart.ctx.widgets.seriesWidget&&this.focusIndicator?.focus({preventScroll:!0,focusVisible:!1}),!this.isState(83))return;if(t===this.chart.ctx.widgets.seriesWidget){if(!t.getElement().contains(e.sourceEvent.target))return}else if(e.sourceEvent.target!=t.getElement())return;this.focusIndicator?.overrideFocusVisible(!1),this.onHoverLikeEvent(e,t);const i=t===this.chart.ctx.widgets.seriesWidget;if(this.isState(18))return void(i&&this.emitSeriesAreaClickEvent(e,!1));const s=i?this.toCanvasCoordinates(e):{canvasX:e.currentX,canvasY:e.currentY},a=this.emitSeriesAreaCanvasClickEvent(e,s);if(this.checkCrossLineClick(e,a)){return void function(e,t){const i=t.length>0?[...e.allMatchedParams,...t]:e.allMatchedParams;for(const t of e.crossLines.values())Vd(i,t);for(const t of e.axes.values())Vd(i,t);e.chart&&Vd(i,e.chart)}(a,i?this.pickSeriesNodeHitParams(e):[])}if(i){const t=this.checkSeriesNodeClick(e,a.allMatchedParams);if(t){if(t.defaultPrevented)return;return this.emitSeriesAreaClickEvent(e,!0,t.node,t.target),this.update(n.GvF.SERIES_UPDATE),void e.sourceEvent.preventDefault()}this.emitSeriesAreaClickEvent(e,!1)}const o="click"===e.type?"click":"doubleClick",r=i?this.chart.ctx.chartService.toAgCoordinates(s):void 0,l={type:o,event:e.sourceEvent,coordinates:r};this.chart.ctx.chartService.callListener(l)}emitSeriesAreaHoverEvent(e,t){const{canvasX:i,canvasY:n}=this.toCanvasCoordinates(e),s={canvasX:i,canvasY:n,consumed:t,sourceEvent:e.sourceEvent};this.chart.ctx.eventsHub.emit("series-area:hover",s)}emitSeriesAreaCanvasClickEvent(e,{canvasX:t,canvasY:i}){const{type:n,sourceEvent:s}=e,a={type:n,canvasX:t,canvasY:i,sourceEvent:s,pendingCrossLineCallbacks:{allMatchedParams:[],axes:new Map,crossLines:new Map}};return this.chart.ctx.eventsHub.emit("series-area:canvas-click",a),a.pendingCrossLineCallbacks}emitSeriesAreaClickEvent(e,t,i,n){const{type:s,sourceEvent:a}=e,o={type:s,consumed:t,sourceEvent:a,clickedNode:i,target:n},{datum:r}=this.focus,l=r?.series.getDataSelectionState(r.datumIndex);this.chart.ctx.eventsHub.emit("series-area:click",o);const h=r?.series.getDataSelectionState(r.datumIndex);l!==h&&this.announceDataSelectionChange()}toCanvasCoordinates(e){return{canvasX:e.currentX+(this.hoverRect?.x??this.seriesRect?.x??0),canvasY:e.currentY+(this.hoverRect?.y??this.seriesRect?.y??0)}}onFocus(){if(!this.isState(69)||!this.focusIndicator)return;this.initFocus(this.chart.ctx.chartState.getValue("options","keyboard").initialFocus);const e=this.focusIndicator.onFocus();this.setHoverDevice(e?"keyboard":"pointer");const{pendingViewportFocus:t}=this.focus;4===this.refreshFocus()&&t&&(this.focus.pendingViewportFocus=void 0,this.pickViewportFocus(t))}onBlur(e){this.isState(69)&&(this.setHoverDevice("pointer"),this.isState(1)||this.maybeEnterInteractiveTooltip(e)||this.clearAll(!0),this.focusIndicator?.onBlur())}onKeyDown(e){if(!this.isState(87))return;const t=function(e){for(const[t,{activatesFocusIndicator:i=!0,bindings:s}]of(0,n.jOZ)($d))if(Wd(e,s))return{name:t,activatesFocusIndicator:i}}(e.sourceEvent);switch(!1===t?.activatesFocusIndicator&&this.focusIndicator?.overrideFocusVisible("keyboard"===this.getHoverDevice()
1),t?.name){case"redo":return this.chart.ctx.eventsHub.emit("series:redo",null);case"undo":return this.chart.ctx.eventsHub.emit("series:undo",null);case"zoomin":return this.chart.ctx.eventsHub.emit("series:keynav-zoom",{delta:1,widgetEvent:e});case"zoomout":return this.chart.ctx.eventsHub.emit("series:keynav-zoom",{delta:-1,widgetEvent:e});case"panxleft":return this.onPage(-1,e);case"panxright":return this.onPage(1,e);case"arrowup":return this.onArrow(-1,0,e);case"arrowdown":return this.onArrow(1,0,e);case"arrowleft":return this.onArrow(0,-1,e);case"arrowright":return this.onArrow(0,1,e);case"home":return this.onHome(e);case"end":return this.onEnd(e);case"submit":return this.onSubmit(e);case"expand":return this.onExpandCollapse("series:keynav-expand",e);case"collapse":return this.onExpandCollapse("series:keynav-collapse",e);case"delete":return}}onPage(e,t){if(!this.chart.hasPgUpPgDownSupport())return;if(!this.onNav(t))return;const i=!0===this.focus.series?.axes.x?.options.reverse;this.chart.ctx.eventsHub.emit("series:keynav-panx",{delta:e,reverse:i,widgetEvent:t})}onNav(e){return!!this.isState(69)&&(this.setHoverDevice("keyboard"),this.focusIndicator?.overrideFocusVisible(!0),e.sourceEvent.preventDefault(),!0)}onArrow(e,t,i){this.onNav(i)&&(this.focus.seriesIndex+=e,this.focus.datumIndex+=t,this.handleFocusFromUserInput({datumIndexDelta:t,otherIndexDelta:e}))}onHome(e){if(this.chart.hasViewportSupport())return this.onPage("home",e);this.onNav(e)&&this.handleFocusFromUserInput({otherIndex:this.focus.seriesIndex,datumIndex:0})}onEnd(e){if(this.chart.hasViewportSupport())return this.onPage("end",e);if(!this.onNav(e))return;const t=this.focus.series?.data?.data.length;void 0!==t&&this.handleFocusFromUserInput({otherIndex:this.focus.seriesIndex,datumIndex:t-1})}onSubmit(e){if(!this.onNav(e))return;const{series:t,datum:i}=this.focus,s=e.sourceEvent;if(null!=t&&null!=i){const e=function(e,t){const i=vl(t.series,t,void 0);return void 0===i?void 0:e.toAgCoordinates(i)}(this.chart.ctx.chartService,i);if(!t.fireNodeClickEvent({event:s,datums:[i],winner:0,coordinates:e})){const e={type:"click",device:"keyboard",sourceEvent:s};this.emitSeriesAreaClickEvent(e,!0,i),this.update(n.GvF.SERIES_UPDATE)}}else this.chart.ctx.chartService.callListener({type:"click",event:s,coordinates:void 0})}onExpandCollapse(e,t){const i=this.focus.datum;i&&this.chart.ctx.eventsHub.emit(e,{nodeDatum:i,widgetEvent:t})}checkCrossLineClick(e,t){const{allMatchedParams:i,axes:n,crossLines:s}=t,a="click"===e.type?this.chart.ctx.chartService.listeners.crossLineClick:this.chart.ctx.chartService.listeners.crossLineDoubleClick;return i.length>0&&(n.size>0||s.size>0||null!=a)}pickSeriesNodeHitParams(e){const t=this.pickNodes({x:e.currentX,y:e.currentY},"event");if(null==t||0===t.matches.length)return[];const{matches:i,target:n}=t;if(!i[0].series.firesUserClickListeners(n))return[];const s="click"===e.type?"seriesNodeClick":"seriesNodeDoubleClick";return i.map((e=>({...e.series.createNodeParams(e),type:s})))}checkSeriesNodeClick(e,t){var i;const n=this.pickNodes({x:e.currentX,y:e.currentY},"event"),s=this.pickManager.onPickedNodesTooltip(n);if(void 0===n||void 0===s.active)return;const a=null==s.paginationState?n.distance:0,o=this.toCanvasCoordinates(e),r=this.chart.ctx.chartService.toAgCoordinates(o),l=s.active.series.firesUserClickListeners(n.target),{matches:h}=n,c={event:e.sourceEvent,datums:h,winner:h.indexOf(s.active),coordinates:r,otherHitParams:t};if("click"===e.type){const e=l&&s.active.series.fireNodeClickEvent(c);if(!e){const e=this.pickManager.nextCandidate();if(void 0!==e.active){const{active:t}=e,{canvasX:s,canvasY:a}=o;(i=this.highlight).pendingHoverEvent??(i.pendingHoverEvent=this.highlight.appliedHoverEvent),this.handleHoverHighlight(!1,{active:t,target:n.target,defaultCb:()=>{this.showTooltip(t,s,a,e.paginationState)}})}}return{node:s.active,target:n.target,defaultPrevented:e}}if("dblclick"===e.type){e.preventZoomDblClick=0===a;const t=l&&s.active.series.fireNodeDoubleClickEvent(c);return{node:s.active,target:n.target,defaultPrevented:t}}return e.type}handleFocusFromUserInput(e){this.handleFocus(e),this.chart.ctx.eventsHub.emit("series:focus-change",null)}refreshFocus(){return this.handleFocus({datumIndexDelta:0,otherIndexDelta:0})}handleFocus(e){const t=this.chart.overlays.getFocusInfo(this.chart.ctx.localeManager);if(null==t){const t=this.handleSeriesFocus(e);return this.announceMode=0===t?"when-changed":"always",t}
1return this.focusIndicator?.update(t.rect,this.seriesRect,!1),this.swapChain.update(t.text),this.announceMode="always",0}handleSeriesFocus(e){return"datumIndexDelta"in e?this.handleSeriesFocusDeltas(e):this.handleSeriesFocusIndices(e)}makeUpdateFocusParamsFromDeltas(e){const{otherIndexDelta:t,datumIndexDelta:i}=e;if("standalone"===this.chart.chartType){this.focus.series=this.focus.sortedSeries[0];const e=this.focus.datumIndex,n=this.focus.seriesIndex;return{datumIndex:e,datumIndexDelta:i,oldDatumIndex:this.focus.datumIndex-i,otherIndex:n,otherIndexDelta:t,oldOtherIndex:this.focus.seriesIndex-t}}const{focus:s}=this,a=s.sortedSeries.filter((e=>e.visible&&e.focusable));if(0===a.length)return 1;const o=s.datumIndex-i,r=s.seriesIndex-t;s.seriesIndex=(0,n.qE8)(0,s.seriesIndex,a.length-1),s.series=a[s.seriesIndex];return{datumIndex:this.focus.datumIndex,datumIndexDelta:i,oldDatumIndex:o,otherIndex:this.focus.seriesIndex,otherIndexDelta:t,oldOtherIndex:r}}handleSeriesFocusDeltas(e){const t=this.makeUpdateFocusParamsFromDeltas(e);return 1===t?1:this.pickFocus(t)}handleSeriesFocusIndices(e){const{datumIndex:t,otherIndex:i}=e,n=this.focus.datumIndex,s=this.focus.seriesIndex;return this.pickFocus({datumIndex:t,datumIndexDelta:t-n,oldDatumIndex:n,otherIndex:i,otherIndexDelta:i-s,oldOtherIndex:s})}pickFocus(e){const{datumIndex:t,datumIndexDelta:i,otherIndex:n,otherIndexDelta:s}=e,{focus:a,hoverRect:o,seriesRect:r}=this;if(null==a.series||null==o)return 1;const l={datumIndex:t,datumIndexDelta:i,otherIndex:n,otherIndexDelta:s,seriesRect:r},h=a.series.pickFocus(l);return h?this.updatePickedFocus(e,h):2}pickViewportFocus(e){const{focus:t,hoverRect:i}=this;if(null==t.series||null==i)return 1;const n=t.series.pickViewportFocus({where:e,hoverRect:i,otherIndex:t.seriesIndex});if(!n)return 2;const s={datumIndex:n.datumIndex,datumIndexDelta:0,oldDatumIndex:this.focus.datumIndex,otherIndex:n.otherIndex??this.focus.seriesIndex,otherIndexDelta:0,oldOtherIndex:this.focus.seriesIndex};return this.updatePickedFocus(s,n)}updatePickedFocus(e,t){const{datumIndexDelta:i,oldDatumIndex:s,otherIndexDelta:a,oldOtherIndex:o}=e,{focus:r,hoverRect:l}=this;if(null==r.series||null==l)return 1;if(void 0!==r.pendingViewportFocus)return 4;const{datum:h}=t;if(r.datum=h,r.datumIndex=t.datumIndex,null!=t.otherIndex&&(r.seriesIndex=t.otherIndex),this.focusIndicator?.isFocusVisible()){this.chart.ctx.animationManager.reset();const e=_d(t),{x:i,y:s}=e.computeCenter();if(!l.containsPoint(i,s)){const t=r.series.mapFocusBBoxToPanTarget(l,e),i=this.chart.ctx.zoomManager?.panToBBox(l,t);if(i)return 3}const{x1:a,x2:o,y1:h,y2:c}=n.Zbg.from(e),d=l.containsPoint(a,h),u=l.containsPoint(o,h),p=l.containsPoint(a,c),g=l.containsPoint(o,c);if(!(d||u||p||g)){const i=n.Zbg.from(l);t.movedBounds=e.clone(),a<i.x1&&o<i.x1?(t.movedBounds.x=i.x1-2,t.movedBounds.width=4):a>i.x2&&o>i.x2&&(t.movedBounds.x=i.x2-2,t.movedBounds.width=4),h<i.y1&&c<i.y1?(t.movedBounds.y=i.y1-2,t.movedBounds.height=4):h>i.y2&&c>i.y2&&(t.movedBounds.y=i.y2-2,t.movedBounds.height=4)}}this.focusIndicator?.update(t.movedBounds??t.bounds,this.seriesRect,t.clipFocusBox);const c=this.getTooltipContent(h,"aria-label"),d=Gd(r.series,l,t);if(null!=d&&"keyboard"===this.getHoverDevice()&&(this.clearCachedEvents(),!this.isState(1))){const e=Al.makeTooltipMeta(d,r.series,h,t.movedBounds);this.pickManager.maybeActivate(h,(({series:t})=>{this.chart.ctx.highlightManager.updateHighlight(this.id,h),this.isTooltipEnabled(t)&&this.chart.ctx.tooltipManager.updateTooltip(this.id,e,c)}),{defaultCbArg:{series:r.series}})}return this.maybeAnnouncePickedFocus(i,s,a,o,t,c),0}maybeAnnouncePickedFocus(e,t,i,n,s,a){const{focus:o}=this;let r;if("when-changed"===this.announceMode){r=0===e&&0===i||t!==s.datumIndex||n!==(s.otherIndex??o.seriesIndex)?"always":"never"}else r=this.announceMode;"always"===r&&this.swapChain.update(this.getDatumAriaText("keynav",s.datum,a))}announceDataSelectionChange(){const{datum:e}=this.focus;if(void 0!==e){const t=this.getTooltipContent(e,"aria-label");this.swapChain.update(this.getDatumAriaText("selectionChange",e,t))}}getDatumAriaText(e,t,i){const s=null==i?"":function(e,t){const i=iu(e),s=[];for(const e of i)if("raw"!==e.type){Jd(e.heading)&&s.push((0,n.boc)(e.heading));for(const t of e.items)if(Jd(t.title)&&s.push((0,n.boc)(t.title)),t.data)for(const e of t.data)!0!==e.missing&&s.push(e.label??e.fallbackLabel,(0,n.boc)(e.value))}else s.push(nu(e.rawHtmlString,t));return s.filter((e=>""!==e)).join("; ")}(i,this.chart.ctx.logger),a=t.series.getDatumAriaMeta(t,s),o=this.chart.ctx.localeManager.t("ariaAnnounceHoverDatum",{datum:a?.text??s}),r=e=>a?.instructions?[e,...a.instructions].join(". "):e,l=this.getSelectedStateAriaText(t);if(void 0===l)return r(o);switch(e){case"keynav":return r([o,l].join(", "));case"selectionChange":return r([l,o].join(", "));default:return e}}getSelectedStateAriaText(e){const t=e.series.getDataSelectionState(e.datumIndex);switch(t){case 1:return this.chart.ctx.localeManager.t("ariaAnnounceSelectedItem");case 0:case 2:return this.chart.ctx.localeManager.t("ariaAnnounceUnselectedItem");case 3:case void 0:return;default:return t}}clearHighlight(e=!1){this.pickManager.maybeActivate(void 0,(()=>{this.highlight.pendingHoverEvent=void 0,this.highlight.appliedHoverEvent=void 0,this.chart.ctx.highlightManager.updateHighlight(this.id,void 0,e)}))}clearTooltip(e=!1){this.chart.ctx.tooltipManager.removeTooltip(this.id,void 0,e),this.tooltip.lastHover=void 0}clearAll(e=!1){this.isState(1)||(this.pickManager.onClearUI(),this.clearHighlight(e),this.pickManager.wasActivationPrevented()||this.clearTooltip(e),this.focusIndicator?.clear())}clearStaleHighlightTooltip(){"setState"===this.getHoverDevice()&&(this.clearCachedEvents(),this.chart.ctx.highlightManager.updateHighlight(this.id
1),this.chart.ctx.tooltipManager.removeTooltip(this.id))}clearUnpreventable(){this.activeState.lastActive=void 0,this.pickManager.onClearUI(),this.clearHighlight(!1),this.clearTooltip(!1)}clearCachedEvents(){this.tooltip.lastHover=void 0,this.highlight.appliedHoverEvent=void 0,this.highlight.pendingHoverEvent=void 0,this.highlight.stashedHoverEvent=void 0}createHoverScheduler(){return e=this.chart.ctx.domManager.getDocument(),$e((function(t,i){return e.requestAnimationFrame(t)}),(()=>{if("setState"===this.getHoverDevice())return this.handleHoverFromState();(this.tooltip.lastHover||this.highlight.pendingHoverEvent)&&(this.chart.getUpdateType()<=n.GvF.SERIES_UPDATE?this.hoverScheduler.schedule():(this.highlight.pendingHoverEvent&&this.handleHoverHighlight(!1),this.tooltip.lastHover&&this.handleHoverTooltip(this.tooltip.lastHover,!1)))}),(function(t){e.cancelAnimationFrame(t)}));var e}resetHoverScheduler(){this.hoverScheduler.cancel(),this.hoverScheduler=this.createHoverScheduler()}handleHoverFromState(){const{active:e,paginationState:t}=this.pickManager.onPickedNodesAPIDebounced();void 0!==e&&this.pickManager.maybeActivate(e,(()=>{const i=vl(e.series,e,void 0);if(this.chart.tooltip.enabled)if(e.series.visible){if(i){const{canvasX:n,canvasY:s}=i,a=this.activeState.highlightInViewport;this.chart.ctx.highlightManager.updateHighlight(this.id,e,!1,a),a?this.showTooltip(e,n,s,t):this.clearTooltip()}}else this.clearStaleHighlightTooltip()}))}handleHoverHighlight(e,t){this.highlight.appliedHoverEvent=this.highlight.pendingHoverEvent,this.highlight.pendingHoverEvent=void 0;const i=this.highlight.appliedHoverEvent;if(!i||!this.isState(82))return;const{canvasX:n,canvasY:s}=this.toCanvasCoordinates(i);if(e?this.chart.ctx.animationManager.isActive():!this.hoverRect?.containsPoint(n,s))return void this.clearHighlight();const{range:a}=this.chart.highlight,o="tooltip"===a?"highlight-tooltip":"highlight",r=null==t?.active?this.pickNodes({x:i.currentX,y:i.currentY},o):void 0,l=t?.active??this.pickManager.onPickedNodesHighlight(r);if(void 0===l)this.pickManager.maybeActivate(void 0,(()=>{this.chart.ctx.highlightManager.updateHighlight(this.id,void 0,!0),t?.defaultCb()}));else{const e=l.series.getHighlightPart(t?.target??r?.target);this.pickManager.maybeActivate(l,(()=>{this.chart.ctx.highlightManager.updateHighlight(this.id,l,!1,void 0,e),t?.defaultCb()}))}}handleHoverTooltip(e,t){if(!this.isState(82))return;const{canvasX:i,canvasY:n}=this.toCanvasCoordinates(e),s=e.sourceEvent.target;if(t?this.chart.ctx.animationManager.isActive():!this.hoverRect?.containsPoint(i,n))return void("pointer"==this.getHoverDevice()&&this.clearTooltip());if(s&&this.chart.tooltip.interactive&&this.chart.ctx.domManager.isManagedChildDOMElement(s,"canvas-overlay",qd))return;const a=this.pickNodes({x:e.currentX,y:e.currentY},"tooltip"),{active:o,paginationState:r}=this.pickManager.onPickedNodesTooltip(a);this.pickManager.wasActivationPrevented()||(void 0===o?"pointer"==this.getHoverDevice()&&this.clearTooltip(!0):this.showTooltip(o,i,n,r))}showTooltip(e,t,i,n){const s=this.getTooltipContent(e,"tooltip");if(null!=s&&s.length>0){const{series:a}=e,o=Al.makeTooltipMeta({type:"pointermove",canvasX:t,canvasY:i},a,e,void 0);this.chart.ctx.tooltipManager.updateTooltip(this.id,o,s,n)}else this.chart.ctx.tooltipManager.removeTooltip(this.id,void 0,!0)}maybeEnterInteractiveTooltip(e){return this.chart.tooltip.maybeEnterInteractiveTooltip(e,(()=>{this.pickManager.maybeActivate(void 0,(()=>{this.tooltip.lastHover=void 0,this.chart.ctx.tooltipManager.removeTooltip(this.id,void 0,!0),this.chart.ctx.highlightManager.updateHighlight(this.id,void 0,!0)}))}))}changeHighlightDatum(e){const t=e.previousHighlight?.series,i=e.currentHighlight?.series;t?.properties.cursor&&e.previousHighlight?.datum&&this.chart.ctx.domManager.updateCursor(t.id),i?.properties.cursor&&"default"!==i.properties.cursor&&e.currentHighlight?.datum&&this.chart.ctx.domManager.updateCursor(i.id,i.properties.cursor);const s=t?.isHighlightEnabled()??!1;if(e.highlightSuppressed&&!s)return;const a=e.highlightSuppressed!==!s,o="shared"===this.chart.highlight.mode&&(yl(e.currentHighlight)||yl(e.previousHighlight));"setState"===this.getHoverDevice()||null==i||null==t||a||o?this.update(n.GvF.SERIES_UPDATE,{clearCallbackCache:!0}):this.update(n.GvF.SERIES_UPDATE,{seriesToUpdate:new Set([t,i].filter(
1Boolean)),clearCallbackCache:!0})}onHighlightSelectionUpdate(e){if(!this.isState(1)||!this.seriesRect)return void(this.activeState.highlightInViewport=!0);if(0===e.highlightSelection.length)return;const t=function(e,t){for(const i of e)if(Me.toCanvas(i.node).intersectsWith(t))return!0;return!1}(e.highlightSelection,this.seriesRect);this.activeState.highlightInViewport=t}pickNodes(e,t,i){const n=[...this.series].reverse(),s="event"===t||"context-menu"===t,a="tooltip"===t||"highlight-tooltip"===t,o=e=>s?e.properties.nodeClickRange:a?e.properties.tooltip.range:void 0,{x:r,y:l}=e,h=new Set;for(const e of n)e.visible&&e.contentGroup.visible&&"area"===o(e)&&e.isPointInArea?.(r,l)&&h.add(e);const c=h.size>0;let d;for(const s of n){if(!s.visible||!s.contentGroup.visible)continue;if(c){if(!("area"===o(s)&&h.has(s)))continue}const n=s.pickNodes(e,t,i);if(null==n||0===n.picks.length)continue;const{picks:a}=n,r=a[0].distance,l=a.at(-1)?.target;if(0===r){0!==d?.distance&&(d={matches:[],distance:0,target:l});for(const{datum:e}of a)d.matches.push(e)}else(null==d||d.distance>r)&&(d={matches:a.map((e=>e.datum)),distance:r,target:l})}return d}isTooltipEnabled(e){return e.tooltipEnabled??this.chart.tooltip.enabled}getTooltipContent(e,t){const{series:i,datumIndex:n}=e;let s;if("aria-label"===t||this.isTooltipEnabled(i)){const{cachedTooltipContent:a}=this;if(a?.series===i&&a.datumIndex===n)s=a.content;else{const a=this.chart.getTooltipContent(i,n,e,t);this.cachedTooltipContent={series:i,datumIndex:n,content:a},s=a}}else this.cachedTooltipContent=void 0;return s}onLegendHover(e){this.isState(82)&&(this.setHoverDevice("pointer"),this.clearCachedEvents(),this.chart.ctx.highlightManager.updateHighlight(this.id),this.chart.ctx.tooltipManager.removeTooltip(this.id))}onActiveLoadMemento(e){switch(e.activeItem?.type){case void 0:case"legend":return this.onActiveClear();case"series-node":return this.onActiveDatum(e.activeItem,e);default:return e.activeItem?.type}}onActiveClear(){this.pickManager.onClearAPI(),this.setHoverDevice("setState"),this.activeState.lastActive=void 0,this.clearHighlight(),this.clearTooltip()}refreshSetState(){if(void 0===this.activeState.lastActive)this.pickManager.onClearUI(),this.clearHighlight(!1),this.clearTooltip(!1);else if("legend"!==this.activeState.lastActive){const{seriesId:e,itemId:t}=this.activeState.lastActive,i=this.findPickedNodes(e,t);void 0===i?this.clearUnpreventable():"series-hidden"===i?this.isState(1)?this.clearStaleHighlightTooltip():this.pickManager.maybeActivate(void 0,(()=>{this.activeState.lastActive=void 0,this.clearCachedEvents(),this.chart.ctx.highlightManager.updateHighlight(this.id),this.chart.ctx.tooltipManager.removeTooltip(this.id)})):(this.pickManager.onPickedNodesAPI(i),this.hoverScheduler.schedule())}}onActiveDatum(e,t){const{seriesId:i,itemId:n}=e,s=this.findPickedNodes(i,n);if(void 0===s)t.reject(),this.onActiveClear();else{if("series-hidden"!==s){const e=this.pickManager.onPickedNodesAPI(s);t.setDatum(e)}this.setHoverDevice("setState"),this.activeState.lastActive={seriesId:i,itemId:n},t.initialState?(this.chart.ctx.scene.applyPendingResize(),this.handleHoverFromState()):(this.clearCachedEvents(),this.hoverScheduler.schedule())}}findPickedNodes(e,t){const i=this.series.find((t=>t.id===e));if(null==i)return void this.chart.ctx.logger.warn(`Cannot find seriesId: "${e}"`);if(!i.visible)return"series-hidden";const n=i.findNodeDatum(t);if(null!=n)return{matches:[n],distance:0,target:void 0};this.chart.ctx.logger.warn(`Cannot find itemId: ${JSON.stringify(t)}`)}};return e.className="SeriesAreaManager",e})(),mu=class{constructor(e){this.seriesRoot=e,this.groups=new Map,this.series=new Map,this.expectedSeriesCount=1,this.mode="normal"}setSeriesCount(e){this.expectedSeriesCount=e}getGroupIndex(e){const{internalId:t,seriesGrouping:i}=e;return i?.groupIndex??t}getGroupType(e,t){return t?"top":e.type}requestGroup(e){const{internalId:t,contentGroup:i}=e,n=e.bringToFront(),s=this.getGroupType(e,n),a=this.getGroupIndex(e),o=this.series.get(t);if(null!=o)throw new Error(`AG Charts - series already has an allocated layer: ${JSON.stringify(o)}`);0===this.series.size&&(this.mode=this.expectedSeriesCount>=30?"aggressive-grouping":"normal");let r=this.groups.get(s);null==r&&(r=new Map,this.groups.set(s,r));const l=this.lookupIdx(a);let h=r.get(l);return null==h&&(h={type:s,id:l,seriesIds:[],group:this.seriesRoot.appendChild(new ke({name:`${e.contentGroup.name??s}-managed-layer`,zIndex:e.contentGroup.zIndex,renderToOffscreenCanvas:!1}))},r.set(l,h)),this.series.set(t,{layerState:h,seriesConfig:e,bringToFront:n}),h.seriesIds.push(t),h.group.appendChild(i),h.group}changeGroup(e){const{internalId:t,contentGroup:i}=e,n=e.bringToFront(),s=this.getGroupType(e,n),a=this.series.get(t),o=a?this.getGroupType(a.seriesConfig,a.bringToFront):void 0,r=this.getGroupIndex(e),l=this.lookupIdx(r),h=this.groups.get(s)?.get(l);if(o!==s||!0!==h?.seriesIds.includes(t))return this.series.has(t)&&this._releaseGroup({internalId:t,contentGroup:i,type:o}),this.requestGroup(e)}releaseGroup(e){const{internalId:t,contentGroup:i}=e,n=this.getGroupType(e,e.bringToFront());this._releaseGroup({internalId:t,contentGroup:i,type:n})}_releaseGroup(e){const{internalId:t,contentGroup:i,type:n}=e;if(!this.series.has(t))throw new Error(`AG Charts - series doesn't have an allocated layer: ${t}`);const s=this.series.get(t)?.layerState;s&&(s.seriesIds=s.seriesIds.filter((e=>e!==t)),i.remove()),0===s?.seriesIds.length?(s.group.remove(),this.groups.get(s.type)?.delete(s.id),this.groups.get(n)?.delete(t)):null!=s&&s.seriesIds.length>0&&(s.group.zIndex=this.getLowestSeriesZIndex(s.seriesIds)),this.series.delete(t)}
1updateLayerCompositing(){for(const e of this.groups.values())for(const t of e.values()){const{group:e,seriesIds:i}=t;let n;if(0===i.length)n=!1;else if(i.length>1)n=!0;else{const e=this.series.get(i[0]);n=!0===e?.seriesConfig.renderToOffscreenCanvas()}e.renderToOffscreenCanvas=n,e.zIndex=this.getLowestSeriesZIndex(i)}}lookupIdx(e){return"normal"===this.mode?e:"string"!=typeof e||(e=Number(e.split("-").at(-1)),Number.isFinite(e))?Math.floor(30*(0,n.qE8)(0,e/this.expectedSeriesCount,1)):0}destroy(){for(const e of this.groups.values())for(const t of e.values())t.group.remove();this.groups.clear(),this.series.clear()}getLowestSeriesZIndex(e){let t;for(const i of e){const e=this.series.get(i),s=e?.seriesConfig.contentGroup.zIndex??n.qw7.ANY_CONTENT;null!=t&&null!=s?t=C(t,s)<=0?t:s:t=s}return t??n.qw7.ANY_CONTENT}},yu=class{constructor(){this.cache=[]}invalidate(){this.cache.length=0}get(e,t,i){const n=this.cache.find((e=>e.series===t&&e.datumIndex===i));if(null!=n)return n.group;const s=function(e,t,i){const n=new Map,s=t.getCategoryValue(i);if(null==s)return n;n.set(t,i);for(const i of e){if(i===t||!i.isEnabled())continue;const e=i.datumIndexForCategoryValue(s);null!=e&&n.set(i,e)}return n}(e,t,i);return this.cache.unshift({series:t,datumIndex:i,group:s}),this.cache.length=Math.min(this.cache.length,2),s}};var fu={min:0,max:1},xu=class{constructor(e,t){this.chart=e,this.ctx=t,this.dirtyZoom=!1,this.dirtyDataSource=!1,this.lastAxisZooms=new Map,this.requestCounter=0,this.errorRollbacks=new Map,this.cleanup=new n._uV,this.cleanup.register(t.eventsHub.on("data:source-change",(()=>this.onDataSourceChange())),t.eventsHub.on("data:load",(()=>this.onDataLoad())),t.eventsHub.on("data:error",(e=>this.onDataError(e))),t.eventsHub.on("data:render-verdict",(e=>this.onRenderVerdict(e))),t.eventsHub.on("update:complete",(e=>this.onUpdateComplete(e))),t.eventsHub.on("zoom:change-complete",(e=>this.onZoomChange(e))))}destroy(){this.cleanup.flush()}onDataLoad(){this.ctx.animationManager.skip(),this.ctx.eventsHub.emit("chart:request-update",{type:n.GvF.UPDATE_DATA})}onDataError(e){this.applyRollback(e?.requestId),this.discardRollbacksUpTo(e?.requestId),this.ctx.eventsHub.emit("chart:request-update",{type:n.GvF.PERFORM_LAYOUT})}onRenderVerdict({requestId:e,rendered:t}){t||this.applyRollback(e),this.discardRollbacksUpTo(e)}applyRollback(e){const t=null==e?void 0:this.errorRollbacks.get(e);t&&e===this.latestRequestId&&(this.lastWindow=t.window,null!=t.axisId&&(t.axisZoom?this.lastAxisZooms.set(t.axisId,t.axisZoom):this.lastAxisZooms.delete(t.axisId)))}discardRollbacksUpTo(e){if(null!=e)for(const t of this.errorRollbacks.keys())t<=e&&this.errorRollbacks.delete(t)}onDataSourceChange(){this.dirtyDataSource=!0}onUpdateComplete(e){(e.apiUpdate||this.dirtyZoom||this.dirtyDataSource)&&(e.wasShortcut||this.updateWindow(e))}onZoomChange(e){this.dirtyZoom=!0,this.zoomSource=e.source}updateWindow(e){if(!this.ctx.dataService.isLazy())return;const t=this.chart.axes.find((({direction:e})=>e===n.tv$.X)),i=this.lastWindow,s=t?this.lastAxisZooms.get(t.id):void 0;let a,o=!0;if(t){const i=(0,n.gMZ)(this.ctx.chartState.getValue("zoom"),t.direction)??fu;a=this.getAxisWindow(t,i),o=this.shouldRefresh(e,t,i,a)}const r=this.dirtyZoom&&this.zoomSource?this.zoomSource:"chart-update";if(this.dirtyZoom=!1,this.dirtyDataSource=!1,this.zoomSource=void 0,this.lastWindow=a,!o)return;const l=this.requestCounter++;this.latestRequestId=l,this.errorRollbacks.set(l,{window:i,axisId:t?.id,axisZoom:s}),this.ctx.dataService.load({windowStart:a?.windowStart,windowEnd:a?.windowEnd,source:r},l)}shouldRefresh(e,t,i,n){const{lastAxisZooms:s,lastWindow:a}=this;if(e.apiUpdate)return!0;if(this.dirtyDataSource)return!0;if(!this.dirtyZoom)return!1;const o=s.get(t.id);return(i.min!==o?.min||i.max!==o?.max)&&(s.set(t.id,i),!n||!a||n.windowStart?.valueOf()!==a.windowStart?.valueOf()||n.windowEnd?.valueOf()!==a.windowEnd?.valueOf())}getAxisWindow(e,t){const i=this.getDomainPixelExtents(e);if(!i)return;const[n,s]=i;let a,o;return n<=s?(a=e.scale.invert(0,!0),o=e.scale.invert(n+(s-n)*t.max,!0)):(a=e.scale.invert(n-(n-s)*t.min,!0),o=e.scale.invert(0,!0)),{windowStart:a,windowEnd:o}}getDomainPixelExtents(e){const[t,i]=e.scale.range;if((0,n.BfI)(t)&&(0,n.BfI)(i))return[t,i]}},bu=/^((?!chrome|android).)*safari/i,vu=/Version\/(\d+(\.\d+)?)/,Su=/Chrome/,Mu=/Chrome\/(\d+)/,ku=/Edg/,Du=/OPR/;var wu=new Set(["map-shape-background","map-line-background"]),Iu=class{constructor(e,t,i,s,a,o,r,l){this.chartLike=e,this.overlays=t,this.eventsHub=i,this.dataService=s,this.localeManager=a,this.animationManager=o,this.domManager=r,this.validations=l,this.cleanup=new n._uV,this.overlayState=void 0,this.overlayMounted=!1,this.overlayElem=this.domManager.addProxyChild("canvas-overlay","overlay"),this.overlayElem.setAttr("role","status"),this.overlayElem.setAttr("aria-atomic","fal
1se"),this.overlayElem.setAttr("aria-live","polite"),this.overlayElem.toggleClass(Jc,!0),this.cleanup.register(this.eventsHub.on("layout:complete",(e=>this.onLayoutComplete(e))),this.eventsHub.on("canvas:resize",(e=>this.onCanvasResize(e))),this.eventsHub.on("validation:change",(()=>this.onValidationChange())))}destroy(){this.cleanup.flush(),this.domManager.removeChild("canvas-overlay","overlay")}onLayoutComplete({chart:e,series:{rect:t}}){this.lastSeriesRect=t,this.lastChartRect=new m(0,0,e.width,e.height),this.refresh(t)}onCanvasResize({width:e,height:t}){this.lastChartRect=new m(0,0,e,t),"validation"===this.overlayState&&this.refresh(this.lastSeriesRect??this.lastChartRect,!1)}onValidationChange(){const e=this.lastSeriesRect??this.fullContainerRect();e&&this.refresh(e,!1)}fullContainerRect(){const e=this.domManager.containerSize;return e?new m(0,0,e.width,e.height):void 0}refresh(e,t=!0){const i=this.selectOverlayState(t),n="validation"===i?this.lastChartRect??this.fullContainerRect()??e:e;if(this.overlayElem.toggleClass("ag-charts-dark-overlay",this.overlays.darkTheme),this.overlayElem.setProperty("left",`${n.x}px`),this.overlayElem.setProperty("top",`${n.y}px`),this.overlayElem.setProperty("width",`${n.width}px`),this.overlayElem.setProperty("height",`${n.height}px`),i!==this.overlayState){const e=this.getOverlayFromState(this.overlayState);e&&this.hideOverlay(e,t),this.overlayState=i,this.overlayMounted=!1}const s=this.getOverlayFromState(this.overlayState);if(s){const e="loading"===this.overlayState;!s.enabled||e&&this.overlayMounted?!s.enabled&&this.overlayMounted?(this.hideOverlay(s,t),this.overlayMounted=!1):this.overlayMounted&&s.reposition(n):(this.showOverlay(s,n),this.overlayMounted=!0)}this.overlayElem.setAttr("aria-hidden",String(null==this.overlayState))}selectOverlayState(e){return this.validations.hasVisibleIssues()?"validation":this.dataService.isLoading()?"loading":e?null!=this.lastSeriesRect?this.chartLike.series.some((e=>e.hasData))?this.chartLike.series.some((e=>e.visible&&!wu.has(e.type)))?this.overlays.unsupportedBrowser.enabled&&function(){const{userAgent:e}=(0,n.zkX)("navigator");if(bu.test(e)){const t=vu.exec(e);if(null==t)return!1;const i=Number.parseFloat(t[1]),s=Math.floor(i)>16;return s||n.tDR.warnOnce(`Unsupported Safari version: ${i}; ${e}`),!s}if(Su.test(e)&&!ku.test(e)&&!Du.test(e)){const t=Mu.exec(e);if(null==t)return!1;const i=Number.parseInt(t[1],10),s=i>126;return s||n.tDR.warnOnce(`Unsupported Chrome version: ${i}; ${e}`),!s}return!1}()?"unsupported-browser":void 0:"no-visible-series":"no-data":void 0:"validation"===this.overlayState||"loading"===this.overlayState?void 0:this.overlayState}getOverlayFromState(e){switch(e){case"validation":return this.overlays.validation;case"loading":return this.overlays.loading;case"no-data":return this.overlays.noData;case"no-visible-series":return this.overlays.noVisibleSeries;case"unsupported-browser":return this.overlays.unsupportedBrowser}}showOverlay(e,t){const i=e.getElement(this.chartLike,this.animationManager,this.localeManager,t);this.overlayElem.replaceChildren(i)}hideOverlay(e,t=!0){e.removeElement((()=>{this.overlayElem.innerText="Â "}),t?this.animationManager:void 0)}},Au=n.yar.create(!0,"opts"),Cu=new Set(["interval","autoRotate","autoRotateAngle","itemStyler","minSpacing","rotation"]),Nu=new Set(["top","bottom"]),Lu=new Set(["time","unit-time","ordinal-time"]);function Pu(e,t){const i=t.context;void 0!==i?e.context=i:"context"in e&&delete e.context}var Tu=new Set(["thickness","title","crosshair","depthOptions"]),Ou=["step","values","minSpacing","maxSpacing"];function Ru(e,t){const i={...t,...e};for(const t of Ou)i[t]=e?.[t];return i}function Eu(e){const t=e,i={};for(const e of Object.keys(t))Tu.has(e)||(i[e]=t[e]);return i}function zu(e){return Array.isArray(e)&&0!==e.length?e.map(((e,t)=>0===t?e:(0,n.HFk)({label:{enabled:!1}},e))):[{label:{enabled:!0}}]}var Bu,Fu=(()=>{var e=class e{constructor(e,t){var i,s;this.id=(0,n.sX_)(this),this.seriesRoot=new we({name:`${this.id}-series-root`,zIndex:n.Dcv.SERIES_LAYER}),this.annotationRoot=new we({name:`${this.id}-annotation-root`,zIndex:n.Dcv.SERIES_ANNOTATION}),this.selectionRoot=new we({name:`${this.id}-selection-root`,zIndex:n.Dcv.SERIES_ANNOTATION}),this.titleGroup=new ke({name:"titles",zIndex:n.Dcv.SERIES_LABEL,renderToOffscreenCanvas:!0,optimizeForInfrequentRedraws:!0}),this.sharedCategoryGroup=new yu,this.debug=n.yar.create(!0,"chart"),this.extraDebugStats={},this.pendingDataRetain=void 0,this.loading=void 0,this._firstAutoSize=!0,this._autoSizeNotify=new n.iNx,this._requiredRange=0,this._requiredRangeDirection=n.tv$.X,this.destroyed=!1,this.cleanup=new n._uV,this.chartAnimationPhase="initial",this.modulesManager=new Qc,this.processors=[],this.queuedUserOptions=[],this.queuedChartOptions=[],this.firstApply=!0,this.syncStatus="init",this.apiUpdate=!1,this._pendingFactoryUpdatesCount=0,this._performUpdateSkipAnimations=!1,this._performUpdateNotify=new n.iNx,this.performUpdateType=n.GvF.NONE,this.runningUpdateType=n.GvF.NONE,this.currentProcessingUpdateType=n.GvF.NONE,this.updateShortcutCount=0,this.seriesToUpdate=new Set,this.updateMutex=new Fe,this.clearCallbackCacheOnUpdate=!1,this.updateRequestors={},this.performUpdateTrigger=Ve((({count:e})=>{this.destroyed||this.updateMutex.acquire(this.tryPerformUpdate.bind(this,e)).catch((e=>this.reportAsyncError(e)))})),this._performUpdateSplits={},this._previousSplit=0,this.axes=this.createChartAxes(),this.series=[],this._cachedData=void 0,this.seriesGroupingChanged=e=>{const{series:t,seriesGrouping:i}=e;if(t.contentGroup.isRoot())return;const n=this.seriesLayerManager.changeGroup({internalId:t.internalId,type:t.type,contentGroup:t.contentGroup,bringToFront:()=>t.bringToFront(),renderToOffscreenCanvas:()=>t.renderToOffscreenCanvas(),seriesGrouping:i});null!=n&&t.attachSeries(n,this.seriesRoot,this.annotationRoot)},this.chartOptions=e;const a=t?.scene,o=t?.container??e.processedOptions.container??void 0,r=t?.styleContainer??e.specialOverrides.styleContainer,l=e.specialOverrides.skipCss;a&&(this._firstAutoSize=!1,this._lastAutoSize=[a.width,a.height,a.pixelRatio]);const h=new ke({name:"root"});h.visible=!1,h.append(this.seriesRoot),h.append(this.annotationRoot),h.append(this.selectionRoot),h.append(this.titleGroup);const c=new n.G8T(e.specialOverrides.document,e.specialOverrides.window);this.tooltip=new pu(c),this.seriesLayerManager=new mu(this.seriesRoot);const d=this.ctx=function(e,t){const i=(0,n.Xlx)(),s=new n.bkB,a=new n.vKy;a.setValue("activeItem",void 0),a.setValue("highlight",void 0),a.setValue("legendData",{}),a.setValue("legendVisible",!0);const o=new si(s,t.styleNonce,t.agDocument,t.container,t.styleContainer,t.skipCss,t.domMode,t.cssVariables),r=o.addChild("canvas","scene-canvas",t.scene?.canvas.element),l=t.scene??new Yi({canvasElement:r,pixelRatio:t.agDocument.window.devicePixelRatio??1},t.logger);l.setRoot(t.root),i.ref("logger",t.logger).constant("moduleRegistry",t.moduleRegistry).constant("eventsHub",s).constant("agDocument",t.agDocument).ref("chartService",e).ref("annotationRoot",e.annotationRoot).constant("syncManager",t.syncManager).constant("chartState",a).constant("domManager",o).ref("scene",l),i.service("validations",(e=>new kh(e))).service("callbackCache",(e=>new n.WIG(e.logger))).service("formatManager",(()=>new ut)).service("seriesStateManager",(()=>new dh)).service("stateManager",(e=>new zt(e.logger))).service("labelManager",(()=>new oh)).service("interactionManager",(()=>new ja)).service("optionsGraphService",(e=>new hh(e.logger))).service("chartTypeOriginator",(t=>new Tt(e,t.logger))).service("widgets",(e=>new Ol(e,{withDragInterpretation:t.withDragInterpretation}))).service("axisManager",(e=>new Ui(e.eventsHub,t.root))).service("highlightManager",(e=>new el(e))).service("layoutManager",(e=>new lh(e.eventsHub))).service("localeManager",(e=>new $i(e.eventsHub,e.logger))).service("historyManager",(e=>new Et(e))).service("collapsedManager",(e=>new Jr(e.eventsHub,e.chartService))).service("animationManager",(e=>new Qr(e.agDocument,e.interactionManager,t.updateMutex,e.logger))).service("activeManager",(e=>new Wa(e))).service("proxyInteractionService",(e=>new Bi(e))).service("fontManager",(e=>new Qi(e))).service("tooltipManager",(t=>new Al(t.eventsHub,t.localeManager,t.domManager,e.tooltip))).service("dataService",(t=>new qi(t.eventsHub,e,t.animationManager,t.logger))).service("zoomManager",(e=>new sh(e))),t.scene&&l.setLogger(t.logger);
1for(const e of t.moduleRegistry.listModulesByType(n.nR2.Plugin))e.chartType&&e.chartType!==t.chartType||e.register?.(i);return i}(this,{chartType:this.getChartType(),scene:a,root:h,container:o,styleContainer:r,styleNonce:e.processedOptions.styleNonce,skipCss:l,agDocument:c,domMode:e.optionMetadata.domMode,withDragInterpretation:e.optionMetadata.withDragInterpretation??!0,syncManager:new Rh(this),logger:e.logger,moduleRegistry:e.moduleRegistry,updateMutex:this.updateMutex,cssVariables:e.processedCSSVariables});this.data=Ph.empty(d.logger),d.chartState.setValue("options",e.processedOptions),this.chartCaptions=new Lt(d),this.titleGroup.append(this.title.node),this.titleGroup.append(this.subtitle.node),this.titleGroup.append(this.footnote.node),"sparkline"===e.optionMetadata.presetType&&(d.highlightManager.unhighlightDelay=0,d.tooltipManager.removeDelay=0),this.cleanup.register(d.eventsHub.on("dom:resize",(()=>this.parentResize(d.domManager.containerSize))),d.eventsHub.on("font:load",(()=>{this.title.node.markDirty(),this.subtitle.node.markDirty(),this.footnote.node.markDirty(),this.update(n.GvF.PERFORM_LAYOUT)})),d.eventsHub.on("rtl:change",(()=>{d.scene.setDirection(d.domManager.isRtl),this.update(n.GvF.PERFORM_LAYOUT)})),d.eventsHub.on("chart:request-update",(e=>this.update(e.type,e.opts))),d.scene.on("scene-changed",(()=>this.update(n.GvF.SCENE_RENDER)))),d.scene.setDirection(d.domManager.isRtl),this.overlays=new id,(i=this.overlays.loading).renderer??(i.renderer=()=>function(e,t,i,s){const{animationDuration:a}=Ka.add,o=a*i,r=e.createElement("div",`${Jc}--loading`,{display:"flex",alignItems:"center",justifyContent:"center",flexDirection:"column",height:"100%",boxSizing:"border-box",font:'13px "IBM Plex Sans", -apple-system, "system-ui", "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif',userSelect:"none",animation:`ag-charts-loading ${o}ms linear 50ms both`}),l=e.createElement("span",{width:"45px",height:"40px",backgroundImage:["linear-gradient(#0000 calc(1 * 100% / 6), #ccc 0 calc(3 * 100% / 6), #0000 0), ","linear-gradient(#0000 calc(2 * 100% / 6), #ccc 0 calc(4 * 100% / 6), #0000 0), ","linear-gradient(#0000 calc(3 * 100% / 6), #ccc 0 calc(5 * 100% / 6), #0000 0)"].join(""),backgroundSize:"10px 400%",backgroundRepeat:"no-repeat",animation:"ag-charts-loading-matrix 1s infinite linear"}),h=e.createElement("p",{marginTop:"1em"});h.innerText=t;const c=e.createElement("div",`${Jc}__loading-background`,{position:"absolute",inset:"0",opacity:"0.5",zIndex:"-1"}),d=(0,n.aBg)(s,e);return d.innerText=["@keyframes ag-charts-loading { from { opacity: 0 } to { opacity: 1 } }","@keyframes ag-charts-loading-matrix {","0% { background-position: 0% 0%, 50% 0%, 100% 0%; }","100% { background-position: 0% 100%, 50% 100%, 100% 100%; }","}"].join(" "),r.replaceChildren(d,l,h,c),r}(d.agDocument,this.overlays.loading.getText(d.localeManager),d.animationManager.defaultDuration,d.domManager.styleNonce)),(s=this.overlays.validation).renderer??(s.renderer=()=>rd({agDocument:d.agDocument,localeManager:d.localeManager,grouped:d.validations.getVisibleIssues(),onDismiss:()=>d.validations.dismiss()})),this.processors=[new xu(this,d),new Iu(this,this.overlays,d.eventsHub,d.dataService,d.localeManager,d.animationManager,d.domManager,d.validations)],this.highlight=new Dh,this.container=o;const u=this.getModuleContext();this.background=n.dC9.createBackground?.(u)??new qe(u),this.foreground=n.dC9.createForeground?.(u),this.seriesArea=n.dC9.createSeriesArea?.(u)??new ld(u),d.domManager.setDataBoolean("animating",!1),d.domManager.setDataNumber("animationTimeMs",0),this.seriesAreaManager=new gu(this.initSeriesAreaDependencies()),this.cleanup.register(d.chartState.observe((e=>{const t=e("options","tooltip");null!=t&&this.tooltip.set(t)})),d.chartState.observe((e=>{const t=e("options","highlight");null!=t&&this.highlight.set(t)})),d.chartState.observe((e=>{const t=e("options","seriesArea");null!=t&&this.seriesArea.set(t)})),d.chartState.observe((e=>{const t=e("options","overlays");null!=t&&this.overlays.set(t)}
1)),d.eventsHub.on("validation:change",(()=>{d.validations.hasVisibleIssues()?d.tooltipManager.suppressTooltip("validation-overlay"):d.tooltipManager.unsuppressTooltip("validation-overlay")})),d.layoutManager.registerElement(0,(e=>{e.layoutBox.shrink(d.chartState.getValue("options","padding")),this.chartCaptions.positionCaptions(e)})),d.eventsHub.on("layout:complete",(e=>this.chartCaptions.positionAbsoluteCaptions(e))),d.eventsHub.on("data:load",(e=>{this.pendingDataRetain={snapshot:this.data,requestId:e.requestId},this.data=this.createDataSet(e.data)})),d.eventsHub.on("update:complete",(()=>this.resolveDataRetain())),this.title.registerInteraction(u,"beforebegin"),this.subtitle.registerInteraction(u,"beforebegin"),this.footnote.registerInteraction(u,"afterend"),(()=>this.title.destroy()),(()=>this.subtitle.destroy()),(()=>this.footnote.destroy()),this.ctx.agDocument.attachListener("pagehide",(e=>{e.persisted||this.destroy()})),d.animationManager.addListener("animation-frame",(()=>{this.update(n.GvF.SCENE_RENDER),d.domManager.setDataNumber("animationTimeMs",d.animationManager.getCumulativeAnimationTime())})),d.animationManager.addListener("animation-start",(()=>d.domManager.setDataBoolean("animating",!0))),d.animationManager.addListener("animation-stop",(()=>{d.domManager.setDataBoolean("animating",!1),d.domManager.setDataNumber("animationTimeMs",d.animationManager.getCumulativeAnimationTime())})),d.eventsHub.on("zoom:change-complete",(()=>{const e="initial"===this.chartAnimationPhase;for(const e of this.series)e.animationState?.transition("updateData");if(e)for(const e of this.axes)e.resetAnimation(this.chartAnimationPhase);this.update(n.GvF.PERFORM_LAYOUT,{forceNodeDataRefresh:!0,skipAnimations:!e})}))),this.parentResize(d.domManager.containerSize)}static getInstance(t){return e.chartsInstances.get(t)}get canvasElement(){return this.ctx.scene.canvas.element}download(e,t){this.ctx.scene.download(e,t)}getCanvasDataURL(e){return this.ctx.scene.getDataURL(e)}toSVG(){return this.ctx.scene.toSVG()}get seriesAreaBoundingBox(){return this.seriesAreaManager.bbox}get title(){return this.chartCaptions.title}get subtitle(){return this.chartCaptions.subtitle}get footnote(){return this.chartCaptions.footnote}getOptions(){return this.queuedUserOptions.at(-1)??this.chartOptions.userOptions}getChartOptions(){return this.queuedChartOptions.at(-1)??this.chartOptions}isDataTransactionSupported(){return!0}createDataSet(e){const t=this.ctx.chartState.getValue("options","dataIdKey");return Oh(this.ctx.dataSelectionService,this.data,e,t,this.ctx.logger)}resolveDataRetain(){const e=this.pendingDataRetain;if(null==e)return;this.pendingDataRetain=void 0;const t=this.series.some((e=>e.hasData));this.ctx.eventsHub.emit("data:render-verdict",{requestId:e.requestId,rendered:t}),t||(this.data=e.snapshot,this.ctx.eventsHub.emit("chart:request-update",{type:n.GvF.UPDATE_DATA,opts:{forceNodeDataRefresh:!0}}))}overrideFocusVisible(e){this.seriesAreaManager.focusIndicator?.overrideFocusVisible(e)}get listeners(){return this.ctx.chartState.getValue("options","listeners")??{}}callListener(e){const t=this.listeners[e.type];t&&(0,n.cVk)(this,t,e)}initSeriesAreaDependencies(){const{ctx:e,tooltip:t,highlight:i,overlays:n,seriesRoot:s}=this;return{hasViewportSupport:()=>this.hasViewportSupport(),hasPgUpPgDownSupport:()=>this.hasPgUpPgDownSupport(),getUpdateType:()=>this.performUpdateType,getTooltipContent:(e,t,i,n)=>this.getTooltipContent(e,t,i,n),chartType:this.getChartType(),ctx:e,tooltip:t,highlight:i,overlays:n,seriesRoot:s}}getModuleContext(){return this.ctx}getTooltipContent(e,t,i,n){const s="aria-label"===n||!1!==e.properties.tooltip.enabled?e.getTooltipContent(t,i):void 0,a=null==s?[]:[s];if("shared"!==this.tooltip.mode||1===this.series.length)return a;const o=this.sharedCategoryGroup.get(this.series,e,t);return 0===o.size?a:this.series.flatMap((t=>{if(t===e)return a;
1if(!1===t.properties.tooltip.enabled)return[];const i=o.get(t),n=null==i?void 0:t.getTooltipContent(i,void 0);return null==n?[]:[n]}))}getSharedHighlightMatch(e,t,i){return this.sharedCategoryGroup.get(this.series,e,t).get(i)}getCaptionText(){return[this.title,this.subtitle,this.footnote].filter((e=>e.enabled&&e.text)).map((e=>e.text)).join(". ")}getAriaLabel(){return this.ctx.localeManager.t("ariaAnnounceChart",{seriesCount:this.series.length})}refreshSeriesUserVisibility(e,t){for(let i=0;i<this.series.length;i++){const n=this.series[i],s=e.processedOptions.series?.[i];(t.identifiers.has(n.id)||t.indices.has(i))&&void 0!==s&&"visible"in s&&(s.visible=n.visible)}}getSelection(){return this.modulesManager.selection()?.getSelection()}setSelection(e){return this.modulesManager.selection()?.setSelection(e)}clearSelection(){return this.modulesManager.selection()?.clearSelection()}resetAnimations(){this.chartAnimationPhase="initial";for(const e of this.series)e.resetAnimation(this.chartAnimationPhase);for(const e of this.axes)e.resetAnimation(this.chartAnimationPhase);this.animationRect=void 0,this.ctx.animationManager.reset()}skipAnimations(){this.ctx.animationManager.skipCurrentBatch(),this._performUpdateSkipAnimations=!0}detachAndClear(){this.container=void 0,this.ctx.scene.clearCanvas()}setRequestRefreshListener(e){this.requestRefreshListener&&this.ctx.eventsHub.off("chart:request-refresh",this.requestRefreshListener),this.ctx.eventsHub.on("chart:request-refresh",e),this.requestRefreshListener=e}destroy(e){if(this.destroyed)return;this.destroyed=!0;const t=e?.keepTransferableResources;let i;return t&&(this.ctx.scene.strip(),this.ctx.domManager.detachFromContainer(),i={container:this.container,scene:this.ctx.scene}),this.updateMutex.acquire((()=>this.performTeardown(!!t))).catch((e=>this.reportAsyncError(e))),i}performTeardown(e){this.performUpdateType=n.GvF.NONE,this.cleanup.flush();for(const e of this.processors)e.destroy();this.overlays.destroy(),this.modulesManager.destroy(),this.background.destroy(),this.foreground?.destroy(),this.seriesArea.destroy(),e||(this.ctx.scene.destroy(),this.container=void 0),this.destroySeries(this.series),this.seriesLayerManager.destroy(),this.axes.destroy(),this.animationRect=void 0,this.ctx.destroy(),Object.freeze(this)}requestFactoryUpdate(e){this.destroyed||(this._pendingFactoryUpdatesCount++,this.updateMutex.acquire((async()=>{if(!this.destroyed)try{await e(this)}finally{this.destroyed||this._pendingFactoryUpdatesCount--}})).catch((e=>this.reportAsyncError(e))))}clearCallbackCache(){this.ctx.callbackCache.invalidateCache();for(const e of this.series)e.resetDatumCallbackCache()}update(e=n.GvF.FULL,t){if(this.destroyed)return;const{forceNodeDataRefresh:i=!1,skipAnimations:s,seriesToUpdate:a=this.series,newAnimationBatch:o,apiUpdate:r=!1,clearCallbackCache:l=!1}=t??{};if(this.apiUpdate=r,this.ctx.widgets.seriesWidget.setDragTouchEnabled("none"!==this.ctx.chartState.getValue("options","touch").dragAction),i)for(const e of this.series)e.markNodeDataDirty();for(const e of a)this.seriesToUpdate.add(e);if(s&&(this.ctx.animationManager.skipCurrentBatch(),this._performUpdateSkipAnimations=!0),o&&this.ctx.animationManager.isActive()&&(this._performUpdateSkipAnimations=!0),(e===n.GvF.FULL||l)&&(this.clearCallbackCacheOnUpdate=!0),this.debug.check()){let t=new Error("Stack trace for update tracking").stack??"<unknown>";t=t.replaceAll(/\([^)]*/g,""),this.updateRequestors[t]=e,this.currentProcessingUpdateType!==n.GvF.NONE&&this.currentProcessingUpdateType>=e&&this.debug.group(`Chart.update() - â ï¸ received update for earlier update stage ${n.GvF[e]} â ï¸`,(()=>{this.debug(`Current processing update type: ${n.GvF[this.currentProcessingUpdateType]}`),this.debug("Update from: ",t)}))}e<this.performUpdateType&&(this.performUpdateType=e,this.ctx.domManager.setDataBoolean("updatePending",!0),this.performUpdateTrigger.schedule(t?.backOffMs))}updateSplits(e){const t=this._performUpdateSplits;t[e]??(t[e]=0),t[e]+=performance.now()-this._previousSplit,this._previousSplit=performance.now()}async tryPerformUpdate(e){const t=this.clearCallbackCacheOnUpdate&&this.performUpdateType<=n.GvF.PROCESS_DATA;this.ctx.validations.beginPass("update");let i=!1;this.pendingFailFastError=void 0;try{const s=`${n.GvF[this.performUpdateType]} ${this.updateShortcutCount>0?"â ï¸ redo #"+this.updateShortcutCount+" â ï¸ ":""}`;await this.debug.group(`Chart.performUpdate() ${s}`,(async()=>{await this.performUpdate(e)})),i=t&&0===this.updateShortcutCount}catch(e){this.reportAsyncError(e),this.runningUpdateType=n.GvF.NONE,this._performUpdateNotify.notify()}finally{this.ctx.validations.endPass("update",i)}}reportAsyncError(e){if(e instanceof ze)this.pendingFailFastError=e;else try{this.ctx.logger.error(e)}catch(e){if(!(e instanceof ze))throw e;this.pendingFailFastError=e}}takeFailFastError(){const e=this.pendingFailFastError;return this.pendingFailFastError=void 0,e}async performUpdate(e){const{performUpdateType:t,extraDebugStats:i,_performUpdateSplits:s,ctx:a}=this,o=[...this.seriesToUpdate];switch(this.clearCallbackCacheOnUpdate&&(this.clearCallbackCacheOnUpdate=!1,this.clearCallbackCache()),this.sharedCategoryGroup.invalidate(),this.performUpdateType=n.GvF.NONE,this.seriesToUpdate.clear(),this.runningUpdateType=t,this.currentProcessingUpdateType=t,a.chartState.flushChanges(),0===this.updateShortcutCount&&t<n.GvF.SCENE_RENDER&&(a.animationManager.startBatch(this._performUpdateSkipAnimations),a.animationManager.onBatchStop((()=>this.chartAnimationPhase="ready"))),this.ctx.scene.updateDebugFlags(),this.debug("Chart.performUpdate() - start",n.GvF[t]),this._previousSplit=performance.now(),s.start??(s.start=this._previousSplit),a.domManager.setDeferring(!0),t){case n.GvF.FULL:if(this.checkUpdateShortcut(n.GvF.FULL))break;this.ctx.eventsHub.emit("update:pre-dom",null),this.updateDOM();case n.GvF.UPDATE_DATA:if(this.checkUpdateShortcut(n.GvF.UPDATE_DATA))break;this.updateData(),this.updateSplits("â¬ï¸");case n.GvF.PROCESS_DATA:if(this.checkUpdateShortcut(n.GvF.PROCESS_DATA))break;await this.processData(),this.seriesAreaManager.dataChanged(),this.updateSplits("ð");case n.GvF.PROCESS_DOMAIN:if(this.checkUpdateShortcut(n.GvF.PROCESS_DOMAIN))break;await this.processDomains(),this.updateSplits("â°ï¸");case n.GvF.PROCESS_RANGE:if(this.checkUpdateShortcut(n.GvF.PROCESS_RANGE))break;this.processRanges(),this.updateSplits("ð");case n.GvF.PERFORM_LAYOUT:if(await this.checkFirstAutoSize(),a.domManager.setThemeParameters(this.chartOptions.themeParameters),this.checkUpdateShortcut(n.GvF.PERFORM_LAYOUT))break;a.chartState.flushChanges("legendData"),await this.processLayout(),this.updateSplits("â");case n.GvF.PRE_SERIES_UPDATE:if(this.checkUpdateShortcut(n.GvF.PRE_SERIES_UPDATE))break;this.preSeriesUpdate(),this.updateSplits("â");case n.GvF.SERIES_UPDATE:if(this.checkUpdateShortcut(n.GvF.SERIES_UPDATE))break;this.seriesRoot.renderToOffscreenCanvas="cutout"===this.highlight.drawingMode,await this.updateSeries(o),this.updateAriaLabels(),this.seriesLayerManager.updateLayerCompositing(
1),this.updateSplits("ð¤");case n.GvF.PRE_SCENE_RENDER:if(this.checkUpdateShortcut(n.GvF.PRE_SCENE_RENDER))break;a.eventsHub.emit("update:pre-scene-render",{apiUpdate:this.apiUpdate}),a.scene.updateBaseFont(),this.updateSplits("â");case n.GvF.SCENE_RENDER:if(this.checkUpdateShortcut(n.GvF.SCENE_RENDER))break;a.animationManager.endBatch(),i.updateShortcutCount=this.updateShortcutCount,a.scene.render({debugSplitTimes:s,extraDebugStats:i,seriesRect:this.seriesRect,debugColors:n.yar.check("scene:stats","scene:stats:verbose")?this.getDebugColors():void 0}),this.extraDebugStats={};for(const e of Object.keys(s))delete s[e];this.ctx.domManager.incrementDataCounter("sceneRenders");case n.GvF.NONE:this.updateShortcutCount=0,this.updateRequestors={},this.currentProcessingUpdateType=n.GvF.NONE,this._performUpdateSkipAnimations=!1,a.animationManager.endBatch()}this.destroyed||(a.eventsHub.emit("update:complete",{apiUpdate:this.apiUpdate,wasShortcut:this.updateShortcutCount>0}),this.apiUpdate=!1,this.ctx.domManager.setDataBoolean("updatePending",!1),this.runningUpdateType=n.GvF.NONE,this.syncStatus="ready"),this._performUpdateNotify.notify(),a.domManager.setDeferring(!1);const r=performance.now();this.debug("Chart.performUpdate() - end",{chart:this,durationMs:(0,n.GBz)(r-s.start),count:e,performUpdateType:n.GvF[t]})}updateThemeClassName(){const e="ag-charts-theme-",t=[`${e}default`,`${e}default-dark`];let i=t[0],n=!1,{theme:s}=this.chartOptions.processedOptions;for(;"string"!=typeof s&&null!=s;)s=s.baseTheme;"string"==typeof s&&(i=s.replace("ag-",e),n=s.includes("-dark")),t.includes(i)||(i=n?t[1]:t[0]),this.ctx.domManager.setThemeClass(i)}updateDOM(){this.updateThemeClassName();const{enabled:e,tabIndex:t}=this.ctx.chartState.getValue("options","keyboard");this.ctx.domManager.setTabGuardIndex(e?t??0:-1)}updateAriaLabels(){this.ctx.domManager.updateCanvasLabel(this.getAriaLabel())}checkUpdateShortcut(e){return!!this.destroyed||(this.updateShortcutCount>3?(this.ctx.logger.warn("exceeded the maximum number of simultaneous updates (4), discarding changes and rendering",this.updateRequestors),!1):this.performUpdateType<=e?(this.debug("Chart.checkUpdateShortcut() - BLOCKED AT: ",n.GvF[e]," BY REQUEST FOR: ",n.GvF[this.performUpdateType]),this.updateShortcutCount++,!0):(this.debug("Chart.checkUpdateShortcut() - PROCEEDING TO: ",n.GvF[e]),this.currentProcessingUpdateType=e,!1))}async checkFirstAutoSize(){if(null!=this.width&&null!=this.height);else if(!this._lastAutoSize){await this._autoSizeNotify.waitForCompletion(500)||this.debug("Chart.checkFirstAutoSize() - timeout for first size update.")}}createChartAxes(){return new Qe}onAxisChange(e,t){null==t&&0===e.length||this.ctx.axisManager.updateAxes(t??[],e)}onSeriesChange(e,t){const i=t?.filter((t=>!e.includes(t)))??[];this.destroySeries(i),this.seriesLayerManager?.setSeriesCount(e.length);for(const i of e){if(t?.includes(i))continue;const e=this.seriesLayerManager.requestGroup(i);i.attachSeries(e,this.seriesRoot,this.annotationRoot),i.chart={},Object.defineProperty(i.chart,"mode",{get:()=>this.ctx.chartState.getValue("options","mode")}),Object.defineProperty(i.chart,"isMiniChart",{get:()=>!1}),Object.defineProperty(i.chart,"flashOnUpdateEnabled",{get:()=>!!this.modulesManager.getModule("flashOnUpdate")?.enabled}),Object.defineProperty(i.chart,"seriesRect",{get:()=>this.seriesRect}),Object.defineProperty(i.chart,"seriesAreaPadding",{get:()=>this.seriesArea?.getPadding()}),i.resetAnimation(this.chartAnimationPhase),i.events.on("grouping-changed",this.seriesGroupingChanged)}this.seriesAreaManager?.seriesChanged(e)}destroySeries(e){if(e)for(const t of e)t.destroy(),this.seriesLayerManager.releaseGroup(t),t.detachSeries(void 0,this.seriesRoot,this.annotationRoot),t.chart=void 0}assignSeriesToAxes(){for(const e of this.axes){let t=function(t){return t.axes[e.direction]===e};e.boundSeries=this.series.filter(t)}}assignAxesToSeries(){for(const e of this.series)for(const t of e.directions){const i=e.getKeyAxis(t)??t,n=this.axes.findById(i);if(!n)return void this.ctx.logger.warnOnce(`no matching axis for direction [${t}] and id [${i}]; check series and axes configuration.`);e.axes[t]=n}}parentResize(e){if(this.destroyed||null==e||null!=this.width&&null!=this.height)return;let{width:t,height:i}=e;const{pixelRatio:n}=e;if(t=Math.floor(t),i=Math.floor(i),0===t&&0===i)return;const[s=0,a=0,o=1]=this._lastAutoSize??[];s===t&&a===i&&o===n||(this._lastAutoSize=[t,i,n],this.resize("SizeMonitor",{}))}resize(e,t){const{scene:i,animationManager:s}=this.ctx,{inWidth:a,inHeight:o,inMinWidth:r,inMinHeight:l,inOverrideDevicePixelRatio:h}=t;this.ctx.domManager.setSizeOptions(r??this.minWidth,l??this.minHeight,a??this.width,o??this.height);const c=a??this.width??this._lastAutoSize?.[0],d=o??this.height??this._lastAutoSize?.[1],u=h??this.overrideDevicePixelRatio??this._lastAutoSize?.[2];if(this.debug(`Chart.resize() from ${e}`,{width:c,height:d,pixelRatio:u,stack:new Error("Stack trace for resize tracking").stack}),null!=c&&null!=d&&(0,n.BfI)(c)&&(0,n.BfI)(d)&&i.resize(c,d,u)){s.reset(),this.ctx.eventsHub.emit("canvas:resize",{width:i.width,height:i.height});let e=!0;null!=this.width&&null!=this.height||!this._firstAutoSize?"initial"===this.chartAnimationPhase&&(e=!1):(e=!1,this._firstAutoSize=!1);let t=n.GvF.PERFORM_LAYOUT;for(const e of this.axes){const i=e.getUpdateTypeOnResize();i<t&&(t=i)}
1this.update(t,{forceNodeDataRefresh:!0,skipAnimations:e}),this._autoSizeNotify.notify()}}updateData(){this.ctx.eventsHub.emit("data:update",this.data)}async processData(){this.series.some((e=>e.canHaveAxes))&&(this.assignAxesToSeries(),this.assignSeriesToAxes());const e=new Lh(this.ctx.chartState.getValue("options","mode"),this.ctx.chartState.getValue("options","suppressFieldDotNotation"),this.ctx.eventsHub,this.ctx.logger),t=[];this.ctx.validations.beginPass("data");let i=!1;try{for(const i of this.series)t.push(i.processData(e)??Promise.resolve());for(const i of this.modulesManager.modules())i?.processData&&t.push(i.processData(e)??Promise.resolve());this._cachedData=e.execute(this._cachedData,this.ctx.dataSelectionService),i=!e.reprocessedIncrementally}finally{this.ctx.validations.endPass("data",i)}this.updateSplits("ð"),await Promise.all(t),this.updateLegends()}async processDomains(){for(const e of this.axes)e.processData();for(const e of this.series)e.updatedDomains()}processRanges(){var e;const t={},i={},s=new Map;this._requiredRangeDirection=n.tv$.X;for(const i of this.series)i.visible&&(t[e=i.type]??(t[e]=[]),i.getMinimumRangeSeries(t[i.type]),i.resolveKeyDirection(n.tv$.X)===n.tv$.Y&&(this._requiredRangeDirection=n.tv$.Y),s.has(i.type)||s.set(i.type,i));for(const[e,n]of s)i[e]=n.getMinimumRangeChart(t[e]);0===Object.keys(i).length?this._requiredRange=0:this._requiredRange=Math.ceil(Math.max(...Object.values(i)));for(const e of this.axes)e.requiredRange=this._requiredRange}updateLegends(e){for(const t of this.ctx.moduleRegistry.listModulesByType(n.nR2.Plugin))switch(t.name){case"legend":this.setCategoryLegendData(e);break;case"gradientLegend":this.modulesManager.getModule("gradientLegend").data=this.series.filter((e=>e.properties.showInLegend)).flatMap((e=>e.getLegendData("gradient")))}}setCategoryLegendData(e){const{legendManager:t,stateManager:i}=this.ctx;if(e)for(const t of this.series){const i=e.find((e=>e.seriesId===t.id));t.onLegendInitialState("category",i)}const s=this.series.flatMap((e=>{const i=e.getLegendData("category");return t?.updateData(e.id,i),i}));if(e&&t)i.setStateAndRestore(t,e);else if("integrated"!==this.ctx.chartState.getValue("options","mode")){const e={},t=new Map(this.series.map((e=>[e.id,e])));for(const{seriesId:i,symbol:{marker:a},label:o}of s.filter((e=>!e.hideInLegend))){if(null==a.fill)continue;const s=t.get(i);if(!s?.hasData)continue;const r=s.type,l=e[r]??(e[r]=new Map);l.has(o.text)?l.get(o.text)!==a.fill&&this.ctx.logger.warnOnce(`legend item '${(0,n.boc)(o.text)}' has multiple fill colours, this may cause unexpected behaviour.`):l.set(o.text,a.fill)}}}async processLayout(){const e=this.animationRect,{width:t,height:i}=this.ctx.scene,n=this.ctx.layoutManager.createContext(t,i);await this.performLayout(n),e&&!this.animationRect?.equals(e)&&this.ctx.animationManager.skipCurrentBatch(),this.debug("Chart.performUpdate() - seriesRect",this.seriesRect)}getDebugColors(){const e=this.ctx.chartState.getValue("options","background").fill;if(e)try{const t=n.Q1f.fromString(e),[i]=n.Q1f.RGBtoOKLCH(t.r,t.g,t.b);return{background:e,foreground:i>.5?"black":"white"}}catch{return{background:e}}}preSeriesUpdate(){const{_requiredRange:e,seriesRect:t}=this;if(null==t)return;const i=e/(this._requiredRangeDirection===n.tv$.X?t.width:t.height)||0;this.ctx.eventsHub.emit("update:pre-series",{requiredRangeRatio:i,requiredRangeDirection:this._requiredRangeDirection,requiredRange:e})}async updateSeries(e){const{seriesRect:t}=this;await Promise.all(e.map((function(e){return e.update({seriesRect:t})})).filter((e=>null!=e))),this.ctx.labelManager.updateLabels(this.series.filter((e=>e.visible)),this.ctx.chartState.getValue("options","padding"),this.seriesRect)}async waitForUpdate(e,t){const i=(0,n.zkX)("agChartsDebugTimeout");null==i?(e??(e=1e4),t??(t=!1)):(e=i,t??(t=!0));const s=performance.now();for(;(this._pendingFactoryUpdatesCount>0||this.performUpdateType!==n.GvF.NONE||this.runningUpdateType!==n.GvF.NONE||this.ctx.scene.waitingForUpdate()||this.data.hasPendingTransactions())&&!this.destroyed;
1){if(this._pendingFactoryUpdatesCount>0&&await this.updateMutex.waitForClearAcquireQueue(),(this.performUpdateType!==n.GvF.NONE||this.runningUpdateType!==n.GvF.NONE||this.data.hasPendingTransactions())&&await this._performUpdateNotify.waitForCompletion(),performance.now()-s>e){const i=`Chart.waitForUpdate() timeout of ${e} reached - first chart update taking too long.`;if(t)throw new Error(i);this.ctx.logger.warnOnce(i)}(0,n.UWw)()&&await(0,n.v7K)(),this.ctx.scene.waitingForUpdate()&&await(0,n.v7K)(50)}}filterMiniChartSeries(e){return e?.filter((e=>!1!==e.showInMiniChart))}applyOptions(e){e.revalidated&&this.ctx.validations.beginCycle(e.issues,e.validations),e.seriesWithUserVisibility&&this.refreshSeriesUserVisibility(this.chartOptions,e.seriesWithUserVisibility);const t=n.GvF.PERFORM_LAYOUT,i=this.firstApply?e.processedOptions:e.diffOptions(this.chartOptions);if(null==i||0===Object.keys(i).length)return Au("Chart.applyOptions() - no delta, forcing re-layout",i),this.chartOptions=e,void this.update(t,{apiUpdate:!0,newAnimationBatch:!0});const s=this.firstApply?{}:this.chartOptions.processedOptions,a=e.processedOptions;Au("Chart.applyOptions() - applying delta",i),this.ctx.chartState.setValue("options",e.processedOptions);const o=this.applyModules();"enableRtl"in i&&this.ctx.domManager.setEnableRtl(i.enableRtl),"container"in i&&(this.container=i.container??void 0),"height"in i&&(this.height=i.height),"minHeight"in i&&(this.minHeight=i.minHeight),"minWidth"in i&&(this.minWidth=i.minWidth),"overrideDevicePixelRatio"in i&&(this.overrideDevicePixelRatio=i.overrideDevicePixelRatio),"width"in i&&(this.width=i.width),"loading"in i&&(this.loading=i.loading),"context"in i&&(this.context=i.context);let r=!1,l="no-op";null!=i.series&&(l=this.applySeries(this,i.series,s?.series),r=!0),"replaced"===l&&this.resetAnimations(),this.applyAxes(this,a,l)&&(r=!0),this.seriesArea.applyOptions();const{userDeltaKeys:h}=e,c=void 0===h||h.has("data");let d=!1;if(i.data&&c){const t=i.data,n=e.userOptions.data,s=Array.isArray(t)&&t!==n?t.slice():t;this.data=this.createDataSet(s),d=!0}!("dataIdKey"in i)||i.data&&c||this.data.dataIdKey===this.ctx.chartState.getValue("options","dataIdKey")||(this.data=this.createDataSet(this.data.data),d=!0),"replaced"!==l||d||(this.data=this.createDataSet(this.data.data)),this.chartOptions=e;const u=this.modulesManager.getModule("navigator");this.hasViewportSupport()||this.ctx.zoomManager?.updateZoom({source:"chart-update",sourceDetail:"internal-applyOptions"},{x:{min:0,max:1},y:{min:0,max:1}});const p=u?.miniChart,g=a.navigator?.miniChart?.series??a.series;!0===p?.enabled&&null!=g?this.applyMiniChartOptions(p,g,a,s):!1===p?.enabled&&(p.series=[],p.axes=[]),this.ctx.annotationManager?.setAnnotationStyles(e.annotationThemes),r||(r=this.shouldForceNodeDataRefresh(i,l));const m=r||o?n.GvF.FULL:t;if(this.maybeResetAnimations(l),this.shouldClearLegendData(a,s,l)&&this.ctx.legendManager?.clearData(),this.applyInitialState(a),this.ctx.formatManager.setFormatter(a.formatter),Au("Chart.applyOptions() - update type",n.GvF[m],{seriesStatus:l,forceNodeDataRefresh:r}),void 0!==e.optionsProcessingTime){this._performUpdateSplits["âï¸"]=e.optionsProcessingTime;const t=performance.now()-e.optionsProcessingTime;this._performUpdateSplits.start=t}this.update(m,{apiUpdate:!0,forceNodeDataRefresh:r,newAnimationBatch:!0,clearCallbackCache:!0}),this.firstApply=!1}applyInitialState(e){const{activeManager:t,annotationManager:i,chartTypeOriginator:s,historyManager:a,stateManager:o,zoomManager:r}=this.ctx,{initialState:l}=e;if("annotations"in e&&e.annotations?.enabled&&null!=l?.annotations&&i){const e=l.annotations.map((e=>{const t=i.getAnnotationTypeStyles(e.type);return(0,n.HFk)(e,t)}));o.setState(i,e)}if(null!=l?.chartType&&o.setState(s,l.chartType),this.needsViewportSupport(e)&&null!=l?.zoom&&r&&o.setState(r,l.zoom),null!=l?.active&&o.setState(t,l.active),null!=l?.collapsed&&o.setState(this.ctx.collapsedManager,l.collapsed),null!=l?.legend&&this.updateLegends(l.legend),null!=l?.legendPagination){const e=Eh(this.modulesManager.legends());e&&o.setState(new zh(e),l.legendPagination)}null!=l&&a.clear()}maybeResetAnimations(e){if("standalone"===this.ctx.chartState.getValue("options","mode"))switch(e){case"series-grouping-change":case"replaced":this.resetAnimations()}}shouldForceNodeDataRefresh(e,t){const i=!!e.data||"data-change"===t||"replaced"===t,n=["legend","gradientLegend"].some((t=>
1null!=e[t])),s=null!=e.title&&null!=e.subtitle||null!=e.formatter;return i||n||s}shouldClearLegendData(e,t,i){const n="replaced"===i||"series-count-changed"===i||"series-grouping-change"===i||"updated"===i&&(e.series?.length!==t.series?.length||!e.series?.every(((e,i)=>e.type===t.series?.[i].type))),s=null!=t.legend&&!1!==t.legend.enabled&&(null==e.legend||!1===e.legend.enabled);return n||s}applyMiniChartOptions(e,t,i,s){const a=s?.navigator?.miniChart?.series??s?.series,o=this.applySeries(e,this.filterMiniChartSeries(t),this.filterMiniChartSeries(a)),r=function(e){const t=e.axes;if(null==t)return e;const i=e.navigator?.miniChart?.label,s={};for(const e of Object.keys(i??{}))Cu.has(e)||(s[e]=i[e]);const a=i?.interval,o={};for(const[e,i]of(0,n.jOZ)(t)){const t=Nu.has(i.position??""),r=t&&"grouped-category"===i.type,l=t?s:{},h=t?{enabled:!r,...r?{rotation:0}:{}}:{enabled:!1},c=t?{enabled:!1}:void 0,d=t&&Lu.has(i.type??"")?{enabled:!1}:void 0,u=i.depthOptions,p=r?zu(u):void 0,g={...Eu(i),label:(0,n.HFk)(h,l,i.label),gridLine:(0,n.HFk)({enabled:!1},i.gridLine),tick:(0,n.HFk)({enabled:!1},i.tick),line:(0,n.HFk)(c,i.line),interval:t?Ru(a,i.interval):i.interval,title:{enabled:!1}};if(null!=d){const e=i.parentLevel;g.parentLevel=(0,n.HFk)(d,e)}null!=p&&(g.depthOptions=p),o[e]=g}return{...e,axes:o}}(i);this.applyAxes(e,r,o);const l=e.series;for(const e of l)e.properties.id=void 0;const h=e.axes,c=this.series.some((e=>e.visible&&e.resolveKeyDirection(n.tv$.X)===n.tv$.Y))?n.tv$.Y:n.tv$.X,d=this.axes.find((e=>e.direction===c));for(const e of h)e.nice=e.direction===c&&(d?.nice??!0),e.interactionEnabled=!1}applyModules(){const{type:e}=this.constructor;let t=!1;for(const i of this.ctx.moduleRegistry.listModulesByType(n.nR2.Plugin)){const n=!i.chartType||i.chartType===e;if(n!==this.modulesManager.isEnabled(i.name)){if(n){i.register?.(this.getModuleContext());const e=i.create(this.getModuleContext());this.modulesManager.addModule(i.name,e)}else this.modulesManager.removeModule(i.name);t=!0}}return t}initSeriesDeclarationOrder(e){for(let t=0;t<e.length;t++)e[t].setSeriesIndex(t)}applySeries(e,t,i){if(!t)return"no-change";const n=Zc(e.series,t,i,this.ctx.moduleRegistry);if("no-overlap"===n.status){Au(`Chart.applySeries() - creating new series instances, status: ${n.status}`,n);const i=t.map((e=>this.createSeries(e)));return this.initSeriesDeclarationOrder(i),e.series=i,"replaced"}Au("Chart.applySeries() - matchResult",n);const s=[];let a=!1,o=!1,r=!1,l=!1;const h=n.changes.toSorted(((e,t)=>e.targetIdx-t.targetIdx));for(const e of h)switch(o||(o="series-grouping"===e.status),a||(a=null!=e.diff?.data),r||(r="no-op"!==e.status),l||(l="add"===e.status||"remove"===e.status),e.status){case"add":{const t=this.createSeries(e.opts);s.push(t),Au("Chart.applySeries() - created new series",t);break}case"remove":Au(`Chart.applySeries() - removing series at previous idx ${e.idx}`,e.series);break;case"no-op":s.push(e.series),Au(`Chart.applySeries() - no change to series at previous idx ${e.idx}`,e.series);break;default:{const{series:t,diff:i,idx:n}=e;Au(`Chart.applySeries() - applying series diff previous idx ${n}`,i,t),this.applySeriesValues(t,i),t.markNodeDataDirty(),s.push(t)}}return this.initSeriesDeclarationOrder(s),Au("Chart.applySeries() - final series instances",s),e.series=s,o?"series-grouping-change":l?"series-count-changed":a?"data-change":r?"updated":"no-op"}applyAxes(e,t,i){if(!("axes"in t)||!t.axes)return!1;const n=t.axes;if(!("replaced"===i)&&e.axes.matches(n))for(const t of e.axes){const e=n[t.id];t.applyOptions(e),Pu(t,e),this.applyAxisModules(t,e)}else Au(`Chart.applyAxes() - creating new axes instances; seriesStatus: ${i}`),e.axes=this.createAxes(n);const{unmappedAxisKeys:s,optionMetadata:a}=this.chartOptions,o="sparkline"!==a.presetType;for(const t of e.axes)t.userKey=s.get(t.id)??t.id,t.setPickComputationEnabled(o);return!0}createSeries(e){const t=this.ctx.moduleRegistry.getSeriesModule(e.type).create(this.getModuleContext());return this.applySeriesOptionModules(t,e),this.applySeriesValues(t,e),t}applySeriesOptionModules(e,t){const i=e.createModuleContext(),s=e.getModuleMap();
1for(const a of this.ctx.moduleRegistry.listModulesByType(n.nR2.SeriesPlugin))a.name in t&&(a.seriesTypes?.includes(e.type)??1)&&s.addModule(a.name,a.create(i))}applySeriesValues(e,t){const i=e.getModuleMap(),{type:s,data:a,seriesGrouping:o,showInMiniChart:r,...l}=t;for(const e of this.ctx.moduleRegistry.listModulesByType(n.nR2.SeriesPlugin))if(e.name in l){const t=i.getModule(e.name);if(t){const i=l[e.name];t.properties.set(i),delete l[e.name]}}null!=l.visible&&(e.visible=l.visible),e.properties.set(l),"data"in t&&e.setOptionsData(null==a?void 0:Ph.wrap(a,this.ctx.logger)),"seriesGrouping"in t&&(e.seriesGrouping=null==o?void 0:{...e.seriesGrouping,...o})}createAxes(e){const t=this.createChartAxes(),i=this.getModuleContext();for(const[s,a]of(0,n.jOZ)(e)){const e=this.ctx.moduleRegistry.getAxisModule(a.type).create(i,s,a);this.applyAxisModules(e,a),t.push(e)}return function(e){const t=[],i=[],n=[...Uc];for(const n of e)n instanceof Yc&&("string"==typeof(s=n.position)&&Uc.includes(s)?i.push(n.position):t.push(n));var s;for(const e of t){let t;do{t=n.pop()}while(t&&i.includes(t));if(null==t)break;e.position=t}}(t),t}applyAxisModules(e,t){const i=e.createModuleContext(),s=e.getModuleMap(),{type:a}=this.constructor;for(const e of this.ctx.moduleRegistry.listModulesByType(n.nR2.AxisPlugin)){if(e.chartType&&e.chartType!==a)continue;const n=t[e.optionsKey??e.name],o=null!=n,r=s.isEnabled(e.name);if(!o){r&&s.removeModule(e.name);continue}r||(e.register?.(i),s.addModule(e.name,e.create(i)));s.getModule(e.name).applyOptions(n)}}async applyTransaction(e){await this.updateMutex.acquire((()=>{this.data.addTransaction(e),this.update(n.GvF.UPDATE_DATA,{apiUpdate:!0,skipAnimations:!0})})),await this.waitForUpdate()}onSyncActiveClear(){this.seriesAreaManager.onActiveClear()}needsViewportSupport(e){return!!e.navigator?.enabled||!!e.zoom?.enabled||!!e.scrollbar?.enabled}hasViewportSupport(){return this.needsViewportSupport({navigator:this.modulesManager.getModule("navigator"),zoom:this.modulesManager.getModule("zoom"),scrollbar:this.modulesManager.getModule("scrollbar")})}hasPgUpPgDownSupport(){return!0}};return e.className="Chart",e.chartsInstances=new WeakMap,d([(0,n.mBh)({newValue(t){this.destroyed||(this.ctx.domManager.setContainer(t),e.chartsInstances.set(t,this))},oldValue(t){e.chartsInstances.delete(t)}})],e.prototype,"container",2),d([(0,n.mBh)({newValue(e){this.resize("width option",{inWidth:e})}})],e.prototype,"width",2),d([(0,n.mBh)({newValue(e){this.resize("height option",{inHeight:e})}})],e.prototype,"height",2),d([(0,n.mBh)({newValue(e){this.resize("minWidth option",{inMinWidth:e})}})],e.prototype,"minWidth",2),d([(0,n.mBh)({newValue(e){this.resize("minHeight option",{inMinHeight:e})}})],e.prototype,"minHeight",2),d([(0,n.mBh)({newValue(e){this.resize("overrideDevicePixelRatio option",{inOverrideDevicePixelRatio:e})}})],e.prototype,"overrideDevicePixelRatio",2),d([(0,n.mBh)({changeValue(e,t){this.onAxisChange(e,t)}})],e.prototype,"axes",2),d([(0,n.mBh)({changeValue(e,t){this.onSeriesChange(e,t)}})],e.prototype,"series",2),e})(),Vu=Fu,$u=new Map([{type:"chart",name:"cartesian",moduleId:"CartesianChartModule"},{type:"chart",name:"standalone",moduleId:"StandaloneChartModule",enterprise:!0},{type:"chart",name:"polar",moduleId:"PolarChartModule"},{type:"chart",name:"topology",moduleId:"TopologyChartModule",enterprise:!0},{type:"axis",name:"number",chartType:"cartesian",moduleId:"NumberAxisModule"},{type:"axis",name:"log",chartType:"cartesian",moduleId:"LogAxisModule"},{type:"axis",name:"time",chartType:"cartesian",moduleId:"TimeAxisModule"},{type:"axis",name:"unit-time",chartType:"cartesian",moduleId:"UnitTimeAxisModule"},{type:"axis",name:"category",chartType:"cartesian",moduleId:"CategoryAxisModule"},{type:"axis",name:"grouped-category",chartType:"cartesian",moduleId:"GroupedCategoryAxisModule"},{type:"axis",name:"ordinal-time",chartType:"cartesian",enterprise:!0,moduleId:"OrdinalTimeAxisModule"},{type:"axis",name:"angle-category",chartType:"polar",enterprise:!0,moduleId:"AngleCategoryAxisModule"},{type:"axis",name:"angle-number",chartType:"polar",enterprise:!0,moduleId:"AngleNumberAxisModule"},{type:"axis",name:"radius-category",chartType:"polar",enterprise:!0,moduleId:"RadiusCategoryAxisModule"},{type:"axis",name:"radius-number",chartType:"polar",enterprise:!0,moduleId:"RadiusNumberAxisModule"},{type:"series",name:"bar",chartType:"cartesian",moduleId:"BarSeriesModule"},{type:"series",name:"scatter",chartType:"cartesian",moduleId:"ScatterSeriesModule"},{type:"series",name:"bubble",chartType:"cartesian",moduleId:"BubbleSeriesModule"},{type:"series",name:"line",chartType:"cartesian",moduleId:"LineSeriesModule"},{type:"series",name:"area",chartType:"cartesian",moduleId:"AreaSeriesM
1odule"},{type:"series",name:"pie",chartType:"polar",moduleId:"PieSeriesModule"},{type:"series",name:"donut",chartType:"polar",moduleId:"DonutSeriesModule"},{type:"series",name:"box-plot",chartType:"cartesian",enterprise:!0,moduleId:"BoxPlotSeriesModule"},{type:"series",name:"candlestick",chartType:"cartesian",enterprise:!0,moduleId:"CandlestickSeriesModule"},{type:"series",name:"cone-funnel",chartType:"cartesian",enterprise:!0,moduleId:"ConeFunnelSeriesModule"},{type:"series",name:"funnel",chartType:"cartesian",enterprise:!0,moduleId:"FunnelSeriesModule"},{type:"series",name:"ohlc",chartType:"cartesian",enterprise:!0,moduleId:"OhlcSeriesModule"},{type:"series",name:"heatmap",chartType:"cartesian",enterprise:!0,moduleId:"HeatmapSeriesModule"},{type:"series",name:"histogram",chartType:"cartesian",moduleId:"HistogramSeriesModule"},{type:"series",name:"range-area",chartType:"cartesian",enterprise:!0,moduleId:"RangeAreaSeriesModule"},{type:"series",name:"range-bar",chartType:"cartesian",enterprise:!0,moduleId:"RangeBarSeriesModule"},{type:"series",name:"waterfall",chartType:"cartesian",enterprise:!0,moduleId:"WaterfallSeriesModule"},{type:"series",name:"nightingale",chartType:"polar",enterprise:!0,moduleId:"NightingaleSeriesModule"},{type:"series",name:"radar-area",chartType:"polar",enterprise:!0,moduleId:"RadarAreaSeriesModule"},{type:"series",name:"radar-line",chartType:"polar",enterprise:!0,moduleId:"RadarLineSeriesModule"},{type:"series",name:"radial-bar",chartType:"polar",enterprise:!0,moduleId:"RadialBarSeriesModule"},{type:"series",name:"radial-column",chartType:"polar",enterprise:!0,moduleId:"RadialColumnSeriesModule"},{type:"series",name:"map-shape",chartType:"topology",enterprise:!0,moduleId:"MapShapeSeriesModule"},{type:"series",name:"map-line",chartType:"topology",enterprise:!0,moduleId:"MapLineSeriesModule"},{type:"series",name:"map-marker",chartType:"topology",enterprise:!0,moduleId:"MapMarkerSeriesModule"},{type:"series",name:"map-shape-background",chartType:"topology",enterprise:!0,moduleId:"MapShapeBackgroundSeriesModule"},{type:"series",name:"map-line-background",chartType:"topology",enterprise:!0,moduleId:"MapLineBackgroundSeriesModule"},{type:"series",name:"pyramid",chartType:"standalone",enterprise:!0,moduleId:"PyramidSeriesModule"},{type:"series",name:"linear-gauge",chartType:"standalone",enterprise:!0,moduleId:"LinearGaugeModule"},{type:"series",name:"radial-gauge",chartType:"standalone",enterprise:!0,moduleId:"RadialGaugeModule"},{type:"series",name:"sunburst",chartType:"standalone",enterprise:!0,moduleId:"SunburstSeriesModule"},{type:"series",name:"treemap",chartType:"standalone",enterprise:!0,moduleId:"TreemapSeriesModule"},{type:"series",name:"chord",chartType:"standalone",enterprise:!0,moduleId:"ChordSeriesModule"},{type:"series",name:"sankey",chartType:"standalone",enterprise:!0,moduleId:"SankeySeriesModule"},{type:"series",name:"organization",chartType:"standalone",enterprise:!0,moduleId:"OrganizationSeriesModule"},{type:"plugin",name:"animation",enterprise:!0,moduleId:"AnimationModule"},{type:"plugin",name:"annotations",chartType:"cartesian",enterprise:!0,moduleId:"AnnotationsModule"},{type:"plugin",name:"legend",moduleId:"LegendModule"},{type:"plugin",name:"locale",moduleId:"LocaleModule"},{type:"plugin",name:"chartToolbar",chartType:"cartesian",enterprise:!0,moduleId:"ChartToolbarModule"},{type:"plugin",name:"contextMenu",enterprise:!0,moduleId:"ContextMenuModule"},{type:"plugin",name:"statusBar",chartType:"cartesian",enterprise:!0,moduleId:"StatusBarModule"},{type:"plugin",name:"dataSource",enterprise:!0,moduleId:"DataSourceModule"},{type:"plugin",name:"sync",chartType:"cartesian",enterprise:!0,moduleId:"SyncModule"},{type:"plugin",name:"ranges",chartType:"cartesian",enterprise:!0,moduleId:"RangesModule"},{type:"plugin",name:"zoom",enterprise:!0,moduleId:"ZoomModule"},{type:"plugin",name:"axis-interaction",chartType:"cartesian",enterprise:!0,moduleId:"AxisInteractionModule",apiName:"axes[].listeners.click / doubleClick"},{type:"plugin",name:"flashOnUpdate",enterprise:!0,moduleId:"FlashOnUpdateModule"},{type:"plugin",name:"gradientLegend",enterprise:!0,moduleId:"GradientLegendModule"},{type:"plugin",name:"navigator",chartType:"cartesian",enterprise:!0,moduleId:"NavigatorModule"},{type:"plugin",name:"scrollbar",chartType:"cartesian",enterprise:!0,moduleId:"ScrollbarModule"},{type:"plugin",name:"selection",enterprise:!0,moduleId:"SelectionModule"},{type:"axis:plugin",name:"crossLines",chartType:"cartesian",moduleId:"CrossLinesModule"},{type:"axis:plugin",name:"polarCrossLines",chartType:"polar",optionsKey:"crossLines",enterprise:!0,moduleId:"PolarCrossLinesModule"},{type:"axis:plugin",name:"crosshair",chartType:"cartesian",enterprise:!0,moduleId:"CrosshairModule"},{type:"axis:plugin",name:"bandHighlight",chartType:"cartesian",enterprise:!0,moduleId:"BandHighlightModule"},{type:"series:plugin",name:"errorBar",chartType:"cartesian",enterprise:!0,moduleId:"ErrorBarsModule"},{type:"preset",name:"gauge-preset",chartType:"standalone",enterprise:!0,moduleId:"GaugePresetModule",apiName:"AgCharts.createGauge"},{type:"preset",name:"price-volume",chartType:"cartesian",enterprise:!0,moduleId:"PriceVolumePresetModule",apiName:"AgCharts.createFinancialChart"},{type:"preset",name:"quadrant",chartType:"cartesian",enterprise:!0,moduleId:"QuadrantChartModule",apiName:"AgCharts.createQuadrantChart"},{type:"preset",name:"sparkline",moduleId:"SparklinePresetModule"}].map((e=>[e.name,e])));function Hu(e){return e?.up||e?.down||e?.neutral?"user-full":e?.fills||e?.strokes?"user-indexed":"inbuilt"}var ju={BLUE:"#5090dc",ORANGE:"#ffa03a",GREEN:"#459d55",CYAN:"#34bfe1",YELLOW:"#e1cc00",VIOLET:"#9669cb",GRAY:"#b5b5b5",MAGENTA:"#bd5aa7",BROWN:"#8a6224",RED:"#ef5452"},Wu={BLUE:"#2b5c95",ORANGE:"#cc6f10",GREEN:"#1e652e",CYAN:"#18859e",YELLOW:"#a69400",VIOLET:"#603c88",GRAY:"#575757",MAGENTA:"#7d2f6d",BROWN:"#4f3508",RED:"#a82529"},_u="#ffffff";var Gu={"radial-gauge":!0,"linear-gauge":!0};function Ku(e){return{$some:[{$and:[{$or:[{$isSeriesType:"line"},{$isSeriesType:"scatter"},{$isSeriesType:"area"},{$isSeriesType:"radar"},{$isSeriesType:"rangeArea"}]},{$isUserOption:[`/series/$index/${e}`,{$lessThan:[{$path:`/series/$index/${e}`},1]},!1]}]},{$path:"/series"}]}}var Yu=class e{static getDefaultColors(){return{fills:ju,fillsFallback:Object.values(ju),strokes:Wu,sequentialColors:(0,n._uB)(ju),divergingColors:[ju.ORANGE,ju.YELLOW,ju.GREEN],hierarchyColors:["#fff","#e0e5ea","#c1ccd5","#a3b4c1","#859cad"],secondSequentialColors:n.Q1f.interpolate([n.Q1f.fromHexString(ju.BLUE),n.Q1f.fromHexString("#cbdef5")],8).map((e=>e.toString())),secondDivergingColors:[ju.GREEN,ju.YELLOW,ju.RED],secondHierarchyColors:["#fff","#c5cbd1","#a4b1bd","#8498a9","#648096"],up:{fill:ju.GREEN,stroke:Wu.GREEN},down:{fill:ju.RED,stroke:Wu.RED},neutral:{fill:ju.GRAY,stroke:Wu.GRAY},altUp:{fill:ju.BLUE,stroke:Wu.BLUE},altDown:{fill:ju.ORANGE,stroke:Wu.ORANGE},altNeutral:{fill:ju.GRAY,stroke:Wu.GRAY}}}static getDefaultPublicParameters(){return{accentColor:"#2196f3",axisLineColor:{$ref:"borderColor"}
vendor: 5,651 bytes, line 1
1,backgroundColor:_u,borderColor:{$foregroundBackgroundMix:.15},borderRadius:4,borderWidth:1,chartBackgroundColor:{$ref:"backgroundColor"},chartPadding:20,focusShadow:"0 0 0 3px color-mix(in srgb, var(--ag-charts-accent-color) 50%, transparent)",foregroundColor:"#181d1f",fontFamily:'"IBM Plex Sans", -apple-system, "system-ui", "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif',fontSize:n.Efy,fontWeight:400,gridLineColor:{$mix:[{$ref:"axisLineColor"},{$ref:"backgroundColor"},.35]},popupShadow:"0 0 16px rgba(0, 0, 0, 0.15)",subtleTextColor:{$mix:[{$ref:"textColor"},{$ref:"chartBackgroundColor"},.38]},textColor:{$ref:"foregroundColor"},chromeBackgroundColor:{$foregroundBackgroundMix:.02},chromeFontFamily:{$ref:"fontFamily"},chromeFontSize:{$ref:"fontSize"},chromeFontWeight:{$ref:"fontWeight"},chromeTextColor:{$ref:"foregroundColor"},chromeSubtleTextColor:{$mix:[{$ref:"chromeTextColor"},{$ref:"backgroundColor"},.38]},buttonBackgroundColor:{$ref:"backgroundColor"},buttonBorder:{color:{$ref:"borderColor"},width:{$ref:"borderWidth"}},buttonBorderRadius:{$ref:"borderRadius"},buttonFontWeight:400,buttonTextColor:{$ref:"textColor"},inputBackgroundColor:{$ref:"backgroundColor"},inputBorder:{color:{$ref:"borderColor"},width:{$ref:"borderWidth"}},inputBorderRadius:{$ref:"borderRadius"},inputTextColor:{$ref:"textColor"},menuBackgroundColor:{$ref:"chromeBackgroundColor"},menuBorder:{color:{$ref:"borderColor"},width:{$ref:"borderWidth"}},menuBorderRadius:{$ref:"borderRadius"},menuTextColor:{$ref:"chromeTextColor"},panelBackgroundColor:{$ref:"chromeBackgroundColor"},panelSubtleTextColor:{$ref:"chromeSubtleTextColor"},tooltipBackgroundColor:{$ref:"chromeBackgroundColor"},tooltipBorder:{color:{$ref:"borderColor"},width:{$ref:"borderWidth"}},tooltipBorderRadius:{$ref:"borderRadius"},tooltipTextColor:{$ref:"chromeTextColor"},tooltipSubtleTextColor:{$ref:"chromeSubtleTextColor"},crosshairLabelBackgroundColor:{$ref:"foregroundColor"},crosshairLabelTextColor:{$ref:"chartBackgroundColor"},groupedCategoryLineColor:{$foregroundBackgroundMix:.17}}}static getPrivateParameters(){return{focusColor:{$mix:[{$ref:"backgroundColor"},{$ref:"accentColor"},.12]}}}getChartDefaults(){return{minHeight:300,minWidth:300,background:{visible:!0,fill:{$ref:"chartBackgroundColor"}},padding:{$applyPadding:{$ref:"chartPadding"}},seriesArea:{border:{enabled:!1,stroke:{$ref:"foregroundColor"},strokeOpacity:1,strokeWidth:1},cornerRadius:4,padding:{$applyPadding:{$if:[{$path:"./border/enabled"},5,0]}}},keyboard:{enabled:!0},title:{enabled:!1,text:"Title",spacing:{$if:[{$path:"../subtitle/enabled"},10,20]},fontWeight:{$ref:"fontWeight"},fontSize:{$rem:n.q8q.LARGEST},fontFamily:{$ref:"fontFamily"},color:{$ref:"textColor"},wrapping:"hyphenate",layoutStyle:n.ILz,textAlign:n.fH_,cornerRadius:4,border:{enabled:!1,strokeWidth:1,stroke:{$foregroundOpacity:.08}},padding:{$if:[{$path:"./border/enabled"},{left:12,right:12,top:8,bottom:8},{$isUserOption:["./fill",{left:12,right:12,top:8,bottom:8},0]}]}},subtitle:{enabled:!1,text:"Subtitle",spacing:20,fontWeight:{$ref:"fontWeight"},fontSize:{$rem:n.q8q.MEDIUM},fontFamily:{$ref:"fontFamily"},color:{$ref:"subtleTextColor"},wrapping:"hyphenate",layoutStyle:n.ILz,textAlign:n.fH_,cornerRadius:4,border:{enabled:!1,strokeWidth:1,stroke:{$foregroundOpacity:.08}},padding:{$if:[{$path:"./border/enabled"},{left:12,right:12,top:8,bottom:8},{$isUserOption:["./fill",{left:12,right:12,top:8,bottom:8},0]}]}},footnote:{enabled:!1,text:"Footnote",spacing:20,fontSize:{$rem:n.q8q.MEDIUM},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"subtleTextColor"},wrapping:"hyphenate",layoutStyle:n.ILz,textAlign:n.fH_,cornerRadius:4,border:{enabled:!1,strokeWidth:1,stroke:{$foregroundOpacity:.08}},padding:{$if:[{$path:"./border/enabled"},{left:12,right:12,top:8,bottom:8},{$isUserOption:["./fill",{left:12,right:12,top:8,bottom:8},0]}]}},highlight:{enabled:!0,drawingMode:{$if:[{$or:[Ku("highlight/highlightedItem/opacity"),Ku("highlight/unhighlightedItem/opacity"),Ku("highlight/highlightedSeries/opacity"),Ku("highlight/unhighlightedSeries/opacity"),Ku("fillOpacity"),Ku("marker/fillOpacity")]},"overlap","cutout"]}},tooltip:{enabled:!0,darkTheme:n.oxB,delay:0,pagination:!1,mode:{$if:[{$or:[{$and:[{$isChartType:"cartesian"},{$not:{$hasSeriesType:"bubble"}},{$not:{$hasSeriesType:"scatter"}},{$greaterThan:[{$size:{$path:"/series"}},1]},{$lessThan:[{$size:{$path:"/series"}},4]}]},{$and:[{$isChartType:"polar"},{$greaterThan:[{$size:{$path:"/series"}},1]},{$lessThan:[{$size:{$path:"/series"}},4]}]}]},"shared","single"]}},overlays:{darkTheme:n.oxB},listeners:{},series:{tooltip:{range:{$if:[{$eq:[{$path:["/tooltip/range","exact"]},"area"]},"exact",{$path:["/tooltip/range","exact"]}]},position:{anchorTo:{$path:["/tooltip/position/anchorTo","pointer"]},placement:{$path:["/tooltip/position/placement",void 0]},xOffset:{$path:["/tooltip/position/xOffset",0]},yOffset:{$path:["/tooltip/position/yOffset",0]},offset:{$path:["/tooltip/position/offset",{$if:[{$eq:[{$path:"./anchorTo"},"chart"]},0,12]}]}}}}}}constructor(e={},t,i=n.syG.resolveModuleScope()){const{overrides:s,palette:a,params:o}=(0,n.Go6)(e),r=this.createChartConfigPerChartType(this.getDefaults(t,i),i),l={};s&&this.processOverrides(l,s,i);const{fills:h,strokes:c,sequentialColors:d,...u}=this.getDefaultColors();this.palette=(0,n.olf)((0,n.HFk)(a,{fills:Object.values(h),strokes:Object.values(c),sequentialColors:Object.values(d),...u})),this.paletteType=Hu(a),this.params=(0,n.HFk)(o,this.getThemeParameters()),this.config=(0,n.olf)((0,n.Go6)(r)),this.overrides=(0,n.olf)(s),this.presets=(0,n.olf)(l)}
1processOverrides(e,t,i){for(const s of i.listModulesByType(n.nR2.Series)){const i=s.name,n=t[i];!0===Gu[i]&&(e[i]=n,delete t[i])}}createChartConfigPerChartType(e,t){var i;for(const s of t.listModulesByType(n.nR2.Chart))for(const a of t.listModulesByType(n.nR2.Series))a.chartType===s.name&&(e[i=a.name]??(e[i]=s.themeTemplate));return e}getDefaults(e,t){const i=null==e?void 0:t.getPresetModule(e),s=i?.themeTemplate,a=(e,a)=>{const o={},r=(0,n.pej)({axes:{}},s?.common,...Array.from(t.listModulesByType(n.nR2.Plugin),(e=>({[e.name]:e.themeTemplate}))),t.getChartModule(e)?.themeTemplate,this.getChartDefaults());for(const l of a){if(o[l]=(0,n.pej)(s?.[l],Xu(l,t),o[l]??r),i?.removeThemeSeriesKeys&&o[l].series)for(const e of i.removeThemeSeriesKeys)e in o[l].series&&delete o[l].series[e];const{axes:a}=o[l];for(const i of t.listModulesByType(n.nR2.Axis))a[i.name]=(0,n.pej)(a[i.name],i.chartType&&i.chartType!==e?null:Uu(i.name,t));"map-shape-background"!==l&&"map-line-background"!==l||delete o[l].series.tooltip}return o},o=[...t.listModulesByType(n.nR2.Series)],r=(0,n.$zQ)(o,(e=>e.chartType||"unknown"));return(0,n.pej)(...Object.keys(r).map((e=>a(e,r[e]?.map((e=>e.name))??[]))))}static applyTemplateTheme(e,t,i){if((0,n.cyL)(e))for(let t=0;t<e.length;t++){const n=e[t];"symbol"==typeof n&&i?.has(n)&&(e[t]=i.get(n))}else for(const t of Object.keys(e)){const n=e[t];"symbol"==typeof n&&i?.has(n)&&(e[t]=i.get(n))}}templateTheme(t,i=!0){const s=i?(0,n.Go6)(t):t,a=this.getTemplateParameters();return(0,n.mfG)(s,e.applyTemplateTheme,void 0,void 0,a),s}getDefaultColors(){return e.getDefaultColors()}getThemeParameters(){return{...e.getDefaultPublicParameters(),...e.getPrivateParameters()}}getTemplateParameters(){const e=new Map;e.set(n.oxB,!1),e.set(n.KU9,"#00000080"),e.set(n.kOz,"#aaa"),e.set(n.ILz,"block"),e.set(n.fH_,"center"),e.set(n.fsm,["#797b86","#e24c4a","#f49d2d","#65ab58","#409682","#4db9d2","#5090dc","#3068f9","#e24c4a","#913aac","#d93e64"]),e.set(n.iKe,_u),e.set(n.oC3,ju.BLUE),e.set(n.zVM,ju.BLUE),e.set(n.yQs,ju.BLUE),e.set(n.nW0,_u),e.set(n.w9K,"#fafafa"),e.set(n.lO7,"#ddd"),e.set(n.KCM,"#000"),e.set(n.Fn1,"#181d1f"),e.set(n.Xg7,"#e35c5c"),e.set(n.wAP,"#e35c5c"),e.set(n.xFO,"#fafafa"),e.set(n.U4X,"#ddd"),e.set(n.vjx,"#000"),e.set(n.QJY,"top");const t=this.getDefaultColors();return e.set(n.JsB,this.palette.up?.stroke??t.up.stroke),e.set(n.ENk,this.palette.up?.fill??t.up.fill),e.set(n.qvb,this.palette.down?.stroke??t.down.stroke),e.set(n.P04,this.palette.down?.fill??t.down.fill),e.set(n.ThM,this.palette.neutral?.stroke??t.neutral.stroke),e.set(n.olo,this.palette.neutral?.fill??t.neutral.fill),e.set(n.Ra$,this.palette.altUp?.stroke??t.up.stroke),e.set(n.W_3,this.palette.altUp?.fill??t.up.fill),e.set(n.AmB,this.palette.altDown?.stroke??t.down.stroke),e.set(n.v48,this.palette.altDown?.fill??t.down.fill),e.set(n.yYi,this.palette.altNeutral?.fill??t.altNeutral.fill),e.set(n.HVx,this.palette.altNeutral?.stroke??t.altNeutral.stroke),e}};function Uu(e,t){let i=t.getAxisModule(e)?.themeTemplate??{};for(const s of t.listModulesByType(n.nR2.AxisPlugin))if(s.axisTypes?.includes(e)??1){const e=s.optionsKey??s.name;i=(0,n.pej)({[e]:s.themeTemplate},i)}return i}function Xu(e,t){let i=t.getSeriesModule(e)?.themeTemplate??{};for(const s of t.listModulesByType(n.nR2.SeriesPlugin))(s.seriesTypes?.includes(e)??1)&&(i=(0,n.pej)({series:{[s.name]:s.themeTemplate}},i));return null!=n.dC9.seriesAreaThemeTemplate&&(i=(0,n.pej)({seriesArea:n.dC9.seriesAreaThemeTemplate},i)),i}var Zu=new Set(["foreground"]),qu=(0,n.Z6N)((()=>({themes:new WeakMap})),(e=>{e.themes=new WeakMap})),Qu=n.yar.create(!0,"perf","theme");function Ju(e,t=n.syG.resolveModuleScope()){const{themes:i}=qu.for(t),s=i.get(e);if(void 0!==s)return Qu("[CACHE] SanitizedTheme","hit"),s;Qu("[CACHE] SanitizedTheme","miss");const a=function(e,t){const i=new Map,s=new Set([...t.listModulesByType(n.nR2.AxisPlugin)].map((e=>e.optionsKey??e.name)));for(const[e,{type:a,optionsKey:o}]of $u){if(t.hasModule(e))continue;const r=a===n.nR2.AxisPlugin?o??e:e;a===n.nR2.AxisPlugin&&s.has(r)||(i.has(a)?i.get(a).add(r):i.set(a,new Set([r])))}if(0===i.size)return e;function a(e,t){return!t||!0!==e.enabled}function o(e,t){const s=i.get(n.nR2.Plugin);if((0,n.Gvm)(e)&&s)for(const i of s)i in e&&a(e[i],t)&&delete e[i]}function r(e){const t=i.get(n.nR2.SeriesPlugin);if((0,n.Gvm)(e)&&t)for(const i of t)i in e&&delete e[i]}function l(e,t){const s=i.get(n.nR2.AxisPlugin);if((0,n.Gvm)(e)&&s)for(const i of s)i in e&&a(e[i],t)&&delete e[i]}function h(e,t){if((0,n.Gvm)(e))for(const s of Object.keys(e))i.get(n.nR2.Axis)?.has(s)?delete e[s]:l(e[s],t)}function c(e,t){(0,n.Gvm)(e)&&(h(e.axes,t),o(e,t),r(e.series))}const d=(0,n.Go6)(e.config),u=(0,n.Go6)(e.overrides),p=(0,n.Go6)(e.presets);for(const e of Object.keys(d))i.get(n.nR2.Series)?.has(e)?delete d[e]:c(d[e],!1);if((0,n.Gvm)(u)){const e=u;(0,n.Gvm)(e.common)&&(h(e.common.axes,!0),o(e.common,!0));for(const t of Object.keys(e))"common"!==t&&(i.get(n.nR2.Series)?.has(t)?delete e[t]:c(e[t],!0))}if((0,n.Gvm)(p)){const e=p;for(const t of Object.keys(e))i.get(n.nR2.Preset)?.has(t)||i.get(n.nR2.Series)?.has(t)?delete e[t]:(o(e[t],!0),h(e[t]?.axes,!0))}return Object.create(e,{config:{value:(0,n.olf)(d),enumerable:!0},overrides:{value:(0,n.Gvm)(u)?(0,n.olf)(u):u,enumerable:!0},presets:{value:(0,n.Gvm)(p)?(0,n.olf)(p):p,enumerable:!0}})}(e,t);return i.set(e,a),a}function ep(e,t,i,s,a){const o=(0,n.AmM)(function(e,t,i){const s=new Map,a="axes"in t&&(0,n.Gvm)(t.axes)?t.axes:{},o=new Set(Object.values(a).map((e=>e?.type)).filter(n.O9V)),r=new Set(t.series?.map((e=>e.type)).filter(n.O9V));function l(e){s.set(e.name,e)}
1for(const s of $u.values())if(!i.hasModule(s.name)&&!(Zu.has(s.name)||e&&s.chartType&&e!==s.chartType))switch(s.type){case"chart":break;case"axis":if(o.has(s.name)){for(const e of Object.keys(a))a?.[e].type===s.name&&delete a[e];l(s)}break;case"series":r.has(s.name)&&(t.series=t.series.filter((e=>e.type!==s.name)),l(s));break;case"plugin":const e=s.name,i=t[e];(0,n.Gvm)(i)&&(!1!==i.enabled&&l(s),delete t[e]);break;case"axis:plugin":for(const e of Object.values(a)){const t=s.optionsKey??s.name;e?.[t]&&(!1!==e[t].enabled&&l(s),delete e[t])}break;case"series:plugin":for(const e of t.series??[])e[s.name]&&(delete e[s.name],l(s))}for(const e of r){const a=$u.get(e);a?.type!==n.nR2.Series||i.hasModule(a.name)||s.has(a.name)||(t.series=t.series.filter((e=>e.type!==a.name)),l(a))}return Array.from(s.values())}(e,t,a).concat(i));if(!o.length)return;const r=n.syG.isIntegrated()?"https://www.ag-grid.com/data-grid/integrated-charts-installation/":"https://www.ag-grid.com/charts/r/module-registry/",l=(0,n.$zQ)(o,(e=>e.enterprise?"enterprise":"community"));if(n.syG.isUmd())s.warnOnce(function(e){const t=n.syG.isIntegrated()?"https://www.ag-grid.com/data-grid/integrated-charts-installation/":"https://www.ag-grid.com/charts/javascript/installation/";return["unable to use these enterprise features as 'ag-charts-enterprise' has not been loaded:","",e.map((e=>e.apiName??e.name)).join("\n"),"",`See ${t} for more details.`].join("\n")}(l.enterprise??[]));else{const e=function(e,t,i,s){const a=n.syG.isEnterprise()||t.enterprise?.length?"enterprise":"community";return["required modules are not registered. Check if you have registered the modules:","",sp(e.map(tp),a,s),"",`See ${i} for more details.`].join("\n")}(o,l,r,!n.syG.isGlobalScope(a));s.errorOnce(e)}}function tp(e){return e.moduleId??e.name}function ip(e){return` ${e},`}function np(e,t){return e.length?`import {\n${e.map(ip).join("\n")}\n} from 'ag-charts-${t}';`:null}function sp(e,t,i){const n=e.map(ip).join("\n");if(i){return`${np(["AgCharts"].concat(e),t)}\n\nAgCharts.create(options, {\n modules: [\n${n.replace(/^/gm," ")}\n ],\n});`}return`${np(["ModuleRegistry"].concat(e),t)}\n\nModuleRegistry.registerModules([\n${n}\n]);`}function ap(e,t,i){const s="axes"in t&&(0,n.Gvm)(t.axes),a="series"in t&&(0,n.cyL)(t.series),o=t=>null==e||!t.chartType||t.chartType===e,r=[],l=new Set;for(const e of i.listModulesByType(n.nR2.AxisPlugin))o(e)&&l.add(e.optionsKey??e.name);for(const e of i.listModules())if(n.syG.isModuleType(n.nR2.Plugin,e))o(e)||(delete t[e.name],r.push(e.name));else if(n.syG.isModuleType(n.nR2.AxisPlugin,e)){if(s&&!o(e)){const i=e.optionsKey??e.name;if(l.has(i))continue;for(const e of Object.values(t.axes))delete e[i];r.push(e.name)}}else if(n.syG.isModuleType(n.nR2.SeriesPlugin,e)&&a&&!o(e)){for(const i of t.series)delete i[e.name];r.push(e.name)}return r}var op="#192232",rp={BLUE:"#5090dc",ORANGE:"#ffa03a",GREEN:"#459d55",CYAN:"#34bfe1",YELLOW:"#e1cc00",VIOLET:"#9669cb",GRAY:"#b5b5b5",MAGENTA:"#bd5aa7",BROWN:"#8a6224",RED:"#ef5452"},lp={BLUE:"#74a8e6",ORANGE:"#ffbe70",GREEN:"#6cb176",CYAN:"#75d4ef",YELLOW:"#f6e559",VIOLET:"#aa86d8",GRAY:"#a1a1a1",MAGENTA:"#ce7ab9",BROWN:"#997b52",RED:"#ff7872"},hp=class extends Yu{getDefaultColors(){return{fills:rp,fillsFallback:Object.values(rp),strokes:lp,sequentialColors:(0,n._uB)(rp),divergingColors:[rp.ORANGE,rp.YELLOW,rp.GREEN],hierarchyColors:["#192834","#253746","#324859","#3f596c","#4d6a80"],secondSequentialColors:["#5090dc","#4882c6","#4073b0","#38659a","#305684","#28486e","#203a58","#182b42"],secondDivergingColors:[rp.GREEN,rp.YELLOW,rp.RED],secondHierarchyColors:["#192834","#3b5164","#496275","#577287","#668399"],up:{fill:rp.GREEN,stroke:lp.GREEN},down:{fill:rp.RED,stroke:lp.RED},neutral:{fill:rp.GRAY,stroke:lp.GRAY},altUp:{fill:rp.BLUE,stroke:lp.BLUE},altDown:{fill:rp.ORANGE,stroke:lp.ORANGE},altNeutral:{fill:rp.GRAY,stroke:lp.GRAY}}}getThemeParameters(){return{...super.getThemeParameters(),axisLineColor:{$foregroundBackgroundMix:.737},backgroundColor:op,borderColor:{$foregroundBackgroundMix:.216}
vendor: 7,436 bytes, line 1
1,chromeBackgroundColor:{$foregroundBackgroundMix:.07},focusColor:{$mix:[{$ref:"backgroundColor"},{$ref:"accentColor"},.22]},foregroundColor:"#fff",gridLineColor:{$foregroundBackgroundMix:.257},popupShadow:"0 0 16px rgba(0, 0, 0, 0.33)",subtleTextColor:{$mix:[{$ref:"textColor"},{$ref:"chartBackgroundColor"},.57]},groupedCategoryLineColor:{$foregroundBackgroundMix:.44},crosshairLabelBackgroundColor:{$foregroundBackgroundMix:.65}}}getTemplateParameters(){const e=super.getTemplateParameters();return e.set(n.oxB,!0),e.set(n.iKe,op),e.set(n.oC3,rp.BLUE),e.set(n.yQs,"#fff"),e.set(n.zVM,rp.BLUE),e.set(n.nW0,op),e.set(n.w9K,"#28313e"),e.set(n.lO7,"#4b525d"),e.set(n.KCM,"#fff"),e.set(n.Fn1,"#fff"),e.set(n.xFO,"#28313e"),e.set(n.U4X,"#4b525d"),e.set(n.vjx,"#fff"),e}},cp={GREEN:"#089981",RED:"#F23645",BLUE:"#5090dc",GRAY:"#A9A9A9"},dp={GREEN:"#089981",RED:"#F23645",BLUE:"#5090dc",GRAY:"#909090"},up=class extends hp{getDefaultColors(){return{...super.getDefaultColors(),fills:{...cp},fillsFallback:Object.values({...cp}),strokes:{...dp},sequentialColors:(0,n._uB)(cp),divergingColors:[cp.GREEN,cp.BLUE,cp.RED],secondSequentialColors:["#5090dc","#4882c6","#4073b0","#38659a","#305684","#28486e","#203a58","#182b42"],up:{fill:cp.GREEN,stroke:dp.GREEN},down:{fill:cp.RED,stroke:dp.RED},neutral:{fill:cp.BLUE,stroke:dp.BLUE},altUp:{fill:cp.GREEN,stroke:dp.GREEN},altDown:{fill:cp.RED,stroke:dp.RED},altNeutral:{fill:cp.GRAY,stroke:dp.GRAY}}}getThemeParameters(){return{...super.getThemeParameters(),chartPadding:0,gridLineColor:{$foregroundBackgroundMix:.12}}}getTemplateParameters(){const e=super.getTemplateParameters();return e.set(n.oC3,cp.BLUE),e.set(n.zVM,cp.BLUE),e.set(n.ILz,"overlay"),e.set(n.fH_,"left"),e.set(n.QJY,"bottom"),e}},pp={GREEN:"#089981",RED:"#F23645",BLUE:"#5090dc",GRAY:"#A9A9A9"},gp={GREEN:"#089981",RED:"#F23645",BLUE:"#5090dc",GRAY:"#909090"},mp=class extends Yu{getDefaultColors(){return{...super.getDefaultColors(),fills:{...pp},fillsFallback:Object.values({...pp}),strokes:{...gp},sequentialColors:(0,n._uB)(pp),divergingColors:[pp.GREEN,pp.BLUE,pp.RED],up:{fill:pp.GREEN,stroke:gp.GREEN},down:{fill:pp.RED,stroke:gp.RED},neutral:{fill:pp.BLUE,stroke:gp.BLUE},altUp:{fill:pp.GREEN,stroke:gp.GREEN},altDown:{fill:pp.RED,stroke:gp.RED},altNeutral:{fill:pp.GRAY,stroke:gp.GRAY}}}getThemeParameters(){return{...super.getThemeParameters(),chartPadding:0,gridLineColor:{$foregroundBackgroundMix:.06}}}getTemplateParameters(){const e=super.getTemplateParameters();return e.set(n.oC3,pp.BLUE),e.set(n.zVM,pp.BLUE),e.set(n.ILz,"overlay"),e.set(n.fH_,"left"),e.set(n.QJY,"bottom"),e}},yp={BLUE:"#2196F3",ORANGE:"#FF9800",GREEN:"#4CAF50",CYAN:"#00BCD4",YELLOW:"#FFEB3B",VIOLET:"#7E57C2",GRAY:"#9E9E9E",MAGENTA:"#F06292",BROWN:"#795548",RED:"#F44336"},fp={BLUE:"#90CAF9",ORANGE:"#FFCC80",GREEN:"#A5D6A7",CYAN:"#80DEEA",YELLOW:"#FFF9C4",VIOLET:"#B39DDB",GRAY:"#E0E0E0",MAGENTA:"#F48FB1",BROWN:"#A1887F",RED:"#EF9A9A"},xp=class extends hp{getDefaultColors(){return{...super.getDefaultColors(),fills:yp,fillsFallback:Object.values(yp),strokes:fp,sequentialColors:(0,n._uB)(yp),divergingColors:[yp.ORANGE,yp.YELLOW,yp.GREEN],secondSequentialColors:["#2196f3","#208FEC","#1E88E5","#1C7FDC","#1976d2","#176EC9","#1565c0"],secondDivergingColors:[yp.GREEN,yp.YELLOW,yp.RED],up:{fill:yp.GREEN,stroke:fp.GREEN},down:{fill:yp.RED,stroke:fp.RED},neutral:{fill:yp.GRAY,stroke:fp.GRAY},altUp:{fill:yp.BLUE,stroke:fp.BLUE},altDown:{fill:yp.RED,stroke:fp.RED},altNeutral:{fill:yp.GRAY,stroke:fp.GRAY}}}getTemplateParameters(){const e=super.getTemplateParameters();return e.set(n.oC3,yp.BLUE),e.set(n.zVM,yp.BLUE),e}},bp={BLUE:"#2196F3",ORANGE:"#FF9800",GREEN:"#4CAF50",CYAN:"#00BCD4",YELLOW:"#FFEB3B",VIOLET:"#7E57C2",GRAY:"#9E9E9E",MAGENTA:"#F06292",BROWN:"#795548",RED:"#F44336"},vp={BLUE:"#1565C0",ORANGE:"#E65100",GREEN:"#2E7D32",CYAN:"#00838F",YELLOW:"#F9A825",VIOLET:"#4527A0",GRAY:"#616161",MAGENTA:"#C2185B",BROWN:"#4E342E",RED:"#B71C1C"},Sp=class extends Yu{getDefaultColors(){return{...super.getDefaultColors(),fills:bp,fillsFallback:Object.values(bp),strokes:vp,sequentialColors:(0,n._uB)(bp),divergingColors:[bp.ORANGE,bp.YELLOW,bp.GREEN],secondSequentialColors:["#2196f3","#329EF4","#42a5f5","#53ADF6","#64b5f6","#7AC0F8","#90caf9"],secondDivergingColors:[bp.GREEN,bp.YELLOW,bp.RED],up:{fill:bp.GREEN,stroke:vp.GREEN},down:{fill:bp.RED,stroke:vp.RED},neutral:{fill:bp.GRAY,stroke:vp.GRAY},altUp:{fill:bp.BLUE,stroke:vp.BLUE},altDown:{fill:bp.RED,stroke:vp.RED},altNeutral:{fill:bp.GRAY,stroke:vp.GRAY}}}getTemplateParameters(){const e=super.getTemplateParameters();return e.set(n.oC3,bp.BLUE),e.set(n.zVM,bp.BLUE),e}},Mp={BLUE:"#436ff4",PURPLE:"#9a7bff",MAGENTA:"#d165d2",PINK:"#f0598b",RED:"#f47348",ORANGE:"#f2a602",YELLOW:"#e9e201",GREEN:"#21b448",CYAN:"#00b9a2",MODERATE_BLUE:"#00aee4",GRAY:"#bbbbbb"},kp={BLUE:"#6698ff",PURPLE:"#c0a3ff",MAGENTA:"#fc8dfc",PINK:"#ff82b1",RED:"#ff9b70",ORANGE:"#ffcf4e",YELLOW:"#ffff58",GREEN:"#58dd70",CYAN:"#51e2c9",MODERATE_BLUE:"#4fd7ff",GRAY:"#eeeeee"},Dp=class extends hp{getDefaultColors(){return{fills:Mp,fillsFallback:Object.values(Mp),strokes:kp,sequentialColors:(0,n._uB)(Mp),divergingColors:[Mp.BLUE,Mp.RED],hierarchyColors:[],secondSequentialColors:[Mp.BLUE,Mp.PURPLE,Mp.MAGENTA,Mp.PINK,Mp.RED,Mp.ORANGE,Mp.YELLOW,Mp.GREEN],secondDivergingColors:[Mp.BLUE,Mp.RED],secondHierarchyColors:[],up:{fill:Mp.GREEN,stroke:kp.GREEN},down:{fill:Mp.RED,stroke:kp.RED},neutral:{fill:Mp.GRAY,stroke:kp.GRAY},altUp:{fill:Mp.BLUE,stroke:kp.BLUE},altDown:{fill:Mp.RED,stroke:kp.RED},altNeutral:{fill:Mp.GRAY,stroke:kp.GRAY}}}getTemplateParameters(){const e=super.getTemplateParameters();return e.set(n.oC3,Mp.BLUE),e.set(n.zVM,Mp.BLUE),e}},wp={BLUE:"#436ff4",PURPLE:"#9a7bff",MAGENTA:"#d165d2",PINK:"#f0598b",RED:"#f47348",ORANGE:"#f2a602",YELLOW:"#e9e201",GREEN:"#21b448",CYAN:"#00b9a2",MODERATE_BLUE:"#00aee4",GRAY:"#bbbbbb"},Ip={BLUE:"#2346c9",PURPLE:"#7653d4",MAGENTA:"#a73da9",PINK:"#c32d66",RED:"#c84b1c",ORANGE:"#c87f00",YELLOW:"#c1b900",GREEN:"#008c1c",CYAN:"#00927c",MODERATE_BLUE:"#0087bb",GRAY:"#888888"},Ap=class extends Yu{getDefaultColors(){return{...super.getDefaultColors(),fills:wp,fillsFallback:Object.values(wp),strokes:Ip,sequentialColors:(0,n._uB)(wp),divergingColors:[wp.BLUE,wp.RED],hierarchyColors:[],secondSequentialColors:[wp.BLUE,wp.PURPLE,wp.MAGENTA,wp.PINK,wp.RED,wp.ORANGE,wp.YELLOW,wp.GREEN],secondDivergingColors:[wp.BLUE,wp.RED],secondHierarchyColors:[],up:{fill:wp.GREEN,stroke:Ip.GREEN},down:{fill:wp.RED,stroke:Ip.RED},neutral:{fill:wp.GRAY,stroke:Ip.GRAY},altUp:{fill:wp.BLUE,stroke:Ip.BLUE},altDown:{fill:wp.RED,stroke:Ip.RED},altNeutral:{fill:wp.GRAY,stroke:Ip.GRAY}}}getTemplateParameters(){const e=super.getTemplateParameters();return e.set(n.oC3,wp.BLUE),e.set(n.zVM,wp.BLUE),e}},Cp={BLUE:"#4472C4",ORANGE:"#ED7D31",GRAY:"#A5A5A5",YELLOW:"#FFC000",MODERATE_BLUE:"#5B9BD5",GREEN:"#70AD47",DARK_GRAY:"#7B7B7B",DARK_BLUE:"#264478",VERY_DARK_GRAY:"#636363",DARK_YELLOW:"#997300"},Np={BLUE:"#6899ee",ORANGE:"#ffa55d",GRAY:"#cdcdcd",YELLOW:"#ffea53",MODERATE_BLUE:"#82c3ff",GREEN:"#96d56f",DARK_GRAY:"#a1a1a1",DARK_BLUE:"#47689f",VERY_DARK_GRAY:"#878787",DARK_YELLOW:"#c0993d"},Lp=class extends hp{getDefaultColors(){return{...super.getDefaultColors(),fills:{...Cp,RED:Cp.ORANGE},fillsFallback:Object.values({...Cp,RED:Cp.ORANGE}),strokes:{...Np,RED:Np.ORANGE},sequentialColors:(0,n._uB)({...Cp,RED:Cp.ORANGE}),divergingColors:[Cp.ORANGE,Cp.YELLOW,Cp.GREEN
1],secondSequentialColors:["#5090dc","#4882c6","#4073b0","#38659a","#305684","#28486e","#203a58","#182b42"],secondDivergingColors:[Cp.GREEN,Cp.YELLOW,Cp.ORANGE],up:{fill:Cp.GREEN,stroke:Np.GREEN},down:{fill:Cp.ORANGE,stroke:Np.ORANGE},neutral:{fill:Cp.GRAY,stroke:Np.GRAY},altUp:{fill:Cp.BLUE,stroke:Np.BLUE},altDown:{fill:Cp.ORANGE,stroke:Np.ORANGE},altNeutral:{fill:Cp.GRAY,stroke:Np.GRAY}}}getTemplateParameters(){const e=super.getTemplateParameters();return e.set(n.oC3,Cp.BLUE),e.set(n.zVM,Cp.BLUE),e}},Pp={BLUE:"#5281d5",ORANGE:"#ff8d44",GRAY:"#b5b5b5",YELLOW:"#ffd02f",MODERATE_BLUE:"#6aabe6",GREEN:"#7fbd57",DARK_GRAY:"#8a8a8a",DARK_BLUE:"#335287",VERY_DARK_GRAY:"#717171",DARK_YELLOW:"#a98220"},Tp={BLUE:"#214d9b",ORANGE:"#c25600",GRAY:"#7f7f7f",YELLOW:"#d59800",MODERATE_BLUE:"#3575ac",GREEN:"#4b861a",DARK_GRAY:"#575757",DARK_BLUE:"#062253",VERY_DARK_GRAY:"#414141",DARK_YELLOW:"#734f00"},Op=class extends Yu{getDefaultColors(){return{...super.getDefaultColors(),fills:{...Pp,RED:Pp.ORANGE},fillsFallback:Object.values({...Pp,RED:Pp.ORANGE}),strokes:{...Tp,RED:Tp.ORANGE},sequentialColors:(0,n._uB)({...Pp,RED:Pp.ORANGE}),divergingColors:[Pp.ORANGE,Pp.YELLOW,Pp.GREEN],secondSequentialColors:["#5090dc","#629be0","#73a6e3","#85b1e7","#96bcea","#a8c8ee","#b9d3f1","#cbdef5"],secondDivergingColors:[Pp.GREEN,Pp.YELLOW,Pp.ORANGE],secondHierarchyColors:[],up:{fill:Pp.GREEN,stroke:Tp.GREEN},down:{fill:Pp.ORANGE,stroke:Tp.ORANGE},neutral:{fill:Tp.GRAY,stroke:Tp.GRAY},altUp:{fill:Pp.BLUE,stroke:Tp.BLUE},altDown:{fill:Pp.ORANGE,stroke:Tp.ORANGE},altNeutral:{fill:Pp.GRAY,stroke:Tp.GRAY}}}getTemplateParameters(){const e=super.getTemplateParameters();return e.set(n.oC3,Pp.BLUE),e.set(n.zVM,Pp.BLUE),e}},Rp={BLUE:"#0083ff",ORANGE:"#ff6600",GREEN:"#00af00",CYAN:"#00ccff",YELLOW:"#f7c700",VIOLET:"#ac26ff",GRAY:"#a7a7b7",MAGENTA:"#e800c5",BROWN:"#b54300",RED:"#ff0000"},Ep={BLUE:"#67b7ff",ORANGE:"#ffc24d",GREEN:"#5cc86f",CYAN:"#54ebff",VIOLET:"#fff653",YELLOW:"#c18aff",GRAY:"#aeaeae",MAGENTA:"#f078d4",BROWN:"#ba8438",RED:"#ff726e"},zp=class extends hp{getDefaultColors(){return{fills:Rp,fillsFallback:Object.values(Rp),strokes:Ep,sequentialColors:(0,n._uB)(Rp),divergingColors:[Rp.ORANGE,Rp.YELLOW,Rp.GREEN],hierarchyColors:[],secondSequentialColors:["#0083ff","#0076e6","#0069cc","#005cb3","#004f99","#004280","#003466","#00274c"],secondDivergingColors:[Rp.GREEN,Rp.YELLOW,Rp.RED],secondHierarchyColors:[],up:{fill:Rp.GREEN,stroke:Ep.GREEN},down:{fill:Rp.RED,stroke:Ep.RED},neutral:{fill:Rp.GRAY,stroke:Ep.GRAY},altUp:{fill:Rp.BLUE,stroke:Ep.BLUE},altDown:{fill:Rp.ORANGE,stroke:Ep.ORANGE},altNeutral:{fill:Rp.GRAY,stroke:Ep.GRAY}}}getTemplateParameters(){const e=super.getTemplateParameters();return e.set(n.oC3,Rp.BLUE),e.set(n.zVM,Rp.BLUE),e}},Bp={BLUE:"#0083ff",ORANGE:"#ff6600",GREEN:"#00af00",CYAN:"#00ccff",YELLOW:"#f7c700",VIOLET:"#ac26ff",GRAY:"#a7a7b7",MAGENTA:"#e800c5",BROWN:"#b54300",RED:"#ff0000"},Fp={BLUE:"#0f68c0",ORANGE:"#d47100",GREEN:"#007922",CYAN:"#009ac2",VIOLET:"#bca400",YELLOW:"#753cac",GRAY:"#646464",MAGENTA:"#9b2685",BROWN:"#6c3b00",RED:"#cb0021"},Vp=class extends Yu{getDefaultColors(){return{...super.getDefaultColors(),fills:Bp,fillsFallback:Object.values(Bp),strokes:Fp,sequentialColors:(0,n._uB)(Bp),divergingColors:[Bp.ORANGE,Bp.YELLOW,Bp.GREEN],hierarchyColors:[],secondSequentialColors:["#0083ff","#1a8fff","#339cff","#4da8ff","#66b5ff","#80c1ff","#99cdff","#b3daff"],secondDivergingColors:[Bp.GREEN,Bp.YELLOW,Bp.RED],secondHierarchyColors:[],up:{fill:Bp.GREEN,stroke:Fp.GREEN},down:{fill:Bp.RED,stroke:Fp.RED},neutral:{fill:Bp.GRAY,stroke:Fp.GRAY},altUp:{fill:Bp.BLUE,stroke:Fp.BLUE},altDown:{fill:Bp.ORANGE,stroke:Fp.ORANGE},altNeutral:{fill:Bp.GRAY,stroke:Fp.GRAY}}}getTemplateParameters(){const e=super.getTemplateParameters();return e.set(n.oC3,Bp.BLUE),e.set(n.zVM,Bp.BLUE),e}};function $p(e){const t=(0,n.Z6N)((()=>new Map),(e=>e.clear()));return(i,s=n.syG.resolveModuleScope())=>{const a=t.for(s);return a.has(i)||a.set(i,e(i,s)),a.get(i)}}var Hp=$p(((e,t)=>new Yu({},e,t))),jp=(()=>({"ag-default-dark":$p(((e,t)=>new hp({},e,t))),"ag-sheets-dark":$p(((e,t)=>new Lp({},e,t))),"ag-polychroma-dark":$p(((e,t)=>new Dp({},e,t))),"ag-vivid-dark":$p(((e,t)=>new zp({},e,t))),"ag-material-dark":$p(((e,t)=>new xp({},e,t))),"ag-financial-dark":$p(((e,t)=>new up({},e,t))),"ag-default":Hp,"ag-sheets":$p(((e,t)=>new Op({},e,t))),"ag-polychroma":$p(((e,t)=>new Ap({},e,t))),"ag-vivid":$p(((e,t)=>new Vp({},e,t))),"ag-material":$p(((e,t)=>new Sp({},e,t))),"ag-financial":$p(((e,t)=>new mp({},e,t)))}))(),Wp=(0,n.Z6N)((()=>
1({byValue:new Map,byObject:new Map})),(({byValue:e,byObject:t})=>{e.clear(),t.clear()})),_p=n.yar.create(!0,"perf","theme"),Gp=(e,t,i,s=n.syG.resolveModuleScope())=>{const{byValue:a,byObject:o}=Wp.for(s),r="object"==typeof e&&null!==e?e:void 0;let l;if(l=r?o.get(i)?.get(r):a.get(i)?.get(e),null==l)if(_p("[CACHE] ChartTheme","miss",Kp.name,[e,i]),l=Kp(e,t,i,s),r){let e=o.get(i);null==e&&(e=new WeakMap,o.set(i,e)),e.set(r,l)}else{let t=a.get(i);null==t&&(t=new Map,a.set(i,t)),t.set(e,l)}else _p("[CACHE] ChartTheme","hit",Kp.name,[e,i]);return l};function Kp(e,t=n.tr_,i=void 0,s=n.syG.resolveModuleScope()){if(e instanceof Yu)return e;const a=null==i?void 0:s.getPresetModule(i)?.baseTheme;if(!function(e,t){const{invalid:i}=(0,n.tfT)({theme:e},{theme:(0,n.or)(Xp,n.Ikc)},"",{logger:t});for(const e of i)t.warnOnce(String(e));return 0===i.length}(e,t))return a?Gp(a,t,i,s):Hp(i,s);if(null==e||"string"==typeof e){const t=jp[e??"ag-default"];if(t)return t(i,s);throw new Error(`Cannot find theme \`${e}\`.`)}const{cleared:o,invalid:r}=(0,n.tfT)(function(e){if(!(0,n.Gvm)(e)||!(0,n.Gvm)(e.baseTheme))return e;let t,i,s=e;const a=[];for(;"object"==typeof s;)t??(t=s.palette),i??(i=s.params),s.overrides&&a.push(s.overrides),s=s.baseTheme;return{baseTheme:s,overrides:(0,n.HFk)(...a),params:i,palette:t}}(e),Up,"theme",{logger:t});for(const e of r)t.warnOnce(String(e));const l=o?.baseTheme??a,h=l?Gp(l,t,i,s):Hp(i,s);return o?new h.constructor(o,i,s):h}var Yp=(0,n.fd6)({color:n.aXB,width:n.LyW}),Up=(()=>({baseTheme:(0,n.or)(n.YjP,n.Ikc),overrides:Oa,params:{accentColor:n.aXB,axisLineColor:n.aXB,backgroundColor:n.aXB,borderColor:n.aXB,borderRadius:n.aig,borderWidth:n.aig,chartBackgroundColor:n.aXB,chartPadding:n.LyW,focusShadow:n.YjP,foregroundColor:n.aXB,fontFamily:n.jjy,fontSize:n.aig,fontWeight:n.Wyg,gridLineColor:n.aXB,popupShadow:n.YjP,subtleTextColor:n.aXB,textColor:n.aXB,groupedCategoryLineColor:n.aXB,chromeBackgroundColor:n.aXB,chromeFontFamily:n.jjy,chromeFontSize:n.aig,chromeFontWeight:n.Wyg,chromeSubtleTextColor:n.aXB,chromeTextColor:n.aXB,buttonBackgroundColor:n.aXB,buttonBorder:(0,n.or)(n.zMY,Yp),buttonBorderRadius:n.aig,buttonFontWeight:n.Wyg,buttonTextColor:n.aXB,inputBackgroundColor:n.aXB,inputBorder:(0,n.or)(n.zMY,Yp),inputBorderRadius:n.aig,inputTextColor:n.aXB,menuBackgroundColor:n.aXB,menuBorder:(0,n.or)(n.zMY,Yp),menuBorderRadius:n.aig,menuTextColor:n.aXB,panelBackgroundColor:n.aXB,panelSubtleTextColor:n.aXB,tooltipBackgroundColor:n.aXB,tooltipBorder:(0,n.or)(n.zMY,Yp),tooltipBorderRadius:n.aig,tooltipTextColor:n.aXB,tooltipSubtleTextColor:n.aXB,crosshairLabelBackgroundColor:n.aXB,crosshairLabelTextColor:n.aXB},palette:{fills:(0,n.jk9)(n.rTu),strokes:(0,n.jk9)(n.yWT),up:{fill:(0,n.or)(n.yWT,n.MPH),stroke:n.yWT},down:{fill:(0,n.or)(n.yWT,n.MPH),stroke:n.yWT},neutral:{fill:(0,n.or)(n.yWT,n.MPH),stroke:n.yWT}}}))(),Xp=(0,n.KCZ)("ag-default","ag-default-dark","ag-sheets","ag-sheets-dark","ag-polychroma","ag-polychroma-dark","ag-vivid","ag-vivid-dark","ag-material","ag-material-dark","ag-financial","ag-financial-dark");function Zp(e,t=n.syG.resolveModuleScope()){const i=e.series?.[0]?.type??"line";return t.getSeriesModule(i)?.chartType??function(e){const t=$u.get(e);return t?.type===n.nR2.Series?t.chartType:void 0}(i)??"unknown"}var qp=new Set(Object.values(n.nR2));function Qp(e){const t=e;return"object"==typeof t&&null!=t&&"string"==typeof t.type&&qp.has(t.type)&&"string"==typeof t.name&&"string"==typeof t.version}function Jp(e){const t=[];for(const i of e?.flat()??[]){if(!Qp(i))throw new Error(`AG Charts - \`modules\` must contain modules exported by ag-charts-community or ag-charts-enterprise, such as LineSeriesModule; received ${JSON.stringify(i)}.`);t.push(i)}return n.syG.resolveModuleScope(t)}var eg="path",tg="pathArray",ig="default",ng="override",sg="user",ag="userPartial",og="operation",rg="operationValue",lg="dependency",hg="autoEnable",cg="autoEnableValue",dg="prune",ug="childrenSource";function pg(e){return(0,n.EtT)(e)&&e>=0&&e<=1}function gg(e,t){let i=e;for(const e of t){if(!("string"==typeof e&&null!=i&&("object"==typeof i||Array.isArray(i))&&e in i))return!1;i=i[e]}return!0}function mg(e,t){let i=e;for(const e of t){if(!("string"==typeof e&&null!=i&&("object"==typeof i||Array.isArray(i))&&e in i))return;i=i[e]}return i}function yg(e,t,i){const s=t.length;if(0===s)return;let a=e;const o=s-1,r=t[o];for(let e=0;e<o;e++){const i=t[e],s=t[e+1];let o=a[i];null!=o&&(0,n.Z4x)(o)||(o=Number.isNaN(Number(s))?{}:[],a[i]=o),a=o}a[r]=i}var fg=/^\d+$/;function xg(e,t=0){const i=function(e,t=0){let i=0;for(let n=e.length-1;n>=0;n--){const s=e[n];if(fg.test(s)&&(i++,i>t))return n}return-1}(e,t);return Number(e[i])}function bg(e,t,i){const n=t.split("/");let s=[...e];t.startsWith("/")&&(s=[],n.shift());let a=!1;for(const t of n){if(".."===t)s.pop(),a||s.pop();else if("."===t)s.pop();else if("$index"===t){const t=xg(e);
1if(Number.isNaN(t))return vg;s.push(`${t}`)}else if("$prevIndex"===t){const t=xg(e);if(Number.isNaN(t)||Number(t)<=0)return vg;s.push(""+(Number(t)-1))}else if(t.startsWith("$")){const e=i?.[t.slice(1)];if(null==e)return vg;s.push(e)}else 0!==t.length&&s.push(t);a=".."===t}return s}var vg=Symbol("unresolvable-path"),Sg=Symbol("resolved-to-branch");function Mg(e,t,i){if(null==e||"object"!=typeof e||Array.isArray(e))return;if(i??(i=Object.keys(e)),0===i.length)return;const s=function(e,t,i){if("ref"in e&&"string"==typeof e.ref){let s=0;const a=i.at(-1);if(a&&Fg.has(a)&&(s=1),i.length===1+s)return{operation:"$ref",values:[e.ref]};if("mix"in e&&"number"==typeof e.mix){if(i.length===2+s)return{operation:"$opacity",values:[{$ref:e.ref},(0,n.qE8)(0,e.mix,1)]};const a=1-(0,n.qE8)(0,e.mix,1);if("onto"in e&&"string"==typeof e.onto&&"ontoColor"in e&&"string"==typeof e.ontoColor&&i.length===4+s)return t.warnOnce("`onto` and `ontoColor` are mutually exclusive, ignoring `ontoColor`."),{operation:"$mix",values:[{$ref:e.ref},{$ref:e.onto},a]};if("onto"in e&&"string"==typeof e.onto&&i.length===3+s)return{operation:"$mix",values:[{$ref:e.ref},{$ref:e.onto},a]};if("ontoColor"in e&&"string"==typeof e.ontoColor&&i.length===3+s)return{operation:"$mix",values:[{$ref:e.ref},e.ontoColor,a]}}}}(e,t,i);if(s)return s;const a=i[0];return Fg.has(a)?{operation:a,values:Array.isArray(e[a])?e[a]:[e[a]]}:void 0}var kg={$cacheMax:function(e,t,i){const[n]=i,s=e.getPathArray(t),a=e.getCachedValue(s,"$cacheMax"),o=e.resolveVertexValue(t,n);if("number"!=typeof o)return a;if("number"!=typeof a)return e.setCachedValue(s,"$cacheMax",o),o;const r=Math.max(a,o);return e.setCachedValue(s,"$cacheMax",r),r}};var Dg={$hasSeriesType:{dependencies:wg,resolve:function(e,t,i){const[n]=i,s=e.resolveVertexValue(t,n),a=e.getResolvedPath(["series"]);if(!Array.isArray(a))return!1;for(const e of a)if(e.type===s)return!0;return!1}},$isChartType:{dependencies:wg,resolve:function(e,t,i){const[n]=i,s=e.resolveVertexValue(t,n),a=e.getResolvedPath(["series","0","type"]);if("string"!=typeof a)return!1;const o=e.moduleRegistry.getSeriesModule(a);if(null==o)return!1;switch(s){case"cartesian":return"cartesian"===o.chartType;case"polar":return"polar"===o.chartType;case"standalone":return"standalone"===o.chartType}return!1}},$isPackageType:function(e,t,i){const[s]=i,a=e.resolveVertexValue(t,s),o=n.syG.isEnterprise();return"enterprise"===a?o:"community"===a&&!o},$isSeriesType:{dependencies:wg,resolve:function(e,t,i){const[n]=i,s=e.resolveVertexValue(t,n);return e.getResolvedPath(["series","0","type"])===s}}};function wg(e,t,i){const n=e.findVertexAtPath(["series","0","type"]);n&&e.addEdge(t,n,lg)}var Ig={$foregroundBackgroundMix:function(e,t,i){const[s]=i,a=e.resolveVertexValue(t,s),o=e.getParamValue("foregroundColor"),r=e.getParamValue("backgroundColor");if("string"==typeof o&&"string"==typeof r&&pg(a))return n.Q1f.mix(n.Q1f.fromString(o),n.Q1f.fromString(r),1-a).toString();n.yar.inDevelopmentMode((()=>e.warnOnce(`\`$foregroundBackgroundMix\` json operation failed on [${String(a)}}}] at [${e.getPathArray(t).join(".")}], expecting a number between 0 and 1.`)))},$foregroundOpacity:function(e,t,i){const[s]=i,a=e.resolveVertexValue(t,s),o=e.getParamValue("foregroundColor");if("string"==typeof o&&pg(a)){const e=n.Q1f.fromString(o);return new n.Q1f(e.r,e.g,e.b,a).toString()}n.yar.inDevelopmentMode((()=>e.warnOnce(`\`$foregroundOpacity\` json operation failed on [${String(a)}}}] at [${e.getPathArray(t).join(".")}], expecting a number between 0 and 1.`)))},$interpolate:function(e,t,i){const[s,a]=i,o=e.resolveVertexValue(t,s),r=e.resolveVertexValue(t,a);if(!(0,n.cyL)(o)||!(0,n.EtT)(r))return;return n.Q1f.interpolate(o.map((e=>n.Q1f.fromString(e))),r).map((e=>e.toString()))},$isGradient:function(e,t,i){const[s]=i,a=e.resolveVertexValue(t,s);return(0,n.MBc)(a)},$isImage:function(e,t,i){const[s]=i,a=e.resolveVertexValue(t,s);return(0,n.BF9)(a)},$isPattern:function(e,t,i){const[s]=i,a=e.resolveVertexValue(t,s);return(0,n.EDy)(a)},$mix:function(e,t,i){const[s,a,o]=i,r=e.resolveVertexValue(t,s),l=e.resolveVertexValue(t,a),h=e.resolveVertexValue(t,o),c=e.getPathArray(t),d=`\`$mix\` json operation failed on [${String(r)}, ${String(l)}, ${String(h)}] at [${c.join(".")}], expecting`,u=`${d} two colors and a number between 0 and 1.`;if("string"!=typeof l||!pg(h))return void n.yar.inDevelopmentMode((()=>e.warnOnce(u)));if("string"==typeof r)try{return n.Q1f.mix(n.Q1f.fromString(r),n.Q1f.fromString(l),h).toString()}catch{return void n.yar.inDevelopmentMode((()=>e.warnOnce(u)))}if(!(0,n.MBc)(r))return void n.yar.inDevelopmentMode((()=>e.warnOnce(u)));let p=r.colorStops;try{p=p?.map((e=>{let t;return"string"==typeof e.color&&(t=n.Q1f.mix(n.Q1f.fromString(e.color),n.Q1f.fromString(l),h).toString()),{...e,color:t}}))}catch{return void n.yar.inDevelopmentMode((()=>e.warnOnce(`${d} a gradient, a color and a number between 0 and 1.`)))}return{...r,colorStops:p}},$opacity:function(e,t,i){const[s,a]=i,o=e.resolveVertexValue(t,s),r=e.resolveVertexValue(t,a);if("string"==typeof o&&pg(r)){const e=n.Q1f.fromString(o);return new n.Q1f(e.r,e.g,e.b,r).toString()}n.yar.inDevelopmentMode((()=>e.warnOnce(`\`$opacity\` operation failed on [${String(o)}, ${String(r)}}}] at [${e.getPathArray(t).join(".")}], expecting a color and a number between 0 and 1.`)))}};var Ag={$rem:function(e,t,i){const[s,a]=i,o=e.getVertexValue(s),r=a?e.getVertexValue(a):"fontSize",l=e.getParamValue(r);if("number"==typeof l&&"number"==typeof o)return Math.round(o*l);n.yar.inDevelopmentMode((()=>e.warnOnce(`\`$rem\` json operation failed on [${String(o)}] at [${e.getPathArray(t).join(".")}], expecting a number.`)))}};var Cg={$and:function(e,t,i){for(const n of i){const s=e.resolveVertexValue(t,n);if(1===i.length&&Array.isArray(s))return s.every(Boolean);if(!s)return!1}return!0},$eq:function(e,t,i){let n,s=!0;for(const a of i){const i=e.resolveVertexValue(t,a);if(s)n=i,s=!1;else if(i!==n)return!1}return!0},$every:function(e,t,i){const[n,s]=i,a=e.getVertexValue(n),o=e.resolveVertexValue(t,s);if(!Array.isArray(o))return;let r=0;for(const i of o){if(!e.graftAndResolveOrphanValue(t,a,`${r}`,i))return!1;r++}return!0},$greaterThan:function(e,t,i){const[n,s]=i;return e.resolveVertexValue(t,n)>e.resolveVertexValue(t,s)},$if:function(e,t,i){const[n,s,a]=i,o=Boolean(e.resolveVertexValue(t,n)),r=o?s:a;return r?Ng(e,t,r):o},$isType:function(e,t,i){const[s,a,o,r]=i,l=e.resolveVertexValue(t,a),h=e.resolveVertexValue(t,s),c=(0,n.cyL)(l)?l.some((i=>Pg(e,t,h,i))):Pg(e,t,h,l),d=c?o:r;return d?Ng(e,t,d):c}
1,$lessThan:function(e,t,i){const[n,s]=i;return e.resolveVertexValue(t,n)<e.resolveVertexValue(t,s)},$not:function(e,t,i){const[n]=i;if(!n)return;return!e.resolveVertexValue(t,n)},$or:function(e,t,i){for(const n of i){const s=e.resolveVertexValue(t,n);if(1===i.length&&Array.isArray(s))return s.some(Boolean);if(s)return!0}return!1},$some:function(e,t,i){const[n,s]=i,a=e.getVertexValue(n),o=e.resolveVertexValue(t,s);if(!Array.isArray(o))return;let r=0;for(const i of o){if(e.graftAndResolveOrphanValue(t,a,`${r}`,i))return!0;r++}return!1},$switch:function(e,t,i){const[n,s,...a]=i,o=e.resolveVertexValue(t,n);for(const i of a){const n=e.getVertexValue(i);if(!Array.isArray(n))continue;const[s,a]=n;if(o===s||Array.isArray(s)&&s.includes(o))return e.graftAndResolveOrphanValue(t,a,"value",void 0)}return e.resolveVertexValue(t,s)}};function Ng(e,t,i){const n=e.neighboursWithEdgeValue(i,eg);if(n)for(const i of n){const n=e.getVertexValue(i),s=e.findNeighbourWithValue(t,n,eg);s?e.mergeConditionalBranch(s,i):e.addEdge(t,i,eg)}return e.resolveVertexValue(t,i)}var Lg={array:n.cyL,boolean:n.Lmq,date:n.$PY,function:n.Tnt,nullish:e=>null==e,number:n.EtT,object:n.Gvm,string:n.KgX};function Pg(e,t,i,s){return(0,n.KgX)(s)&&Object.hasOwn(Lg,s)?Lg[s](i):(n.yar.inDevelopmentMode((()=>e.warnOnce(`\`$isType\` json operation failed on [${String(s)}] at [${e.getPathArray(t).join(".")}], expecting one of [${Object.keys(Lg).join(", ")}].`))),!1)}var Tg={$circular:function(e,t,i){const[n]=i;e.setResolveFresh(!0);const s=e.resolveVertexValue(t,n);return e.setResolveFresh(!1),s},$isUserOption:function(e,t,i){const[n,s,a]=i;let o=!1;const r=e.neighboursWithEdgeValue(n,eg);if(r)for(const i of r){const n=e.findNeighbour(i,ig);if(n&&Og(e,t,n)){o=!0;break}}else o=Og(e,t,n);const l=o?s:a;return l?e.resolveVertexValue(t,l):o},$palette:function(e,t,i){const[s]=i,a=e.resolveVertexValue(t,s);if(!(0,n.KgX)(a))return;if(Rg.has(a)){const i=xg(e.getPathArray(t));if(Number.isNaN(i))return;switch(a){case"fill":return(0,n.XKp)(e.palette.fills,1,i)[0];case"fillFallback":return(0,n.XKp)(e.palette.fillsFallback,1,i)[0];case"stroke":return(0,n.XKp)(e.palette.strokes,1,i)[0];case"gradient":return(0,n.XKp)(e.palette.sequentialColors,1,i)[0];case"range2":return(0,n.XKp)(e.palette.fills,2,i)}return}if("gradients"===a)return e.palette.sequentialColors;if("type"===a)return e.paletteType;const o=mg(e.palette,a.split("."));return Array.isArray(o)?[...o]:"object"==typeof o?{...o}:o},$mapPalette:function(e,t,i){const[s]=i,a=e.resolveVertexValue(t,s);if(!(0,n.KgX)(a))return;if(Rg.has(a)){let i=xg(e.getPathArray(t)),s=0;const o=["series","0","type"];for(let t=0;t<i;t++){o[1]=`${t}`;const i=e.getResolvedPath(o);"map-shape-background"!==i&&"map-line-background"!==i||s++}if(i-=s,Number.isNaN(i))return;switch(a){case"fill":return(0,n.XKp)(e.palette.fills,1,i)[0];case"fillFallback":return(0,n.XKp)(e.palette.fillsFallback,1,i)[0];case"stroke":return(0,n.XKp)(e.palette.strokes,1,i)[0];case"gradient":return(0,n.XKp)(e.palette.sequentialColors,1,i)[0];case"range2":return(0,n.XKp)(e.palette.fills,2,i)}return}if("gradients"===a)return e.palette.sequentialColors;if("type"===a)return e.paletteType;const o=mg(e.palette,a.split("."));return Array.isArray(o)?[...o]:"object"==typeof o?{...o}:o},$path:{dependencies:Eg,resolve:function(e,t,i){const s=i.length>1,a=i.length>2,[o,r,l]=i,h=e.resolveVertexValue(t,o),c=a?e.resolveVertexValue(t,l):null;if(!(0,n.KgX)(h))throw new Error(`\`$path\` json operation failed on [${String(h)}], expecting a string.`);const d=bg(e.getPathArray(t),h);if(d===vg)return;const u=c?mg(c,d):e.getResolvedPath(d);if(null!=u)return u;if(s)return e.resolveVertexValue(t,r)}},$pathString:{dependencies:Eg,resolve:function(e,t,i){const[s,a]=i,o=e.resolveVertexValue(t,s);if(!(0,n.KgX)(o))throw new Error(`\`$path\` json operation failed on [${String(o)}], expecting a string.`);let r;a&&(r=e.graftAndResolveOrphan(t,a));const l=e.getPathArray(t),h=bg(l,o,r);if(h===vg)throw new Error(`Unresolvable path [${o}] at [${l.join(".")}]`);return h}},$preset:function(e,t,i){const[n,s]=i,a=e.getVertexValue(n),o=bg([],a);if(o===vg)throw new Error(`Unresolvable preset path [${a}] at [${e.getPathArray(t)}]`);const r=e.getPresetValue(o);if(null==r)return s?e.getVertexValue(s):void 0;return r},$ref:function(e,t,i){const[n]=i,s=e.getVertexValue(n);return e.getParamValue(s)}};function Og(e,t,i){const s=e.resolveVertexValue(t,i);if(!(0,n.KgX)(s))throw new Error(`\`$isUserOption\` json operation failed on [${String(s)}], expecting a string.`);const a=e.getPathArray(t),o=bg(a,s);if(o===vg)return!1;if(e.hasUserOption(o))return!0;return!("enabled"===a.at(-1)&&"enabled"!==o.at(-1))&&e.hasThemeOverride(o)}var Rg=new Set(["fill","fillFallback","stroke","gradient","range2"]);function Eg(e,t,i){const[s]=i,a=e.getVertexValue(s);if((0,n.KgX)(a)){const i=bg(e.getPathArray(t),a);if(i===vg)return;const n=e.findVertexAtPath(i);n&&e.addEdge(t,n,lg)}}function zg(e){return"number"==typeof e?{top:e,right:e,bottom:e,left:e}:(0,n.QdQ)(e)?e:void 0}var Bg={...kg,...Dg,...Ig,...Ag,...Tg,...Cg,...{$isEven:function(e,t,i){const[n]=i,s=e.resolveVertexValue(t,n);return!Number.isNaN(Number(s))&&Number(s)%2==0}},...{$apply:function(e,t,i){const[s,a,o,r]=i,l=e.getVertexValue(s);if(!(0,n.QdQ)(l))return;const h=a?e.getVertexValue(a):void 0,c=e.neighboursWithEdgeValue(t,eg),d=c&&c.length>0;if(!d&&null==h)return Sg;const u=o?e.resolveVertexValue(t,o):void 0,p=r?e.resolveVertexValue(t,r):void 0;if(!d&&null!=h)if(Mg(h,e)){const i=e.resolveVertexValue(t,a);(0,n.QdQ)(i)&&e.graftObject(t,i,[u,p])}else e.graftObject(t,h,[u,p]);if(!d)return Sg;for(const t of c){const i=e.neighboursWithEdgeValue(t,eg);
1if(i&&0!==i.length)e.graftObject(t,l,[u,p]);else{const i=e.addVertex({});e.addEdge(t,i,ig)}}return Sg},$applyCycle:function(e,t,i){const[n,s,a]=i,o=e.resolveVertexValue(t,n);if("number"!=typeof o)return;const r=e.getPathArray(t),l=e.dangerouslyGetUserOption(r),h=e.hasThemeOverride(r),c=null==l?void 0:sg,d=l??e.resolveVertexValue(t,s);if(!Array.isArray(d))return;const u=a?e.getVertexValue(a):void 0;for(let i=0;i<o;i++){const n=d[i%d.length];null!=n&&(!l&&h||e.graftValue(t,`${i}`,n,void 0,c),u&&e.graftValue(t,`${i}`,u,n,c))}return Sg},$applyPadding:function(e,t,i){const[n]=i,s=e.getPathArray(t),a=e.dangerouslyGetUserOption(s),o=e.dangerouslyGetThemeOverride(s)??e.dangerouslyGetThemeOverride(function(e){return e.filter((e=>!/^\d+$/.test(e)))}(s)),r=zg(e.resolveVertexValue(t,n));if(null==r)return;const l=zg(o),h=zg(a);e.graftObject(t,r,void 0,ig),l&&e.graftObject(t,l,void 0,ng);h&&e.graftObject(t,h,void 0,sg);return Sg},$applySwitch:function(e,t,i){const[n,s,...a]=i,o=e.resolveVertexValue(t,n);for(const i of a){const n=e.getVertexValue(i);if(!Array.isArray(n))continue;const[s,a]=n;if(o===s||Array.isArray(s)&&s.includes(o))return e.graftObject(t,a,[],ig),Sg}return e.resolveVertexValue(t,s)},$applyTheme:function(e,t,i){const[n,s,a]=i;let o=e.getVertexValue(n);"string"==typeof o&&(o=[o]);if(!Array.isArray(o))return;const r=e.neighboursWithEdgeValue(t,eg),l=a?e.getVertexValue(a):[],h=Array.isArray(l)?new Set(l):new Set;if(!r)return Sg;for(const t of r){const i=e.graftAndResolveOrphan(t,s);for(const n of o){const s=bg([],n,i);s!==vg&&e.graftConfig(t,s,h)}}return Sg},$clone:function(e,t,i){const[s]=i,a=e.resolveVertexValue(t,s);if(!(0,n.QdQ)(a))return;return e.graftObject(t,a,void 0,sg),Sg},$findFirstSiblingNotOperation:function(e,t,i){const[n]=i,s=e.getPathArray(t),a=bg(s,"..");if(a===vg)return;const o=e.findVertexAtPath(a);if(!o)return e.resolveVertexValue(t,n);const r=e.neighboursWithEdgeValue(o,eg);if(r)for(const t of r){const i=e.getPathArray(t);if(i[a.length]===s[a.length])continue;const n=i.concat(s.slice(a.length+1)),o=e.findVertexAtPath(n);if(!o)continue;const r=e.findNeighbourValue(o,sg);if(null!=r)return r;const l=e.findNeighbourValue(o,ng);if(null!=l)return l}return e.resolveVertexValue(t,n)},$map:function(e,t,i){const[n,s]=i,a=e.getVertexValue(n),o=e.resolveVertexValue(t,s);if(!Array.isArray(o))return;const r=e.neighboursWithEdgeValue(t,eg);if(r&&r.length>0)return;let l=0;for(const i of o)e.graftValue(t,`${l}`,a,i),l++;return Sg},$merge:function(e,t,i){for(const s of i){const i=e.resolveVertexValue(t,s);(0,n.QdQ)(i)&&e.graftObject(t,i)}return Sg},$omit:function(e,t,i){const[s,a]=i;let o=e.getVertexValue(s);if(!Array.isArray(o)){const i=function(e,t,i){const n=Mg(e.getVertexValue(i),e);switch(n?.operation){case"$path":{const[i]=n.values,s=bg(e.getPathArray(t),i);if(s===vg)return;return e.findVertexAtPath(s)}case"$value":return t}}(e,t,a);if(!i)return;o=e.resolveVertexValue(i,s)}const r=e.resolveVertexValue(t,a);if(!Array.isArray(o)||!(0,n.QdQ)(r))return;return(0,n.FFB)(r,o)},$size:function(e,t,i){const[s]=i,a=e.resolveVertexValue(t,s);return(0,n.Z4x)(a)?"length"in a?a.length:Object.keys(a).length:0},$shallow:function(e,t,i){const n=e.getPathArray(t),s=e.hasUserOption(n);if(!s&&1===i.length)return e.resolveVertexValue(t,i[0]);const a=[];for(const t of i)a.push(e.getVertexValue(t));if(s)return e.prune(t,[ng,ig]),Sg;return e.graftObject(t,a),Sg},$shallowSimple:function(e,t,i){const n=[];for(const t of i)n.push(e.getVertexValue(t));return n},$value:function(e,t,i){const[n]=i,s=e.getVertexValue(n),a=e.getPathArray(t);if("$index"===s)return xg(a);if("$parentIndex"===s)return xg(a,1);if("$1"===s)return e.resolveValue$1(a)}}},Fg=new Set(Object.keys(Bg));function Vg(e){return Fg.has(e)}var $g=class{constructor(){this.entries=new n.qKc(512)}clear(){this.entries.clear()}invalidateIfStale(e){this.resolvedState!==e&&(this.resolvedState=e,this.entries.clear())}keyFor(e,t,i){if(null!=i?.proxyPaths)return;const n=[e.join("."),!0===i?.permissivePath?"P":"-",!1===i?.pick?"K":"-"];return jg(n,t,0)?n.join("\0"):void 0}read(e){const t=this.entries.get(e);if(t)return{value:t.value&&Hg(t.value)}}write(e,t){this.entries.set(e,{value:t&&Hg(t)})}};function Hg(e){return Array.isArray(e)?[...e]:{...e}}function jg(e,t,i){if(i>6)return!1;if(null===t)return e.push("null"),!0;switch(typeof t){case"undefined":return e.push("undefined"),!0;case"string":return e.push("s",t),!0;case"number":case"bigint":case"boolean":return e.push(typeof t,String(t)),!0;case"object":break;default:return!1}if(Array.isArray(t)){e.push("[");for(const n of t)if(!jg(e,n,i+1))return!1;return e.push("]"),!0}if(!(0,n.QdQ)(t))return!1;e.push("{");for(const n of Object.keys(t))if(e.push(n),!jg(e,t[n],i+1))return!1;return e.push("}"),!0}var Wg=n.yar.create("opts","options-graph"),_g=(0,n.FAd)(Gg);function Gg(e,t,i,n,s){return Wg.group("OptionsGraph.constructor()",(()=>{const a=new Xg(e.config,t,e.params,e.getThemeParameters(),e.palette,e.overrides,e.getTemplateParameters(),i,n,s);return{resolve:e=>a.resolve(e),resolveParams:()=>a.resolveParams(),resolveAnnotationThemes:()=>a.resolveAnnotationThemes(),resolvePartial:(e,t,i,n,s)=>a.resolvePartial(e,t,i,n,s),clearSafe:()=>a.clearSafe()}}))}var Kg=new Set(["context","data","topology"]),Yg=new Set(["placement","orientation"]),Ug=(()=>{var e=class e extends n.TS0{constructor(t={},i={},s=void 0,a={},o={},r=void 0,l=new Map,h={},c={},d=n.syG.resolveModuleScope()){super({cachedNeighboursEdge:eg,processedEdge:og,singleValueEdges:new Set([ag,sg])}),this.config=t,this.userOptions=i,this.palette=o,this.overrides=r,this.internalParams=l,this.cssVariables=h,this.presetOptions=c,this.moduleRegistry=d,this.pendingWarnings=[],this.edgePriority=[...e.EDGE_PRIORITY],this.graftEdge=e.GRAFT_EDGE,this.resolvedParams={},this.resolvedAnnotations={},this.value$1=new Map,this.cachedPathVertices=new Map,this.cachedPartials=new $g,this.hasUnsafeClearKeys=!1,this.rollbackVertices=[],this.rollbackEdgesFrom=[],this.rollbackEdgesTo=[],this.rollbackEdgesValue=[],this.isRollingBack=!1,this.resolvedRootAncestorsPaths=new Set,this.resolveFresh=!1,this.EMPTY_PATH_ARRAY_VERTEX=this.addVertex([]),this.root=this.addVertex("root"),this.params=this.addVertex("params"),this.annotations=this.addVertex("annotations"),this.paletteType=(0,n.Gvm)(i?.theme)?Hu(i.theme?.palette):"inbuilt";const u=this.resolveSeriesType();this.seriesType=u,Wg("build user"),this.buildGraphFromObject(this.root,sg,(0,n.FFB)(i,["theme"])),Wg("build defaults"),this.buildGraphFromObject(this.root,ig,(0,n.FFB)(t[u],e.COMPLEX_KEYS));const p=r?(0,n.FFB)(r[u],e.COMPLEX_KEYS):{};Object.keys(p).length>0&&(Wg("build series overrides"),this.buildGraphFromObject(this.root,ng,p));const g=r?(0,n.FFB)(r.common,e.COMPLEX_KEYS):{};if(Object.keys(g).length>0&&(Wg("build common overrides"),this.buildGraphFromObject(this.root,ng,"cartesian"===this.moduleRegistry.getSeriesModule(u)?.chartType?g:(0,n.FFB)(g,["zoom","navigator"]))),s){Wg("build params"),this.buildGraphFromObject(this.params,ig,s);this.findAndWarnParamsCycle(this.neighboursWithEdgeValue(this.params,eg))&&(this.params=this.addVertex("params"),this.buildGraphFromObject(this.params,ig,a))}const m=this.findNeighbourWithValue(this.root,"axes",eg),y=this.findNeighbourWithValue(this.root,"series",eg);m&&(Wg("build axes"),this.buildGraphFromObject(m,ig,{$applyTheme:[["/$seriesType/axes/$axisType/$position","/$seriesType/axes/$axisType"],{seriesType:{$path:["/series/0/type",u]},axisType:{$path:["./type","category"]},position:{$path:["./position"]}},["top","right","bottom","left"]]})),y&&(Wg("build series"),this.buildGraphFromObject(y,ig,{$applyTheme:["/$seriesType/series",{seriesType:{$path:["./type","line"]}}]}));const f=(0,n.FFB)(t[u]?.annotations??{},e.ANNOTATIONS_OPTIONS_KEYS);Object.keys(f).length>0&&(Wg("build annotations type config"),this.buildGraphFromObject(this.annotations,ig,f));const x=(0,n.FFB)(r?.common?.annotations??{},e.ANNOTATIONS_OPTIONS_KEYS);Object.keys(x).length>0&&(Wg("build annotations type overrides"),this.buildGraphFromObject(this.annotations,ng,x));const b=(0,n.UpN)(t[u]?.annotations??{},e.ANNOTATIONS_OPTIONS_KEYS);Object.keys(b).length>0&&(Wg("build annotations config"),this.buildGraphFromObject(this.root,ig,{annotations:b}));const v=(0,n.UpN)(r?.common?.annotations??{},e.ANNOTATIONS_OPTIONS_KEYS);Object.keys(v).length>0&&(Wg("build annotations overrides"),this.buildGraphFromObject(this.root,ng,{annotations:v})),this.buildDependencyGraph()}static clearValueCache(){e.valueCache.clear()}warnOnce(e){null==this.activeLogger?this.pendingWarnings.push(e):this.activeLogger.w
1arnOnce(e)}clear(){Wg.group("OptionsGraph.clear()",(()=>{super.clear(),this.cachedPathVertices.clear(),this.cachedPartials.clear(),this.root=void 0,this.params=void 0,this.annotations=void 0,Wg("cleared")}))}resolveSeriesType(){const e=this.userOptions.series?.[0]?.type??"line";if(e in this.config)return e;const t=Object.keys(this.config);return t.find((e=>"cartesian"===this.moduleRegistry.getSeriesModule(e)?.chartType))??t[0]??e}clearSafe(){this.hasUnsafeClearKeys||this.clear()}resolve(e){return this.withLogger(e,(()=>Wg.group("OptionsGraph.resolve()",(()=>(this.resolved={},this.resolvedParams={},this.resolvedAnnotations={},Wg("resolve params"),this.resolveVertex(this.params,this.resolvedParams),Wg("resolve annotations"),this.resolveVertex(this.annotations,this.resolvedAnnotations),Wg("resolve root"),this.resolveVertex(this.root),Wg("resolved root",this.resolved),Wg("vertex count",this.getVertexCount()),Wg("edge count",this.getEdgeCount()),this.resolved)))))}resolveParams(){return this.resolvedParams}resolveAnnotationThemes(){return this.resolvedAnnotations}addVertex(e){const t=super.addVertex(e);return this.isRollingBack&&this.rollbackVertices.push(t),t}addEdge(e,t,i){const n=-1!==(this.neighboursWithEdgeValue(e,i)?.indexOf(t)??-1);this.isRollingBack&&!n&&(this.rollbackEdgesFrom.push(e),this.rollbackEdgesTo.push(t),this.rollbackEdgesValue.push(i)),super.addEdge(e,t,i)}mergeConditionalBranch(t,i){if(t!==i){for(const n of e.SOURCE_EDGES){const e=this.findNeighbour(i,n);e&&!this.findNeighbour(t,n)&&this.addEdge(t,e,n)}for(const e of this.neighboursWithEdgeValue(i,eg)??[]){const i=this.getVertexValue(e),n=this.findNeighbourWithValue(t,i,eg);n?this.mergeConditionalBranch(n,e):this.addEdge(t,e,eg)}}}resolvePartial(e,t,i,n,s){if(i)return this.withLogger(e,(()=>this.resolvePartialInternal(t,i,n,s)))}findVertexAtPath(e){const t=e.join(".");if(this.cachedPathVertices.has(t))return this.cachedPathVertices.get(t);const i=this.findVertexAlongEdge(this.root,e,eg);return i?(this.cachedPathVertices.set(t,i),i):void 0}hasUserOption(e){if(gg(this.userOptions,e))return!0;const t=this.findVertexAtPath(e);if(t){if(null!=this.findNeighbour(t,sg))return!0;if(null!=this.findNeighbour(t,ag))return!0;const e=this.findNeighbourValue(t,ug);return e===sg||e===ag}return!1}dangerouslyGetUserOption(e){if(this.userPartialOptions){const t=mg(this.userPartialOptions,e);if(null!=t)return t}return mg(this.userOptions,e)}dangerouslyGetThemeOverride(e){if(null!=this.overrides){if("axes"===e[0]&&e.length>1){const t=this.getResolvedPath(["axes",e[1],"type"]);return mg(this.overrides,[this.seriesType,"axes",t,...e.slice(2)])??mg(this.overrides,["common","axes",t,...e.slice(2)])}if("series"===e[0]&&e.length>1){const t=this.getResolvedPath(["series",e[1],"type"]);return mg(this.overrides,[t,"series",...e.slice(2)])}return mg(this.overrides,[this.seriesType,...e])??mg(this.overrides,["common",...e])??mg(this.overrides,e)}}hasThemeOverride(e){if(null==this.overrides)return!1;if("axes"===e[0]&&e.length>1){const t=this.getResolvedPath(["axes",e[1],"type"]);if(gg(this.overrides,["common","axes",t,...e.slice(2)]))return!0;const i=this.getResolvedPath(["series","0","type"]);return gg(this.overrides,[i,"axes",t,...e.slice(2)])}if("series"===e[0]&&e.length>1){const t=this.getResolvedPath(["series",e[1],"type"]);return gg(this.overrides,[t,"series",...e.slice(2)])}return gg(this.overrides,e)}getParamValue(e){const t=e.split("."),i=mg(this.resolvedParams,t);if(null!=i)return i;const n=this.findVertexAlongEdge(this.params,t,eg);if(!n)return;const s=this.findNeighbour(n,ig);if(!s)return;const a=this.resolveVertexValue(n,s);return yg(this.resolvedParams,t,a),a}getPresetValue(e){return mg(this.presetOptions,e)}getPathArray(e){return this.findNeighbourValue(e,tg)??[]}getResolvedPath(e){return mg(this.resolved,e)}getCachedValue(t,i){const n=[...t,i].join(".");return e.valueCache.get(n)}setCachedValue(t,i,n){const s=[...t,i].join(".");e.valueCache.set(s,n)}setResolveFresh(e){this.resolveFresh=e}prune(e,t){this.addEdge(e,this.addVertex(t),dg)}resolveVertexValue(e,t){this.resolveVertexDependencies(t);const i=this.findNeighbourValue(t,og);if(i&&Vg(i)){const n=this.neighboursWithEdgeValue(t,rg),s=Bg[i],a="function"==typeof s?s:s.resolve,o=a?.(this,e,n??[]);return o===Sg?void 0:this.resolveValueOrSymbol(o)}let n=this.getVertexValue(t);if(Array.isArray(n)){const i={};this.resolveVertexChildren(t,i),n=mg(i,this.getPathArray(e))}return this.resolveValueOrSymbol(n)}resolveValue$1(e){for(let t=e.length;t>=0;t--){const i=e.slice(0,t).join("."),n=this.value$1.get(i);if(null!=n)return n}}graftConfig(e,t,i){const s=mg(this.config,t),a=this.findNeighbour(e,tg);if((0,n.Gvm)(s)&&this.buildGraphFromObject(e,ig,s,a,void 0,i),this.overrides){const s=mg(this.overrides,t);(0,n.Gvm)(s)&&this.buildGraphFromObject(e,ng,s,a,void 0,i);const o=mg(this.overrides,["common",...t.slice(1)]);(0,n.Gvm)(o)&&this.buildGraphFromObject(e,ng,o,a,void 0,i)}this.buildDependencyGraph()}graftObject(e,t,i,n=this.graftEdge){const s=this.findNeighbour(e,tg);if(this.buildGraphFromObject(e,n,t,s),this.overrides&&i)for(const t of i){if(null==t)continue;const i=mg(this.overrides,t);i&&this.buildGraphFromObject(e,ng,i,s)}this.buildDependencyGraph()}graftValue(e,t,i,n,s=this.graftEdge){const a=[...this.getPathArray(e),t],o=this.findVertexAtPath(a)??this.addVertex(t);Mg(n,this)||(this.value$1.set(a.join("."),n),this.buildGraphFromValue(e,o,s,a,i),this.buildDependencyGraph())}graftAndResolveOrphan(e,t){const i={},n=this.addVertex(i),s=this.getPathArray(e);return this.graftAndResolveChildren(t,n,s,[]),this.resolveVertex(n,i),mg(i,s)}graftAndResolveOrphanValue(e,t,i,n=void 0,s=this.graftEdge){const a={}
1,o=this.addVertex(a),r=this.getPathArray(e),l=i?[...r,i]:r,h=this.findVertexAtPath(l)??this.addVertex(i);return this.value$1.set(l.join("."),n),this.buildGraphFromValue(o,h,s,l,t),this.resolveVertex(o,a),mg(a,l)}buildGraphFromObject(e,t,i,n,s=Kg,a){const o=Object.keys(i),r=Mg(i,this,o);if(r){const s=this.addVertex(i);return this.addEdge(e,s,t),void this.buildGraphFromOperation(s,t,r,n)}if(0===o.length)return this.addEdge(e,this.addVertex(Array.isArray(i)?[]:{}),t),void this.buildGraphAutoEnable(e,t,i,void 0);const l=this.getVertexChildrenByKey(e),h=n?this.getVertexValue(n):[];let c;Array.isArray(i)&&this.addEdge(e,this.addVertex(t),ug);const d=[...h],u=h.length;for(const n of o){if(a?.has(n))continue;const o=l?.get(n)??this.addVertex(n);d[u]=n;const r=Yg.has(n)&&Array.isArray(i[n]);s?.has(n)||r?this.buildShallowGraphFromValue(e,o,t,d,i[n]):this.buildGraphFromValue(e,o,t,d,i[n],s),"enabled"===n&&(c=o)}this.buildGraphAutoEnable(e,t,i,c)}buildGraphAutoEnable(e,t,i,n){if(t===ig&&!n)return;if(t===sg&&n)return;if(t!==ig&&t!==sg&&t!==ag&&t!==ng)return;let s=this.findNeighbour(e,hg);s||(s=this.addVertex(hg),this.addEdge(e,s,hg)),n&&this.addEdge(n,s,cg);const{enabled:a,_enabledFromTheme:o}=i;this.addEdge(s,this.addVertex({enabled:a,_enabledFromTheme:o,keys:Object.keys(i).length}),t)}getVertexChildrenByKey(e){const t=this.neighboursWithEdgeValue(e,eg);if(!t)return;const i=new Map;for(const e of t)i.set(this.getVertexValue(e),e);return i}buildGraphFromValue(e,t,i,s,a,o){this.addEdge(e,t,eg);let r=this.findNeighbour(t,tg);r||(r=this.addVertex([...s]),this.addEdge(t,r,tg));const l=Mg(a,this);if(l){const e=this.addVertex(a);this.addEdge(t,e,i),this.addEdge(e,r,tg),this.buildGraphFromOperation(e,i,l,r)}else if((0,n.Z4x)(a))this.buildGraphFromObject(t,i,a,r,o);else{const e=this.findNeighbour(t,i);if(e&&this.getVertexValue(e)===a)return;const n=this.addVertex(a);this.addEdge(t,n,i)}}buildShallowGraphFromValue(e,t,i,n,s){this.addEdge(e,t,eg);let a=this.findNeighbour(t,tg);a||(a=this.addVertex([...n]),this.addEdge(t,a,tg));const o=this.addVertex(s);this.addEdge(t,o,i)}buildGraphFromOperation(e,t,i,n){const s=this.addVertex(i.operation);this.addEdge(e,s,og);for(const s of i.values)this.buildGraphFromOperationValue(e,s,t,n)}buildGraphFromOperationValue(e,t,i,s=this.EMPTY_PATH_ARRAY_VERTEX){const a=this.addVertex(t);this.addEdge(e,s,tg),this.addEdge(e,a,rg);const o=Mg(t,this);o?this.buildGraphFromOperation(a,i,o,s):(0,n.Z4x)(t)&&this.buildGraphFromObject(a,i,t,s)}findAndWarnParamsCycle(e,t){let i=!1;if(!this.params||!e)return i;for(const n of e){if(!n)continue;if("string"==typeof n.value&&t?.includes(n.value))return this.warnOnce(`Infinite loop cycle found in theme params [${t.join(" -> ")}], ignoring.`),!0;const e=[...t??[]];"string"==typeof n.value&&e?.push(n.value);const s=this.findNeighbour(n,ig);s&&(i||(i=this.findAndWarnParamsCycleVertex(s,e)))}return i}findAndWarnParamsCycleVertex(e,t){let i=!1;const n=this.findNeighbourValue(e,og);if(!n||!Vg(n))return i;const s=this.neighboursWithEdgeValue(e,rg);if(!s)return i;if("$ref"===n){const e=this.findNeighbourWithValue(this.params,s[0].value,eg);i||(i=this.findAndWarnParamsCycle([e],t))}else for(const e of s)i||(i=this.findAndWarnParamsCycleVertex(e,[...t]));return i}buildDependencyGraph(){for(let e=0;e<this.pendingProcessingEdgesFrom.length;e++){const t=this.pendingProcessingEdgesFrom[e],i=this.pendingProcessingEdgesTo[e],n=this.getVertexValue(i);if(!Vg(n))continue;const s=this.neighboursWithEdgeValue(t,rg),a=Bg[n],o="function"==typeof a?void 0:a.dependencies;o?.(this,t,s??[])}this.pendingProcessingEdgesFrom=[],this.pendingProcessingEdgesTo=[]}refreshPendingProcessingEdges(e){const t=this.findNeighbour(e,ig)??e,i=this.findNeighbour(t,og);if(i){this.pendingProcessingEdgesFrom.push(t),this.pendingProcessingEdgesTo.push(i);const e=this.neighboursWithEdgeValue(t,rg);if(e)for(const t of e)this.refreshPendingProcessingEdges(t)}const n=this.neighboursWithEdgeValue(e,eg);if(n)for(const e of n)this.refreshPendingProcessingEdges(e)}resolveVertex(e,t=this.resolved,i){const s=this.getPathArray(e),a=s[0];if(1===s.length&&this.resolvedRootAncestorsPaths.add(a),!this.resolveFresh&&s.length>1&&!this.resolvedRootAncestorsPaths.has(a)){const e=this.findVertexAtPath([a]);if(e)return void this.resolveVertex(e,t,i)}if(!this.resolveFresh&&null==this.userPartialOptions&&t===this.resolved&&s.length>0){const e=mg(t,s);if(null!=e&&!(0,n.QdQ)(e))return}this.resolveVertexInEdgePriority(e,t,s,i),this.resolveVertexAutoEnable(e,t,s
1),this.resolveVertexChildren(e,t,i)}resolveVertexInEdgePriority(t,i,n,s){const a=n.at(-1),o=this.neighboursWithEdgeValue(t,eg),r=this.getEdgePriority(t,a),[l]=r;for(const h of r){const r=this.findNeighbour(t,h);if(null==r)continue;const c=this.resolveVertexValueInternal(t,r);if((null!=c||h===l)&&!(o&&o.length>0&&h!==l||Array.isArray(s)&&s.includes(h))){if(this.hasUnsafeClearKeys||(this.hasUnsafeClearKeys=null!=c&&e.UNSAFE_CLEAR_KEYS.has(a)),0===n.length){if(null==c)continue;this.resolved=c}else yg(i,n,c);break}}}getEdgePriority(t,i){let n=this.edgePriority;if(i in e.TRANSFORM_USER_KEY_OPERATION_PAIRS){const s=e.TRANSFORM_USER_KEY_OPERATION_PAIRS[i],a=Mg(this.findNeighbourValue(t,ng),this)?.operation.valueOf()===s,o=Mg(this.findNeighbourValue(t,ig),this)?.operation.valueOf()===s;a?n=[ng,ig]:o&&(n=[ig])}return n}resolveVertexValueInternal(e,t){this.resolveVertexDependencies(t);const i=this.findNeighbourValue(t,og);if(i&&Vg(i)){const n=this.neighboursWithEdgeValue(t,rg),s=Bg[i],a="function"==typeof s?s:s.resolve,o=a?.(this,e,n??[]);return o===Sg?void 0:this.resolveValueOrSymbol(o)}return this.resolveValueOrSymbol(this.getVertexValue(t))}resolveVertexAutoEnable(e,t,i){const n=this.neighboursWithEdgeValue(e,cg)?.[0];if(!n)return;const s=this.findVertexAtPath(i),a=this.findNeighbourValue(n,ig),o=this.findNeighbourValue(n,ng),r=this.findNeighbourValue(n,sg),l=s&&null!=this.findNeighbour(s,sg)?void 0:this.findNeighbourValue(n,ag);if(!1===l?.enabled)return;!(null!=r&&null==r.enabled||null!=l&&null==l.enabled)||a?._enabledFromTheme||o?._enabledFromTheme||yg(t,i,!0)}resolveVertexChildren(e,t,i){const n=this.neighboursWithEdgeValue(e,eg);if(n){i??(i=this.findNeighbourValue(e,dg));for(const e of n){const s=this.getVertexValue(e);n.length>1&&Vg(s)||"_enabledFromTheme"!==s&&this.resolveVertex(e,t,i)}}}resolveVertexDependencies(e){const t=this.neighboursWithEdgeValue(e,lg);if(t)for(const e of t)this.resolveVertex(e)}graftAndResolveChildren(e,t,i,s){const a=this.neighboursWithEdgeValue(e,eg);if(a)for(const e of a){const a=this.getVertexValue(e),o=[...i,a],r=[...s,a],l=this.addVertex(a),h=this.findNeighbourValue(e,ig);this.addEdge(t,l,eg);const c=this.addVertex(o);if(this.addEdge(l,c,tg),(0,n.Gvm)(h)){this.buildGraphFromObject(l,ig,h,c);const e=this.findNeighbour(l,ig);this.addEdge(e,this.addVertex(o),tg);const t=this.findNeighbourValue(e,og);if(Vg(t)){const i=this.neighboursWithEdgeValue(e,rg),n=Bg[t],s="function"==typeof n?void 0:n.dependencies;s?.(this,e,i??[])}}this.graftAndResolveChildren(e,l,o,r)}}resolveValueOrSymbol(e){return"symbol"==typeof e&&this.internalParams?.has(e)?this.internalParams.get(e):"string"==typeof e&&Object.hasOwn(this.cssVariables,e)?this.cssVariables[e]:e}snapshot(){Wg("snapshot"),this.isRollingBack=!0}rollback(){Wg(`rollback ${this.rollbackEdgesFrom.length} edges and ${this.rollbackVertices.length} vertices`);for(let e=0;e<this.rollbackEdgesFrom.length;e++){const t=this.rollbackEdgesFrom[e],i=this.rollbackEdgesTo[e],n=this.rollbackEdgesValue[e];this.removeEdge(t,i,n)}for(const e of this.rollbackVertices)this.removeVertex(e);this.cachedPathVertices.clear(),this.rollbackVertices=[],this.rollbackEdgesFrom=[],this.rollbackEdgesTo=[],this.rollbackEdgesValue=[],this.isRollingBack=!1}withLogger(e,t){const i=this.activeLogger;this.activeLogger=e;try{if(null!=e)for(const t of this.pendingWarnings.splice(0))e.warnOnce(t);return t()}finally{this.activeLogger=i}}resolvePartialInternal(e,t,i,n){if(!this.root)return;null!=n&&function(e,t){for(const i of Object.keys(t))if(e[i]!==t[i])return!0;return!1}(this.cssVariables,n)&&(this.cssVariables={...this.cssVariables,...n},this.cachedPartials.clear()),this.cachedPartials.invalidateIfStale(this.resolved);const s=this.cachedPartials.keyFor(e,t,i),a=null==s?void 0:this.cachedPartials.read(s);if(a)return a.value;const o=this.resolvePartialUncached(e,t,i);return null!=s&&this.cachedPartials.write(s,o),o}resolvePartialUncached(t,i,s){const{permissivePath:a,proxyPaths:o}=s??{},r=Object.keys(i),l=Wg.check()?`OptionsGraph.resolvePartial() - ${t.join(".")} [${r}]`:"";return Wg.group(l,(()=>{if(0===r.length)return{};const l=this.findVertexAtPath(t);if(!l){if(a)return;throw new Error(`Could not find vertex in OptionsGraph at path [${t.join(".")}].`)}const h=this.findNeighbour(l,tg);if(this.userPartialOptions={},yg(this.userPartialOptions,t,i),o)for(const e of Object.keys(o)){const n=o[e],s=mg(i,[e]);null!=s&&(yg(i,n,s),yg(this.userPartialOptions,[...t,...n],s),delete i[e],delete this.userPartialOptions[e])}this.graftEdge=ag,this.edgePriority=[ag,...e.EDGE_PRIORITY],this.snapshot(),this.buildGraphFromObject(l,ag,i,h);for(const e of r){const i=o?.[e]?this.findVertexAtPath([...t,...o[e]]):this.findNeighbourWithValue(l,e,eg);i&&this.refreshPendingProcessingEdges(i)}this.buildDependencyGraph();const c={};if(this.resolveVertex(l,c),this.rollback(),this.graftEdge=e.GRAFT_EDGE,this.edgePriority=e.EDGE_PRIORITY,this.userPartialOptions=void 0,o)for(const e of Object.keys(o)){const i=o[e],n=mg(c,[...t,...i]);yg(c,[...t,e],n)}const d=mg(c,t),u=s?.pick??!0?(0,n.UpN)(mg(c,t),r):d;return Wg("vertex count",this.getVertexCount()),Wg("edge count",this.getEdgeCount()),Wg("resolved partial",u),u}))}diagram(e,t=2){this.diagramKeys=new Map,this.diagramEdges=new Map;const i=this.findVertexAtPath(e),s=["---","config:"," layout: elk"," look: neo"," theme: redux","---","flowchart TB"];i&&this.diagramVertex(s,i,1,t),s.push("classDef UO fill: #e8f5e8, stroke: #4caf50"),s.push("classDef DE fill: #e3f2fd, stroke: #2196f3"),s.push("classDef DEP fill: #ffe0fd, stroke: #ff00f2"),s.push("classDef OP fill: #fff3e0, stroke: #ff9800"),s.push("classDef OPV fill: #fff3e0, stroke: #ff9800, stroke-width: 1px"),s.push("classDef OV fill: #e8f5ee, stroke: #4caf87"),n.tDR.log(s.join("\n"))}diagramKey(e){let t=this.diagramKeys.get(e);return t||(t=`${this.diagramKeys.size}`,this.diagramKeys.set(e,t)),t}diagramLabel(e,t,i){let n=this.diagramKeys.get(e);if(n)return n;n=this.diagramKey(e);let s=i?{[sg]:"UO",[ig]:"DE",[lg]:"DEP",[og]:"OP",[rg]:"OPV",[ng]:"OV"}[i]??void 0:void 0;return s=s?`:::${s}`:"","symbol"==typeof t.value?String.raw`${n}[/"[symbol]"\]${s}`:Array.isArray(t.value)?String.raw`${n}[/"[array]"\]${s}`:"object"==typeof t.value?String.raw`${n}[/"[object]"\]${s}`:i===ig||i===sg||i===ng?`${n}("${t.value}")${s}`:`${n}["${t.value}"]${s}`}diagramVertex(e,t,i,n){const s=this.getPathArray(t),a=s.length>0?s.join("."):"root";this.diagramNeighbours(e,a,t,i+1,n);let o=this.diagramKeys.get(a);o||(o=this.diagramKey(a),e.push(`\t${o}["${t.value}"]`))}diagramNeighbours(e,t,i,n,s){for(const a of this.neighboursWithEdgeValue(i,eg)??[]){const o=this.getPathArray(a),r=o.length>0?o.join("."):"root";n<s&&this.diagramVertex(e,a,n+1,s),this.diagramChild(e,eg,t,i,r,a)}const a=this.neighboursWithEdgeValue(i,sg)??[];let o=0;for(const n of a)this.diagramChild(e,sg,t,i,`${t}.${sg}.${o}`,n),o++;const r=this.neighboursWithEdgeValue(i,ig)??[];o=0;for(const a of r)this.diagramChildWithNeighbours(e,ig,t,i,`${t}.${ig}.${o}`,a,n+1,s),o++;const l=this.neighboursWithEdgeValue(i,og)??[];o=0;const[h]=l;h&&(this.diagramChildWithNeighbours(e,og,t,i,`${t}.${og}.${o}`,h,n+1,s),o++);const c=this.neighboursWithEdgeValue(i,rg)??[];o=0;for(const a of c)this.diagramChildWithNeighbours(e,rg,t,i,`${t}.${rg}.${o}`,a,n+1,s),o++;const d=this.neighboursWithEdgeValue(i,lg)??[];o=0;for(const a of d)this.diagramChildWithNeighbours(e,lg,t,i,this.getPathArray(a).join("."),a,n+1,s),o++}diagramChild(e,t,i,n,s,a){let o=this.diagramEdges.get(i);if(o?.has(s))return;o||(o=new Set,this.diagramEdges.set(i,o)),o.add(s);const r=t===eg?"":`|${t}|`;e.push(`\t${this.diagramLabel(i,n)} --\x3e${r} ${this.diagramLabel(s,a,t)}`)}diagramChildWithNeighbours(e,t,i,n,s,a,o,r){this.diagramChild(e,t,i,n,s,a),this.diagramNeighbours(e,s,a,o+1,r)}};return e.EDGE_PRIORITY=[sg,ng,ig],e.GRAFT_EDGE=ig,e.SOURCE_EDGES=[ig,ng,sg,ag],e.COMPLEX_KEYS=["annotations","axes","series"],e.ANNOTATIONS_OPTIONS_KEYS=["axesButtons","data","enabled","optionsToolbar","snap","toolbar","xKey","volumeKey"],e.UNSAFE_CLEAR_KEYS=new Set(["itemStyler","styler"]),e.TRANSFORM_USER_KEY_OPERATION_PAIRS={padding:"$applyPadding"},e.valueCache=new Map,e})(),Xg=Ug,Zg=(0,n.Z6N)((()=>new n.qKc(8)),(e=>e.clear())),qg=n.yar.create(!0,"perf","opts"),Qg=new Set(["data","container","document","window","
1styleContainer","context"]),Jg=["container","context"];function em(e){let t=!1;const i=(e,i)=>{if(!Qg.has(e)){if(!("function"==typeof i||i instanceof Date||i instanceof Map||i instanceof Set))return i;t=!0}};try{const n=JSON.stringify(e,i);if(t||!n)return;return`${n}|${function(e){if(!Array.isArray(e))return null==e?"no-data":"object";if(0===e.length)return"empty";const t=e.find((e=>null!=e));if(null==t)return"null";if("number"==typeof t)return"number";if(Array.isArray(t))return"tuple";if("object"==typeof t)return`object:${Object.keys(t).sort(((e,t)=>e.localeCompare(t))).join(",")}`;return typeof t}(e.data)}`}catch{return}}var tm=["backgroundRegions"];function im(){return{googleFonts:new Set,fonts:new Set}}function nm(e,t){const{fontFamily:i,fontWeight:s,fontStyle:a}=t;if("string"==typeof i)for(const t of i.split(",")){const i=t.trim().replace(/(^['"])|(['"]$)/g,"");""===i||n.dRv.has(i.toLowerCase())||e.add((0,n.q2v)({fontSize:16,fontFamily:i,fontWeight:s,fontStyle:a}))}}var sm=e=>`'${e}'`,am="__AXIS_ID_",om={top:n.tv$.X,bottom:n.tv$.X,left:n.tv$.Y,right:n.tv$.Y},rm={bubble:["minSize","maxSize"],"map-marker":["minSize","maxSize"],"map-line":["minStrokeWidth","maxStrokeWidth"]},lm=(()=>{var e=class e{constructor(t,i,s,a,o,r,l=!1,h=!1,c,d){this.themeParameters={},this.issues=[],this.revalidated=!0,this.unmappedAxisKeys=new Map,d??(d=function(e){const t=new n.bkB;return{logger:e,eventsHub:t,validations:new kh({logger:e,eventsHub:t})}}(new n.VyI)),this.logger=d.logger,this.validations=d.validations,this.optionMetadata=o??{},this.moduleRegistry=t instanceof e?t.moduleRegistry:Jp(this.optionMetadata.modules),this.processedOverrides=s??{};let u,p,g,m,y,f,x,b,v,S=null;t instanceof e?(S=t,this.specialOverrides=S.specialOverrides,r&&(this.userDeltaKeys=new Set(Object.keys(r))),null==r&&(r=(0,n.G4M)(S.userOptions,i,e.JSON_DIFF_OPTS,e.REMOVED),l||(l=e.containsRemovalSentinel(r))),this.userOptions=(0,n.Go6)((0,n.h1I)(r,S.userOptions),{...e.OPTIONS_CLONE_OPTS_SLOW,seen:[]})):(this.userOptions=(0,n.Go6)(t??i,{...e.OPTIONS_CLONE_OPTS_SLOW,seen:[]}),this.specialOverrides=this.specialOverridesDefaults({...a})),this.validations.configure({...bh(this.processedOverrides),...bh(this.userOptions)});const M=this.logger.onIssue((e=>this.issues.push(e))),k=h?this.validations.suspendFailFast():void 0;let D=!1;try{this.findSeriesWithUserVisiblity(i,r),l&&this.removeLeftoverSymbols(this.userOptions);const n=t instanceof e&&void 0!==r?.data&&r?.data?.length!==t.userOptions.data?.length,a=null==this.optionMetadata.presetType?void 0:this.moduleRegistry.getPresetModule(this.optionMetadata.presetType);l||h||null!=this.seriesWithUserVisibility||void 0===r||!e.isFastPathDelta(r,a?.fastUpdateKeys)||null==S||n?(e.perfDebug("ChartOptions.slowSetup()"),({activeTheme:u,processedOptions:p,themeParameters:m,annotationThemes:y,googleFonts:f,fonts:x,optionsGraph:b,remappedAxisKeys:v}=this.slowSetup(s,r,l))):(({activeTheme:u,processedOptions:p,fastDelta:g}=this.fastSetup(r,S)),m=S.themeParameters,y=S.annotationThemes,x=S.fonts,this.issues.push(...S.issues),this.revalidated=!1)}catch(e){throw D=!0,Be(e),this.logger.error(e),e}finally{D&&null!=S&&this.validations.configure(bh(S.processedOptions)),k?.(),M()}if(this.activeTheme=u,this.processedOptions=p,this.validations.configure(bh(this.processedOptions)),this.fastDelta=g??void 0,this.themeParameters=m,this.annotationThemes=y,this.googleFonts=f,this.fonts=x,this.optionsGraph=b,this.remappedAxisKeys=v,void 0!==c&&"number"==typeof c&&!Number.isNaN(c)){const e=performance.now();this.optionsProcessingTime=e-c}n.yar.inDevelopmentMode((()=>(0,n.olf)(this)))}static isFastPathDelta(t,i){for(const n of Object.keys(t??{}))if(!this.FAST_PATH_OPTIONS.has(n)&&!i?.has(n))return e.perfDebug("ChartOptions.isFastPathDelta() - slow path required due to presence of: ",n),!1;return e.perfDebug("ChartOptions.isFastPathDelta() - fast path possible."),!0}static containsRemovalSentinel(t){if(!(0,n.QdQ)(t))return!1;for(const i of Object.keys(t)){const s=t[i];if((0,n.Bmc)(s))return!0;if(!Kg.has(i)&&e.containsRemovalSentinel(s))return!0}return!1}findSeriesWithUserVisiblity(e,t){for(const i of[e,t]){const e=i?.series;if(Array.isArray(e))for(let t=0;t<e.length;t++){const i=e[t];"visible"in i&&(this.seriesWithUserVisibility??(this.seriesWithUserVisibility={identifiers:new Set,indices:new Set}),i.id?this.seriesWithUserVisibility.identifiers.add(i.id):this.seriesWithUserVisibility.indices.add(t))}}}fastSetup(t,i){const{activeTheme:s,processedOptions:a}=i,{presetType:o}=this.optionMetadata;if(null!=o&&null!=t){const e=this.moduleRegistry.getPresetModule(o);if(e?.processData&&null!=t.data){const{series:i,data:s}=e.processData(t.data);t=(0,n.HFk)({series:i,data:s},t)}
1e?.processFastUpdate&&(t=e.processFastUpdate(t))}this.fastSeriesSetup(t,a);const r=(0,n.HFk)(t,a);return e.debug("ChartOptions.fastSetup() - processed options",r),{activeTheme:s,processedOptions:r,fastDelta:t}}fastSeriesSetup(e,t){e?.series&&(e.series?.every(((e,i)=>(0,n.lCp)(e,t.series?.[i]??{})))?delete e.series:e.series=e.series.map(((e,i)=>(0,n.h1I)(e,t.series?.[i]??{}))))}slowSetup(t,i,s=!1){const a=this.computeStructuralCacheKeyForSlowSetup(i,s);if(void 0!==a){const e=function(e,t){const i=Zg.for(t).get(e);return qg("[CACHE] StructuralOptions",i?"hit":"miss"),i}(a,this.moduleRegistry);if(e)return this.slowSetupCached(e)}let o=(0,n.Go6)(this.userOptions,e.OPTIONS_CLONE_OPTS_FAST);i&&(o=(0,n.HFk)(i,o),s&&this.removeLeftoverSymbols(o));const{presetType:r}=this.optionMetadata;let l,h,c,d,u=o.theme;null!=r&&(l=this.moduleRegistry.getPresetModule(r),h=l?.name,u??(u=l?.baseTheme),d=null==l?$u.get(r):void 0);const p=Ju(Gp(u,this.logger,h,this.moduleRegistry),this.moduleRegistry);if(l){const{validate:t=n.tfT}=l,i=o,s=o.type,a=null==s?void 0:p.presets[s],{cleared:r,invalid:h}=t(i,l.options,"",this.validateParams);this.logValidationErrors(h),c=r??void 0,(0,n.ehc)(h,"")?o={}:(e.debug(">>> AgCharts.createOrUpdate() - applying preset",c),o=l.create(c,a,(()=>this.activeTheme),p.overrides,this.logger,(()=>this.optionsGraph)))}this.soloSeriesIntegrity(o),null!=r&&p.templateTheme(o,!1),ap(void 0,o,this.moduleRegistry);const g=this.validateSeriesOptions(o,this.validateParams),m=Zp(o,this.moduleRegistry);if(this.chartDef=this.moduleRegistry.getChartModule(m),this.removeIncompatibleSeriesAreaOptions(o),!this.chartDef.placeholder){const{validate:e=n.tfT}=this.chartDef,{cleared:t,invalid:i}=e(o,this.chartDef.options,"",this.validateParams);null==d&&this.logValidationErrors(i),o=t}const y=this.validateAxesOptions(o,this.validateParams),f=this.removeAxisInteractionListeners(o);this.removeDisabledOptions(o);let x=this.processFonts(p.params);x=this.processFonts(o,x);const{googleFonts:b}=x;this.processSeriesOptions(o);const v=this.processAxesOptions(o,m);"sparkline"!==this.optionMetadata.presetType&&(this.processedCSSVariables=this.processCSSVariables(o,p.params));const S=_g(p,o,this.processedCSSVariables,c,this.moduleRegistry),M=S.resolve(this.logger),k=S.resolveParams(),D=S.resolveAnnotationThemes();S.clearSafe();const w=(0,n.HFk)(t,M);ap(this.chartDef.name,w,this.moduleRegistry),ep(this.chartDef.name,w,g.concat(y,d??[],f??[]),this.logger,this.moduleRegistry);const I={skipDisabledNodeValidation:!0,silentAdvisories:!0,logger:this.logger};this.validateSeriesOptions(w,I),this.validateAxesOptions(w,I),this.validatePluginOptions(w,I),this.processMiniChartSeriesOptions(w),w.loadGoogleFonts||b.clear();const{fonts:A}=x;if(e.debug((()=>["ChartOptions.slowSetup() - processed options",(0,n.Go6)(w)])),void 0!==a){const{data:e,...t}=w;for(const e of Jg)delete t[e];C=a,N={processedOptions:t,themeParameters:k,googleFonts:b.size>0?new Set(b):void 0,fonts:A.size>0?new Set(A):void 0,annotationThemes:D,chartDef:this.chartDef,issues:[...this.issues],remappedAxisKeys:v},L=this.moduleRegistry,Zg.for(L).set(C,(0,n.olf)(N))}var C,N,L;return{activeTheme:p,processedOptions:w,themeParameters:k,annotationThemes:D,googleFonts:b,fonts:A,optionsGraph:S,remappedAxisKeys:v}}computeStructuralCacheKeyForSlowSetup(e,t){if("minimal"===this.optionMetadata.domMode&&!t&&!e)return em(this.userOptions)}slowSetupCached(e){const t=null==this.optionMetadata.presetType?void 0:this.moduleRegistry.getPresetModule(this.optionMetadata.presetType),i=this.userOptions.theme??t?.baseTheme,n=Ju(Gp(i,this.logger,t?.name,this.moduleRegistry),this.moduleRegistry);this.chartDef=e.chartDef;for(const t of e.issues)this.replay(t);const s=this.userOptions.data,a=t?.processData?t.processData(s).data:s,o=this.userOptions,r={...e.processedOptions,data:a};for(const e of Jg)e in o&&(r[e]=o[e]);"sparkline"!==this.optionMetadata.presetType&&(this.processedCSSVariables=this.processCSSVariables(r));const l=Gg(n,r,void 0,void 0,this.moduleRegistry);return{activeTheme:n,processedOptions:r,themeParameters:e.themeParameters,annotationThemes:e.annotationThemes,googleFonts:e.googleFonts?new Set(e.googleFonts):void 0,fonts:e.fonts?new Set(e.fonts):void 0,optionsGraph:l,remappedAxisKeys:e.remappedAxisKeys}}adopt(e){this.logger=e.logger,this.validations!==e.validations&&this.validations.destroy(),e.validations.configure(bh(this.processedOptions))}
1replay({severity:e,message:t,detail:i}){const n=null==i?[]:[i];switch(e){case"error":this.logger.error(t,...n);break;case"warning":this.logger.warn(t,...n);break;case"deprecation":this.logger.deprecation(t,...n)}}get validateParams(){return{logger:this.logger}}logValidationErrors(e){for(const t of e)this.logger.warn(t)}recordOptionsArgumentError(e){this.issues=[...this.issues,{severity:"error",message:e}],this.logger.error(e)}removeIncompatibleSeriesAreaOptions(e){const t=this.chartDef?.name,i=e.seriesArea;if(null!=i&&null!=t&&"cartesian"!==t)for(const t of tm){if(null==i[t])continue;delete i[t];const n=null==e.series?.at(0)?.type?"this series type":`\`${e.series?.at(0)?.type}\` series`;this.logger.warn(`Option \`seriesArea.${t}\` is not supported by ${n}, ignoring.`)}}validatePluginOptions(e,t){for(const i of this.moduleRegistry.listModulesByType(n.nR2.Plugin)){const s=i.name;if(s in e&&null!=i.options&&(!i.chartType||i.chartType===this.chartDef?.name)){const{cleared:a,invalid:o}=(0,n.tfT)(e[s],i.options,i.name,t);this.logValidationErrors(o),e[s]=a}}}validateSeriesOptions(e,t){if(null!=e.series&&!(0,n.cyL)(e.series))return[];const i=this.chartDef?.name,s=[],a=e.series?.length??0,o=[];if(0===a){const t=this.optionsType(e),i=$u.get(t);null==this.optionMetadata.presetType&&null==this.moduleRegistry.getSeriesModule(t)&&i?.type===n.nR2.Series&&o.push(i)}let r;for(let l=0;l<a;l++){const a=`series[${l}]`,h=e.series[l],c=this.moduleRegistry.getSeriesModule(h.type);if(null==c){const e=n.syG.isEnterprise();r??(r=(0,n.lp6)(Array.from($u.values()).filter((t=>t.type===n.nR2.Series&&(e||!t.enterprise)&&(!i||t.chartType===i))).map((e=>e.name)),"or",sm));const t=$u.get(h.type);if(null!=h.type&&t?.type===n.nR2.Series){o.push(t);continue}this.logger.warn(null==h.type?`Option \`${a}.type\` is required and has not been provided; expecting ${r}, ignoring.`:`Unknown type \`${h.type}\` at \`${a}.type\`; expecting ${r}, ignoring.`);continue}if(i&&c.chartType!==i){this.logger.warn(`Series type \`${c.name}\` at \`${a}.type\` is not supported by chart type \`${i}\`, ignoring.`);continue}if(null==c.options){s.push(h);continue}const{validate:d=n.tfT}=c,{cleared:u,invalid:p}=d(h,c.options,a,t);this.logValidationErrors(p),(0,n.ehc)(p,a)||s.push(u)}return e.series=s,o}validateAxesOptions(e,t){const i=[];if(!("axes"in e)||!e.axes)return i;const s=this.chartDef?.name,a={};let o;for(const[r,l]of(0,n.jOZ)(e.axes)){if(!l)continue;if(null==l.type){a[r]=l;continue}const e=`axes.${this.unmappedAxisKeys?.get(r)??r}`,h=this.moduleRegistry.getAxisModule(l.type);if(null==h){const t=$u.get(l.type);if(t?.type===n.nR2.Axis){i.push(t);continue}const a=n.syG.isEnterprise();o??(o=(0,n.lp6)(Array.from($u.values()).filter((e=>e.type===n.nR2.Axis&&(a||!e.enterprise)&&e.chartType===s)).map((e=>e.name)),"or",sm)),this.logger.warn(`Unknown type \`${l.type}\` at \`${e}.type\`; expecting one of ${o}, ignoring.`);continue}if(h.chartType!==s){this.logger.warn(`Axis type \`${h.name}\` at \`${e}.type\` is not supported by chart type \`${s}\`, ignoring.`);break}const{validate:c=n.tfT}=h,{cleared:d,invalid:u}=c(l,h.options,e,t);this.logValidationErrors(u),(0,n.ehc)(u,e)||(a[r]=d)}return e.axes=a,i}removeAxisInteractionListeners(e){const t=$u.get("axis-interaction");if(null==t||this.moduleRegistry.hasModule(t.name))return;if(null!=t.chartType&&t.chartType!==this.chartDef?.name)return;let i=!1;const s=(e,...t)=>{if((0,n.Gvm)(e))for(const n of t)null!=e[n]&&(delete e[n],i=!0)};if(s(e.listeners,"axisClick","axisDoubleClick"),"axes"in e&&e.axes)for(const[,t]of(0,n.jOZ)(e.axes))s(t?.listeners,"click","doubleClick");return i?t:void 0}diffOptions(t){return this===t?{}:null==t?this.processedOptions:this.fastDelta??(0,n.G4M)(t.processedOptions,this.processedOptions,e.JSON_DIFF_OPTS)}optionsType(e){return e.series?.[0]?.type??"line"}processSeriesOptions(e){const t=e.displayNullData,i=e.series?.map(((e,i)=>{this.validateSizeBounds(e,i);const s=this.moduleRegistry.getSeriesModule(e.type),a={};return Boolean(s?.options?.visible)&&(a.visible=!0),void 0!==t&&void 0===e.allowNullKeys&&(a.allowNullKeys=t),(0,n.HFk)(this.getSeriesGroupingOptions(e),e,a)}));e.series=this.setSeriesGroupingOptions(i??[])}validateSizeBounds(e,t){const i=rm[e.type];if(null==i)return;const[s,a]=i,o=e,r=o[s],l=o[a];(0,n.zZm)(r)&&(0,n.zZm)(l)&&r>l&&(this.logger.warnOnce(`series[${t}].${s} (${r}) cannot be greater than ${a} (${l}), ignoring both.`),delete o[s],delete o[a])}processAxesOptions(e,t){const i="polar"===t?[n.tv$.Angle,n.tv$.Radius]:[n.tv$.X,n.tv$.Y],s="axes"in e&&Object.keys(e.axes??{}).length>0,a=this.countNonDefaultSeriesAxisKeys(e,i),o=a>0,r=o&&a<(e?.series?.length??0),l=e.series?.[0],h=this.optionsType(e),c=this.predictAxes(h,i,l,e.data)??this.cloneDefaultAxes(
1h),d=(0,n.Gvm)(l)&&"direction"in l&&"horizontal"===l.direction&&null!=this.moduleRegistry.getSeriesModule(l.type)?.axisKeysFlipped;if(!s&&!o&&!d)return void(e.axes=c);const u="axes"in e?new Set(Object.keys(e.axes??{})):new Set,p=this.getPrimaryAxisKeys(e,i,u,o),g=this.getRemappedAxisKeys(u,p,i,r),m={};this.unmappedAxisKeys.clear();for(const[t,i]of g)m[i]="axes"in e?(0,n.yGp)(e.axes?.[t]):void 0,this.unmappedAxisKeys.set(i,t);return this.remapSeriesAxisKeys(e,i,m,g,c,r),this.predictAxesMissingTypesAndPositions(e,i,m,c),this.alternateSecondaryAxisPositions(e,m),e.axes=m,g}getSeriesDirectionAxisKey(e,t){const i=this.moduleRegistry.getSeriesModule(e.type);if(!i)return;return"direction"in e&&"horizontal"===e.direction&&i.axisKeysFlipped?i.axisKeysFlipped[t]:i.axisKeys?.[t]}countNonDefaultSeriesAxisKeys(e,t){let i=0;for(const s of e.series??[])for(const e of t){const t=this.getSeriesDirectionAxisKey(s,e);t&&(0,n.bXA)(t,s)&&(s[t]!==e&&i++)}return i}getPrimaryAxisKeys(e,t,i,s){const a=new Map;for(const o of t){let t=!1;if("axes"in e&&e.axes&&(!(o in e.axes)||!(0,n.Gvm)(e.axes[o])||"position"in e.axes[o]))for(const[i,s]of(0,n.jOZ)(e.axes))if("position"in s&&s.position&&o===om[s.position]){a.set(o,i),t=!0;break}if(!t&&s)for(const t of e.series??[]){const e=this.getSeriesDirectionAxisKey(t,o);if(!e)continue;const n=t[e];if(!i.has(n)){if(!n){a.set(o,o);break}a.set(o,n);break}}}if(0===i.size||!("axes"in e)||!e.axes)return a;if(0===a.size)for(const i of t)i in e.axes&&a.set(i,i);if(0===a.size)for(const i of t)for(const[t,s]of(0,n.jOZ)(e.axes))if(s.type?.startsWith(i)){a.set(i,t);break}if(0===a.size&&(e.series?.length??0)>0)for(const n of t)for(const t of e.series){const e=this.getSeriesDirectionAxisKey(t,n);if(!e)continue;const s=t[e];if(i.has(s)){a.set(n,s);break}}if(a.size<2){const i=new Set(a.values());for(const[s,o]of(0,n.jOZ)(e.axes))if(!i.has(s)&&!("position"in o)){for(const e of t)if(!a.has(e)){a.set(e,s),i.add(s);break}if(2===a.size)break}}return a}getRemappedAxisKeys(e,t,i,n){const s=new Map;for(const[e,i]of t)s.set(i,e);for(const t of e)s.has(t)||s.set(t,`${am}${s.size}`);if(n)for(const e of i)s.has(e)||s.set(e,`${am}${s.size}`);return s}remapSeriesAxisKeys(e,t,i,s,a,o){for(const r of e.series??[])for(const e of t){const t=this.getSeriesDirectionAxisKey(r,e);if(!t)continue;i[e]??(i[e]=(0,n.yGp)(a[e]));let l=e;if(t in r){const o=r[t];s.has(o)?l=s.get(o):(l=`${am}${s.size}`,s.set(o,l),this.unmappedAxisKeys.set(l,o),i[l]=(0,n.yGp)(a[e]))}else s.has(e)&&o&&(l=s.get(e),i[l]??(i[l]=(0,n.yGp)(a[e])));r[t]=l}}predictAxes(e,t,i,s){if(!i)return;const a=i?.data??s;if(!a?.length)return;const o=this.moduleRegistry.getSeriesModule(e)?.predictAxis;if(!o)return;const r=new Map,l=(0,n.mnw)(0,a.length-1,5);for(const e of l){const n=a[e];for(const e of t){const t=o(e,n,i);if(!r.has(e)){r.set(e,t);continue}const s=r.get(e);if(t||s){if(!t||!s)return;for(const e of Object.keys(s))if(s[e]!==t[e])return}}}for(const[e,t]of r)t||r.delete(e);if(0!==r.size){if(1===r.size){const[t]=r.values(),i=this.cloneDefaultAxes(e);if(!("position"in t))return;return(0,n.LGi)(i,(e=>"position"in e&&e.position===t.position?t:e))}return Object.fromEntries(r)}}cloneDefaultAxes(e){const t=this.moduleRegistry.getSeriesModule(e);return t?.defaultAxes?(0,n.Go6)(t.defaultAxes):{}}predictAxesMissingTypesAndPositions(e,t,i,s){for(const[a,o]of(0,n.jOZ)(i)){if(!(0,n.QdQ)(o))continue;if("type"in o&&"position"in o)continue;if(a in s){o.type??(o.type=s[a].type),o.position??(o.position=s[a].position);continue}this.predictAxisMissingTypeFromPosition(o,s)||(this.predictAxisMissingTypeAndPositionFromSeries(e,t,a,o,s),"type"in o||delete i[a])}}predictAxisMissingTypeFromPosition(e,t){if(!("position"in e)||!(0,n.bXA)(e.position,om))return!1;for(const i of Object.values(t))if((0,n.bXA)(i.position,om)&&om[e.position]===om[i.position])return e.type=i.type,!0;for(const[i,s]of(0,n.jOZ)(om))if(e.position!==i&&s===om[e.position])return e.type=t[s].type,!0;return!1}predictAxisMissingTypeAndPositionFromSeries(e,t,i,s,a){for(const o of e.series??[])for(const e of t){const t=this.getSeriesDirectionAxisKey(o,e);
1if(t&&(0,n.bXA)(t,o)&&o[t]===i)return s.type??(s.type=a[e].type),s.position??(s.position=a[e].position),e===n.tv$.Y}return!1}alternateSecondaryAxisPositions(e,t){let i=0,s=0;for(const[a,o]of(0,n.jOZ)(t)){if(!(0,n.QdQ)(o)||!("position"in o))continue;const t=this.unmappedAxisKeys.get(a),r="axes"in e&&e.axes&&t&&t in e.axes?e.axes[t]:void 0,l=r&&"position"in r?r.position:void 0;if("top"===o.position||"bottom"===o.position?(i+=1,2===i&&null==l&&(o.position="top")):"left"!==o.position&&"right"!==o.position||(s+=1,2===s&&null==l&&(o.position="right")),i>1&&s>1)break}}processMiniChartSeriesOptions(e){const t=e.navigator?.miniChart?.series;null!=t&&(e.navigator.miniChart.series=this.setSeriesGroupingOptions(t))}getSeriesGroupingOptions(e){const{groupable:t,stackable:i,stackedByDefault:n=!1}=this.moduleRegistry.getSeriesModule(e.type);e.grouped&&!t&&this.logger.warnOnce(`unsupported grouping of series type "${e.type}".`),!e.stacked&&!e.stackGroup||i||this.logger.warnOnce(`unsupported stacking of series type "${e.type}".`);let{grouped:s,stacked:a}=e;return a??(a=(n||null!=e.stackGroup)&&!(t&&s)),s??(s=!0),{stacked:i&&a,grouped:t&&s&&!(i&&a)}}setSeriesGroupingOptions(t){const i=this.getSeriesGrouping(t);e.debug("ChartOptions.setSeriesGroupingOptions() - series grouping: ",i);const n={},s=i.reduce(((e,t)=>{var i;return"default"===t.groupType||(e[i=t.seriesType]??(e[i]=0),e[t.seriesType]+="stack"===t.groupType?1:t.series.length),e}),{});return i.flatMap((e=>{var t;switch(n[t=e.seriesType]??(n[t]=0),e.groupType){case"stack":{const t=n[e.seriesType]++;return e.series.map(((i,n)=>Object.assign(i,{seriesGrouping:{groupId:e.groupId,groupIndex:t,groupCount:s[e.seriesType],stackIndex:n,stackCount:e.series.length}})))}case"group":return e.series.map((t=>Object.assign(t,{seriesGrouping:{groupId:e.groupId,groupIndex:n[e.seriesType]++,groupCount:s[e.seriesType],stackIndex:0,stackCount:0}})))}return e.series})).map((({stacked:e,grouped:t,...i})=>i))}getSeriesGroupId(e){return[e.type,e.xKey,e.stacked?e.stackGroup??"stacked":"grouped"].filter(Boolean).join("-")}getSeriesGrouping(e){const t=new Map;return e.reduce(((e,i)=>{const n=i.type;if(i.stacked||i.grouped){const s=this.getSeriesGroupId(i);if(!t.has(s)){const a={groupType:i.stacked?"stack":"group",seriesType:n,series:[],groupId:s};t.set(s,a),e.push(a)}t.get(s).series.push(i)}else e.push({groupType:"default",seriesType:n,series:[i],groupId:"__default__"});return e}),[])}soloSeriesIntegrity(e){if(!(0,n.cyL)(e.series))return;const t=e=>this.moduleRegistry.getSeriesModule(e)?.solo??!1,i=e.series;if(i&&i.length>1&&i.some((e=>t(e.type)))){const s=this.optionsType(e);if(t(s))this.logger.warn(`series[0] of type '${s}' is incompatible with other series types. Only processing series[0]`),e.series=i.slice(0,1);else{const{solo:s,nonSolo:a}=(0,n.$zQ)(i,(e=>t(e.type)?"solo":"nonSolo")),o=(0,n.AmM)(s.map((e=>e.type))).join(", ");this.logger.warn(`Unable to mix these series types with the lead series type: ${o}`),e.series=a}}}
1static processFontOptions(e,t=im()){if("object"==typeof e&&"fontFamily"in e){const{fontWeight:i,fontStyle:n}=e;if(Array.isArray(e.fontFamily)){const s=[];for(const a of e.fontFamily)"object"==typeof a&&"googleFont"in a?(s.push(a.googleFont),t.googleFonts.add(a.googleFont),nm(t.fonts,{fontFamily:a.googleFont,fontWeight:i,fontStyle:n})):(s.push(a),nm(t.fonts,{fontFamily:a,fontWeight:i,fontStyle:n}));e.fontFamily=s.join(", ")}else"object"==typeof e.fontFamily&&"googleFont"in e.fontFamily?(e.fontFamily=e.fontFamily.googleFont,t.googleFonts.add(e.fontFamily),nm(t.fonts,{fontFamily:e.fontFamily,fontWeight:i,fontStyle:n})):"string"==typeof e.fontFamily&&nm(t.fonts,{fontFamily:e.fontFamily,fontWeight:i,fontStyle:n})}return t}processFonts(t,i=im()){return(0,n.mfG)(t,(t=>e.processFontOptions(t,i)),new Set(["data","theme"])),i}static removeDisabledOptionJson(e){if("enabled"in e&&!1===e.enabled)for(const t of Object.keys(e))"enabled"!==t&&delete e[t]}removeDisabledOptions(t){(0,n.mfG)(t,e.removeDisabledOptionJson,new Set(["data","theme","contextMenu","ranges"]))}static removeLeftoverSymbolsJson(e){if(e&&(0,n.Gvm)(e))for(const t of Object.keys(e)){const i=e[t];(0,n.Bmc)(i)&&delete e[t]}}removeLeftoverSymbols(t){(0,n.mfG)(t,e.removeLeftoverSymbolsJson,new Set(["data"]))}static processCSSVariablesJSON(t,i,s,a){a??(a={});const o=s?.container;if(!(s&&t&&(0,n.Z4x)(t)&&o))return a;for(const i of Object.keys(t)){const n=t[i];if(!e.isExternalColorVar(n))continue;const r=e.resolveColorVar(n,o);r&&(r.isValid?a[n]??(a[n]=r.propertyValue):(s.logger.warnOnce(`CSS property [${n}] is not a valid color, ignoring.`),delete t[i]))}return a}static isExternalColorVar(e){return"string"==typeof e&&e.startsWith("var(--")&&!e.slice(4,-1).startsWith("--ag-charts")}static resolveColorVar(t,i){const s=t.slice(4,-1),[a,...o]=s.split(","),r=getComputedStyle(i);let l=r.getPropertyValue(a.trim()),h=n.Q1f.validColorString(l);if(!h&&o.length>0){const t=o.join(",").trim();if(t.startsWith("var(--"))return e.resolveColorVar(t,i);l=r.getPropertyValue(t)||t,h=n.Q1f.validColorString(l)}return{isValid:h,propertyValue:l}}processCSSVariables(t,i){const{container:s}=t;if(null==s)return;const a=new Set(["data"]),o={container:s,logger:this.logger};let r=(0,n.mfG)(t,e.processCSSVariablesJSON,a,void 0,o);return r=(0,n.mfG)(i,e.processCSSVariablesJSON,a,void 0,o,r),r}processCSSVariablesPartial(t,i){if(null!=t&&null!=i)return(0,n.mfG)(t,e.processCSSVariablesJSON,new Set(["data"]),void 0,{container:i,logger:this.logger})}specialOverridesDefaults(e){if(null==e.window?e.window=(0,n.zkX)():(0,n.d16)(e.window),null==e.document?e.document=(0,n.YEm)():(0,n._9u)(e.document),null==e.window)throw new Error("AG Charts - unable to resolve global window");if(null==e.document)throw new Error("AG Charts - unable to resolve global document");return e}};return e.OPTIONS_CLONE_OPTS_SLOW={shallow:new Set(["data","container"]),assign:new Set(["context","theme"])},e.OPTIONS_CLONE_OPTS_FAST={shallow:new Set(["container"]),assign:new Set(["data","context","theme"])},e.JSON_DIFF_OPTS=new Set(["data","localeText"]),e.REMOVED=Symbol("UNSET"),e.perfDebug=n.yar.create(!0,"perf"),e.FAST_PATH_OPTIONS=new Set(["data","width","height","container","context"]),e.debug=n.yar.create(!0,"opts"),e})(),hm=n.yar.create(!0,"opts"),cm="AG Charts - Chart was destroyed, cannot perform request.",dm=(()=>{var e=class{constructor(e,t){this.factoryApi=t,this.chart=e}async update(e){if(!this.chart)throw new Error(cm);return hm.group("AgChartInstance.update()",(async()=>{const t=n.yar.check("scene:stats","scene:stats:verbose")?performance.now():void 0;this.factoryApi.update(e,this,void 0,t),await(this.chart?.waitForUpdate());const i=this.chart?.takeFailFastError();if(null!=i)throw i}))}async updateDelta(e){if(!this.chart)throw new Error(cm);return hm.group("AgChartInstance.updateDelta()",(async()=>{const t=n.yar.check("scene:stats","scene:stats:verbose")?performance.now():void 0;this.factoryApi.updateUserDelta(this,e,t),await(this.chart?.waitForUpdate());const i=this.chart?.takeFailFastError();if(null!=i)throw i}))}getOptions(){if(!this.chart)throw new Error(cm);const e=(0,n.Go6)(this.chart.getOptions(),lm.OPTIONS_CLONE_OPTS_FAST);for(const t of Object.keys(e))t.startsWith("_")&&delete e[t];return e}async waitForUpdate(){if(!this.chart)throw new Error(cm);await this.chart.waitForUpdate();const e=this.chart.takeFailFastError();if(null!=e)throw e}applyTransaction(e){const{chart:t}=this;if(!t)throw new Error(cm);if(null==e||"object"!=typeof e)throw new Error("AG Charts - applyTransaction expects a transaction object.");const{add:i,addIndex:n,remove:s,update:a}=e;if(null!=i&&!Array.isArray(i))throw new Error('AG Charts - transaction "add" must be an array.');if(null!=n){if("number"!=typeof n||!Number.isSafeInteger(n)||n<0)throw new Error('AG Charts - transaction "addIndex" must be a safe non-negative integer (0 to 9007199254740991).');if(null==i||0===i.length)throw new Error('AG Charts - transaction "addIndex" requires a non-empty "add" array.')}if(null!=s&&!Array.isArray(s))throw new Error('AG Charts - transaction "remove" must be an array.');if(null!=a&&!Array.isArray(a))throw new Error('AG Charts - transaction "update" must be an array.');return hm.group("AgChartInstance.applyTransaction()",(async()=>
1{if(!t.isDataTransactionSupported()){const i=t.ctx.dataSelectionService,n=Th(i,t.data,t.ctx.logger);return n.addTransaction(e),n.commitPendingTransactions(i),this.updateDelta({data:n.data})}return hm("transaction",e),this.chart?.applyTransaction(e)}))}async download(e){if(!this.chart)throw new Error(cm);const t=await this.prepareResizedChart(this,this.chart,e);try{t.chart?.download(e?.fileName,e?.fileFormat)}finally{t.destroy()}}async __toSVG(e){if(!this.chart)throw new Error(cm);const t=await this.prepareResizedChart(this,this.chart,{width:600,height:300,...e});try{return t?.chart?.toSVG()}finally{t?.destroy()}}async getImageDataURL(e){if(!this.chart)throw new Error(cm);const t=await this.prepareResizedChart(this,this.chart,e);try{return t.chart.getCanvasDataURL(e?.fileFormat)}finally{t.destroy()}}getState(){return this.factoryApi.caretaker.save(...this.getEnabledOriginators())}async setState(e){if(!this.chart)return;const{interactionManager:t,legendManager:i,zoomManager:n}=this.chart.ctx,s=this.getEnabledOriginators(),a=new Set(s);t.isState(2)||(i&&n&&a.has(i)&&a.has(n)?(a.delete(n),await this.setStateOriginators(e,Array.from(a)),await this.setStateOriginators(e,[n])):await this.setStateOriginators(e,s))}getSelection(){return this.chart?.getSelection()??[]}setSelection(e){return this.chart?.setSelection(e)}isModuleRegistered(e){if(!this.chart)throw new Error(cm);const t=function(e){return Bu??(Bu=new Map(Array.from($u.values(),(e=>[e.moduleId,e.name])))),Bu.get(e)}(e)??e;return this.chart.chartOptions.moduleRegistry.hasModule(t)}clearSelection(){return this.chart?.clearSelection()}resetAnimations(){this.chart?.resetAnimations()}skipAnimations(){this.chart?.skipAnimations()}destroy(){this.releaseChart?(this.releaseChart(),this.releaseChart=void 0):this.chart&&(this.chart.publicApi=void 0,this.chart.destroy()),this.chart=void 0}async prepareResizedChart(e,t,i={}){const s=i.width??t.width??t.ctx.scene.canvas.width,a=i.height??t.height??t.ctx.scene.canvas.height,o=e.getState(),r=t.chartOptions.specialOverrides.document??(0,n.YEm)(),l={...t.chartOptions.processedOverrides,container:r.createElement("div"),width:s,height:a};null!=i.width&&null!=i.height&&(l.overrideDevicePixelRatio=1);const h=t.getOptions();n.syG.isEnterprise()&&(l.animation={enabled:!1}),this.licenseManager?.validateLicense();const c=this.licenseManager?.getWatermarkForegroundConfigForBrowser();c&&(l.foreground=c);const d={...t.chartOptions.specialOverrides},u={...t.chartOptions.optionMetadata},p=await(this.chart?.ctx.dataService.getData()),g=this.factoryApi.create(h,l,d,u,p,this.licenseManager);o.legend&&this.syncLegend(t,g,o),g.chart?.update(n.GvF.FULL,{forceNo
1deDataRefresh:!0}),await g.waitForUpdate(),await g.setState(o);g.chart?.ctx.zoomManager?.updateZoom({source:"chart-update",sourceDetail:"internal-prepareResizedChart"},t.ctx.chartState.getValue("zoom")),g.chart?.update(n.GvF.FULL,{forceNodeDataRefresh:!0}),await g.waitForUpdate();const m=[];for(const e of t.modulesManager.legends())m.push(e.legend.pagination?.currentPage??0);for(const e of g.chart.modulesManager.legends()){const t=m.shift()??0;e.legend.pagination&&e.legend.pagination.setPage(t)}return g.chart?.update(n.GvF.FULL,{forceNodeDataRefresh:!0}),await g.waitForUpdate(),g}syncLegend(e,t,i){const n=new Map;for(const[i,s]of e.series.entries()){const e=t.chart?.series[i];e&&n.set(s.id,e.id)}i.legend=i.legend?.map((e=>({...e,seriesId:n.get(e.seriesId??"")??e.seriesId})))}getEnabledOriginators(){if(!this.chart)return[];const{chartOptions:{processedOptions:e,optionMetadata:t},ctx:{annotationManager:i,chartTypeOriginator:n,zoomManager:s,legendManager:a},modulesManager:o}=this.chart,r=[];"annotations"in e&&e.annotations?.enabled&&i&&r.push(i);"price-volume"===t.presetType&&r.push(n),(e.navigator?.enabled||e.zoom?.enabled)&&s&&r.push(s);o.isEnabled("legend")&&!1!==e.legend?.enabled&&a&&r.push(a);const l=Eh(o.legends());return l?.pagination&&l.pagination.totalPages>1&&r.push(new zh(l)),r.push(this.chart.ctx.activeManager),r.push(this.chart.ctx.collapsedManager),r}async setStateOriginators(e,t){const i=this.chart?.ctx;null!=i&&(this.factoryApi.caretaker.restore(i.logger,e,...t),i.eventsHub.emit("chart:request-update",{type:n.GvF.PROCESS_DATA,opts:{forceNodeDataRefresh:!0}}),await(this.chart?.waitForUpdate()))}};return e.chartInstances=new WeakMap,d([(0,n.mBh)({oldValue(t){t.destroyed||(t.publicApi=void 0),e.chartInstances.delete(t)},newValue(t){t&&(t.publicApi=this,e.chartInstances.set(t,this))}})],e.prototype,"chart",2),e})(),um=new WeakSet;function pm(e){return um.add(e),e}var gm=(()=>{var e=class e{constructor(e,t,i,n,s,a=1e3){this.name=e,this.buildItem=t,this.releaseItem=i,this.destroyItem=n,this.maxPoolSize=s,this.cleanupTimeMs=a,this.freePool=[],this.busyPool=new Set}static getPool(t,i,n,s,a){return this.pools.has(t)||this.pools.set(t,new e(t,i,n,s,a)),this.pools.get(t)}isFull(){return this.freePool.length+this.busyPool.size>=this.maxPoolSize}hasFree(){return this.freePool.length>0}obtain(t){if(!this.hasFree()&&this.isFull())throw new Error("AG Charts - pool exhausted");let i=this.freePool.pop();return null==i?(i=this.buildItem(t),e.debug((()=>[`Pool[name=${this.name}]: Created instance (${this.freePool.length} / ${this.busyPool.size+1} / ${this.maxPoolSize})`,i]))):e.debug((()=>[`Pool[name=${this.name}]: Re-used instance (${this.freePool.length} / ${this.busyPool.size+1} / ${this.maxPoolSize})`,i])),this.busyPool.add(i),{item:i,release:()=>this.release(i)}}obtainFree(){const t=this.freePool.pop();if(null==t)throw new Error("AG Charts - pool has no free instances");return e.debug((()=>[`Pool[name=${this.name}]: Re-used instance (${this.freePool.length} / ${this.busyPool.size+1} / ${this.maxPoolSize})`,t])),this.busyPool.add(t),{item:t,release:()=>this.release(t)}}release(t){if(!this.busyPool.has(t))throw new Error("AG Charts - cannot free item from pool which is not tracked as busy.");e.debug((()=>[`Pool[name=${this.name}]: Releasing instance (${this.freePool.length} / ${this.busyPool.size} / ${this.maxPoolSize})`,t])),this.releaseItem(t),this.busyPool.delete(t),this.freePool.push(t),e.debug((()=>[`Pool[name=${this.name}]: Returned instance to free pool (${this.freePool.length} / ${this.busyPool.size} / ${this.maxPoolSize})`,t]));const i=Date.now(),n=i+.5*this.cleanupTimeMs;this.cleanPoolTimer&&(this.cleanPoolDue??1/0)<n&&(clearTimeout(this.cleanPoolTimer),this.cleanPoolTimer=void 0),this.cleanPoolTimer||(this.cleanPoolDue=i+this.cleanupTimeMs,this.cleanPoolTimer=setTimeout(this.cleanPool.bind(this),this.cleanupTimeMs))}cleanPool(){const t=this.freePool.splice(0);for(const e of t)this.destroyItem(e);e.debug((()=>[`Pool[name=${this.name}]: Cleaned pool of ${t.length} items (${this.freePool.length} / ${this.busyPool.size} / ${this.maxPoolSize})`]))}destroy(){this.cleanPool();for(const e of this.busyPool.values())this.destroyItem(e);this.busyPool.clear()}};return e.pools=new Map,e.debug=n.yar.create(!0,"pool"),e})(),mm=n.yar.create(!0,"opts");var ym=Symbol("agChartsOptionsArgumentIssue");function fm(e,t){if(!((0,n.QdQ)(e)&&Object.keys(e).length>0))return`${t} requires a non-empty options object; a minimal chart specifies a \`container\` and \`series\` (or \`data\`). Received ${function(e){if(null===e)return"null";if(Array.isArray(e))return"an array";if("string"==typeof e)return`a string ('${e.length>20?`${e.slice(0,20)}â¦`:e}')`;return"object"==typeof e?0===Object.keys(e).length?"an empty object":"an object":"function"==typeof e?"a function":void 0===e?"undefined":`a ${typeof e} (${String(e)})`}(e)}.`}function xm(e,t){if((0,n.QdQ)(e)&&ym in e)return e;const i=fm(e,t);return null==i?e:{[ym]:i}}var bm={},vm=new WeakMap,Sm=new WeakMap;function Mm(e,t){const i=function(e){return e.container?.ownerDocument??("undefined"==typeof document?void 0:document)}(e),s=i??bm;let a=vm.get(s);if(null==a){if(a=n.dC9.licenseManager?.(i),null==a)return;vm.set(s,a)}if(!t||a.isLicenseKeySupplied())return a.validateLicense(),a}var km=class{static __validateOptionsArgument(e,t){return xm(e,t)}static getLicenseDetails(e){return n.dC9.licenseManager?.().getLicenseDetails(e)}static getInstance(e){return Dm.getInstance(e)}static create(e,t){return this.createInternal(e,{modules:t?.modules})}static createInternal(e,t){const{options:i,issue:s}=function(e,t){const i=xm(e,t);if(!(0,n.QdQ)(i)||!(ym in i))return{options:e};const{[ym]:s,...a}=i;return{options:a,issue:s}}(e,"AgCharts.create()");e=i;const a=n.yar.check("scene:stats","scene:stats:verbose")?performance.now():void 0;return mm.group("AgCharts.create()",(()=>{e=n.yar.inDevelopmentMode((()=>(0,n.olf)((0,n.Go6)(e))))??e;return Dm.createOrUpdate({userOptions:e,optionsMetadata:t,optionsArgumentIssue:s,apiStartTime:a})}))}static createFinancialChart(e,t){return e=xm(e,"AgCharts.createFinancialChart()"),mm.group("AgCharts.createFinancialChart()",(()=>this.createInternal(e,{presetType:"price-volume",modules:t?.modules})))}static createGauge(e,t){return e=xm(e,"AgCharts.createGauge()"),mm.group("AgCharts.createGauge()",(()=>this.createInternal(e,{presetType:"gauge-preset",modules:t?.modules})))}static createQuadrantChart(e,t){return e=xm(e,"AgCharts.createQuadrantChart()"),mm.group("AgCharts.createQuadrantChart()",(()=>this.createInternal(e,{presetType:"quadrant",modules:t?.modules})))}static __createSparkline(e,t){return e=xm(e,"AgCharts.__createSparkline()"),mm.group("AgCharts.__createSparkline()",(()=>{const{pool:i,...n}=e;return this.createInternal(xm(n,"AgCharts.__createSparkline()"),{presetType:"sparkline",pool:i??
1!0,domMode:"minimal",withDragInterpretation:!1,modules:t?.modules})}))}},Dm=(()=>{var e=class e{static getInstance(e){const t=Vu.getInstance(e);return t?dm.chartInstances.get(t):void 0}static createOrUpdate(t){let{proxy:i}=t;const{userOptions:s,licenseManager:a,processedOverrides:o=i?.chart?.chartOptions.processedOverrides??{},specialOverrides:r=i?.chart?.chartOptions.specialOverrides??{},optionsMetadata:l=i?.chart?.chartOptions.optionMetadata??{},deltaOptions:h,data:c,stripSymbols:d=!1,apiStartTime:u}=t;let{optionsArgumentIssue:p}=t;const g=null==n.dC9.styles?[]:[["ag-charts-enterprise",n.dC9.styles]],m=i?.chart?.chartOptions.moduleRegistry??Jp(l.modules);if(m.listModules().next().done)throw new Error(["AG Charts - No modules have been registered.","","Call ModuleRegistry.registerModules(...) with the modules you need before using AgCharts.create(),","or pass them to the chart with AgCharts.create(options, { modules: [...] }).","","See https://www.ag-grid.com/charts/r/module-registry/ for more details."].join("\n"));mm((()=>[">>> AgCharts.createOrUpdate() user options",(0,n.Go6)(s)]));const{presetType:y}=l;let f=s;km.optionsMutationFn&&f&&(f=km.optionsMutationFn((0,n.Go6)(f,lm.OPTIONS_CLONE_OPTS_FAST),y),mm((()=>[">>> AgCharts.createOrUpdate() MUTATED user options",(0,n.Go6)(f)])));const x=this.getPool(l,m);let b,v=!1,S=i?.chart;null==S&&x?.hasFree()&&(b=x.obtainFree(),S=b.item);const{document:M,window:k,styleContainer:D,skipCss:w,[ym]:I,...A}=f??{};p??(p=I);const C=S?.getChartOptions(),N={...r,document:M,window:k,styleContainer:D,skipCss:w};let L;try{L=new lm(C,A,o,N,l,h,d,!1,u,S?.ctx)}catch(e){throw b?.release(),e}null!=S&&Zp(L.processedOptions,L.moduleRegistry)===Zp(S.chartOptions.processedOptions,S.chartOptions.moduleRegistry)||(b?.release(),b=this.getPool(L.optionMetadata,L.moduleRegistry)?.obtain(L),b?S=b.item:(v=!0,S=e.createChartInstance(L,S))),L.adopt(S.ctx),null!=p&&L.recordOptionsArgumentError(p),L.optionsGraph&&S.ctx.optionsGraphService.updateCallback(((e,t,i,n)=>{const s=L.processCSSVariablesPartial(i,L.processedOptions.container);return S.ctx.domManager.updateCSSVariableWatchers(s),L.optionsGraph?.resolvePartial(e,t,i,n,s)}));for(const[e,t]of g)S.ctx.domManager.addStyles(e,t);L.remappedAxisKeys&&S.ctx.axisManager.setRemappedAxisKeys(L.remappedAxisKeys),S.ctx.fontManager.updateFonts(L.googleFonts),S.ctx.fontManager.waitForFonts(L.fonts),null!=c&&S.ctx.dataService.restoreData(c);const P="loading"in L.processedOptions?L.processedOptions.loading:void 0;S.ctx.dataService.setForcedLoading(P),null==i?(i=new dm(S,e.callbackApi),i.licenseManager=a,i.releaseChart=b?.release):(b||v)&&(i.releaseChart?.(),i.chart=S,i.releaseChart=b?.release);const T=i;return e.licenseCheck(T,L),mm.check()&&void 0!==globalThis.window&&(globalThis.agChartInstances??(globalThis.agChartInstances={}),globalThis.agChartInstances[S.id]=S),S.ctx.domManager.updateCSSVariableWatchers(L.processedCSSVariables),S.setRequestRefreshListener((()=>{const t=new lm(C,A,o,N,l,h,d,!0,n.yar.check("scene:stats","scene:stats:verbose")?performance.now():void 0,S.ctx);e.licenseCheck(T,t),e.requestFactoryUpdate(S,t)})),e.requestFactoryUpdate(S,L),i}static licenseCheck(e,t){const{userOptions:i,processedOptions:s,moduleRegistry:a}=t;let o=Sm.get(e);if(null==o&&(o=!0===i.withinStudio,Sm.set(e,o)),o)return;const r=function(e){for(const i of e.listModules())if(t=i,!um.has(t))return!0;var t;return!1}(a),l=Mm(s,!r);null!=l&&r&&null==e.licenseManager&&(e.licenseManager=l,l.isDisplayWatermark()&&n.dC9.injectWatermark?.(e.chart.ctx.domManager,l.getWatermarkMessage()))}static updateUserDelta(t,i,s){i=(0,n.Go6)(i,lm.OPTIONS_CLONE_OPTS_FAST);const a=(0,n.mfG)(i,e.markRemovedProperties,new Set(["data"]),void 0,void 0,!1);mm((()=>[">>> AgCharts.updateUserDelta() user delta",(0,n.Go6)(i)])),e.createOrUpdate({proxy:t,deltaOptions:i,stripSymbols:a,apiStartTime:s})}static createChartInstance(e,t){const i=t?.destroy({keepTransferableResources:!0}),n=Zp(e.processedOptions,e.moduleRegistry);return e.moduleRegistry.getChartModule(n).create(e,i)}static getPool(e,t){if(!0!==e.pool)return;const i=n.syG.getModuleScopeKey(t),s=e.presetType??"default";return gm.getPool(i?`${s}|${i}`:s,this.createChartInstance,this.detachAndClear,this.destroy,1/0)}static requestFactoryUpdate(e,t){e.queuedUserOptions.push(t.userOptions),e.queuedChartOptions.push(t),e.requestFactoryUpdate((e=>{mm.group(">>>> Chart.applyOptions()",(()=>{e.applyOptions(t);const i=e.queuedUserOptions.indexOf(t.userOptions)+1;e.queuedUserOptions.splice(0,i),e.queuedChartOptions.splice(0,i)}))}))}};return e.caretaker=new n.OQ$(Ot),e.callbackApi={caretaker:e.caretaker,create:(t,i,n,s,a,o)=>e.createOrUpdate({userOptions:t,processedOverrides:i,specialOverrides:n,optionsMetadata:s,data:a,licenseManager:o}),update:(t,i,n,s)=>e.createOrUpdate({userOptions:t,proxy:i,specialOverrides:n,apiStartTime:s}),updateUserDelta:(t,i,n)=>e.updateUserDelta(t,i,n)},e.markRemovedProperties=(e,t,i,s)=>{let a=s??!1;if("object"!=typeof e||null==e)return a;for(const t of(0,n.vIl)(e)){void 0===e[t]&&(Object.assign(e,{[t]:Symbol("UNSET")}),a||(a=!0))}return a},e.detachAndClear=e=>e.detachAndClear(),e.destroy=e=>e.destroy(),e})(),wm={};h(wm,{APPROXIMATE_THRESHOLD:()=>1e3,AbstractBarSeries:()=>Zf,AbstractBarSeriesProperties:()=>Xf,AggregationManager:()=>kb,AnchoredPopover:()=>sv,AnnotationManager:()=>Mf,ApproximateOrdinalTimeScale:()=>_b,Arc:()=>Yb,Axis:()=>mc,AxisGroupZIndexMap:()=>uc,BBox:()=>
1m,Background:()=>qe,BandScale:()=>Vl,BaseToolbar:()=>pv,BucketLookupManager:()=>Ab,Caption:()=>Yh,CartesianAxis:()=>Yc,CartesianCrossLine:()=>by,CartesianSeries:()=>hy,CartesianSeriesProperties:()=>ly,CategoryAxis:()=>Rf,CategoryScale:()=>yc,Chart:()=>Vu,ChartAxes:()=>Qe,ChartOptions:()=>lm,CollapseMode:()=>rx,ColorScale:()=>V,ColorScaleProperties:()=>G,ContextMenuRegistry:()=>If,ContinuousScale:()=>Rl,DEFAULT_CARTESIAN_DIRECTION_KEYS:()=>oy,DEFAULT_CARTESIAN_DIRECTION_NAMES:()=>ry,DEFAULT_POLAR_DIRECTION_KEYS:()=>nb,DEFAULT_POLAR_DIRECTION_NAMES:()=>sb,DOMElementProxy:()=>Xt,DOMManager:()=>si,DataChangeDescription:()=>ir,DataController:()=>Lh,DataModel:()=>ur,DataModelSeries:()=>sy,DataSet:()=>Ph,DiscreteTimeAxis:()=>Ob,DraggablePopover:()=>ov,DropShadow:()=>$b,ExtendedPath2D:()=>se,FillGradientDefaults:()=>ul,FillImageDefaults:()=>gl,FillPatternDefaults:()=>pl,FloatingToolbar:()=>yv,FormatManager:()=>ut,Group:()=>ke,GroupWidget:()=>Ai,HierarchyHighlightState:()=>db,HierarchyNode:()=>gb,HierarchySeries:()=>mb,HierarchySeriesProperties:()=>pb,HighlightManager:()=>el,HighlightProperties:()=>ll,HighlightState:()=>tl,Image:()=>Kb,IndexSetBucketLookupManager:()=>Lb,InteractionManager:()=>ja,InteractionState:()=>Ha,LARGEST_KEY_INTERVAL:()=>Tr,Label:()=>bt,LabelPlacementStyle:()=>xt,LabelStyle:()=>ft,LayoutElement:()=>rh,Line:()=>Gh,LinearScale:()=>Qm,LogScale:()=>_m,Marker:()=>Sd,Menu:()=>av,MercatorScale:()=>Sb,NODE_UPDATE_STATE_TO_PHASE_MAPPING:()=>Fh,NativeWidget:()=>vi,NiceMode:()=>rc,Node:()=>P,OrdinalTimeScale:()=>Dc,PHASE_METADATA:()=>Ka,PanToBBoxScalingModeEnum:()=>jl,Path:()=>je,PlacedSeriesLabel:()=>vt,PointerEvents:()=>N,PolarAxis:()=>Tb,PolarSeries:()=>ab,QuadtreeNearest:()=>Um,RadialColumnShape:()=>Xb,Range:()=>dy,Rect:()=>Ge,Rotatable:()=>fe,RotatableSvgPath:()=>Wb,RotatableText:()=>Xe,SMALLEST_KEY_INTERVAL:()=>Pr,Scalable:()=>xe,ScalableGroup:()=>De,Scene:()=>Yi,Sector:()=>Qb,SectorBox:()=>Gb,SegmentedPath:()=>Gm,Selection:()=>_h,SelectionState:()=>il,Series:()=>Td,SeriesArea:()=>ld,SeriesLabelProperties:()=>Pb,SeriesMarker:()=>wd,SeriesNodePickMode:()=>Cd,SeriesProperties:()=>ml,SeriesSelectionProperties:()=>hl,SeriesTooltip:()=>Tf,Shape:()=>ce,SliderWidget:()=>Ti,SplitBucketLookupManager:()=>Nb,StopProperties:()=>_,SvgPath:()=>Hb,Text:()=>Ue,TimeScale:()=>vc,Toolbar:()=>gv,ToolbarButtonWidget:()=>dv,ToolbarWidget:()=>Ri,TooltipManager:()=>Al,Transformable:()=>Me,TransformableGroup:()=>Ie,TransformableText:()=>Ze,Translatable:()=>be,TranslatableGroup:()=>we,TranslatableSvgPath:()=>jb,UnitTimeScale:()=>Ac,ZoomManager:()=>sh,accumulativeValueProperty:()=>Ir,addHitTestersToQuadtree:()=>Yf,adjustLabelPlacement:()=>gf,angleCategoryAxisOptionsDefs:()=>Pn,angleNumberAxisOptionsDefs:()=>Ln,animationValidation:()=>Wr,annotationCalloutStylesDefs:()=>vs,annotationChannelTextDefs:()=>hs,annotationCommentStylesDefs:()=>Ss,annotationCrossLineStyleDefs:()=>ms,annotationDisjointChannelStyleDefs:()=>fs,annotationFibonacciStylesDefs:()=>bs,annotationLineStyleDefs:()=>gs,annotationLineTextDefs:()=>ls,annotationMeasurerStylesDefs:()=>Ds,annotationNoteStylesDefs:()=>Ms,annotationOptionsDef:()=>Is,annotationParallelChannelStyleDefs:()=>xs,annotationQuickMeasurerStylesDefs:()=>ws,annotationShapeStylesDefs:()=>ks,annotationTextStylesDef:()=>rs,bandRangeExpansion:()=>zd,barLabelDataContext:()=>sf,barLabelObstaclesFor:()=>af,boxPlotSeriesThemeableOptionsDef:()=>Ts,buildBarLabelCandidates:()=>ff,buildColorCategoryLegendData:()=>cb,buildGradientLegendDatum:()=>lb,buildResetPathFn:()=>tb,calculateDataDiff:()=>jx,calculateLabelTranslation:()=>Fb,calculateSegments:()=>Pm,candlestickSeriesThemeableOptionsDef:()=>Es,cartesianMarkerDrawMode:()=>Zx,checkCrisp:()=>Lx,chordSeriesThemeableOptionsDef:()=>zs,clippedRoundRect:()=>_e,collapsedStartingBarPosition:()=>Tx,colorScaleLegendFormatterContext:()=>hb,commonAxisThemeTemplate:()=>Cm,commonChartThemeTemplate:()=>Nm,compassCandidatePlacement:()=>Jy,computeBarFocusBounds:()=>Bx,computeMarkerFocusBounds:()=>Xx,coneFunnelSeriesThemeableOptionsDef:()=>Vs,configureColorScale:()=>ob,createAxisLabelFormatterCache:()=>Xh,createBarCandidateStyleResolver:()=>of,createBarPositionedCandidateResolver:()=>Sf,createCandidateStyleResolver:()=>tf,createDatumId:()=>Xr,createDynamicContext:()=>n.Xlx,deepCloneDataSet:()=>Th,diff:()=>Ur,drawCorner:()=>He,drawMarkerUnitPolygon:()=>hd,expandLabelBoxExtent:()=>kt,expandPlacementLabelBoxExtent:()=>Dt,findNodeDatumInArray:()=>Il,findQuadtreeMatch:()=>Uf,fitLabelToContainer:()=>jy,fitLabelToContainerAutoSize:()=>Wy,fixNumericExtent:()=>uo,formatAxisLabelValue:()=>
vendor: 4,488 bytes, line 1
1oc,fromToMotion:()=>Vh,funnelSeriesThemeableOptionsDef:()=>$s,generateTicks:()=>Vc,getAxisLabelSideFlag:()=>Zh,getColorStops:()=>K,getCrossLineValue:()=>Bd,getCrossLinesPlugin:()=>Eb,getItemId:()=>Md,getItemStyles:()=>Sl,getItemStylesPerItemId:()=>Ml,getLabelStyles:()=>rf,getMarkerStyles:()=>qx,getMissCount:()=>go,getRadialColumnWidth:()=>Zb,getShapeFill:()=>Id,getShapeStyle:()=>Ad,groupAccumulativeValueProperty:()=>Cr,hasDimmedOpacity:()=>kl,heatmapSeriesThemeableOptionsDef:()=>Hs,initialStatePickedOptionsDef:()=>Ra,insideBarLabelBounds:()=>uf,interpolatePoints:()=>Dx,isTooltipValueMissing:()=>eu,isUnselected:()=>ol,isValidScaleValue:()=>Ed,keyProperty:()=>Mr,makeSeriesTooltip:()=>Of,mapLineBackgroundSeriesThemeableOptionsDef:()=>_s,mapLineSeriesThemeableOptionsDef:()=>Ws,mapMarkerSeriesThemeableOptionsDef:()=>Gs,mapShapeBackgroundSeriesThemeableOptionsDef:()=>Ys,mapShapeSeriesThemeableOptionsDef:()=>Ks,markerFadeInAnimation:()=>_x,markerSwipeScaleInAnimation:()=>Gx,maxMarkerStrokePickInflation:()=>Qx,midpointStartingBarPosition:()=>Ox,minimumTimeAxisDatumGranularity:()=>iy,motion:()=>Sv,nightingaleSeriesThemeableOptionsDef:()=>Xs,normaliseGroupTo:()=>zr,numberAxisOptionsDefs:()=>wn,ohlcSeriesThemeableOptionsDef:()=>js,ordinalTimeAxisOptionsDefs:()=>Nn,organizationSeriesThemeableOptionsDef:()=>qs,pairUpSpans:()=>kx,parentLevelAxisThemeTemplate:()=>Am,pathFadeInAnimation:()=>eb,pathMotion:()=>Vb,pathSwipeInAnimation:()=>Jx,pickPlacementStyle:()=>Zy,pickSectorsInBBoxPredicate:()=>vv,placedLabelTextOffset:()=>It,plotAreaPathFill:()=>Vx,plotInterpolatedLinePathStroke:()=>Ax,plotLinePathStroke:()=>Ix,predictCartesianFinancialAxis:()=>Em,predictCartesianNonPrimitiveAxis:()=>Rm,prepareAreaFillAnimationFns:()=>Hx,prepareBarAnimationFunctions:()=>Rx,prepareLinePathPropertyAnimation:()=>Nx,processedDataIsAnimatable:()=>gr,pyramidSeriesThemeableOptionsDef:()=>Qs,radarAreaSeriesThemeableOptionsDef:()=>Js,radarLineSeriesThemeableOptionsDef:()=>ea,radialBarSeriesThemeableOptionsDef:()=>ta,radialColumnSeriesThemeableOptionsDef:()=>ia,radiusCategoryAxisOptionsDefs:()=>On,radiusNumberAxisOptionsDefs:()=>Tn,rangeAreaSeriesThemeableOptionsDef:()=>la,rangeBarSeriesThemeableOptionsDef:()=>ca,replaceDataSet:()=>Oh,resetAxisLabelSelectionFn:()=>dc,resetBarSelectionsDirect:()=>zx,resetBarSelectionsFn:()=>Ex,resetLabelFn:()=>Nf,resetMarkerFn:()=>Kx,resetMarkerPositionFn:()=>Ux,resetMarkerSelectionsDirect:()=>Yx,resetMotion:()=>Wh,resolveBarLabelCandidate:()=>vf,resolvePlacementLabelBoxExtent:()=>wt,sankeySeriesThemeableOptionsDef:()=>da,sectorBox:()=>vy,seriesLabelFadeInAnimation:()=>Af,seriesLabelFadeOutAnimation:()=>Cf,stackCartesianSeries:()=>cy,standaloneChartOptionsDefs:()=>$a,styledBarLabelBox:()=>nf,styledLabelTextOffset:()=>At,sunburstSeriesThemeableOptionsDef:()=>ua,titleAxisThemeTemplate:()=>Im,toHierarchyHighlightString:()=>ub,toHighlightString:()=>sl,toResolvedPlacement:()=>qy,toSelectionString:()=>al,topologyChartOptionsDefs:()=>Va,trailingAccumulatedValueProperty:()=>Ar,treemapSeriesThemeableOptionsDef:()=>pa,updateClipPath:()=>ib,updateLabelNode:()=>lf,upsertNodeDatum:()=>Fx,userInteraction:()=>th,validateCrossLineValue:()=>Fd,valueProperty:()=>kr,visibleRangeIndices:()=>bl,waterfallSeriesThemeableOptionsDef:()=>ma});var Im={title:{enabled:!1,text:"Axis Title",spacing:25,fontWeight:{$ref:"fontWeight"},fontSize:{$rem:n.q8q.MEDIUM},fontFamily:{$ref:"fontFamily"},color:{$ref:"textColor"},wrapping:"always",truncate:!0}},Am={parentLevel:{enabled:!1,label:{enabled:{$path:"../../label/enabled"},border:{enabled:{$or:[{$isUserOption:"../border"},{$path:"../../../label/border/enabled"}]},strokeWidth:{$path:"../../../label/border/strokeWidth"},stroke:{$path:"../../../label/border/stroke"}},fill:{$path:"../../label/fill"},fontSize:{$path:"../../label/fontSize"},fontFamily:{$path:"../../label/fontFamily"},fontWeight:"bold",spacing:{$path:"../../label/spacing"},color:{$path:"../../label/color"},cornerRadius:{$path:"../../label/cornerRadius"},padding:{$path:"../../label/padding"},avoidCollisions:{$path:"../../label/avoidCollisions"}},tick:{enabled:{$path:"../../tick/enabled"},width:{$path:"../../tick/width"},size:{$path:"../../tick/size"},stroke:{$path:"../../tick/stroke"}}}},Cm={reverse:!1,label:{enabled:!0,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},spacing:11,color:{$ref:"textColor"},avoidCollisions:!0,cornerRadius:4,border:{enabled:!1,strokeWidth:1,stroke:{$foregroundOpacity:.08}}
1,padding:{$if:[{$path:"./border/enabled"},{left:12,right:12,top:8,bottom:8},5]}},line:{enabled:!0,width:1,stroke:{$ref:"axisLineColor"}},tick:{enabled:!1,size:6,width:1,stroke:{$ref:"axisLineColor"}},gridLine:{enabled:!0,width:1,style:{$apply:[{fillOpacity:1,stroke:{$ref:"gridLineColor"},strokeWidth:{$path:"../../width"},lineDash:[]},[{fillOpacity:1,stroke:{$ref:"gridLineColor"},strokeWidth:{$path:"../../width"},lineDash:[]}]]}}},Nm={mode:"standalone",suppressFieldDotNotation:!1,keyboard:{initialFocus:"data-start"},touch:{dragAction:"drag"}};function Lm(e){return e.isReversed()!==e.range[1]<e.range[0]}function Pm(e,t,i,s,a,o=!0){if(0===t.scale.domain.length||0===i.scale.domain.length)return;const r=e.key===n.tv$.X?t:i,{scale:l,direction:h}=r,c=h===n.tv$.X,d=l.bandwidth??0,u=o?((l.step??0)-d)/2:0,p=Math.max(s.x,a.width-(s.x+s.width)),g=Math.max(s.y,a.height-(s.y+s.height));return(e=>{const a=[];let o=-1;for(let r=0;r<e.length;r++){const h=e[r];if((0,n.RIy)(h))continue;const{start:d,stop:m,...y}=e[r],f=e[o]?.stop,x=e.slice(r+1).find((e=>null!=e.start))?.start;let b=l.convert(d??f)-u,v=l.convert(m??x)+2*u;const S=null!=d&&Number.isNaN(b),M=null!=m&&Number.isNaN(v);S||M||(Number.isNaN(b)&&(b=Lm(c?t:i)?c?s.width+p:s.height+g:c?-p:-g),Number.isNaN(v)&&(v=Lm(c?t:i)?c?-p:-g:c?s.width+p:s.height+g),null!=m&&(o=r),a.push({start:b,stop:v,...y}))}return a})(e.segments).map((({stop:e,start:t,...i})=>({clipRect:{x0:c?t:-p,y0:c?-g:t,x1:c?e+d:s.width+p,y1:c?s.height+g:e+d},...i})))}var Tm=new Set(["time","timestamp","date","datetime"]);function Om(e,t,i,{allowPrimitiveTypes:s=!0}={}){if(e!==n.tv$.X&&e!==n.tv$.Y)return;if(!(0,n.Gvm)(t))return;const a=zm(e,i);if(null==a||!(a in t))return;const o=t[a],r=Bm(e,i),l=function(e){if((0,n.cyL)(e)&&e.every((e=>(0,n.KgX)(e)||null===e)))return n.uCf.GROUPED_CATEGORY}(o);if(l)return{type:l,position:r};const h=function(e,t){if((0,n.$PY)(t)||Tm.has(e)&&((0,n.zZm)(t)||(0,n.p1d)(t)))return n.uCf.TIME}(a,o);return h?{type:h,position:r}:s?"number"==typeof o?{type:n.uCf.NUMBER,position:r}:{type:n.uCf.CATEGORY,position:r}:void 0}function Rm(e,t,i){return Om(e,t,i,{allowPrimitiveTypes:!1})}function Em(e,t,i){if(e!==n.tv$.X)return;if(!(0,n.Gvm)(t))return;const s=zm(e,i);if(null==s||!(s in t))return;const a=t[s],o=Bm(e,i),r=function(e,t){if((0,n.$PY)(t)||Tm.has(e)&&((0,n.zZm)(t)||(0,n.p1d)(t)))return n.uCf.ORDINAL_TIME}(s,a);return r?{type:r,position:o}:(0,n.KgX)(a)?{type:"category",position:o}:void 0}function zm(e,t){return e===n.tv$.X&&"xKey"in t?t.xKey:e===n.tv$.Y&&"yKey"in t?t.yKey:void 0}function Bm(e,t){return"direction"in t&&"horizontal"===t.direction?e===n.tv$.X?n.v9C.LEFT:n.v9C.BOTTOM:e===n.tv$.X?n.v9C.BOTTOM:n.v9C.LEFT}var Fm={2:(e,t)=>Math.log2(t),[Math.E]:(e,t)=>Math.log(t),10:(e,t)=>Math.log10(t)},Vm=(e,t)=>Math.log(t)/Math.log(e);function $m(e,t,i){const n=Math.min(...t),s=Fm[e]??Vm;return n>=0?s(e,i):-s(e,-i)}var Hm={[Math.E]:(e,t)=>Math.exp(t),10:(e,t)=>t>=0?10**t:1/10**-t},jm=(e,t)=>e**t;function Wm(e,t,i){const n=Math.min(...t),s=Hm[e]??jm;return n>=0?s(e,i):-s(e,-i)}var _m=class e extends Rl{constructor(e=[1,10],t=[0,1]){super(e,t),this.type="log",this.defaultClamp=!0,this.base=10,this.log=e=>$m(this.base,this.domain,e),this.pow=e=>Wm(this.base,this.domain,e)}static is(t){return t instanceof e}transform(e){const[t,i]=(0,n.uYy)(this.domain);return t>=0!=i>=0?Number.NaN:t>=0?Math.log(e):-Math.log(-e)}transformInvert(e){const[t,i]=(0,n.uYy)(this.domain);return t>=0!=i>=0?Number.NaN:t>=0?Math.exp(e):-Math.exp(-e)}toDomain(e){return e}niceDomain(e,t=this.domain){if(t.length<2)return[];t=t.map(Number);const{base:i}=this,[n,s]=t,a=n>s?Math.ceil:Math.floor,o=n>s?Math.floor:Math.ceil,r=Wm(i,t,a($m(i,t,n))),l=Wm(i,t,o($m(i,t,s)));return[e.nice[0]?r:t[0],e.nice[1]?l:t[1]]}ticks({interval:e,tickCount:t=Rl.defaultTickCount},i=this.domain,s){if(!i||i.length<2||t<1)return;i=i.map(Number);const a=this.base,[o,r]=i,l=Math.min(o,r),h=Math.max(o,r);let c=this.log(l),d=this.log(h);if(e){const t=e=>e>=l&&e<=h,i=Math.min(Math.abs(e),Math.abs(d-c)),{ticks:a,count:o,firstTickIndex:r}=(0,n.y17)(c,d,i,s),u=a.map(this.pow).filter(t);if(!(0,n.bVu)(u.length,this.getPixelRange(),this.logger))return{ticks:u,count:o,firstTickIndex:r}}if(!(0,n.FqJ)(a)||d-c>=t){const e=Math.min(d-c,t),{ticks:i,count:a,firstTickIndex:o}=(0,n.np_)(c,d,e,void 0,void 0,s);return{ticks:i.map(this.pow),count:a,firstTickIndex:o}}const u=[],p=l>0;c=Math.floor(c)-1,d=Math.round(d)+1;const g=(0,n.DuJ)(this.range)/t;let m=1/0;for(let e=c;e<=d;e++){const t=this.convert(this.pow(e+1));for(let i=1;i<a;
1i++){const n=p?i:a-i+1,s=this.pow(e)*n,o=this.convert(s),r=Math.abs(m-o),c=Math.abs(o-t);s>=l&&s<=h&&(1===i||r>=g&&c>=g||0===u.length)&&(u.push(s),m=o)}}return R(u,p,s)}},Gm=(()=>{var e=class extends je{constructor(){super(...arguments),this.segmentPath=new je}drawPath(e,t){if(!this.segments||0===this.segments.length)return void super.drawPath(e,t);e.save();const i=(0,n.w6e)(),s=new i,a=this.layerManager?.canvas?.pixelRatio??1;Km(s,{x0:0,y0:0,x1:e.canvas.width/a,y1:e.canvas.height/a},!1);for(const e of this.segments)Km(s,e.clipRect);e.clip(s),super.drawPath(e,t),e.restore();const{segmentPath:o}=this;o.setProperties({opacity:this.opacity,visible:this.visible,lineCap:this.lineCap,lineJoin:this.lineJoin,pointerEvents:this.pointerEvents});for(const{clipRect:n,fill:s,stroke:a,...r}of this.segments){e.save(),o.path=this.path,o.setProperties(r),o.fill=null==this.fill?"none":s,o.stroke=null==this.stroke?"none":a;const l=new i;Km(l,n),e.clip(l),o.drawPath(e,t),e.restore()}}};return d([(0,n.$aV)()],e.prototype,"segments",2),e})();function Km(e,{x0:t,y0:i,x1:n,y1:s},a=!0){const o=Math.min(t,n),r=Math.min(i,s),l=Math.max(t,n),h=Math.max(i,s);e.moveTo(o,r),a?(e.lineTo(l,r),e.lineTo(l,h),e.lineTo(o,h)):(e.lineTo(o,h),e.lineTo(l,h),e.lineTo(l,r)),e.closePath()}var Ym=(()=>{var e=class extends we{constructor(){super(...arguments),this.segments=[],this.scalablePath=new(xe(je))}renderInContext(e){if(!this.visible)return;const{ctx:t}=e;if(!this.segments||0===this.segments?.length)return super.renderInContext(e);t.save();const i=(0,n.w6e)(),s=new i;Km(s,{x0:0,y0:0,x1:t.canvas.width,y1:t.canvas.height},!1);for(const e of this.segments)Km(s,e.clipRect);t.clip(s);for(const t of this.children())t.visible&&t.render(e);t.restore();const{scalablePath:a}=this;for(const{clipRect:n,...s}of this.segments){t.save();const r=new i;Km(r,n),t.clip(r),a.setProperties(s);for(const t of this.children())t.visible&&t instanceof je&&(a.path=t.path,a.setProperties({opacity:t.opacity,lineCap:t.lineCap,lineJoin:t.lineJoin,...(o=t,"scalingX"in o&&"scalingY"in o&&"scalingCenterX"in o&&"scalingCenterY"in o&&{scalingX:t.scalingX,scalingY:t.scalingY,scalingCenterX:t.scalingCenterX,scalingCenterY:t.scalingCenterY})}),a.render(e));t.restore()}var o}};return d([(0,n.$aV)()],e.prototype,"segments",2),e})(),Um=class{constructor(e,t,i){this.root=new qm(e,t,i)}clear(e){this.root.clear(e)}addValue(e,t){const i={hitTester:e,value:t,distanceSquared:(t,i)=>e.distanceSquared(t,i)};this.root.addElem(i)}find(e,t){const i={best:{nearest:void 0,distanceSquared:1/0}};return this.root.find(e,t,i),i.best}},Xm=class{constructor(e,t,i,n){this.nw=e,this.ne=t,this.sw=i,this.se=n}addElem(e){this.nw.addElem(e),this.ne.addElem(e),this.sw.addElem(e),this.se.addElem(e)}find(e,t,i){this.nw.find(e,t,i),this.ne.find(e,t,i),this.sw.find(e,t,i),this.se.find(e,t,i)}},Zm=class{constructor(e,t,i){this.capacity=e,this.maxdepth=t,this.boundary=i??m.NaN,this.elems=[],this.subdivisions=void 0}clear(e){this.elems.length=0,this.boundary=e,this.subdivisions=void 0}addElem(e){this.addCondition(e)&&(void 0===this.subdivisions?0===this.maxdepth||this.elems.length<this.capacity?this.elems.push(e):this.subdivide(e):this.subdivisions.addElem(e))}find(e,t,i){this.findCondition(e,t,i)&&(void 0===this.subdivisions?this.findAction(e,t,i):this.subdivisions.find(e,t,i))}subdivide(e){this.subdivisions=this.makeSubdivisions();for(const e of this.elems)this.subdivisions.addElem(e);this.subdivisions.addElem(e),this.elems.length=0}makeSubdivisions(){const{x:e,y:t,width:i,height:n}=this.boundary,{capacity:s}=this,a=this.maxdepth-1,o=i/2,r=n/2,l=new m(e,t,o,r),h=new m(e+o,t,o,r),c=new m(e,t+r,o,r),d=new m(e+o,t+r,o,r);return new Xm(this.child(s,a,l),this.child(s,a,h),this.child(s,a,c),this.child(s,a,d))}},qm=class e extends Zm{addCondition(e){const{x:t,y:i}=e.hitTester.midPoint;return this.boundary.containsPoint(t,i)}findCondition(e,t,i){const{best:n}=i;return 0!==n.distanceSquared&&this.boundary.distanceSquared(e,t)<n.distanceSquared}findAction(e,t,i){const s=(0,n.KpM)(e,t,this.elems,i.best.distanceSquared);void 0!==s.nearest&&s.distanceSquared<i.best.distanceSquared&&(i.best=s)}child(t,i,n){return new e(t,i,n)}},Qm=class e extends Rl{constructor(){super([0,1],[0,1]),this.type="number"}static is(t){return t instanceof e}static getTickStep(e,t,i){const{interval:s,tickCount:a=Rl.defaultTickCount,minTickCount:o,maxTickCount:r}=i;return null==s?(0,n.sG5)(e,t,a,o,r):Number(s)}toDomain(e){return(0,n.sI5)(this.domainMin)&&(0,n.sI5)(this.domainMax)&&((0,n.sI5)(e)||Number.isInteger(e))?BigInt(e):e}ticks({interval:e,tickCount:t=Rl.defaultTickCount,minTickCount:i,maxTickCount:s},a=this.domain,o){if(!a||a.length<2||t<1)return{ticks:[],count:0,firstTickIndex:0};const[r,l]=a,h="bigint"==typeof r&&"bigint"==typeof l,c=null==o||0===o[0]&&1===o[1];if(h&&!e&&c){const e=(0,n.ozM)(r,l,t);return{ticks:e,count:e.length,firstTickIndex:0}}const d=a.map(Number);if(!d.every(Number.isFinite))return{ticks:[],count:0,firstTickIndex:0};const[u,p]=d;if(e){const t=Math.abs(Number(e));if(!(0,n.bVu)((p-u)/t,this.getPixelRange(),this.logger))return(0,n.y17)(u,p,t,o)}return(0,n.np_)(u,p,t,i,s,o)}niceDomain(t,i=this.domain){if(i.length<2)return[];const{tickCount:s=Rl.defaultTickCount}=t,[a,o]=i;
1if("bigint"==typeof a&&"bigint"==typeof o&&null==t.interval){const[e,i]=(0,n.hLv)(a,o,s);return[t.nice[0]?e:a,t.nice[1]?i:o]}const r=i.map(Number);let[l,h]=r;if(1===s)[l,h]=(0,n._hN)(l,h);else if(s>1){const i=l>h?Math.ceil:Math.floor,n=l>h?Math.floor:Math.ceil,s=4;for(let a=0;a<s;a++){const s=l,a=h,o=e.getTickStep(l,h,t),[c,d]=r;if(l=i(c/o)*o,h=n(d/o)*o,l===s&&h===a)break}}return[t.nice[0]?l:r[0],t.nice[1]?h:r[1]]}},Jm=(()=>{var e=class extends Yc{constructor(e,t,i=new Qm,n){super(e,t,i,n)}hasDefinedDomain(){const{min:e,max:t}=this.options;return null!=e&&null!=t&&e<t}getLabelFormat(){return this.options.label.format}normaliseDataDomain(e){const{min:t,max:i,preferredMin:s,preferredMax:a}=this.options,{extent:o,clipped:r}=(0,n.Myf)(e.domain,t,i,s,a,void 0,e.sortMetadata?.sortOrder);return{domain:o,clipped:r}}getDomainExtentsNice(){return[null==this.options.min&&this.nice,null==this.options.max&&this.nice]}getVisibleDomain(e){const t=Number(e[0]),i=Number(e[1]),[n,s]=this.visibleRange,a=i-t;return[t+n*a,i-(1-s)*a]}tickFormatParams(e,t,i){return{type:"number",visibleDomain:this.getVisibleDomain(e),fractionDigits:i}}datumFormatParams(e,t,i){const{datum:n,seriesId:s,legendItemName:a,key:o,source:r,property:l,domain:h,boundSeries:c}=t;return{type:"number",value:e,datum:n,seriesId:s,legendItemName:a,key:o,source:r,property:l,domain:h,visibleDomain:this.getVisibleDomain(h),boundSeries:c,fractionDigits:i}}};return e.className="NumberAxis",e.type="number",e})();function ey(e){return"bigint"==typeof e?Number(e):(0,n.p1d)(e)?new Date(e):e}var ty=(()=>{var e=class extends Yc{constructor(e,t,i){super(e,t,new vc,i)}hasDefinedDomain(){const{min:e,max:t}=this.options;return null!=e&&null!=t&&e<t}isCategoryLike(){return!1}get primaryLabel(){const e=this.options.parentLevel;return e?.enabled?e.label:void 0}getLabelFormat(){const e=this.options.label.format;return e}getPrimaryLabelFormat(){const e=this.primaryLabel?.format;return e}get primaryTick(){const e=this.options.parentLevel;return e?.enabled?e.tick:void 0}normaliseDataDomain(e){const{min:t,max:i,preferredMin:s,preferredMax:a}=this.options,{extent:o,clipped:r}=(0,n.XKY)(e,ey(t),ey(i),ey(s),ey(a));return{domain:o,clipped:r}}processData(){super.processData();const{boundSeries:e,direction:t}=this,{min:i,max:n}=this.options;this.minimumTimeGranularity=iy(e,t,ey(i),ey(n))}tickFormatParams(e,t,i,s){s??(s=(0,n._cn)(t));const a=(0,n.pm8)(e);return{type:"date",unit:(0,n.u1v)(s),step:(0,n.SBk)(s),epoch:(0,n.Nam)(s),truncateDate:a}}datumFormatParams(e,t,i,s,a){if(e instanceof Date||(e=new Date((0,n.Hre)(e))),null==s){const{minimumTimeGranularity:t}=this,i=(0,n.DSS)(e);s=null!=t&&(0,n.UQv)(t)<(0,n.UQv)(i)?t:i}const{datum:o,seriesId:r,legendItemName:l,key:h,source:c,property:d,domain:u,boundSeries:p}=t;return{type:"date",value:e,datum:o,seriesId:r,legendItemName:l,key:h,source:c,property:d,domain:u,boundSeries:p,unit:(0,n.u1v)(s),step:(0,n.SBk)(s),epoch:(0,n.Nam)(s),style:a}}};return e.className="TimeAxis",e.type="time",e})();function iy(e,t,i,s){const a=e.reduce(((e,t)=>Math.min(t.minTimeInterval()??1/0,e)),1/0);return Number.isFinite(a)?(0,n.nhz)(a):ny(e,t,i,s)?.unit}function ny(e,t,i,s){let a,o=1/0,r=-1/0,l=0;const h=[];for(const i of e){if(!i.visible)continue;const{extent:e}=(0,n.XKY)(i.getDomain(t));if(0===e.length)continue;const s=e[0].valueOf(),c=e.at(-1).valueOf();h.push(s,c),o=Math.min(o??1/0,s,c),r=Math.max(r??-1/0,s,c);const d=Math.abs(c-s);if(0===d)continue;const u=i.dataCount();if(l=Math.max(l,u),u<=1)continue;const p=d/(u-1);a=Math.min(a??1/0,p)}if(o=Math.min(o,i?.valueOf()??1/0,s?.valueOf()??1/0),r=Math.max(r,i?.valueOf()??-1/0,s?.valueOf()??-1/0),!Number.isFinite(o)||!Number.isFinite(r))return;a??(a=Math.abs(r-o)),a=Math.min(a,function(e){e.sort(((e,t)=>e-t));let t=1/0;for(let i=1;i<e.length;i++){const n=e[i-1],s=e[i];s-n>0&&(t=Math.min(t,Math.abs(s-n)))}return t}(h));const c=(0,n.nhz)(a);let d=a/(0,n.UQv)(c);d=l<=2?Math.floor(d):Math.round(d),d=Math.max(d,1);return{unit:c,step:d,epoch:1===d?void 0:(0,n.qpA)(c,o)}}var sy=class extends Td{constructor({clipFocusBox:e,categoryKey:t,...i}){super(i),this.categoryKey=t,this.clipFocusBox=e??!0}
1dataCount(){return this.processedData?.dataSources?.get(this.id)?.data?.length??0}invalidDataCount(){return this.processedData?.invalidDataCount?.get(this.id)??0}missingDataCount(){return this.dataModel?.resolveMissingDataCount(this)??0}get hasData(){return Math.max(0,this.dataCount()-this.invalidDataCount()-this.missingDataCount())>0}getScaleInformation({xScale:e,yScale:t}){return{isContinuousX:Rl.is(e),isContinuousY:Rl.is(t),xScaleType:e?.type,yScaleType:t?.type}}getModulePropertyDefinitions(){const e=this.axes[n.tv$.X]?.scale,t=this.axes[n.tv$.Y]?.scale;return this.moduleMap.mapModules((i=>i.getPropertyDefinitions(this.getScaleInformation({xScale:e,yScale:t})))).flat()}async requestDataModel(e,t,i){i.props.push(...this.getModulePropertyDefinitions()),t??(t=Ph.empty(this.ctx.logger));const{dataModel:n,processedData:s}=await e.request(this.id,t,i);return this.dataModel=n,this.processedData=s,this.categoryValueLookup=void 0,this.events.emit("data-processed",{dataModel:n,processedData:s}),{dataModel:n,processedData:s}}isProcessedDataAnimatable(){const{processedData:e,ctx:t}=this;if(!e)return!1;const i=this.getNodeData();if(null!=i&&i.length>t.animationManager.maxAnimatableItems)return!1;const n=e.reduced?.animationValidation;if(!n)return!0;const{orderedKeys:s,uniqueKeys:a}=n;return s&&a}checkProcessedDataAnimatable(){this.isProcessedDataAnimatable()||this.ctx.animationManager.skipCurrentBatch()}findNodeDatum(e){return Il(e,this.getNodeData(),this.data?.dataIdKey)}pickFocus(e){const t=this.getNodeData();if(void 0===t||0===t.length)return;const i=this.computeFocusDatumIndex(e,t);if(void 0===i)return;const{clipFocusBox:n}=this,s=t[i],a={...e,datumIndex:i},o=this.computeFocusBounds(a);return void 0!==o?{bounds:o,clipFocusBox:n,datum:s,datumIndex:i}:void 0}pickNodesExactShape(e){const t=super.pickNodesExactShape(e);return t.sort(((e,t)=>e.datum.datumIndex-t.datum.datumIndex)),t}isDatumEnabled(e,t){const{missing:i=!1,enabled:n=!0,focusable:s=!0}=e[t];return!i&&n&&s}computeFocusDatumIndex(e,t){const i=(e,i)=>{for(;e>=0&&!this.isDatumEnabled(t,e);)e+=i;return-1===e?void 0:e},s=(e,i)=>{for(;e<t.length&&!this.isDatumEnabled(t,e);)e+=i;return e===t.length?void 0:e};let a;const o=(0,n.qE8)(0,e.datumIndex,t.length-1);return a=e.datumIndexDelta<0?i(o,e.datumIndexDelta):e.datumIndexDelta>0?s(o,e.datumIndexDelta):s(o,1)??i(o,-1),void 0===a?0===e.datumIndexDelta?void 0:e.datumIndex-e.datumIndexDelta:a}dataModelPropertyIsKey(e){const{processedData:t}=this;return!!t&&t.defs.keys.some((t=>t.id===e&&!0===t.idsMap?.get(this.id)?.has(e)))}keysOrValues(e){const{dataModel:t,processedData:i}=this;return t&&i?this.dataModelPropertyIsKey(e)?t.resolveKeysById(this,e,i):t.resolveColumnById(this,e,i,"object"):[]}sortOrder(e){const{dataModel:t,processedData:i}=this;if(t&&i)return this.dataModelPropertyIsKey(e)?t.getKeySortOrder(this,e,i):t.getColumnSortOrder(this,e,i)}getCategoryKey(){return this.categoryKey}getCategoryValue(e){const{processedData:t,dataModel:i}=this,n=this.getCategoryKey();if(!t||!i||!n)return;return t.invalidData?.get(this.id)?.[e]??!1?void 0:this.keysOrValues(n)[e]}datumIndexForCategoryValue(e){const{processedData:t,dataModel:i}=this,s=this.getCategoryKey();if(!t||!i||!s)return;e=e.valueOf();const a=t.invalidData?.get(this.id),o=this.keysOrValues(s),r=this.categoryValueIndex(o,a);if(null!=r)return r.get(e);for(let t=0;t<o.length;t+=1){if(!0===a?.[t])continue;const i=o[t]?.valueOf();if((0,n.DH9)(e,i))return t}}categoryValueIndex(e,t){let i=this.categoryValueLookup;return i?.xValues===e&&i.invalidValues===t||(i={xValues:e,invalidValues:t,byValue:ay(e,t)},this.categoryValueLookup=i),i.byValue}};function ay(e,t){const i=new Map;for(let n=0;n<e.length;n+=1){if(!0===t?.[n])continue;const s=e[n]?.valueOf();if(null!==s&&"object"==typeof s)return;"number"==typeof s&&Number.isNaN(s)||(i.has(s)||i.set(s,n))}return i}var oy={[n.tv$.X]:["xKey"],[n.tv$.Y]:["yKey"]},ry={[n.tv$.X]:["xName"],[n.tv$.Y]:["yName"]},ly=(()=>{var e=class extends ml{constructor(){super(...arguments),this.xKeyAxis="x",this.yKeyAxis="y",this.pickOutsideVisibleMinorAxis=!1,this.segmentation=new dl}};return d([n.mAP],e.prototype,"xKeyAxis",2),d([n.mAP],e.prototype,"yKeyAxis",2),d([n.mAP],e.prototype,"legendItemName",2),d([n.mAP],e.prototype,"pickOutsideVisibleMinorAxis",2),d([n.mAP],e.prototype,"segmentation",2),e})(),hy=class extends sy{constructor({pathsPerSeries:e=["path"],pathsZIndexSubOrderOffset:t=[],datumSelectionGarbageCollection:i=!0,animationAlwaysUp
1dateSelections:s=!1,animationAlwaysPopulateNodeData:a=!1,segmentedDataNodes:o=!0,animationResetFns:r,propertyKeys:l,propertyNames:h,...c}){if(super({propertyKeys:l,propertyNames:h,canHaveAxes:!0,...c}),this.dataNodeGroup=this.contentGroup.appendChild(new Ym({name:`${this.id}-series-dataNodes`,zIndex:1})),this.labelGroup=this.contentGroup.appendChild(new we({name:`${this.id}-series-labels`})),this.labelSelection=_h.select(this.labelGroup,Xe),this.highlightSelection=_h.selectNoInference(this.highlightNodeGroup,(()=>this.nodeFactory())),this.highlightLabelSelection=_h.select(this.highlightLabelGroup,Xe),this.annotationSelections=new Set,this.seriesBelowStackContext=void 0,this.debug=n.yar.create(),!l||!h)throw new Error(`Unable to initialise series type ${this.type}`);this.opts={pathsPerSeries:e,pathsZIndexSubOrderOffset:t,propertyKeys:l,propertyNames:h,animationResetFns:r,animationAlwaysUpdateSelections:s,animationAlwaysPopulateNodeData:a,datumSelectionGarbageCollection:i,segmentedDataNodes:o},this.paths=e.map((e=>new Gm({name:`${this.id}-${e}`}))),this.datumSelection=_h.selectNoInference(this.dataNodeGroup,(()=>this.nodeFactory()),i),this.animationState=new n.Z37("empty",{empty:{update:{target:"ready",action:e=>this.animateEmptyUpdateReady(e)},reset:"empty",skip:"ready",disable:"disabled"},ready:{updateData:"waiting",clear:"clearing",highlight:e=>this.animateReadyHighlight(e),resize:e=>this.animateReadyResize(e),reset:"empty",skip:"ready",disable:"disabled"},waiting:{update:{target:"ready",action:e=>{this.ctx.animationManager.isSkipped()?this.resetAllAnimation(e):this.animateWaitingUpdateReady(e)}},reset:"empty",skip:"ready",disable:"disabled"},disabled:{update:e=>this.resetAllAnimation(e),reset:"empty"},clearing:{update:{target:"empty",action:e=>this.animateClearingUpdateEmpty(e)},reset:"empty",skip:"ready"}},this.checkProcessedDataAnimatable.bind(this)),this.cleanup.register(this.ctx.eventsHub.on("legend:item-click",(e=>this.onLegendItemClick(e))),this.ctx.eventsHub.on("legend:item-double-click",(e=>this.onLegendItemDoubleClick(e))))}get contextNodeData(){return this._contextNodeData}getNodeData(){return this.contextNodeData?.nodeData}getKeyAxis(e){if(this.shouldFlipXY()){if(e===n.tv$.X)return this.properties.yKeyAxis;if(e===n.tv$.Y)return this.properties.xKeyAxis}return e===n.tv$.X?this.properties.xKeyAxis:e===n.tv$.Y?this.properties.yKeyAxis:void 0}attachSeries(e,t,i){super.attachSeries(e,t,i),this.attachPaths(this.paths)}detachSeries(e,t,i){super.detachSeries(e,t,i),this.detachPaths(this.paths)}updatedDomains(){this.animationState.transition("updateData")}attachPaths(e){for(const t of e)this.contentGroup.appendChild(t)}detachPaths(e){for(const t of e)t.remove()}renderToOffscreenCanvas(){const e=this.getNodeData();return null!=e&&e.length>100}
1resetAnimation(e){"initial"===e?this.animationState.transition("reset"):"ready"===e?this.animationState.transition("skip"):"disabled"===e&&this.animationState.transition("disable")}destroy(){super.destroy(),this._contextNodeData=void 0}isSeriesHighlighted(e){if(!this.properties.highlight.enabled)return!1;const{series:t,legendItemName:i}=e??{},{legendItemName:n}=this.properties;return t===this||null!=n&&n===i}strokewidthChange(){const e=("strokeWidth"in this.properties&&this.properties.strokeWidth)??0,t=this.properties.highlight.highlightedSeries.strokeWidth??e,i=this.properties.highlight.highlightedItem?.strokeWidth??e;return e>i||t>i}update({seriesRect:e}){const{_contextNodeData:t}=this,i=this.checkResize(e),n=this.updateHighlightSelection(),s=this;this.contentGroup.batchedUpdate((function(){const e=s.updateSelections(),t=s.contextNodeData?.segments;s.opts.segmentedDataNodes?s.dataNodeGroup.segments=t??s.dataNodeGroup.segments:s.dataNodeGroup.segments=void 0,s.updateNodes(n,i||e)}));const a=this.getAnimationData(e,t);a&&(i&&this.animationState.transition("resize",a),this.animationState.transition("update",a),this.processedDataUpdated=!1)}createStackContext(){}canIncrementallyUpdateNodes(e=!1){const t=this.contextNodeData?.nodeData;if(null==t)return!1;const{processedData:i}=this;return!!i&&(null!=i.changeDescription||!gr(i)||e)}trimIncrementalNodeArray(e,t){t<e.length&&(e.length=t)}createNodeData(){const e=this.validateCreateNodeDataPreconditions();if(!e)return;const{xAxis:t,yAxis:i}=e,n=this.createNodeDatumContext(t,i);if(!n)return this.getEmptyResult();const s=this.initializeResult(n);return this.visible||(null!=this.seriesGrouping||this.opts.animationAlwaysPopulateNodeData)&&n.animationEnabled?(this.populateNodeData(n),this.finalizeNodeData(n),this.assembleResult(n,s)):s}createNodeDatumContext(e,t){throw new Error(`${this.constructor.name}: createNodeDatumContext() must be implemented when using the template method pattern`)}populateNodeData(e){throw new Error(`${this.constructor.name}: populateNodeData() must be implemented when using the template method pattern`)}initializeResult(e){throw new Error(`${this.constructor.name}: initializeResult() must be implemented when using the template method pattern`)}validateCreateNodeDataPreconditions(){const e=this.axes[n.tv$.X],t=this.axes[n.tv$.Y];if(e&&t&&this.dataModel&&this.processedData)return{xAxis:e,yAxis:t}}getEmptyResult(){}finalizeNodeData(e){e.canIncrementallyUpdate&&this.trimIncrementalNodeArray(e.nodes,e.nodeIndex)}assembleResult(e,t){return t}updateSelections(){var e;const t=!this.opts.animationAlwaysUpdateSelections&&this.ctx.animationManager.isSkipped();if(!this.visible&&t)return this._contextNodeData&&(this._contextNodeData.visible=!1),!1;const{nodeDataRefresh:i}=this;if(!i&&!this.isPathOrSelectionDirty())return!1;if(i){this.nodeDataRefresh=!1,this.debug("CartesianSeries.updateSelections() - calling createNodeData() for",this.id),this.markQuadtreeDirty(),this._contextNodeData=this.createNodeData();const t=this.isProcessedDataAnimatable();if(this._contextNodeData){(e=this._contextNodeData).animationValid??(e.animationValid=t);const i=this._contextNodeData.nodeData?.length;null!=i&&n.Xjz.record(`${this.type}:nodeData`,i)}const{dataModel:i,processedData:s}=this;void 0!==i&&void 0!==s&&this.events.emit("data-update",{dataModel:i,processedData:s}),this.updateSeriesSelections()}return i}updateSeriesSelections(){this.usesPlacedLabels=this.resolveUsesPlacedLabels();const{datumSelection:e,labelSelection:t,paths:i}=this,n=this._contextNodeData;if(!n)return;const{nodeData:s,labelData:a,itemId:o}=n;this.updatePaths({itemId:o,contextData:n,paths:i}),this.datumSelection=this.updateDatumSelection({nodeData:s,datumSelection:e}),this.labelGroup.batchedUpdate((()=>{this.labelSelection=this.updateLabelSelection({labelData:a,labelSelection:t})??t}))}getShapeFillBBox(){const{axes:e}=this,t=e[n.tv$.X],i=e[n.tv$.Y],[s,a]=(0,n.uYy)(t?.range??[0,1]),[o,r]=(0,n.uYy)(i?.range??[0,1]),l=(0,n.aX5)(this.getSeriesDomain(n.tv$.X)),h=[t?.scale.convert(l.at(0)),t?.scale.convert(l.at(-1))],c=(0,n.aX5)(this.getSeriesDomain(n.tv$.Y)),d=[i?.scale.convert(c.at(0)),i?.scale.convert(c.at(-1))],[u,p]=(0,n.uYy)(h),[g,y]=(0,n.uYy)(d);return{axis:new m(s,o,a-s,r-o),series:new m(u,g,p-u,y-g)}}updateNodes(e,t){const{highlightSelection:i,datumSelection:n}=this,s=!this.ctx.animationManager.isSkipped(),a=this.visible&&null!=this._contextNodeData;this.contentGroup.visible=s||a,this.annotationGroup.visible=s||a,this.highlightGroup.visible=(s||a)&&e,this.updateDatumStyles({datumSelection:i,isHighlight:!0});const o=this.ctx.chartService.highlight?.drawingMode??"overlay";this.updateDatumNodes({datumSelection:i,isHighlight:!0,drawingMode:o}),this.highlightLabelGroup.batchedUpdate((()=>{this.updateLabelNodes({labelSelection:this.highlightLabelSelection,isHighlight:!0})}
1)),this.animationState.transition("highlight",i),this.ctx.eventsHub.emit("highlight:selection-updated",{highlightSelection:i});const{dataNodeGroup:r,labelSelection:l,paths:h,labelGroup:c}=this,{itemId:d}=this.contextNodeData??{};if(this.updatePathNodes({itemId:d,paths:h,visible:a,animationEnabled:s}),r.visible=s||a,c.visible=a,!r.visible)return;this.hasItemStylers()&&this.updateDatumStyles({datumSelection:n,isHighlight:!1});const u=this.strokewidthChange()||this.hasChangesOnHighlight||this.hasChangesOnSelection;this.hasChangesOnSelection=!1,(t||u)&&(this.updateDatumNodes({datumSelection:n,isHighlight:!1,drawingMode:"overlay"}),this.usesPlacedLabels||this.labelGroup.batchedUpdate((()=>{this.updateLabelNodes({labelSelection:l,isHighlight:!1})})))}getHighlightData(e,t){return t?[{...t}]:void 0}getHighlightLabelData(e,t){const i=e.filter((e=>e.datum===t.datum&&e.itemId===t.itemId));return 0===i.length?void 0:i}updateHighlightSelection(){const{highlightSelection:e,highlightLabelSelection:t,_contextNodeData:i}=this;if(!i)return!1;const n=this.ctx.highlightManager?.getActiveHighlight(),s=this.isSeriesHighlighted(n)&&this.isDatumHighlight(n)?n:void 0;if(null==s)return!1;const{nodeData:a,labelData:o}=i,r=this.getHighlightData(a,s);this.highlightSelection=this.updateHighlightSelectionItem({items:r,highlightSelection:e});const l=this.getHighlightLabelData(o,s)??[];return this.highlightLabelSelection=this.updateLabelSelection({labelData:l,labelSelection:t})??t,!0}markQuadtreeDirty(){this.quadtree=void 0}*datumNodesIter(){for(const{node:e}of this.datumSelection)!0!==e.datum?.missing&&(yield e)}getQuadTree(){if(void 0===this.quadtree){const e=this.ctx.scene?.canvas??{width:0,height:0},t=new m(0,0,e.width,e.height);this.quadtree=new Um(100,10,t),this.initQuadTree(this.quadtree)}return this.quadtree}initQuadTree(e){}pickViewportFocus(e){if(void 0===this.contextNodeData?.nodeData)return;const{otherIndex:t,where:i,hoverRect:n}=e;if("data-start"===i)return this.pickFocus({datumIndex:0,datumIndexDelta:0,otherIndex:t,otherIndexDelta:0});if("data-end"===i){const e=this.contextNodeData.nodeData.length-1;return this.pickFocus({datumIndex:e,datumIndexDelta:0,otherIndex:t,otherIndexDelta:0})}let s,a,o=0,r=this.contextNodeData.nodeData.length-1;const l=!0===this.axes.x?.options.reverse;function h(e){const t=n.x+n.width;return e.x+e.width<=t}function c(e){return e.x>=n.x}function d(e,t){e(_d(t))?(s=t,r=a-1):o=a+1}function u(e,t){e(_d(t))?(s=t,o=a+1):r=a-1}const p={"viewport-start + true":{predicate:h,iterator:d},"viewport-start + false":{predicate:c,iterator:d},"viewport-end + true":{predicate:c,iterator:u},"viewport-end + false":{predicate:h,iterator:u}},{predicate:g,iterator:m}=p[`${i} + ${l}`];let y=0;const f=Math.ceil(Math.log2(this.contextNodeData.nodeData.length))+1;for(;o<=r&&y<=f;){a=Math.floor((o+r)/2);const e=this.pickFocus({datumIndex:a,datumIndexDelta:0,otherIndex:t,otherIndexDelta:0});if(void 0===e)return void this.ctx.logger.error(`pickFocus (datumIndex: ${a}) failed`);m(g,e),y++}return s}pickNodeDataExactShape(e){const{x:t,y:i}=e,{dataNodeGroup:n}=this,s=n.pickNodes(t,i).filter((e=>{const{unsafeDatum:t}=e;return void 0!==t&&!0!==t?.missing}));if(0!==s.length)return s.map((e=>({datum:e.datum,distance:0,target:e})))}pickModulesExactShape(e){for(const t of this.moduleMap.modules()){const{unsafeDatum:i}=t.pickNodeExact(e)??{};if(null!=i&&!0!==i?.missing)return[{datum:i,distance:0,target:this.contentGroup}]}}pickNodesExactShape(e){const t=super.pickNodesExactShape(e);return 0!==t.length?t:this.pickNodeDataExactShape(e)??this.pickModulesExactShape(e)??[]}pickNodeDataClosestDatum(e){const{x:t,y:i}=e,{axes:s,_contextNodeData:a}=this;if(!a)return;const o=s[n.tv$.X],r=s[n.tv$.Y],l=t,h=i;let c,d=1/0;for(const e of a.nodeData){const{point:{x:t=Number.NaN,y:i=Number.NaN}={}}=e;if(Number.isNaN(t)||Number.isNaN(i))continue;if(!(o?.inRange(t)&&r?.inRange(i)))continue;const n=Math.max((l-t)**2+(h-i)**2,0);n<d&&(d=n,c=e)}if(null!=d){const e=(c?.point?.size??0)/2,t=Math.sqrt(d);return{datum:c,distance:Math.max(t-e,0)}}}pickModulesClosestDatum(e){let t,i=1/0;for(const n of this.moduleMap.modules()){const s=n.pickNodeNearest(e);void 0!==s&&s.distanceSquared<i&&(i=s.distanceSquared,t=s.unsafeDatum)}if(null!=i)return{unsafeClosestDatum:t,distance:Math.sqrt(i)}}pickNodeClosestDatum(e){let t,i=1/0;const n=this.pickNodeDataClosestDatum(e);null!=n&&n.distance<i&&(i=n.distance,t=n.datum);const s=this.pickModulesClosestDatum(e);if(null!=s&&s.distance<i&&(i=s.distance,t=s.unsafeClosestDatum),t)return{datum:t,distance:i,target:this.contentGroup}}pickNodeMainAxisFirst(e,t){const{x:i,y:s}=e,{axes:a,_contextNodeData:o}=this,{pickOutsideVisibleMinorAxis:r}=this.properties;if(!o)return;const l=a[n.tv$.X],h=a[n.tv$.Y];if(null==l||null==h)return;const c=[l,h].filter((e=>e.isCategoryLike())).map((e=>e.direction));if(t&&0===c.length)return;const[d=n.tv$.X]=c,u=[i,s];d!==n.tv$.X&&u.reverse();const p=[1/0,1/0];let g;for(const e of o.nodeData){const{x:t=Number.NaN,y:i=Number.NaN}=e.point??e.midPoint??{};
1if(Number.isNaN(t)||Number.isNaN(i)||!0===e.missing)continue;const s=[l?.inRange(t,1),h?.inRange(i,1)];if(d!==n.tv$.X&&s.reverse(),!s[0]||!r&&!s[1])continue;const a=[t,i];d!==n.tv$.X&&a.reverse();let o=!0;for(let e=0;e<a.length;e++){const t=Math.abs(a[e]-u[e]);if(t>p[e]){o=!1;break}t<p[e]&&(p[e]=t,p.fill(1/0,e+1,p.length))}o&&(g=e)}if(g){let t=Math.max(p[0]**2+p[1]**2-(g.point?.size??0),0);for(const i of this.moduleMap.modules()){const n=i.pickNodeMainAxisFirst(e,d);if(null!=n&&n.distanceSquared<t){g=n.unsafeDatum,t=n.distanceSquared;break}}return{datum:g,distance:Math.sqrt(t),target:this.contentGroup}}}isPathOrSelectionDirty(){return!1}shouldFlipXY(){return!1}visibleRangeIndices(e,t,i,n){let s;if(null==n){const{processedData:t,dataModel:i}=this;s=i.getColumnSortOrder(this,e,t)??1}else s=n.sortOrder;const a=this.keysOrValues(e),[o,r]=bl(s,i?.length??a.length,t,(e=>{const t=i?.[e]??e;return this.xCoordinateRange(a[t],0,t)}));return o<r?[o,r]:[r,o]}domainForVisibleRange(e,t,i,s,a){const{processedData:o,dataModel:r}=this,[l,h]=s,c=this.keysOrValues(i),d=this.sortOrder(i);if(null!=d){const e=this.visibleRangeIndices(i,s,a,{sortOrder:d});return r.getDomainBetweenRange(this,t,e,o)}const u=t.map((e=>this.keysOrValues(e)));let p=1/0,g=-1/0;for(const[e,i]of c.entries()){const[s,a]=this.xCoordinateRange(i,0,e);if(!(a<l||s>h))for(let i=0;i<t.length;i++){const t=u[i][e];(0,n.kuK)(t)&&(p=(0,n.Wwf)(p,t),g=(0,n.cGV)(g,t))}}return p>g?[Number.NaN,Number.NaN]:[p,g]}domainForClippedRange(e,t,i){const{processedData:s,dataModel:a,axes:o}=this,r=function(e){let t,i;(e instanceof Jm||e instanceof ty)&&({min:t,max:i}=e.options);if(null==t&&null==i)return;return t??(t=-1/0),i??(i=1/0),[t,i]}(o[e===n.tv$.X?n.tv$.Y:n.tv$.X]);if(!r)return t.flatMap((e=>a.getDomain(this,e,"value",s).domain));const l=this.keysOrValues(i),h=this.sortOrder(i);if(null!=h){const e=function(e,t,i,s){const a=i[0].valueOf(),o=i[1].valueOf();let r=(0,n.S3I)(0,t-1,(i=>{const n=1===e?i:t-i,o=s(n)?.valueOf();return!Number.isFinite(o)||o>=a})),l=(0,n.I5B)(0,t-1,(i=>{const n=1===e?i:t-i,a=s(n)?.valueOf();return!Number.isFinite(a)||a<=o}));if(null==r||null==l)return[0,0];-1===e&&([r,l]=[t-l,t-r]);return r=Math.max(r,0),l=Math.min(l+1,t),[r,l]}(h,l.length,r,(e=>l[e]));return a.getDomainBetweenRange(this,t,e,s)}const c=t.map((e=>this.keysOrValues(e))),d=r[0].valueOf(),u=r[1].valueOf();let p=1/0,g=-1/0;for(const[e,i]of l.entries()){const s=i.valueOf();if(!(s<d||s>u))for(let i=0;i<t.length;i++){const t=c[i][e];(0,n.kuK)(t)&&(p=(0,n.Wwf)(p,t),g=(0,n.cGV)(g,t))}}return p>g?[Number.NaN,Number.NaN]:[p,g]}zoomFittingVisibleItems(e,t,i,s,a){const{dataModel:o,processedData:r}=this;if(!o||!r)return;const l=this.axes[n.tv$.X];if(null!=s)return;const h=this.sortOrder(e);if(null==h)return;const c=this.keysOrValues(e);if(a>c.length)return{x:[0,1],y:void 0};const d=l.scale,u=d.range;d.range=[0,1];let[p,g]=this.visibleRangeIndices(e,i,void 0,{sortOrder:h});g-=1;let m;if(this.xCoordinateRange(c[p],0,p)[0]<i[0]&&(p+=1),this.xCoordinateRange(c[g],0,g)[1]>i[1]&&(g-=1),Math.abs(g-p)>=a-1)m=i;else{const e=(i[0]+i[1])/2;for(;Math.abs(g-p)<a-1&&(p>0||g<c.length-1);)if(0===p)g+=1;else if(g===c.length-1)p-=1;else{const t=this.xCoordinateRange(c[p-1],0,p-1)[0],i=this.xCoordinateRange(c[g+1],0,g+1)[1];Math.abs(t-e)<Math.abs(i-e)?p-=1:g+=1}const t=this.xCoordinateRange(c[p],0,p)[0],n=this.xCoordinateRange(c[g],0,g)[1];m=[Math.min(i[0],t),Math.max(i[1],n)]}return d.range=u,{x:m,y:void 0}}countVisibleItems(e,t,i,s,a){const{dataModel:o,processedData:r}=this;if(!o||!r)return 1/0;const l=this.keysOrValues(e),h=t.map((e=>o.resolveColumnById(this,e,r,"object"))),c=this.shouldFlipXY(),d=c?this.axes[n.tv$.Y]:this.axes[n.tv$.X],u=c?this.axes[n.tv$.X]:this.axes[n.tv$.Y],p=c?s??[0,1]:i,g=c?i:s??[0,1];if(null==s){const t=this.sortOrder(e);if(null!=t){const i=d.scale,n=i.range;i.range=[0,1];const s=this.keysOrValues(e);let[a,o]=this.visibleRangeIndices(e,p,void 0,{sortOrder:t});if(o-=1,o<a)return 0;const r=0;this.xCoordinateRange(s[a],r,a)[0]<p[0]&&(a+=1),this.xCoordinateRange(s[o],r,o)[1]>p[1]&&(o-=1);const l=Math.abs(o-a)+1;return i.range=n,l}}const m=(e,t,i)=>e[0]+(i-t[0])/(t[1]-t[0])*(e[1]-e[0]),y=d.range.toSorted(),f=u.range.toSorted(),x=m(y,d.visibleRange,p[0]),b=m(y,d.visibleRange,p[1]),v=m(f,u.visibleRange,Math.min(...g)),S=m(f,u.visibleRange,Math.max(...g)),M=Math.round((p[0]+(p[1]-p[0])/2)*l.length);return function(e,t,i,n,s){let a=-1,o=0,r=0,l=!1;for(;o<n&&a<=t-e;){a+=1;const n=i+r;l||(r*=-1),r>=0&&(r+=1),l&&r<0&&(r-=1),n<e||n>t?l=!0:s(n)&&(o+=1)}return o}(0,l.length-1,M,a,(e=>{const[t,i]=this.xCoordinateRange(l[e],0,e),[s,a]=this.yCoordinateRange(h.map((t=>t[e])),0,e);return!!((0,n.BfI)(t)&&(0,n.BfI)(i)&&(0,n.BfI)(s)&&(0,n.BfI)(a))&&(t>=x&&i<=b&&s>=v&&a<=S)}))}minTimeInterval(){let e;try{e=this.keysOrValues("xValue")}catch{}if(null==e||e.length>1e3)return;let t,i=1/0,n=e[0];for(let s=1;s<e.length;s++){const a=e[s];if(null!=a&&null!=n){const e=Number(a.valueOf())-Number(n.valueOf()),s=Math.sign(e);if(0===s)continue;if(void 0!==t&&s!==t)return;i=Math.min(i,Math.abs(e)),t=s}n=a}return Number.isFinite(i)?i:void 0}updateHighlightSelectionItem(e){const{items:t,highlightSelection:i}=e,n=t??[];return this.updateDatumSelection({nodeData:n,datumSelection:i})}updateDatumSelection(e){return e.datumSelection}updateDatumNodes(e){}updateDatumStyles(e){}updatePaths(e){for(const t of e.paths)t.visible=!1}updatePathNodes(e){const{paths:t,visible:i}=e;for(const e of t)e.visible=i}resetPathAnimation(e){const{path:t}=this.opts?.animationResetFns??{};if(t)for(const i of e.paths)Wh([i],t)}resetDatumAnimation(e){const{datum:t}=this.opts?.animationResetFns??{};t&&Wh([e.datumSelection],t)}
1resetLabelAnimation(e){const{label:t}=this.opts?.animationResetFns??{};t&&Wh([e.labelSelection],t)}resetAllAnimation(e){this.ctx.animationManager.stopByAnimationGroupId(this.id),this.resetPathAnimation(e),this.resetDatumAnimation(e),this.resetLabelAnimation(e),!1===e.contextData?.animationValid&&this.ctx.animationManager.skipCurrentBatch()}animateEmptyUpdateReady(e){this.ctx.animationManager.skipCurrentBatch(),this.resetAllAnimation(e)}animateWaitingUpdateReady(e){this.ctx.animationManager.skipCurrentBatch(),this.resetAllAnimation(e)}animateReadyHighlight(e){const{datum:t}=this.opts?.animationResetFns??{};t&&Wh([e],t)}animateReadyResize(e){this.resetAllAnimation(e)}animateClearingUpdateEmpty(e){this.ctx.animationManager.skipCurrentBatch(),this.resetAllAnimation(e)}getAnimationData(e,t){const{_contextNodeData:i}=this;if(!i)return;return{datumSelection:this.datumSelection,labelSelection:this.labelSelection,annotationSelections:[...this.annotationSelections],contextData:i,previousContextData:t,paths:this.paths,seriesRect:e}}updateLabelSelection(e){return e.labelSelection}resolveUsesPlacedLabels(){return this.usesPlacedLabels}updateHighlightLabelSelection(){const e=this.ctx.highlightManager?.getActiveHighlight(),t=this.isSeriesHighlighted(e)&&e?.datum?e:void 0,i=null==t?[]:this.getHighlightLabelData([],t)??[];this.highlightLabelSelection=this.updateLabelSelection({labelData:i,labelSelection:this.highlightLabelSelection})??this.highlightLabelSelection,this.highlightLabelGroup.visible=i.length>0,this.highlightLabelGroup.batchedUpdate((()=>{this.updateLabelNodes({labelSelection:this.highlightLabelSelection,isHighlight:!0})}))}refreshPlacedLabelNodes(){this.labelGroup.batchedUpdate((()=>{this.updateLabelNodes({labelSelection:this.labelSelection,isHighlight:!1})})),this.highlightLabelGroup.batchedUpdate((()=>{this.updateLabelNodes({labelSelection:this.highlightLabelSelection,isHighlight:!0})}))}getScaling(e){if(e instanceof _m){const{range:t,domain:i}=e;return{type:"log",convert:t=>e.convert(t),domain:[i[0],i[1]],range:[t[0],t[1]]}}if(e instanceof Rl){const{range:t,domain:i}=e;return{type:"continuous",domain:[i[0],i[1]],range:[t[0],t[1]]}}if(e instanceof Vl){if(e instanceof Ac){const t=e.getLinearParams(),i=e.getBandCountForUpdate();if(null!=t&&i>0)return{type:"category",variant:"unit-time",firstBandTime:t.firstBandTime,lastBandTime:t.firstBandTime+(i-1)*t.intervalMs,bandCount:i,intervalMs:t.intervalMs,inset:e.inset,step:e.step}}return{type:"category",domain:e.domain,inset:e.inset,step:e.step}}}calculateScaling(){const e={};for(const t of Object.values(n.tv$)){const i=this.axes[t];if(!i)continue;const n=this.getScaling(i.scale);null!=n&&(e[t]=n)}return e}};function cy(e){const t=new Map;for(const i of e){if(!(i instanceof hy))continue;const e=(i.seriesGrouping?.stackCount??0)>0?i.seriesGrouping?.groupIndex:void 0;if(null==e){i.seriesBelowStackContext=void 0,i.createStackContext();continue}const n=`${i.type}-${e}`;let s=t.get(n);null==s&&(s=[],t.set(n,s)),s.push(i)}for(const e of t.values()){let t;e.sort(((e,t)=>(e.seriesGrouping?.stackIndex??0)-(t.seriesGrouping?.stackIndex??0)));for(const i of e)i.seriesBelowStackContext=t,t=i.createStackContext()}}var dy=(()=>{var e=class extends ce{constructor(e={}){super(e),this.x1=0,this.y1=0,this.x2=0,this.y2=0,this.startLine=!1,this.endLine=!1,this.horizontal=!1,this.strokeWidth=1}serialize(){return{type:"range",props:this.serializeProps()}}serializeProps(){return{...super.serializeProps(),x1:this.x1,y1:this.y1,x2:this.x2,y2:this.y2}}computeBBox(){return new m(this.x1,this.y1,this.x2-this.x1,this.y2-this.y1)}isPointInPath(e,t){return!1}render(e){const{ctx:t}=e;let{x1:i,y1:n,x2:s,y2:a}=this;i=this.align(i),n=this.align(n),s=this.align(s),a=this.align(a);const{fill:o,horizontal:r}=this,{globalAlpha:l}=t;null!=o&&(this.applyFillAndAlpha(t,e.logger),t.beginPath(),t.moveTo(i,n),t.lineTo(s,n),t.lineTo(s,a),t.lineTo(i,a),t.closePath(),t.fill(),t.globalAlpha=l);const{stroke:h,strokeWidth:c,startLine:d,endLine:u}=this;if(!(!d&&!u||!h||!c)){const{lineDash:e,lineDashOffset:o,lineCap:h,lineJoin:p}=this;this.applyStrokeAndAlpha(t),t.lineWidth=c,e&&t.setLineDash([...e]),o&&(t.lineDashOffset=o),h&&(t.lineCap=h),p&&(t.lineJoin=p),t.beginPath(),d&&(t.moveTo(i,n),r?t.lineTo(i,a):t.lineTo(s,n)),u&&(t.moveTo(s,a),r?t.lineTo(s,n):t.lineTo(i,a)),t.stroke(),t.globalAlpha=l}this.fillShadow?.markClean(),super.render(e)}};return e.className="Range",d([(0,n.k8u)()],e.prototype,"x1",2),d([(0,n.k8u)()],e.prototype,"y1",2),d([(0,n.k8u)()],e.prototype,"x2",2),d([(0,n.k8u)()],e.prototype,"y2",2),d([(0,n.k8u)()],e.prototype,"startLine",2),d([(0,n.k8u)()],e.prototype,"endLine",2),d([(0,n.k8u)()],e.prototype,"horizontal",2),e})(),uy={top:{rangeH:0,rangeV:-1,labelH:0,labelV:1},"inside-top":{rangeH:0,rangeV:-1,labelH:0,labelV:1},"top-left":{rangeH:-1,rangeV:-1,labelH:-1,labelV:1},"inside-top-left":{rangeH:-1,rangeV:-1,labelH:-1,labelV:1}
vendor: 1,791 bytes, line 1
1,left:{rangeH:-1,rangeV:0,labelH:1,labelV:0},"inside-left":{rangeH:-1,rangeV:0,labelH:-1,labelV:0},"bottom-left":{rangeH:-1,rangeV:1,labelH:-1,labelV:-1},"inside-bottom-left":{rangeH:-1,rangeV:1,labelH:-1,labelV:-1},bottom:{rangeH:0,rangeV:1,labelH:0,labelV:-1},"inside-bottom":{rangeH:0,rangeV:1,labelH:0,labelV:-1},"bottom-right":{rangeH:1,rangeV:1,labelH:1,labelV:-1},"inside-bottom-right":{rangeH:1,rangeV:1,labelH:1,labelV:-1},right:{rangeH:1,rangeV:0,labelH:-1,labelV:0},"inside-right":{rangeH:1,rangeV:0,labelH:1,labelV:0},"top-right":{rangeH:1,rangeV:-1,labelH:1,labelV:1},"inside-top-right":{rangeH:1,rangeV:-1,labelH:1,labelV:1},inside:{rangeH:0,rangeV:0,labelH:0,labelV:0}},py={top:{rangeH:0,rangeV:-1,labelH:0,labelV:1},"inside-top":{rangeH:0,rangeV:-1,labelH:0,labelV:-1},"top-left":{rangeH:-1,rangeV:-1,labelH:1,labelV:-1},"inside-top-left":{rangeH:-1,rangeV:-1,labelH:1,labelV:-1},left:{rangeH:-1,rangeV:0,labelH:1,labelV:0},"inside-left":{rangeH:-1,rangeV:0,labelH:1,labelV:0},"bottom-left":{rangeH:-1,rangeV:1,labelH:1,labelV:1},"inside-bottom-left":{rangeH:-1,rangeV:1,labelH:1,labelV:1},bottom:{rangeH:0,rangeV:1,labelH:0,labelV:-1},"inside-bottom":{rangeH:0,rangeV:1,labelH:0,labelV:1},"bottom-right":{rangeH:1,rangeV:1,labelH:-1,labelV:1},"inside-bottom-right":{rangeH:1,rangeV:1,labelH:-1,labelV:1},right:{rangeH:1,rangeV:0,labelH:-1,labelV:0},"inside-right":{rangeH:1,rangeV:0,labelH:-1,labelV:0},"top-right":{rangeH:1,rangeV:-1,labelH:-1,labelV:-1},"inside-top-right":{rangeH:-1,rangeV:-1,labelH:-1,labelV:-1},inside:{rangeH:0,rangeV:0,labelH:0,labelV:0}},gy={top:{rangeH:0,rangeV:-1,labelH:0,labelV:1},"inside-top":{rangeH:0,rangeV:-1,labelH:0,labelV:-1},"top-left":{rangeH:-1,rangeV:-1,labelH:-1,labelV:1},"inside-top-left":{rangeH:-1,rangeV:-1,labelH:-1,labelV:-1}
1,left:{rangeH:-1,rangeV:0,labelH:1,labelV:0},"inside-left":{rangeH:-1,rangeV:0,labelH:-1,labelV:0},"bottom-left":{rangeH:-1,rangeV:1,labelH:-1,labelV:-1},"inside-bottom-left":{rangeH:-1,rangeV:1,labelH:-1,labelV:1},bottom:{rangeH:0,rangeV:1,labelH:0,labelV:-1},"inside-bottom":{rangeH:0,rangeV:1,labelH:0,labelV:1},"bottom-right":{rangeH:1,rangeV:1,labelH:1,labelV:-1},"inside-bottom-right":{rangeH:1,rangeV:1,labelH:1,labelV:1},right:{rangeH:1,rangeV:0,labelH:-1,labelV:0},"inside-right":{rangeH:1,rangeV:0,labelH:1,labelV:0},"top-right":{rangeH:1,rangeV:-1,labelH:1,labelV:1},"inside-top-right":{rangeH:1,rangeV:-1,labelH:1,labelV:-1},inside:{rangeH:0,rangeV:0,labelH:0,labelV:0}},my={top:{rangeH:0,rangeV:-1,labelH:0,labelV:1},"inside-top":{rangeH:0,rangeV:-1,labelH:0,labelV:-1},"top-left":{rangeH:-1,rangeV:-1,labelH:1,labelV:-1},"inside-top-left":{rangeH:-1,rangeV:-1,labelH:-1,labelV:-1},left:{rangeH:-1,rangeV:0,labelH:1,labelV:0},"inside-left":{rangeH:-1,rangeV:0,labelH:-1,labelV:0},"bottom-left":{rangeH:-1,rangeV:1,labelH:1,labelV:1},"inside-bottom-left":{rangeH:-1,rangeV:1,labelH:-1,labelV:1},bottom:{rangeH:0,rangeV:1,labelH:0,labelV:-1},"inside-bottom":{rangeH:0,rangeV:1,labelH:0,labelV:1},"bottom-right":{rangeH:1,rangeV:1,labelH:-1,labelV:1},"inside-bottom-right":{rangeH:1,rangeV:1,labelH:1,labelV:1},right:{rangeH:1,rangeV:0,labelH:-1,labelV:0},"inside-right":{rangeH:1,rangeV:0,labelH:1,labelV:0},"top-right":{rangeH:1,rangeV:-1,labelH:-1,labelV:-1},"inside-top-right":{rangeH:1,rangeV:-1,labelH:1,labelV:-1},inside:{rangeH:0,rangeV:0,labelH:0,labelV:0}};var yy=1e-6;function fy(e,t,i,n,s){return 1===t?e-i-n:-1===t?s-(e+i):2*Math.min(e-n,s-e)}var xy=(()=>{var e=class extends ft{constructor(){super(...arguments),this.padding=5,this.reserveSpace=!1}};return d([n.mAP],e.prototype,"enabled",2),d([n.mAP],e.prototype,"padding",2),d([n.mAP],e.prototype,"text",2),d([n.mAP],e.prototype,"position",2),d([n.mAP],e.prototype,"overflow",2),d([n.mAP],e.prototype,"reserveSpace",2),d([n.mAP],e.prototype,"rotation",2),d([n.mAP],e.prototype,"parallel",2),e})(),by=(()=>{var e=class extends n.XPE{constructor(){super(),this.internalId=(0,n.sX_)(this),this.defaultColorRange=[],this.fill="#c16068",this.label=new xy,this.scale=void 0,this.clippedRange=[-1/0,1/0],this.gridLength=0,this.gridPadding=0,this.containerBox=void 0,this.position="top",this.rangeGroup=new ke({name:this.internalId}),this.lineGroup=new ke({name:this.internalId}),this.labelGroup=new ke({name:this.internalId}),this.crossLineRange=this.lineGroup.appendChild(new dy),this.crossLineLabel=this.labelGroup.appendChild(new Ze),this.data=void 0,this.startLine=!1,this.endLine=!1,this._isRange=void 0,this.crossLineRange.pointerEvents=1}get defaultLabelPosition(){return"top"}containsPoint(e){const t="range"===this.type?this.rangeGroup:this.lineGroup;if(!this.enabled||null==this.data||!t.visible)return!1;if(Me.toCanvas(this.crossLineRange).clone().grow(5).containsPoint(e.canvasX,e.canvasY))return!0;const{label:i}=this;return!(!this.labelGroup.visible||!1===i.enabled||!i.text)&&Me.toCanvas(this.crossLineLabel).containsPoint(e.canvasX,e.canvasY)}update(e){const{enabled:t,type:i,data:n,scale:s}=this;if(!(s&&t&&e&&Fd(this,s)&&null!=n))return this.rangeGroup.visible=!1,this.lineGroup.visible=!1,void(this.labelGroup.visible=!1);this.rangeGroup.visible=e,this.lineGroup.visible=e,this.labelGroup.visible=e,this.updateNodes();const a="range"===i;a!==this._isRange&&(a?this.rangeGroup.appendChild(this.crossLineRange):this.lineGroup.appendChild(this.crossLineRange)),this._isRange=a}calculateLayout(e){if(this.data=void 0,!e)return;const{type:t,range:i,value:s,scale:a,clippedRange:o,strokeWidth:r=0}=this;if(!a)return;const{bandwidth:l,rangePadding:h}=zd(a);let c,d,u,p,[g,m]=(0,n.uYy)(o);if(g-=l,m+=l,"line"===t){const e=l/2;if(c=a.convert(s)+e,d=Number.NaN,u=a.convert(s,{clamp:!0})+e,p=Number.NaN,c>m||c<g)return}else{if(!i)return;{const[e,t]=i,[n,s]=ql(e,t);if(c=a.convert(e,{alignment:n}),d=a.convert(t,{alignment:s}),u=a.convert(e,{clamp:!0,alignment:n}),p=a.convert(t,{clamp:!0,alignment:s}),u>p&&([u,p]=[p,u],[c,d]=[d,c]),u>=m||p<=g)return;Number.isFinite(c)&&(u-=h),Number.isFinite(d)&&(d+=l,p+=l+h)}}u=(0,n.jVD)(u,o),p=(0,n.jVD)(p,o),c-h>=u&&(c-=h),d+h<=p&&(d+=h),this.startLine=r>0&&c>=u&&c<=u+h,this.endLine=r>0&&d>=p-l-h&&d<=p,this.data=[u,p],!1!==this.label.enabled&&this.label.text}get reservesLabelSpace(){return this.label.reserveSpace}getLabelBox(){const{crossLineLabel:e,label:t}=this;if(!1!==t.enabled&&t.text&&this.labelGroup.visible)return Me.toCanvas(e)}updateNodes(){const{position:e,data:[t,i]=[0,0],gridLength:n,gridPadding:s}=this,a=Number.isFinite(i)?i-t:0,o="bottom"===e||"right"===e?-1:1,r=Math.min(o*s,o*(n+s));let l;switch(e){case"top":case"bottom":l=new m(t,r,a,n);break;case"left":case"right":l=new m(r,t,n,a)}this.updateRangeNode(l);const{label:h}=this;!1!==h.enabled&&h.text&&(this.updateLabel(),"clip-text"===h.overflow&&this.clipLabelText(l),this.positionLabel(l))}updateRangeNode(e){const{type:t,position:i,crossLineRange:n,startLine:s,endLine:a,fill:o,fillOpacity:r,stroke:l,strokeWidth:h,strokeOpacity:c,lineDash:d}=this;n.x1=e.x,n.x2=e.x+e.width,n.y1=e.y,n.y2=e.y+e.height,n.horizontal="top"===i||"bottom"===i,n.startLine=s,n.endLine=a,n.fill="range"===t?o:void 0,n.fillOpacity=r??1,n.stroke=l,n.strokeWidth=h??1,n.strokeOpacity=c??1,n.lineDash=d}updateLabel(){const{crossLineLabel:e,label:t}=this;t.text&&(e.fill=t.color,e.text=t.text,e.rotation=(0,n.ehJ)(t.rotation??0),e.textAlign="center",e.textBaseline="middle",e.setFont(t),e.setBoxing(t))}
1get anchor(){const e="left"===this.position||"right"===this.position,t="range"===this.type,{position:i=this.defaultLabelPosition,overflow:n}=this.label;let s;s=t?e?gy:my:e?uy:py;const a=s[i];return"realign-text"!==n?a:function(e,t){if(t){if(-1===e.rangeH&&1===e.labelH)return{...e,labelH:-1};if(1===e.rangeH&&-1===e.labelH)return{...e,labelH:1}}else{if(-1===e.rangeV&&1===e.labelV)return{...e,labelV:-1};if(1===e.rangeV&&-1===e.labelV)return{...e,labelV:1}}return e}(a,e)}labelAnchorOffsets(){const{crossLineLabel:e,label:{padding:t}}=this,i="number"==typeof t;return{pad:i&&!e.hasBoxing()?t:0,xPaddingDiff:i?0:(t.right??0)-(t.left??0),yPaddingDiff:i?0:(t.bottom??0)-(t.top??0)}}clipLabelText(e){const{crossLineLabel:t,containerBox:i,label:s,anchor:a}=this,{text:o}=s;if(null==i||!o)return;const r=t.getBBox();if(!r)return;const{x:l,y:h,width:c,height:d}=i,u=Me.fromCanvas(this.labelGroup,new m(l,h,c,d)),{pad:p,xPaddingDiff:g,yPaddingDiff:y}=this.labelAnchorOffsets(),f=e.x+e.width*(a.rangeH+1)/2-g/2,x=e.y+e.height*(a.rangeV+1)/2-y/2,b=fy(f,a.labelH,p,u.x,u.x+u.width),v=fy(x,a.labelV,p,u.y,u.y+u.height),S=(0,n.K$y)(s).measureLines(o).width,M=Math.abs(Math.cos(t.rotation)),k=Math.abs(Math.sin(t.rotation));let D=1/0;if(M>yy&&(D=Math.min(D,(b-(r.width-S*M))/M)),k>yy&&(D=Math.min(D,(v-(r.height-S*k))/k)),D>=S)return;const w={maxWidth:Math.max(D,0),wrapping:"never",overflowStrategy:"ellipsis"},I=(0,n.HRu)(o,w,s);"string"==typeof I&&(t.text=I)}positionLabel(e){const{crossLineLabel:t,anchor:i}=this,n=t.getBBox();if(!n)return;const{width:s,height:a}=n,{pad:o,xPaddingDiff:r,yPaddingDiff:l}=this.labelAnchorOffsets(),h=s/2+o,c=a/2+o,d=e.x+e.width*(i.rangeH+1)/2-h*i.labelH-r/2,u=e.y+e.height*(i.rangeV+1)/2-c*i.labelV-l/2;t.x=d,t.y=u,t.rotationCenterX=d,t.rotationCenterY=u}computeLabelSize(){const{label:e}=this;if(!1===e.enabled||!e.text)return;const t=new Ze;t.fontFamily=e.fontFamily,t.fontSize=e.fontSize,t.fontStyle=e.fontStyle,t.fontWeight=e.fontWeight,t.text=e.text,t.rotation=(0,n.ehJ)(e.rotation??0),t.textBaseline="middle",t.textAlign="center";const i=t.getBBox();if(!i)return;const{width:s,height:a}=i;return{width:s,height:a}}calculatePadding(e){const{label:{padding:t,overflow:i},anchor:n}=this;if("pad-chart"!==(i??"pad-chart"))return;const s=this.computeLabelSize();if(!s)return;const{width:a,height:o}=s,r=("number"==typeof t?2*t:(t.left??0)+(t.right??0))+a,l=("number"==typeof t?2*t:(t.top??0)+(t.bottom??0))+o,h="left"===this.position||"right"===this.position;h&&(-1===n.rangeH&&1===n.labelH?e.left=Math.max(e.left??0,r):1===n.rangeH&&-1===n.labelH&&(e.right=Math.max(e.right??0,r))),h||(-1===n.rangeV&&1===n.labelV?e.top=Math.max(e.top??0,l):1===n.rangeV&&-1===n.labelV&&(e.bottom=Math.max(e.bottom??0,l)))}};return e.className="CrossLine",d([n.mAP],e.prototype,"id",2),d([n.mAP],e.prototype,"enabled",2),d([n.mAP],e.prototype,"type",2),d([n.mAP],e.prototype,"range",2),d([n.mAP],e.prototype,"value",2),d([n.mAP],e.prototype,"defaultColorRange",2),d([n.mAP],e.prototype,"fill",2),d([n.mAP],e.prototype,"fillOpacity",2),d([n.mAP],e.prototype,"stroke",2),d([n.mAP],e.prototype,"strokeWidth",2),d([n.mAP],e.prototype,"strokeOpacity",2),d([n.mAP],e.prototype,"lineDash",2),d([n.mAP],e.prototype,"label",2),d([n.mAP],e.prototype,"listeners",2),e})();function vy({startAngle:e,endAngle:t,innerRadius:i,outerRadius:s}){let a=1/0,o=1/0,r=-1/0,l=-1/0;const h=(e,t)=>{a=Math.min(e,a),o=Math.min(t,o),r=Math.max(e,r),l=Math.max(t,l)};return h(i*Math.cos(e),i*Math.sin(e)),h(i*Math.cos(t),i*Math.sin(t)),h(s*Math.cos(e),s*Math.sin(e)),h(s*Math.cos(t),s*Math.sin(t)),(0,n.tF8)(0,e,t)&&h(s,0),(0,n.tF8)(.5*Math.PI,e,t)&&h(0,s),(0,n.tF8)(Math.PI,e,t)&&h(-s,0),(0,n.tF8)(1.5*Math.PI,e,t)&&h(0,-s),new m(a,o,r-a,l-o)}function Sy(e,t){const i=e.x+e.width,s=e.y+e.height;if(!(ky(e.x,e.y,t)&&ky(i,e.y,t)&&ky(i,s,t)&&ky(e.x,s,t)))return!1;if(Math.min(Math.max(0,e.x),i)**2+Math.min(Math.max(0,e.y),s)**2<Math.min(t.innerRadius,t.outerRadius)**2)return!1;if((0,n.s57)(t.startAngle,t.endAngle)<=Math.PI)return!0;const a=Math.max(t.innerRadius,t.outerRadius);return!My(e,t.startAngle,a)&&!My(e,t.endAngle,a)}function My(e,t,i){const n=e.x+e.width,s=e.y+e.height,a=i*Math.cos(t),o=i*Math.sin(t);return 1===te(0,0,a,o,e.x,e.y,n,e.y)||1===te(0,0,a,o,n,e.y,n,s)||1===te(0,0,a,o,n,s,e.x,s)||1===te(0,0,a,o,e.x,s,e.x,e.y)}function ky(e,t,i){const s=Math.sqrt(Math.pow(e,2)+Math.pow(t,2)),{innerRadius:a,outerRadius:o}=i;if(i.startAngle===i.endAngle||s<Math.min(a,o)||s>Math.max(a,o))return!1;const r=(0,n.KVy)(i.startAngle),l=(0,n.KVy)(i.endAngle),h=Math.atan2(t,e);return r<l?h<=l&&h>=r:h<=l&&h>=-Math.PI||h>=r&&h<=Math.PI}function Dy(e,t,i,s,a,o,r,l,h,c){if(Number.isNaN(e)||Number.isNaN(t))return 0;o&&([a,s]=[s,a]);const d=[];if(r===h){const n=Math.pow(i,2)-Math.pow(r-e,2);if(n<0)return 0;const s=Math.sqrt(n);d.push({x:r,y:t+s},{x:r,y:t-s})}else{const n=(c-l)/(h-r),s=l-n*r,a=Math.pow(n,2)+1,o=2*(n*(s-t)-e),u=Math.pow(e,2)+Math.pow(s-t,2)-Math.pow(i,2),p=Math.pow(o,2)-4*a*u;if(p<0)return 0;const g=(-o+Math.sqrt(p))/2/a,m=(-o-Math.sqrt(p))/2/a;d.push({x:g,y:n*g+s},{x:m,y:n*m+s})}let u=0;for(const{x:i,y:o}of d){if(!(i>=Math.min(r,h)&&i<=Math.max(r,h)&&o>=Math.min(l,c)&&o<=Math.max(l,c)))continue;const d=Math.atan2(o-t,i-e);(0,n.tF8)(d,s,a)&&u++}return u}function wy(e,t){const{startAngle:i,endAngle:n,innerRadius:s,outerRadius:a}=t,o=e.y,r=e.y+e.height,l=e.x,h=e.x+e.width,c=Math.sin(i),d=Math.cos(i),u=Math.sin(n),p=Math.cos(n),g=s*d,m=s*c,y=a*d,f=a*c,x=s*p,b=s*u,v=a*p,S=a*u,M=(e,t)=>e>=l&&e<=h&&t>=o&&t<=r;return!!(M(g,m)||M(y,f)||M(x,b)||M(v,S))||(!!(ky(l,o,t)||ky(h,o,t)||ky(l,r,t)||ky(h,r,t))||(!!(te(l,o,h,o,g,m,y,f)||te(l,o,h,o,x,b,v,S)||te(l,r,h,r,g,m,y,f)||te(l,r,h,r,x,b,v,S)||te(l,o,l,r,g,m,y,f)||te(l,o,l,r,x,b,v,S)||te(h,o,h,r,g,m,y,f)||te(h,o,h,r,x,b,v,S))||(!!(Dy(0,0,a,i,n,!1,l,o,h,o)||Dy(0,0,a,i,n,!1,l,r,h,r)||Dy(0,0,a,i,n,!1,l,o,l,r)||Dy(0,0,a,i,n,!1,h,o,h,r))||!!(s>0&&(Dy(0,0,s,i,n,!1,l,o,h,o)||Dy(0,0,s,i,n,!1,l,r,h,r)||Dy(0,0,s,i,n,!1,l,o,l,r)||Dy(0,0,s,i,n,!1,h,o,h,r))))))}function Iy(e,t,i,n){if(0===i&&0===n)return 0;if(Math.asin(Math.abs(1*i)/(e+1*i))+Math.asin(Math.abs(1*n)/(e+1*n))-t<0)return 1;let s=0,a=1;for(let o=0;o<8;o+=1){const o=(s+a)/2;Math.asin(Math.abs(o*i)/(e+o*i))+Math.asin(Math.abs(o*n)/(e+o*n))-t<0?s=o:a=o}return s}var Ay=1e-6;function Cy(e,t){return(0,n.s57)(e,t)<Ay?t:(0,n.YcT)(e-t)+t}function Ny(e,t,i=0){const s=Math.abs(t-e)>=2*Math.PI-Ay?2*Math.PI:(0,n.YcT)(t-e);return{startAngle:e=Cy(e,i),endAngle:t=e+s}}function Ly(e,t,i,n,s,a){const o=Math.sin(a),r=Math.cos(a),l=e**2+t**2-i**2;let h,c,d,u;if(r>.5){const i=o/r,n=1+i**2,s=-2*(e+t*i),a=s**2-4*n*l;if(a<0)return;const p=(-s+Math.sqrt(a))/(2*n),g=(-s-Math.sqrt(a))/(2*n);h=p,c=p*i,d=g,u=g*i}else{const i=r/o,n=1+i**2,s=-2*(t+e*i),a=s**2-4*n*l;if(a<0)return;const p=(-s+Math.sqrt(a))/(2*n),g=(-s-Math.sqrt(a))/(2*n);h=p*i,c=p,d=g*i,u=g}const p=d*r+u*o,g=h*r+c*o>0?Cy(Math.atan2(c-t,h-e),n):Number.NaN,m=p>0?Cy(Math.atan2(u-t,d-e),n):Number.NaN;return g>=n&&g<=s?g:m>=n&&m<=s?m:void 0}function Py(e,t,i,n,s,a){const o=Math.hypot(e,t),r=o-(o**2-i**2+a**2)/(2*o),l=Math.atan2(t,e),h=Math.acos(-r/i),c=Cy(l+h,n),d=Cy(l-h,n);return c>=n&&c<=s?c:d>=n&&d<=s?d:void 0}var Ty={width:Math.SQRT1_2,height:Math.SQRT1_2,cx:0,cy:0},Oy=33,Ry=.1,Ey=new Map;function zy(e){if(null==e)return Ty;let t=Ey.get(e);return null==t&&(t=function(e){const t=Vy(e);if(null==t)return;const{bbox:i,inside:n,cellW:s,cellH:a}=t,o=Hy(n);if(null==o)return;const r=(o.c1-o.c0)*s,l=(o.r1-o.r0)*a;if(r<Ry||l<Ry)return;const h=i.x+((o.c0+o.c1)/2+.5)*s,c=i.y+((o.r0+o.r1)/2+.5)*a;return{width:r,height:l,cx:h,cy:c}}(e)??Ty,Ey.set(e,t)),t}var By=new Map;function Fy(e){if(null!=e)return By.has(e)||By.set(e,function(e){const t=Vy(e);if(null==t)return;const{bbox:i,inside:n,cellW:s,cellH:a}=t,o=Hy(n);if(null==o)return;const r=Math.round((o.c0+o.c1)/2),l=[];for(let e=0;e<Oy;e++){const t=t=>n[e*Oy+t];if(!t(r)){l.push(void 0);continue}let a=r,o=r;for(;a>0&&t(a-1);)a--;for(;o<32&&t(o+1);)o++;l.push([i.x+(a+.5)*s,i.x+(o+.5)*s])}return{rows:l,top:i.y,rowHeight:a}}(e)),By.get(e)}function Vy(e){const t=gd(e,1),i=t.computeBBox();if(i.width<=0||i.height<=0)return;const n=t.flatten(),s=i.width/Oy,a=i.height/Oy,o=new Array(1089);for(let e=0;e<Oy;e++){const t=i.y+(e+.5)*a;for(let a=0;a<Oy;a++){const r=i.x+(a+.5)*s;o[e*Oy+a]=$y(r,t,n)}}return{bbox:i,inside:o,cellW:s,cellH:a}}function $y(e,t,i){let n=!1;for(const s of i)for(let i=0,a=s.length-1;i<s.length;a=i++){const{x:o,y:r}=s[i],{x:l,y:h}=s[a];r>t!=h>t&&e<(l-o)*(t-r)/(h-r)+o&&(n=!n)}return n}function Hy(e){const t=new Array(Oy).fill(0),i=[];let n,s=0;for(let a=0;a<Oy;a++){for(let i=0;i<Oy;i++)t[i]=e[a*Oy+i]?t[i]+1:0;i.length=0;for(let e=0;e<=Oy;e++){const o=e<Oy?t[e]:0;for(;i.length>0&&t[i.at(-1)]>o;){const o=t[i.pop()],r=i.length>0?i.at(-1)+1:0,l=o*(e-r);l>s&&(s=l,n={r0:a-o+1,r1:a,c0:r,c1:e-1})}i.push(e)}}return n}function jy(e,t,i,s,a){return(0,n.IK$)(e,_y(t,s),a,i)}function Wy(e,t,i,s,a){return(0,n.YTK)(e,_y(t,s),a,i)}function _y(e,t){return null==e||null==t?e:{...e,maxWidth:Math.min(e.maxWidth??1/0,t.width),maxHeight:Math.min(e.maxHeight??1/0,t.height)}}function Gy(e,t,i=0){const n=zy(t);return{width:Math.max(0,e*n.width-2*i),height:Math.max(0,e*n.height-2*i)}}function Ky(e,t){let i=0,n=e;for(let e=0;e<24;e+=1){const e=(i+n)/2;t(e)?i=e:n=e}return i}function Yy(e,t,i,s){const a=(0,n.QI3)(e,t,i),o=a.width,r=s?.height??a.height,l=o/2,h=r/2;if(l<=0||h<=0||!ky(e.x,e.y,t))return{centerX:e.x,centerY:e.y,width:o,height:r};if(null!=s&&function(e,t,{width:i,height:n}){const s={x:e.x-i/2,y:e.y-n/2,width:i,height:n};return Sy(s,Uy(t))}(e,t,s))return{centerX:e.x,centerY:e.y,width:o,height:r,anchored:!0};if(r>1.5*i){const i=function(e,t,i,n){const s=Math.hypot(e.x,e.y);if(s<1e-6)return null;const{bands:a,maxWidth:o}=Xy(e,Uy(t),i);if(null!=n){const t=function(e,t,i){let n=null,s=1/0;for(const a of e){if(a.width<i)continue;const e=Math.hypot(a.centerX-t.x,a.centerY-t.y);e<s&&(n=a,s=e)}return n}(a,e,Math.min(n,o)-2);if(null!=t)return t}let r=null,l=-1/0;for(const e of a){if(e.width<o-2)continue;const t=Math.hypot(e.centerX,e.centerY);t>l&&(r=e,l=t)}return r}(e,t,r,s?.width);if(null!=i)return i}const c=(e,i)=>ky(e,i,t),d=2*Math.abs(t.outerRadius),u=(e,t,i,n,s,a)=>Ky(d,(o=>c(e+s*o,t+a*o)&&c(i+s*o,n+a*o))),p=u(e.x,e.y-h,e.x,e.y+h,1,0),g=u(e.x,e.y-h,e.x,e.y+h,-1,0),m=e.x+(p-g)/2,y=u(m-l,e.y,m+l,e.y,0,1),f=u(m-l,e.y,m+l,e.y,0,-1);return{centerX:m,centerY:e.y+(y-f)/2,width:o,height:r}}function Uy(e){return{startAngle:e.startAngle,endAngle:e.endAngle,innerRadius:e.innerRadius>0?e.innerRadius+.75:0,outerRadius:Math.abs(e.outerRadius)-.75}}function Xy(e,t,i){const n=Math.hypot(e.x,e.y),s=e.x/n,a=e.y/n,o=t.outerRadius,r=i/2,l=2*o,h=(e,i,n)=>e+n*Ky(l,(s=>ky(e+n*s,i,t))),c=t=>Math.abs(a)>.001?t*s/a:e.x,d=[];let u=0;for(let e=0;e<=48;e+=1){const n=2*o*e/48-o;let s=-1/0,a=1/0,l=!0;for(const e of[n-r,n+r]){const i=c(e);if(!ky(i,e,t)){l=!1;break}s=Math.max(s,h(i,e,-1)),a=Math.min(a,h(i,e,1))}if(!l||a<=s)continue;const p=a-s;d.push({centerX:(s+a)/2,centerY:n,width:p,height:i}),u=Math.max(u,p)}return{bands:d,maxWidth:u}}function Zy(e,t){if(null!=e&&null!=t)return"inside"===t?e.insideStyle:e.outsideStyle}function qy(e){return e.startsWith("inside")?"inside":"outside"}function Qy(e){return"inside"===e?"inside":"outside"}var Jy=e=>({style:Qy(e),reported:e});function ef(e,t,i,n,s,a,o){const r=rf(e,s,i,t,!1,void 0,n,Zy(t,a.style),{placement:a.reported,orientation:o});return{font:r,boxPadding:kt(r),hidden:!r.enabled}}function tf(e,t,i,n,s){if(null!=t.itemStyler)return function(a,o,r){const l=n(o,a);return ef(e,t,i,s,a,l,r)}}function nf(e,t,i,s,a){if(null==e||null==t)return;const{font:o,boxPadding:r,hidden:l}=e(t,i,s),h=(0,n.kzl)(a,o);
1return{size:{width:h.width+r.left+r.right,height:h.height+r.top+r.bottom},font:o,boxPadding:r,hidden:!0===l}}function sf(e){const t=Dt(e),i=e.collision.alwaysShow;return{box:t,alwaysShow:i,collideWith:e.collision.resolveCollideWith(),threshold:e.collision.threshold??0,measureBox:i=>{const{width:s,height:a}=(0,n.kzl)(i,e);return{width:s+t.left+t.right,height:a+t.top+t.bottom}},fitFor:(0,n.MPT)(e,t,!i)}}function af(e,t,i,s,a){const o=Dt(e);return(0,n.Amh)(t,i,s,(t=>{const i=a(t);return{label:i,config:(0,n.lad)(e,i?.fittedFontSize),box:o}}))}function of(e,t,i,n,s){if(null!=t.itemStyler)return function(a,o,r){const l={style:qy(o),reported:s?.(o)??o};return ef(e,t,i,n,a,l,r)}}function rf(e,t,i,s,a,o,r=["series",`${e.declarationOrder}`,"label"],l,h){const c=Mt(s,l);if(e.visible&&s.itemStyler){const l=e.getHighlightStateString(o,a||null!=t&&o?.series===t.series&&o?.datumIndex===t.datumIndex,t?.datumIndex),d=t?Md(t,e.data?.dataIdKey):void 0,u={border:c.border,color:c.color,cornerRadius:c.cornerRadius,datum:t?.datum,enabled:s.enabled,fill:c.fill,fillOpacity:c.fillOpacity,fontFamily:c.fontFamily,fontSize:c.fontSize,fontStyle:c.fontStyle,fontWeight:c.fontWeight,itemId:d,itemType:t?.itemType,seriesId:e.id,padding:c.padding,...void 0!==h?.placement&&{placement:h.placement},...void 0!==h?.orientation&&{orientation:h.orientation},highlightState:l,selectionState:e.getSelectionStateString(t?.datumIndex),candidateState:e.getCandidateStateString(t?.datumIndex)},p=e.ctx.optionsGraphService.resolvePartial(r,e.cachedCallWithContext(s.itemStyler,{...i,...u}),{pick:!1})??{};return(0,n.HFk)(p,u)}return c}function lf(e,t,i,n,s,a,o,r,l){const{isHighlight:h,activeHighlight:c}=a;if(e.visible&&n.enabled&&s){const a=rf(e,t.datum,i,n,h,c,o,r,l);if(!a.enabled)return void(t.visible=!1);if(t.visible=!0,t.x=s.x+(s.offsetX??0),t.y=s.y+(s.offsetY??0),t.text=s.fittedText??s.text,t.fill=a.color,t.setAlign(s),t.setFont(a),null!=s.fittedFontSize&&(t.fontSize=s.fittedFontSize),t.setBoxing(a),"rotation"in(d=t)&&"rotationCenterX"in d&&"rotationCenterY"in d){const e=s.rotation??0;if(0!==e){const e=t.getTextMeasureBBox();t.rotationCenterX=e.x+e.width/2,t.rotationCenterY=e.y+e.height/2}t.rotation=e}}else t.visible=!1;var d}var hf={"inside-start":{inside:!0,direction:-1,textAlignment:1},"inside-end":{inside:!0,direction:1,textAlignment:-1},"outside-start":{inside:!1,direction:-1,textAlignment:-1},"outside-end":{inside:!1,direction:1,textAlignment:1}};function cf(e){return e.startsWith("beside-")}function df(e){const t=cf(e)?pf(e).valuePlacement:e;return t.endsWith("-center")?"center":t.endsWith("-start")?"start":"end"}function uf(e,t,i,s,a,o){const r=(0,n.Djl)(df(t),i,s,a),l=(0,n.gEE)(e,r.min,r.max,s);return{region:l,container:(0,n.bRJ)(l,o)}}function pf(e){const t=e.includes("-after-");let i="center";return e.endsWith("-start")?i="start":e.endsWith("-end")&&(i="end"),{after:t,valuePlacement:`inside-${i}`}}function gf({isUpward:e,isVertical:t,placement:i,spacing:s=0,boxPadding:a,rect:o,rotation:r=0,labelWidth:l=0,labelHeight:h=0,crossReversed:c=!1}){let d=o.x+o.width/2,u=o.y+o.height/2,p="center",g="middle";const m=null==a?{x:0,y:0}:(0,n.baU)(r,a),y=e=>null==a?0:(0,n.jH0)(e,r,l,h,a);let f,x;if(cf(i)){const e=pf(i);f={after:e.after},x=e.valuePlacement}else x=i;const b=null==f?s:0;if("inside-center"===x)d-=m.x,u-=m.y;else{const i=(e?1:-1)*(t?-1:1),{direction:n,textAlignment:s}=hf[x],a=.5*(n+1);if(t){const t=s===i?"top":"bottom";u=(e?o.y+o.height:o.y)+o.height*i*a+(b+y(t))*s*i,d-=m.x,g=t}else{const t=s===i?"left":"right";d=(e?o.x:o.x+o.width)+o.width*i*a+(b+y(t))*s*i,u-=m.y,p=t}}if(f){const e=f.after!==c;if(t){const t=e?"left":"right",i=s+y(t);d=e?o.x+o.width+i:o.x-i,p=t}else{const t=e?"top":"bottom",i=s+y(t);u=e?o.y+o.height+i:o.y-i,g=t}}return{x:d,y:u,textAlign:p,textBaseline:g}}function mf(e,t,i){return t%180==0?(0,n.bRJ)(e,i):{width:Math.max(0,e.height-i.left-i.right),height:Math.max(0,e.width-i.top-i.bottom)}}function yf(e,t){if(null==e)return;const i=Math.max(t.left,t.right),s=Math.max(t.top,t.bottom);return 0===i&&0===s?e:(0,n.Hn4)(e,i,s)}function ff(e){const{isUpward:t,isVertical:i,placements:s,reportedPlacements:a,orientations:o,spacing:r,label:l,rect:h,insideCrossReg
1ion:c,rejectOutsideStart:d=!1,rejectOutsideEnd:u=!1,hideable:p=!1,plotRegion:g,text:m}=e,y=d||u;let f=s.map(((e,t)=>t));if(y&&(f=f.filter((e=>!("outside-start"===s[e]&&d||"outside-end"===s[e]&&u))),0===f.length)){if(p)return[];f=s.map(((e,t)=>t))}const x=null!=l.itemStyler&&null!=m,b=[];for(const d of f){const u=s[d],p=a?.[d]??u,m=wt(l,Zy(l,qy(u))),y=u.startsWith("inside"),f=(0,n.Djl)(df(u),t,i,r);let v=y?(0,n.gEE)(h,f.min,f.max,i):void 0;null!=v&&null!=c&&(v=i?{...v,x:c.x,width:c.width}:{...v,y:c.y,height:c.height});const S=v??g;for(const t of o){const i=x?{spec:e,placement:u,reportedPlacement:p,orientation:t,insideRegion:v,region:S,placementBox:m}:void 0;b.push(xf(e,u,p,t,v,S,m,void 0,i))}}return b}function xf(e,t,i,s,a,o,r,l,h){const{text:c,shapeAt:d}=e,u=t.startsWith("inside"),p=l?.boxPadding??r,g=null==l||null==c?void 0:(0,n.kzl)(c,l.font),m=(g?.width??e.textWidth)+p.left+p.right,y=(g?.height??e.textHeight)+p.top+p.bottom,f=gf({isUpward:e.isUpward,isVertical:e.isVertical,placement:t,spacing:e.spacing,boxPadding:p,rect:e.rect,crossReversed:e.crossReversed??!1}),x=(0,n.CaF)({x:0,y:0},f,m,y,p),b=n.Thr[s],{width:v,height:S}=(0,n.Jlv)(b,m,y);return{box:{x:x.x-v/2,y:x.y-S/2,width:v,height:S},region:o,flushToRegion:!!u&&void 0,rotation:b||void 0,anchor:f,placement:i,size:null==l?void 0:{width:m,height:y},hidden:l?.hidden,fitTo:e.fitted?{container:a&&mf(a,b,p),shape:u?yf(d?.(f),p):void 0,shapeAlign:(M=f.textBaseline,"top"===M||"hanging"===M?"start":"bottom"===M||"alphabetic"===M?"end":"center"),anchor:f,padding:p,font:l?.font}:void 0,deferred:h};var M}function bf(e,t){const{spec:i,placement:n,reportedPlacement:s,orientation:a,insideRegion:o,region:r,placementBox:l}=e;return xf(i,n,s,a,o,r,l,t,void 0)}function vf(e,t,i){const{deferred:n}=e;return null==i||null==n?.spec.text?e:bf(n,i(t,n.placement,n.orientation))}function Sf(e,t,i,n){if(null!=t.itemStyler)return function(s,a){const{styleDatum:o}=s,{deferred:r}=a;if(null==o||null==r?.spec.text)return a;return bf(r,ef(e,t,i(o),n,o,{style:qy(r.placement),reported:r.reportedPlacement},r.orientation))}}var Mf=class{constructor(e){this.ctx=e,this.mementoOriginatorKey="annotations",this.annotations=[]}createMemento(){return this.annotations}guardMemento(e){return null==e||(0,n.cyL)(e)}restoreMemento(e,t,i){this.annotations=this.cleanData(i??[]).map((e=>{const t=this.getAnnotationTypeStyles(e.type);return(0,n.HFk)(e,t)})),this.ctx.eventsHub.emit("annotations:restore",{annotations:this.annotations})}updateData(e){this.annotations=this.cleanData(e??[])}fireChangedEvent(){this.ctx.chartService.callListener({type:"annotations",annotations:(0,n.Go6)([...this.annotations])})}attachNode(e){return this.ctx.annotationRoot.append(e),()=>(e.remove(),this)}setAnnotationStyles(e){this.styles=e}getAnnotationTypeStyles(e){return this.styles?.[e]}cleanData(e){for(const t of e)"textAlign"in t&&delete t.textAlign;return e}},kf=class{constructor(){this.download={type:"action",showOn:"always",label:"contextMenuDownload",enabled:!0,action:void 0,items:void 0},this["zoom-to-cursor"]={type:"action",showOn:"series-area",label:"contextMenuZoomToCursor",enabled:!0,action:void 0,items:void 0},this["pan-to-cursor"]={type:"action",showOn:"series-area",label:"contextMenuPanToCursor",enabled:!0,action:void 0,items:void 0},this["reset-zoom"]={type:"action",showOn:"series-area",label:"contextMenuResetZoom",enabled:!0,action:void 0,items:void 0},this["toggle-series-visibility"]={type:"action",showOn:"legend-item",label:"contextMenuToggleSeriesVisibility",enabled:!0,action:void 0,items:void 0},this["toggle-other-series"]={type:"action",showOn:"legend-item",label:"contextMenuToggleOtherSeries",enabled:!0,action:void 0,items:void 0},this.separator={type:"separator",showOn:"always",label:"separator",enabled:!0,action:void 0,items:void 0}}},Df=class{constructor(){this.defaults=["download","zoom-to-cursor","pan-to-cursor","reset-zoom","toggle-series-visibility","toggle-other-series"]}},wf=class{constructor(){this.items=new kf,this.lists=new Df}},If=class{constructor(e){this.ctx=e,this.builtins=new wf,this.hiddenActions=new Set,this.toggle("zoom
1-to-cursor","hide"),this.toggle("pan-to-cursor","hide"),this.toggle("reset-zoom","hide")}static check(e,t){return t.showOn==e}static checkCallback(e,t,i){return e===t}dispatchContext(e,t,i){this.dispatchContextRegions(e,[e],{[e]:i},t)}dispatchContextRegions(e,t,i,n,s){const{widgetEvent:a}=n;if(a.sourceEvent.defaultPrevented)return;const o={showOn:e,canvasX:s?.canvasX??n.canvasX,canvasY:s?.canvasY??n.canvasY,context:i[e],widgetEvent:a,regions:t,contexts:i};this.ctx.eventsHub.emit("context-menu:setup",o),this.ctx.eventsHub.emit("context-menu:complete",o)}isVisible(e){return!this.hiddenActions.has(e)}toggle(e,t){switch(t??(t=this.isVisible(e)?"hide":"show"),t){case"show":this.hiddenActions.delete(e);break;case"hide":this.hiddenActions.add(e)}}};function Af({id:e},t,i,...n){for(const e of n)e.cleanup();$h(e,t,i,n,{opacity:0},{opacity:1},{phase:"trailing"})}function Cf({id:e},t,i,...n){$h(e,t,i,n,{opacity:1},{opacity:0},{phase:"remove"})}function Nf(e){return{opacity:1}}function Lf(e,t){if(null!=e)return{enabled:e.enabled??!0,stroke:e.stroke??t?.stroke??"transparent",strokeWidth:e.strokeWidth??t?.strokeWidth??1,strokeOpacity:e.strokeOpacity??t?.strokeOpacity??1,lineDash:e.lineDash??t?.lineDash??[]}}var Pf=(()=>{var e=class extends n.XPE{constructor(){super(...arguments),this.enabled=!1}};return d([n.mAP],e.prototype,"enabled",2),e})(),Tf=(()=>{var e=class extends n.XPE{constructor(){super(...arguments),this.interaction=new Pf,this.position=new uu,this.range=void 0,this.class=void 0}formatTooltip(e,t,i){const s=null==this.renderer?void 0:(0,n.cVk)(e,this.renderer,i);if((0,n.KgX)(s)||(0,n.EtT)(s)||(0,n.$PY)(s))return{type:"raw",rawHtmlString:(0,n.i$)(s)};if(null!=s){const e=(0,n.HFk)(s.symbol?.marker,t.symbol?.marker),i=s.symbol?.line??t.symbol?.line?(0,n.HFk)(s.symbol?.line,t.symbol?.line):void 0,a=t.symbol||s.symbol?{marker:e,line:Lf(i,e)}:void 0;return{type:"structured",...t,...s,symbol:a}}return{type:"structured",...t}}};return d([n.mAP],e.prototype,"enabled",2),d([n.mAP],e.prototype,"showArrow",2),d([n.mAP],e.prototype,"renderer",2),d([n.mAP],e.prototype,"interaction",2),d([n.mAP],e.prototype,"position",2),d([n.mAP],e.prototype,"range",2),d([n.mAP],e.prototype,"class",2),e})();function Of(){return new Tf}var Rf=(()=>{var e=class e extends Yc{static is(t){return t instanceof e}get layoutConstraints(){const e=this.options.bandAlignment;return null==e?this._layoutConstraints:{...this._layoutConstraints,align:e}}set requiredRange(e){this._requiredRange=e,null==e||e<=0?(this._layoutConstraints.width=100,this._layoutConstraints.unit="percent"):(this._layoutConstraints.width=e,this._layoutConstraints.unit="px",this.animationManager.skipCurrentBatch())}get requiredRange(){return this._requiredRange}constructor(e,t,i=new yc,n,s=!0){super(e,t,i,n),this.includeInvisibleDomains=s,this.nice=!1}isCategoryLike(){return!0}hasDefinedDomain(){return!1}normaliseDataDomain(e){return{domain:e.domain,clipped:!1}}getUpdateTypeOnResize(){const{bandAlignment:e}=this.options;return null==e||"justify"===e?super.getUpdateTypeOnResize():n.GvF.PROCESS_DOMAIN}updateScale(){super.updateScale();let{paddingInner:e,paddingOuter:t}=this.options;if(!(0,n.BfI)(e)||!(0,n.BfI)(t)){const i=this.reduceBandScalePadding();e??(e=i.inner),t??(t=i.outer)}this.scale.paddingInner=e??0,this.scale.paddingOuter=t??0}calculateGridLines(e,t,i){const n=super.calculateGridLines(e,t,i);return"between"===this.options.interval?.placement&&e.length>0&&n.push(super.calculateGridLine({index:e.at(-1).index+1,tickId:`after:${e.at(-1).tickId}`,translation:this.range[1]},e.length,t,i,e)),n}calculateGridLine({index:e,tickId:t,translation:i},n,s,a,o){const{horizontal:r,scale:l}=this,h=this.options.gridLine;if("between"!==this.options.interval?.placement)return super.calculateGridLine({index:e,tickId:t,translation:i},n,s,a,o);const c=i-(i<l.step?Math.floor(l.step/2):l.step/2),[d,u,p,g]=r?[c,Math.max(s,a),c,Math.min(s,a)]:[Math.min(s,a),c,Math.max(s,a),c],{style:m}=h,{stroke:y,strokeWidth:f=0,lineDash:x}=m[e%m.length]??{};return{tickId:t,offset:c,x1:d,y1:u,x2:p,y2:g,stroke:y,strokeWidth:f,lineDash:x}}calculateGridFills(e,t,i){const{horizontal:n,range:s,scale:a}=this;if("between"!==this.options.interval?.placement)return super.calculateGridFills(e,t,i);const o=[];if(0==e.length)return o;const r=e[0],l=r.translation>s[0]+a.step/2,h=e.at(-1),c=n&&h.translation<s[1]-a.step/2;if(l){const n={tickId:`before:${r.tickId}`,translation:r.translation-a.step};o.push(this.calculateGridFill(n,-1,r.index-1,t,i,e))}if(o.push(...e.map(((n,s)=>this.calculateGridFill(n,s,n.index,t,i,e)))),c){const n={tickId:`after:${h.tickId}`,translation:h.translation+a.step};o.push(this.calculateGridFill(n,e.length,h.index+1,t,i,e))}return o}calculateGridFill({tickId:e,translation:t},i,n,s,a,o){const{horizontal:r,scale:l}=this,h=this.options.gridLine;if("between"!==this.options.interval?.placement)return super.calculateGridFill({tickId:e,translation:t},i,n,s,a,o);const c=t-l.step/2,d=t+l.step/2,[u,p,g,m]=r?[c,Math.max(s,a),d,Math.min(s,a)]:[Math.min(s,a),c,Math.max(s,a),d],{fill:y,fillOpacity:f}=h.style[n%h.style.length]??{};return{tickId:e,x1:u,y1:p,x2:g,y2:m,fill:y,fillOpacity:f}}
1calculateTickLines(e,t,i=0){const n=super.calculateTickLines(e,t,i);return"between"===this.options.interval?.placement&&e.length>0&&n.push(super.calculateTickLine({isPrimary:!1,tickId:`after:${e.at(-1)?.tickId}`,translation:this.range[1]},e.length,t,e,i)),n}calculateTickLine({isPrimary:e,tickId:t,translation:i},n,s,a,o=0){const{horizontal:r,primaryTick:l,scale:h}=this,c=this.options.tick;if("between"!==this.options.interval?.placement)return super.calculateTickLine({isPrimary:e,tickId:t,translation:i},n,s,a,o);const d=e&&l?.enabled?l:c,u=-s*this.getTickSize(d),p=i-(i<h.step?Math.floor(h.step/2):h.step/2),g=-s*(o+this.getTickSpacing(d)),[m,y,f,x]=r?[p,g,p,g+u]:[g,p,g+u,p],{stroke:b,width:v}=d;return{tickId:t,offset:p,x1:m,y1:y,x2:f,y2:x,stroke:b,strokeWidth:v,lineDash:void 0}}reduceBandScalePadding(){return this.boundSeries.reduce(((e,t)=>{const i=t.getBandScalePadding?.();return i&&(e.inner>i.inner&&(e.inner=i.inner),e.outer<i.outer&&(e.outer=i.outer)),e}),{inner:1/0,outer:-1/0})}tickFormatParams(e,t,i,n){return{type:"category"}}datumFormatParams(e,t,i,n,s){const{datum:a,seriesId:o,legendItemName:r,key:l,source:h,property:c,domain:d,boundSeries:u}=t;return Array.isArray(e)&&e.some((e=>"string"!=typeof e))&&(e=e.map(String)),{type:"category",value:e,datum:a,seriesId:o,legendItemName:r,key:l,source:h,property:c,domain:d,boundSeries:u}}};return e.className="CategoryAxis",e.type="category",e})(),Ef=class e extends yc{constructor(){super(...arguments),this.previousDomainJson=void 0,this.animatable=!0}static is(t){return t instanceof e}set domain(e){if(e.length<=1e3){const t=JSON.stringify(e);this.animatable=void 0===this.previousDomainJson||this.previousDomainJson===t,this.previousDomainJson=t}else this.animatable=void 0===this.previousDomainJson,this.previousDomainJson="";super.domain=e}get domain(){return super.domain}normalizeDomains(...e){const{domain:t}=super.normalizeDomains(...e);return{domain:t,animatable:!1}}findIndex(e){return super.findIndex(e)??this.getMatchIndex(e)}getMatchIndex(e){const t=JSON.stringify(e),i=this._domain.find((e=>JSON.stringify(e)===t));if(null!=i)return super.findIndex(i)}},zf=class e{constructor(e="",t,i){this.label=e,this.parent=t,this.refId=i,this.position=0,this.subtreeLeft=Number.NaN,this.subtreeRight=Number.NaN,this.children=[],this.leafCount=0,this.prelim=0,this.mod=0,this.ancestor=this,this.change=0,this.shift=0,this.index=0,this.separatorDepth=0,this.leftmostLeaf=this,this.screen=0,this.depth=t?t.depth+1:0}insertTick(t,i){let n,s=this;for(let a=0;a<t.length;a++){const o=t[a],r=a!==t.length-1,{children:l}=s,h=l.find((e=>e.label===o));if(h&&r)s=h,n=h;else{const t=new e(o,s,i);t.index=l.length,l.push(t),r&&(s=t),n=t}}return n}getLeftSibling(){return this.index>0?this.parent?.children[this.index-1]:void 0}getLeftmostSibling(){return this.index>0?this.parent?.children[0]:void 0}nextLeft(){return this.children[0]}nextRight(){return this.children.at(-1)}getSiblings(){return this.parent?.children.filter(((e,t)=>t!==this.index))??[]}};function Bf(e,t,i){const n=i/(t.index-e.index);t.change-=n,t.shift+=i,e.change+=n,t.prelim+=i,t.mod+=i}function Ff(e,t,i){return t.getSiblings().includes(e.ancestor)?e.ancestor:i}function Vf(e,t){const i=e.getLeftSibling();if(i){let n=e,s=e,a=i,o=s.getLeftmostSibling(),r=s.mod,l=n.mod,h=a.mod,c=o.mod;for(;a.nextRight()&&s.nextLeft();){a=a.nextRight(),s=s.nextLeft(),o=o.nextLeft(),n=n.nextRight(),n.ancestor=e;const i=a.prelim+h-(s.prelim+r)+1;i>0&&(Bf(Ff(a,e,t),e,i),r+=i,l+=i),h+=a.mod,r+=s.mod,c+=o.mod,l+=n.mod}a.nextRight()&&!n.nextRight()?n.mod+=h-l:(s.nextLeft()&&!o.nextLeft()&&(o.mod+=r-c),t=e)}return t}function $f(e){const{children:t}=e;if(t.length){let[i]=t;for(const e of t)$f(e),i=Vf(e,i);!function({children:e}){let t=0,i=0;for(let n=e.length-1;n>=0;n--){const s=e[n];s.prelim+=t,s.mod+=t,i+=s.change,t+=s.shift+i}}(e);const n=(t[0].prelim+t.at(-1).prelim)/2,s=e.getLeftSibling();s?(e.prelim=s.prelim+1,e.mod=e.prelim-n):e.prelim=n}else{const t=e.getLeftSibling();e.prelim=t?t.prelim+1:0}}function Hf(e,t,i){e.position=e.prelim+t,e.separatorDepth=0===e.index?1+(e.parent?.separatorDepth??0):0,i.insertNode(e);for(const n of e.children)Hf(n,t+e.mod,i)}function jf(e){const{children:t}=e;let i=0;for(const e of t)jf(e),e.children.length?i+=e.leafCount:i++;e.leafCount=i,t.length?(e.subtreeLeft=t[0].subtreeLeft,e.subtreeRight=t.at(-1).subtreeRight,e.position=(e.subtreeLeft+e.subtreeRight)/2,e.leftmostLeaf=t[0].leftmostLeaf):(e.subtreeLeft=e.position,e.subtreeRight=e.position)}function Wf(e){const t=new _f,{root:i,tickNodes:n}=function(e){const t=e.reduce(((e,t)=>Math.max(e,t.length)),0),i=new zf,n=new Map;for(let s=0;s<e.length;s++){const a=e[s];for(;a.length<t;)a.push("");const o=i.insertTick(a,s);null!=o&&n.set(a,o)}return{root:i,tickNodes:n}}(e);return $f(i),Hf(i,-i.prelim,t),jf(i),{layout:t,tickNodes:n}}var _f=class{constructor(){this.minPosition=1/0,this.maxPosition=-1/0,this.nodes=[],this.depth=0}insertNode(e){this.depth<e.depth&&(this.depth=e.depth),e.position<this.minPosition&&(this.minPosition=e.position),e.position>this.maxPosition&&(this.maxPosition=e.position),this.nodes.push(e)}scaling(e,t){let i=1;return e>0&&this.maxPosition!==this.minPosition&&(i=e/(this.maxPosition-this.minPosition)),t&&(i*=-1),i}resize(e,t,i,n){const s=Math.abs(e[1]-e[0])-t,a=this.scaling(s,e[0]>e[1]),o=i+n/2;let r=0;for(const e of this.nodes){const t=e.position*a;r>t&&(r=t),e.screen=t+o}for(const e of this.nodes)e.screen-=r}},Gf=(()=>{var e=class extends Rf{constructor(e,t,i){super(e,t,new Ef,i),this.tickScale=new Ef,this.computedLayout=void 0,this.tickTreeLayout=void 0,this.tickValues=void 0,this.tickNodes=void 0,this.leafNodeToKey=void 0,this.ftdPositions=new Map,this.ftdCandidates=new Set,this.ftdKept=new Set,this.ftdByDepth=[],this.ftdStack=[],this.includeInvisibleDomains=!0,this.tickScale.paddingInner=1,this.tickScale.paddingOuter=0}getDepthOptionsMap(e){const t=[],i=this.options.depthOptions??[],n=this.options.label,s=this.horizontal?0:-90;for(let a=0;a<e;a++){const e=i[a]?.label;t.push(e?.enabled??n?.enabled??1?{enabled:!0,spacing:e?.spacing??n?.spacing??5,wrapping:e?.wrapping??n?.wrapping,truncate:e?.truncate??n?.truncate,rotation:e?.rotation??(a?s:n?.rotation),avoidCollisions:e?.avoidCollisions??n?.avoidCollisions??!0}:{enabled:!1,spacing:0,rotation:0,avoidCollisions:!1})}return t}updateCategoryLabels(){this.computedLayout&&this.tickLabelGroupSelection.update(this.computedLayout.tickLabelLayout).each(((e,t)=>{e.fill=t.color,e.text=t.text,e.textBaseline=t.textBaseline,e.textAlign=t.textAlign??"center",e.pointerEvents=null==t.textUntruncated?1:0,e.setFont(t),e.setBoxing(t)}
1))}updateAxisLine(){if(!this.computedLayout)return;const{line:e}=this.options;this.lineNode.visible=e.enabled,this.lineNode.stroke=e.stroke,this.lineNode.strokeWidth=e.width}computeLayout(){this.updateDirection(),this.updateScale();const{step:e}=this.scale,{range:t,horizontal:i}=this,s=this.options.depthOptions??[],a=this.options.line,o=this.options.label,r=this.options.title,l=this.chartLayout?.scrollbars?.[this.id],h=this.getScrollbarThickness(l),c=this.getTickSpacing();if(this.lineNode.datum=i?{x1:t[0],x2:t[1],y1:0,y2:0}:{x1:0,x2:0,y1:t[0],y2:t[1]},this.lineNode.setProperties({stroke:a.stroke,strokeWidth:a.enabled?a.width:0}),this.tickTreeLayout?.resize(this.scale.range,this.scale.step,this.scale.inset,this.scale.bandwidth),!this.tickTreeLayout?.depth)return this.pickTickData=[],{bbox:m.zero,spacing:0,tickSizeAtDepth:[],tickLabelLayout:[]};const{depth:d,nodes:u}=this.tickTreeLayout,p=Zh(this.mirrored),g=i?-p:p,y=[],f=new Map,x=new Ze,b=this.getDepthOptionsMap(d),v=g*(b[0].spacing+h+c),S=this.tickFormatter(this.scale.domain,this.scale.domain,!1),M=new Map,k={},D=[];for(const[a,r]of u.entries()){const l=d-r.depth;if(k[l]??(k[l]=0),!b[l]?.enabled||!(0,n.r4$)(r.screen,t))continue;const h=a-1,c=(null==r.refId?void 0:this.tickValues?.[r.refId])??[],u=S(c,h,l),p=(r.leafCount||1)*e/2;D.push({index:h,value:c,formattedValue:u,along:[r.screen-p,r.screen+p],depth:l});if(!r.children.length&&e<5)continue;let g=(r.leafCount||1)*e;if(g<5)continue;let m=u;const y=this.getLabelStyles({value:c,formattedValue:m,depth:l,index:h},s[l]?.label);if(o?.avoidCollisions??1){const e=b[l].rotation;let t=this.options.thickness;if(null!=e){const i=(0,n.WTq)(e,g,t);g=i.width,t=i.height}const i={font:y,textWrap:b[l].wrapping,overflow:b[l].truncate?"ellipsis":"hide",maxWidth:g,maxHeight:t};m=(0,n.rHj)(m,i)||m}const w=m!==u&&(0,n.pQy)(m)?(0,n.boc)(u):void 0;if(x.x=i?r.screen:v,x.y=i?v:r.screen,x.rotation=0,x.fill=y.color,x.text=m,x.textAlign="center",x.textBaseline=this.parallel?"top":"bottom",x.setFont(y),x.setBoxing(y),!x.getBBox())continue;M.set(a,{text:m,styles:y,truncatedText:w}),f.set(a,x.getBBox()),x.rotation=(0,n.JJe)(b[l]?.rotation);const{width:I,height:A}=x.getBBox(),C=i?A:I;k[l]<C&&(k[l]=C)}const w=[0],I=[(k[0]??0)+(b[0]?.spacing??0)];let A=k[0]??0,C=b[0]?.spacing??0,N=0;for(let e=1;e<d;e++)N+=b[e]?.spacing??0,w[e]=A+N,A+=k[e]??0,C+=b[e]?.spacing??0,I[e]=A+C;this.pickTickData=D.map((({depth:e,...t})=>({...t,depth:e,cross:[0===e?0:I[e-1],e===d-1?1/0:I[e]]})));const L=(0,n.Iig)();for(const[t,s]of u.entries()){if(0===t)continue;const a=M.get(t);if(!a)continue;const o=!s.children.length,r=d-s.depth;if(o&&e<5)continue;const l=(0,n.JJe)(b[r].rotation),h=f.get(t);if(!h)continue;const{width:c,height:u}=h,p=w[r]??0;if(x.x=i?s.screen:v,x.y=i?v:s.screen,x.fill=a.styles.color,x.text=a.text,x.setFont(a.styles),x.setBoxing(a.styles),x.textAlign="center",x.textBaseline="middle",x.rotation=l,i?(x.y+=(p+(0,n.IUw)(c/2,u/2,l))*g,x.rotationCenterX=s.screen,x.rotationCenterY=x.y):(x.x+=p*g+(0,n.IUw)((b[r].spacing*g+c)/2,this.mirrored?c:0,l)-c/2,x.rotationCenterX=x.x,x.rotationCenterY=s.screen),b[r].avoidCollisions){const{width:n,height:a}=x.getBBox();if((i?n:a)>(o?e:s.leafCount*e)){f.delete(t);continue}}const m=x.getPlainText(),S=x.getBoxingProperties();y.push({text:m,textUntruncated:a.truncatedText,visible:!0,tickId:L(m),range:this.scale.range,border:S.border,color:x.fill,cornerRadius:S.cornerRadius,fill:S.fill,fontFamily:x.fontFamily,fontSize:x.fontSize,fontStyle:x.fontStyle,fontWeight:x.fontWeight,padding:S.padding,rotation:x.rotation,rotationCenterX:x.rotationCenterX,rotationCenterY:x.rotationCenterY,textAlign:x.textAlign,textBaseline:x.textBaseline,x:x.x,y:x.y}),f.set(t,Me.toCanvas(x))}const P=(I[d-1]??0)+h+c,T=[this.lineNodeBBox(),m.merge(f.values()),new m(0,0,P*g,0)],O=m.merge(T),R=i?O.height:O.width,{spacing:E,scrollbarLayout:z}=this.applyScrollbarLayout(T,R,l);this.layout.labelThickness=R,this.layout.scrollbar=z,r.enabled&&T.push(this.titleBBox(this.scale.domain,E));const B=m.merge(T);return this.notifyAxisPlugins("onAxisLayout"),{bbox:B,spacing:E,tickSizeAtDepth:I,tickLabelLayout:y}}buildDepthsMap(e){const{tickNodes:t,tickScale:i,tickTreeLayout:n}=this;if(!n||!t)return new Map;const s=n.depth,a=new Map;for(const i of e){const e=t.get(i),n=null==e?s-1:Math.min(e.separatorDepth,s-1);a.set(i,n)}if(i.step<5&&e.length>1){const i=e.at(-1);if(i&&!t.has(i)){const t=e.at(-2),n=t?a.get(t):void 0;null!=n&&a.set(i,n)}}return a}filterTicksTopDown(e,t){const{tickScale:i,tickTreeLayout:n,tickNodes:s,leafNodeToKey:a}=this;if(!n||null==s||null==a)return{ticks:e,depthsMap:new Map};const o=i.range,r=i.step,l=i.inset,h=i.bandwidth,c=t?.[0]??0,d=t?.[1]??1,u=this.filterTickCache;if(u?.range0===o[0]&&u.range1===o[1]&&u.step===r&&u.inset===l&&u.bandwidth===h&&u.vr0===c&&u.vr1===d)return u.result;const p=e=>(this.filterTickCache={range0:o[0],range1:o[1],step:r,inset:l,bandwidth:h,vr0:c,vr1:d,result:e},e);if(i.step>=5)return p({ticks:e,depthsMap:this.buildDepthsMap(e)});const g=this.ftdPositions;g.clear();const m=this.ftdCandidates;m.clear();const y=this.ftdKept;y.clear();const f=this.ftdStack;f.length=0;const x=e=>(g.has(e)||g.set(e,i.convert(e)),g.get(e));let b=e;if(null!=t&&(0!==t[0]||1!==t[1])){const n=i.domain,s=n.length;if(s>0){const i=Math.max(0,Math.floor(t[0]*s)-1),a=Math.min(s-1,Math.ceil(t[1]*s));if(0===e.length)b=n.slice(i,a+1);else{const t=n[i],s=n[a],o=e[0],r=e.at(-1),l=null!=t&&t!==o,h=null!=s&&s!==r;if(l||h){const i=l?[t]:[];i.push(...e),h&&i.push(s),b=i}}}}if((e=>{let t=0;for(const i of e)if(Number.isFinite(x(i))&&(t+=1,t>1))break;return t})(b)<=1)return p({ticks:b,positions:g,depthsMap:this.buildDepthsMap(b)});for(const e of b)m.add(e);for(const e of b){const t=s.get(e);let i=t?.parent;for(;i?.parent;){const e=a.get(i.leftmostLeaf);null!=e&&m.add(e),i=i.parent}}const v=Math.max(0,n.depth-1),S=e=>Math.min(v,n.depth-e.depth),M=n.nodes[0];if(!M?.children.length)return p({ticks:b,positions:g,depthsMap:this.buildDepthsMap(b)});const k=this.ftdByDepth;for(const e of k)e.positions.length=0,e.ticks.length=0;const D=(e,t)=>{const i=e.at(-1);return null!=i&&t-i<5},w=(e,t)=>{for(let i=t+1;i<=v;i++)if(D(k[i].positions,e))return!1;return!D(k[t].positions,e)},I=(e,t,i)=>{const n=k[i];n.positions.push(e),n.ticks.push(t)},A=(e,t)=>
1{if(0!==t)for(let i=0;i<t;i++){const t=k[i];for(;t.positions.length>0&&e-t.positions.at(-1)<5;)y.delete(t.ticks.at(-1)),t.positions.pop(),t.ticks.pop()}};for(let e=M.children.length-1;e>=0;e--){const t=M.children[e],i=a.get(t.leftmostLeaf);null!=i&&m.has(i)&&f.push(t)}for(;f.length;){const e=f.pop(),t=a.get(e.leftmostLeaf);if(null==t||!m.has(t))continue;const i=x(t);if(null==i||!Number.isFinite(i))continue;if(y.has(t)){for(let t=e.children.length-1;t>=0;t--)f.push(e.children[t]);continue}const n=S(e);if(w(i,n)){y.add(t),I(i,t,n),A(i,n);for(let t=e.children.length-1;t>=0;t--)f.push(e.children[t])}}for(const e of b){if(s.has(e))continue;const t=x(e);if(null==t||!Number.isFinite(t))continue;if(y.has(e))continue;const i=0;w(t,i)&&(y.add(e),I(t,e,i),A(t,i))}const C=b.filter((e=>y.has(e)));return p({ticks:C,positions:g,depthsMap:this.buildDepthsMap(C)})}update(){if(!this.computedLayout)return;this.scale.animatable||this.moduleCtx.animationManager.skipCurrentBatch();const{tickScale:e,gridLength:t,visibleRange:i,tickTreeLayout:n}=this,{tick:s,gridLine:a}=this.options;if(!n)return;const{tickSizeAtDepth:o,spacing:r}=this.computedLayout,{depth:l}=n,h=this.chartLayout?.scrollbars?.[this.id],c=this.getScrollbarThickness(h),d=this.getTickSpacing(),{position:u,horizontal:p,gridPadding:g}=this,m="bottom"===u||"right"===u?-1:1,y=g,f=m*t-g,x={nice:[!1,!1],interval:void 0,tickCount:void 0,minTickCount:0,maxTickCount:1/0};let{ticks:b}=e.ticks(x,void 0,i);const v=this.filterTicksTopDown(b,i);b=v.ticks;const{depthsMap:S}=v,M=b.map(((t,i)=>({index:e.findIndex(t),tickId:Xr(i,...t),translation:Math.round(v.positions?.get(t)??e.convert(t))}))),k=e=>e.tickId;this.gridLineGroupSelection.update(a.enabled&&t?this.calculateGridLines(M,y,f):[],void 0,k),this.gridFillGroupSelection.update(a.enabled&&t?this.calculateGridFills(M,y,f):[],void 0,k),this.tickLineGroupSelection.update(s.enabled?b.map(((e,t)=>{const{tickId:i,translation:n}=M[t],a=(e=>S.get(e)??l-1)(e),r=(this.options.depthOptions??[])[a]?.tick,h=o[a]??0,u=r?.stroke??s.stroke,g=!1===r?.enabled?0:r?.width??s.width,y=-m*h,f=-m*(c+d),[x,b,v,k]=p?[n,f,n,f+y]:[f,n,f+y,n];return{tickId:i,offset:n,x1:x,y1:b,x2:v,y2:k,stroke:u,strokeWidth:g,lineDash:void 0}})):[],void 0,k),this.updatePosition(),this.updateCategoryLabels(),this.updateAxisLine(),this.updateGridLines(),this.updateGridFills(),this.updateTickLines(),this.updateTitle(this.scale.domain,r),this.notifyAxisPlugins("onAxisUpdate"),this.resetSelectionNodes()}calculateLayout(e,t){this.chartLayout=t;const{tickSizeAtDepth:i,tickLabelLayout:n,spacing:s,bbox:a}=this.computeLayout();return this.computedLayout={tickSizeAtDepth:i,tickLabelLayout:n,spacing:s},{bbox:a,niceDomain:this.scale.domain}}onGridVisibilityChange(){super.onGridVisibilityChange(),this.tickLabelGroupSelection.clear()}updateScale(){super.updateScale(),this.tickScale.range=this.scale.range,this.scale.paddingOuter=this.scale.paddingInner/2}processData(){const{direction:e}=this,t=this.boundSeries.filter((e=>e.visible)).flatMap((t=>(0,n.aX5)(t.getDomain(e))));this.dataDomain={domain:(0,n.Xxv)(t)??this.filterDuplicateArrays(t),clipped:!1},this.isReversed()&&(this.dataDomain={...this.dataDomain,domain:this.dataDomain.domain.toReversed()});const i=this.dataDomain.domain.map(Kf),{layout:s,tickNodes:a}=Wf(i);this.tickValues=i,this.tickTreeLayout=s,this.tickNodes=a,this.leafNodeToKey=new Map;for(const[e,t]of a)this.leafNodeToKey.set(t,e);this.filterTickCache=void 0,this.ftdByDepth=Array.from({length:Math.max(0,s.depth-1)+1},(()=>({positions:[],ticks:[]})));const o=[];
1for(const e of this.tickTreeLayout.nodes)e.leafCount||null==e.refId||o.push(this.dataDomain.domain[e.refId]);const r=(0,n.EGs)(this.dataDomain.domain,o);this.scale.domain=r;const l=r.map(Kf);l.push([""]),this.tickScale.domain=l}filterDuplicateArrays(e){const t=new Set;return e.filter((e=>{const i=(0,n.cyL)(e)?JSON.stringify(e):e;return!t.has(i)&&(t.add(i),!0)}))}};return e.className="GroupedCategoryAxis",e.type="grouped-category",e})();function Kf(e){return(0,n.$rL)((0,n.Gvm)(e)&&"value"in e?e.value:e)}function Yf(e,t,i){for(const n of t){const t=n.datum;void 0===t?i.error("undefined datum"):e.addValue(n,t)}}function Uf(e,t){const{x:i,y:n}=t,{nearest:s,distanceSquared:a}=e.getQuadTree().find(i,n);if(void 0!==s)return{datum:s.value,distance:Math.sqrt(a),target:e.contentGroup}}var Xf=(()=>{var e=class extends ly{constructor(){super(...arguments),this.direction="vertical",this.width=void 0,this.widthRatio=void 0}};return d([n.mAP],e.prototype,"direction",2),d([n.mAP],e.prototype,"width",2),d([n.mAP],e.prototype,"widthRatio",2),e})(),Zf=class extends hy{constructor(){super(...arguments),this.smallestDataInterval=void 0,this.largestDataInterval=void 0}padBandExtent(e,t){const i="boolean"==typeof t?1:.5,s=null==this.smallestDataInterval?Number.NaN:Number(this.smallestDataInterval),a=(0,n.BfI)(s)?s*i:0,o=(0,n.Xxv)(e);if(null==o)return uo([Number.NaN,Number.NaN]);const r=[o[0],o[1]];if("boolean"==typeof t){const e=t?0:1;r[e]=(0,n.Vz0)(r[e],(t?1:-1)*a)}else r[0]=(0,n.Vz0)(r[0],a),r[1]=(0,n.mlo)(r[1],a);return uo(r)}getBandScalePadding(){return{inner:.3,outer:.15}}shouldFlipXY(){return!this.isVertical()}isVertical(){return"vertical"===this.properties.direction}getBarDirection(){return this.shouldFlipXY()?n.tv$.X:n.tv$.Y}getCategoryDirection(){return this.shouldFlipXY()?n.tv$.Y:n.tv$.X}getValueAxis(){const e=this.getBarDirection();return this.axes[e]}getCategoryAxis(){const e=this.getCategoryDirection();return this.axes[e]}getCategoryCrispDirection(){if(Vl.is(this.getCategoryAxis()?.scale))return this.getCategoryDirection()===n.tv$.X?"x":"y"}getMinimumRangeSeries(e){const{width:t}=this.properties;if(null==t)return;if(!this.getCategoryAxis())return;const{index:i}=this.ctx.seriesStateManager.getVisiblePeerGroupIndex(this);e[i]=Math.max(e[i]??0,t)}getMinimumRangeChart(e){if(0===e.length)return 0;const t=this.getCategoryAxis();if(!(t instanceof Gf||t instanceof Rf))return 0;const i=this.data?.netSize()??0;if(0===i)return 0;const n=this.getBandScalePadding(),{paddingInner:s=n.inner,paddingOuter:a=n.outer,groupPaddingInner:o}=t.options,r=e.reduce(((e,t)=>e+t),0),l=r/e.length,{visibleGroupCount:h}=this.ctx.seriesStateManager.getVisiblePeerGroupIndex(this);return(r+o*l*(h-1))*((i-s+2*a)/(1-s))}validateCreateNodeDataPreconditions(){const e=this.getCategoryAxis(),t=this.getValueAxis();if(e&&t&&this.dataModel&&this.processedData)return{xAxis:e,yAxis:t}}getBandwidth(e,t){return Rl.is(e.scale)?e.scale.calcBandwidth(this.smallestDataInterval,t):e.scale.bandwidth??0}xCoordinateRange(e){const t=this.axes[this.getCategoryDirection()],i=t.scale,n=this.getBandwidth(t,0),s=Rl.is(i)?-.5*n:0,a=i.convert(e)+s;return[a,a+n]}yCoordinateRange(e){const t=this.axes[this.getBarDirection()].scale,i=e.map((e=>t.convert(e)));if(1===i.length){const e=t.convert(0);return[Math.min(i[0],e),Math.max(i[0],e)]}return(0,n.uYy)(i)}getBarDimensions(){const e=this.getCategoryAxis(),t=this.getBandwidth(e);this.ctx.seriesStateManager.updateGroupScale(this,t,e);const i=this.getBarWidth(),n=this.getBarOffset(i);let s=this.getGroupOffset();if(this.ctx.domManager.isRtl&&null!=this.seriesGrouping){s=t-s-this.ctx.seriesStateManager.getGroupBandWidth(this)}return{groupOffset:s,barOffset:n,barWidth:i}}getGroupOffset(){return this.ctx.seriesStateManager.getGroupOffset(this)}getBarOffset(e){const t=this.ctx.seriesStateManager.getGroupScale(this),i=this.getCategoryAxis();let n=0;if(Rl.is(i.scale))n=-e/2;else if(null==this.seriesGrouping&&t){n=(this.getGroupScaleRangeWidth(t)-e)/2}else t&&null!=this.properties.widthRatio&&(n=(t.bandwidth-e)/2);return n+this.ctx.seriesStateManager.getStackOffset(this,e)}getBarWidth(){const{seriesGrouping:e}=this,{width:t}=this.properties;let{widthRatio:i}=this.properties;const n=this.ctx.seriesStateManager.getGroupScale(this),s=n?.bandwidth??0;if(null==e&&(i??(i=1)),null!=i){let a=t;return null==e&&null==a&&n&&(a=this.getGroupScaleRangeWidth(n)),null==a&&s<1&&n?n.rawBandwidth:(a??s)*i}return null!=t?t:s<1&&n?n.rawBandwidth:s}getGroupScaleRangeWidth(e){return e.range[1]-e.range[0]}getDatumOffset(e){const t=this.getCategoryAxis();if(!(t instanceof Rf&&t.options.skipNullBars))return 0;const i=this.ctx.seriesStateManager.getDatumOffset(this,e);return this.ctx.domManager.isRtl?-i:i}
1updateDatumValidKeys(){const{dataModel:e,processedData:t}=this,i=this.getCategoryAxis();if(!e||!t||!(i instanceof Rf&&i.options.skipNullBars))return void this.ctx.seriesStateManager.setSeriesDatumValidKeys(this.internalId,void 0);const n=e.resolveKeysById(this,"xValue",t),s=t.invalidData?.get(this.id),a=t.missingData?.get(this.id),o=[];for(let e=0;e<n.length;e+=1)!0!==s?.[e]&&!0!==a?.[e]&&o.push(n[e]);this.ctx.seriesStateManager.setSeriesDatumValidKeys(this.internalId,o)}resolveKeyDirection(e){return this.getBarDirection()===n.tv$.X?e===n.tv$.X?n.tv$.Y:n.tv$.X:e}initQuadTree(e){Yf(e,this.datumNodesIter(),this.ctx.logger)}pickNodeClosestDatum(e){return Uf(this,e)}};function qf(e,t,i){return(t-e)*i+e}function Qf(e,t){const{x0:i,y0:n,x1:s,y1:a}=e,o=(a-n)/(s-i)*(t-i)+n;return{leftCp1x:i,leftCp1y:n,leftCp2x:t,leftCp2y:o,stepX:t,stepY0:o,stepY1:o,rightCp1x:t,rightCp1y:o,rightCp2x:s,rightCp2y:a}}function Jf(e,t){return"linear"===e.type?Qf(e,t):"cubic"===e.type?function(e,t){const{cp0x:i,cp0y:s,cp1x:a,cp1y:o,cp2x:r,cp2y:l,cp3x:h,cp3y:c}=e,d=(0,n.D83)(i,a,r,h,t),[u,p]=(0,n.ypg)(i,s,a,o,r,l,h,c,d),g=u[3].y;return{leftCp1x:u[1].x,leftCp1y:u[1].y,leftCp2x:u[2].x,leftCp2y:u[2].y,stepX:t,stepY0:g,stepY1:g,rightCp1x:p[1].x,rightCp1y:p[1].y,rightCp2x:p[2].x,rightCp2y:p[2].y}}(e,t):"step"===e.type?function(e){const{x0:t,y0:i,x1:n,y1:s,stepX:a}=e;return{leftCp1x:(t+a)/2,leftCp1y:i,leftCp2x:(t+a)/2,leftCp2y:i,stepX:a,stepY0:i,stepY1:s,rightCp1x:(a+n)/2,rightCp1y:s,rightCp2x:(a+n)/2,rightCp2y:s}}(e):Qf(e,t)}function ex(e,t,i,s,a,o,r){switch(t){case n.Dl4.MoveTo:r?e.moveTo(a,o):e.moveTo(i,s);break;case n.Dl4.LineTo:r?e.lineTo(a,o):e.lineTo(i,s);case n.Dl4.Skip:}}function tx(e,t,i,n,s,a){a?e.lineTo(t,i):e.lineTo(n,s)}function ix(e,t,i,n,s,a,o,r,l,h){h?e.cubicCurveTo(a,o,n,s,t,i):e.cubicCurveTo(n,s,a,o,r,l)}function nx(e,t,i,n,s,a,o){o?(e.lineTo(a,s),e.lineTo(a,i),e.lineTo(t,i)):(e.lineTo(a,i),e.lineTo(a,s),e.lineTo(n,s))}function sx(e,t,i,s){const[a,o]=(0,n.gUy)(t);switch(ex(e,i,a.x,a.y,o.x,o.y,s),t.type){case"linear":tx(e,t.x0,t.y0,t.x1,t.y1,s);break;case"cubic":ix(e,t.cp0x,t.cp0y,t.cp1x,t.cp1y,t.cp2x,t.cp2y,t.cp3x,t.cp3y,s);break;case"step":nx(e,t.x0,t.y0,t.x1,t.y1,t.stepX,s);break;case"multi-line":!function(e,t,i,n,s,a,o){if(o){for(let t=a.length-1;t>=0;t--){const{x:i,y:n}=a[t];e.lineTo(i,n)}e.lineTo(t,i)}else{for(const{x:t,y:i}of a)e.lineTo(t,i);e.lineTo(n,s)}}(e,t.x0,t.y0,t.x1,t.y1,t.midPoints,s)}}function ax(e,t,i){const[s,a]=(0,n.gUy)(e),[o,r]=(0,n.gUy)(t);return[{x:qf(s.x,o.x,i),y:qf(s.y,o.y,i)},{x:qf(a.x,r.x,i),y:qf(a.y,r.y,i)}]}function ox(e,t,i,n,s,a){const[{x:o,y:r},{x:l,y:h}]=ax(t,i,n);if(ex(e,s,o,r,l,h,a),"cubic"===t.type&&"cubic"===i.type){ix(e,o,r,qf(t.cp1x,i.cp1x,n),qf(t.cp1y,i.cp1y,n),qf(t.cp2x,i.cp2x,n),qf(t.cp2y,i.cp2y,n),l,h,a)}else if("step"===t.type&&"step"===i.type){nx(e,o,r,l,h,qf(t.stepX,i.stepX,n),a)}else if("linear"===t.type&&"linear"===i.type)tx(e,o,r,l,h,a);else{let s;s="step"===t.type?t.stepX:"step"===i.type?i.stepX:(o+l)/2;const c=Jf(t,s),d=Jf(i,s),u=qf(c.leftCp1x,d.leftCp1x,n),p=qf(c.leftCp1y,d.leftCp1y,n),g=qf(c.leftCp2x,d.leftCp2x,n),m=qf(c.leftCp2y,d.leftCp2y,n),y=qf(c.stepX,d.stepX,n),f=qf(c.stepY0,d.stepY0,n),x=qf(c.stepY1,d.stepY1,n),b=qf(c.rightCp1x,d.rightCp1x,n),v=qf(c.rightCp1y,d.rightCp1y,n),S=qf(c.rightCp2x,d.rightCp2x,n),M=qf(c.rightCp2y,d.rightCp2y,n);a?(e.cubicCurveTo(S,M,b,v,y,x),e.lineTo(y,f),e.cubicCurveTo(g,m,u,p,o,r)):(e.cubicCurveTo(u,p,g,m,y,f),e.lineTo(y,x),e.cubicCurveTo(b,v,S,M,l,h))}}var rx=(e=>(e[e.Zero=0]="Zero",e[e.Split=1]="Split",e))(rx||{});function lx(e){return(0,n.vq9)(e).valueOf()}function hx(e,t){if(!t)return Number.NaN;if(e instanceof Date&&(e=e.getTime()),"continuous"===t.type&&"number"==typeof e){return(e-t.domain[0])/(t.domain[1]-t.domain[0])*(t.range[1]-t.range[0])+t.range[0]}if("log"===t.type&&"number"==typeof e)return t.convert(e);if("category"!==t.type)return Number.NaN;if((0,n.$uD)(t)){if("number"==typeof e){const{firstBandTime:i,intervalMs:n,bandCount:s,inset:a,step:o}=t,r=Math.round((e-i)/n);if(r>=0&&r<s)return a+o*r}return Number.NaN}const i=lx(e);let s=t.domain.findIndex((e=>lx(e)===i));return-1===s&&(s=t.domain.findIndex((t=>{return n=t,null!=(i=e)&&null!=n&&"object"==typeof i&&"object"==typeof n&&("id"in i&&"id"in n?i.id===n.id:i.toString()===n.toString());var i,n}))),s>=0?t.inset+t.step*s:Number.NaN}function cx({data:e},t){return e.map(((e,i)=>({xValue0Index:t.indexOf(lx(e.xValue0)),xValue1Index:t.indexOf(lx(e.xValue1)),datumIndex:i})))}function dx(e){return Object.values(e.scales).every((e=>"category"!==e.type||((0,n.$uD)(e)?e.bandCount<1e3:e.domain.length<1e3)))}function ux(e,t){const i=new Map;for(const{xValue0:t,xValue1:n}of e.data){const e=lx(t),s=lx(n);i.set(e,t).set(s,n)}const n=Array.from(i,(([e,t])=>({axisValue:e,value:t})));n.sort(((t,i)=>hx(t.value,e.scales.x)-hx(i.value,e.scales.x)));const s=[];for(const{xValue0:e,xValue1:n}of t.data){const t=lx(e),a=lx(n);i.has(t)||(i.set(t,e),s.push({axisValue:t,value:e})),i.has(a)||(i.set(a,n),s.push({axisValue:a,value:n}))}s.sort(((e,i)=>hx(e.value,t.scales.x)-hx(i.value,t.scales.x)));const a=n;let o=0;for(const e of s){for(let i=a.length-1;i>=o;i-=1){if(hx(e.value,t.scales.x)>hx(a[i].value,t.scales.x)){o=i+1;break}}a.splice(o,0,e),o+=1}if(!function(e,t){let i=-1/0;for(const n of e){const e=hx(n.value,t.scales.x);if(Number.isFinite(e)){if(e<i)return!1;i=e}}return!0}(a,t))return;const r=a.map((e=>e.axisValue));
1return{axisValues:r,oldDataAxisIndices:cx(t,r),newDataAxisIndices:cx(e,r)}}function px(e,t,i,s,a){if(a.xValue1Index===a.xValue0Index+1)return e;const o=(0,n.gUy)(e);let r,l;if("category"===t.scales.x?.type){const e=(o[1].x-o[0].x)/(a.xValue1Index-a.xValue0Index);r=o[0].x+(s-a.xValue0Index)*e,l=r+e}else{const e=i[s],n=i[s+1];r=hx(e,t.scales.x),l=hx(n,t.scales.x)}return(0,n.hKy)(e,r,l)}function gx(e,t){const[i,s]=(0,n.gUy)(e),a=hx(0,t.scales.y);return(0,n.ES1)(e,{x:i.x,y:a},{x:s.x,y:a})}function mx(e){const[t,i]=(0,n.gUy)(e);return(0,n.ru5)(e,{x:(t.x+i.x)/2,y:(t.y+i.y)/2})}function yx(e,t,i,s,a,o){let r,l;if(a.xValue0Index>=o.xValue1Index){const e=s.findLast((e=>e.xValue1Index<=o.xValue1Index))?.datumIndex,t=null==e?void 0:i.data[e];r=t?.xValue1,l=t?.yValue1}else if(a.xValue0Index<=o.xValue0Index){const e=s.find((e=>e.xValue0Index>=o.xValue0Index))?.datumIndex,t=null==e?void 0:i.data[e];r=t?.xValue0,l=t?.yValue0}if(null==r||null==l)switch(t){case 0:return gx(e,i);case 1:return mx(e)}const h={x:hx(r,i.scales.x),y:hx(l,i.scales.y)};return(0,n.ES1)(e,h,h)}function fx(e,t){if(null==t)return;const i=lx(e.xValue0),n=lx(e.xValue1);return t.find((e=>lx(e.xValue0)===i&&lx(e.xValue1)===n))?.span}function xx(e,t,i,n,s,a,o){const r=e.data[n.datumIndex],l=r.span,h=fx(r,s);if(null==h){const s=yx(l,t,e,i,n,a);o.added.push({from:s,to:l})}else o.removed.push({from:h,to:h}),o.moved.push({from:h,to:l}),o.added.push({from:l,to:l})}function bx(e,t,i,n,s,a,o){const r=e.data[n.datumIndex],l=r.span,h=fx(r,s);if(null==h){const s=yx(l,t,e,i,n,a);o.removed.push({from:l,to:s})}else o.removed.push({from:l,to:l}),o.moved.push({from:l,to:h}),o.added.push({from:h,to:h})}function vx(e,t,i,s,a){const o=s.scales.x,r=t[a.xValue0Index],l=t[a.xValue1Index];let h,c;if("continuous"===o?.type||"log"===o?.type?(h=i.data.findLast((e=>lx(e.xValue0)<=r)),c=i.data.find((e=>lx(e.xValue1)>=l))):(h=i.data.find((e=>lx(e.xValue0)===r)),c=i.data.find((e=>lx(e.xValue1)===l))),null==h||null==c)return;const[{x:d},{x:u}]=(0,n.gUy)(e),p=hx(h.xValue0,i.scales.x),g=hx(h.yValue0,i.scales.y),m=hx(c.xValue1,i.scales.x),y=hx(c.yValue1,i.scales.y);let f=s.data[a.datumIndex].span;return f=(0,n.ES1)(f,{x:p,y:g},{x:m,y}),f=(0,n.hKy)(f,d,u),f}function Sx(e,t,i,n,s,a,o,r,l){const h=s+1,c=o.find((e=>e.xValue0Index<=s&&e.xValue1Index>=h)),d=a.find((e=>e.xValue0Index<=s&&e.xValue1Index>=h)),u=t.zeroData,p=e.zeroData;if(null==c&&null!=d)return void xx(e,i,a,d,u,r,l);if(null!=c&&null==d)return void bx(t,i,o,c,p,r,l);if(null==c||null==d)return;let g;g=c.xValue0Index===d.xValue0Index&&c.xValue1Index===d.xValue1Index?0:c.xValue0Index<=d.xValue0Index&&c.xValue1Index>=d.xValue1Index?-1:c.xValue0Index>=d.xValue0Index&&c.xValue1Index<=d.xValue1Index?1:0;const m=px(t.data[c.datumIndex].span,t,n,s,c),y=px(e.data[d.datumIndex].span,e,n,s,d);if(1===g){const s=vx(m,n,t,e,d);null==s?bx(t,i,o,c,p,r,l):(l.removed.push({from:m,to:s}),l.moved.push({from:s,to:y}),l.added.push({from:y,to:y}))}else if(-1===g){const s=vx(y,n,e,t,c);null==s?xx(e,i,a,d,u,r,l):(l.removed.push({from:m,to:m}),l.moved.push({from:m,to:s}),l.added.push({from:s,to:y}))}else l.removed.push({from:m,to:m}),l.moved.push({from:m,to:y}),l.added.push({from:y,to:y})}function Mx(e,t,i){const{span:n}=t;switch(i){case 0:return fx(t,e.zeroData)??gx(n,e);case 1:return mx(n)}}function kx(e,t,i){if(!dx(e)||!dx(t))return;if(!function(e,t){const i=t.scales.x,s=e.scales.x;if("category"!==i?.type||"category"!==s?.type)return!0;if((0,n.$uD)(i)||(0,n.$uD)(s))return!0;let a=-1/0;for(const e of i.domain){const t=hx(e,s);if(Number.isFinite(t)){if(t<a)return!1;a=t}}return!0}(e,t))return;const s=ux(e,t);return null==s?function(e,t,i){const n=[],s=[];for(const e of t.data){const n=e.span,a=Mx(t,e,i);s.push({from:n,to:a})}for(const t of e.data){const s=t.span,a=Mx(e,t,i);n.push({from:a,to:s})}return{removed:s,moved:[],added:n}}(e,t,i):s.axisValues.length===s.oldDataAxisIndices.length+s.newDataAxisIndices.length+2?function(e,t){const i=[],s=[],a=[],o=Math.min(t.data.length,e.data.length);for(let n=0;n<o;n+=1){const o=t.data[n].span,r=e.data[n].span;i.push({from:o,to:o}),s.push({from:o,to:r}),a.push({from:r,to:r})}if(t.data.length>e.data.length&&e.data.length>0){const a=e.data.at(-1).span,[,r]=(0,n.gUy)(a),l=(0,n.ru5)(a,r);for(let e=o;e<t.data.length;e+=1){const n=t.data[e].span;i.push({from:n,to:n}),s.push({from:n,to:l})}}if(e.data.length>t.data.length&&t.data.length>0){const i=t.data.at(-1).span,[,r]=(0,n.gUy)(i),l=(0,n.ru5)(i,r);for(let t=o;t<e.data.length;t+=1){const i=e.data[t].span;s.push({from:l,to:i}),a.push({from:i,to:i})}}return{removed:i,moved:s,added:a}}(e,t):function(e,t,i,n){const s={removed:[],moved:[],added:[]},{axisValues:a,oldDataAxisIndices:o,newDataAxisIndices:r}=e,l={xValue0Index:Math.max(o.at(0)?.xValue0Index??-1/0,r.at(0)?.xValue0Index??-1/0),xValue1Index:Math.min(o.at(-1)?.xValue1Index??1/0,r.at(-1)?.xValue1Index??1/0)};for(let e=0;e<a.length-1;e+=1)Sx(t,i,n,a,e,r,o,l,s);return s}(s,e,t,i)}function Dx(e,t){const i=e.map((e=>e.point));let s=(0,n.DGc)(i);switch(t.type){case"linear":break;case"smooth":s=(0,n.kNJ)(i,t.tension);break;case"step":s=(0,n.kxA)(i,t.position)}return s.map((function(t,i){return{span:t,xValue0:e[i].xDatum,yValue0:e[i].yDatum,xValue1:e[i+1].xDatum,yValue1:e[i+1].yDatum}}))}function wx(e,t,i=.001){return Math.abs(e.x-t.x)<i&&Math.abs(e.y-t.y)<i}function Ix({path:e},t){let i;for(const{span:s}of t){const[t,a]=(0,n.gUy)(s);sx(e,s,null!=i&&wx(i,t)?n.Dl4.Skip:n.Dl4.MoveTo,!1),i=a}}function Ax(e,t,i){let s;for(const a of i){const[i,o]=ax(a.from,a.to,e),r=null!=s&&wx(s,i)?n.Dl4.Skip:n.Dl4.MoveTo;ox(t.path,a.from,a.to,e,r,!1),s=o}}function Cx(e,t,i,n=1){return{status:e,path:{addPhaseFn:(e,i)=>Ax(e,i,t.added),updatePhaseFn:(e,i)=>Ax(e,i,t.moved),removePhaseFn:(e,i)=>Ax(e,i,t.removed)},pathProperties:Nx(e,i,n)}}function Nx(e,t,i=1){const n="none"===t?"updated":e,s={fromFn(t,i){const s={phase:Fh[n]},a=t.previousDatum??i;return null!=a&&(s.segments=a),"removed"===e?s.finish={visible:!1}:"added"===e&&(s.start={visible:!0}),s},toFn(e,t){const i={phase:Fh[n]},s=t;return null!=s&&(i.segments=s),i}};return"fade"===t?{fromFn(t,n){const a="added"===e?0:i,o="removed"===e?t.previousDatum??n:n;return{...s.fromFn(t,n),opacity:a,segments:o}},toFn(t,n){const a="removed"===e?0:i,o="removed"===e?t.previousDatum??n:n;return{...s.toFn(t,n),opacity:a,segments:o}}}:s}function Lx(e,t,i,n){if(null!=t){const[e,i]=t;if(0!==e||1!==i)return!1}if(Rl.is(e)){const t=e.calcBandwidth(n)-e.calcBandwidth(i);if(t>0&&t<1)return!1}if(Vl.is(e)){const{bandwidth:t,step:i}=e;if(t>0&&t<1)return!1;const n=i-t;if(n>0&&n<1)return!1}return!0}var Px=e=>(0,n.cIo)(e.yValue??0);function Tx(e,t,i){const{startingX:s,startingY:a}=function(e,t){const i=t[e?n.tv$.Y:n.tv$.X];let s=1/0,a=0;if(!i)return{startingX:s,startingY:a};e?a=i.scale.convert(Rl.is(i.scale)?0:Math.max(...i.range)):s=i.scale.convert(Rl.is(i.scale)?0:Math.min(...i.range));return{startingX:s,startingY:a}}(e,t);return{isVertical:e,calculate:(t,i)=>{let n=e?t.x:s,o=e?a:t.y,r=e?t.width:0,l=e?0:t.height;const{opacity:h=1}=t;let c;return i&&(Number.isNaN(n)||Number.isNaN(o))&&(({x:n,y:o}=i),r=e?i.width:0,l=e?0:i.height,e&&!Px(i)?o+=i.height:!e&&Px(i)&&(n+=i.width)),c=null==t.clipBBox?void 0:Px(t)?e?new m(n,o-l,r,l):new m(n-r,o,r,l):new m(n,o,r,l),{x:n,y:o,width:r,height:l,clipBBox:c,opacity:h}},mode:i}}function Ox(e,t){return{isVertical:e,calculate:(t,i)=>{let n=e?t.x:t.x+t.width/2,s=e?t.y+t.height/2:t.y,a=e?t.width:0,o=e?0:t.height;return i&&(Number.isNaN(n)||Number.isNaN(s))&&(n=e?i.x:i.x+i.width/2,s=e?i.y+i.height/2:i.y,a=e?i.width:0,o=e?0:i.height),{x:n,y:s,width:a,height:o,clipBBox:t.clipBBox,opacity:t.opacity??1}},mode:t}}function Rx(e,t){const i=e=>null==e||Number.isNaN(e.x)||Number.isNaN(e.y),n={start:0,length:0},s=(e,t)=>{const i=e.crispCentreDirection;if(null==i)return t;const s="x"===i?t.x:t.y;if(!Number.isFinite(s))return t;const a="x"===i?t.width:t.height;if(!e.centreSnapApplies(a))return t;const{start:o,length:r}
1=e.alignCentre(s,a,n),{clipBBox:l}=t;return"x"===i?{...t,x:o,width:r,clipBBox:l&&new m(o,l.y,r,l.height)}:{...t,y:o,height:r,clipBBox:l&&new m(l.x,o,l.width,r)}};return{toFn:(t,n,a)=>"removed"===a&&null==t.datum&&"fade"===e.mode?{...Ex(t,n),opacity:0}:"removed"===a||i(t.unsafeDatum)?e.calculate(t.unsafeDatum,t.unsafePreviousDatum):s(t,{x:n.x,y:n.y,width:n.width,height:n.height,clipBBox:n.clipBBox,opacity:n.opacity??1}),fromFn:(n,a,o)=>{let r;"updated"===o&&i(n.unsafeDatum)?o="removed":"updated"===o&&i(n.unsafePreviousDatum)&&(o="added"),"unknown"===o||"added"===o?(r=null==n.previousDatum&&"fade"===e.mode?{...Ex(n,a),opacity:0}:e.calculate(n.unsafeDatum,n.unsafePreviousDatum),"unknown"===o&&(o=t)):r={x:n.x,y:n.y,width:n.width,height:n.height,clipBBox:n.clipBBox,opacity:n.opacity??1};const l=Fh[o];return{...s(n,r),phase:l}},applyFn:(e,t,i)=>{e.resetAnimationProperties(t.x,t.y,t.width,t.height,t.opacity??1,t.clipBBox),e.crisp="end"===i&&(e.datum?.crisp??!1)}}}function Ex(e,{x:t,y:i,width:n,height:s,clipBBox:a,opacity:o=1}){return{x:t,y:i,width:n,height:s,clipBBox:a,opacity:o,crisp:e.datum?.crisp??!1}}function zx(e){for(const t of e){const e=t.nodes();t.batchedUpdate((function(){for(const t of e){const e=t.datum;null!=e&&(t.resetAnimationProperties(e.x,e.y,e.width,e.height,e.opacity??1,e.clipBBox),t.crisp=e.crisp??!1)}t.cleanup()}))}}function Bx(e,t){if(void 0===t)return;const{x:i,y:n,width:s,height:a}=t;return Me.toCanvas(e.contentGroup,new m(i,n,s,a))}function Fx(e,t,i,n){let s;return e.canIncrementallyUpdate&&e.nodeIndex<e.nodes.length?(s=e.nodes[e.nodeIndex],n(e,s,t)):(s=i(e,t),null!=s&&e.nodes.push(s)),e.nodeIndex++,s}function Vx({path:e},{spans:t,phantomSpans:i}){let s=0,a={x:Number.NaN,y:Number.NaN},o={x:Number.NaN,y:Number.NaN};for(let r=0;r<t.length;r+=1){const{span:l}=t[r],{span:h}=i[r],{0:c,1:d}=(0,n.gUy)(l),{0:u,1:p}=(0,n.gUy)(h);if(wx(a,c)&&wx(o,u))sx(e,l,n.Dl4.Skip,!1);else{for(let t=r-1;t>=s;t-=1)sx(e,i[t].span,n.Dl4.LineTo,!0);e.closePath(),sx(e,l,n.Dl4.MoveTo,!1),s=r}a=d,o=p}for(let a=t.length-1;a>=s;a-=1)sx(e,i[a].span,n.Dl4.LineTo,!0);e.closePath()}function $x(e,{path:t},i,s){for(let a=0;a<i.length;a+=1){const o=i[a],r=s[a];ox(t,o.from,o.to,e,n.Dl4.MoveTo,!1),ox(t,r.from,r.to,e,n.Dl4.LineTo,!0),t.closePath()}}function Hx(e,t,i,n){return{status:e,path:{addPhaseFn:(e,n)=>$x(e,n,t.added,i.added),updatePhaseFn:(e,n)=>$x(e,n,t.moved,i.moved),removePhaseFn:(e,n)=>$x(e,n,t.removed,i.removed)},pathProperties:Nx(e,n)}}function jx(e,t,i,s,a,o,r){let l=o?.reduced?.diff?.[e];if(l?.changed)return l;if(!r)return{changed:!1,added:new Set,updated:new Set,removed:new Set,moved:new Set};const h=function(e,t){if(!t)return!1;const i=e.scales,s=t.scales;if(!(0,n.wo0)(i.x,s.x))return!0;if(!(0,n.wo0)(i.y,s.y))return!0;if(!Wx(e)||!Wx(t))return!1;const a=e.groupScale,o=t.groupScale;return!(0,n.wo0)(a,o)}(s,a);return null==l&&null!=o?.reduced?.diff?(l={changed:!0,added:new Set,updated:new Set,removed:new Set,moved:new Set},h?l.updated=new Set(Array.from(t,(({datum:e})=>i(e)))):l.added=new Set(Array.from(t,(({datum:e})=>i(e))))):h&&(l={changed:!0,added:new Set,updated:new Set(Array.from(t,(({datum:e})=>i(e)))),removed:new Set,moved:new Set}),l}function Wx(e){return"object"==typeof e&&null!==e&&"groupScale"in e}function _x({id:e},t,i,n,...s){$h(e,"markers",t,s,{opacity:0},{opacity:1},{...n,phase:n?.phase??(i?Fh[i]:"trailing")});for(const e of s)e.cleanup()}function Gx({id:e,nodeDataDependencies:t},i,s,...a){const o=t.seriesRectWidth;Vh(e,"markers",i,a,{fromFn:(e,t)=>{const i=t.midPoint?.x??o;let a=(0,n.qE8)(0,(0,n.DMO)(i/o),1);return Number.isNaN(a)&&(a=0),{scalingX:0,scalingY:0,delay:s?.delay??a,duration:s?.duration??.2,phase:s?.phase??"initial",start:s?.start,finish:s?.finish}},toFn:()=>({scalingX:1,scalingY:1})})}function Kx(e){return{opacity:1,scalingX:1,scalingY:1}}function Yx(e){for(const t of e){const e=t.nodes();t.batchedUpdate((function(){for(const t of e){const e=t.datum;if(null==e?.point)continue;const{x:i,y:n}=e.point;Number.isFinite(i)&&Number.isFinite(n)&&t.resetAnimationProperties(i,n,t.size,1,1,1)}t.cleanup()}))}}function Ux(e,t){return{x:t.point?.x??Number.NaN,y:t.point?.y??Number.NaN,scalingCenterX:t.point?.x??Number.NaN,scalingCenterY:t.point?.y??Number.NaN}}function Xx(e,{datumIndex:t}){const i=e.getNodeData();if(void 0===i)return;const n=i[t],{point:s}=n??{};if(null==n||null==s)return;const a=e.getFormattedMarkerStyle(n),o=Sd.anchor(a.shape),r=s.focusSize??a.size,l=4+r,h=l/2,c=(o.x-.5)*r,d=(o.y-.5)*r,u=n.point.x-h-c,p=n.point.y-h-d;return Me.toCanvas(e.contentGroup,new m(u,p,l,l))}function Zx(e,t,i,s,a,o=a,r=!1){const l=!0===t?.crossFiltering||function(e,t,i,s){return!!(s.enabled??i.enabled)&&(t.step??(0,n.DuJ)(t.range)/Math.max(1,e))>1}(i.input.count,s[n.tv$.X].scale,a,o);return e.selection.enabled&&!r?{needsNodeData:!0,hideWithSize0:!l}:{needsNodeData:l,hideWithSize0:!1}}function qx(e,t,i,n){return n??(n={stroke:t.stroke,strokeOpacity:t.strokeOpacity,strokeWidth:t.strokeWidth}),nl.reduce(((t,s)=>(t[s]=e.getMarkerStyle(i,{},void 0,{highlightState:s},void 0,n),t)),{})}function Qx(e){if(null==e)return 0;let t=0;for(const i of nl)t=Math.max(t,bd(e[i]));return t}function Jx({id:e,visible:t,nodeDataDependencies:i},n,...s){const{seriesRectWidth:a,seriesRectHeight:o}=i;$h(e,"path_properties",n,s,{clipX:0},{clipX:a},{phase:"initial",start:{clip:!0,clipY:o,visible:t},finish:{clip:!1,visible:t}})}function eb({id:e},t,i,n="add",...s){$h(e,t,i,s,{opacity:0}
1,{opacity:1},{phase:n})}function tb(e){return t=>({visible:e.getVisible(),opacity:e.getOpacity(),clipScalingX:1,clip:!1})}function ib({nodeDataDependencies:e},t){const i=e=>Number.isFinite(e)?e:0;t.clipX=i(e.seriesRectWidth),t.clipY=i(e.seriesRectHeight)}var nb={[n.tv$.Angle]:["angleKey"],[n.tv$.Radius]:["radiusKey"]},sb={[n.tv$.Angle]:["angleName"],[n.tv$.Radius]:["radiusName"]},ab=class extends sy{constructor({categoryKey:e,pickModes:t=[1,0],canHaveAxes:i=!1,animationResetFns:s,...a}){super({...a,categoryKey:e,pickModes:t,canHaveAxes:i}),this.directions=[n.tv$.Angle,n.tv$.Radius],this.itemGroup=this.contentGroup.appendChild(new ke({name:"items"})),this.nodeData=[],this.itemSelection=_h.selectNoInference(this.itemGroup,(()=>this.nodeFactory()),!1),this.labelSelection=_h.select(this.labelGroup,(()=>this.labelFactory()),!1),this.highlightSelection=_h.selectNoInference(this.highlightNodeGroup,(()=>this.nodeFactory())),this.highlightLabelSelection=_h.select(this.highlightLabelGroup,(()=>this.labelFactory())),this.centerX=0,this.centerY=0,this.radius=0,this.maxChartMarkerSize=0,this.animationResetFns=s,this.animationState=new n.Z37("empty",{empty:{update:{target:"ready",action:e=>this.animateEmptyUpdateReady(e)},reset:"empty",skip:"ready"},ready:{updateData:"waiting",clear:"clearing",highlight:e=>this.animateReadyHighlight(e),highlightMarkers:e=>this.animateReadyHighlightMarkers(e),resize:e=>this.animateReadyResize(e),reset:"empty",skip:"ready"},waiting:{update:{target:"ready",action:e=>this.animateWaitingUpdateReady(e)},reset:"empty",skip:"ready"},clearing:{update:{target:"empty",action:e=>this.animateClearingUpdateEmpty(e)},reset:"empty",skip:"ready"}},(()=>this.checkProcessedDataAnimatable())),this.cleanup.register(this.ctx.eventsHub.on("legend:item-click",(e=>this.onLegendItemClick(e))),this.ctx.eventsHub.on("legend:item-double-click",(e=>this.onLegendItemDoubleClick(e))))}getItemNodes(){return[...this.itemGroup.children()]}getNodeData(){return this.nodeData}getKeyAxis(e){return e===n.tv$.Angle?this.properties.angleKeyAxis:e===n.tv$.Radius?this.properties.radiusKeyAxis:void 0}setZIndex(e){super.setZIndex(e),this.contentGroup.zIndex=[e,n.$5h.FOREGROUND],this.highlightGroup.zIndex=[e,n.$5h.HIGHLIGHT],this.labelGroup.zIndex=[e,n.$5h.LABEL]}
1resetAnimation(e){"initial"===e?this.animationState.transition("reset"):"ready"===e&&this.animationState.transition("skip")}labelFactory(){const e=new Ue;return e.pointerEvents=1,e}getInnerRadius(){return 0}computeLabelsBBox(e,t){return null}getShapeFillBBox(){const e=this.radius;return{series:new m(-e,-e,2*e,2*e),axis:new m(-e,-e,2*e,2*e)}}resetAllAnimation(){const{item:e,label:t}=this.animationResetFns??{};this.ctx.animationManager.stopByAnimationGroupId(this.id),e&&Wh([this.itemSelection,this.highlightSelection],e),t&&Wh([this.labelSelection,this.highlightLabelSelection],t),this.itemSelection.cleanup(),this.labelSelection.cleanup(),this.highlightSelection.cleanup(),this.highlightLabelSelection.cleanup()}animateEmptyUpdateReady(e){this.ctx.animationManager.skipCurrentBatch(),this.resetAllAnimation()}animateWaitingUpdateReady(e){this.ctx.animationManager.skipCurrentBatch(),this.resetAllAnimation()}animateReadyHighlight(e){const{item:t,label:i}=this.animationResetFns??{};t&&Wh([this.highlightSelection],t),i&&Wh([this.highlightLabelSelection],i)}animateReadyHighlightMarkers(e){}animateReadyResize(e){this.resetAllAnimation()}animateClearingUpdateEmpty(e){this.ctx.animationManager.skipCurrentBatch(),this.resetAllAnimation()}computeFocusBounds(e){const t=this.getNodeData()?.[e.datumIndex];if(void 0!==t)return this.itemSelection.select((e=>e instanceof je&&e.datum===t))[0]}getSeriesRange(){return[Number.NaN,Number.NaN]}isSeriesHighlighted(e,t){if(!this.properties.highlight.enabled)return!1;const{series:i,legendItemName:n,datumIndex:s}=e??{},a="number"==typeof s?t?.[s]:void 0;return i===this||null!=a&&a===n}};function ob(e,t,i,s){if(e.logger=s,i.length<2)return;if(0===t.fills.length)return;const a=[i[0],i.at(-1)],o=t.domain??a,{domain:r,range:l}=(0,n.ZpP)(t.fills,o,t.mode);e.mode=t.mode,e.domain=r,e.range=l,e.displayDomain=o,e.update()}function rb(e,t){const{domain:i,range:s,mode:a,displayDomain:o}=e;if(0===s.length)return;const[r,l]=o?[(0,n.Roz)(o[0]),(0,n.Roz)(o[1])]:[i[0],i.at(-1)],h=l-r||1,c=[];for(let e=0;e<s.length;e++){const n=t[e]?.name;if(null==n)continue;const s=(("discrete"===a?(i[e]+i[e+1])/2:i[e])-r)/h;s<0||s>1||c.push({position:s,label:n})}return c.length>0?c:void 0}function lb(e,t,i,s,a){const{domain:o,displayDomain:r,mode:l}=e,h=r?[(0,n.Roz)(r[0]),(0,n.Roz)(r[1])]:[o[0],o.at(-1)],c=(0,n.kXN)(e);return{legendType:"gradient",enabled:s,seriesId:i,series:a,colorStops:"continuous"===l?function(e,t,i){if(0===e.length)return e;const n=e[0],s=e.at(-1);if(n.stop>=0&&s.stop<=1)return e;const a=[{stop:0,color:t}];for(const t of e)t.stop>0&&t.stop<1&&a.push(t);return a.push({stop:1,color:i}),a}(c,e.convert(h[0]),e.convert(h[1])):c,axisDomain:h,namedLabels:rb(e,t)}}function hb(e){return{formatManager:e.ctx.formatManager,formatInContext:e.callWithContext.bind(e),key:"colorKey"in e.properties?e.properties.colorKey:void 0,legendItemName:"legendItemName"in e.properties?e.properties.legendItemName:void 0,boundSeries:e.getFormatterContext("color")}}function cb(e,t,i,s,a,o="square"){const{domain:r,range:l}=e;if(0===l.length)return[];const h=function(e,t,{formatManager:i,formatInContext:n,key:s,legendItemName:a,boundSeries:o}){const{domain:r}=e;return(e,l)=>{const h={type:"number",value:e,datum:void 0,seriesId:t,legendItemName:a,key:s,source:"gradient-legend",property:"color",domain:r,boundSeries:o,fractionDigits:l,visibleDomain:void 0};return i.format(n,h)??i.defaultFormat(h)}}(e,i,a);return l.map(((e,a)=>{const c=r[a],d=r[a+1],u=t[a]?.name;return{legendType:"category",id:i,itemId:a,seriesId:i,enabled:s,symbol:{marker:{shape:o,fill:e,fillOpacity:1,stroke:void 0,strokeWidth:0,strokeOpacity:1}},label:{text:u??(0,n.SWA)(c,d,a,l.length,h)},isFixed:!0,hideToggleOtherSeries:!0,suppressHighlight:!0}}))}var db=(e=>(e[e.None=0]="None",e[e.Item=1]="Item",e[e.OtherItem=2]="OtherItem",e[e.Branch=3]="Branch",e[e.OtherBranch=4]="OtherBranch",e))(db||{});function ub(e){switch(e){case 1:return"highlighted-item";case 2:return"unhighlighted-item";case 3:return"highlighted-branch";case 4:return"unhighlighted-branch";case 0:return"none";default:return e}}var pb=(()=>{var e=class extends ml{constructor(){super(...arguments),this.childrenKey="children",this.fills=Object.values(ju),this.strokes=Object.values(Wu),this.colorScale=new G}};return d([n.mAP],e.prototype,"childrenKey",2),d([n.mAP],e.prototype,"sizeKey",2),d([n.mAP],e.prototype,"colorKey",2),d([n.mAP],e.prototype,"colorName",2),d([n.mAP],e.prototype,"fills",2),d([n.mAP],e.prototype,"strokes",2),d([n.mAP],e.prototype,"colorScale",2),e})(),gb=(()=>{var e=class e{constructor(e,t,i,n,s,a,o,r,l,h,c,d){this.series=e,this.itemId=t,this.path=i,this.datumIndex=n,this.datum=s,this.sizeValue=a,this.colorValue=o,this.sumSize=r,this.depth=l,this.parent=h,this.children=c,this.style=d,this.midPoint={x:0,y:0}}get hasChildren(){return this.children.length>0}walk(t,i=e.Walk.PreOrder){i===e.Walk.PreOrder&&t(this);for(const e of this.children)e.walk(t,i);i===e.Walk.PostOrder&&t(this)}find(e){if(e(this))return this;for(const t of this.children){const i=t.find(e);if(null!=i)return i}}*[Symbol.iterator](){yield this;for(const e of this.children)yield*e}};return e.Walk={PreOrder:0,PostOrder:1},e})(),mb=class extends Td{constructor(e){super({moduleCtx:e,pickModes:[1,0]}),this.colorDomain=[0,0],this.maxDepth=0,this.colorScale=new V,this.animationState=new n.Z37("empty",{empty:{update:{target:"ready",action:e=>this.animateEmptyUpdateReady(e)},reset:"empty",skip:"ready"},ready:{updateData:"waiting",clear:"clearing",highlight:e=>this.animateReadyHighlight(e),resize:e=>this.animateReadyResize(e),reset:"empty",skip:"ready"},waiting:{update:{target:"ready",action:e=>this.animateWaitingUpdateReady(e)},reset:"empty",skip:"ready"},clearing:{update:{target:"empty",action:e=>this.animateClearingUpdateEmpty(e)},reset:"empty",skip:"ready"}},(()=>this.checkProcessedDataAnimatable()))}
1resetAnimation(e){"initial"===e?this.animationState.transition("reset"):"ready"===e&&this.animationState.transition("skip")}processData(){this.data?.commitPendingTransactions(this.ctx.dataSelectionService);const{NodeClass:e}=this,{childrenKey:t,sizeKey:i,colorKey:s}=this.properties;let a=0,o=1/0,r=-1/0,l=-1;const h=(h,d,u)=>{const p=null==u.depth?0:u.depth+1,g=null==t?void 0:h[t],m=null==g||0===g.length;let y=null==i?void 0:h[i];y=(0,n.kuK)(y)?Math.max((0,n.Roz)(y),0):m?1:0;const f=y;a=Math.max(a,p);let x=null==s?void 0:h[s];(0,n.zZm)(x)&&(x=(0,n.Roz)(x),o=Math.min(o,x),r=Math.max(r,x)),++l;const b=this.getItemStyle({datumIndex:l,datum:h,depth:p,colorValue:x},m,!1);return c(new e(this,Xr(d.join(";")),d,l,h,y,x,f,p,u,[],b),g)},c=(e,t)=>{const{path:i}=e;if(t)for(const[n,s]of t.entries()){const t=h(s,i.concat(n),e);e.children.push(t),e.sumSize+=t.sumSize}return e},d=c(new e(this,"root",[],l,void 0,0,void 0,0,void 0,void 0,[],{}),this.data?.data),u=[o,r],p=o<r?[o,r]:[0,1];ob(this.colorScale,this.properties.colorScale,p,this.ctx.logger),this.rootNode=d,this.maxDepth=a,this.colorDomain=u}update({seriesRect:e}){this.updateSelections(),this.updateNodes();const t=this.getAnimationData();this.checkResize(e)&&this.animationState.transition("resize",t),this.animationState.transition("update",t)}resetAllAnimation(e){this.ctx.animationManager.stopByAnimationGroupId(this.id)}animateEmptyUpdateReady(e){this.ctx.animationManager.skipCurrentBatch(),this.resetAllAnimation(e)}animateWaitingUpdateReady(e){this.ctx.animationManager.skipCurrentBatch(),this.resetAllAnimation(e)}animateReadyHighlight(e){}animateReadyResize(e){this.resetAllAnimation(e)}animateClearingUpdateEmpty(e){this.ctx.animationManager.skipCurrentBatch(),this.resetAllAnimation(e)}getAnimationData(){return{}}isProcessedDataAnimatable(){return!0}checkProcessedDataAnimatable(){this.isProcessedDataAnimatable()||this.ctx.animationManager.skipCurrentBatch()}findNodeDatum(e){return this.rootNode?.find((t=>t.itemId===e))}dataCount(){return Number.NaN}getSeriesDomain(){return{domain:[Number.NaN,Number.NaN]}}getSeriesRange(){return[Number.NaN,Number.NaN]}getLegendData(e){const{colorKey:t,colorScale:i}=this.properties,n=i.fills.length>0,{id:s,ctx:{legendManager:a},visible:o}=this;if(null==t||!n)return[];const r=o&&(a?.getItemEnabled({seriesId:s})??!0);return"category"===e&&"discrete"===i.mode&&n?cb(this.colorScale,i.fills,s,r,hb(this)):"gradient"===e?[lb(this.colorScale,i.fills,s,r,this.getFormatterContext("color"))]:[]}removeMeIndexPathForIndex(e){return this.datumSelection.at(e+1)?.datum?.path??[]}removeMeIndexForIndexPath(e){const t=this.datumSelection.nodes();for(let i=0;i<t.length;i++){const{datum:s}=t[i];if(void 0!==s&&(0,n.r1i)(s.path,e))return i-1}return 0}pickFocus(e){if(!this.rootNode?.children.length)return;const t=(0,n.qE8)(0,e.datumIndex-e.datumIndexDelta,this.datumSelection.length-1),{datumIndexDelta:i,otherIndexDelta:s}=e;let a=this.removeMeIndexPathForIndex(t);const o=a.reduce(((e,t)=>e.children[t]),this.rootNode);if(s>0&&o.hasChildren)a=[...a,0];else if(s<0&&a.length>1)a=a.slice(0,-1);else if(0===s&&0!==i){const e=o.parent.children.length-1;a=a.slice(),a[a.length-1]=(0,n.qE8)(0,a.at(-1)+i,e)}const r=a.reduce(((e,t)=>e.children[t]),this.rootNode),l=this.datumSelection.at(t+1);if(null==l)return;const h=this.computeFocusBounds(l);return null!=h?{datum:r,datumIndex:this.removeMeIndexForIndexPath(a),otherIndex:r.depth,bounds:h,clipFocusBox:!0}:void 0}getDatumAriaMeta(e,t){if(e instanceof this.NodeClass)return{text:this.ctx.localeManager.t("ariaAnnounceHierarchyDatum",{level:(e.depth??-1)+1,count:e.children.length,description:t})};this.ctx.logger.error(`datum is not HierarchyNode: ${JSON.stringify(e)}`)}getCategoryValue(e){}datumIndexForCategoryValue(e){}getActiveHighlightNode(){if(!this.properties.highlight.enabled)return;const e=this.ctx.highlightManager?.getActiveHighlight();return e?.series===this?e:void 0}getHierarchyHighlightState(e,t,i){if(e)return 1;if(null==t)return 0;const n=i.path?.[0],s=t.path?.[0];return null==n||null==s?0:n===s?3:4}getHierarchyHighlightStyles(e,t){switch(e){case 1:return(0,n.HFk)(t.highlightedItem,t.highlightedBranch);case 3:return(0,n.HFk)(t.unhighlightedItem,t.highlightedBranch);case 4:return t.unhighlightedBranch;default:return}}getHighlightStateString(e,t,i,n){if(!this.properties.highlight.enabled)return ub(0);if(null==i)return ub(0);const s=this.dfsFind(i),a=this.getActiveHighlightNode();if(null==s)return ub(0);return ub(this.getHierarchyHighlightState(t??!1,a,s))}dfsFind(e){const t=[];let i=this.rootNode;for(;i&&i.datumIndex!==e;)t.push(...i.children),i=t.pop();return i}},yb=Math.PI/180,fb=e=>e*yb,xb=e=>-Math.log(Math.tan(.25*Math.PI+e*yb*.5)),bb=e=>e/yb,vb=e=>(Math.atan(Math.exp(-e))-.25*Math.PI)/(.5*yb),Sb=class e extends T{constructor(t,i){super(),this.domain=t,this.range=i,this.type="mercator",this.defaultTickCount=0,this.bounds=e.bounds(t)}
1static bounds(e){const[[t,i],[n,s]]=e,a=fb(t),o=xb(i),r=fb(n),l=xb(s);return new m(Math.min(a,r),Math.min(o,l),Math.abs(r-a),Math.abs(l-o))}static fixedScale(){return new e([[bb(0),vb(0)],[bb(1),vb(1)]],[[0,0],[1,1]])}toDomain(){}normalizeDomains(...e){let t=-1/0,i=1/0,n=-1/0,s=1/0;for(const a of e){const e=a.domain;for(const[a,o]of e)t=Math.min(a,t),i=Math.max(a,i),n=Math.min(o,n),s=Math.max(o,s)}return{domain:[[t,n],[i,s]],animatable:!0}}convert([e,t]){const[[i,n],[s,a]]=this.range,o=(s-i)/this.bounds.width,r=(a-n)/this.bounds.height;return[(fb(e)-this.bounds.x)*o+i,(xb(t)-this.bounds.y)*r+n]}invert([e,t]){const[[i,n],[s,a]]=this.range,o=(s-i)/this.bounds.width,r=(a-n)/this.bounds.height;return[bb((e-i)/o+this.bounds.x),vb((t-n)/r+this.bounds.y)]}getDomainMinMax(){return E(this.domain)}},Mb=class{constructor(e){this.minimumDelay=e?.minimumDelay??50,this.timeout=e?.timeout??100}schedule(e,t){this.cancel(),this.pending={computation:e,onComplete:t},this.minimumDelay>0?this.delayTimeoutId=setTimeout((()=>{this.delayTimeoutId=void 0,this.scheduleIdleCallback()}),this.minimumDelay):this.scheduleIdleCallback()}demand(){if(this.pending)return this.cancelScheduled(),this.execute()}cancel(){this.cancelScheduled(),this.pending=void 0}isPending(){return null!=this.pending}scheduleIdleCallback(){const e=Math.max(0,this.timeout-this.minimumDelay);"function"==typeof requestIdleCallback?this.idleCallbackId=requestIdleCallback(this.execute.bind(this),{timeout:e}):this.idleCallbackId=setTimeout((()=>this.execute()),e)}cancelScheduled(){null!=this.delayTimeoutId&&(clearTimeout(this.delayTimeoutId),this.delayTimeoutId=void 0),null!=this.idleCallbackId&&("function"==typeof cancelIdleCallback?cancelIdleCallback(this.idleCallbackId):clearTimeout(this.idleCallbackId),this.idleCallbackId=void 0)}execute(){const{pending:e}=this;if(!e)return;this.pending=void 0,this.delayTimeoutId=void 0,this.idleCallbackId=void 0;const t=e.computation();return e.onComplete(t),t}},kb=class{constructor(){this._dataLength=0,this.executor=new Mb,this.events=new n.bkB}get filters(){return this._filters}aggregate(e){if(this.executor.cancel(),e.targetRange>1&&e.computePartial){const t=e.computePartial(this._filters);if(t){const{immediate:e,computeRemaining:i}=t;return i&&this.executor.schedule(i,(e=>{this.mergeFilters(e),this.events.emit("filtersChanged",void 0)})),this._filters=e,this.events.emit("filtersChanged",void 0),e}}return this._filters=e.computeFull(this._filters),this.events.emit("filtersChanged",void 0),this._filters}ensureLevelForRange(e){const t=this._filters?.some((t=>t.maxRange>e));!t&&this.executor.isPending()&&this.executor.demand()}getFilterForRange(e){return this._filters?.find((t=>t.maxRange>e))}cancel(){this.executor.cancel()}markStale(e){const t=this._dataLength>0?e/this._dataLength:0,i=t>=2||t<=.5||0===this._dataLength;if(i)this._filters=void 0;else if(this._filters)for(const e of this._filters)e.stale=!0;this._dataLength=e,this.executor.cancel(),i&&this.events.emit("filtersChanged",void 0)}mergeFilters(e){if(!this._filters||0===e.length)return;const t=[...this._filters,...e];t.sort(((e,t)=>e.maxRange-t.maxRange)),this._filters=t}},Db=class{has(e,t){return this.processedData===e&&this.filter===t&&void 0!==this.selectedReader}set(e,t,i,n){this.processedData=e,this.filter=t,this.selectedReader=i,this.rangeReader=n}clear(){this.processedData=void 0,this.filter=void 0,this.selectedReader=void 0,this.rangeReader=void 0}};function wb(e,t,i,s,a){const o=i.getDomain(e,"xValue",a,s),r="key"===a?i.resolveKeysById(e,"xValue",s):i.resolveColumnById(e,"xValue",s,"object"),l="key"!==a&&i.resolveColumnNeedsValueOf(e,"xValue",s),[h,c]=(0,n.HBB)(t.scale.type,o);return{xValues:r,d0:h,d1:c,xNeedsValueOf:l}}var Ib=class{constructor(e){this.opts=e,this.selectionEpoch=0,this.populatedEpochs=new WeakMap,this.cache=new Db,e.aggregationManager.events.on("filtersChanged",(()=>this.populateStaleFilters()))}setActiveFilter(e,t){if(void 0===t)return void this.cache.clear();const i=t;if(this.cache.has(e,i))return;const n=this.opts.getDataModel(),s=this.opts.getXAxis();n&&s&&this.populateCache(i,n,e,s)}refresh(){this.selectionEpoch+=1;const e=this.opts.dataSelectionService?.getDataSetSelection(this.opts.series)?.getSelection();this.sparseSelection=e?(0,n.Vom)(e):void 0,this.populateStaleFilters()}populateStaleFilters(){const e=this.opts.aggregationManager.filters;if(!e||0===e.length)return void this.invalidateCache();const t=this.opts.getXAxis(),i=this.opts.getDataModel(),n=this.opts.getProcessedData();if(!t||!i||!n)return;const s=this.sparseSelection;if(void 0===s){for(const t of e)this.populatedEpochs.get(t)!==this.selectionEpoch&&(this.clearSelectedSlot(t),this.populatedEpochs.set(t,this.selectionEpoch));return}
1const a=wb(this.opts.series,t,i,n,this.opts.domainKey);for(const t of e)this.populatedEpochs.get(t)!==this.selectionEpoch&&(this.populateFilter(t,s,a),this.populatedEpochs.set(t,this.selectionEpoch))}isBucketSelected(e){return(this.cache.selectedReader??this.ensureReaders()?.selectedReader)?.(e)}getRangeReader(){return this.cache.rangeReader??this.ensureReaders()?.rangeReader}getIndexSet(e){}ensureReaders(){const e=this.opts.getXAxis(),t=this.opts.getProcessedData(),i=this.opts.getDataModel();if(!e||!t||!i)return;const[n,s]=e.scale.range,a=this.opts.aggregationManager.getFilterForRange(Math.abs(s-n));if(a)return this.cache.has(t,a)?this.cache:this.populateCache(a,i,t,e);this.cache.clear()}invalidateCache(){this.cache.clear()}},Ab=class extends Ib{clearSelectedSlot(e){const{indexData:t,maxRange:i}=e;for(let e=0;e<i;e++)t[e*n.kmN+n.OFF]=0}populateFilter(e,t,i){(0,n.S6A)(t,e.indexData,e.maxRange,i.xValues,i.d0,i.d1,i.xNeedsValueOf)}populateCache(e,t,i,s){const{xValues:a,d0:o,d1:r,xNeedsValueOf:l}=wb(this.opts.series,s,t,i,this.opts.domainKey),h=a.length,{indexData:c,maxRange:d}=e,u=this.opts.canonicalExtremaSlots;return this.cache.set(i,e,(function(e){const t=(0,n.JGt)(a,o,r,d,e,{xNeedsValueOf:l,xValuesLength:h});if(t<0||1!==c[t+n.OFF])return!1;if(void 0===u)return!0;for(let i=0;i<u.length;i++)if(c[t+u[i]]===e)return!0;return!1}),(function(e){const t=(0,n.JGt)(a,o,r,d,e,{xNeedsValueOf:l,xValuesLength:h});if(!(t<0))return[c[t+n.qbB],c[t+n.IXP]]})),this.cache}},Cb=[n.qbB,n.IXP,n.jBM,n.BNK],Nb=class extends Ib{constructor(e){super(e),this.splitOpts=e}clearSelectedSlot(e){const{positiveIndexData:t,negativeIndexData:i,maxRange:s}=e;for(let e=0;e<s;e++){const s=e*n.kmN+n.OFF;t[s]=0,i[s]=0}}populateFilter(e,t,i){const s=this.splitOpts.getDataModel(),a=this.splitOpts.getProcessedData(),o=this.splitOpts.getYColumnId(s,a),r=s.resolveColumnById(this.splitOpts.series,o,a,"mixed-numeric"),l=s.resolveColumnNeedsValueOf(this.splitOpts.series,o,a);(0,n.s5l)(t,e.positiveIndexData,e.negativeIndexData,e.maxRange,i.xValues,r,i.d0,i.d1,i.xNeedsValueOf,l)}populateCache(e,t,i,s){const{xValues:a,d0:o,d1:r,xNeedsValueOf:l}=wb(this.splitOpts.series,s,t,i,this.splitOpts.domainKey),h=this.splitOpts.getYColumnId(t,i),c=t.resolveColumnById(this.splitOpts.series,h,i,"mixed-numeric"),d=t.resolveColumnNeedsValueOf(this.splitOpts.series,h,i),u=a.length,{positiveIndexData:p,negativeIndexData:g,maxRange:m}=e,y=this.splitOpts.canonicalExtremaSlots;return this.cache.set(i,e,(function(e){const t=(0,n.JGt)(a,o,r,m,e,{xNeedsValueOf:l,xValuesLength:u});if(t<0)return!1;const i=c[e];if(null==i)return!1;const s=(d?i.valueOf():i)>=0?p:g;if(1!==s[t+n.OFF])return!1;if(void 0===y)return!0;for(let i=0;i<y.length;i++)if(s[t+y[i]]===e)return!0;return!1}),(function(e){const t=(0,n.JGt)(a,o,r,m,e,{xNeedsValueOf:l,xValuesLength:u});if(t<0)return;let i;return(0,n.Vnh)(p,t,e,Cb)?i=p:(0,n.Vnh)(g,t,e,Cb)&&(i=g),i?[i[t+n.qbB],i[t+n.IXP]]:void 0})),this.cache}},Lb=class{constructor(e){this.opts=e}isBucketSelected(e){const t=this.opts.getIndexSetMap();if(void 0===t)return;const i=t.get(e);if(void 0===i)return;const n=this.opts.dataSelectionService?.getDataSetSelection(this.opts.series)?.getSelection();if(void 0===n)return!1;for(let e=0;e<i.length;e++)if(1===n[i[e]])return!0;return!1}getRangeReader(){}getIndexSet(e){return this.opts.getIndexSetMap()?.get(e)}refresh(){}setActiveFilter(){}},Pb=(()=>{var e=class extends n.XPE{constructor(){super(...arguments),this.enabled=!0,this.border=new pt,this.wrapping="never",this.truncate=!1,this.spacing=5,this.avoidCollisions=!0,this._formatters={"component:year":void 0,"component:month":void 0,"component:day":void 0,"component:none":void 0,"long:year":void 0,"long:month":void 0,"long:day":void 0,"long:none":void 0}}formatValue(e,t,i,s){const{formatter:a,format:o}=this,{type:r,value:l,domain:h,boundSeries:c}=t,d="number"===t.type?t.fractionDigits:void 0,u="date"===t.type?t.unit:void 0;let p;if(null!=a){p=e(a,{type:r,value:l,index:i,domain:h,fractionDigits:d,unit:u,step:"date"===t.type?t.step:void 0,boundSeries:c,visibleDomain:"number"===t.type?t.visibleDomain:void 0})}if(null!=o&&null==p){const{specifier:e,dateStyle:t="long",truncateDate:i}=s??{},a=`${t}:${i??"none"}`;let h=this._formatters[a];const c=ut.mergeSpecifiers(e,o);h?.type===r&&h?.unit===u&&(0,n.DH9)(h?.mergedFormat,c)||(h={type:r,mergedFormat:c,unit:u,formatter:ut.getFormatter(r,c,u,t,{truncateDate:i})},this._formatters[a]=h),p=h.formatter?.(l,d)}return null==p||(0,n.cyL)(p)?p:String(p)}};return d([n.mAP],e.prototype,"enabled",2),d([n.mAP],e.prototype,"border",2),d([n.mAP],e.prototype,"cornerRadius",2),d([n.mAP],e.prototype,"fill",2),d([n.mAP],e.prototype,"fillOpacity",2),d([n.mAP],e.prototype,"fontStyle",2),d([n.mAP],e.prototype,"fontWeight",2),d([n.mAP],e.prototype,"fontSize",2),d([n.mAP],e.prototype,"fontFamily",2),d([n.mAP],e.prototype,"wrapping",2),d([n.mAP],e.prototype,"truncate",2),d([n.mAP],e.prototype,"spacing",2),d([n.mAP],e.prototype,"minSpacing",2),d([n.mAP],e.prototype,"color",2),d([n.mAP],e.prototype,"rotation",2),d([n.mAP],e.prototype,"avoidCollisions",2),d([n.mAP],e.prototype,"padding",2),d([n.mAP],e.prototype,"itemStyler",2),d([n.mAP],e.prototype,"formatter",2),d([n.mAP],e.prototype,"format",2),e}
1)(),Tb=class extends mc{constructor(){super(...arguments),this.defaultTickMinSpacing=20}get shape(){return this.options.shape}get innerRadiusRatio(){return this._innerRadiusRatio??this.options.innerRadiusRatio??0}set innerRadiusRatio(e){this._innerRadiusRatio=e}update(){super.update(),this.tickLineGroup.visible=this.options.tick.enabled,this.tickLabelGroup.visible=this.options.label.enabled}createAxisContext(){const e=super.createAxisContext();return e.getPolarLayout=()=>this.computePolarLayout(),e}updatePosition(){super.updatePosition();const e=Math.floor(this.translation.x),t=Math.floor(this.translation.y);this.tickLineGroup.translationX=e,this.tickLineGroup.translationY=t,this.tickLabelGroup.translationX=e,this.tickLabelGroup.translationY=t,this.tickLabelGroupSelection.each(((e,t)=>({x:t.x,y:t.y,rotationCenterX:t.rotationCenterX,rotationCenterY:t.rotationCenterY,rotation:t.rotation})))}computeLabelsBBox(e,t){return null}computeRange(){}getAxisLinePoints(){}},Ob=class extends Rf{calculateGridLine({index:e,tickId:t,translation:i},n,s,a,o){const{horizontal:r,range:l}=this,h=this.options.gridLine;if("between"!==this.options.interval?.placement)return super.calculateGridLine({index:e,tickId:t,translation:i},n,s,a,o);const c=o[n-1],d=c?i-(i-c.translation)/2:l[0],[u,p,g,m]=r?[d,Math.max(s,a),d,Math.min(s,a)]:[Math.min(s,a),d,Math.max(s,a),d],{style:y}=h,{stroke:f,strokeWidth:x=0,lineDash:b}=y[e%y.length]??{};return{tickId:t,offset:d,x1:u,y1:p,x2:g,y2:m,stroke:f,strokeWidth:x,lineDash:b}}calculateGridFills(e,t,i){return"between"!==this.options.interval?.placement?super.calculateGridFills(e,t,i):e.map(((n,s)=>this.calculateGridFill(n,s,n.index,t,i,e)))}calculateGridFill({tickId:e,translation:t},i,n,s,a,o){const{horizontal:r,range:l}=this,h=this.options.gridLine;if("between"!==this.options.interval?.placement)return super.calculateGridFill({tickId:e,translation:t},i,n,s,a,o);const c=o[i-1],d=o[i+1],u=c?t-(t-c.translation)/2:l[0],p=d?t+(d.translation-t)/2:l[1],[g,m,y,f]=r?[u,Math.max(s,a),p,Math.min(s,a)]:[Math.min(s,a),u,Math.max(s,a),p],{fill:x,fillOpacity:b}=h.style[n%h.style.length]??{};return{tickId:e,x1:g,y1:m,x2:y,y2:f,fill:x,fillOpacity:b}}calculateTickLine({isPrimary:e,tickId:t,translation:i},n,s,a,o=0){const{horizontal:r,primaryTick:l,range:h}=this,c=this.options.tick;if("between"!==this.options.interval?.placement)return super.calculateTickLine({isPrimary:e,tickId:t,translation:i},n,s,a,o);const d=e&&l?.enabled?l:c,u=-s*this.getTickSize(d),p=a[n-1],g=p?i-(i-p.translation)/2:h[0],m=-s*(o+this.getTickSpacing(d)),[y,f,x,b]=r?[g,m,g,m+u]:[m,g,m+u,g],{stroke:v,width:S}=d;return{tickId:t,offset:g,x1:y,y1:f,x2:x,y2:b,stroke:v,strokeWidth:S,lineDash:void 0}}},Rb=(()=>{var e=class extends n.UbG{constructor(e){super(),this.usesPlacedLabels=!1,this.nodeDataVersion=0,this.rangeGroup=new ke({name:"CrossLines-Range"}),this.lineGroup=new ke({name:"CrossLines-Line"}),this.labelGroup=new ke({name:"CrossLines-Label"}),this.instances=[],this.visible=!0,this.ctx=e,this.axisCtx=e.parent,this.id=`crossLines:${this.axisCtx.axisId}`,this.ctx.labelManager.registerSource(this),this.axisCtx.attachAxisOverlay(this.rangeGroup,"low"),this.axisCtx.attachAxisOverlay(this.lineGroup,"mid"),this.axisCtx.attachAxisOverlay(this.labelGroup,"high"),this.removePointerListeners=[this.ctx.eventsHub.on("series-area:contextmenu",(e=>this.onSeriesAreaContextMenu(e))),this.ctx.eventsHub.on("series-area:canvas-click",(e=>this.onSeriesAreaCanvasClick(e)))]}pickCrosslines(e){const t=[];for(const i of this.instances)i.containsPoint?.(e)&&t.push(i);return t}toParamsArray(e,t,i){const{userAxisId:n,direction:s}=this.axisCtx;for(const a of e){const{type:e,range:o,value:r}=a,l=a.id??a.internalId;t.push({type:i,axisId:n,direction:s,crossLineId:l,crossLineType:e,range:o,value:r})}return t}onSeriesAreaContextMenu(e){const t=this.pickCrosslines(e);this.toParamsArray(t,e.crossLine,"crossLineContextMenuAction")}onSeriesAreaCanvasClick(e){const t=this.pickCrosslines(e);if(t.length>0){const i=e.pendingCrossLineCallbacks,n="click"===e.type,s=this.toParamsArray(t,[],n?"crossLineClick":"crossLineDoubleClick");i.allMatchedParams.push(...s);const a={event:e.sourceEvent,type:n?"crossLineClick":"crossLineDoubleClick"},o={allMatchedParams:void 0,...s[0],...a},r=[this.axisCtx.caller,this.ctx.chartService],{listeners:l}=this.axisCtx;for(const e of t){const{internalId:t}=e,s=n?e.listeners?.click:e.listeners?.doubleClick;s&&i.crossLines.set(t,{callers:r,fn:s,params:o})}const h=this.axisCtx.userAxisId,c=n?l?.crossLineClick:l?.crossLineDoubleClick;c&&!i.axes.has(h)&&i.axes.set(h,{callers:r,fn:c,params:o}),i.chart??(i.chart={callers:r,fn:e=>this.ctx.chartService.callListener(e),params:o})}}applyOptions(e){if(!this.optionsEquivalent(e)){this.lastOptions=e,this.nodeDataVersion++;for(const e of this.instances)this.detachInstance(e);this.instances=null!=e?e.map((e=>{const t=this.ctx.crossLine;return t.set(e),this.attachInstance(t),this.initInstance(t),t})):[]}}onAxisUpdate(){const e=this.axisCtx.hasDefinedDomain()||this.axisCtx.hasVisibleSeries(),{gridPadding:t}=this.axisCtx,{width:i,height:n}=this.ctx.scene,s={x:0,y:0,width:i,height:n},a=this.axisCtx.getPolarLayout?.();for(const i of this.instances)i.gridPadding=t,i.containerBox=s,a&&i.applyPolarLayout(a),i.update(e)}onAxisLayout(){this.nodeDataVersion++;const e=this.axisCtx.getPolarLayout?.(),t=this.axisCtx.hasDefinedDomain()||this.axisCtx.hasVisibleSeries(),{reverse:i}
1=this.axisCtx;if(e){const n=-Zh(this.axisCtx.mirrored);for(const s of this.instances){const a=s;a.sideFlag=n,a.parallelFlipRotation=e.parallelFlipRotation,a.regularFlipRotation=e.regularFlipRotation,a.calculateLayout?.(t,i)}}else for(const e of this.instances)e.calculateLayout?.(t,i)}onScaleChange(){const[e,t]=this.axisCtx.range;for(const i of this.instances)i.clippedRange=[e,t]}onGridChange(){for(const e of this.instances)this.initInstance(e)}setVisible(e){e!==this.visible&&this.nodeDataVersion++,this.visible=e,this.rangeGroup.visible=e,this.lineGroup.visible=e,this.labelGroup.visible=e}getInstances(){return this.instances}getLabelObstacles(e){if(!this.visible)return;const t=[];for(const i of this.instances){if(!0!==i.reservesLabelSpace)continue;const n=i.getLabelBox?.();null!=n&&t.push({kind:"rect",category:"label",box:{x:n.x-e.x,y:n.y-e.y,width:n.width,height:n.height}})}return t.length>0?t:void 0}destroy(){this.ctx.labelManager.unregisterSource(this.id,this);for(const e of this.removePointerListeners)e();for(const e of this.instances)this.detachInstance(e);this.instances=[],this.rangeGroup.remove(),this.lineGroup.remove(),this.labelGroup.remove(),super.destroy()}attachInstance(e){this.rangeGroup.appendChild(e.rangeGroup),this.lineGroup.appendChild(e.lineGroup),this.labelGroup.appendChild(e.labelGroup)}detachInstance(e){e.rangeGroup.remove(),e.lineGroup.remove(),e.labelGroup.remove()}initInstance(e){e.scale=this.axisCtx.scale,e.gridLength=this.axisCtx.gridLength,e.gridPadding=this.axisCtx.gridPadding}optionsEquivalent(e){const t=this.lastOptions;return e===t||null!=e&&null!=t&&null==(0,n.G4M)(t,e)}};return e.className="CrossLines",e})();function Eb(e){const t=e.getModuleMap().getModule("crossLines");return t instanceof Rb?t:void 0}var zb={top:{xTranslationDirection:0,yTranslationDirection:-1},bottom:{xTranslationDirection:0,yTranslationDirection:1},left:{xTranslationDirection:-1,yTranslationDirection:0},right:{xTranslationDirection:1,yTranslationDirection:0},"top-left":{xTranslationDirection:1,yTranslationDirection:-1},"top-right":{xTranslationDirection:-1,yTranslationDirection:-1},"bottom-left":{xTranslationDirection:1,yTranslationDirection:1},"bottom-right":{xTranslationDirection:-1,yTranslationDirection:1},inside:{xTranslationDirection:0,yTranslationDirection:0},"inside-left":{xTranslationDirection:1,yTranslationDirection:0},"inside-right":{xTranslationDirection:-1,yTranslationDirection:0},"inside-top":{xTranslationDirection:0,yTranslationDirection:1},"inside-bottom":{xTranslationDirection:0,yTranslationDirection:-1},"inside-top-left":{xTranslationDirection:1,yTranslationDirection:1},"inside-bottom-left":{xTranslationDirection:1,yTranslationDirection:-1},"inside-top-right":{xTranslationDirection:-1,yTranslationDirection:1},"inside-bottom-right":{xTranslationDirection:-1,yTranslationDirection:-1}},Bb={top:{xTranslationDirection:1,yTranslationDirection:0},bottom:{xTranslationDirection:-1,yTranslationDirection:0},left:{xTranslationDirection:0,yTranslationDirection:-1},right:{xTranslationDirection:0,yTranslationDirection:1},"top-left":{xTranslationDirection:-1,yTranslationDirection:-1},"top-right":{xTranslationDirection:-1,yTranslationDirection:1},"bottom-left":{xTranslationDirection:1,yTranslationDirection:-1},"bottom-right":{xTranslationDirection:1,yTranslationDirection:1},inside:{xTranslationDirection:0,yTranslationDirection:0},"inside-left":{xTranslationDirection:0,yTranslationDirection:1},"inside-right":{xTranslationDirection:0,yTranslationDirection:-1},"inside-top":{xTranslationDirection:-1,yTranslationDirection:0},"inside-bottom":{xTranslationDirection:1,yTranslationDirection:0},"inside-top-left":{xTranslationDirection:-1,yTranslationDirection:1},"inside-bottom-left":{xTranslationDirection:1,yTranslationDirection:1},"inside-top-right":{xTranslationDirection:-1,yTranslationDirection:-1},"inside-bottom-right":{xTranslationDirection:1,yTranslationDirection:-1}};function Fb({yDirection:e,padding:t=0,position:i="top",bbox:n}){const s=e?zb:Bb,{xTranslationDirection:a,yTranslationDirection:o}=s[i];return{xTranslation:a*(t+n.width/2),yTranslation:o*(t+n.height/2)}}function Vb(e,t,i,s,a){const o=(s,a,o,r)=>{i.animate({id:`${e}_${t}_${a.id}_${s}
1`,groupId:e,from:o?1:0,to:1,ease:n.vTE,collapsable:o,onUpdate(e,t){t&&"removed"!==s||(a.path.clear(!0),r(e,a),a.checkPathDirty())},onStop(){"added"===s&&(a.path.clear(!0),r(1,a),a.checkPathDirty())},phase:Fh[s]})},r=new je,l=e=>(r.resetPathDirty(),e(0,r),r.resetPathDirty(),e(1,r),r.checkPathDirty(),r.isPathDirty()),{addPhaseFn:h,updatePhaseFn:c,removePhaseFn:d}=a;for(const e of s)i.isSkipped()||(o("removed",e,!l(d),d),o("updated",e,!l(c),c)),o("added",e,!l(h),h)}var $b=(()=>{var e=class extends n.zey{constructor(){super(...arguments),this.enabled=!0,this.color="rgba(0, 0, 0, 0.5)",this.xOffset=0,this.yOffset=0,this.blur=5}};return d([n.mAP,(0,n.k8u)()],e.prototype,"enabled",2),d([n.mAP,(0,n.k8u)()],e.prototype,"color",2),d([n.mAP,(0,n.k8u)()],e.prototype,"xOffset",2),d([n.mAP,(0,n.k8u)()],e.prototype,"yOffset",2),d([n.mAP,(0,n.k8u)()],e.prototype,"blur",2),e})(),Hb=class extends je{constructor(e=""){super(),this._d="",this.d=e}get d(){return this._d}set d(e){e!==this._d&&(this._d=e,this.path.clear(),this.path.appendSvg(e),this.checkPathDirty())}},jb=(()=>class extends(be(Hb)){isPointInPath(e,t){return super.isPointInPath(e-this.translationX,t-this.translationY)}})(),Wb=(()=>class extends(fe(jb)){})(),_b=class e extends Dc{static is(t){return t instanceof e}setSourceScale(e){this._sourceScale=e;const t=t=>{Object.defineProperty(this,t,{get:()=>e[t],set:i=>{e[t]=i},configurable:!0})};t("domain"),t("range"),t("paddingInner"),t("paddingOuter"),t("round");const i=t=>{Object.defineProperty(this,t,{get:()=>e[t],configurable:!0})};i("bandwidth"),i("step"),i("inset"),i("rawBandwidth")}get bands(){return this._sourceScale?.bands??super.bands}refresh(){this._sourceScale?.refresh?.()}ordinalRange(e){return this._sourceScale?this._sourceScale.ordinalRange(e):super.ordinalRange(e)}convert(e,t){this.refresh();const i=this.findIndex(e,t?.alignment);return null==i||i<0||i>=this.bands.length?Number.NaN:this.ordinalRange(i)}findIndex(e,t=n.w8L.Leading){if(null==e)return;const{bands:i,reversed:s}=this,a=i.length;if(0===a)return;if(1===a)return 0;const o=i[0],r=i[a-1];if(null==o||null==r)return this._sourceScale?.findIndex(e,t);const l=e.valueOf(),h=o.valueOf(),c=(l-h)/(r.valueOf()-h),d=s?(1-c)*(a-1):c*(a-1);return t===n.w8L.Leading?Math.max(0,Math.min(a-1,Math.floor(d))):Math.max(0,Math.min(a-1,Math.ceil(d)))}},Gb=class e{constructor(e,t,i,n){this.startAngle=e,this.endAngle=t,this.innerRadius=i,this.outerRadius=n}clone(){const{startAngle:t,endAngle:i,innerRadius:n,outerRadius:s}=this;return new e(t,i,n,s)}equals(e){return this.startAngle===e.startAngle&&this.endAngle===e.endAngle&&this.innerRadius===e.innerRadius&&this.outerRadius===e.outerRadius}[p](t,i){return new e(this.startAngle*(1-i)+t.startAngle*i,this.endAngle*(1-i)+t.endAngle*i,this.innerRadius*(1-i)+t.innerRadius*i,this.outerRadius*(1-i)+t.outerRadius*i)}},Kb=(()=>{var e=class extends P{constructor(e){super(),this.sourceImage=e,this.x=0,this.y=0,this.width=0,this.height=0,this.opacity=1}render(e){const{ctx:t}=e,i=this.sourceImage;i&&(t.globalAlpha=this.opacity,t.drawImage(i,0,0,i.width,i.height,this.x,this.y,this.width,this.height)),super.render(e)}};return d([(0,n.k8u)()],e.prototype,"x",2),d([(0,n.k8u)()],e.prototype,"y",2),d([(0,n.k8u)()],e.prototype,"width",2),d([(0,n.k8u)()],e.prototype,"height",2),d([(0,n.k8u)()],e.prototype,"opacity",2),e})(),Yb=(()=>{var e=class extends je{constructor(){super(...arguments),this.centerX=0,this.centerY=0,this.radius=10,this.startAngle=0,this.endAngle=2*Math.PI,this.counterClockwise=!1,this.type=0}get fullPie(){return(0,n.YXt)((0,n.YcT)(this.startAngle),(0,n.YcT)(this.endAngle))}updatePath(){const e=this.path;e.clear(),e.arc(this.centerX,this.centerY,this.radius,this.startAngle,this.endAngle,this.counterClockwise),1===this.type?e.closePath():2!==this.type||this.fullPie||(e.lineTo(this.centerX,this.centerY),e.closePath())}computeBBox(){return new m(this.centerX-this.radius,this.centerY-this.radius,2*this.radius,2*this.radius)}isPointInPath(e,t){const i=this.getBBox();return 0!==this.type&&i.containsPoint(e,t)&&this.path.isPointInPath(e,t)}};return e.className="Arc",d([(0,n.k8u)()],e.prototype,"centerX",2),d([(0,n.k8u)()],e.prototype,"centerY",2),d([(0,n.k8u)()],e.prototype,"radius",2),d([(0,n.k8u)()],e.prototype,"startAngle",2),d([(0,n.k8u)()],e.prototype,"endAngle",2),d([(0,n.k8u)()],e.prototype,"counterClockwise",2),d([(0,n.k8u)()],e.prototype,"type",2),e})();function Ub(e,t,i){const n=Math.hypot(e,t),s=Math.atan2(t,e)+i;return{x:Math.cos(s)*n,y:Math.sin(s)*n}}var Xb=(()=>{var e=class extends je{constructor(){super(...arguments),this.isBeveled=!0,this.columnWidth=0,this.startAngle=0,this.endAngle=0,this.outerRadius=0,this.innerRadius=0,this.axisInnerRadius=0,this.axisOuterRadius=0}set cornerRadius(e){}computeBBox(){const{columnWidth:e}=this,[t,i]=this.normalizeRadii(this.innerRadius,this.outerRadius),n=this.getRotation(),s=-e/2,a=e/2,o=-i,r=-t;let l=1/0,h=1/0,c=-1/0,d=-1/0;for(let e=0;e<4;e+=1){const{x:t,y:i}=Ub(e%2==0?s:a,e<2?o:r,n);l=Math.min(t,l),h=Math.min(i,h),c=Math.max(t,c),d=Math.max(i,d)}return new m(l,h,c-l,d-h)}getRotation(){const{startAngle:e,endAngle:t}=this,i=(0,n.s57)(e,t);return(0,n.YcT)(e+i/2+Math.PI/2)}normalizeRadii(e,t){return e>t?[t,e]:[e,t]}updatePath(){const{isBeveled:e}=this;e?this.updateBeveledPath():this.updateRectangularPath(),this.checkPathDirty()}updateRectangularPath(){const{columnWidth:e,path:t}=this,[i,n]=this.normalizeRadii(this.innerRadius,this.outerRadius),s=-e/2,a=e/2,o=-n,r=-i,l=this.getRotation(),h=[[s,r],[s,o],[a,o],[a,r]].map((([e,t])=>Ub(e,t,l)));t.clear(!0),t.moveTo(h[0].x,h[0].y),t.lineTo(h[1].x,h[1].y),t.lineTo(h[2].x,h[2].y),t.lineTo(h[3].x,h[3].y),t.closePath()}calculateCircleIntersection(e,t){const i=e*e;if(t<i)return null;const n=-Math.sqrt(t-i);return{y:n,angle:Math.atan2(n,e)}}calculateBothIntersections(e,t,i){const n=i*i,s=this.calculateCircleIntersection(e,n),a=this.calculateCircleIntersection(t,n);return s&&a?{left:s,right:a}:null}calculateAxisOuterIntersections(e,t,i){const n=i*i,s=this.calculateCircleIntersection(e,n),a=this.calculateCircleIntersection(t,n);return s&&a?{left:s,right:a,radiusSquared:n}:null}moveToRotated(e,t,i){const n=Ub(e,t,i);this.path.moveTo(n.x,n.y)}lineToRotated(e,t,i){const n=Ub(e,t,i);this.path.lineTo(n.x,n.y)}renderTopWithCornerClipping(e,t,i){const{path:n}=this,{right:s,top:a,rotation:o}=i,r=a*a,l=t.radiusSquared-r;if(l<=0)this.lineToRotated(s,t.right.y,o),n.arc(0,0,e,o+t.right.angle,o+t.left.angle,!0);else{const i=Math.sqrt(l),r=Math.atan2(a,i),h=Math.atan2(a,-i);this.lineToRotated(s,t.right.y,o),n.arc(0,0,e,o+t.right.angle,o+r,!0),this.lineToRotated(-i,a,o),n.arc(0,0,e,o+h,o+t.left.angle,!0)}}updateBeveledPath(){const{columnWidth:e,path:t,axisInnerRadius:i,axisOuterRadius:s}=this,[a,o]=this.normalizeRadii(this.innerRadius,this.outerRadius),r=-e/2,l=e/2,h=-o,c=-a,d=this.getRotation(),u=(0,n.YXt)(a,i),p=(0,n.YXt)(o,s),g=Math.hypot(r,h)>s||Math.hypot(l,h)>s;if(!u&&!p&&!g)return void this.updateRectangularPath();const m=u?this.calculateBothIntersections(r,l,a):null,y=p?this.calculateBothIntersections(r,l,o):null,f=g?this.calculateAxisOuterIntersections(r,l,s):null;if(u&&!m||p&&!y||g&&!f)return void this.updateRectangularPath();t.clear(!0);const x={left:r,right:l,top:h,bottom:c,rotation:d};m?this.moveToRotated(r,m.left.y,d):this.moveToRotated(r,c,d),m?t.arc(0,0,a,d+m.left.angle,d+m.right.angle,!1):this.lineToRotated(l,c,d),y?(this.lineToRotated(l,y.right.y,d),t.arc(0,0,o,d+y.right.angle,d+y.left.angle,!0)):f?this.renderTopWithCornerClipping(s,f,x):(this.lineToRotated(l,h,d),this.lineToRotated(r,h,d)),t.closePath()}};return e.className="RadialColumnShape",d([(0,n.k8u)()],e.prototype,"isBeveled",2),d([(0,n.k8u)()],e.prototype,"columnWidth",2),d([(0,n.k8u)()],e.prototype,"startAngle",2),d([(0,n.k8u)()],e.prototype,"endAngle",2),d([(0,n.k8u)()],e.prototype,"outerRadius",2),d([(0,n.k8u)()],e.prototype,"innerRadius",2),d([(0,n.k8u)()],e.prototype,"axisInnerRadius",2),d([(0,n.k8u)()],e.prototype,"axisOuterRadius",2),e})();function Zb(e,t,i,s,a){const o=(0,n.s57)(e,t),r=o*(1-s)/2;if(e+=r,t-=r,o<.001)return 2*i*a;if(o>=2*Math.PI){const i=e+o/2;e=i-Math.PI,t=i+Math.PI}const l=i*Math.cos(e),h=i*Math.sin(e),c=i*Math.cos(t),d=i*Math.sin(t),u=Math.floor(Math.hypot(l-c,h-d)),p=2*i*a;return Math.max(1,Math.min(p,u))}var qb=class{constructor(e,t,i,n,s){this.cx=e,this.cy=t,this.r=i,this.a0=n,this.a1=s,this.a0>=this.a1&&(this.a0=Number.NaN,this.a1=Number.NaN)}isValid(){return Number.isFinite(this.a0)&&Number.isFinite(this.a1)}pointAt(e){return{x:this.cx+this.r*Math.cos(e),y:this.cy+this.r*Math.sin(e)}}clipStart(e){null==e||!this.isValid()||e<this.a0||(this.a0=e,(Number.isNaN(e)||this.a0>=this.a1)&&(this.a0=Number.NaN,this.a1=Number.NaN))}clipEnd(e){null==e||!this.isValid()||e>this.a1||(this.a1=e,(Number.isNaN(e)||this.a0>=this.a1)&&(this.a0=Number.NaN,this.a1=Number.NaN))}},Qb=(()=>{var e=class extends je{constructor(){super(...arguments),this.centerX=0,this.centerY=0,this.innerRadius=10,this.outerRadius=20,this.startAngle=0,this.endAngle=2*Math.PI,this.clipSector=void 0,this.concentricEdgeInset=0,this.radialEdgeInset=0,this.startOuterCornerRadius=0,this.endOuterCornerRadius=0,this.startInnerCornerRadius=0,this.endInnerCornerRadius=0}serialize(){return{type:"sector",props:this.serializeProps(),svgPath:this.serializeSvgPath()}}serializeProps(){return{...super.serializeProps(),startAngle:this.startAngle,endAngle:this.endAngle,innerRadius:this.innerRadius,outerRadius:this.outerRadius}}set inset(e){this.concentricEdgeInset=e,this.radialEdgeInset=e}set cornerRadius(e){this.startOuterCornerRadius=e,this.endOuterCornerRadius=e,this.startInnerCornerRadius=e,this.endInnerCornerRadius=e}computeBBox(){return vy(this).translate(this.centerX,this.centerY)}normalizedRadii(){const{concentricEdgeInset:e}=this;let{innerRadius:t,outerRadius:i}=this;return t=t>0?t+e:0,i=Math.max(i-e,0),{innerRadius:t,outerRadius:i}}normalizedClipSector(){const{clipSector:e}=this;if(null==e)return;const{startAngle:t,endAngle:i}=Ny(this.startAngle,this.endAngle),{innerRadius:n,outerRadius:s}=this.normalizedRadii(),a=Ny(e.startAngle,e.endAngle,t);return new Gb(Math.max(t,a.startAngle),Math.min(i,a.endAngle),Math.max(n,e.innerRadius),Math.min(s,e.outerRadius))}getAngleOffset(e){return e>0?this.radialEdgeInset/e:0}arc(e,t,i,n,s,a,o,r){if(e<=0)return;const{startAngle:l,endAngle:h}=Ny(this.startAngle,this.endAngle),{innerRadius:c,outerRadius:d}=this.normalizedRadii(),u=this.normalizedClipSector();if(r&&c<=0)return;const p=r?this.getAngleOffset(c+e):this.getAngleOffset(d-e),g=o?l+p+t:h-p-t,m=r?c+e:d-e,y=m*Math.cos(g),f=m*Math.sin(g);if(null!=u){const e=1e-6;if(!(o||g>=l-e&&g<=u.endAngle-e))return;if(o&&!(g>=u.startAngle+e&&g<=h-e))return;if(r&&m<u.innerRadius-e)return;if(!r&&m>u.outerRadius+e)return}const x=new qb(y,f,e,i,n);if(null!=u){let t,h;if(r?(x.clipStart(Ly(y,f,e,i,n,u.endAngle)),x.clipEnd(Ly(y,f,e,i,n,u.startAngle))):(x.clipStart(Ly(y,f,e,i,n,u.startAngle)),x.clipEnd(Ly(y,f,e,i,n,u.endAngle))),o?(t=Py(y,f,e,i,n,u.innerRadius),h=Py(y,f,e,i,n,u.outerRadius)):(t=Py(y,f,e,i,n,u.outerRadius),h=Py(y,f,e,i,n,u.innerRadius)),x.clipStart(t),x.clipEnd(h),null!=t){const{x:e,y:i}=x.pointAt(t),n=Cy(Math.atan2(i,e),l);o?a?.clipStart(n):s.clipEnd(n)}if(null!=h){const{x:e,y:t}=x.pointAt(h),i=Cy(Math.atan2(t,e),l);o?s.clipStart(i):a?.clipEnd(i)}}if(null!=u){const{x:e,y:t}=x.pointAt((x.a0+x.a1)/2);if(!ky(e,t,u))return}const{x:b,y:v}=x.pointAt(o===r?x.a0:x.a1),S=Cy(Math.atan2(v,b),l),M=r?a:s;return o?M?.clipStart(S):M?.clipEnd(S),x}updatePath(){const e=1e-6,{path:t,centerX:i,centerY:n,concentricEdgeInset:s,radialEdgeInset:a}=this;let{startOuterCornerRadius:o,endOuterCornerRadius:r,startInnerCornerRadius:l,endInnerCornerRadius:h}=this;const{startAngle:c,endAngle:d}=Ny(this.startAngle,this.endAngle),{innerRadius:u,outerRadius:p}=this.normalizedRadii(),g=this.normalizedClipSector(),m=d-c,y=m>=2*Math.PI-e;t.clear();const f=this.getAngleOffset(u),x=m-2*f,b=p-u,v=u>0&&x>0?2*u*Math.sin(x/2):0,S=p>0&&x>0?2*p*Math.sin(x/2):0;o=Math.floor(Math.max(0,Math.min(o,S/2,b/2))),r=Math.floor(Math.max(0,Math.min(r,S/2,b/2))),l=Math.floor(Math.max(0,Math.min(l,v/2,b/2))),h=Math.floor(Math.max(0,Math.min(h,v/2,b/2)));if(0===u&&0===p||u>p||v<0||S<=0)return;if((g?.startAngle??c)===(g?.endAngle??d))return;if(y&&null==this.clipSector&&0===o&&0===r&&0===l&&0===h)return t.moveTo(i+p*Math.cos(c),n+p*Math.sin(c)),t.arc(i,n,p,c,d),u>s&&(t.moveTo(i+u*Math.cos(d),n+u*Math.sin(d)),t.arc(i,n,u,d,c,!0)),void t.closePath();if(null==this.clipSector&&Math.abs(u-p)<1e-6)return t.arc(i,n,p,c,d,!1),t.arc(i,n,p,d,c,!0),void t.closePath();const M=this.getAngleOffset(p);if(m<2*M)return;const k=(g?.innerRadius??u)>s,D=u<s||m<2*f,w=Math.max(o,l,r,h),I=w>0?Math.min(b/w,1):1;o*=I,r*=I,l*=I,h*=I;const A=Iy(p,m-2*M,-o,-r);if(o*=A,r*=A,!D&&k){const e=Iy(u,m-2*f,l,h);l*=e,h*=e}else l=0,h=0;const C=Math.max(o+l,r+h),N=C>0?Math.min(b/C,1):1;o*=N,r*=N,l*=N,h*=N;let L=0,P=0;const T=o/(p-o),O=r/(p-r);if(T>=0&&T<.999999)L=Math.asin(T);else{L=m/2;const e=p/(1/Math.sin(L)+1);o=Math.min(e,o)}if(O>=0&&O<.999999)P=Math.asin(O);else{P=m/2;const e=p/(1/Math.sin(P)+1);r=Math.min(e,r)}const R=Math.asin(l/(u+l)),E=Math.asin(h/(u+h)),z=g?.outerRadius??p,B=this.getAngleOffset(z),F=new qb(0,0,z,c+B,d-B),V=g?.innerRadius??u,$=this.getAngleOffset(V),H=k?new qb(0,0,V,c+$,d-$):void 0;null!=g&&(F.clipStart(g.startAngle),F.clipEnd(g.endAngle),H?.clipStart(g.startAngle),H?.clipEnd(g.endAngle));const j=this.arc(o,L,c-.5*Math.PI,c+L,F,H,!0,!1),W=this.arc(r,P,d-P,d+.5*Math.PI,F,H,!1,!1),_=this.arc(h,E,d+.5*Math.PI,d+Math.PI-E,F,H,!1,!0),G=this.arc(l,R,c+Math.PI+R,c+1.5*Math.PI,F,H,!0,!0);if(D&&k);else if(D){const e=m<.5*Math.PI?a*(1+Math.cos(m))/Math.sin(m):Number.NaN;let s;s=e>0&&e<p?Math.max(Math.hypot(a,e),u):a,s=Math.max(s,u);const o=c+.5*m;t.moveTo(i+s*Math.cos(o),n+s*Math.sin(o))}else if(!0===G?.isValid()||!0===H?.isValid());else{const e=c+m/2,s=u*Math.cos(e),a=u*Math.sin(e);t.moveTo(i+s,n+a)}if(!0===j?.isValid()){const{cx:e,cy:s,r:a,a0:o,a1:r}=j;t.arc(i+e,n+s,a,o,r)}if(F.isValid()){const{r:e,a0:s,a1:a}=F;t.arc(i,n,e,s,a)}if(!0===W?.isValid()){const{cx:e,cy:s,r:a,a0:o,a1:r}=W;t.arc(i+e,n+s,a,o,r)}
1if(!D){if(!0===_?.isValid()){const{cx:e,cy:s,r:a,a0:o,a1:r}=_;t.arc(i+e,n+s,a,o,r)}if(!0===H?.isValid()){const{r:e,a0:s,a1:a}=H;t.arc(i,n,e,a,s,!0)}if(!0===G?.isValid()){const{cx:e,cy:s,r:a,a0:o,a1:r}=G;t.arc(i+e,n+s,a,o,r)}}t.closePath()}isPointInPath(e,t){const{startAngle:i,endAngle:n,innerRadius:s,outerRadius:a}=this.clipSector??this;return ky(e-this.centerX,t-this.centerY,{startAngle:i,endAngle:n,innerRadius:Math.min(s,a),outerRadius:Math.max(s,a)})}};return e.className="Sector",d([(0,n.k8u)()],e.prototype,"centerX",2),d([(0,n.k8u)()],e.prototype,"centerY",2),d([(0,n.k8u)()],e.prototype,"innerRadius",2),d([(0,n.k8u)()],e.prototype,"outerRadius",2),d([(0,n.k8u)()],e.prototype,"startAngle",2),d([(0,n.k8u)()],e.prototype,"endAngle",2),d([(0,n.Tou)({equals:(e,t)=>e.equals(t)})],e.prototype,"clipSector",2),d([(0,n.k8u)()],e.prototype,"concentricEdgeInset",2),d([(0,n.k8u)()],e.prototype,"radialEdgeInset",2),d([(0,n.k8u)()],e.prototype,"startOuterCornerRadius",2),d([(0,n.k8u)()],e.prototype,"endOuterCornerRadius",2),d([(0,n.k8u)()],e.prototype,"startInnerCornerRadius",2),d([(0,n.k8u)()],e.prototype,"endInnerCornerRadius",2),e})(),Jb=class extends wi{constructor(){super((0,n.na4)("div"),"menuitem")}},ev=class extends wi{constructor(){super((0,n.na4)("div"),"menuitemradio")}setChecked(e){(0,n.Bqc)(this.elem,"aria-checked",e)}},tv=class e extends Ci{constructor(e="vertical"){super(e,"menu"),this.handleMouseEnter=(e,t)=>{t.hasPopup()||this.expandSubMenu(e,void 0)},this.handleMouseMove=(e,t)=>{t.focus({preventScroll:!0})}}destructor(){this.collapse({mode:"2"})}addSeparator(){const e=this.elem.ownerDocument.createElement("div");return(0,n.Bqc)(e,"role","separator"),this.elem.appendChild(e),e}toggleChildEnabledByIndex(e,t){this.children.at(e)?.setEnabled(t)}onChildAdded(e){super.onChildAdded(e),e.addListener("mouseenter",this.handleMouseEnter),e.addListener("mousemove",this.handleMouseMove)}onChildRemoved(e){super.onChildRemoved(e),e.removeListener("mouseenter",this.handleMouseEnter),e.removeListener("mousemove",this.handleMouseMove)}addSubMenu(){const t=new Jb,i=new e(this.orientation);i.id=(0,n.wWH)();const s=()=>{this.collapseExpandedSubMenu(i),t.expandControlled()};return t.setControlled(i),t.setAriaHasPopup("menu"),t.addListener("click",s),t.addListener("mouseenter",s),t.addListener("keydown",(e=>{const s=(0,n._gn)(this.elem)?"ArrowLeft":"ArrowRight";(0,n.yFN)(e.sourceEvent)&&e.sourceEvent.code===s&&(this.collapseExpandedSubMenu(i),t.expandControlled())})),this.addChild(t),{subMenuButton:t,subMenu:i}}expandSubMenu(e,t){const{expansionScope:i}=this;i&&(this.collapseExpandedSubMenu(t),t?.expand(e))}collapseExpandedSubMenu(e){const{expansionScope:t}=this;t&&(t.expandedSubMenu?.collapse({mode:"4"}),t.expandedSubMenu=e)}getCloseKeys(){return(0,n._gn)(this.elem)?["Escape","ArrowRight"]:["Escape","ArrowLeft"]}expand(e){if(null!=this.expansionScope)return;this.expansionScope={lastFocus:(0,n.DTD)(e.sourceEvent),expandedSubMenu:void 0,abort:()=>this.collapse({mode:"1"}),close:()=>this.collapse({mode:"0"}),removers:new n._uV};const t=this.expansionScope,i=this.children.map((e=>e.getElement()));(0,n.Bqc)(t.lastFocus,"aria-expanded",!0),t.removers.register((0,n.FQL)(this.elem,t.abort),(0,n.Jc$)(this.elem,t.abort),...this.children.map((e=>(0,n.LLE)(e.getElement(),t.close,(()=>this.getCloseKeys())))),e?.overrideFocusVisible&&(0,n.yB$)(this.elem,i,e.overrideFocusVisible)),this.internalListener?.dispatch("expand-widget",this,{type:"expand-widget"}),this.children[0]?.focus({preventScroll:!0})}collapse(e){const{mode:t="0"}=e??{};if(void 0===this.expansionScope)return;const{lastFocus:i,removers:s,expandedSubMenu:a}=this.expansionScope;this.expansionScope=void 0,a?.collapse({mode:"3"}),(0,n.Bqc)(i,"aria-expanded",!1),"0"===t&&i?.focus({preventScroll:!0}),s.flush(),this.internalListener?.dispatch("collapse-widget",this,{type:"collapse-widget",mode:t})}},iv="canvas-overlay",nv=class extends n.UbG{constructor(e,t,i){super(),this.ctx=e,this.hideFns=[],this.setOwnedWidget=(()=>{let e;return t=>{e?.destroy(),e=t}})(),this.moduleId=`popover-${t}`,this.element=i?.detached?(0,n.na4)("div"):e.domManager.addChild(iv,this.moduleId),this.element.setAttribute("role","presentation"),this.hideFns.push((()=>this.setOwnedWidget(void 0))),this.cleanup.register((()=>e.domManager.removeChild(iv,this.moduleId)))}attachTo(e){this.element.parentElement||e.element.append(this.element)}hide(e){const{lastFocus:t=this.lastFocus}=e??{};if(0!==this.element.children.length){for(const e of this.hideFns)e();t?.focus(),this.lastFocus=void 0}}removeChildren(){this.element.replaceChildren()}initPopoverElement(e,t){if(!this.element.parentElement)throw new Error("Can not show popover that has not been attached to a parent.");return e??(e=(0,n.na4)("div","ag-charts-popover")),e.classList.toggle("ag-charts-popover",!0),null!=t.ariaLabel&&e.setAttribute("aria-label",t.ariaLabel),null!=t.class&&e.classList.add(t.class),null!=t.minWidth&&(e.style.minWidth=`${t.minWidth}px`),this.element.replaceChildren(e),e}showWidget(e,t,i){this.setOwnedWidget(t),this.initPopoverElement(t.getElement(),i),t.addListener("collapse-widget",(()=>{this.hide(),e.setControlled(void 0),this.setOwnedWidget(void 0)})),e.setControlled(t),e.expandControlled(),i.onHide&&this.hideFns.push(i.onHide)}showWithChildren(e,t){const i=this.initPopoverElement(void 0,t);
1if(i.replaceChildren(...e),this.hideFns.push((()=>this.removeChildren())),t.onHide&&this.hideFns.push(t.onHide),t.initialFocus&&t.sourceEvent){const e=(0,n.DTD)(t.sourceEvent);void 0!==e&&(this.lastFocus=e,this.initialFocus=t.initialFocus)}return i}getPopoverElement(){return this.element.firstElementChild}updatePosition(e){const t=this.getPopoverElement();t&&(t.style.setProperty("right","unset"),t.style.setProperty("bottom","unset"),null!=e.x&&t.style.setProperty("left",`${e.x}px`),null!=e.y&&t.style.setProperty("top",`${e.y}px`),this.initialFocus?.focus(),this.initialFocus=void 0)}},sv=class extends nv{setAnchor(e,t){this.anchor=e,this.fallbackAnchor=t,this.updatePosition(e),this.repositionWithinBounds()}updateAnchor(e){const t=e.anchor??this.anchor,i=e.fallbackAnchor??this.fallbackAnchor;t&&this.setAnchor(t,i)}showWidget(e,t,i){super.showWidget(e,t,i),this.updateAfterShow(i)}showWithChildren(e,t){const i=super.showWithChildren(e,t);return this.updateAfterShow(t),i}repositionWithinBounds(){const{anchor:e,ctx:t,fallbackAnchor:i}=this,s=this.getPopoverElement();if(!e||!s)return;const a=t.domManager.getBoundingClientRect(),{offsetWidth:o,offsetHeight:r}=s,{isRtl:l}=t.domManager,h=l?e.x-o:e.x;let c=(0,n.qE8)(0,h,a.width-o),d=(0,n.qE8)(0,e.y,a.height-r);if(c!==h&&null!=i?.x){const e=l?i.x:i.x-o;c=(0,n.qE8)(0,e,a.width-o)}d!==e.y&&null!=i?.y&&(d=(0,n.qE8)(0,i.y-r,a.height-r)),this.updatePosition({x:c,y:d})}updateAfterShow(e){this.updateAnchor(e),this.ctx.agDocument.requestAnimationFrame((()=>{this.repositionWithinBounds()}))}},av=class extends sv{show(e,t){const i=new tv("vertical");for(const e of t.items)i.addChild(this.createRow(t,e,i));i.addClass("ag-charts-menu"),this.showWidget(e,i,t)}allocRow(e,t){if(null==e.menuItemRole||"menuitem"===e.menuItemRole)return new Jb;{e.menuItemRole;const i=new ev;return i.setChecked(e.value===t.value),i}}createRow(e,t,i){const s=t.value===e.value,a=this.allocRow(e,t);if(null!=t.enabled&&a.setEnabled(t.enabled),a.addClass("ag-charts-menu__row"),a.toggleClass("ag-charts-menu__row--active",s),"string"==typeof t.value&&(a.getElement().dataset.popoverId=t.value),null!=t.icon){const e=(0,n.na4)("span",`ag-charts-menu__icon ${(0,n.YE8)(t.icon)}`);a.getElement().appendChild(e)}const o=null!=t.strokeWidth;if(o&&(a.toggleClass("ag-charts-menu__row--stroke-width-visible",o),a.setCSSVariable("--strokeWidth",o?`${t.strokeWidth}px`:null)),null!=t.label){const e=(0,n.na4)("span","ag-charts-menu__label");e.textContent=this.ctx.localeManager.t(t.label),a.getElement().appendChild(e)}return"altText"in t&&a.setAriaLabel(this.ctx.localeManager.t(t.altText)),a.addListener("click",(({sourceEvent:n})=>{e.onPress?.(t),n.preventDefault(),i.collapse()})),a}},ov=class extends nv{constructor(){super(...arguments),this.dragged=!1}setDragHandle(e){e.addListener("drag-start",(t=>{e.addClass(this.dragHandleDraggingClass),this.onDragStart(t)})),e.addListener("drag-move",this.onDragMove.bind(this)),e.addListener("drag-end",(()=>{e.removeClass(this.dragHandleDraggingClass),this.onDragEnd.bind(this)}))}onDragStart(e){const t=this.getPopoverElement();t&&(e.sourceEvent.preventDefault(),this.dragged=!0,this.dragStartState={client:n.ZY9.from(e.clientX,e.clientY),position:n.ZY9.from(Number(t.style.getPropertyValue("left").replace("px","")),Number(t.style.getPropertyValue("top").replace("px","")))})}onDragMove(e){const{dragStartState:t}=this,i=this.getPopoverElement();if(!t||!i)return;const s=n.ZY9.sub(n.ZY9.from(e.clientX,e.clientY),t.client),a=n.ZY9.add(t.position,s),o=this.ctx.domManager.getBoundingClientRect(),r={};a.x>=0&&a.x+i.offsetWidth<=o.width&&(r.x=a.x),a.y>=0&&a.y+i.offsetHeight<=o.height&&(r.y=a.y),this.updatePosition(r)}onDragEnd(){this.dragStartState=void 0}},rv={"disjoint-channel":"false","fibonacci-menu":"menu","fibonacci-retracement":"false","fibonacci-retracement-trend-based":"false","fill-color":"dialog","horizontal-line":"false","line-color":"dialog","line-menu":"menu","line-stroke-width":"menu","line-style-type":"menu","measurer-menu":"menu","pan-end":"false","pan-left":"false","pan-right":"false","pan-start":"false","parallel-channel":"false","shape-menu":"menu","text-color":"dialog","text-menu":"menu","text-size":"menu","vertical-line":"false","zoom-in":"false","zoom-out":"false",callout:"false",clear:"false",comment:"false",delete:"false",line:"false",lock:"false",menu:"menu",note:"false",reset:"false",settings:"dialog",text:"false",millisecond:"false",second:"false",minute:"false",hour:"false",day:"false",month:"false",year:"false"};function lv(e){return(0,n.yFN)(e.sourceEvent)&&"ArrowLeft"===e.sourceEvent.code}function hv(e){return(0,n.yFN)(e.sourceEvent)&&"ArrowRight"===e.sourceEvent.code}function cv(e){return!1}var dv=class extends Ii{constructor(e,t){super(),this.localeManager=e,this.arrowKeyPredicate=cv,t&&this.addKeyboardClickBinding((e=>this.arrowKeyPredicate(e)))}update(e,t){const{localeManager:i}=this;if(e.tooltip){const t=i.t(e.tooltip);t!==this.lastTooltip&&(this.elem.title=t,this.lastTooltip=t)}let s="";if(null!=e.icon&&"after"!==e.iconPosition&&(s=`<span class="${(0,n.YE8)(e.icon)} ag-charts-toolbar__icon"></span>`),null!=e.label){s=`${s}<span class="ag-charts-toolbar__label">${i.t(e.label)}</span>`}null!=e.icon&&"after"===e.iconPosition&&(s=`${s}<span class="${(0,n.YE8)(e.icon)} ag-charts-toolbar__icon"></span>`);const a="string"!=typeof(o=e.value)?"false":rv[o];var o;"false"==a?(this.setAriaHasPopup(void 0),this.setAriaExpanded(void 0),this.arrowKeyPredicate=cv):(this.setAriaHasPopup(a),this.setAriaExpanded(!1),this.arrowKeyPredicate=t.isRtl?lv:hv),s!==this.lastInnerHTML&&(this.elem.innerHTML=s,this.lastInnerHTML=s)}setChecked(e){(0,n.Bqc)(this.elem,"aria-checked",e)}},uv="ag-charts-toolbar__button--active",pv=class extends Ri{constructor({eventsHub:e,localeManager:t,domManager:i},n,s){super(s),this.ariaLabelId=n,this.horizontalSpacing=10,this.verticalSpacing=10,this.events=new tt,this.hasPrefix=!1,this.buttonWidgets=[],this.updateAriaLabel=()=>this.setAriaLabel(this.localeManager.t(this.ariaLabelId)),this.eventsHub=e,this.localeManager=t,this.domManager=i,this.addClass("ag-charts-toolbar"),this.toggleClass("ag-charts-toolbar--horizontal","horizontal"===s),this.toggleClass("ag-charts-toolbar--vert
1ical","vertical"===s),this.eventsHub.on("locale:change",this.updateAriaLabel),this.updateAriaLabel()}setAriaLabelId(e){this.ariaLabelId=e,this.updateAriaLabel()}addToolbarListener(e,t){return this.events.addListener(e,t)}clearButtons(){this.expanded?.collapse({mode:"2"});for(const e of this.buttonWidgets)e.destroy();this.buttonWidgets.splice(0)}getInteractionOptions(){const{isRtl:e}=this.domManager;return{isRtl:e}}updateButtons(e){const{buttonWidgets:t}=this;for(const[t,i]of e.entries()){(this.buttonWidgets.at(t)??this.createButton(t,i)).update(i,this.getInteractionOptions())}for(let i=e.length;i<t.length;i++){const e=this.buttonWidgets.at(i);e?.destroy()}this.buttonWidgets.splice(e.length),this.refreshButtonClasses()}updateButtonByIndex(e,t){this.buttonWidgets.at(e)?.update(t,this.getInteractionOptions())}clearActiveButton(){for(const e of this.buttonWidgets)e.toggleClass(uv,!1)}toggleActiveButtonByIndex(e){if(-1!==e)for(const[t,i]of this.buttonWidgets.entries())i.toggleClass(uv,null!=e&&e===t)}toggleButtonEnabledByIndex(e,t){-1!==e&&this.buttonWidgets.at(e)?.setEnabled(t)}toggleSwitchCheckedByIndex(e,t){-1!==e&&this.buttonWidgets.at(e)?.setChecked(t)}getButtonBounds(){return this.buttonWidgets.map((e=>this.getButtonWidgetBounds(e)))}getButtonWidget(e){return this.buttonWidgets.at(e)}setButtonHiddenByIndex(e,t){this.buttonWidgets.at(e)?.setHidden(t)}getButtonWidgetBounds(e){const t=this.getBounds(),i=e.getBounds(),n=e.getBoundingClientRect(),s=n.x-Math.floor(n.x),a=n.y-Math.floor(n.y);return new m(i.x+t.x+s,i.y+t.y+a,n.width,n.height)}refreshButtonClasses(){const{buttonWidgets:e,hasPrefix:t}=this;let i,n,s;for(const[a,o]of e.entries())i=!t&&0===a||s!=o.section,n=a===e.length-1||o.section!=e.at(a+1)?.section,o.toggleClass("ag-charts-toolbar__button--first",i),o.toggleClass("ag-charts-toolbar__button--last",n),o.toggleClass("ag-charts-toolbar__button--group-first",a>0&&i),s=o.section}createButton(e,t){const i=this.createButtonWidget();return i.addClass("ag-charts-toolbar__button"),i.addListener("click",(s=>{const a={event:s,button:{index:e,...t instanceof n.XPE?t.toJson():t},buttonBounds:this.getButtonWidgetBounds(i),buttonWidget:i};this.events.dispatch("button-pressed",a)})),i.addListener("focus",(()=>{const t={button:{index:e}};this.events.dispatch("button-focused",t)})),i.addListener("expand-controlled-widget",(e=>{this.expanded?.collapse({mode:"4"}),this.expanded=e.controlled;const t=this.expanded.addListener("collapse-widget",(()=>{this.expanded=void 0,t()}))})),t.section&&(i.section=t.section),this.buttonWidgets.push(i),this.addChild(i),i}},gv=class extends pv{createButtonWidget(){return new dv(this.localeManager,!0)}},mv=class extends ov{constructor(e,t,i){super(e,t),this.onPopoverMoved=i,this.dragHandleDraggingClass="ag-charts-floating-toolbar__drag-handle--dragging"}show(e,t={}){this.showWithChildren(e,{...t,class:"ag-charts-floating-toolbar"})}hide(){this.dragged=!1,super.hide()}getBounds(){const e=this.getPopoverElement();return new m(e?.offsetLeft??0,e?.offsetTop??0,e?.offsetWidth??0,e?.offsetHeight??0)}hasBeenDragged(){return this.dragged}setAnchor(e,t,i){const n=this.getPopoverElement();if(!n)return;const s=e.position??"above",{offsetWidth:a,offsetHeight:o}=n;let r=e.y-o-i,l=e.x-a/2;"below"===s?r=e.y+i:"right"===s?(r=e.y-o/2,l=e.x+t):"above-left"===s&&(l=e.x),this.updatePosition({x:l,y:r})}ignorePointerEvents(){const e=this.getPopoverElement();e&&(e.style.pointerEvents="none")}capturePointerEvents(){const e=this.getPopoverElement();e&&(e.style.pointerEvents="unset")}updatePosition(e){const t=this.getBounds(),i=this.ctx.domManager.getBoundingClientRect();e.x=Math.floor((0,n.qE8)(0,e.x,i.width-t.width)),e.y=Math.floor((0,n.qE8)(0,e.y,i.height-t.height)),super.updatePosition(e),this.onPopoverMoved()}},yv=class extends pv{constructor(e,t,i){super(e,t,"horizontal"),this.hasPrefix=!0,this.popover=new mv(e,i,this.onPopoverMoved.bind(this)),this.dragHandle=new fv(e.localeManager.t("toolbarAnnotationsDragHandle")),this.popover.setDragHandle(this.dragHandle)}destroy(){super.destroy(),this.popover.destroy()}show(e={}){this.popover.show([this.dragHandle.getElement(),this.getElement()],e)}hide(){this.popover.hide()}setAnchor(e){this.popover.setAnchor(e,this.horizontalSpacing,this.verticalSpacing)}hasBeenDragged(){return this.popover.hasBeenDragged()}ignorePointerEvents(){this.popover.ignorePointerEvents()}capturePointerEvents(){this.popover.capturePointerEvents()}onPopoverMoved(){const e=this.popover.getBounds();if(this.popoverBounds?.equals(e))return;this.popoverBounds=e.clone();const t=this.getButtonBounds();this.events.dispatch("toolbar-moved",{popoverBounds:e,buttonBounds:t})}getButtonWidgetBounds(e){const t=this.popover.getBounds(),i=super.getButtonWidgetBounds(e),n=this.dragHandle.getBounds();return new m(i.x+t.x-n.width,i.y+t.y,i.width,i.height)}},fv=class extends vi{constructor(e){super((0,n.na4)("div","ag-charts-floating-toolbar__drag-handle"));const t=new vi((0,n.na4)("span",`${(0,n.YE8)("drag-handle")} ag-charts-toolbar__icon`));t.setAriaHidden(!0),this.addChild(t),this.elem.title=e}};function xv(e,t,i,s){const a=[i.convert(0),i.convert(1)],o=[s.convert(0),s.convert(1)],r=Math.PI/-2+(0,n.ehJ)(t),l=e?"initial":"update";return{nodes:{toFn:(e,t,i,{prevLive:n})=>{let{startAngle:s,endAngle:o,innerRadius:l,outerRadius:h}=t;const{stroke:c,fill:d}=t.sectorFormat;if("removed"===i&&n?(s=n.unsafeDatum?.endAngle,o=n.unsafeDatum?.endAngle):"removed"!==i||n||(s=r,o=r),"removed"===i){const e=(({radiu
1s:e})=>({innerRadius:a[0],outerRadius:a[0]+(a[1]-a[0])*e}))(t);l=e.innerRadius,h=e.outerRadius}return{startAngle:s,endAngle:o,outerRadius:h,innerRadius:l,stroke:c,..."string"==typeof d?{fill:d}:{}}},fromFn:(t,i,n,{prevFromProps:s})=>{let{startAngle:a,endAngle:h,innerRadius:c,outerRadius:d}=t,{fill:u,stroke:p}=i.sectorFormat;if("updated"===n&&null==t.previousDatum&&(n="added"),"unknown"===n||"added"===n&&!s?(a=r,h=r,c=i.innerRadius,d=i.outerRadius):"added"===n&&s&&(a=s.endAngle??r,h=s.endAngle??r,c=s.innerRadius??i.innerRadius,d=s.outerRadius??i.outerRadius),"added"===n&&!e){const e=(({radius:e})=>({innerRadius:o[0],outerRadius:o[0]+(o[1]-o[0])*e}))(i);c=e.innerRadius,d=e.outerRadius}"updated"===n&&(u=t.fill??u,p=("string"==typeof t.stroke?t.stroke:void 0)??p);return{startAngle:a,endAngle:h,innerRadius:c,outerRadius:d,stroke:p,phase:l,..."string"==typeof u?{fill:u}:{}}}},innerCircle:{fromFn:(e,t)=>({size:e.unsafePreviousDatum?.radius??e.size??0,phase:l}),toFn:(e,t)=>({size:t.radius??0})}}}function bv(e,t){return{startAngle:t.startAngle,endAngle:t.endAngle,innerRadius:t.innerRadius,outerRadius:t.outerRadius,stroke:t.sectorFormat.stroke}}function vv(e){const t=e.properties.selection.containment;switch(t){case"any":return(t,i)=>{if(i instanceof Qb){const n=Me.fromCanvas(e.contentGroup,new m(t.x,t.y,t.width,t.height));return n.x-=i.centerX,n.y-=i.centerY,wy(n,i)}return!1};case"all":return(t,i)=>{if(i instanceof Qb){const{x:s,y:a,width:o,height:r}=Me.toCanvas(e.contentGroup,i.getBBox());return(0,n.JF9)(t,s,a,o,r)}return!1};default:return t}}var Sv={...Bh,...jh},Mv={};function kv(e){if(Array.isArray(e)&&0!==e.length){const t=e.find((e=>null!=e));if("number"==typeof t){return{data:e.map(((e,t)=>({x:t,y:e}))),series:[{xKey:"x",yKey:"y"}],datumKey:"y"}}if(Array.isArray(t)){return{data:e.map((e=>({x:e?.[0],y:e?.[1],datum:e}))),series:[{xKey:"x",yKey:"y"}],datumKey:"datum"}}}else if(0===e?.length)return{data:e,series:[{xKey:"x",yKey:"y"}],datumKey:"y"};return{data:e}}function Dv(e){switch(e?.type){case"number":{const{reverse:t,min:i,max:n}=e??{};return{type:"number",reverse:t,min:i,max:n}}case"time":{const{reverse:t,min:i,max:n}=e??{};return{type:"time",reverse:t,min:i,max:n}}default:{if(null==e)return{type:"category"};const{reverse:t,paddingInner:i,paddingOuter:n}=e;return{type:"category",reverse:t,paddingInner:i,paddingOuter:n}}}}function wv(e,t,i){const n={};return null!=e?.stroke&&(n.style=[{stroke:e?.stroke}],n.enabled??(n.enabled=!0)),null!=e?.strokeWidth&&(n.width=e?.strokeWidth,n.enabled??(n.enabled=!0)),"bar"===i.type&&"horizontal"!==i.direction&&(n.enabled??(n.enabled=!0)),null!=e?.visible&&(n.enabled=e.visible),n.enabled??(n.enabled=t),n}h(Mv,{AxisWidget:()=>Si,ButtonWidget:()=>Ii,MenuItemRadioWidget:()=>ev,MenuItemWidget:()=>Jb,MenuWidget:()=>tv,NativeWidget:()=>vi,SliderWidget:()=>Ti,ToolbarWidget:()=>Ri,Widget:()=>bi,WidgetEventUtil:()=>li});var Iv=(0,n.FAd)(((e,t)=>i=>{const s=i.datum[i.xKey],a=i.datum[i.yKey],o=null==t?i.datum:i.datum[t],r=e?.renderer?.({context:i.context,datum:o,xValue:s,yValue:a});if((0,n.KgX)(r)||(0,n.EtT)(r)||(0,n.$PY)(r))return(0,n.i$)(r);const l=null!=r?.title,h=r?.content??((e,t,i,n)=>n||"y"===i||null==e?String(t):`${String(e)} ${String(t)}`)(s,a,t,l);return r?.title?{heading:void 0,title:void 0,data:[{label:r.title,value:h}]}:{heading:void 0,title:h,data:[]}}));var Av={title:{enabled:!1},label:{enabled:!1},line:{enabled:!1},gridLine:{enabled:!1},crosshair:{enabled:!1,stroke:n.kOz,lineDash:[0],label:{enabled:!1}}},Cv={...Av,nice:!1},Nv={mode:"compact",position:{anchorTo:"node",placement:["right","left"]},showArrow:!1},Lv={width:2},Pv={number:{gridLine:Lv},time:{gridLine:Lv},category:{gridLine:Lv}},Tv={common:{animation:{enabled:!1},contextMenu:{enabled:!1},keyboard:{enabled:!1},background:{visible:!1},navigator:{enabled:!1},padding:{$applyPadding:0},axes:{number:{...Cv,interval:{values:[0]}},log:{...Cv},time:{...Cv},category:{...Av}}},bar:{series:{crisp:!1,label:{placement:"inside-end",padding:4},sparklineMode:!0},tooltip:{...Nv,position:{...Nv.position,anchorTo:"pointer"},range:"nearest"},axes:Pv},line:{seriesArea:{padding:{$applyPadding:2}},series:{sparklineMode:!0,strokeWidth:1,marker:{enabled:!1,size:3}},tooltip:Nv},area:{seriesArea:{padding:{$applyPadding:{top:1,right:0,bottom:1,left:0}}},series:{strokeWidth:1,fillOpacity:.4},tooltip:Nv}},Ov=["showInLegend","showInMiniChart","grouped","stacked","stackGroup","tooltip","listeners","errorBar","xKey","yKey","type"],Rv={visible:n.zMY,reverse:n.zMY,stroke:n.aXB,strokeWidth:n.LyW},Ev=(()=>({context:()=>!0,tooltip:n.swK,theme:n.swK,background:n.swK,container:n.swK,width:n.swK,height:n.swK,minWidth:n.swK,minHeight:n.swK,padding:n.swK,listeners:n.swK,locale:n.swK,data:n.swK,styleNonce:n.YjP,axis:(0,n.ist)({number:{...Rv,min:(0,n.Uo6)(n.aig,(0,n.XeB)("max")),max:(0,n.Uo6)(n.aig,(0,n.MM$)("min"))},category:{...Rv,paddingInner:n.CGN,paddingOuter:n.CGN},time:{...Rv,min:(0,n.Uo6)((0,n.or)(n.aig,n.p6U),(0,n.XeB)("max")),max:(0,n.Uo6)((0,n.or)(n.aig,n.p6U),(0,n.MM$)("min"))}},"axis options","category"),min:(0,n.Uo6)(n.aig,(0,n.XeB)("max")),max:(0,n.Uo6)(n.aig,(0,n.MM$)("min")),crosshair:{enabled:n.zMY,snap:n.zMY,...n.AFh,...n.mLn},xKey:n.YjP,yKey:n.YjP}))();Ev.overrideDevicePixelRatio=(0,n._Le)(n.aig),Ev.foreground=(0,n._Le)(n.swK);var zv=pm({type:"preset",name:"sparkline",version:Ot,options:(0,n.ist)({area:{...Ev,...(0,n.FFB)(Bn,Ov)},bar:{...Ev,...(0,n.FFB)(Hn,Ov)},line:{...Ev,...(0,n.FFB)(Zn,Ov)}},"sparkline options"),create:function(e){const{background:t,container:i,foreground:n,height:s,listeners:a,locale:o,minHeight:r,minWidth:l,overrideDevicePixelRatio:h,padding:c,width:d,theme:u,data:p,crosshair:g,axis:m,min:y,max:f,tooltip:x,context:b,styleNonce:v,...S}=e,M={background:t,container:i,context:b,foreground:n,height:s,listeners:a,locale:o,minHeight:r,minWidth:l,overrideDevicePixelRatio:h,padding:c,width:d,styleNonce:v},{data:k,series:[D]=[],datumKey:w}=kv(p),I=S;null!=D&&Object.assign(I,D),I.tooltip={...x,renderer:Iv(x,w)},M.data=k,M.series=[I];const A="bar"===I.type&&"horizontal"===I.direction,[C,N]=A?["left","bottom"]:["bottom","left"],L={...Dv(m),position:C,...null==g?{}:{crosshair:g}},P={type:"number",gridLine:wv(m,!1,e),position:N,...null==y?{}:{min:y},...null==f?{}:{max:f}};return M.axes=A?{x:P,y:L}:{x:L,y:P},M},processData:kv,themeTemplate:Tv}),Bv=["top","right","bottom","left"];function Fv(e,t,i,n){const s=e[t]+e[i],a=.5*Math.max(n,0);if(s<=a)return;const o=s>0?a/s:0;e[t]*=o,e[i]*=o}var Vv=(()=>{var e=class e extends Vu{constructor(e,t){super(e,t),this.paired=!0,this.axes=this.createChartAxes(),this.lastUpdateClipRect=void 0,this.lastLayoutWidth=Number.NaN,this.lastLayoutHeight=Number.NaN}createChartAxes(){return new Je}onAxisChange(e,t){super.onAxisChange(e,t),this.syncAxisChanges(e,t),null!=this.ctx&&this.ctx.zoomManager?.setAxes(e)}destroySeries(e){super.destroySeries(e),this.lastLayoutWidth=Number.NaN,this.lastLayoutHeight=Number.NaN}toAgCoordinates(e){const t={};for(const i of this.axes){const n=i.pickValue(e);if(n){const{boundSeries:e,depth:i,direction:s,domain:a,groupPercentage:o,index:r,value:l}=n,h={boundSeries:e,depth:i,direction:s,domain:a,groupPercentage:o,index:r,value:l};t[n.axisId]=h}else t[i.userKey]=void 0}return t}getChartType(){return"cartesian"}setRootClipRects(e){const{seriesRoot:t,annotationRoot:i}=this;t.setClipRect(e),i.setClipRect(e)}
1async processData(){await super.processData(),"init"===this.syncStatus&&(this.syncStatus="domains-calculated"),this.ctx.eventsHub.emit("update:process-data",{series:{shouldFlipXY:this.shouldFlipXY()}})}async processDomains(){await super.processDomains();for(const e of this.axes){const t=await this.getSyncedDomain(e);null!=t&&e.setDomains({domain:t})}}performLayout(e){const{seriesRoot:t,annotationRoot:i}=this,{clipSeries:s,seriesRect:a,visible:o}=this.updateAxes(e);this.seriesRoot.visible=o,this.seriesRect=a,this.animationRect=e.layoutBox;const{x:r,y:l}=a;if(e.width!==this.lastLayoutWidth||e.height!==this.lastLayoutHeight)for(const e of[t,i])e.translationX=Math.floor(r),e.translationY=Math.floor(l);else{const{translationX:e,translationY:n}=t;$h(this.id,"seriesRect",this.ctx.animationManager,[t,i],{translationX:e,translationY:n},{translationX:Math.floor(r),translationY:Math.floor(l)},{phase:"update"})}this.lastLayoutWidth=e.width,this.lastLayoutHeight=e.height;const h=a.clone().grow(this.seriesArea.getPadding()),c=this.series.some((e=>e.alwaysClip))||(this.seriesArea.clip??!1)||s?h:void 0,{lastUpdateClipRect:d}=this;this.lastUpdateClipRect=c,this.ctx.animationManager.isActive()&&null!=d?this.ctx.animationManager.animate({id:this.id,groupId:"clip-rect",phase:"update",from:d,to:h,onUpdate:e=>this.setRootClipRects(e),onStop:()=>this.setRootClipRects(c),onComplete:()=>this.setRootClipRects(c)}):this.setRootClipRects(c),this.seriesArea.update(a,h),this.ctx.layoutManager.emitLayoutComplete(e,{axes:(0,n.Cr)(this.axes.map((e=>[e.id,e.getLayoutState()]))),series:{visible:o,rect:a,paddedRect:h},clipSeries:s,layoutBox:e.layoutBox}),cy(this.series)}updateAxes(e){const{layoutBox:t,scrollbars:i}=e,{clipSeries:n,seriesRect:s,overflows:a}=this.resolveAxesLayout(t,i);for(const e of this.axes)e.update(),Eb(e)?.setVisible(!a),this.clipAxis(e,s,t);return{clipSeries:n,seriesRect:s,visible:!a}}resolveAxesLayout(e,t){let i,n,s=0;const a=this.axes.filter((e=>null!=e.options.crossAt?.value));do{if(n=i??this.getDefaultState(),i=this.updateAxesPass(new Map(n.axisAreaWidths),e.clone(),a,t),s++>10){this.ctx.logger.warn("Max iterations reached. Unable to stabilize axes layout.");break}}while(!this.isLayoutStable(i,n));return this.lastAreaWidths=i.axisAreaWidths,i}updateAxesPass(t,i,s,a){const o=new Map,r={};let l=!1,h=!1;const c=this.seriesArea.getPadding();for(const e of Bv){const t=c[e]??0,n=this.axes.findLast((t=>t.position===e));n?n.seriesAreaPadding=t:i.shrink(t,e)}const d=(t.get("left")??0)+(t.get("right")??0),u=(t.get("top")??0)+(t.get("bottom")??0),p=this.buildCrossLinePadding(t);i.width<=d||i.height<=u?l=!0:(Fv(p,"left","right",i.width-d),Fv(p,"top","bottom",i.height-u),i.shrink(p));const{scene:g}=this.ctx,m=i.clone().shrink(Object.fromEntries(t));for(const e of this.axes){const{position:t="left",direction:i}=e,s=i===n.tv$.Y;let l;this.sizeAxis(e,m,t);const{thickness:c,maxThicknessRatio:d}=e.options;if(null==c){l=$v(s,g)*d}else l=c;const u={sizeLimit:l-e.options.label.spacing,padding:this.ctx.chartState.getValue("options","padding"),scrollbars:a},{primaryTickCount:p,bbox:y}=e.calculateLayout(e.nice?r[i]:void 0,u);r[i]??(r[i]=p),h||(h=e.dataDomain.clipped||e.visibleRange[0]>0||e.visibleRange[1]<1),null==e.options.thickness&&(l=Math.min($v(s,y)??0,l)),o.set(e.id,Math.ceil(l))}const y=this.calculateAxesCrossPositions(o,m,s),f=(0,n.$zQ)(this.axes,(e=>e.position??"left")),x=new Map,b=new Map;for(const[t,s]of(0,n.jOZ)(f)){const n="top"===t||"bottom"===t?i.y:i.x;let a=g.pixelRatio%1==0?0:n%g.pixelRatio,r=0;for(const t of s??[]){b.set(t.id,a);const i=o.get(t.id)??0;r=Math.max(r,a+i),t.layoutConstraints.stacked&&(a+=i+e.AxesPadding)}x.set(t,Math.ceil(r))}for(const[e,t]of(0,n.jOZ)(f))this.positionAxes({axes:t??[],position:e,axisWidths:o,axisOffsets:b,axisAreaWidths:x,axisBound:i,seriesRect:m});return this.applyAxisCrossing(m,y),{clipSeries:h,seriesRect:m,axisAreaWidths:x,overflows:l}}calculateAxesCrossPositions(e,t,i){const n=new Map;for(const s of i){const{crossPosition:i,visible:a}=this.calculateAxisCrossPosition(s);s.setAxisVisible(a),this.adjustAxisWidth(s,e,i,t,a),null!=i&&n.set(s.id,i)}return n}calculateAxisCrossPosition(e){const t=this.axes.perpendicular(e),{scale:{domain:i,bandwidth:s},range:a}=t,o=(s??0)/2,{crossAt:r}=e.options,l=t.scale.convert(r?.value,{clamp:!1})+o;if(t.inRange(l))return{crossPosition:l,visible:!0};if(!1===r?.sticky)return{crossPosition:void 0,visible:!1};return{crossPosition:Number.isNaN(l)?a[i[0]]:(0,n.jVD)(l,a),visible:!0}}adjustAxisWidth(e,t,i,s,a){const o=this.modulesManager.getModule("annotations");
1if(!0===o?.enabled||this.ctx.annotationManager?.createMemento().some((t=>{switch(t.type){case"vertical-line":return e.direction===n.tv$.X;case"horizontal-line":return e.direction===n.tv$.Y}})))return;const r=t.get(e.id)??0,l=a?this.calculateCrossAtAxisWidth(e,r,i,s):0;t.set(e.id,l)}calculateCrossAtAxisWidth(e,t,i,n){const{titlePlacement:s,labelPlacement:a}=e.options.crossAt??{};if("edge"!==s&&"edge"!==a&&!e.crosshairLabelNeedsEdgeSpace())return this.calculateAxisBleedingWidth(e,t,i,n);const{atEdge:o,atCrossing:r}=e.getCrossAtThicknesses(),l=this.calculateAxisBleedingWidth(e,Math.min(r,t),i,n);return Math.ceil(Math.max(o,l))}calculateAxisBleedingWidth(e,t,i,n){if(null==i)return t;switch(e.position){case"left":case"top":return Math.max(0,t-i);case"right":return Math.max(0,i+t-n.width);case"bottom":return Math.max(0,i+t-n.height);default:return t}}applyAxisCrossing(e,t){for(const i of this.axes){const s=t.get(i.id);if(null==s){i.crossAxisTranslation.x=0,i.crossAxisTranslation.y=0,null==i.options.crossAt?.value&&i.setAxisVisible(!0);continue}const a=i.direction===n.tv$.X;i.crossAxisTranslation.x=a?0:e.x+s-i.translation.x,i.crossAxisTranslation.y=a?e.y+s-i.translation.y:0}}buildCrossLinePadding(e){var t;const i={top:0,right:0,bottom:0,left:0};for(const e of this.axes){const{position:n}=e,s=Eb(e)?.getInstances();if(s)for(const a of s)a instanceof by&&(a.position=n??"top",(t=a.label).parallel??(t.parallel=e.parallel)),a.calculatePadding?.(i)}for(const[t,s=0]of(0,n.jOZ)(i))i[t]=Math.max(s-(e.get(t)??0),0);return i}clampToOutsideSeriesRect(e,t,i,n){const s="x"===i?e.x:e.y,a="x"===i?e.width:e.height;return 1===n?Math.min(t,s+a):Math.max(t,s)}async getSyncedDomain(e){const t=this.modulesManager.getModule("sync");if(t?.enabled)return await t.getSyncedDomain(e)}syncAxisChanges(e,t){const i=this.modulesManager.getModule("sync");if(!i?.enabled)return;const n=new Set(t??[]);for(const t of e)n.delete(t);for(const e of n)i.removeAxis(e)}sizeAxis(e,t,i){const n=e instanceof Jm,s="left"===i||"right"===i,{width:a,height:o}=t,r=s?o:a;let l=0,h=r,{min:c,max:d}=e.getZoom();const{width:u,unit:p,align:g}=e.layoutConstraints;h="px"===p?l+u:h*u/100;const m=h-l;if("end"===g)l=r-m,h=r;else if("center"===g){const e=l+(r-l)/2;l=e-m/2,h=e+m/2}else"justify"===g&&(h=r);s&&(n?[l,h]=[h,l]:[c,d]=[1-d,1-c]),e.range=[l,h],e.visibleRange=[c,d],e.gridLength=s?a:o,e.lineRange=s?[o,0]:[0,a]}positionAxes(e){const{axes:t,axisBound:i,axisWidths:n,axisOffsets:s,axisAreaWidths:a,seriesRect:o,position:r}=e,l=a.get(r)??0;let h="x",c="y",d=1;"top"!==r&&"bottom"!==r||(h="y",c="x");let u=i[h];"right"!==r&&"bottom"!==r||(d=-1,u+="x"===h?i.width:i.height);for(const e of t){const t=a.get("x"===c?"left":"top")??0,r=n.get(e.id)??0,p=s.get(e.id)??0;e.gridPadding=l-p-r,e.translation[c]=i[c]+t,e.translation[h]=this.clampToOutsideSeriesRect(o,u+d*(p+r),h,d)}}shouldFlipXY(){return this.series.every((e=>e instanceof hy&&e.shouldFlipXY()))}getDefaultState(){const e=new Map;if(this.lastAreaWidths)for(const{position:t="left"}of this.axes){const i=this.lastAreaWidths.get(t);null!=i&&e.set(t,i)}return{axisAreaWidths:e,clipSeries:!1,overflows:!1}}isLayoutStable(e,t){if(t.overflows!==e.overflows||t.clipSeries!==e.clipSeries)return!1;for(const i of e.axisAreaWidths.keys())if(!t.axisAreaWidths.has(i))return!1;for(const[i,n]of t.axisAreaWidths.entries()){const t=e.axisAreaWidths.get(i);if((null!=n||null!=t)&&n!==t)return!1}return!0}clipAxis(e,t,i){const s=Math.ceil(e.options.gridLine.width),a=Math.ceil(e.options.line.width);let{width:o,height:r}=t;switch(o+=e.direction===n.tv$.X?s:a,r+=e.direction===n.tv$.Y?s:a,e.clipGrid(t.x,t.y,o,r),e.position){case"left":case"right":e.clipTickLines(i.x,t.y-s,i.width+s,t.height+2*s);break;case"top":case"bottom":e.clipTickLines(t.x-s,i.y,t.width+2*s,i.height+s)}}};return e.className="CartesianChart",e.type="cartesian",e.AxesPadding=15,d([(0,n.mBh)({changeValue(e,t){this.onAxisChange(e,t)}})],e.prototype,"axes",2),e})();function $v(e,t){return e?t?.width:t?.height}var Hv=new Set(["number","log","time"]),jv=e=>(0,n.Gvm)(e)&&null!=e.type&&!Hv.has(e.type),Wv=pm({type:"chart",name:"cartesian",version:Ot,options:Ba,themeTemplate:Nm,create:(e,t)=>
1new Vv(e,t),validate(e,t,i,s){const a=[];"histogram"===e?.series?.[0]?.type&&Object.values(e?.axes??{}).some(jv)&&(a.push(new n.yI4("invalid","only continuous axis types when histogram series is used",e.axes,i,"axes")),e=(0,n.FFB)(e,["axes"]));const o=(0,n.tfT)(e,t,i,s);return o.invalid.push(...a),o}}),_v=(()=>{var e=class extends Vu{constructor(e,t){super(e,t),this.series=[],this.axes=this.createChartAxes(),this.ctx.axisManager.axisGroup.zIndex=n.Dcv.AXIS_FOREGROUND}createChartAxes(){return new et}toAgCoordinates(e){}getChartType(){return"polar"}isDataTransactionSupported(){return!this.series.some((e=>"pie"===e.type||"donut"===e.type))}async performLayout(e){const t=e.layoutBox.clone().shrink(this.seriesArea.getPadding());this.seriesRect=t,this.animationRect=t,this.seriesRoot.translationX=t.x,this.seriesRoot.translationY=t.y,await this.computeCircle(t);for(const e of this.axes)e.update();let i=0;for(const e of this.series)i=Math.max(i,e.properties.marker?.size??0);for(const e of Gv(this.series))e.maxChartMarkerSize=i;this.ctx.layoutManager.emitLayoutComplete(e,{series:{visible:!0,rect:t,paddedRect:e.layoutBox},layoutBox:e.layoutBox})}updateAxes(e,t,i,s){if(0===this.axes.length)return;const a=this.axes[n.tv$.Angle],o=this.axes[n.tv$.Radius],r=a.scale,l=o.innerRadiusRatio;a.innerRadiusRatio=l,a.computeRange(),a.gridLength=s,o.gridAngles=r.ticks({nice:[a.nice,a.nice],interval:void 0,tickCount:void 0,minTickCount:0,maxTickCount:1/0})?.ticks?.map((e=>r.convert(e))),o.gridRange=a.range,o.range=[s,s*l];for(const n of[a,o])n.translation.x=e.x+t,n.translation.y=e.y+i,n.calculateLayout()}async computeCircle(e){const t=Gv(this.series),i=(i,n,s)=>{this.updateAxes(e,i,n,s);for(const e of t)e.centerX=i,e.centerY=n,e.radius=s;const a=t.filter((e=>"donut"===e.type||"pie"===e.type));if(a.length>1){const e=a.map((e=>{const t=e.getInnerRadius();return{series:e,innerRadius:t}})).sort(((e,t)=>e.innerRadius-t.innerRadius));e.at(-1).series.surroundingRadius=void 0;for(let t=0;t<e.length-1;t++)e[t].series.surroundingRadius=e[t+1].innerRadius}},s=e.width/2,a=e.height/2,o=Math.max(0,Math.min(e.width,e.height)/2);let r=o;i(s,a,r);const l=async({hideWhenNecessary:l=!1}={})=>{const h=[];for(const i of(0,n.nlf)(this.axes,t)){const t=await i.computeLabelsBBox({hideWhenNecessary:l},e);t&&h.push(t)}if(0===h.length)return void i(s,a,o);const c=m.merge(h),d=this.refineCircle(c,r,e);i(d.centerX,d.centerY,d.radius),r=d.radius};await l(),await l(),await l(),await l({hideWhenNecessary:!0}),await l({hideWhenNecessary:!0});for(const i of(0,n.nlf)(this.axes,t))await i.computeLabelsBBox({hideWhenNecessary:!0},e);return{radius:r,centerX:s,centerY:a}}refineCircle(e,t,i){const n=-t,s=-t,a=t,o=t;let r=Math.max(0,n-e.x),l=Math.max(0,s-e.y),h=Math.max(0,e.x+e.width-a),c=Math.max(0,e.y+e.height-o);r=h=Math.max(r,h),l=c=Math.max(l,c);const d=i.width-r-h,u=i.height-l-c;let p=Math.min(d,u)/2;const g=.5*i.width/2,m=.5*i.height/2,y=Math.min(g,m);if(p<y){p=y;const e=r+h;if(2*p+(l+c)>i.height){const e=i.height-2*p;2*Math.min(l,c)>e?(l=e/2,c=e/2):l>c?l=e-c:c=e-l}if(2*p+e>i.width){const e=i.width-2*p;2*Math.min(r,h)>e?(r=e/2,h=e/2):r>h?r=e-h:h=e-r}}const f=r+2*p+h,x=l+2*p+c;return{centerX:(i.width-f)/2+r+p,centerY:(i.height-x)/2+l+p,radius:p}}};return e.className="PolarChart",e.type="polar",e})();function Gv(e){return e.filter((e=>e instanceof ab))}var Kv=pm({type:"chart",name:"polar",version:Ot,options:Fa,themeTemplate:Nm,create:(e,t)=>new _v(e,t),validate(e,t,i,s){const a=[],o=e?.series?.[0]?.type;"pie"!==o&&"donut"!==o||e?.axes&&(a.push(new n.Bk6([],e.axes,i,"axes")),e=(0,n.FFB)(e,["axes"]));const r=(0,n.tfT)(e,t,i,s);return r.invalid.push(...a),r}}),Yv=pm({type:"axis:plugin",name:"crossLines",chartType:"cartesian",enterprise:!1,version:Ot,themeTemplate:{$apply:[{enabled:!0,fill:{$if:[{$eq:[{$path:"./type"},"range"]},{$ref:"foregroundColor"},void 0]},fillOpacity:{$if:[{$eq:[{$path:"./type"},"range"]},.08,void 0]},stroke:{$ref:"foregroundColor"},strokeWidth:1,label:{...(0,n.fs4)({overflow:"pad-chart"}),fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"}
1,padding:{$if:[{$path:"./border/enabled"},{left:12,right:12,top:8,bottom:8},5]},color:{$ref:"textColor"},cornerRadius:4,border:{enabled:!1,stroke:{$foregroundOpacity:.08},strokeOpacity:1,strokeWidth:1}}},void 0,{$pathString:["/common/axes/$axisType/crossLines",{axisType:{$path:["../type"]}}]},{$pathString:["/$seriesType/axes/$axisType/crossLines",{seriesType:{$path:["/series/0/type","line"]},axisType:{$path:["../type"]}}]}]},register:e=>{e.factory("crossLine",(()=>new by))},create:e=>new Rb(e)});function Uv({orientation:e,bboxes:t,maxHeight:i,maxWidth:n,itemPaddingY:s=0,itemPaddingX:a=0,forceResult:o=!1}){const r="horizontal"===e,l={max:r?n:i,fn:r?e=>e.width:e=>e.height,padding:r?a:s},h={max:r?i:n,fn:r?e=>e.height:e=>e.width,padding:r?s:a};let c=0;const d=[];for(;c<t.length;){const e=Xv(t.slice(c),c,l,h,o);if(!e)return;c+=e.processedBBoxCount,d.push(e.pageIndices)}return function(e,t,i,n,s){let a=0,o=0;const r=e.map((e=>{"horizontal"===t&&(e=function(e){const t=[];for(const i of e[0])t.push([]);for(const[i,n]of e.entries())for(const[e,s]of n.entries())t[e][i]=s;return t}(e));let r=0;const l=e.map((e=>{const t=e.map((e=>(r=Math.max(e,r),i[e])));let a=0,o=0;for(const e of t)a+=e.height+n,o=Math.max(o,e.width+s);return{indices:e,bboxes:t,columnHeight:Math.ceil(a),columnWidth:Math.ceil(o)}}));let h=0,c=0;for(const e of l)h+=e.columnWidth,c=Math.max(c,e.columnHeight);return a=Math.max(h,a),o=Math.max(c,o),{columns:l,startIndex:e[0][0],endIndex:r,pageWidth:h,pageHeight:c}}));return{pages:r,maxPageWidth:a,maxPageHeight:o}}(d,e,t,s,a)}function Xv(e,t,i,n,s){let a=function(e,t){const i=e.length;let n=0;for(let s=0;s<i;s++)if(n+=t.fn(e[s])+t.padding,n>t.max){return i/s<2?Math.ceil(i/2):s}return i}(e,i);if(a<1){if(!s)return;a=1}let o=a;for(;o>=1;){const a=Zv(e,t,o,i,n,s);if(null==a&&o<=1)return;if(null==a){o--;continue}if("number"==typeof a){if(a<=1)return;o=a<o&&a>1?a:o,o--;continue}return{processedBBoxCount:a.length*a[0].length,pageIndices:a}}}function Zv(e,t,i,n,s,a){const o=[];let r=0,l=0,h=[];const c=[];for(let d=0;d<e.length;d++){const u=(d+i)%i;0===u&&(r+=l,l=0,h.length>0&&o.push(h),h=[]);const p=n.fn(e[d])+n.padding;c[u]=Math.max(c[u]??0,p),l=Math.max(l,s.fn(e[d])+s.padding);const g=r+l,m=!a||o.length>0;if(g>s.max&&m){h=[];break}if(c.reduce(((e,t)=>e+t),0)>n.max&&!a)return c.length<i?c.length:void 0;h.push(d+t)}return h.length>0&&o.push(h),o.length>0?o:void 0}var qv=(()=>{var e=class{constructor(e,t){this.chartUpdateCallback=e,this.pageUpdateCallback=t,this.id=(0,n.sX_)(this),this.group=new we({name:"pagination"}),this.labelNode=new Ue,this.nextButton=new Sd,this.previousButton=new Sd,this.totalPages=0,this.currentPage=0,this.translationX=0,this.translationY=0,this.nextButtonDisabled=!1,this.previousButtonDisabled=!1,this._visible=!0,this._enabled=!0,this.isRtl=!1,this.orientation="vertical",this.labelNode.setProperties({textBaseline:"middle",textAlign:"left",text:"1 / 0",y:1}),this.group.append([this.nextButton,this.previousButton,this.labelNode])}set visible(e){this._visible=e,this.updateGroupVisibility()}get visible(){return this._visible}set enabled(e){this._enabled=e,this.updateGroupVisibility()}get enabled(){return this._enabled}updateGroupVisibility(){this.group.visible=this.enabled&&this.visible}applyRotations(){const{isRtl:e}=this;if("horizontal"===this.orientation)this.previousButton.rotation=e?Math.PI/2:-Math.PI/2,this.nextButton.rotation=e?-Math.PI/2:Math.PI/2;else this.previousButton.rotation=0,this.nextButton.rotation=Math.PI}update(e){this.lastOpts=e,this.applyRotations(),this.updateLabel(e),this.updatePositions(e),this.enableOrDisableButtons()}updatePositions(e){this.group.translationX=this.translationX,this.group.translationY=this.translationY,this.updateLabelPosition(e),this.updateButtonPositions(e)}updateLabelPosition(e){const{size:t,padding:i}=e.marker;this.nextButton.size=t,this.previousButton.size=t,this.labelNode.x=t/2+i.right}updateButtonPositions(e){const t=this.labelNode.getBBox().width+e.marker.size+e.marker.padding.left+e.marker.padding.right;this.isRtl&&"horizontal"===this.orientation?(this.nextButton.translationX=0,this.previousButton.translationX=t):(this.previousButton.translationX=0,this.nextButton.translationX=t)}updateLabel(e){const{isRtl:t,labelNode:i,currentPage:n,totalPages:s}=this,{color:a,fontStyle:o,fontWeight:r,fontSize:l,fontFamily:h}=e.label,c=[n+1,s];t&&c.reverse(),i.text=c.join(" / "),i.fill=a,i.fontStyle=o,i.fontWeight=r,i.fontSize=l,i.fontFamily=h}updateMarkers(e){const{nextButton:t,previousButton:i,nextButtonDisabled:n,previousButtonDisabled:s,highlightActive:a}=this,o=(t,i)=>i?e.inactiveStyle:t===a?e.highlightStyle:e.activeStyle;this.updateMarker(t,e,o("next",n)),this.updateMarker(i,e,o("previous",s))}updateMarker(e,t,i){const{shape:n,size:s}=t.marker;e.shape=n,e.size=s,e.fill=i.fill,e.fillOpacity=i.fillOpacity??1,e.stroke=i.stroke,e.strokeWidth=i.strokeWidth,e.strokeOpacity=i.strokeOpacity}enableOrDisableButtons(){const{currentPage:e,totalPages:t}=this,i=0===t,n=e===t-1,s=0===e;this.nextButtonDisabled=n||i,this.previousButtonDisabled=s||i}setPage(e){e=(0,n.qE8)(0,e,Math.max(0,this.totalPages-1)),this.currentPage!==e&&(this.currentPage=e,this.onPaginationChanged())}getCursor(e){return{previous:this.previousButtonDisabled,next:this.nextButtonDisabled}[e]?void 0:"pointer"}onClick(e,t){e.preventDefault(),"next"!==t||this.nextButtonDisabled?"previous"!==t||this.previousButtonDisabled||(this.decrementPage(),this.onPaginationChanged()):(this.incrementPage(),this.onPaginationChanged())}onMouseHover(e){this.highlightActive=e,this.lastOpts&&this.updateMarkers(this.lastOpts),this.chartUpdateCallback()}onPaginationChanged(){this.pageUpdateCallback(this.currentPage)}incrementPage(){this.currentPage=Math.min(this.currentPage+1,this.totalPages-1)}decrementPage(){this.currentPage=Math.max(this.currentPage-1,0)}attachPagination(e){e.append(this.group)}getBBox(){return this.group.getBBox()}computeCSSBounds(){return{prev:Me.toCanvas(this.previousButton),next:Me.toCanvas(this.nextButton)}}};return e.className="Pagination",e})(),Qv=class{constructor(e,t){this.ctx=e,this.dirty=!0,this.itemList=e.proxyInteractionService.createProxyContainer({type:"list",domManagerId:`${t}-toolbar`,classList:["ag-charts-proxy-legend-toolbar"],ariaLabel:{id:"ariaLabelLegend"}}),this.paginationGroup=e.proxyInteractionService.createProxyContainer({type:"group",domManagerId:`${t}-pagination`,classList:["ag-charts-proxy-legend-pagination"],ariaLabel:{id:"ariaLabelLegendPagination"}}),this.itemDescription=e.agDocument.createElement("p"),this.itemDescription.style.display="none",this.itemDescription.id=(0,n.wWH)(),this.itemDescription.textContent=this.getItemAriaDescription(),this.itemList.getElement().append(this.itemDescription)}shouldApplyHoverOnFocus(e){const t=e.getElement();return[":hover",":focus-visible"].some((e=>t.matches(e)))}initLegendList(e){if(!this.dirty)return;const{itemSelection:t,datumReader:i,itemListener:s}=e,a=t.length;t.each(((e,t,o)=>{e.proxyButton?.destroy(),e.proxyButton=this.ctx.proxyInteractionService.createProxyElement({type:"listswitch",textContent:this.getItemAriaText((0,n.boc)(i.getItemLabel(t)),o,a),ariaChecked:!!e.unsafeNonNullDatum.enabled,ariaDescribedBy:this.itemDescription.id,parent:this.itemList});const r=e.proxyButton;r.addListener("click",(t=>s.onClick(t.sourceEvent,e.datum,r))),r.addListener("dblclick",(t=>s.onDoubleClick(t.sourceEvent,e.datum))),r.addListener("mouseenter",(t=>s.onHover(t.sourceEvent,e))),r.addListener("mouseleave",(()=>s.onLeave())),r.addListener("contextmenu",(t=>s.onContextClick(t,e))),r.addListener("blur",(()=>s.onLeave(!0))),r.addListener("focus",(t=>this.shouldApplyHoverOnFocus(r)?s.onHover(t.sourceEvent,e,!0):s.onLeave())),r.addListener("drag-start",(()=>{}))})),this.dirty=!1}update(e){e.visible&&(this.initLegendList(e),this.syncItemLabels(e),this.updateItemProxyButtons(e),this.updatePaginationProxyButtons(e,!0)),this.updateVisibility(e.visible)}syncItemLabels({itemSelection:e,datumReader:t}){const i=e.length;e.each((({proxyButton:e},s,a)=>{const o=e?.getElement();if(null!=o){const e=this.getItemAriaText((0,n.boc)(t.getItemLabel(s)),a,i);o.textContent!==e&&(o.textContent=e)}}))}updateVisibility(e){this.itemList.setHidden(!e),this.paginationGroup.setHidden(!e)}updateItemProxyButtons({itemSelection:e,group:t,pagination:i,interactive:n,contextMenuAvailable:s}){const a=Me.toCanvas(t);this.itemList.setBounds(a);const o=Math.max(...e.nodes().map((e=>e.getTextMeasureBBox().height)));e.each(((e,t)=>{if(e.proxyButton){const r=e.pageIndex===i.currentPage,{x:l,y:h,height:c,width:d}=Me.toCanvas(e,e.getTextMeasureBBox()),u=(o-c)/2,p={x:l-a.x,y:h-u-a.y,height:o,width:d},g=n&&r,m=(n||s)&&r;e.proxyButton.setCursor(t.suppressHighlight?"default":"pointer"),e.proxyButton.setEnabled(g),e.proxyButton.setPointerEvents(m?void 0:"none"),e.proxyButton.setBounds(p),e.proxyButton.setAriaDescribedBy(g?this.itemDescription.id:void 0)}}))}updatePaginationProxyButtons(e,t){const{pagination:i}=e;if(this.paginationGroup.setHidden(!i.visible),t&&"ctx"in e){const{oldPages:t,newPages:i}=e,n=(t?.length??i.length)>1,s=i.length>1;
1n!==s&&(s?this.createPaginationButtons(e):this.destroyPaginationButtons()),this.paginationGroup.setAriaHidden(!s||void 0)}if(this.prevButton&&this.nextButton){const{prev:e,next:t}=i.computeCSSBounds(),n=m.merge([e,t]);e.x-=n.x,e.y-=n.y,t.x-=n.x,t.y-=n.y,this.paginationGroup.setBounds(n),this.prevButton.setBounds(e),this.nextButton.setBounds(t),this.prevButton.setEnabled(0!==i.currentPage),this.nextButton.setEnabled(i.currentPage!==i.totalPages-1),this.nextButton.setCursor(i.getCursor("next")),this.prevButton.setCursor(i.getCursor("previous"))}}createPaginationButtons(e){const{ctx:t,pagination:i}=e;this.prevButton||(this.prevButton=t.proxyInteractionService.createProxyElement({type:"button",textContent:{id:"ariaLabelLegendPagePrevious"},tabIndex:0,parent:this.paginationGroup}),this.prevButton.addListener("click",(t=>this.onPageButton(e,t,"previous"))),this.prevButton.addListener("mouseenter",(()=>i.onMouseHover("previous"))),this.prevButton.addListener("mouseleave",(()=>i.onMouseHover(void 0)))),this.nextButton||(this.nextButton=t.proxyInteractionService.createProxyElement({type:"button",textContent:{id:"ariaLabelLegendPageNext"},tabIndex:0,parent:this.paginationGroup}),this.nextButton.addListener("click",(t=>this.onPageButton(e,t,"next"))),this.nextButton.addListener("mouseenter",(()=>i.onMouseHover("next"))),this.nextButton.addListener("mouseleave",(()=>i.onMouseHover(void 0))))}destroyPaginationButtons(){this.nextButton?.destroy(),this.prevButton?.destroy(),this.nextButton=void 0,this.prevButton=void 0}onPageButton(e,t,i){e.pagination.onClick(t.sourceEvent,i),this.updatePaginationProxyButtons(e,!1)}onDataUpdate(e,t){this.dirty=e.length!==t.length||e.some(((i,n,s)=>{const[a,o]=[t[n],e[n]];return a.id!==o.id}))}onLocaleChanged(e,t){const i=e.length;e.each((({proxyButton:e},s,a)=>{const o=e?.getElement();if(null!=o){const e=(0,n.boc)(t.getItemLabel(s));o.textContent=this.getItemAriaText(e,a,i)}})),this.itemDescription.textContent=this.getItemAriaDescription()}onPageChange(e){this.updateItemProxyButtons(e),this.updatePaginationProxyButtons(e,!1)}getItemAriaText(e,t,i){return t>=0&&e?(t++,this.ctx.localeManager.t("ariaLabelLegendItem",{label:e,index:t,count:i})):this.ctx.localeManager.t("ariaLabelLegendItemUnknown")}getItemAriaDescription(){return this.ctx.localeManager.t("ariaDescriptionLegendItem")}};function Jv(e,{itemId:t,seriesId:i,enabled:s,label:{text:a}},o){const r={defaultPrevented:!1,apiEvent:{type:e,itemId:t,seriesId:i,event:o,visible:s,text:(0,n.boc)(a),get defaultPrevented(){return r.defaultPrevented},preventDefault:()=>{r.defaultPrevented=!0}}};return r}var eS=(()=>{var e=class extends we{constructor(){super({name:"markerLabelGroup"}),this.symbolsGroup=this.appendChild(new ke({name:"legend-markerLabel-symbols",renderToOffscreenCanvas:!0,optimizeForInfrequentRedraws:!0})),this.label=this.appendChild(new Ue),this.pageIndex=Number.NaN,this.labelOpacity=1,this.symbolsOpacity=1,this.spacing=0,this.length=0,this.isCustomMarker=!1,this.isRtl=!1,this.marker=this.symbolsGroup.appendChild(new Sd({zIndex:1})),this.line=this.symbolsGroup.appendChild(new Gh({zIndex:0})),this.line.visible=!1,this.label.textBaseline="middle",this.label.y=1}destroy(){super.destroy(),this.proxyButton?.destroy()}getTextMeasureBBox(){return this.layout(),m.merge([this.symbolsGroup.getBBox(),this.label.getTextMeasureBBox()])}layout(){const{marker:e,line:t,length:i}=this;let n=0,s=0;if(e.visible){const{size:t}=e,a=Sd.anchor(e.shape);n=(a.x-.5)*t+i/2,s=(a.y-.5)*t,e.x=n,e.y=s,e.translationX=0,e.translationY=0}t.visible&&(t.x1=0,t.x2=i,t.y1=0,t.y2=0)}preRender(e){const t=super.preRender(e);return this.layout(),t}layoutLabel(){const{length:e,spacing:t,isRtl:i}=this;this.label.x=i?-t:e+t,this.label.textAlign=i?"right":"left"}computeBBox(){return this.layout(),super.computeBBox()}};return e.className="MarkerLabel",d([(0,n.s8C)("label")],e.prototype,"text",2),d([(0,n.s8C)("label")],e.prototype,"fontStyle",2),d([(0,n.s8C)("label")],e.prototype,"fontWeight",2),d([(0,n.s8C)("label")],e.prototype,"fontSize",2),d([(0,n.s8C)("label")],e.prototype,"fontFamily",2),d([(0,n.s8C)("label","fill")],e.prototype,"color",2),d([(0,n.s8C)("label","opacity")],e.prototype,"labelOpacity",2),d([(0,n.s8C)("symbolsGroup","opacity")],e.prototype,"symbolsOpacity",2),d([(0,n.SY0)((e=>e.layoutLabel()))],e.prototype,"spacing",2),d([(0,n.SY0)((e=>e.layoutLabel()))],e.prototype,"length",2),d([(0,n.k8u)()],e.prototype,"isCustomMarker",2),d([(0,n.SY0)((e=>e.layoutLabel()))],e.prototype,"isRtl",2),e})(),tS=.5;function iS(e){return null!=e&&Object.values(e).some((e=>void 0!==e))}var nS=(()=>{var e=class{constructor(e){this.ctx=e,this.id=(0,n.sX_)(this),this.group=new we({name:"legend",zIndex:n.Dcv.LEGEND}),this.itemSelection=_h.select(this.group,eS),this.containerNode=this.group.appendChild(new Ge({
1name:"legend-container"})),this.oldSize=[0,0],this.pages=[],this.paginationItemsOffsetX=0,this.maxPageSize=[0,0],this.paginationTrackingIndex=0,this.truncatedItems=new Set,this.highlightUpdateToken=0,this._data=[],this.size=[0,0],this._visible=!0,this.cleanup=new n._uV,this.group.visible=!1,this.pagination=new qv((()=>e.eventsHub.emit("chart:request-update",{type:n.GvF.SCENE_RENDER})),(e=>this.updatePageNumber(e))),this.pagination.attachPagination(this.group);const t=e.contextMenuRegistry?.builtins.items;t&&(t["toggle-series-visibility"].action=e=>this.contextToggleVisibility(e),t["toggle-other-series"].action=e=>this.contextToggleOtherSeries(e));let i=this.opts?.enabled;this.cleanup.register(e.chartState.observe((t=>{const n=t("options","legend.enabled");!1===i&&!0===n&&e.legendManager&&e.stateManager.restoreState(e.legendManager),i=n,this.updateGroupVisibility()})),e.eventsHub.on("active:load-memento",(e=>this.onActiveLoadMemento(e))),e.chartState.observe((e=>{const t=e("activeItem");"series-node"===t?.type&&this.ctx.highlightManager.updateHighlight(this.id)})),e.chartState.observe((e=>{const t=e("legendData");if(null==t)return;const i=Object.values(t).flat();this.data=i.filter((e=>!e.hideInLegend))})),e.layoutManager.registerElement(1,(e=>this.positionLegend(e))),e.eventsHub.on("locale:change",(()=>this.onLocaleChanged())),(()=>{t&&(delete t["toggle-series-visibility"].action,delete t["toggle-other-series"].action)}),(()=>this.group.remove())),this.domProxy=new Qv(this.ctx,this.id),e.legendManager&&this.ctx.historyManager.addMementoOriginator(e.legendManager)}set data(e){(0,n.DH9)(e,this._data)||(this.domProxy.onDataUpdate(this._data,e),this._data=e,this.syncProxyButtonStates(e),this.updateGroupVisibility())}get data(){return this._data}syncProxyButtonStates(e){const t=new Map(e.map((e=>[e.itemId,e.enabled])));this.itemSelection.each((({proxyButton:e},{itemId:i})=>{if(null==e)return;const n=t.get(i);null!=n&&e.setChecked(n)}))}set visible(e){this._visible=e,this.ctx.chartState.setValue("legendVisible",e),this.updateGroupVisibility()}get visible(){return this._visible}get opts(){return this.ctx.chartState.getValue("options","legend")}destroy(){this.ctx.domManager.removeChild("canvas-overlay",`${this.id}-toolbar`),this.ctx.domManager.removeChild("canvas-overlay",`${this.id}-pagination`),this.cleanup.flush(),this.itemSelection.clear()}updateGroupVisibility(){const e=this.ctx.chartState.getValue("options");if(void 0===e)return;const t=e.legend?.enabled??!1;this.group.visible=t&&this.visible&&this.data.length>0}updateItemSelection(){const e=[...this.data];this.opts.reverseOrder&&e.reverse(),this.itemSelection.update(e)}isInteractive(){const{toggleSeries:e,listeners:{legendItemClick:t,legendItemDoubleClick:i},item:{tooltip:n}}=this.opts,s=null!=n&&"never"!==n.visible;return e||null!=i||null!=t||s}hasEnabledContextMenu(){return null!=this.ctx.contextMenuRegistry&&(this.ctx.chartState.getValue("options","contextMenu")?.enabled??!0)}checkInteractionState(){const{interactionManager:e}=this.ctx;return e.isState(1)||e.isState(32)}attachLegend(e){e.appendChild(this.group)}getItemLabel(e){const{formatter:t}=this.opts.item.label;if(t){const i=e.datum;return this.cachedCallWithContext(t,{itemId:e.itemId,value:e.label.text,seriesId:e.seriesId,...i&&{datum:i}})}return e.label.text}calcLayout(e,t){const{item:i}=this.opts,{padding:s,label:a,maxWidth:o,label:{maxLength:r=1/0,fontStyle:l,fontWeight:h,fontSize:c,fontFamily:d}}=i;this.updateItemSelection();const u=[],p=(0,n.K$y)(a),g=o??.8*e,{markerWidth:m,anyLineEnabled:y}=this.calculateMarkerWidth(),{isRtl:f}=this.ctx.domManager;if(this.itemSelection.each(((e,t)=>{e.fontStyle=l,e.fontWeight=h,e.fontSize=c,e.fontFamily=d,e.isRtl=f;const s=this.updateMarkerLabel(e,t,m,y,i),a=t.itemId??t.id,o=this.getItemLabel(t),x=(0,n.boc)(o,"<unknown>").replace(n.g3U," ");e.text=this.truncate(x,r,g,s,p,a),u.push(e.getTextMeasureBBox())})),e=Math.max(1,e),t=Math.max(1,t),!Number.isFinite(e))return{};[e,t]=this.updateContainer(e,t);const x=this.size,b=this.oldSize;x[0]=e,x[1]=t,x[0]===b[0]&&x[1]===b[1]||(b[0]=x[0],b[1]=x[1]);const{pages:v,maxPageHeight:S,maxPageWidth:M}=this.updatePagination(u,e,t),k=this.pages;if(this.pages=v,this.maxPageSize=[M-s.left-s.right,S-s.top-s.bottom],null!=this.pendingPage&&this.pages.length>0){const e=this.pendingPage;this.pendingPage=void 0,this.pagination.setPage(e)}const D=this.pagination.currentPage,w=this.pages[D];return this.pages.length<1||!w?(this.visible=!1,{oldPages:k}):(this.visible=!0,this.updatePositions(D),this.update(),{oldPages:k})}isCustomMarker(e,t){return e&&void 0!==t&&"string"!=typeof t}calcSymbolsEnabled(e,t){const i=!t||(e.marker.enabled??!0);
1return{markerEnabled:i,lineEnabled:!(!e.line||!t),isCustomMarker:this.isCustomMarker(i,e.marker.shape)}}calcSymbolsLengths(e,t,i,n){const{marker:s,line:a}=n;let o;const{shape:r}=e.marker;if(this.isCustomMarker(t,r)){const e=new Sd;e.shape=r,e.updatePath();const t=e.getBBox();o=Math.max(t.width,t.height)}return{markerLength:t?s.size:0,lineLength:i?a.length:0,customMarkerSize:o}}calculateMarkerWidth(){const{item:e}=this.opts,{showSeriesStroke:t}=e;let i=0,n=!1;return this.itemSelection.each(((s,a)=>{const{symbol:o}=a,{lineEnabled:r,markerEnabled:l}=this.calcSymbolsEnabled(o,t),{markerLength:h,lineLength:c,customMarkerSize:d=-1/0}=this.calcSymbolsLengths(o,l,r,e);i=Math.max(i,c,d,h),n||(n=r)})),{markerWidth:i,anyLineEnabled:n}}updateMarkerLabel(e,t,i,s,a){const{marker:o,padding:r,showSeriesStroke:l}=a,{symbol:h}=t;let c=r.left+r.right;const{markerEnabled:d,isCustomMarker:u}=this.calcSymbolsEnabled(h,l);(d||s)&&(c+=o.padding.right+i);const{marker:p,line:g}=e;return p.visible=d,p.visible&&(p.shape=o.shape??h.marker.shape??"square",p.size=o.size,p.setStyleProperties(this.getMarkerStyles((0,n.Go6)(h),t.enabled))),g.visible=s,g.visible&&g.setStyleProperties(this.getLineStyles(h,t.enabled)),e.length=i,e.spacing=o.padding.right,e.isCustomMarker=u,c}updateContainer(e,t){const i=this.getContainerStyles();return this.containerNode.width=0,this.containerNode.height=0,this.containerNode.setStyleProperties(i),this.containerNode.cornerRadius=i.cornerRadius,[e-=2*i.strokeWidth+i.padding.left+i.padding.right,t-=2*i.strokeWidth+i.padding.top+i.padding.bottom]}truncate(e,t,i,s,a,o){let r=!1;e.length>t&&(e=e.substring(0,t),r=!0);const l=(0,n.rTr)(e,a,i-s,r);return(0,n.KQS)(l)?this.truncatedItems.add(o):this.truncatedItems.delete(o),l}updatePagination(e,t,i){const{item:s,pagination:a,orientation:o}=this.opts,r=Math.min(this.paginationTrackingIndex,e.length),{isRtl:l}=this.ctx.domManager;this.pagination.orientation=o,this.pagination.isRtl=l,this.pagination.translationX=0,this.pagination.translationY=0;const{pages:h,maxPageHeight:c,maxPageWidth:d,paginationBBox:u,paginationVertical:p}=this.calculatePagination(e,t,i,a),g=h.findIndex((e=>e.endIndex>=r));this.pagination.currentPage=(0,n.qE8)(0,g,Math.max(0,h.length-1));const{marker:m,padding:y}=s,f=d-y.left-y.right,x=c-y.top-y.bottom;let b=0,v=-u.y-m.size/2;p?(l&&(b=t-u.width+u.x),v+=x+8):l?(b=-u.x,v+=(x-u.height)/2):(b+=-u.x+f+8,v+=(x-u.height)/2),this.paginationItemsOffsetX=l&&!p&&this.pagination.visible?u.width+8:0,this.pagination.translationX=b,this.pagination.translationY=v,this.pagination.update(a),this.pagination.updateMarkers(a);let S=0;return this.itemSelection.each(((e,t,i)=>{i>(h[S]?.endIndex??1/0)&&S++,e.pageIndex=S})),{maxPageHeight:c,maxPageWidth:d,pages:h}}calculatePagination(e,t,i,s){const{item:a,maxWidth:o,maxHeight:r,position:l,orientation:h}=this.opts,{padding:c}=a,{placement:d}
1=(0,n.Zz1)(l),u=["left","left-top","left-bottom","right","right-top","right-bottom"].includes(d);this.pagination.update(s),this.pagination.updateMarkers(s);let p=this.pagination.getBBox(),g=new m(0,0,0,0),y=[],f=0,x=0,b=0;const v=void 0!==o&&void 0!==r;do{if(b++>10){this.ctx.logger.warn("unable to find stable legend layout.");break}p=g;const n=Uv({orientation:h,bboxes:e,maxWidth:t-(u?0:p.width),maxHeight:i-(u?p.height:0),itemPaddingY:c.top+c.bottom,itemPaddingX:c.left+c.right,forceResult:v});y=n?.pages??[],f=n?.maxPageWidth??0,x=n?.maxPageHeight??0;const a=y.length;if(this.pagination.visible=a>1,this.pagination.totalPages=a,this.pagination.update(s),this.pagination.updateMarkers(s),g=this.pagination.getBBox(),!this.pagination.visible)break}while((S=g).width!==p.width||S.height!==p.height);var S;return{maxPageWidth:f,maxPageHeight:x,pages:y,paginationBBox:g,paginationVertical:u}}updatePositions(e=0){const{opts:{item:{padding:t}},itemSelection:i,pages:n}=this;if(n.length<1||!n[e])return;const{columns:s,startIndex:a,endIndex:o}=n[e];let r=0,l=0;const h=s.length,c=s[0].indices.length,d="horizontal"===this.opts.orientation,u=s[0].bboxes[0].height+t.top+t.bottom,{isRtl:p}=this.ctx.domManager,g=[],m=s.reduce(((e,t)=>e+t.columnWidth),0);i.each(((e,t,i)=>{if(i<a||i>o)return void(e.visible=!1);const n=i-a;let y,f;d?(y=n%h,f=Math.floor(n/h)):(y=Math.floor(n/c),f=n%c),e.visible=!0;const x=s[y];x&&(l=Math.floor(u*f),r=p?Math.floor(m-(g[f]??0)):Math.floor(g[f]??0),g[f]=(g[f]??0)+x.columnWidth,e.translationX=r+this.paginationItemsOffsetX,e.translationY=l)}))}updatePageNumber(e){const{itemSelection:t,group:i,pagination:s,pages:a,opts:{pagination:o}}=this,r=a[e];if(!r)return;const{startIndex:l,endIndex:h}=r;0===l?this.paginationTrackingIndex=0:e===a.length-1?this.paginationTrackingIndex=h:this.paginationTrackingIndex=Math.floor((l+h)/2),this.pagination.update(o),this.pagination.updateMarkers(o),this.updatePositions(e),this.domProxy.onPageChange({itemSelection:t,group:i,pagination:s,interactive:this.isInteractive(),contextMenuAvailable:this.hasEnabledContextMenu()}),this.ctx.eventsHub.emit("chart:request-update",{type:n.GvF.SCENE_RENDER})}restorePage(e){this.pendingPage=e}update(){const{color:e,disabledStyle:t}=this.opts.item.label,i=this.disabledOpacities();this.itemSelection.each(((n,s)=>{n.color=s.enabled?e:t?.color??e,n.opacity=s.enabled?1:i.item,n.symbolsOpacity=s.enabled?1:i.symbols,n.labelOpacity=s.enabled?1:i.label})),this.updateContextMenu()}updateContextMenu(){const e=this.opts.toggleSeries?"show":"hide";this.ctx.contextMenuRegistry?.toggle("toggle-series-visibility",e),this.ctx.contextMenuRegistry?.toggle("toggle-other-series",e)}disabledOpacities(){const{marker:e,line:t,label:i}=this.opts.item,n=iS(e.disabledStyle)||iS(t.disabledStyle),s=n||iS(i.disabledStyle);return{item:s?1:tS,symbols:s&&!n?tS:1,marker:n?e.disabledStyle?.opacity??tS:1,line:n?t.disabledStyle?.opacity??tS:1,label:s?i.disabledStyle?.opacity??.25:tS}}getLineStyles(e,t){const{stroke:i,strokeOpacity:n=1,strokeWidth:s,lineDash:a}=e.line??{},o=Math.min(2,s??1),{disabledStyle:r}=this.opts.item.line,l=t?void 0:r;return{stroke:l?.stroke??i,strokeOpacity:l?.strokeOpacity??n,strokeWidth:this.opts.item.line.strokeWidth??o,lineDash:l?.lineDash??a,lineDashOffset:l?.lineDashOffset,opacity:t?1:this.disabledOpacities().line}}getMarkerStyles({marker:e},t){const{stroke:i,strokeOpacity:s=1,fillOpacity:a=1,strokeWidth:o,lineDash:r,lineDashOffset:l}=e,h=Math.min(2,o??1),{disabledStyle:c}=this.opts.item.marker,d=t?void 0:c,u=null==d?.fill?e.fill:(0,n.Go6)(d.fill);return(0,n.EDy)(u)&&(u.width=8,u.height=8,u.padding=1,u.strokeWidth=Math.min(2,u.strokeWidth??2)),(0,n.BF9)(u)&&(u.fit="contain",u.width=void 0,u.height=void 0,u.repeat="no-repeat"),{...Ad({fill:u,stroke:d?.stroke??i,strokeOpacity:d?.strokeOpacity??s,fillOpacity:d?.fillOpacity??a,strokeWidth:d?.strokeWidth??this.opts.item.marker.strokeWidth??h,lineDash:r,lineDashOffset:l},n.Xaq,n.Tmp,n.Wx1),opacity:t?1:this.disabledOpacities().marker}}getContainerStyles(){const{border:e,cornerRadius:t,fill:i,fillOpacity:s,padding:a}=this.opts,{stroke:o,strokeOpacity:r,strokeWidth:l,enabled:h}=e,c="number"==typeof a;return Ad({cornerRadius:t,fill:i,fillOpacity:s,padding:{top:c?a:a.top??0,right:c?a:a.right??0,bottom:c?a:a.bottom??0,left:c?a:a.left??0},stroke:o,strokeOpacity:r,strokeWidth:h?l:0},n.Xaq,n.Tmp,n.Wx1)}computePagedBBox(){const e=ke.computeChildrenBBox(this.group.excludeChildren({name:"legend-container"}));if(this.pages.length>1){const[t,i]=this.maxPageSize;e.height=Math.max(i,e.height),e.width=Math.max(t,e.width)}const{strokeWidth:t,padding:i}=this.getContainerStyles();return e.grow(i).grow(t),e}findNode(e){const{datum:t,proxyButton:i}=this.itemSelection.select((t=>t.datum?.itemId===e.itemId))[0]??{};if(void 0===t||void 0===i)throw new Error(`AG Charts - Missing required properties { datum: ${JSON.stringify(t)}, proxyButton: ${JSON.stringify(i)} }`);return{datum:t,proxyButton:i}}contextToggleVisibility(e){const{datum:t,proxyButton:i}=this.findNode(e);this.doClick(e.event,t,i),this.clearHighlight()}contextToggleOtherSeries(e){this.doDoubleClick(e.event,this.findNode(e).datum),this.clearHighlight()}onContextClick(e,t){if(this.checkInteractionState())return;const{sourceEvent:i}=e,n=t.unsafeNonNullDatum;this.clearHighlight();const s=this.ctx.contextMenuRegistry?.builtins.items;s&&(s["toggle-series-visibility"].enabled=!(this.opts.preventHidingAll&&this.contextMenuDatum?.enabled&&this.getVisibleItemCount()<=1));const a=this.ctx.chartService.series.length>1&&!0!==this.ctx.chartService.series[0]?.getLegendData("category")[0]?.hideToggleOtherSeries?"show":"hide";this.ctx.contextMenuRegistry?.toggle("toggle-other-series",a);const{offsetX:o,offsetY:r}=i,{canvasX:l,canvasY:h}=Me.toCanvasPoint(t,o,r);
1this.ctx.contextMenuRegistry?.dispatchContext("legend-item",{widgetEvent:e,canvasX:l,canvasY:h},{legendItem:n})}onClick(e,t,i){this.doClick(e,t,i)&&e.preventDefault()}getVisibleItemCount(){return this.ctx.chartService.series.flatMap((e=>e.getLegendData("category"))).filter((e=>e.enabled)).length}doClick(e,t,i){const{opts:{listeners:{legendItemClick:s},preventHidingAll:a,toggleSeries:o},ctx:{chartService:r}}=this;if(!t)return!1;const{legendType:l,seriesId:h,itemId:c,enabled:d,legendItemName:u}=t,p=r.series.find((e=>e.id===h));if(!p)return!1;let g=d;const m=Jv("click",t,e);if(s&&(0,n.cVk)([p.properties,this.ctx.chartService],s,m.apiEvent),m.defaultPrevented)return!0;if(o){if(g=!d,a&&!g){this.getVisibleItemCount()<2&&(g=!0)}i.setChecked(g),this.ctx.eventsHub.emit("legend:item-click",{legendType:l,series:p,itemId:c,enabled:g,legendItemName:u})}return this.updateHighlight(g,t,p),this.ctx.eventsHub.emit("chart:request-update",{type:n.GvF.PROCESS_DATA,opts:{forceNodeDataRefresh:!0,skipAnimations:t.skipAnimations??!1}}),!0}onDoubleClick(e,t){this.doDoubleClick(e,t)&&e.preventDefault()}doDoubleClick(e,t){const{opts:{listeners:{legendItemDoubleClick:i},toggleSeries:s},ctx:{chartService:a}}=this;if(!t)return!1;const{legendType:o,id:r,itemId:l,seriesId:h}=t,c=a.series.find((e=>e.id===r));if(!c)return!1;const d=Jv("dblclick",t,e);if(i&&(0,n.cVk)([c.properties,this.ctx.chartService],i,d.apiEvent),d.defaultPrevented)return!0;if(s){const e=a.series.flatMap((e=>e.getLegendData("category")));let t=0;const i=new Set;for(const n of e)n.enabled&&(t+=1,null!=n.legendItemName&&i.add(n.legendItemName));i.size>0&&(t=i.size);const n=e.find((e=>e.itemId===l&&e.seriesId===h));this.ctx.eventsHub.emit("legend:item-double-click",{legendType:o,series:c,itemId:l,numVisibleItems:t,enabled:n?.enabled??!1,legendItemName:n?.legendItemName})}return this.ctx.eventsHub.emit("chart:request-update",{type:n.GvF.PROCESS_DATA,opts:{forceNodeDataRefresh:!0}}),!0}toTooltipMeta(e,t){let i,n;return e instanceof FocusEvent?({x:i,y:n}=Me.toCanvas(t).computeCenter()):(e.preventDefault(),({canvasX:i,canvasY:n}=Me.toCanvasPoint(t,e.offsetX,e.offsetY))),{canvasX:i,canvasY:n,showArrow:!1}}getTooltipContent(e){const t=this.opts.item.tooltip,i=this.truncatedItems.has(e.itemId??e.id),s=null!=t?.text||null!=t?.renderer,a=t?.visible??(s?"always":"auto");if("never"!==a&&("auto"!==a||i)){if(t?.renderer){const i={seriesId:e.seriesId,itemId:e.itemId??e.id,text:(0,n.boc)(e.label.text),visible:e.enabled},s=this.cachedCallWithContext(t.renderer,i);if(""===s)return;if(null!=s)return[{type:"raw",rawHtmlString:(0,n.i$)(s)}]}return null!=t?.text?[{type:"structured",title:t.text}]:[{type:"structured",title:this.getItemLabel(e)}]}}onHover(e,t,i=!1){if(this.checkInteractionState())return;if(!this.opts.enabled)throw new Error("AG Charts - onHover handler called on disabled legend");this.pagination.setPage(t.pageIndex);const n=t.datum,s=n?this.ctx.chartService.series.find((e=>e.id===n?.id)):void 0,a=n?this.getTooltipContent(n):void 0;if(a){const i=this.toTooltipMeta(e,t);this.ctx.tooltipManager.updateTooltip(this.id,i,a)}else this.ctx.tooltipManager.removeTooltip(this.id,void 0,!0);this.updateHighlight(n?.enabled,n,s,void 0,i),this.ctx.eventsHub.emit("legend:item-hover",null)}onLeave(e=!1){this.checkInteractionState()||(this.ctx.tooltipManager.removeTooltip(this.id,void 0,!0),this.clearHighlight(e))}clearHighlight(e=!1){this.updateHighlight(void 0,void 0,void 0,void 0,e)}updateHighlight(e,t,i,n,s=!1){if(this.checkInteractionState())return;const a=e=>{if(void 0===e)return this.ctx.activeManager.clear();{const t=e.nodeDatum.series.id,i=e.itemId;return this.ctx.activeManager.update({type:"legend",seriesId:t,itemId:i},void 0)}},o=e=>{a(e)||this.ctx.highlightManager.updateHighlight(this.id,e?.nodeDatum)},r=e=>{const t=++this.highlightUpdateToken;this.ctx.interactionManager.isState(64)||n?.initialState?o(e):this.ctx.interactionManager.isState(4)?s?o(e):this.ctx.animationManager.onBatchStop((()=>{t===this.highlightUpdateToken&&o(e)})):void 0===e&&o(e)};if(!0===e&&void 0!==i&&void 0!==t&&!(!0===t?.suppressHighlight)){const e=t.itemId,n=function(e,t){switch(typeof t.itemId){case"number":return{series:e,itemId:void 0,datum:void 0,datumIndex:t.itemId,legendItemName:t.legendItemName};case"string":return{series:e,itemId:t.itemId,datum:void 0,datumIndex:Number.NaN,legendItemName:t.legendItemName};default:return t.itemId}}(i,t);r({itemId:e,nodeDatum:n})}else r(void 0)}onActiveLoadMemento(e){const{activeItem:t}=e;if("legend"!==t?.type)return this.ctx.highlightManager.updateHighlight(this.id
1);const i=this.data.find((e=>e.seriesId===t.seriesId&&e.itemId===t.itemId)),n=this.ctx.chartService.series.find((e=>e.id===t.seriesId));if(void 0===n)this.ctx.logger.warn(`Cannot find seriesId: "${t.seriesId}"`),e.reject();else if(void 0===i){const i=JSON.stringify({seriesId:t.seriesId,itemId:t.itemId});this.ctx.logger.warn(`cannot find legend item: ${i}`),e.reject()}else this.updateHighlight(i.enabled,i,n,e)}onLocaleChanged(){this.updateItemSelection(),this.domProxy.onLocaleChanged(this.itemSelection,this)}positionLegend(e){if(null==this.opts)return;const t=this.positionLegendScene(e);this.positionLegendDOM(t)}positionLegendScene(e){const{enabled:t,position:i,spacing:s}=this.opts;if(!t||!this.data.length)return;const{placement:a,floating:o,xOffset:r,yOffset:l}=(0,n.Zz1)(i),h=o?new m(0,0,e.width,e.height):e.layoutBox,{x:c,y:d,width:u,height:p}=h,[g,y]=this.calculateLegendDimensions(h),{oldPages:f}=this.calcLayout(g,y),x=this.computePagedBBox();if(this.visible){let e=function(e){};let t,i;switch(a){case"top":t=(u-x.width)/2,i=0;break;case"bottom":t=(u-x.width)/2,i=p-x.height;break;case"right":t=u-x.width,i=(p-x.height)/2;break;case"left":t=0,i=(p-x.height)/2;break;case"top-right":case"right-top":t=u-x.width,i=0;break;case"top-left":case"left-top":t=0,i=0;break;case"bottom-right":case"right-bottom":t=u-x.width,i=p-x.height;break;case"bottom-left":case"left-bottom":t=0,i=p-x.height;break;default:e(a)}if(!o){let t,i;switch(a){case"top":case"top-right":case"top-left":t=x.height+s,i="top";break;case"bottom":case"bottom-right":case"bottom-left":t=x.height+s,i="bottom";break;case"left":case"left-top":case"left-bottom":t=x.width+s,i="left";break;case"right":case"right-top":case"right-bottom":t=x.width+s,i="right";break;default:e(a)}h.shrink(t,i)}t+=r,i+=l,this.group.translationX=Math.floor(c+t-x.x),this.group.translationY=Math.floor(d+i-x.y),this.containerNode.x=x.x,this.containerNode.y=x.y,this.containerNode.width=x.width,this.containerNode.height=x.height}return f}positionLegendDOM(e){const{ctx:t,itemSelection:i,pagination:n,pages:s,group:a}=this,o=this.visible&&this.opts.enabled,r=this.isInteractive();this.domProxy.update({visible:o,interactive:r,contextMenuAvailable:this.hasEnabledContextMenu(),ctx:t,itemSelection:i,group:a,pagination:n,oldPages:e,newPages:s,datumReader:this,itemListener:this})}calculateLegendDimensions(e){const{width:t,height:i}=e,{maxWidth:s,maxHeight:a,position:o}=this.opts,{placement:r}=(0,n.Zz1)(o),l=t/i;let h,c;switch(r){case"top":case"top-left":case"top-right":case"bottom":case"bottom-left":case"bottom-right":{const e=l<1?Math.min(.5,1/l*.2):.2;h=s?Math.min(s,t):t,c=a?Math.min(a,i):Math.round(i*e);break}case"left":case"left-top":case"left-bottom":case"right":case"right-top":case"right-bottom":{const e=l>1?Math.min(.5,.25*l):.25;h=s?Math.min(s,t):Math.round(t*e),c=a?Math.min(a,i):i;break}}return[h,c]}cachedCallWithContext(e,t){const{callbackCache:i,chartService:n,chartState:s}=this.ctx,a={context:s.getValue("options","context")};return i.call([a,n],e,t)}};return e.className="Legend",e})(),sS=class{constructor(e){this.mementoOriginatorKey="legend",this.chartState=e.chartState,this.logger=e.logger}createMemento(){return this.getData().filter((({hideInLegend:e,isFixed:t})=>!e&&!t)).map((({enabled:e,seriesId:t,itemId:i,legendItemName:n})=>({visible:e,seriesId:t,itemId:i,legendItemName:n})))}guardMemento(e){return null==e||(0,n.cyL)(e)}restoreMemento(e,t,i){if(i)for(const e of i){const{seriesId:t,data:i}=this.getRestoredData(e)??{};t&&i&&this.updateData(t,i)}}getRestoredData(e){const{seriesId:t,itemId:i,legendItemName:n,visible:s}=e;if(t){const e=(this.legendDataRecord[t]??[]).map((e=>{const n=e.seriesId===t&&(!i||e.itemId===i);return n&&e.isFixed&&this.warnFixed(e.seriesId,e.itemId),!e.isFixed&&n?{...e,enabled:s}:e}));return{seriesId:t,data:e}}
1if(null!=i||null!=n)for(const e of this.getData()){if(null!=i&&e.itemId!==i||null!=n&&e.legendItemName!==n)continue;if(e.isFixed)return void this.warnFixed(e.seriesId,i);const t=(this.legendDataRecord[e.seriesId]??[]).map((e=>e.itemId===i||e.legendItemName===n?{...e,enabled:s}:e));return{seriesId:e.seriesId,data:t}}}warnFixed(e,t){this.logger.warnOnce(`The legend item with seriesId [${e}] and itemId [${t}] is not configurable, this series item cannot be toggled through the legend.`)}get legendDataRecord(){return this.chartState.getValue("legendData")??{}}updateData(e,t=[]){this.chartState.setValue("legendData",{...this.legendDataRecord,[e]:t})}clearData(){this.chartState.setValue("legendData",{})}toggleItem(e,t,i,n){if(n){const t=this.legendDataRecord;for(const i of this.getData()){const s=(t[i.seriesId]??[]).map((t=>t.legendItemName===n?{...t,enabled:e}:t));this.updateData(i.seriesId,s)}return}const s=this.getData(t),a=1===s.length,o=s.map((t=>null==i&&a||t.itemId===i?{...t,enabled:e}:t));this.updateData(t,o)}getData(e){const t=this.legendDataRecord;return e?t[e]??[]:Object.values(t).flat()}getDatum({seriesId:e,itemId:t}={}){return this.getData(e).find((e=>e.itemId===t))}getSeriesEnabled(e){const t=this.getData(e);if(t.length>0)return t.some((e=>e.enabled))}getItemEnabled({seriesId:e,itemId:t}={}){return this.getDatum({seriesId:e,itemId:t})?.enabled??!0}},aS=pm({type:"plugin",name:"legend",version:Ot,options:n._LU,themeTemplate:{...n._n,enabled:{$and:[{$greaterThan:[{$size:{$path:"/series"}},1]},{$or:[{$isChartType:"cartesian"},{$isChartType:"standalone"},{$and:[{$isChartType:"polar"},{$not:{$isSeriesType:"pie"}},{$not:{$isSeriesType:"donut"}}]}]}]},position:n.v9C.BOTTOM,orientation:{$if:[{$or:[{$eq:[{$path:"./position"},n.v9C.LEFT]},{$eq:[{$path:"./position"},n.v9C.LEFT_TOP]},{$eq:[{$path:"./position"},n.v9C.LEFT_BOTTOM]},{$eq:[{$path:"./position"},n.v9C.RIGHT]},{$eq:[{$path:"./position"},n.v9C.RIGHT_TOP]},{$eq:[{$path:"./position"},n.v9C.RIGHT_BOTTOM]},{$eq:[{$path:"./position/placement"},n.v9C.LEFT]},{$eq:[{$path:"./position/placement"},n.v9C.LEFT_TOP]},{$eq:[{$path:"./position/placement"},n.v9C.LEFT_BOTTOM]},{$eq:[{$path:"./position/placement"},n.v9C.RIGHT]},{$eq:[{$path:"./position/placement"},n.v9C.RIGHT_TOP]},{$eq:[{$path:"./position/placement"},n.v9C.RIGHT_BOTTOM]}]},"vertical","horizontal"]},spacing:30,listeners:{},toggleSeries:!0,item:{padding:{$applyPadding:{top:4,right:8,bottom:4,left:8}},marker:{size:15,padding:{$applyPadding:8}},line:{length:25},showSeriesStroke:!0,label:{color:{$ref:"textColor"},fontSize:{$rem:n.q8q.SMALL},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"}}},reverseOrder:!1,pagination:{marker:{shape:"triangle",size:12,padding:{$applyPadding:8}},activeStyle:{fill:{$ref:"foregroundColor"},strokeWidth:1,strokeOpacity:1},inactiveStyle:{fill:{$ref:"subtleTextColor"},strokeWidth:1,strokeOpacity:1},highlightStyle:{fill:{$ref:"foregroundColor"},strokeWidth:1,strokeOpacity:1},label:{color:{$ref:"textColor"},fontSize:{$rem:n.q8q.SMALL},fontFamily:{$ref:"fontFamily"}}},fill:{$if:[{$path:["./position/floating",!1]},{$ref:"chartBackgroundColor"},"transparent"]}},create:e=>{const t=new nS(e);return t.attachLegend(e.scene),t},register:e=>{e.has("legendManager")||e.service("legendManager",(e=>new sS(e)))}}),oS=(()=>{var e=class extends Jm{getVisibleDomain(e){const t=(0,n.cS7)(e[0]),i=(0,n.cS7)(e[1]),[s,a]=this.visibleRange;if(e.length<2)return[t,i];const o=Math.min(t,i),r=Math.max(t,i);if(o>=0){const e=Math.log(t),n=Math.log(i)-e;return[Math.exp(e+s*n),Math.exp(e+a*n)]}if(r<=0){const e=-Math.log(-t),n=-Math.log(-i)-e;return[-Math.exp(-(e+s*n)),-Math.exp(-(e+a*n))]}return[Number.NaN,Number.NaN]}normaliseDataDomain(e){const{min:t,max:i,preferredMin:s,preferredMax:a}=this.options,{extent:o,clipped:r}=(0,n.Myf)(e.domain,t,i,s,a,void 0,e.sortMetadata?.sortOrder);return o[0]<0&&o[1]>0||e.domain[0]<0&&e.domain[1]>0?(this.moduleCtx.logger.warn("The log axis domain crosses zero, the chart data cannot be rendered. See log axis documentation for more information."),{domain:[],clipped:r}):o[0]===(0,n.s1j)(o[0])||o[1]===(0,n.s1j)(o[1])||e.domain[0]===(0,n.s1j)(e.domain[0])||e.domain[1]===(0,n.s1j)(e.domain[1])?(this.moduleCtx.logger.warn("The log axis domain contains a value of 0, the chart data cannot be rendered. See log axis documentation for more information."),{domain:[],clipped:r}):{domain:o,clipped:r}}get base(){return this.optionsBase??this.scale.base}get optionsBase(){return this.options.base}constructor(e,t,i){super(e,t,new _m,i),this.syncScaleBase()}syncScaleBase(){const e=this.optionsBase;null!=e&&(this.scale.base=e)}updateScale(){this.syncScaleBase(),super.updateScale()}};return e.className="LogAxis",e.type="log",e})();function rS(e,t,i,s,a,o,r){const l=e[o];if(void 0===l)return-1;const h=Number.isFinite(t)?(0,n.mYB)(l,t,i,r):(0,n.qUX)(o,e.length),c=(0,n.XBY)(h,a);return o===s[c+n.qbB]||o===s[c+n.IXP]||o===s[c+n.jBM]||o===s[c+n.BNK]?c:-1}function lS(e,t,i,n,s,a,o,r,l){let h=0,c=0,d=-1;for(let r=0;r<o;r++){const o=rS(e,t,i,n,s,r,a);-1!==o&&(h++,o!==d&&(c++,d=o))}c++;
1const u=r?.length===h?r:new Uint32Array(h),p=l?.length===c?l:new Uint32Array(c);let g=0,m=0;d=-1;for(let r=0;r<o;r++){const o=rS(e,t,i,n,s,r,a);-1!==o&&(o!==d&&(p[m++]=g,d=o),u[g++]=r)}return p[m]=h-1,{indices:u,metaIndices:p}}function hS(e,t,i,s){const a=t.length;if(a<n.n9_)return;const[o,r]=e,{xNeedsValueOf:l,yNeedsValueOf:h,existingFilters:c}=s;let d=(0,n.OLL)(t,o,r,{xNeedsValueOf:l});const u=c?.find((e=>e.maxRange===d));let{indexData:p,valueData:g}=(0,n.iPk)(t,i,i,o,r,d,{xNeedsValueOf:l,yNeedsValueOf:h,reuseIndexData:u?.indexData,reuseValueData:u?.valueData}),{indices:m,metaIndices:y}=lS(t,o,r,p,d,l,a,u?.indices,u?.metaIndices);const f=[{maxRange:d,metaIndices:y,indices:m,indexData:p,valueData:g}];for(;m.length>10&&d>n.gjy;){const e=d,i=Math.trunc(e/2),s=c?.find((e=>e.maxRange===i)),a=(0,n.THQ)(p,g,e,{reuseIndexData:s?.indexData,reuseValueData:s?.valueData});d=a.maxRange,p=a.indexData,g=a.valueData;const h=m;let u=0,x=0,b=-1;for(const e of h){const i=rS(t,o,r,p,d,e,l);-1!==i&&(u++,i!==b&&(x++,b=i))}x++;const v=s?.indices?.length===u?s.indices:new Uint32Array(u),S=s?.metaIndices?.length===x?s.metaIndices:new Uint32Array(x);let M=0,k=0;b=-1;for(const e of h){const i=rS(t,o,r,p,d,e,l);-1!==i&&(i!==b&&(S[k++]=M,b=i),v[M++]=e)}S[k]=u-1,m=v,y=S,f.push({maxRange:d,metaIndices:y,indices:m,indexData:p,valueData:g})}return f.reverse(),f}function cS(e,t,i,n,s,a){return hS([i,n],e,t,{xNeedsValueOf:s,yNeedsValueOf:a})}var dS=(0,n.XB6)(cS);function uS(e,t,i,s,a,o,r){const l=t.resolveKeysById(a,"xValue",i),h=t.resolveColumnById(a,s,i,"mixed-numeric"),c=t.getDomain(a,"xValue","key",i),d=t.resolveColumnNeedsValueOf(a,"xValue",i),u=t.resolveColumnNeedsValueOf(a,s,i),{values:p,needsValueOf:g}=(0,n.QP0)(e,l,d),{xValues:m,domain:y}=(0,n.g3H)(e,p,c);return function(e,t,i,s){const a=t.length;if(a<n.n9_)return;const[o,r]=e,{xNeedsValueOf:l,yNeedsValueOf:h,targetRange:c,existingFilters:d}=s,u=(0,n.OLL)(t,o,r,{xNeedsValueOf:l}),p=Math.min(u,(0,n.Myt)(Math.max(c,n.gjy))),g=d?.find((e=>e.maxRange===p)),{indexData:m,valueData:y}=(0,n.iPk)(t,i,i,o,r,p,{xNeedsValueOf:l,yNeedsValueOf:h,reuseIndexData:g?.indexData,reuseValueData:g?.valueData}),{indices:f,metaIndices:x}=lS(t,o,r,m,p,l,a,g?.indices,g?.metaIndices);return{immediate:[{maxRange:p,indices:f,metaIndices:x,indexData:m,valueData:y}],computeRemaining:function(){const e=hS([o,r],t,i,{xNeedsValueOf:l,yNeedsValueOf:h,existingFilters:d});return e?.filter((e=>e.maxRange!==p))??[]}}}(y,m,u?h:(0,n.X_t)(h),{xNeedsValueOf:g,yNeedsValueOf:u,targetRange:o,existingFilters:r})}var pS=(()=>{var e=class extends ly{constructor(){super(...arguments),this.xName=void 0,this.fill="#c16068",this.fillOpacity=1,this.stroke="#874349",this.strokeWidth=2,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.interpolation=new n._eL,this.shadow=new $b,this.marker=new wd,this.label=new vt,this.tooltip=Of(),this.connectMissingData=!1}};return d([n.mAP],e.prototype,"xKey",2),d([n.mAP],e.prototype,"xName",2),d([n.mAP],e.prototype,"yKey",2),d([n.mAP],e.prototype,"yName",2),d([n.mAP],e.prototype,"selectedKey",2),d([n.mAP],e.prototype,"stackGroup",2),d([n.mAP],e.prototype,"normalizedTo",2),d([n.mAP],e.prototype,"fill",2),d([n.mAP],e.prototype,"fillOpacity",2),d([n.mAP],e.prototype,"stroke",2),d([n.mAP],e.prototype,"strokeWidth",2),d([n.mAP],e.prototype,"strokeOpacity",2),d([n.mAP],e.prototype,"lineDash",2),d([n.mAP],e.prototype,"lineDashOffset",2),d([n.mAP],e.prototype,"interpolation",2),d([n.mAP],e.prototype,"styler",2),d([n.mAP],e.prototype,"shadow",2),d([n.mAP],e.prototype,"marker",2),d([n.mAP],e.prototype,"label",2),d([n.mAP],e.prototype,"tooltip",2),d([n.mAP],e.prototype,"connectMissingData",2),e})(),gS={labelsEnabled:!1,labelPadding:{top:0,right:0,bottom:0,left:0},labelTextMeasurer:{measureLines:()=>({width:0,height:0})},labelFit:void 0,labelFitOverflow:void 0,labelStyled:!1,labelInsideOffset:void 0,labelInsideSize:void 0,labelAnchor:void 0};function mS(e){e.pointerEvents=1}var yS=class extends hy{constructor(){super(...arguments),this.placedLabelData=[]}placedLabelDatum(e){const t=this.writeLabelPoint(e.datum,e.x,e.y),i=t;return i.placement=e.placement??t.placement,null!=e.datum.fit&&(i.label={text:e.text,width:e.width,height:e.height,fontSize:e.fontSize}),t}resolveLabelContext(e,t){const i=this.labelProperty;if(!i.enabled)return gS;const{collision:s}=i,{insideOnly:a,offset:o,size:r}=function(e,t){const i=e.length>0&&e.every((e=>"inside"===e)),n=e.includes("inside")?zy(t):void 0;return{insideOnly:i,offset:n?{x:n.cx,y:n.cy}:void 0,size:!i&&n?{width:n.width,height:n.height}:void 0}}((0,n.$rL)(i.placement),e),l=a?(0,n.A_g)(i,!1,!0):void 0;return{labelsEnabled:!0,labelPadding:Dt(i),labelTextMeasurer:(0,n.K$y)(i),labelFit:l?_y(l,Gy(t,e,s.threshold??0)):(0,n.A_g)(i,!s.alwaysShow),labelFitOverflow:s.alwaysShow?l:void 0,labelStyled:null!=i.itemStyler,labelInsideOffset:o,labelInsideSize:r,labelAnchor:Sd.anchor(e)}}measureLabel(e,t){return(0,n.Wkl)(t,this.labelProperty,e)}
1getLabelData(){return this.isLabelEnabled()?this.contextNodeData?.labelData??[]:[]}getLabelDefaults(){const e=this.labelProperty;return(0,n.wSY)(e.collision,(0,n.$rL)(e.placement),e.spacing)}getLabelCandidateStyler(){return tf(this,this.labelProperty,this.makeLabelFormatterParams(),Jy)}getHighlightLabelData(e,t){const i=this.placedLabelData.filter((e=>e.datum.datumIndex===t.datumIndex)).map((e=>this.placedLabelDatum(e)));return 0===i.length?void 0:i}updatePlacedLabelData(e){this.placedLabelData=e,this.labelSelection.update(e.map((e=>this.placedLabelDatum(e))),mS),this.updateLabelNodes({labelSelection:this.labelSelection}),this.updateHighlightLabelSelection()}updateLabelSelection(e){return e.labelSelection.update(e.labelData,mS)}updateLabelNodes(e){if(0===e.labelSelection.length)return;const t=e.isHighlight??!1,i=this.ctx.highlightManager?.getActiveHighlight(),n=this.makeLabelFormatterParams(),s=this.labelProperty,a=Zy(s,"inside"),o=Zy(s,"outside"),r=It(s,a),l=It(s,o),h=null!=s.itemStyler,c=h?s:Mt(s,a),d=h?s:Mt(s,o);e.labelSelection.each(((e,s)=>{const u="inside"===s.placement,p=u?r:l,g=rf(this,s,n,u?c:d,t,i,void 0,h?u?a:o:void 0,{placement:s.placement}),{enabled:m,fontStyle:y,fontWeight:f,fontSize:x,fontFamily:b,color:v}=g;if(m&&s?.labelText){const i=this.readLabelPoint(s),n=h?At(g):p;e.fontStyle=y,e.fontWeight=f,e.fontSize=s.label.fontSize??x,e.fontFamily=b,e.textBaseline="top",e.text=s.label.text,e.x=i.x+n.x,e.y=i.y+n.y,e.fill=v,e.visible=!0,e.fillOpacity=this.getHighlightStyle(t,s.datumIndex).opacity??1,e.setBoxing(g)}else e.visible=!1}))}},fS=(()=>{var e=class e extends yS{constructor(e){super({moduleCtx:e,propertyKeys:oy,propertyNames:ry,categoryKey:"xValue",pathsPerSeries:["fill","stroke"],pathsZIndexSubOrderOffset:[0,1e3],datumSelectionGarbageCollection:!1,segmentedDataNodes:!1,usesPlacedLabels:!0,pickModes:[2,0],animationResetFns:{path:tb({getVisible:()=>this.visible,getOpacity:()=>this.getOpacity()}),label:Nf,datum:(e,t)=>({opacity:1,scalingX:1,scalingY:1,...Ux(0,t)})},clipFocusBox:!1}),this.properties=new pS,this.connectsToYAxis=!0,this.aggregationManager=new kb,this.hideWithSize0=!1,this.markerNodesPickable=!0,this.backgroundGroup=new ke({name:`${this.id}-background`,zIndex:n.qw7.BACKGROUND}),this._isStacked=void 0,this.fillSpans=[],this.phantomSpans=[],this.strokeSpans=[]}createNodeParams(e){return{...super.createNodeParams(e),xKey:this.properties.xKey,yKey:this.properties.yKey}}hasPickableNodeShapes(){return this.markerNodesPickable}get pickModeAxis(){return"main"}renderToOffscreenCanvas(){const e=(this.contextNodeData?.nodeData?.length??0)>0;return super.renderToOffscreenCanvas()||e&&"cutout"===this.getDrawingMode(!1)||null!=this.contextNodeData&&(this.contextNodeData.fillData.spans.length>100||this.contextNodeData.strokeData.spans.length>100)}attachSeries(e,t,i){super.attachSeries(e,t,i),e.appendChild(this.backgroundGroup)}detachSeries(e,t,i){super.detachSeries(e,t,i),this.backgroundGroup.remove()}attachPaths([e,t]){this.backgroundGroup.appendChild(e),this.contentGroup.appendChild(t),t.zIndex=-1}detachPaths([e,t]){e.remove(),t.remove()}isStacked(){return(this.seriesGrouping?.stackCount??1)>1}isNormalized(){return null!=this.properties.normalizedTo}setSeriesIndex(e){const t=this.isStacked()===this._isStacked;return this._isStacked=t,super.setSeriesIndex(e,t)}setZIndex(e){super.setZIndex(e),this.isStacked()?(this.backgroundGroup.zIndex=[n.qw7.BACKGROUND,e],this.contentGroup.zIndex=[n.qw7.ANY_CONTENT,e,n.fUl.FOREGROUND]):(this.backgroundGroup.zIndex=[n.qw7.ANY_CONTENT,e,n.fUl.FOREGROUND,0],this.contentGroup.zIndex=[n.qw7.ANY_CONTENT,e,n.fUl.FOREGROUND,1])}async processData(e){if(null==this.data)return;const{data:t,visible:i,seriesGrouping:{groupIndex:s=this.id,stackCount:a=1}={}}=this,{xKey:o,yKey:r,selectedKey:l,connectMissingData:h,normalizedTo:c}=this.properties,d=!this.ctx.animationManager.isSkipped(),u=this.axes[n.tv$.X]?.scale,p=this.axes[n.tv$.Y]?.scale,{xScaleType:g,yScaleType:m}=this.getScaleInformation({xScale:u,yScale:p}),y=a>1||null!=c,f={value:`area-stack-${s}-yValue`,marker:`area-stack-${s}-yValues-marker`},x={invalidValue:null};((0,n.O9V)(c)||h)&&a>1&&(x.invalidValue=0),i||(x.forceValue=0);const b=[Mr(o,g,{id:"xValue",allowNullKey:this.properties.allowNullKeys??!1}),kr(r,m,{id:"yValueRaw",...x}),...null==l?[]:[kr(l,"category",{id:"selectedRaw"})]];y&&b.push(...Cr(r,"normal",{id:"yValueCumulative",...x,groupId:f.marker},m)),(0,n.O9V)(c)&&b.push(kr(r,m,{id:"yValue",...x,groupId:f.value}),zr(Object.values(f),c)),d&&b.push(Wr());const{dataModel:v,processedData:S}=await this.requestDataModel(e,t,{props:b,groupByKeys:y,groupByData:!y});this.aggregateData(v,S),this.animationState.transition("updateData")}xCoordinateRange(e,t){const{marker:i}=this.properties,s=this.axes[n.tv$.X].scale.convert(e),a=i.enabled?.5*i.size*t:0;return[s-a,s+a]}yCoordinateRange(e,t){const{marker:i}=this.properties,s=this.axes[n.tv$.Y].scale.convert(e[0]),a=i.enabled?.5*i.size*t:0;return[s-a,s+a]}yValueKey(){return this.isNormalized()?"yValue":"yValueRaw"}yCumulativeKey(e){return"grouped"===e.type?"yValueCumulative":this.yValueKey()}getSeriesDomain(e){const{dataModel:t,processedData:i,axes:s}=this;if(!t||!i)return{domain:[]};const a=s[n.tv$.Y];if(e===n.tv$.X){const e=t.resolveProcessedDataDefById(this,"xValue"),s=t.getDomain(this,"xValue","key",i);return"key"===e?.def.type&&"category"===e.def.valueType?s:{domain:uo((0,n.Xxv)(s.domain))}}
1const o=this.domainForClippedRange(n.tv$.Y,[this.yCumulativeKey(i)],"xValue");return a instanceof Jm&&!(a instanceof oS)?{domain:uo(po(o))}:{domain:uo(o)}}getSeriesRange(e,t){const[i,s]=this.domainForVisibleRange(n.tv$.Y,[this.yCumulativeKey(this.processedData)],"xValue",t);return[(0,n.Roz)((0,n.Wwf)(i,0)),(0,n.Roz)((0,n.cGV)(s,0))]}getZoomRangeFittingItems(e,t,i){return this.zoomFittingVisibleItems("xValue",[this.yCumulativeKey(this.processedData)],e,t,i)}getVisibleItems(e,t,i){return this.countVisibleItems("xValue",[this.yCumulativeKey(this.processedData)],e,t,i)}createBucketLookupFeature(){return new Ab({series:this,getXAxis:()=>this.axes[n.tv$.X],getDataModel:()=>this.dataModel,getProcessedData:()=>this.processedData,aggregationManager:this.aggregationManager,dataSelectionService:this.ctx.dataSelectionService,domainKey:"key",canonicalExtremaSlots:[n.BNK]})}aggregateData(e,t){if(this.aggregationManager.markStale(t.input.count),gr(t))return;const i=this.axes[n.tv$.X];if(null==i)return;const s=this.estimateTargetRange();this.aggregationManager.aggregate({computePartial:n=>uS(i.scale.type,e,t,this.yCumulativeKey(t),this,s,n),computeFull:s=>function(e,t,i,s,a,o){const r=t.resolveKeysById(a,"xValue",i),l=t.resolveColumnById(a,s,i,"mixed-numeric"),h=t.getDomain(a,"xValue","key",i),c=t.resolveColumnNeedsValueOf(a,"xValue",i),d=t.resolveColumnNeedsValueOf(a,s,i),{values:u,needsValueOf:p}=(0,n.QP0)(e,r,c),{xValues:g,domain:m}=(0,n.g3H)(e,u,h),y=d?l:(0,n.X_t)(l);return o?hS(m,g,y,{xNeedsValueOf:p,yNeedsValueOf:d,existingFilters:o}):dS(g,y,m[0],m[1],p,d)}(i.scale.type,e,t,this.yCumulativeKey(t),this,s),targetRange:s});const a=this.aggregationManager.filters;a&&a.length>0&&n.Xjz.record(`${this.type}:aggregation`,a.map((e=>e.maxRange)))}estimateTargetRange(){const e=this.axes[n.tv$.X];if(e?.scale?.range){const[t,i]=e.scale.range;return Math.abs(i-t)}return this.ctx.scene?.canvas?.width??800}stackAggregatedData(e){const{indices:t,metaIndices:i}=e,{visible:s,axes:a,dataModel:o,processedData:r,seriesBelowStackContext:l}=this,h=a[n.tv$.X],c=a[n.tv$.Y];if(!s)return this.phantomSpans=[],this.fillSpans=[],this.strokeSpans=[],l;if(null==h||null==c||null==o||null==r)return;const{scale:d}=h,{scale:u}=c,p=(d.bandwidth??0)/2,g=!this.isStacked()&&this.properties.connectMissingData,m=r.invalidData?.get(this.id),y=o.resolveKeysById(this,"xValue",r),f=o.resolveColumnById(this,this.yCumulativeKey(r),r,"mixed-numeric");let[x,b]=bl(1,i.length-1,h.range,(e=>{const n=i[e],s=i[e+1],a=t[n],o=t[s],r=y[a],l=y[o],{0:h}=this.xCoordinateRange(r,0),{1:c}=this.xCoordinateRange(l,0);return[h,c]}));x=Math.max(x-1,0),b=Math.min(b+1,i.length-1);let v=[];if(l?.fillSpans)v=l?.fillSpans;else for(let e=x;e<b;e+=1){const n=i[e],s=i[e+1],a=t[n],o=t[s],r=y[a],l=y[o],h={type:"linear",moveTo:!1,x0:d.convert(r)+p,y0:u.convert(0),x1:d.convert(l)+p,y1:u.convert(0)};v.push({span:h,xValue0:r,xValue1:l,yValue0:0,yValue1:0})}this.phantomSpans=v;const S=[],M=[];let k=0;for(let e=x;e<b;e+=1){const s=i[e],a=i[e+1],o=t[s],r=t[a],l=!g&&this.hasInvalidDatumsInRange(m,f,o,r),h=v[k++];if(l){S.push(h),M.push(h);continue}const c=[];for(let e=s;e<=a;e++){const i=t[e];if(m?.[i])continue;const s=f[i];if(!(0,n.QQF)(s))continue;const a=y[i];c.push({point:{x:d.convert(a)+p,y:u.convert(s)},xDatum:a,yDatum:s})}if(c.length<2){S.push(h),M.push(h);continue}const x=c[0],b=c.at(-1),D=c.slice(1,-1).map((e=>e.point)),w={span:{type:"multi-line",moveTo:!1,x0:x.point.x,y0:x.point.y,x1:b.point.x,y1:b.point.y,midPoints:D},xValue0:x.xDatum,xValue1:b.xDatum,yValue0:x.yDatum,yValue1:b.yDatum};S.push(w),M.push(w)}return this.fillSpans=S,this.strokeSpans=M,{stack:[],fillSpans:S,strokeSpans:M}}hasInvalidDatumsInRange(e,t,i,s){const a=Math.min(i,s),o=Math.max(i,s);for(let i=a;i<=o;i++){if(e?.[i])return!0;const s=t[i];if(!(0,n.QQF)(s))return!0}return!1}stackYValueData(){const{visible:e,axes:t,dataModel:i,processedData:s,seriesBelowStackContext:a,properties:o}=this,r=t[n.tv$.X],l=t[n.tv$.Y];if(null==r||null==l||null==i||null==s)return;const{interpolation:h}=o,{scale:c}=r,{scale:d}=l,u=(c.bandwidth??0)/2;let p=i.resolveKeysById(this,"xValue",s),g=i.resolveColumnById(this,this.yValueKey(),s,"mixed-numeric");const m=!this.isStacked()&&this.properties.connectMissingData,y=s.invalidKeys?.get(this.id
1),f=(m?s.invalidData?.get(this.id):void 0)??y;null!=f&&(p=p.filter(((e,t)=>!1===f[t])),g=g.filter(((e,t)=>!1===f[t])));let x,[b,v]=bl(1,p.length,r.range,(e=>this.xCoordinateRange(p[e],0)));if(b=Math.max(b-2,0),v=Math.min(v+2,p.length),a?.fillSpans)x=a?.fillSpans;else{const e=[];for(let t=b;t<v;t+=1){const i=p[t];e.push({point:{x:c.convert(i)+u,y:d.convert(0)},xDatum:i,yDatum:0})}x=Dx(e,{type:"linear"})}if(this.phantomSpans=x,!e)return this.fillSpans=x,this.strokeSpans=[],a;let S=a?.stack;if(null==S){S=[];for(let e=b;e<v-1;e+=1)S.push({leading:0,trailing:0,dataValid:!0,breakBefore:!1})}const M=S.slice();let k=!1;for(let e=0;e<M.length;e+=1){const t=b+e,i=b+e+1;let{leading:s,trailing:a,breakBefore:o}=S[e];const r=g[t],l=g[i],h=!(0,n.QQF)(r),c=!(0,n.QQF)(l),d=!h&&!c;d&&(s=so(s,r),a=so(a,l)),0!==e&&d!==k&&(o=!0),k=d,M[e]={leading:s,trailing:a,dataValid:d,breakBefore:o}}const D=[],w=[],I=[];for(let e=0;e<M.length;e+=1){const{leading:t,dataValid:i,breakBefore:n}=M[e],s=b+e;if(n){if(0!==I.length){const t=M[e-1],i={point:{x:c.convert(p[s])+u,y:d.convert(t.trailing)},xDatum:p[s],yDatum:t.trailing};I.push(i);const n=Dx(I,h);D.push(...n),w.push(...n)}I.length=0}if(i){const e={point:{x:c.convert(p[s])+u,y:d.convert(t)},xDatum:p[s],yDatum:t};I.push(e)}else D.push(x[e])}if(0!==I.length){const e=M.at(-1),t=b+M.length,i={point:{x:c.convert(p[t])+u,y:d.convert(e.trailing)},xDatum:p[t],yDatum:e.trailing};I.push(i);const n=Dx(I,h);D.push(...n),w.push(...n),I.length=0}return this.fillSpans=D,this.strokeSpans=w,{stack:M,fillSpans:D,strokeSpans:w}}createStackContext(){const e=this.axes[n.tv$.X];if(null==e)return;const{scale:t}=e,[i,s]=t.range,a=Math.abs(s-i);this.aggregationManager.ensureLevelForRange(a);const o=this.aggregationManager.getFilterForRange(a),{processedData:r}=this;return r&&this.ensureBucketLookupFeature()?.setActiveFilter(r,o),o?this.stackAggregatedData(o):this.stackYValueData()}createNodeDatumContext(e,t){const{dataModel:i,processedData:s}=this;if(!i||!s)return;const{xKey:a,xName:o,selectedKey:r,yKey:l,yName:h,legendItemName:c,marker:d,fill:u,stroke:p,normalizedTo:g}=this.properties,m=e.scale,y=t.scale,{isContinuousY:f}=this.getScaleInformation({xScale:m,yScale:y}),x="grouped"===s.type,[b,v]=m.range,S=Math.abs(v-b);this.aggregationManager.ensureLevelForRange(S);const M=this.aggregationManager.getFilterForRange(S);this.ensureBucketLookupFeature()?.setActiveFilter(s,M);const k=this.contextNodeData?.nodeData,D=null!=k&&this.canIncrementallyUpdateNodes(null!=M),w=d.enabled?d.size:0,I=this.resolveLabelContext(d.shape,w);return{xAxis:e,yAxis:t,rawData:s.dataSources.get(this.id)?.data??[],xValues:i.resolveKeysById(this,"xValue",s),yRawValues:i.resolveColumnById(this,"yValueRaw",s,"mixed-numeric"),yCumulativeValues:x?i.resolveColumnById(this,"yValueCumulative",s,"mixed-numeric"):i.resolveColumnById(this,"yValueRaw",s,"mixed-numeric"),crossFilterSelectedValues:null==r?void 0:i.resolveColumnById(this,"selectedRaw",s,"boolean"),invalidData:s.invalidData?.get(this.id),xScale:m,yScale:y,xOffset:(m.bandwidth??0)/2,yOffset:0,indices:M?.indices,isContinuousY:f,labelsEnabled:I.labelsEnabled,labelPadding:I.labelPadding,labelTextMeasurer:I.labelTextMeasurer,labelFit:I.labelFit,labelFitOverflow:I.labelFitOverflow,labelStyled:I.labelStyled,labelInsideOffset:I.labelInsideOffset,labelInsideSize:I.labelInsideSize,labelAnchor:I.labelAnchor,normalizedTo:g,canIncrementallyUpdate:D,animationEnabled:!this.ctx.animationManager.isSkipped(),xKey:a,yKey:l,xName:o,yName:h,legendItemName:c,markerSize:d.size,markerFill:d.fill??u,markerStroke:d.stroke??p,markerStrokeWidth:d.strokeWidth??this.properties.strokeWidth,yDomain:this.getSeriesDomain(n.tv$.Y).domain,nodes:D?k:[],labelData:[],nodeIndex:0}}computeMarkerCoordinate(e,t){let i;((0,n.O9V)(e.normalizedTo)?e.isContinuousY&&(0,n.QQF)(t.yDatum):!Number.isNaN(t.yDatum))&&(i=t.yCumulative),t.x=e.xScale.convert(t.xDatum)+e.xOffset,t.y=e.yScale.convert(i),Number.isFinite(t.x)||(t.validPoint=!1)}handleDatum(e,t,i){if(t.xDatum=e.xValues[i],void 0!==t.xDatum||this.properties.allowNullKeys){if(t.datum=e.rawData[i],t.yDatum=e.yRawValues[i],t.yCumulative=e.yCumulativeValues[i],t.validPoint=(0,n.QQF)(t.yDatum)&&!0!==e.invalidData?.[i],this.computeMarkerCoordinate(e,t),t.crossFilterSelected=e.crossFilterSelectedValues?.[i],t.validPoint){if(e.canIncrementallyUpdate&&e.nodeIndex<e.nodes.length){const n=e.nodes[e.nodeIndex];n.datum=t.datum,n.datumIndex=i,n.midPoint={x:t.x,y:t.y},n.cumulativeValue=Number(t.yCumulative),n.cumulativeValueExact=t.yCumulative,n.yValue=t.yDatum,n.xValue=t.xDatum,n.point={x:t.x,y:t.y,size:e.markerSize},n.crossFilterSelected=t.crossFilterSelected}else e.nodes.push({series:this,datum:t.datum,datumIndex:i,midPoint:{x:t.x,y:t.y},cumulativeValue:Number(t.yCumulative),cumulativeValueExact:t.yCumulative,yValue:t.yDatum,xValue:t.xDatum,yKey:e.yKey,xKey:e.xKey,point:{x:t.x,y:t.y,size:e.markerSize},fill:e.markerFill,stroke:e.markerStroke,strokeWidth:e.markerStrokeWidth,crossFilterSelected:t.crossFilterSelected});
1e.nodeIndex++}if(e.labelsEnabled&&t.validPoint){const s=this.getLabelText(t.yDatum,t.datum,e.yKey,"y",e.yDomain,this.properties.label,{value:t.yDatum,datum:t.datum,xKey:e.xKey,yKey:e.yKey,xName:e.xName,yName:e.yName,legendItemName:e.legendItemName});e.labelData.push({series:this,datum:t.datum,datumIndex:i,x:t.x,y:t.y,labelText:s,point:{x:t.x,y:t.y,size:e.markerSize},label:this.measureLabel(e,s),fit:(0,n.lIw)(s,this.properties.label,e),anchor:e.labelAnchor,insideOffset:e.labelInsideOffset,insideSize:e.labelInsideSize,placement:"top",gap:e.markerSize>0?e.markerSize/2:n.Olx})}}}populateNodeData(e){const t={datum:void 0,xDatum:void 0,yDatum:void 0,yCumulative:0,crossFilterSelected:void 0,x:0,y:0,validPoint:!1};let[i,n]=this.visibleRangeIndices("xValue",e.xAxis.range,e.indices);i=Math.max(i-2,0),n=Math.min(n+2,e.indices?.length??e.xValues.length),this.processedData.input.count<1e3&&(i=0,n=this.processedData.input.count);for(let s=i;s<n;s+=1){const i=e.indices?.[s]??s;this.handleDatum(e,t,i)}}initializeResult(e){const{visibleSameStackCount:t}=this.ctx.seriesStateManager.getVisiblePeerGroupIndex(this);return{itemId:e.yKey,fillData:{spans:this.fillSpans,phantomSpans:this.phantomSpans},strokeData:{spans:this.strokeSpans},labelData:e.labelData,nodeData:e.nodes,scales:this.calculateScaling(),visible:this.visible,stackVisible:t>0,crossFiltering:null!=this.properties.selectedKey,styles:qx(this,this.properties,this.properties.marker),segments:void 0}}assembleResult(e,t){const i=this.chart?.seriesRect;return null==i||(t.segments=Pm(this.properties.segmentation,e.xAxis,e.yAxis,i,this.ctx.scene,!1)),t}isPathOrSelectionDirty(){return this.properties.marker.isDirty()}updatePathNodes(e){const{paths:[t,i],visible:s,animationEnabled:a}=e,o=this.contextNodeData?.segments,r=this.getHighlightStyle(),l=this.getSelectionStyle(),h=this.getStyle(void 0),c=(0,n.HFk)(l,r,h),{strokeWidth:d,stroke:u,strokeOpacity:p,lineDash:g,lineDashOffset:m,fill:y,fillOpacity:f,opacity:x}=c;i.setProperties({segments:o,fill:void 0,lineCap:"round",lineJoin:"round",pointerEvents:1,stroke:u,strokeWidth:d,strokeOpacity:p,lineDash:g,lineDashOffset:m,opacity:x,visible:s||a}),i.datum=o,t.setStyleProperties({fill:y,stroke:void 0,fillOpacity:f},this.getShapeFillBBox()),t.setProperties({segments:o,lineJoin:"round",pointerEvents:1,fillShadow:this.properties.shadow,opacity:x,visible:s||a}),t.datum=o,ib(this,i),ib(this,t)}updatePaths(e){this.updateAreaPaths(e.paths,e.contextData)}updateAreaPaths(e,t){for(const i of e)i.visible=t.visible;if(t.visible)this.updateFillPath(e,t),this.updateStrokePath(e,t);else for(const t of e)t.path.clear(),t.markDirty("AreaSeries")}updateFillPath(e,t){const[i]=e;i.path.clear(),Vx(i,t.fillData),i.markDirty("AreaSeries")}updateStrokePath(e,t){const{spans:i}=t.strokeData,[,n]=e;n.path.clear(),Ix(n,i),n.markDirty("AreaSeries")}updateDatumSelection(e){const{nodeData:t,datumSelection:i}=e,{contextNodeData:n,processedData:s,axes:a,properties:o}=this,{marker:r,styler:l}=o,h=Zx(o,n,s,a,r,l?this.getStyle(void 0).marker:void 0,this.chart?.isMiniChart);this.hideWithSize0=h.hideWithSize0,this.markerNodesPickable=h.needsNodeData&&!h.hideWithSize0,r.isDirty()&&(i.clear(),i.cleanup());const c=h.needsNodeData?t:[];return gr(this.processedData)?i.update(c,void 0,(e=>Xr(e.xValue))):i.update(c)}updateDatumStyles(t){const{hideWithSize0:i}=this,{datumSelection:n,isHighlight:s}=t,{marker:a}=this.properties,{itemStyler:o}=a;if(null==o)return void this.runMarkerStylePass(n,s,{marker:a,hideWithSize0:i,isHighlight:s},{compute:e.computeNoStylerMarkerStyle,apply:Td.assignCachedStyle});const r={marker:a,hideWithSize0:i,isHighlight:s,dataModel:this.dataModel,processedData:this.processedData};this.runMarkerStylePass(n,s,r,{compute:e.computeStylerStyle,apply:e.applyStylerDatum})}updateDatumNodes(e){const{contextNodeData:t,hideWithSize0:i}=this;if(!t)return;const{datumSelection:n,isHighlight:s}=e,a=this.getShapeFillBBox(),o=this.ctx.highlightManager.getActiveHighlight(),r=this.getDrawingMode(s,e.drawingMode),l="cutout"===r?void 0:r,h=Qx(t.styles);n.each(((e,n)=>{const c=this.getHighlightState(o,s,n.datumIndex),d=n.style??t.styles[c];this.applyMarkerStyle(d,e,n.point,a,{crossFilterSelected:n.crossFilterSelected,hideWithSize0:i,pickInflation:h});const u=l??this.resolveMarkerDrawingModeForState(r,d);e.__drawingMode!==u&&(e.drawingMode=u)})),s||this.properties.marker.markClean()}get labelProperty(){return this.properties.label}writeLabelPoint(e,t,i){return{...e,x:t,y:i}}readLabelPoint(e){return e}makeStylerParams(e,t,i){const{id:n}=this,{marker:s,fill:a,fillOpacity:o,lineDash:r,lineDashOffset:l,stroke:h,strokeOpacity:c,strokeWidth:d,xKey:u,yKey:p}=this.properties,g=sl(e??0),m=al(t),y=al(i);return{marker:{fill:s.fill,fillOpacity:s.fillOpacity,size:s.size,shape:s.shape,stroke:s.stroke,strokeOpacity:s.strokeOpacity,strokeWidth:s.strokeWidth,lineDash:s.lineDash,lineDashOffset:s.lineDashOffset},highlightState:g,selectionState:m,candidateState:y,fill:a,fillOpacity:o,lineDash:r,lineDashOffset:l,seriesId:n,stroke:h,strokeOpacity:c,strokeWidth:d,xKey:u,yKey:p}}makeItemStylerParams(e,t,i,n){const{xKey:s,yKey:a}=this.properties,o=e.resolveKeysById(this,"xValue",t)[i],r=e.resolve
1ColumnById(this,"yValueRaw",t,"mixed-numeric")[i],l=e.getDomain(this,"xValue","key",t).domain,h=e.getDomain(this,this.yCumulativeKey(t),"value",t).domain,c=this.filterItemStylerFillParams(n.fill)??n.fill;return{...xl(o,r,s,a,l,h),xValue:o,yValue:r,...n,fill:c}}makeLabelFormatterParams(){const{xKey:e,xName:t,yKey:i,yName:n,legendItemName:s}=this.properties;return{xKey:e,xName:t,yKey:i,yName:n,legendItemName:s}}getTooltipContent(e){const{id:t,dataModel:i,processedData:s,axes:a,properties:o}=this,{xKey:r,xName:l,yKey:h,yName:c,tooltip:d,legendItemName:u}=o,p=o.allowNullKeys??!1,g=a[n.tv$.X],m=a[n.tv$.Y];if(!(i&&s&&g&&m))return;const y=s.dataSources.get(this.id)?.data?.[e],f=i.resolveKeysById(this,"xValue",s)[e],x=i.resolveColumnById(this,"yValueRaw",s,"mixed-numeric")[e];if(void 0===f&&!p)return;const b=this.getStyle(void 0),v=this.makeItemStylerParams(i,s,e,b.marker),S=this.getMarkerStyle(this.properties.marker,{datumIndex:e,datum:y},v,{isHighlight:!1},b.marker);return this.formatTooltipWithContext(d,{heading:this.getAxisValueText(g,"tooltip",f,y,r,u,p),symbol:this.legendItemSymbol(),data:[{label:c,fallbackLabel:h,value:this.getAxisValueText(m,"tooltip",x,y,h,u),missing:eu(x)}]},{seriesId:t,datum:y,title:c,xKey:r,xName:l,yKey:h,yName:c,...S,...this.getModuleTooltipParams()})}legendItemSymbol(){const{fill:e,stroke:t,fillOpacity:i,strokeOpacity:n,strokeWidth:s,lineDash:a,marker:o}=this.getStyle(void 0),r=!o.enabled||null==o.fill,l=r?e:o.fill;return{marker:{...this.getMarkerStyle(this.properties.marker,{},void 0,{isHighlight:!1,checkForHighlight:!1},{size:o.size,shape:o.shape,fill:l,fillOpacity:r?i:o.fillOpacity,stroke:o.stroke}),enabled:o.enabled||s<=0},line:{enabled:!0,stroke:t,strokeOpacity:n,strokeWidth:s,lineDash:a}}}getLegendData(e){if("category"!==e)return[];const{id:t,ctx:{legendManager:i},visible:n}=this,{yKey:s,yName:a,legendItemName:o,showInLegend:r}=this.properties;return[{legendType:e,id:t,itemId:s,legendItemName:o,seriesId:t,enabled:n&&(i?.getItemEnabled({seriesId:t,itemId:s})??!0),label:{text:o??a??s},symbol:this.legendItemSymbol(),hideInLegend:!r}]}resetDatumAnimation(e){Yx([e.datumSelection])}animateEmptyUpdateReady(e){const{datumSelection:t,labelSelection:i,contextData:n,paths:s}=e,{animationManager:a}=this.ctx;this.updateAreaPaths(s,n),Jx(this,a,...s),Wh([t],Ux),Gx(this,a,{...this.getAnimationDrawingModes(),phase:"initial"},t),Af(this,"labels",a,i)}animateReadyResize(e){const{contextData:t,paths:i}=e;this.updateAreaPaths(i,t),super.animateReadyResize(e)}animateWaitingUpdateReady(e){const{animationManager:t}=this.ctx,{datumSelection:i,labelSelection:s,contextData:a,paths:o,previousContextData:r}=e,[l,h]=o;if(!1===a.visible&&!1===r?.visible)return;if(null==l&&null==h)return;this.resetDatumAnimation(e),this.resetLabelAnimation(e);const c=()=>{this.resetPathAnimation(e),this.updateAreaPaths(o,a)},d=()=>{t.skipCurrentBatch(),c()};if(null==a||null==r)return c(),_x(this,t,"added",this.getAnimationDrawingModes(),i),eb(this,"fill_path_properties",t,"add",l),eb(this,"stroke_path_properties",t,"add",h),void Af(this,"labels",t,s);if(a.crossFiltering!==r.crossFiltering)return void d();const u=function(e,t){if("category"===e.scales.x?.type!=("category"===t.scales.x?.type)||!(0,n.z1w)(e.scales.x)||!(0,n.z1w)(t.scales.x))return;let i="updated";t.visible&&!e.visible?i="removed":!t.visible&&e.visible&&(i="added");const s=kx({scales:e.scales,data:e.fillData.spans},{scales:t.scales,data:t.fillData.spans},0);if(null==s)return;const a=kx({scales:e.scales,data:e.fillData.phantomSpans},{scales:t.scales,data:t.fillData.phantomSpans},0);if(null==a)return;const o=kx({scales:e.scales,data:e.strokeData.spans,zeroData:e.fillData.phantomSpans},{scales:t.scales,data:t.strokeData.spans,zeroData:t.fillData.phantomSpans},0);if(null==o)return;const r="none";return{status:i,fill:Hx(i,s,a,r),stroke:Cx(i,o,r)}}(a,r);void 0!==u?"no-op"!==u.status&&(_x(this,t,void 0,this.getAnimationDrawingModes(),i),Vh(this.id,"fill_path_properties",t,[l],u.fill.pathProperties),Vb(this.id,"fill_path_update",t,[l],u.fill.path),Vh(this.id,"stroke_path_properties",t,[h],u.stroke.pathProperties),Vb(this.id,"stroke_path_update",t,[h],u.stroke.path),Af(this,"labels",t,s),this.ctx.animationManager.animate({id:this.id,groupId:"reset_after_animation",phase:"trailing",from:{},to:{},onComplete:()=>this.updateAreaPaths(o,a)})):d()}isLabelEnabled(){return this.properties.label.enabled}nodeFactory(){return new Sd}getStyle(e){const{styler:t,marker:i,fill:n,fillOpacity:s,lineDash:a,lineDashOffset:o,stroke:r,strokeOpacity:l,strokeWidth:h}=this.properties,{size:c,shape:d,fill:u="transparent",fillOpacity:p}=i;let g={};if(t){const i=this.getDataSelectionState(void 0),n=this.getDataCandidacyState(void 0),s=this.makeStylerParams(e,i,n),a=this.cachedCallWithContext(t,s)??{};g=this.ctx.optionsGraphService.resolvePartial(["series",`${this.declarationOrder}`],a,{pick:!1})??{}}return g.marker??(g.marker={}),{fill:g.fill??n,fillOpacity:g.fillOpacity??s,lineDash:g.lineDash??a,lineDashOffset:g.lineDashOffset??o,stroke:g.stroke??r,strokeOpacity:g.strokeOpacity??l,strokeWidth:g.strokeWidth??h,marker:{enabled:g.marker.enabled??i.enabled,fill:g.marker.fill??u,fillOpacity:g.marker.fillOpacity??p,shape:g.marker.shape??d,size:g.marker.size??c,lineDash:g.marker.lineDash??i.lineDash??a,lineDashOffset:g.marker.lineDashOffset??i.lineDashOffset??o,stroke:g.marker.stroke??i.stroke??r,strokeOpacity:g.marker.strokeOpacity??i.strokeOpacity??l,strokeWidth:g.marker.strokeWidth??i.strokeWidth??h}}}getFormattedMarkerStyle(e){const t=this.getStyle(void 0),i=this.makeItemStylerParams(this.dataModel,this.processedData,e.datumIndex,t.marker);return this.getMarkerStyle(this.properties.marker,e,i,{isHighlight:!0},void 0,t)}isPointInArea(e,t){let i;for(const e of this.backgroundGroup.children())if(e instanceof je){i=e;break}return!!i?.getBBox().containsPoint(e,t)&&i.isPointInPath(e,t)}computeFocusBounds(e){return Xx(this,e)}hasItemStylers(){return this.properties.selection.enabled||null!=this.properties.styler||null!=this.properties.marker.itemStyler||null!=this.properties.label.itemStyler}};return e.className="AreaSeries",e.type="area",e.computeNoStylerMarkerStyle=(e,t,i,n,s)=>{const a=e.getStyle(i);return e.getMarkerStyle(t.marker,s,void 0,{isHighlight:t.isHighlight,highlightState:i,selectionState:n,hideWithSize0:t.hideWithSize0},a.marker,{stroke:a.stroke,strokeWidth:a.strokeWidth,strokeOpacity:a.strokeOpacity})},e.computeStylerStyle=(e,t,i)=>e.getStyle(i),e.applyStylerDatum=(e,t,i,n,s,a)=>{const{stroke:o,strokeWidth:r,strokeOpacity:l}=a,h=e.makeItemStylerParams(t.dataModel,t.processedData,i.datumIndex,a.marker);i.style=e.getMarkerStyle(t.marker,i,h,{isHighlight:t.isHighlight,highlightState:n,selectionState:s,hideWithSize0:t.hideWithSize0},a.marker,{stroke:o,strokeWidth:r,strokeOpacity:l})},e})(),xS=(()=>
1({series:{nodeClickRange:{$if:[{$path:"/selection/enabled"},10,"nearest"]},fill:{$applySwitch:[{$path:"type"},{$palette:"fill"},["gradient",n.Euh],["image",n.pwE],["pattern",n.eu4]]},stroke:{$palette:"stroke"},fillOpacity:.8,strokeOpacity:1,strokeWidth:{$isUserOption:["./stroke",2,0]},lineDash:[0],lineDashOffset:0,shadow:{enabled:!1,color:n.KU9,xOffset:3,yOffset:3,blur:5},interpolation:{type:"linear"},marker:{enabled:!1,shape:"circle",size:7,strokeWidth:{$isUserOption:["./stroke",1,0]},fill:{$applySwitch:[{$path:"type"},{$palette:"fill"},["gradient",n.pRl],["pattern",n.eu4]]},stroke:{$palette:"stroke"}},label:{...n.VTt,...n.F$C,enabled:!1,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},padding:8,collision:{alwaysShow:n.O2O},insideStyle:(0,n.KVS)("chartBackgroundColor"),outsideStyle:(0,n.KVS)("textColor"),placement:"top"},tooltip:{range:{$path:["/tooltip/range","nearest"]},position:{anchorTo:{$path:["/tooltip/position/anchorTo","node"]}}},highlight:n.U3R,selection:n.zg6,segmentation:n.IgM}}))(),bS=pm({type:"series",name:"area",chartType:"cartesian",stackable:!0,version:Ot,dependencies:[Wv],options:Bn,predictAxis:Rm,defaultAxes:{y:{type:n.uCf.NUMBER,position:n.v9C.LEFT},x:{type:n.uCf.CATEGORY,position:n.v9C.BOTTOM}},axisKeys:{[n.tv$.X]:"xKeyAxis",[n.tv$.Y]:"yKeyAxis"},themeTemplate:xS,create:e=>new fS(e)}),vS=(()=>{var e=class extends Ge{constructor(){super(...arguments),this.direction="x",this.featherRatio=0}setStaticProperties(e,t,i,n,s,a,o,r,l,h,c){this.__direction=l??"x",this.__featherRatio=h??0,this.__crispCentreDirection=c,super.setStaticProperties(e,t,i,n,s,a,o,r)}get feathered(){return Math.abs(this.featherRatio)>.001}isPointInPath(e,t){if(!this.feathered)return super.isPointInPath(e,t);return this.getBBox().containsPoint(e,t)}updatePath(){if(!this.feathered)return void super.updatePath();const{path:e,borderPath:t,__direction:i,__featherRatio:n,__x:s,__y:a,__width:o,__height:r}=this;if(e.clear(),t.clear(),"x"===i){const t=Math.abs(n)*o;n>0?(e.moveTo(s,a),e.lineTo(s+o-t,a),e.lineTo(s+o,a+r/2),e.lineTo(s+o-t,a+r),e.lineTo(s,a+r),e.closePath()):(e.moveTo(s+t,a),e.lineTo(s+o,a),e.lineTo(s+o,a+r),e.lineTo(s+t,a+r),e.lineTo(s,a+r/2),e.closePath())}else{const t=Math.abs(n)*r;n>0?(e.moveTo(s,a+t),e.lineTo(s+o/2,a),e.lineTo(s+o,a+t),e.lineTo(s+o,a+r),e.lineTo(s,a+r),e.closePath()):(e.moveTo(s,a),e.lineTo(s+o,a),e.lineTo(s+o,a+r-t),e.lineTo(s+o/2,a+r),e.lineTo(s,a+r-t),e.closePath())}}renderStroke(e){if(!this.feathered)return void super.renderStroke(e);const{__stroke:t,__strokeWidth:i,__lineDash:n,__lineDashOffset:s,__lineCap:a,__lineJoin:o,path:r}=this;if(t&&i){const{globalAlpha:t}=e;this.applyStrokeAndAlpha(e),e.lineWidth=i,n&&e.setLineDash(n),s&&(e.lineDashOffset=s),a&&(e.lineCap=a),o&&(e.lineJoin=o),e.stroke(r.getPath2D()),e.globalAlpha=t}}};return d([(0,n.M7D)()],e.prototype,"direction",2),d([(0,n.M7D)()],e.prototype,"featherRatio",2),e})();function SS(e,t,i,s,a){if(t.length<n.n9_)return;const[o,r]=e,{smallestKeyInterval:l,xNeedsValueOf:h,yNeedsValueOf:c,existingFilters:d}=a;let u=(0,n.OLL)(t,o,r,{smallestKeyInterval:l,xNeedsValueOf:h});const p=d?.find((e=>e.maxRange===u));let{indexData:g,valueData:m,negativeIndexData:y,negativeValueData:f}=(0,n.iPk)(t,s,i??s,o,r,u,{split:!0,xNeedsValueOf:h,yNeedsValueOf:c,reuseIndexData:p?.positiveIndexData,reuseValueData:p?.positiveValueData,reuseNegativeIndexData:p?.negativeIndexData,reuseNegativeValueData:p?.negativeValueData});if(!y||!f)throw new Error("Negative aggregation data missing in split mode");let x=(0,n.kRS)(u,g,p?.positiveIndices),b=(0,n.kRS)(u,y,p?.negativeIndices);const v=[{maxRange:u,positiveIndices:x,positiveIndexData:g,positiveValueData:m,negativeIndices:b,negativeIndexData:y,negativeValueData:f}];for(;u>64;){const e=u,t=Math.trunc(e/2),i=d?.find((e=>e.maxRange===t)),s=(0,n.THQ)(g,m,e,{reuseIndexData:i?.positiveIndexData,reuseValueData:i?.positiveValueData}),a=(0,n.THQ)(y,f,e,{reuseIndexData:i?.negativeIndexData,reuseValueData:i?.negativeValueData});u=s.maxRange,g=s.indexData,m=s.valueData,x=s.midpointData??(0,n.kRS)(u,g,i?.positiveIndices),y=a.indexData,f=a.valueData,b=a.midpointData??(0,n.kRS)(u,y,i?.negativeIndices),v.push({maxRange:u,positiveIndices:x,positiveIndexData:g,positiveValueData:m,negativeIndices:b,negativeIndexData:y,negativeValueData:f})}return v.reverse(),v}function MS(e,t,i,n,s,a,o,r){return SS([n,s],e,t,i,{smallestKeyInterval:a,xNeedsValueOf:o,yNeedsValueOf:r})}var kS=(0,n.XB6)(MS);function DS(e,t,i,s,a,o){const r=t.resolveKeysById(s,"xValue",i),l=t.hasColumnById(s,"yValue-start"),h=l?t.resolve
1ColumnById(s,"yValue-start",i,"mixed-numeric"):void 0,c=l?t.resolveColumnById(s,"yValue-end",i,"mixed-numeric"):t.resolveColumnById(s,"yValue-raw",i,"mixed-numeric"),d=t.getDomain(s,"xValue","key",i),u=t.resolveColumnNeedsValueOf(s,"xValue",i),p=t.resolveColumnNeedsValueOf(s,l?"yValue-end":"yValue-raw",i),{values:g,needsValueOf:m}=(0,n.QP0)(e,r,u),{xValues:y,domain:f}=(0,n.g3H)(e,g,d);return function(e,t,i,s,a){if(t.length<n.n9_)return;const[o,r]=e,{smallestKeyInterval:l,xNeedsValueOf:h,yNeedsValueOf:c,targetRange:d,existingFilters:u}=a,p=(0,n.OLL)(t,o,r,{smallestKeyInterval:l,xNeedsValueOf:h}),g=Math.min(p,(0,n.Myt)(Math.max(d,n.gjy))),m=u?.find((e=>e.maxRange===g)),{indexData:y,valueData:f,negativeIndexData:x,negativeValueData:b}=(0,n.iPk)(t,s,i??s,o,r,g,{split:!0,xNeedsValueOf:h,yNeedsValueOf:c,reuseIndexData:m?.positiveIndexData,reuseValueData:m?.positiveValueData,reuseNegativeIndexData:m?.negativeIndexData,reuseNegativeValueData:m?.negativeValueData});if(!x||!b)throw new Error("Negative aggregation data missing in split mode");return{immediate:[{maxRange:g,positiveIndices:(0,n.kRS)(g,y,m?.positiveIndices),positiveIndexData:y,positiveValueData:f,negativeIndices:(0,n.kRS)(g,x,m?.negativeIndices),negativeIndexData:x,negativeValueData:b}],computeRemaining:function(){const e=SS([o,r],t,i,s,{smallestKeyInterval:l,xNeedsValueOf:h,yNeedsValueOf:c,existingFilters:u});return e?.filter((e=>e.maxRange!==g))??[]}}}(f,y,p||null==h?h:(0,n.Rp1)(h),p?c:(0,n.Rp1)(c),{smallestKeyInterval:i.reduced?.smallestKeyInterval,xNeedsValueOf:m,yNeedsValueOf:p,targetRange:a,existingFilters:o})}var wS=(()=>{var e=class extends bt{constructor(){super(...arguments),this.placement="inside-center",this.spacing=0,this.insideStyle=new xt,this.outsideStyle=new xt}};return d([n.mAP],e.prototype,"placement",2),d([n.mAP],e.prototype,"spacing",2),d([n.mAP],e.prototype,"insideStyle",2),d([n.mAP],e.prototype,"outsideStyle",2),e})(),IS=(()=>{var e=class extends Xf{constructor(){super(...arguments),this.fill="#c16068",this.fillOpacity=1,this.stroke="#874349",this.strokeWidth=1,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.cornerRadius=0,this.crisp=void 0,this.shadow=new $b,this.label=new wS,this.tooltip=Of(),this.sparklineMode=!1}};return d([n.mAP],e.prototype,"xKey",2),d([n.mAP],e.prototype,"xName",2),d([n.mAP],e.prototype,"yKey",2),d([n.mAP],e.prototype,"yName",2),d([n.mAP],e.prototype,"yFilterKey",2),d([n.mAP],e.prototype,"stackGroup",2),d([n.mAP],e.prototype,"normalizedTo",2),d([n.mAP],e.prototype,"fill",2),d([n.mAP],e.prototype,"fillOpacity",2),d([n.mAP],e.prototype,"stroke",2),d([n.mAP],e.prototype,"strokeWidth",2),d([n.mAP],e.prototype,"strokeOpacity",2),d([n.mAP],e.prototype,"lineDash",2),d([n.mAP],e.prototype,"lineDashOffset",2),d([n.mAP],e.prototype,"cornerRadius",2),d([n.mAP],e.prototype,"crisp",2),d([n.mAP],e.prototype,"styler",2),d([n.mAP],e.prototype,"itemStyler",2),d([n.mAP],e.prototype,"simpleItemStyler",2),d([n.mAP],e.prototype,"shadow",2),d([n.mAP],e.prototype,"label",2),d([n.mAP],e.prototype,"tooltip",2),d([n.mAP],e.prototype,"sparklineMode",2),e})(),AS=(()=>{var e=class extends Zf{constructor(e){super({moduleCtx:e,propertyKeys:oy,propertyNames:ry,categoryKey:"xValue",pickModes:[2,1,0],pathsPerSeries:[],datumSelectionGarbageCollection:!1,animationAlwaysUpdateSelections:!0,animationResetFns:{datum:Ex,label:Nf}}),this.properties=new IS,this.connectsToYAxis=!0,this.aggregationManager=new kb,this.phantomGroup=this.contentGroup.appendChild(new ke({name:"phantom",zIndex:-1})),this.phantomSelection=_h.select(this.phantomGroup,(()=>this.nodeFactory()),!1),this.phantomHighlightGroup=this.highlightGroup.appendChild(new ke({name:`${this.internalId}-highlight-node`})),this.phantomHighlightSelection=_h.select(this.phantomHighlightGroup,(()=>this.nodeFactory()),!1),this.phantomGroup.opacity=.2,this.phantomHighlightGroup.opacity=.2}createNodeParams(e){return{...super.createNodeParams(e),xKey:this.properties.xKey,yKey:this.properties.yKey}}get pickModeAxis(){return this.properties.sparklineMode?"main":void 0}async processData(e){if(!this.data)return;const{xKey:t,yKey:i,yFilterKey:s,normalizedTo:a}=this.properties,{seriesGrouping:{groupIndex:o=this.id}={},data:r}=this,l=(this.seriesGrouping?.stackCount??0)>1||null!=a,h=l,c=!this.ctx.animationManager.isSkipped(),d=this.getCategoryAxis()?.scale,u=this.getValueAxis()?.scale,{isContinuousX:p,xScaleType:g,yScaleType:m}=this.getScaleInformation({xScale:d,yScale:u}),y=this.visible?{}:{forceValue:0},f=[Mr(t,g,{id:"xValue",allowNullKey:this.properties.allowNullKeys??!1}
1),kr(i,m,{id:"yValue-raw",invalidValue:null,...y})],x=[];if(l){const e=`bar-stack-${o}-yValues`,t=`${e}-trailing`;x.push(e,t),f.push(...Cr(i,"normal",{id:"yValue-end",rangeId:"yValue-range",invalidValue:null,missingValue:0,groupId:e,separateNegative:!0,...y},m),...Cr(i,"trailing",{id:"yValue-start",invalidValue:null,missingValue:0,groupId:t,separateNegative:!0,...y},m))}if(null!=s&&(f.push(kr(s,m,{id:"yFilterValue-raw",invalidValue:null,...y})),l)){const e=`bar-stack-${o}-yFilterValues`,t=`${e}-trailing`;x.push(e,t),f.push(...Cr(s,"normal",{id:"yFilterValue-end",rangeId:"yFilterValue-range",invalidValue:null,missingValue:0,groupId:e,separateNegative:!0,...y},m),...Cr(s,"trailing",{id:"yFilterValue-start",invalidValue:null,missingValue:0,groupId:t,separateNegative:!0,...y},m),function(e,t,i){return{type:"processor",property:"filteredValueExceedUnfiltered",calculate:(0,n.ph$)([e,t,i],Vr)}}(this.id,"yValue-raw","yFilterValue-raw"))}p&&f.push(Pr,Tr),(0,n.BfI)(a)&&f.push(zr(x,Math.abs(a))),this.needsDataModelDiff()&&this.processedData&&f.push(Ur(this.id,this.processedData)),!c&&h||f.push(Wr());const{dataModel:b,processedData:v}=await this.requestDataModel(e,r,{props:f,groupByKeys:h,groupByData:!h});this.aggregateData(b,v),this.smallestDataInterval=v.reduced?.smallestKeyInterval,this.largestDataInterval=v.reduced?.largestKeyInterval,this.updateDatumValidKeys(),this.animationState.transition("updateData")}yCumulativeKey(e){return e.hasColumnById(this,"yValue-end")?"yValue-end":"yValue-raw"}getSeriesDomain(e){const{processedData:t,dataModel:i}=this;if(null==i||null==t)return{domain:[]};if(e===this.getCategoryDirection()){const e=i.resolveProcessedDataDefById(this,"xValue"),n=i.getDomain(this,"xValue","key",t);return"key"===e?.def.type&&"category"===e.def.valueType?n:{domain:this.padBandExtent(n.domain)}}let s;if(!0===t.reduced?.filteredValueExceedUnfiltered)s=this.domainForClippedRange(e,["yFilterValue-end"],"xValue");else{const a=this.yCumulativeKey(i);s=this.domainForClippedRange(e,[a],"xValue");const o=i.hasColumnById(this,"yFilterValue-raw")?i.getDomain(this,"yFilterValue-raw","value",t).domain:void 0;null!=o&&(s=[(0,n.Wwf)(s[0],o[0]),(0,n.cGV)(s[1],o[1])])}const a=this.getValueAxis();return a instanceof Jm&&!(a instanceof oS)?{domain:uo(po(s))}:{domain:uo(s)}}getSeriesRange(e,t){if(("horizontal"===this.properties.direction?n.tv$.X:n.tv$.Y)!==e)return[];const i=this.yCumulativeKey(this.dataModel),[s,a]=this.domainForVisibleRange(n.tv$.Y,[i],"xValue",t);return[(0,n.Roz)((0,n.Wwf)(s,0)),(0,n.Roz)((0,n.cGV)(a,0))]}getZoomRangeFittingItems(e,t,i){const n=this.yCumulativeKey(this.dataModel);return this.zoomFittingVisibleItems("xValue",[n],e,t,i)}getVisibleItems(e,t,i){const n=this.yCumulativeKey(this.dataModel);return this.countVisibleItems("xValue",[n],e,t,i)}createBucketLookupFeature(){return new Nb({series:this,getXAxis:()=>this.axes[n.tv$.X],getDataModel:()=>this.dataModel,getProcessedData:()=>this.processedData,aggregationManager:this.aggregationManager,dataSelectionService:this.ctx.dataSelectionService,domainKey:"key",getYColumnId:e=>this.yCumulativeKey(e),canonicalExtremaSlots:[n.BNK]})}aggregateData(e,t){if(this.aggregationManager.markStale(t.input.count),gr(t))return;const i=this.axes[n.tv$.X];if(null==i)return;const s=this.estimateTargetRange();this.aggregationManager.aggregate({computePartial:n=>DS(i.scale.type,e,t,this,s,n),computeFull:s=>function(e,t,i,s,a){const o=t.resolveKeysById(s,"xValue",i),r=t.hasColumnById(s,"yValue-start"),l=r?t.resolveColumnById(s,"yValue-start",i,"mixed-numeric"):void 0,h=r?t.resolveColumnById(s,"yValue-end",i,"mixed-numeric"):t.resolveColumnById(s,"yValue-raw",i,"mixed-numeric"),c=t.getDomain(s,"xValue","key",i),d=t.resolveColumnNeedsValueOf(s,"xValue",i),u=t.resolveColumnNeedsValueOf(s,r?"yValue-end":"yValue-raw",i),{values:p,needsValueOf:g}=(0,n.QP0)(e,o,d),{xValues:m,domain:y}=(0,n.g3H)(e,p,c),f=u||null==l?l:(0,n.Rp1)(l),x=u?h:(0,n.Rp1)(h);return a?SS(y,m,f,x,{smallestKeyInterval:i.reduced?.smallestKeyInterval,xNeedsValueOf:g,yNeedsValueOf:u,existingFilters:a}):kS(m,f,x,y[0],y[1],i.reduced?.smallestKeyInterval,g,u)}(i.scale.type,e,t,this,s),targetRange:s});const a=this.aggregationManager.filters;a&&a.length>0&&n.Xjz.record(`${this.type}:aggregation`,a.map((e=>e.maxRange)))}estimateTargetRange(){const e=this.axes[n.tv$.X];if(e?.scale?.range){const[t,i]=e.scale.range;return Math.abs(i-t)}return this.ctx.scene?.canvas?.width??800}createNodeDatumContext(e,t){const{dataModel:i,processedData:s}=this;if(!i||!s)return;
1const a=s.dataSources?.get(this.id);if(null==a)return;const o=e.scale,r=t.scale,l=Math.abs(o.range[1]-o.range[0]);this.aggregationManager.ensureLevelForRange(l);const h=this.aggregationManager.getFilterForRange(l);this.ensureBucketLookupFeature()?.setActiveFilter(s,h);const c=s.reduced?.filteredValueExceedUnfiltered??!1,d=i.hasColumnById(this,"yValue-start"),u=this.ctx.seriesStateManager.getVisibleStackNeighbours(this),{label:p}=this.properties,g=p.enabled,m=(0,n.$rL)(p.placement);0===m.length&&m.push("inside-center");const y=m[0],f=y?.startsWith("inside")?p.insideStyle:p.outsideStyle,x=g?this.resolveLabelPlotRegion(p.collision):void 0,b=g?wt(p,f):{bottom:0,left:0,right:0,top:0},v=p.collision.alwaysShow,S=g?(0,n.A_g)(p,!v):void 0,M=this.canIncrementallyUpdateNodes(null!=h),{groupOffset:k,barOffset:D,barWidth:w}=this.getBarDimensions();let I,A,C;if(c)I=i.resolveColumnById(this,"yFilterValue-start",s,"mixed-numeric"),A=i.resolveColumnById(this,"yFilterValue-end",s,"mixed-numeric"),C=void 0;else{const e=i.hasColumnById(this,"yFilterValue-raw");I=d?i.resolveColumnById(this,"yValue-start",s,"mixed-numeric"):void 0,A=d?i.resolveColumnById(this,"yValue-end",s,"mixed-numeric"):void 0,C=e?i.resolveColumnById(this,"yFilterValue-raw",s,"mixed-numeric"):void 0}return{dataSource:a,rawData:a.data,xValues:i.resolveKeysById(this,"xValue",s),yRawValues:i.resolveColumnById(this,"yValue-raw",s,"mixed-numeric"),yStartValues:I,yEndValues:A,yFilterValues:C,xScale:o,yScale:r,xAxis:e,yAxis:t,groupOffset:k,barOffset:D,barWidth:w,range:l,yReversed:t.isReversed(),crossReversed:this.getCategoryAxis()?.isReversed()??!1,stackedTowardStart:d&&u.before,stackedTowardEnd:d&&u.after,plotRegion:x,bboxBottom:r.convert(0n),boxPadding:b,labelBoxExtent:Dt(p),crisp:null==h&&(this.properties.crisp??Lx(e?.scale,e?.visibleRange,this.smallestDataInterval,this.largestDataInterval)),isStacked:d,filteredValueExceedUnfiltered:c,animationEnabled:!this.ctx.animationManager.isSkipped(),dataAggregationFilter:h,canIncrementallyUpdate:M,phantomNodes:M?this.contextNodeData.phantomNodeData??[]:[],nodes:M?this.contextNodeData.nodeData:[],labels:M?this.contextNodeData.labelData:[],nodeIndex:0,phantomIndex:0,barAlongX:this.getBarDirection()===n.tv$.X,shouldFlipXY:this.shouldFlipXY(),xKey:this.properties.xKey,yKey:this.properties.yKey,xName:this.properties.xName,yName:this.properties.yName,legendItemName:this.properties.legendItemName,label:p,labelPlacement:y,labelPlacements:m,labelUsesCandidates:(0,n.Yfy)(p.orientation,p.placement,v,S),labelHideable:!v,labelRotation:(0,n.qlQ)((0,n.$rL)(p.orientation)[0]),labelResolvesOrientation:(0,n.fjG)(p.orientation),labelFit:S,yDomain:this.getSeriesDomain(n.tv$.Y).domain}}computeXPosition(e,t){const i=e.xScale.convert(e.xValues[t]);return Number.isFinite(i)?i+e.groupOffset+e.barOffset+this.getDatumOffset(e.xValues[t]):Number.NaN}prepareNodeDatumState(e,t,i,s,a){if(!(0,n.QQF)(a))return;const o=e.xValues[i];if(void 0===o&&!this.properties.allowNullKeys)return;const r=e.dataSource?.data[i],l=e.yRawValues[i],h=null==e.yFilterValues?void 0:Number(e.yFilterValues[i]);if(null!=h&&!Number.isFinite(h))return;const c=e.label.enabled&&null!=l?this.getLabelText(h??l,r,e.yKey,"y",e.yDomain,e.label,{datum:r,value:h??l,xKey:e.xKey,yKey:e.yKey,xName:e.xName,yName:e.yName,legendItemName:e.legendItemName}):void 0,d=l>=0&&!Object.is(l,-0);return t.datum=r,t.xValue=o,t.yRawValue=l,t.yFilterValue=h,t.labelText=c,t.inset=null!=h&&h>l,t.isPositive=d,t.precomputedBottomY=null==h?void 0:e.yScale.convert(s),t.precomputedIsUpward=null==h?void 0:d!==e.yReversed,t}createSkeletonNodeDatum(e,t,i){const n=t.nodeDatumScratch;return{series:this,datum:n.datum,datumIndex:t.datumIndex,cumulativeValue:0,phantom:i,xValue:n.xValue??"",yValue:0,yKey:e.yKey,xKey:e.xKey,capDefaults:{lengthRatioMultiplier:0,lengthMax:0},x:0,y:0,width:0,height:0,midPoint:{x:0,y:0},opacity:t.opacity,featherRatio:t.featherRatio,topLeftCornerRadius:!1,topRightCornerRadius:!1,bottomRightCornerRadius:!1,bottomLeftCornerRadius:!1,clipBBox:void 0,crisp:e.crisp,label:void 0,missing:!1,focusable:!i}}createNodeDatum(e,t){const i=this.prepareNodeDatumState(e,t.nodeDatumScratch,t.datumIndex,t.yStart,t.yEnd);if(!i)return{nodeData:void 0,phantomNodeData:void 0};const n=this.createSkeletonNodeDatum(e,t,!1);let s;return this.updateNodeDatum(e,n,t,i),null!=i.yFilterValue&&(s=this.createSkeletonNodeDatum(e,t,!0),this.updateNodeDatum(e,s,t)),{nodeData:n,phantomNodeData:s}}updateNodeDatum(e,t,i,s){if(s??(s=this.prepareNodeDatumState(e,i.nodeDatumScratch,i.datumIndex,i.yStart,i.yEnd)),!s)return;const a=t,o=t.phantom,r=i.yStart,l=o?s.yFilterValue:s.yFilterValue??s.yRawValue,h=o?s.yFilterValue:s.yFilterValue??Number(i.yEnd),c=o?s.yFilterValue:s.yFilterValue??i.yEnd,d=o?void 0:s.labelText;let u,p,g;u=o||null==s.yFilterValue?i.yEnd:Number(i.yStart)+s.yFilterValue,p=o||null==s.yFilterValue?i.yRange:Math.max(Number(i.yStart)+s.yFilterValue,Number(i.yRange)),g=o?void 0:s.inset?.6:void 0;const y=s.precomputedIsUpward??s.isPositive!==e.yReversed,f=e.yScale.convert(u),x=s.prec
1omputedBottomY??e.yScale.convert(r),b=e.yScale.convert(p),v=.5*i.width*(1-(g??1)),S=e.barAlongX?Math.min(f,x):i.x+v,M=e.barAlongX?i.x+v:Math.min(f,x),k=e.barAlongX?Math.abs(x-f):i.width*(g??1),D=e.barAlongX?i.width*(g??1):Math.abs(x-f),w=e.barAlongX?Math.min(e.bboxBottom,b):i.x+v,I=e.barAlongX?i.x+v:Math.min(e.bboxBottom,b),A=e.barAlongX?Math.abs(e.bboxBottom-b):i.width*(g??1),C=e.barAlongX?i.width*(g??1):Math.abs(e.bboxBottom-b);a.datum=s.datum,a.datumIndex=i.datumIndex,a.cumulativeValue=h,a.cumulativeValueExact=c,a.xValue=s.xValue,a.yValue=l,a.x=w,a.y=I,a.width=A,a.height=C;const N=a.midPoint;N.x=S+k/2,N.y=M+D/2;const L=e.shouldFlipXY?D:k;a.capDefaults.lengthRatioMultiplier=L,a.capDefaults.lengthMax=L,a.opacity=i.opacity,a.featherRatio=i.featherRatio,a.topLeftCornerRadius=e.barAlongX!==y,a.topRightCornerRadius=y,a.bottomRightCornerRadius=e.barAlongX===y,a.bottomLeftCornerRadius=!y;const P=a.clipBBox;P?(P.x=S,P.y=M,P.width=k,P.height=D):a.clipBBox=new m(S,M,k,D),a.crisp=e.crisp;const T={x:S,y:M,width:k,height:D};if(null==d)a.label=void 0;else if(e.labelUsesCandidates){const t=(0,n.kzl)(d,e.label),i=(0,n.$rL)(e.label.orientation);0===i.length&&i.push("horizontal");const s=ff({isUpward:y,isVertical:!e.barAlongX,placements:e.labelPlacements,orientations:i,spacing:e.label.spacing,label:e.label,textWidth:t.width,textHeight:t.height,rect:T,crossReversed:e.crossReversed,rejectOutsideStart:e.stackedTowardStart,rejectOutsideEnd:e.stackedTowardEnd,hideable:e.labelHideable,plotRegion:e.plotRegion,fitted:null!=e.labelFit,text:d});if(0===s.length)a.label=void 0;else{const{anchor:t,region:i,placement:n}=s[0],o=a.label;o?(o.text=d,o.fittedText=void 0,o.fittedFontSize=void 0,o.x=t.x,o.y=t.y,o.textAlign=t.textAlign,o.textBaseline=t.textBaseline,o.rotation=e.labelRotation,o.region=i,o.offsetX=0,o.offsetY=0,o.placement=n,o.candidates=s):a.label={text:d,x:t.x,y:t.y,textAlign:t.textAlign,textBaseline:t.textBaseline,rotation:e.labelRotation,region:i,offsetX:0,offsetY:0,placement:n,candidates:s}}}else{const{labelPlacement:t,labelRotation:i}=e,s=(null==t||t.startsWith("inside"))&&(null!=e.labelFit||e.labelResolvesOrientation)?uf(T,t??"inside-center",y,!e.barAlongX,e.label.spacing,e.labelBoxExtent):void 0,o=e.labelResolvesOrientation?s?.region:void 0,{text:r,fontSize:l}=e.labelResolvesOrientation?{text:d,fontSize:void 0}:Wy(d,e.labelFit,e.label,s?.container),{width:h,height:c}=0===i?{width:0,height:0}:(0,n.kzl)(r,(0,n.lad)(e.label,l)),u=gf({isUpward:y,isVertical:!e.barAlongX,placement:t,spacing:e.label.spacing,boxPadding:e.boxPadding,rect:T,rotation:i,labelWidth:h,labelHeight:c,crossReversed:e.crossReversed}),p=a.label;p?(p.text=r,p.x=u.x,p.y=u.y,p.textAlign=u.textAlign,p.textBaseline=u.textBaseline,p.rotation=i,p.region=o,p.offsetX=0,p.offsetY=0,p.placement=t,p.candidates=void 0,p.hidden=void 0,p.fittedText=void 0,p.fittedFontSize=l):a.label={text:r,fittedFontSize:l,...u,rotation:i,region:o,offsetX:0,offsetY:0,placement:t}}a.missing=eu(l)}createNodeDataWithAggregation(e,t,i){const s=e.yReversed?-1:1;for(let a=0;a<2;a+=1){const o=0===a,r=o?e.dataAggregationFilter.positiveIndices:e.dataAggregationFilter.negativeIndices,l=o?e.dataAggregationFilter.positiveIndexData:e.dataAggregationFilter.negativeIndexData,h=o?n.jBM:n.BNK,c=o?n.BNK:n.jBM,d=this.visibleRangeIndices("xValue",e.xAxis.range,r),u=d[0],p=d[1];for(let a=u;a<p;a+=1){const r=a*n.kmN,d=l[r+n.qbB],u=l[r+n.IXP],p=l[r+h],g=l[r+c];if(d===n.IXQ)continue;if(null==e.xValues[g]||null==e.xValues[p])continue;const m=t(Math.trunc((d+u)/2)),y=Math.abs(t(u)-t(d))+e.barWidth;if(m-y<0||m>e.range)continue;const f=Math.abs(u-d)+1,x=Vl.is(e.xScale)?Math.min(e.xScale.bandwidth*Math.max(f-1,1)/(e.xScale.step*f),1):1;if(i.datumIndex=g,i.x=m,i.width=y,i.opacity=x,e.isStacked)i.yStart=e.yStartValues[p],i.yEnd=e.yEndValues[g],i.featherRatio=0;else{const t=e.yRawValues[g],a=e.yRawValues[p];i.yStart=0,i.yEnd=t,i.featherRatio=(o?1:-1)*s*(1-(0,n.Roz)(a)/(0,n.Roz)(t))}i.yRange=i.yEnd,this.upsertNodeDatum(e,i)}}}createNodeDataGrouped(e,t,i){const s=this.processedData,a=s.invalidData?.get(this.id),o=e.barWidth;let r;r=e.filteredValueExceedUnfiltered?this.dataModel.resolveProcessedDataIndexById(this,"yFilterValue-range"):e.isStacked?this.dataModel.resolveProcessedDataIndexById(this,"yValue-range"):-1;const l=s.columnScopes.findIndex((e=>e.has(this.id))),h=s.groups,c=bl(1,h.length,e.xAxis.range,(e=>{const t=h[e].keys[0];return this.xCoordinateRange(t)})),d=c[0],u=c[1];for(let s=d;s<u;s+=1){const c=h[s],d=c.aggregation,u=c.datumIndices[l];if(null!=u)for(const l of u){const h=s+l,c=t(h);if(!0===a?.[h])continue;const u=e.yRawValues[h];if(null==u)continue;const p=u>=0&&!Object.is(u,-0),g=(0,n.s1j)(u),m=e.isStacked?e.yStartValues?.[h]??g:g,y=e.isStacked?e.yEndValues?.[h]:u;let f=y;e.isStacked&&(f=d[r][p?1:0]),i.datumIndex=h,i.x=c,i.width=o,i.yStart=m,i.yEnd=y,i.yRange=f,i.featherRatio=0,i.opacity=1,this.upsertNodeDatum(e,i)}}}createNodeDataSimple(e,t,i){const s=this.processedData.invalidData?.get(this.id
1),a=e.barWidth,o=this.visibleRangeIndices("xValue",e.xAxis.range);let r=o[0],l=o[1];this.processedData.input.count<1e3&&(r=0,l=this.processedData.input.count);for(let o=r;o<l;o+=1){if(!0===s?.[o])continue;const r=e.yRawValues[o];if(null==r)continue;const l=t(o),h=r;i.datumIndex=o,i.x=l,i.width=a,i.yStart=(0,n.s1j)(h),i.yEnd=h,i.yRange=h,i.featherRatio=0,i.opacity=1,this.upsertNodeDatum(e,i)}}upsertNodeDatum(e,t){const i=e.canIncrementallyUpdate&&e.nodeIndex<e.nodes.length,n=null!=e.yFilterValues,s=n&&e.canIncrementallyUpdate&&e.phantomIndex<e.phantomNodes.length;let a,o;if(i)a=e.nodes[e.nodeIndex],this.updateNodeDatum(e,a,t),e.nodeIndex>=e.labels.length&&e.labels.push(a);else{const i=this.createNodeDatum(e,t);i.nodeData&&(e.nodes.push(i.nodeData),e.labels.push(i.nodeData)),o=i.phantomNodeData}if(e.nodeIndex++,!n)return{nodeData:e.nodes[e.nodeIndex]};if(s)o=e.phantomNodes[e.phantomIndex],this.updateNodeDatum(e,o,t);else if(o)e.phantomNodes.push(o);else{const i=this.createNodeDatum(e,t);i.phantomNodeData&&e.phantomNodes.push(i.phantomNodeData)}return e.phantomIndex++,{nodeData:a,phantomNodeData:o}}resolveUsesPlacedLabels(){return(0,n.qpr)(this.properties.label)}populateNodeData(e){const t=t=>this.computeXPosition(e,t),i={nodeDatumScratch:{datum:void 0,xValue:void 0,yRawValue:0,yFilterValue:void 0,labelText:void 0,inset:!1,isPositive:!1,precomputedBottomY:void 0,precomputedIsUpward:void 0},datumIndex:0,x:0,width:0,yStart:0,yEnd:0,yRange:0,featherRatio:0,opacity:1};null!=e.dataAggregationFilter?this.createNodeDataWithAggregation(e,t,i):"grouped"===this.processedData.type?this.createNodeDataGrouped(e,t,i):this.createNodeDataSimple(e,t,i)}initializeResult(e){return{itemId:this.properties.yKey,nodeData:e.nodes,phantomNodeData:e.phantomNodes,labelData:e.labels,scales:this.calculateScaling(),visible:this.visible||e.animationEnabled,groupScale:this.getScaling(this.ctx.seriesStateManager.getGroupScale(this)),styles:Sl(this.getItemStyle.bind(this)),segments:void 0}}finalizeNodeData(e){e.canIncrementallyUpdate&&(this.trimIncrementalNodeArray(e.nodes,e.nodeIndex),this.trimIncrementalNodeArray(e.phantomNodes,e.phantomIndex),this.trimIncrementalNodeArray(e.labels,e.nodes.length))}assembleResult(e,t){const i=this.chart?.seriesRect;return null==i||(t.segments=Pm(this.properties.segmentation,e.xAxis,e.yAxis,i,this.ctx.scene)),t}nodeFactory(){return new vS}updateSeriesSelections(){super.updateSeriesSelections(),this.phantomSelection=this.updateDatumSelection({nodeData:this.contextNodeData?.phantomNodeData??[],datumSelection:this.phantomSelection})}updateHighlightSelectionItem(e){const t=super.updateHighlightSelectionItem(e),i=this.ctx.highlightManager?.getActiveHighlight(),n=this.isSeriesHighlighted(i)&&i?.datum?i:void 0;return this.phantomHighlightSelection=this.updateDatumSelection({nodeData:n?this.getHighlightData(this.contextNodeData?.phantomNodeData??[],n)??[]:[],datumSelection:this.phantomHighlightSelection}),t}updateNodes(e,t){super.updateNodes(e,t),this.updateDatumNodes({datumSelection:this.phantomSelection,isHighlight:!1,drawingMode:"overlay"}),this.updateDatumNodes({datumSelection:this.phantomHighlightSelection,isHighlight:!0,drawingMode:"overlay"})}getHighlightData(e,t){const i=e.find((e=>e.datum===t.datum));return null==i?void 0:[{...i}]}updateDatumSelection(e){return gr(this.processedData)?e.datumSelection.update(e.nodeData,void 0,this.getDatumId.bind(this)):e.datumSelection.update(e.nodeData)}makeStylerParams(e,t,i){const{id:n}=this,{cornerRadius:s,fill:a,fillOpacity:o,lineDash:r,lineDashOffset:l,stackGroup:h,stroke:c,strokeOpacity:d,strokeWidth:u,xKey:p,yKey:g}=this.properties;return{cornerRadius:s,fill:a,fillOpacity:o,highlightState:sl(e??0),selectionState:al(t),candidateState:al(i),lineDash:r,lineDashOffset:l,seriesId:n,stackGroup:h,stroke:c,strokeOpacity:d,strokeWidth:u,xKey:p,yKey:g}}makeItemStylerParams(e,t,i,n,s,a){const{id:o}=this,{xKey:r,yKey:l,stackGroup:h}=this.properties,c=t.dataSources.get(o)?.data?.[i],d=e.resolveColumnById(this,"yValue-raw",t,"mixed-numeric")[i],u=e.getDomain(this,"xValue","key",t).domain,p=e.getDomain(this,this.yCumulativeKey(e),"value",t).domain,g=this.ctx.highlightManager?.getActiveHighlight(),m=this.getHighlightStateString(g,s,i),y=this.getSelectionStateString(i),f=this.getCandidateStateString(i),x=this.filterItemStylerFillParam
1s(a.fill)??a.fill;return{seriesId:o,...xl(n,d,r,l,u,p),datum:c,xValue:n,yValue:d,stackGroup:h,highlightState:m,selectionState:y,candidateState:f,...a,fill:x}}getStyle(e,t,i,n){const{cornerRadius:s,fill:a,fillOpacity:o,lineDash:r,lineDashOffset:l,stroke:h,strokeOpacity:c,strokeWidth:d,styler:u}=this.properties;let p={};if(!e&&u){const e=this.makeStylerParams(t,i,n);p=this.ctx.optionsGraphService.resolvePartial(["series",`${this.declarationOrder}`],this.cachedCallWithContext(u,e)??{},{pick:!1})??{}}return{cornerRadius:p.cornerRadius??s,fill:p.fill??a,fillOpacity:p.fillOpacity??o,lineDash:p.lineDash??r,lineDashOffset:p.lineDashOffset??l,opacity:1,stroke:p.stroke??h,strokeOpacity:p.strokeOpacity??c,strokeWidth:p.strokeWidth??d}}getItemStyle(e,t,i,s,a){const{properties:o,dataModel:r,processedData:l}=this,{itemStyler:h,simpleItemStyler:c}=o,d=this.getHighlightStyle(t,e,i),u=this.getSelectionStyle(e,s,a);if(c&&null!=l&&null!=e){const t=l.dataSources.get(this.id)?.data?.[e],o=c(t);return(0,n.HFk)(o,u,d,this.getStyle(!1,i,s,a))}let p=(0,n.HFk)(d,u,this.getStyle(void 0===e,i,s,a));if(h&&null!=r&&null!=l&&null!=e){const i=r.resolveKeysById(this,"xValue",l)[e],s=this.cachedDatumCallback(Xr(this.getDatumId({xValue:i,phantom:!1}),t?"highlight":"node"),(()=>{const n=this.makeItemStylerParams(r,l,e,i,t,p);return this.ctx.optionsGraphService.resolvePartial(["series",`${this.declarationOrder}`],this.callWithContext(h,n))}));s&&(p=(0,n.HFk)(s,p))}return p}updateDatumStyles(e){const t=this.ctx.highlightManager.getActiveHighlight(),i=this;e.datumSelection.each((function(n,s){if(!e.datumSelection.isGarbage(n)){const n=i.getHighlightState(t,e.isHighlight,s.datumIndex),a=i.getDataSelectionState(s.datumIndex),o=i.getDataCandidacyState(s.datumIndex);s.style=i.getItemStyle(s.datumIndex,e.isHighlight,n,a,o)}}))}updateDatumNodes(e){const{contextNodeData:t}=this;if(!t)return;const i=this.ctx.highlightManager.getActiveHighlight(),{shadow:s}=this.properties,a=this.getCategoryDirection()===n.tv$.X,o=this.getShapeFillBBox(),r=this.getBarDirection(),l=this.getCategoryCrispDirection(),{drawingMode:h,isHighlight:c}=e,d=this,u=t.styles;e.datumSelection.each((function(e,t){const n=t.style??u[d.getHighlightState(i,c,t.datumIndex)];e.setStyleProperties(n,o);const p=n.cornerRadius??0,g=a?(t.clipBBox?.width??t.width)>0:(t.clipBBox?.height??t.height)>0;e.setStaticProperties(h,t.topLeftCornerRadius?p:0,t.topRightCornerRadius?p:0,t.bottomRightCornerRadius?p:0,t.bottomLeftCornerRadius?p:0,g,t.crisp,s,r,t.featherRatio,l)}))}getLabelObstacles(){return af(this.properties.label,this.contextNodeData?.nodeData,this.contextNodeData?.labelData,this.isLabelEnabled()&&!this.usesPlacedLabels,(e=>e.label))}getLabelData(){if(!this.usesPlacedLabels||!this.isLabelEnabled())return[];const{label:e}=this.properties,{alwaysShow:t,collideWith:i,threshold:s,measureBox:a,fitFor:o}=sf(e);if((0,n.fD2)(e)){const e=[];for(const r of this.contextNodeData?.labelData??[]){const l=r.label;if(null==l?.candidates||""===l.text)continue;const{width:h,height:c}=a(l.text),d={x:r.x,y:r.y,width:r.width,height:r.height};e.push((0,n.Nv9)(l.text,h,c,l.candidates,l,d,t,i,s,!1,o(l.text),r))}return e}const r=of(this,e,this.makeLabelFormatterParams()),l=(0,n.$rL)(e.orientation)[0]??"horizontal",h=(0,n.$rL)(e.placement)[0]??"inside-center";return(0,n.AEW)(this.contextNodeData?.labelData,(t=>{const n=t.label,c=null!=n&&""!==n.text,d=c?nf(r,t,n.placement??h,l,n.text):void 0;if(!0===d?.hidden)return;const u=null==n?void 0:o(n.text);return{label:n,config:e,size:d?.size??(c?a(n.text):void 0),collideWith:i,threshold:s,fit:null==u||null==d?u:{...u,font:d.font,boxPadding:d.boxPadding}}}))}getLabelCandidateResolver(){const e=this.makeLabelFormatterParams();return Sf(this,this.properties.label,(()=>e))}updatePlacedLabelData(e){(0,n.she)(e),(0,n.HkM)(this.contextNodeData?.labelData,e,(e=>e.label)),this.refreshPlacedLabelNodes()}updateLabelSelection(e){const t=this.isLabelEnabled()?e.labelData:[];return e.labelSelection.update(t,(e=>{e.pointerEvents=1}))}makeLabelFormatterParams(){const{xKey:e,xName:t,yKey:i,yName:n,legendItemName:s}=this.properties;return{xKey:e,xName:t??e,yKey:i,yName:n??i,legendItemName:s??t??e}}updateLabelNodes(e){const{isHighlight:t=!1}=e,i=this.makeLabelFormatterParams(),s=this.ctx.highlightManager?.getActiveHighlight(),{label:a}=this.properties;e.labelSelection.each(((e,o)=>{if(o.label?.hidden)return void(e.visible=!1);e.fillOpacity=this.getHighlightStyle(t,o?.datumIndex).opacity??1;const r=o.label?.placement??(0,n.$rL)(a.placement)[0]??"inside-center",l=Zy(a,qy(r));lf(this,e,i,a,o.label,{isHighlight:t,activeHighlight:s},void 0,l,{placement:r,orientation:(0,n.afe)(o.label?.rotation??0)})}))}getTooltipContent(e){const{id:t,dataModel:i,processedData:n,properties:s}=this,{xKey:a,xName:o,yKey:r,yName:l,legendItemName:h,stackGroup:c,tooltip:d}=s,u=s.allowNullKeys??!1,p=this.getCategoryAxis(),g=this.getValueAxis();if(!(i&&n&&p&&g))return;
1const m=n.dataSources.get(this.id)?.data?.[e],y=i.resolveKeysById(this,"xValue",n)[e],f=i.resolveColumnById(this,"yValue-raw",n,"mixed-numeric")[e];if(void 0===y&&!u)return;const x=this.getItemStyle(e,!1,void 0,void 0,void 0);return this.formatTooltipWithContext(d,{heading:this.getAxisValueText(p,"tooltip",y,m,a,h,u),symbol:this.legendItemSymbol(),data:[{label:l,fallbackLabel:r,value:this.getAxisValueText(g,"tooltip",f,m,r,h),missing:eu(f)}]},{seriesId:t,datum:m,title:l,xKey:a,xName:o,yKey:r,yName:l,legendItemName:h,stackGroup:c,...x,...this.getModuleTooltipParams()})}legendItemSymbol(){const{fill:e,stroke:t,strokeWidth:i,fillOpacity:n,strokeOpacity:s,lineDash:a,lineDashOffset:o}=this.getStyle(!1,0,void 0,void 0);return{marker:{fill:e??"rgba(0, 0, 0, 0)",stroke:t??"rgba(0, 0, 0, 0)",fillOpacity:n,strokeOpacity:s,strokeWidth:i,lineDash:a,lineDashOffset:o}}}getLegendData(e){const{showInLegend:t}=this.properties;if("category"!==e)return[];const{id:i,ctx:{legendManager:n},visible:s}=this,{yKey:a,yName:o,legendItemName:r}=this.properties;return[{legendType:"category",id:i,itemId:a,seriesId:i,enabled:s&&(n?.getItemEnabled({seriesId:i,itemId:a})??!0),label:{text:r??o??a},symbol:this.legendItemSymbol(),legendItemName:r,hideInLegend:!t}]}resetDatumAnimation(e){zx([e.datumSelection,this.phantomSelection])}animateReadyHighlight(e){zx([e,this.phantomHighlightSelection])}animateEmptyUpdateReady({datumSelection:e,labelSelection:t,annotationSelections:i}){const{phantomSelection:n}=this,s=Rx(Tx(this.isVertical(),this.axes,"normal"),"unknown");Vh(this.id,"nodes",this.ctx.animationManager,[e,n],s),Af(this,"labels",this.ctx.animationManager,t),Af(this,"annotations",this.ctx.animationManager,...i)}animateWaitingUpdateReady(e){const{phantomSelection:t}=this,{datumSelection:i,labelSelection:s,annotationSelections:a,contextData:o,previousContextData:r}=e;this.ctx.animationManager.stopByAnimationGroupId(this.id);const l=jx(this.id,i,this.getDatumId.bind(this),e.contextData,r,this.processedData,this.processedDataUpdated),h=null==r?"fade":"normal",c=Rx(Tx(this.isVertical(),this.axes,h),"added");Vh(this.id,"nodes",this.ctx.animationManager,[i,t],c,(e=>this.getDatumId(e.unsafeDatum)),l),l&&!l?.changed&&(0,n.wo0)(o.groupScale,r?.groupScale)||(Af(this,"labels",this.ctx.animationManager,s),Af(this,"annotations",this.ctx.animationManager,...a))}getDatumId(e){return Xr(e.xValue,e.phantom)}isLabelEnabled(){return this.properties.label.enabled}computeFocusBounds({datumIndex:e}){const t=this.contextNodeData?.nodeData[e].clipBBox;return Bx(this,t)}hasItemStylers(){return this.properties.selection.enabled||null!=this.properties.styler||null!=this.properties.itemStyler||null!=this.properties.simpleItemStyler||null!=this.properties.label.itemStyler}};return e.className="BarSeries",e.type="bar",e})(),CS=(()=>({series:{direction:"vertical",fill:{$applySwitch:[{$path:"type"},{$palette:"fill"},["gradient",n.Euh],["image",n.pwE],["pattern",n.eu4]]},fillOpacity:1,stroke:{$palette:"stroke"},strokeWidth:{$isUserOption:["./stroke",2,0]},lineDash:[0],lineDashOffset:0,label:{...n.VTt,...n.F$C,enabled:!1,fontWeight:{$ref:"fontWeight"},fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},spacing:8,padding:8,collision:{threshold:4,alwaysShow:n.O2O,...(0,n.fs4)({collideWith:{seriesItems:!0}})},insideStyle:(0,n.KVS)("chartBackgroundColor"),outsideStyle:(0,n.KVS)("textColor"),placement:"inside-center"},shadow:{enabled:!1,color:n.KU9,xOffset:3,yOffset:3,blur:5},highlight:n.fil,selection:n.zg6,segmentation:n.IgM}}))(),NS=pm({type:"series",name:"bar",chartType:"cartesian",stackable:!0,groupable:!0,version:Ot,dependencies:[Wv],options:Hn,predictAxis:Rm,defaultAxes:n.QTQ,axisKeys:{[n.tv$.X]:"xKeyAxis",[n.tv$.Y]:"yKeyAxis"},axisKeysFlipped:{[n.tv$.X]:"yKeyAxis",[n.tv$.Y]:"xKeyAxis"},themeTemplate:CS,create:e=>new AS(e)});function LS(e,t,i){const{xValues:s,yValues:a,xDomain:o,yDomain:r,xNeedsValueOf:l,yNeedsValueOf:h}=e,{x0:c,y0:d,x1:u,y1:p}=i;let g=0;for(const e of t){const t=s[e],i=a[e];if(null==t||null==i)continue;const m=(0,n.mYB)(t,o.min,o.max,l),y=(0,n.mYB)(i,r.min,r.max,h);m>=c&&m<=u&&y>=d&&y<=p&&(g+=1)}return g}function PS(e,t){if(Number.isFinite(e)&&Number.isFinite(t)&&t>e)return[e,t];const i=Number.isFinite(e)?e:0;return[i,i+1]}function TS(e,t,i){const{x0:s,y0:a,x1:o,y1:r}=i;let l=!Number.isFinite(o-s)||!Number.isFinite(r-a)||t.length<5&&o-s<.05&&r-a<.05||s===o&&a===r?null:function(e,t,i){const{xValues:s,yValues:a,xDomain:o,yDomain:r,xNeedsValueOf:l,yNeedsValueOf:h}=e,{x0:c,y0:d,x1:u,y1:p}=i,g=[{x0:1,y0:1,x1:0,y1:0,indices:[]},{x0:1,y0:1,x1:0,y1:0,indices:[]},{x0:1,y0:1,x1:0,y1:0,indices:[]},{x0:1,y0:1,x1:0,y1:0,indices:[]}],m=(c+u)/2,y=(d+p)/2;for(const e of t){const t=s[e],i=a[e];if(null==t||null==i)continue;const c=(0,n.mYB)(t,o.min,o.max,l),d=(0,n.mYB)(i,r.min,r.max,h),u=g[(c>m?1:0)+(d>y?2:0)];u.indices.push(e),u.x0=Math.min(u.x0,c),u.y0=Math.min(u.y0,d),u.x1=Math.max(u.x1,c),u.y1=Math.max(u.y1,d)}const f=[];for(const t of g){const{indices:i,x0:n,x1:s,y0:a,y1:o}=t;if(0===i.length)continue;const r=TS(e,i,{x0:n,y0:a,x1:s,y1:o});f.push(r)}return f}(e,t,i);if(1===l?.length)return l[0];0===l?.length&&(l=null);const h=Math.hypot(o-s,r-a),c=function(e,t,i){const{xValues:s,yValues:a,xDomain:o,yDomain:r,xNeedsValueOf:l,yNeedsValueOf:h}=e,{x0:c,y0:d,x1:u,y1:p}=i;let g=0,m=1/0;const y=(c+u)/2,f=(d+p)/2;for(const e of t){const t=s[e],i=a[e];if(null==t||null==i)continue;const c=((0,n.mYB)(t,o.min,o.max,l)-y)**2+((0,n.mYB)(i,r.min,r.max,h)-f)**2;c<m&&(m=c,g=e)}return g}(e,t,i);return{scale:h,x0:s,y0:a,x1:o,y1:r,indices:t,primaryDatumIndex:c,children:l}}function OS(e,t,i,s,a,o,r,l,h){const[c,d]=a,[u,p]=(0,n.HBB)(e,o);
1return function(e,t,i,n,s,a,o){const[r,l]=PS(...e),[h,c]=PS(...t),[d,u]=a,{xNeedsValueOf:p,yNeedsValueOf:g}=o,m={xValues:i,yValues:n,xDomain:{min:r,max:l},yDomain:{min:h,max:c},xNeedsValueOf:p,yNeedsValueOf:g},y=[];if(null!=s&&u>d){const e=Array.from({length:3},(()=>[]));for(let t=0;t<s.length;t+=1){const i=(s[t]-d)/(u-d),n=Math.trunc(3*i);n>=0&&n<3&&e[n].push(t)}for(let t=0;t<e.length;t+=1){const i=TS(m,e[t],{x0:0,y0:0,x1:1,y1:1});if(null!=i){const e=t/3;y.push({sizeRatio:e,node:i})}}}else{const e=TS(m,i.map(((e,t)=>t)),{x0:0,y0:0,x1:1,y1:1});null!=e&&y.push({sizeRatio:0,node:e})}return y.length>0?{xValues:i,yValues:n,xd0:r,xd1:l,yd0:h,yd1:c,filters:y,xNeedsValueOf:p,yNeedsValueOf:g}:void 0}([c,d],[u,p],t,i,s,[r[0],r[1]],{xNeedsValueOf:l,yNeedsValueOf:h})}function RS(e,t,i,s,a,o){const{xRange:r,yRange:l,xVisibleRange:[h,c],yVisibleRange:[d,u],minSize:p,maxSize:g}=i,{xValues:m,yValues:y,xd0:f,xd1:x,yd0:b,yd1:v,xNeedsValueOf:S,yNeedsValueOf:M}=t,k=1/Math.min(r/(c-h),l/(u-d)),D={xValues:m,yValues:y,xDomain:{min:f,max:x},yDomain:{min:b,max:v},xNeedsValueOf:S,yNeedsValueOf:M};for(const{sizeRatio:i,node:m}of t.filters){const t=.5*(p+i*(g-p)),y=t*k,f=e*y,x=h-t/r,b=c+t/r,v=d-t/l,S=u+t/l,M=[m];for(;M.length>0;){const t=M.pop();if(!(t.x1<x||t.x0>b||t.y1<v||t.y0>S))if(1!==e&&t.scale<=f)null!=s&&(s.count+=1),a?.push({datumIndex:t.primaryDatumIndex,count:t.indices.length,area:(t.x1-t.x0)*(t.y1-t.y0),dilation:(0,n.qE8)(1,t.scale/y,e),indices:t.indices});else if(null==t.children){const{indices:e}=t;if(null!=s){const i=t.x0>=h&&t.x1<=c&&t.y0>=d&&t.y1<=u?e.length:LS(D,e,{x0:h,y0:d,x1:c,y1:u});s.count+=i}o?.push(...e)}else M.push(...t.children)}}}function ES(e,t,i){const n={count:0};return RS(e,t,i,n,void 0,void 0),n.count}var zS=(()=>{var e=class extends wd{constructor(){super(...arguments),this.maxSize=30}};return d([n.mAP,(0,n.k8u)()],e.prototype,"maxSize",2),d([n.mAP,(0,n.Haz)()],e.prototype,"sizeDomain",2),e})(),BS=(()=>{var e=class extends vt{constructor(){super(...arguments),this.placement="top"}};return d([n.mAP],e.prototype,"placement",2),e})(),FS=(()=>{var e=class extends ly{constructor(){super(...arguments),this.colorScale=new G,this.label=new BS,this.tooltip=Of(),this.maxRenderedItems=1/0,this.marker=new zS}};return d([n.mAP],e.prototype,"xKey",2),d([n.mAP],e.prototype,"yKey",2),d([n.mAP],e.prototype,"sizeKey",2),d([n.mAP],e.prototype,"labelKey",2),d([n.mAP],e.prototype,"colorKey",2),d([n.mAP],e.prototype,"selectedKey",2),d([n.mAP],e.prototype,"xName",2),d([n.mAP],e.prototype,"yName",2),d([n.mAP],e.prototype,"sizeName",2),d([n.mAP],e.prototype,"labelName",2),d([n.mAP],e.prototype,"colorName",2),d([n.mAP],e.prototype,"colorScale",2),d([n.mAP],e.prototype,"title",2),d([(0,n.i1O)("marker.shape")],e.prototype,"shape",2),d([(0,n.i1O)("marker.fill")],e.prototype,"fill",2),d([(0,n.i1O)("marker.fillOpacity")],e.prototype,"fillOpacity",2),d([(0,n.i1O)("marker.stroke")],e.prototype,"stroke",2),d([(0,n.i1O)("marker.strokeWidth")],e.prototype,"strokeWidth",2),d([(0,n.i1O)("marker.strokeOpacity")],e.prototype,"strokeOpacity",2),d([(0,n.i1O)("marker.lineDash")],e.prototype,"lineDash",2),d([(0,n.i1O)("marker.lineDashOffset")],e.prototype,"lineDashOffset",2),d([(0,n.i1O)("marker.itemStyler")],e.prototype,"itemStyler",2),d([n.mAP],e.prototype,"styler",2),d([n.mAP],e.prototype,"label",2),d([n.mAP],e.prototype,"tooltip",2),d([n.mAP],e.prototype,"maxRenderedItems",2),e})(),VS=(()=>{var e=class extends FS{};return d([(0,n.i1O)("marker.size")],e.prototype,"minSize",2),d([(0,n.i1O)("marker.maxSize")],e.prototype,"maxSize",2),d([(0,n.i1O)("marker.sizeDomain")],e.prototype,"sizeDomain",2),e})(),$S=(()=>{var e=class extends FS{};return d([(0,n.i1O)("marker.size")],e.prototype,"size",2),e})();function HS([e,t]){return e<=t?[e,t]:[t,e]}function jS(e,t,i){return i[1]-i[0]>0?(0,n.TnJ)(e,t,i):[0,1]}var WS=(()=>{var e=class e extends hy{constructor(e){super({moduleCtx:e,propertyKeys:{...oy,label:["labelKey"],size:["sizeKey"],color:["colorKey"]},propertyNames:{...ry,label:["labelName"],size:["sizeName"],color:["colorName"]},categoryKey:void 0,pickModes:[2,1,0],pathsPerSeries:[],datumSelectionGarbageCollection:!1,animationResetFns:{label:Nf,datum:Kx},usesPlacedLabels:!0,clipFocusBox:!1}),this.properties=new VS,this.dataAggregation=void 0,this.aggregateIndexSet=void 0,this.sizeScale=new Qm,this.colorScale=new V,this.colorScaleValid=!1,this.placedLabelData=[]}createNodeParams(e){return{...super.createNodeParams(e),xKey:this.properties.xKey,yKey:this.properties.yKey,sizeKey:this.properties.sizeKey,colorKey:this.properties.colorKey}}get pickModeAxis(){return"main-category"}get type(){return super.type}async processData(e){if(null==this.data||!this.visible)return;const t=this.axes[n.tv$.X]?.scale,i=this.axes[n.tv$.Y]?.scale,{xScaleType:s,yScaleType:a}=this.getScaleInformation({xScale:t,yScale:i}),o=this.sizeScale.type,r=this.colorScale.type,{xKey:l,yKey:h,sizeKey:c,selectedKey:d,labelKey:u,colorKey:p,marker:g}=this.properties,m=this.properties.allowNullKeys??!1,{dataModel:y,processedData:f}=await this.requestDataModel(e,this.data,{props:[kr(l,s,{id:"xValue",allowNullKey:m}),kr(h,a,{id:"yValue",allowNullKey:m}),...null==d?[]:[kr(d,"category",{id:"selectedValue"})],...null==c?[]:[kr(c,o,{id:"sizeValue"})],...null==u?[]:[kr(u,"category",{id:"labelValue"})],...null==p?[]:[kr(p,r,{id:"colorValue",invalidValue:void 0})]]}),x=null==c?void 0:y.resolveProcessedDataIndexById(this,"sizeValue"),b=g.sizeDomain?[g.sizeDomain[0],g.sizeDomain[1]]:void 0;if(this.sizeScale.domain=b??(null==x?void 0:f.domain.values[x])??[],this.colorScaleValid=!1,null!=p){const e=y.resolveProcessedDataIndexById(this,"colorValue"),t=f.domain.values[e].filter((e=>null!=e)),i=(0,n.Xxv)(t);null!=i&&(ob(this.colorScale,this.properties.colorScale,i,this.ctx.logger),this.colorScaleValid=!0)}this.dataAggregation=this.aggregateData(y,f),this.animationState.transition("updateData")}isColorScaleValid(){return this.colorScaleValid}resolveScaledSize(e){const{properties:t,sizeScale:i}=this,{sizeKey:n,marker:s}=t;if(null==n)return s.size;
1const a=this.dataModel.resolveColumnById(this,"sizeValue",this.processedData,"number")[e];return null==a?this.getSizeRange()[0]:i.convertClamped(a)}xCoordinateRange(e,t,i){const s=this.axes[n.tv$.X].scale.convert(e),a=.5*this.resolveScaledSize(i)*t;return[s-a,s+a]}yCoordinateRange(e,t,i){const s=this.axes[n.tv$.Y].scale.convert(e[0]),a=.5*this.resolveScaledSize(i)*t;return[s-a,s+a]}getSeriesDomain(e){const{dataModel:t,processedData:i}=this;if(!i||!t)return{domain:[]};const s={[n.tv$.X]:"xValue",[n.tv$.Y]:"yValue"},a=s[e],o=t.resolveProcessedDataDefById(this,a),r=t.getDomain(this,a,"value",i);if("value"===o?.def.type&&"category"===o?.def.valueType)return{domain:r.domain};const l=s[e===n.tv$.X?n.tv$.Y:n.tv$.X],h=this.domainForClippedRange(e,[a],l);return{domain:uo((0,n.Xxv)(h))}}getSeriesRange(e,t){const[i,s]=this.domainForVisibleRange(n.tv$.Y,["yValue"],"xValue",t);return[(0,n.Roz)(i),(0,n.Roz)(s)]}getVisibleItems(e,t,i){const{dataAggregation:s,axes:a}=this,o=a[n.tv$.X],r=a[n.tv$.Y];if(null==s||null==o||null==r)return this.countVisibleItems("xValue",["yValue"],e,t,i);return ES(0,s,this.aggregationOptions(o,r,e,t??[0,1]))}createBucketLookupFeature(){return new Lb({series:this,dataSelectionService:this.ctx.dataSelectionService,getIndexSetMap:()=>this.aggregateIndexSet})}aggregateData(e,t){if("grouped"===t.type)return;if(t.input.count-this.invalidDataCount()-this.missingDataCount()<=this.properties.maxRenderedItems)return;const i=this.axes[n.tv$.X],s=this.axes[n.tv$.Y];if(null==i||null==s)return;const a=i.scale,o=s.scale;return Rl.is(a)&&Rl.is(o)?function(e,t,i,s,a,o,r){const l=i.resolveColumnById(r,"xValue",s,"object"),h=i.resolveColumnById(r,"yValue",s,"mixed-numeric"),c=o?(0,n.Rp1)(i.resolveColumnById(r,"sizeValue",s,"mixed-numeric")):void 0,d=i.getDomain(r,"xValue","value",s),u=i.getDomain(r,"yValue","value",s),p=o?a.domain:[0,0],g=i.resolveColumnNeedsValueOf(r,"xValue",s),m=i.resolveColumnNeedsValueOf(r,"yValue",s),{values:y,needsValueOf:f}=(0,n.QP0)(e,l,g),{xValues:x,domain:b}=(0,n.g3H)(e,y,d);return OS(t,x,m?h:(0,n.Rp1)(h),c,b,u,p,f,m)}(a.type,o.type,e,t,this.sizeScale,null!=this.properties.sizeKey,this):void 0}aggregationOptions(e,t,i=e.visibleRange,s=t.visibleRange){const{processedData:a,dataModel:o}=this,{sizeKey:r}=this.properties,[l,h]=this.getSizeRange(),c=Math.abs(e.range[1]-e.range[0]),d=Math.abs(t.range[1]-t.range[0]),u=Math.max(l,1),p=null==r?u:Math.max(h,1),g=e.scale,m=t.scale;return null!=a&&null!=o&&(Rl.is(g)&&(i=jS(i,g.domain.map(n.nnz),o.getDomain(this,"xValue","value",a).domain.map(n.nnz))),Rl.is(m)&&(s=jS(s,m.domain.map(n.nnz),o.getDomain(this,"yValue","value",a).domain.map(n.nnz)))),{xRange:c,yRange:d,minSize:u,maxSize:p,xVisibleRange:HS(i),yVisibleRange:HS(s)}}createNodeDatumContext(e,t){const{dataModel:i,processedData:s,sizeScale:a,visible:o}=this;if(!i||!s)return;const r=s.dataSources.get(this.id)?.data;if(null==r)return;const{xKey:l,yKey:h,sizeKey:c,selectedKey:d,labelKey:u,colorKey:p,xName:g,yName:m,sizeName:y,labelName:f,colorName:x,label:b,legendItemName:v,marker:S}=this.properties,M=(0,n.$rL)(b.placement),k=M.length>0&&M.every((e=>"inside"===e)),D=M.includes("inside")?zy(S.shape):void 0,w=b.collision.resolveCollideWith(),I=(0,n.A_g)(b,!b.collision.alwaysShow,k),A=e.scale,C=t.scale,N=null!=s.changeDescription&&null!=this.contextNodeData?.nodeData;let L;L=null==u&&null!=c?i.getDomain(this,"sizeValue","value",s).domain:[];const P=i.resolveColumnById(this,"xValue",s,"object");return{xAxis:e,yAxis:t,rawData:r,xValues:P,xDataValues:P,yDataValues:i.resolveColumnById(this,"yValue",s,"object"),sizeDataValues:null==c?void 0:i.resolveColumnById(this,"sizeValue",s,"number"),labelDataValues:null==u?void 0:i.resolveColumnById(this,"labelValue",s,"object"),crossFilterSelectedDataValues:null==d?void 0:i.resolveColumnById(this,"selectedValue",s,"boolean"),colorDataValues:null==p?void 0:i.resolveColumnById(this,"colorValue",s,"number"),xScale:A,yScale:C,sizeScale:a,xOffset:(A.bandwidth??0)/2,yOffset:(C.bandwidth??0)/2,xKey:l,yKey:h,sizeKey:c,labelKey:u,colorKey:p,xName:g,yName:m,sizeName:y,labelName:f,colorName:x,legendItemName:v,labelsEnabled:b.enabled,labelPlacement:M[0],labelAnchor:Sd.anchor(S.shape),labelInsideOffset:D?{x:D.cx,y:D.cy}:void 0,labelInsideRect:k?D:void 0,labelInsideMask:k?Fy(S.shape):void 0,labelInsideSize:!k&&D?{width:D.width,height:D.height}:void 0,labelTextDomain:L,labelPadding:Dt(b),labelTextMeasurer:(0,n.K$y)(b),labelFit:I,labelFitOverflow:k&&b.collision.alwaysShow?I:void 0,labelStyled:null!=b.itemStyler,label:b,plotRegion:k||!w.seriesArea?void 0:this.getSeriesPlotRegion(),animationEnabled:!this.ctx.animationManager.isSkipped(),visible:o,canIncrementallyUpdate:N,nodes:N?this.contextNodeData.nodeData:[],nodeIndex:0}}populateNodeData(e){this.aggregateIndexSet=void 0;const t=this.dataCount();if(t>0&&this.missingDataCount()>=t)return;this.sizeScale.range=this.getSizeRange();const i={datum:void 0,xDatum:void 0,yDatum:void 0,sizeValue:void 0,colorValue:void 0,x:0,y:0,crossFilterSelected:void 0,nodeLabel:{text:"",width:0,height:0},nodeLabelFit:void 0,markerSize:0,count:1,dilation:1,area:0},{dataAggregation:n}=this;null==n?this.createNodeDataSimple(e,i):this.createNodeDataWithAggregation(e,i,e.xAxis,e.yAxis,n)}initializeResult(e){const{marker:t}=this.properties;return{itemId:e.yKey,nodeData:e.nodes,labelData:e.labelsEnabled?e.nodes:[],scales:this.calculateScaling(),visible:this.visible||e.animationEnabled,styles:qx(this,this.properties,t)}}upsertBubbleNodeDatum(e,t,i){this.prepareNodeDatumState(e,t,i)&&Fx(e,{scratch:t,datumIndex:i},((e,t)=>{const i=this.createSkeletonNodeDatum(e,t.scratch,t.datumIndex);return this.updateNodeDatum(e,i,t.scratch,t.datumIndex),i}),((e,t,i)=>this.updateNodeDatum(e,t,i.scratch,i.datumIndex)))}createNodeDataSimple(e,t){const i=e.rawData.length;for(let n=0;n<i;n++)t.count=1,t.dilation=1,t.area=0,this.upsertBubbleNodeDatum(e,t,n)}createNodeDataWithAggregation(e,t,i,n,s){const{maxRenderedItems:a}=this.properties,o=this.aggregationOptions(i,n),r=function(e,t,i){if(ES(1,e,t)<=i)return 1;let n=1,s=2;
1for(;ES(s,e,t)>i&&s<100;)n*=2,s*=2;for(let a=0;a<12;a+=1){const a=(s+n)/2;ES(a,e,t)>i?n=a:s=a}return(n+s)/2}(s,o,a),{groupedAggregation:l,singleDatumIndices:h}=function(e,t,i){const n=[],s=[];return RS(e,t,i,void 0,n,s),{groupedAggregation:n,singleDatumIndices:s}}(r,s,o),c=new Map;for(const{datumIndex:i,count:n,dilation:s,area:a,indices:o}of l)t.count=n,t.dilation=s,t.area=a,c.set(i,o),this.upsertBubbleNodeDatum(e,t,i);this.aggregateIndexSet=c.size>0?c:void 0;for(const i of h)t.count=1,t.dilation=1,t.area=0,this.upsertBubbleNodeDatum(e,t,i)}prepareNodeDatumState(e,t,i){const n=e.rawData[i],s=e.xDataValues[i],a=e.yDataValues[i],o=this.properties.allowNullKeys??!1;if((void 0===s||void 0===a)&&!o)return;const r=e.sizeDataValues?.[i],l=e.xScale.convert(s)+e.xOffset,h=e.yScale.convert(a)+e.yOffset;if(!Number.isFinite(l)||!Number.isFinite(h))return;const c=e.crossFilterSelectedDataValues?.[i],d=null==r?e.sizeScale.range[0]:e.sizeScale.convertClamped(r);if(e.labelsEnabled){const s="inside"===e.labelPlacement?Math.sqrt(t.dilation)*d:0;this.computeLabel(e,t,n,a,r,i,s)}else t.nodeLabel={text:"",width:0,height:0},t.nodeLabelFit=void 0;const u=e.colorDataValues?.[i];return t.datum=n,t.xDatum=s,t.yDatum=a,t.sizeValue=r,t.colorValue=u,t.x=l,t.y=h,t.crossFilterSelected=c,t.markerSize=d,t}computeLabel(e,t,i,s,a,o,r){let l,h,c;null!=e.labelKey&&e.labelDataValues?(l=e.labelDataValues[o],h=e.labelKey,c="label"):null==e.sizeKey?(l=s,h=e.yKey,c="y"):(l=a,h=e.sizeKey,c="size");const d=this.getLabelText(l,i,h,c,e.labelTextDomain,e.label,{value:l,datum:i,xKey:e.xKey,yKey:e.yKey,sizeKey:e.sizeKey,labelKey:e.labelKey,xName:e.xName,yName:e.yName,sizeName:e.sizeName,labelName:e.labelName,colorKey:e.colorKey,colorName:e.colorName,legendItemName:e.legendItemName}),u=e.labelInsideRect,p=e.label.collision.threshold??0,g=u?{width:Math.max(0,r*u.width-2*p),height:Math.max(0,r*u.height-2*p)}:void 0,m=null==e.labelInsideMask||null==u?void 0:(0,n.Hn4)((0,n.OcC)(e.labelInsideMask,r,{x:u.cx*r,y:u.cy*r}),p,p),y=null==m?_y(e.labelFit,g):(0,n.eyx)(_y(e.labelFit,{width:1/0,height:g?.height??1/0}),m);t.nodeLabel=(0,n.Wkl)(d,e.label,e,y),t.nodeLabelFit=(0,n.lIw)(d,e.label,e,y)}createSkeletonNodeDatum(e,t,i){return{series:this,yKey:e.yKey,xKey:e.xKey,datum:void 0,datumIndex:0,xValue:void 0,yValue:void 0,sizeValue:void 0,colorValue:void 0,capDefaults:{lengthRatioMultiplier:this.properties.marker.getDiameter(),lengthMax:1/0},point:{x:0,y:0,size:0},midPoint:{x:0,y:0},label:{text:"",width:0,height:0},fit:void 0,anchor:e.labelAnchor,insideOffset:e.labelInsideOffset,insideSize:e.labelInsideSize,region:e.plotRegion,placement:e.labelPlacement,count:1,dilation:1,area:0,crossFilterSelected:void 0}}updateNodeDatum(e,t,i,n){const s=t,{x:a,y:o,markerSize:r,dilation:l}=i;s.datum=i.datum,s.datumIndex=n,s.xValue=i.xDatum,s.yValue=i.yDatum,s.sizeValue=i.sizeValue,s.colorValue=i.colorValue,s.crossFilterSelected=i.crossFilterSelected,s.count=i.count,s.dilation=i.dilation,s.area=i.area,s.label=i.nodeLabel,s.fit=i.nodeLabelFit,s.anchor=e.labelAnchor,s.insideOffset=e.labelInsideOffset,s.insideSize=e.labelInsideSize,s.region=e.plotRegion,s.placement=e.labelPlacement;const h=s.point;h.x=a,h.y=o,h.size=Math.sqrt(l)*r;const c=s.midPoint;c.x=a,c.y=o}isPathOrSelectionDirty(){return this.properties.marker.isDirty()}getLabelData(){if(!this.isLabelEnabled())return[];const e=this.contextNodeData?.labelData??[];if(null!=this.properties.marker.itemStyler)for(const t of e)(0,n.N3b)(t,t.style?.size);return e}getLabelDefaults(){const{label:e}=this.properties;return(0,n.wSY)(e.collision,(0,n.$rL)(e.placement),e.spacing)}getLabelCandidateStyler(){return tf(this,this.properties.label,this.makeLabelFormatterParams(),Jy)}updateDatumSelection(e){const{nodeData:t,datumSelection:i}=e;if(this.properties.marker.isDirty()&&(i.clear(),i.cleanup()),!gr(this.processedData))return i.update(t);const{sizeKey:s}=this.properties;let a;return null!=s&&(a=e=>Xr(e.xValue,e.yValue,e.sizeValue,(0,n.boc)(e.label.text))),i.update(t,void 0,a)}updateDatumStyles(t){const{datumSelection:i,isHighlight:n}=t,{xKey:s,yKey:a,sizeKey:o,labelKey:r,colorKey:l,marker:h}=this.properties,c=this.isColorScaleValid(),d={xKey:s,yKey:a,sizeKey:o,labelKey:r,colorKey:l};null!=h.itemStyler||c?this.runMarkerStylePass(i,n,{marker:h,params:d,isHighlight:n,
1colorScaleValid:c,colorKey:l},{cacheable:null==l,compute:e.computePerDatumStylerStyle,apply:e.applyPerDatumStyle}):this.runMarkerStylePass(i,n,{marker:h,params:d,isHighlight:n},{compute:e.computeNoStylerMarkerTemplate,apply:e.applyNoStylerTemplate})}updateDatumNodes(e){const{contextNodeData:t}=this;if(!t)return;const{datumSelection:i,isHighlight:s,drawingMode:a}=e;this.sizeScale.range=this.getSizeRange();const o=this.getShapeFillBBox(),r=null!=this.dataAggregation,l=this.ctx.highlightManager.getActiveHighlight(),h="cutout"===a?void 0:a,c=Qx(t.styles);i.each(((e,i,d)=>{const{point:{size:u},count:p,area:g,dilation:m}=i,y=this.getHighlightState(l,s,i.datumIndex),f=null==i.style?{...t.styles[y],size:u}:{...i.style};if(m>1){const e=f.fillOpacity??0,t=.269669+683e-6*p+-37.534348*g+.004449*p*g+-0*p**2+44.428603*g**2;f.fillOpacity=(0,n.qE8)(e/m,e/.1*t,1)}this.applyMarkerStyle(f,e,i.point,o,{crossFilterSelected:i.crossFilterSelected,hideWithSize0:!1,pickInflation:c});const x=h??this.resolveMarkerDrawingModeForState(a,f);e.__drawingMode!==x&&(e.drawingMode=x),e.zIndex=r?[-p,d]:0})),s||this.properties.marker.markClean()}placedLabelDatum(e){return{...e.datum,placement:e.placement??e.datum.placement,label:null==e.datum.fit?e.datum.label:{text:e.text,width:e.width,height:e.height,fontSize:e.fontSize},point:{x:e.x,y:e.y,size:e.datum.point.size}}}updatePlacedLabelData(e){this.placedLabelData=e,this.labelSelection.update(e.map((e=>this.placedLabelDatum(e))),(e=>{e.pointerEvents=1})),this.updateLabelNodes({labelSelection:this.labelSelection}),this.updateHighlightLabelSelection()}updateHighlightLabelSelection(){const e=this.ctx.highlightManager?.getActiveHighlight(),t=this.isSeriesHighlighted(e)&&e?.datum?e:void 0,i=null==t?[]:this.placedLabelData.filter((e=>e.datum.datumIndex===t.datumIndex)).map((e=>this.placedLabelDatum(e)));this.highlightLabelSelection=this.updateLabelSelection({labelData:i,labelSelection:this.highlightLabelSelection})??this.highlightLabelSelection,this.highlightLabelGroup.visible=i.length>0,this.highlightLabelGroup.batchedUpdate((()=>{this.updateLabelNodes({labelSelection:this.highlightLabelSelection,isHighlight:!0})}))}updateLabelNodes(e){const{isHighlight:t=!1}=e,i=this.ctx.highlightManager?.getActiveHighlight(),n=this.makeLabelFormatterParams(),{label:s}=this.properties,a=Zy(s,"inside"),o=Zy(s,"outside"),r=It(s,a),l=It(s,o),h=null!=s.itemStyler,c=h?s:Mt(s,a),d=h?s:Mt(s,o);e.labelSelection.each(((e,s)=>{const u="inside"===s.placement,p=u?r:l,g=rf(this,s,n,u?c:d,t,i,void 0,h?u?a:o:void 0,{placement:s.placement});if(!g.enabled)return void(e.visible=!1);const m=h?At(g):p;e.visible=!0,e.text=s.label.text,e.fill=g.color,e.x=(s.point?.x??0)+m.x,e.y=(s.point?.y??0)+m.y,e.fontStyle=g.fontStyle,e.fontWeight=g.fontWeight,e.fontSize=s.label.fontSize??g.fontSize,e.fontFamily=g.fontFamily,e.textBaseline="top",e.fillOpacity=this.getHighlightStyle(t,s.datumIndex).opacity??1,e.setBoxing(g)}))}updateLabelSelection(e){const{labelData:t,labelSelection:i}=e;return i.update(t,(e=>{e.pointerEvents=1}))}makeStylerParams(e,t,i){const{id:n,properties:{marker:s,shape:a,fill:o,fillOpacity:r,lineDash:l,lineDashOffset:h,stroke:c,strokeOpacity:d,strokeWidth:u,xKey:p,yKey:g,sizeKey:m,labelKey:y,colorKey:f}}=this,{size:x,maxSize:b}=s,v=sl(e??0),S=al(t),M=al(i);return"bubble"===this.type?{highlightState:v,selectionState:S,candidateState:M,minSize:x,maxSize:b,shape:a,fill:o,fillOpacity:r,lineDash:l,lineDashOffset:h,seriesId:n,sizeKey:m,stroke:c,strokeOpacity:d,strokeWidth:u,xKey:p,yKey:g,labelKey:y,colorKey:f}:"scatter"===this.type?{highlightState:v,selectionState:S,candidateState:M,size:x,shape:a,fill:o,fillOpacity:r,lineDash:l,lineDashOffset:h,seriesId:n,stroke:c,strokeOpacity:d,strokeWidth:u,xKey:p,yKey:g,labelKey:y,colorKey:f}:this.type}makeLabelFormatterParams(){const{xKey:e,xName:t,yKey:i,yName:n,sizeKey:s,sizeName:a,labelKey:o,labelName:r,colorKey:l,colorName:h,legendItemName:c}=this.properties;return{xKey:e,xName:t,yKey:i,yName:n,sizeKey:s,sizeName:a,labelKey:o,labelName:r,colorKey:l,colorName:h,legendItemName:c}}getTooltipContent(e){const{id:t,dataModel:i,processedData:s,axes:a,properties:o,ctx:r,colorScale:l}=this,{formatManager:h}
1=r,{xKey:c,xName:d,yKey:u,yName:p,sizeKey:g,sizeName:m,labelKey:y,labelName:f,colorKey:x,colorName:b,title:v,tooltip:S,marker:M,legendItemName:k}=o,D=a[n.tv$.X],w=a[n.tv$.Y];if(!(i&&s&&D&&w))return;const I=s.dataSources.get(this.id)?.data?.[e],A=i.resolveColumnById(this,"xValue",s,"object")[e],C=i.resolveColumnById(this,"yValue",s,"object")[e],N=this.properties.allowNullKeys??!1;if(void 0===A&&!N)return;const L=[];if(this.isLabelEnabled()&&null!=y){const a=i.resolveColumnById(this,"labelValue",s,"object")[e],o=h.format(this.callWithContext.bind(this),{type:"category",value:a,datum:I,seriesId:t,legendItemName:k,key:y,source:"tooltip",property:"label",domain:[],boundSeries:this.getFormatterContext("label")});L.push({label:f,fallbackLabel:y,value:o??(0,n.Fl2)(a)})}L.push({label:d,fallbackLabel:c,value:this.getAxisValueText(D,"tooltip",A,I,c,k,N),missing:eu(A,N)},{label:p,fallbackLabel:u,value:this.getAxisValueText(w,"tooltip",C,I,u,k,N),missing:eu(C,N)});const P=(a,o,r,l)=>{const c=i.resolveColumnById(this,a,s,"number")[e];if(null==c)return;const d=i.getDomain(this,a,"value",s).domain,u=h.format(this.callWithContext.bind(this),{type:"number",value:c,datum:
1I,seriesId:t,legendItemName:k,key:o,source:"tooltip",property:l,boundSeries:this.getFormatterContext(l),domain:d,fractionDigits:void 0,visibleDomain:void 0});return L.push({label:r,fallbackLabel:o,value:u??(0,n.Fl2)(c)}),c};let T;if(null!=g&&P("sizeValue",g,m,"size"),null!=x&&this.isColorScaleValid()){const e=P("colorValue",x,b,"color");if(null!=e){T=l.convert(e);const t=(0,n.zP6)(l,o.colorScale.fills,e,n.Fl2);null!=t&&(L.at(-1).value=t)}else null!=o.colorScale.missingDataFill&&(T=o.colorScale.missingDataFill)}const O=this.getMarkerStyle(M,{datum:I,datumIndex:e},{xKey:c,yKey:u,sizeKey:g,labelKey:y,colorKey:x},{resolveMarkerSubPath:[]});return null!=T&&(O.fill=T),this.formatTooltipWithContext(S,{title:v,symbol:this.legendItemSymbol(O),data:L},{seriesId:t,datum:I,title:u,xKey:c,xName:d,yKey:u,yName:p,sizeKey:g,sizeName:m,labelKey:y,labelName:f,colorKey:x,colorName:b,legendItemName:k,...O,...this.getModuleTooltipParams()})}legendItemSymbol(e){const t=this.getStyle(void 0),i=this.getMarkerStyle(this.properties.marker,{},void 0,{isHighlight:!1,checkForHighlight:!1,resolveMarkerSubPath:[]},t);return{marker:e?{...i,...e}:i}}getLegendData(e){if(this.isColorScaleValid()&&this.dataModel){const{colorScale:t}=this.properties;return"category"===e&&"discrete"===t.mode&&t.fills.length>0?cb(this.colorScale,t.fills,this.id,this.visible,hb(this),this.properties.shape):"gradient"===e&&"discrete"!==t.mode?[{...lb(this.colorScale,t.fills,this.id,this.visible,this.getFormatterContext("color")),showSeparately:!0}]:[]}if("category"!==e)return[];const{id:t,ctx:{legendManager:i},visible:n}=this,{yKey:s,yName:a,legendItemName:o,title:r,showInLegend:l}=this.properties;return[{legendType:"category",id:t,itemId:s,seriesId:t,enabled:n&&(i?.getItemEnabled({seriesId:t,itemId:s})??!0),label:{text:o??r??a??s},symbol:this.legendItemSymbol(),legendItemName:o,hideInLegend:!l}]}animateEmptyUpdateReady({datumSelection:e,labelSelection:t}){!function({id:e},t,...i){$h(e,"markers",t,i,{scalingX:0,scalingY:0},{scalingX:1,scalingY:1},{phase:"initial"});for(const e of i)e.cleanup()}(this,this.ctx.animationManager,e),Af(this,"labels",this.ctx.animationManager,t)}resetDatumAnimation(e){Yx([e.datumSelection])}isLabelEnabled(){return this.properties.label.enabled}nodeFactory(){return new Sd}getStyle(e){const{properties:t}=this,{marker:i}=t;let n={};if(t.styler){const i=this.getDataSelectionState(void 0),s=this.getDataCandidacyState(void 0),a=this.makeStylerParams(e,i,s),o=this.cachedCallWithContext(t.styler,a)??{};n=this.ctx.optionsGraphService.resolvePartial(["series",`${this.declarationOrder}`],o,{pick:!1})??{}}const s=this.getSizeFloorOverride(n);return{fill:n.fill??t.fill,fillOpacity:n.fillOpacity??t.fillOpacity,lineDash:n.lineDash??t.lineDash,lineDashOffset:n.lineDashOffset??t.lineDashOffset,shape:n.shape??t.shape,size:s??i.size,maxSize:n.maxSize??i.maxSize,stroke:n.stroke??t.stroke,strokeOpacity:n.strokeOpacity??t.strokeOpacity,strokeWidth:n.strokeWidth??t.strokeWidth}}getSizeFloorOverride(e){return e.minSize}getSizeRange(){const{size:e,maxSize:t}=this.getStyle(void 0);return[e,Math.max(e,t)]}getFormattedMarkerStyle(e){const{xKey:t,yKey:i,sizeKey:n,labelKey:s,colorKey:a,marker:o}=this.properties;return this.getMarkerStyle(o,e,{xKey:t,yKey:i,sizeKey:n,labelKey:s,colorKey:a},{resolveMarkerSubPath:[]})}computeFocusBounds(e){return Xx(this,e)}hasItemStylers(){const{selection:e,styler:t,itemStyler:i,marker:n,label:s}=this.properties;return e.enabled||!!(t??i??n.itemStyler??s.itemStyler)||this.isColorScaleValid()}initQuadTree(e){Yf(e,this.datumNodesIter(),this.ctx.logger)}pickNodeDataClosestDatum(e){return Uf(this,e)}};return e.className="BubbleSeries",e.type="bubble",e.computeNoStylerMarkerTemplate=(e,t,i,n,s)=>{const a=e.getStyle(i);return e.getMarkerStyle(t.marker,s,t.params,{isHighlight:t.isHighlight,highlightState:i,selectionState:n,resolveMarkerSubPath:[]},{...a,size:s.point.size})},e.applyNoStylerTemplate=(e,t,i,n,s,a)=>{i.style=a.size===i.point.size?a:{...a,size:i.point.size}},e.computePerDatumStylerStyle=(e,t,i)=>e.getStyle(i),e.applyPerDatumStyle=(e,t,i,n,s,a)=>{t.colorScaleValid&&null!=i.colorValue?a.fill=e.colorScale.convert(i.colorValue):null!=t.colorKey&&null==i.colorValue&&null!=e.properties.colorScale.missingDataFill&&(a.fill=e.properties.colorScale.missingDataFill),i.style=e.getMarkerStyle(t.marker,i,t.params,{isHighlight:t.isHighlight,highlightState:n,selectionState:s,resolveMarkerSubPath:[]},{...a,size:i.point.size})},e})(),_S={fills:{$if:[{$isPackageType:"enterprise"},{$map:[{color:{$value:"$1"}},{$palette:"divergingColors"}]},void 0]}}
1,GS={enabled:{$some:[{$and:[{$path:"/series/$index/colorKey"},{$path:"/series/$index/colorScale/fills/0"},{$not:{$eq:[{$path:"/series/$index/colorScale/mode"},"discrete"]}}]},{$path:"/series"}]}},KS=(()=>({series:{shape:"circle",minSize:7,maxSize:30,fill:{$applySwitch:[{$path:"type"},{$palette:"fill"},["gradient",n.pRl],["image",n.pwE],["pattern",n.eu4]]},stroke:{$palette:"stroke"},fillOpacity:.8,maxRenderedItems:2e3,label:{...n.VTt,...n.F$C,enabled:!1,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},padding:8,insideStyle:(0,n.KVS)("chartBackgroundColor"),outsideStyle:(0,n.KVS)("textColor"),collision:{alwaysShow:!1,...(0,n.fs4)({collideWith:{seriesArea:!1}})}},tooltip:{range:{$if:[{$eq:[{$path:["/tooltip/range","nearest"]},"area"]},"nearest",{$path:["/tooltip/range","nearest"]}]},position:{anchorTo:{$path:["/tooltip/position/anchorTo","node"]}}},highlight:n.fil,selection:n.zg6,colorScale:_S},gradientLegend:GS}))(),YS=pm({type:"series",name:"bubble",chartType:"cartesian",version:Ot,dependencies:[Wv],options:Wn,predictAxis:Om,defaultAxes:{x:{type:n.uCf.NUMBER,position:n.v9C.BOTTOM},y:{type:n.uCf.NUMBER,position:n.v9C.LEFT}},axisKeys:{[n.tv$.X]:"xKeyAxis",[n.tv$.Y]:"yKeyAxis"},themeTemplate:KS,create:e=>new WS(e)}),US=(()=>{var e=class extends bt{constructor(){super(...arguments),this.placement="inside-center",this.spacing=0,this.insideStyle=new xt,this.outsideStyle=new xt}};return d([n.mAP],e.prototype,"placement",2),d([n.mAP],e.prototype,"spacing",2),d([n.mAP],e.prototype,"insideStyle",2),d([n.mAP],e.prototype,"outsideStyle",2),e})(),XS=(()=>{var e=class extends ly{constructor(){super(...arguments),this.fillOpacity=1,this.strokeWidth=1,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.cornerRadius=0,this.areaPlot=!1,this.aggregation="sum",this.getItemId=void 0,this.shadow=new $b,this.label=new US,this.tooltip=Of()}getStyle(){const{fill:e,fillOpacity:t,stroke:i,strokeWidth:n,strokeOpacity:s,lineDash:a,lineDashOffset:o,cornerRadius:r}=this;return{fill:e,fillOpacity:t,stroke:i,strokeWidth:n,strokeOpacity:s,lineDash:a,lineDashOffset:o,cornerRadius:r,opacity:1}}};return d([n.mAP],e.prototype,"xKey",2),d([n.mAP],e.prototype,"yKey",2),d([n.mAP],e.prototype,"xName",2),d([n.mAP],e.prototype,"yName",2),d([n.mAP],e.prototype,"fill",2),d([n.mAP],e.prototype,"fillOpacity",2),d([n.mAP],e.prototype,"stroke",2),d([n.mAP],e.prototype,"strokeWidth",2),d([n.mAP],e.prototype,"strokeOpacity",2),d([n.mAP],e.prototype,"lineDash",2),d([n.mAP],e.prototype,"lineDashOffset",2),d([n.mAP],e.prototype,"cornerRadius",2),d([n.mAP],e.prototype,"styler",2),d([n.mAP],e.prototype,"itemStyler",2),d([n.mAP],e.prototype,"areaPlot",2),d([n.mAP],e.prototype,"bins",2),d([n.mAP],e.prototype,"aggregation",2),d([n.mAP],e.prototype,"binCount",2),d([n.mAP],e.prototype,"getItemId",2),d([n.mAP],e.prototype,"shadow",2),d([n.mAP],e.prototype,"label",2),d([n.mAP],e.prototype,"tooltip",2),e})();function ZS(e){return"bigint"==typeof e||Number.isInteger(e)}var qS=(()=>{var e=class extends hy{constructor(e){super({moduleCtx:e,propertyKeys:oy,propertyNames:ry,categoryKey:void 0,pickModes:[1,0],datumSelectionGarbageCollection:!0,animationAlwaysPopulateNodeData:!0,alwaysClip:!0,animationResetFns:{datum:Ex,label:Nf}}),this.properties=new XS,this.calculatedBins=[]}createNodeParams(e){return{...super.createNodeParams(e),xKey:this.properties.xKey,yKey:this.properties.yKey,binIndex:e.binIndex,binRange:e.binRange,aggregatedValue:e.aggregatedValue,frequency:e.frequency}}get hasData(){return this.calculatedBins.length>0}computeBins(e){const t=e[0],i=e[1],s=((0,n.sI5)(t)||(0,n.sI5)(i))&&ZS(t)&&ZS(i);return(0,n.EtT)(this.properties.binCount)?s?(0,n.cpn)(BigInt(t),BigInt(i),this.properties.binCount):this.calculateNiceBins([Number(t),Number(i)],this.properties.binCount):this.properties.bins??(s?(0,n.jjO)(BigInt(t),BigInt(i),10):this.deriveBins([Number(t),Number(i)]))}deriveBins(e){const t=(0,n.np_)(e[0],e[1],10).ticks,i=(0,n.sG5)(e[0],e[1],10),[s]=t;return[[s-i,s],...t.map((e=>[e,e+i]))]}calculateNiceBins(e,t){const i=Math.floor(e[0]),n=e[1],s=t||1,{start:a,binSize:o}=this.calculateNiceStart(i,n,s);return this.getBins(a,n,o,s)}getBins(e,t,i,n){const s=[],a=this.calculatePrecision(i);for(let o=0;o<n;o++){const r=Math.round((e+o*i)*a)/a;let l=Math.round((e+(o+1)*i)*a)/a;o===n-1&&(l=Math.max(l,t)),s[o]=[r,l]}return s}calculatePrecision(e){let t=10;if(Number.isFinite(e)&&e>0)for(;e<1;)t*=10,e*=10;return t}calculateNiceStart(e,t,i){const n=Math.abs(t-e)/i,s=Math.floor(Math.log10(n)),a=Math.pow(10,s);return{start:Math.floor(e/a)*a,binSize:n}}async processData(e){const{visible:t}=this,{xKey:i,yKey:s,areaPlot:a,aggregation:o}=this.properties,r=this.axes[n.tv$.X]?.scale,l=this.axes[n.tv$.Y]?.scale,{xScaleType:h,yScaleType:c}=this.getScaleInformation({yScale:l,xScale:r}),d=t?{}:{forceValue:0},u=[Mr(i,h),Rr],p=e=>null!=s&&"sum"===o?function(e,t){const i=t?.visible??!0;return{id:e,type:"aggregate",matchGroupIds:t?.matchGroupId?[t?.matchGroupId]:void 0,aggregateFunction:e=>ao(e),groupAggregateFunction:(e,t=[0,0])=>(i&&(t[0]=so(t[0],e?.[0]??0),t[1]=so(t[1],e?.[1]??0)),t)}}(e,{visible:t}):null!=s&&"mean"===o?function(e,t){const i=t?.visible??!0;return{id:e,matchGroupIds:t?.matchGroupId?[t?.matchGroupId]:void 0,type:"aggregate",aggregateFunction:e=>ao(e),groupAggregateFunction:(e,t=[0,0,-1])=>(i&&(t[0]=so(t[0],e?.[0]??0),t[2]++,t[1]=so(t[1],e?.[1]??0)),t),finalFunction:(e=[0,0,0])=>{const t=Number(e[0])+Number(e[1]);return t>=0?[0,t/e[2]]:[t/e[2],0]}}}(e,{visible:t}):function(e,t){const i=t?.visible??!0;return{id:e,type:"aggregate",aggregateFunction:()=>[0,1],groupAggregateFunction:(e,t=[0,0])=>(i&&(t[0]+=e?.[0]??0,t[1]+=e?.[1]??0),t)}}(e,{visible:t});null==s?u.push(function(e,t={}){return{property:e,type:"value",valueType:"range",missingValue:1,processor:function(){return function(){return 1}},...t}}("count")):u.push(kr(s,c,{invalidValue:void 0,...d}));const g=p("groupAgg");
1u.push(a?function(e,t,i){const s={id:e,matchGroupIds:i?[i]:void 0,type:"aggregate",aggregateFunction:(e,i=[])=>{const s=Number((0,n.Vz0)(i[1],i[0]));return t.aggregateFunction(e).map((e=>Number(e)/s))}};return t.groupAggregateFunction&&(s.groupAggregateFunction=t.groupAggregateFunction),s}("groupAgg",g):g),a&&u.push(p("rawAgg"));let m=[];const{dataModel:y,processedData:f}=await this.requestDataModel(e,this.data,{props:u,groupByFn:e=>{const t=uo(e.domain.keys[0]);if(0===t.length)return e.domain.groups=[],()=>[];const i=this.computeBins(t),s=i.length;return m=[...i],e=>{let t=e[0];if((0,n.$PY)(t)&&(t=t.getTime()),!(0,n.zZm)(t))return[];for(let e=0;e<s;e++){const n=i[e];if(t>=n[0]&&t<n[1])return n;if(e===s-1&&t<=n[1])return n}return[]}}}),x=f,b=new Map;for(const[e,t]of x.groups.entries()){const i=t.keys;b.set(Xr(...i),{group:t,groupIndex:e})}this.calculatedBins=m.map(((e,t)=>{const i=b.get(Xr(...e));if(i){const{group:n,groupIndex:s}=i,[a=[0,0],o]=n.aggregation,r=[...y.forEachDatum(this,x,n,s)],l=this.frequency(n),h=so(a[0],a[1]);return{domain:e,datum:r,binIndex:t,frequency:l,total:h,aggregatedValue:o?so(o[0],o[1]):h}}return{domain:e,datum:[],binIndex:t,frequency:0,total:0,aggregatedValue:0}})),this.animationState.transition("updateData")}xCoordinateRange(){return[Number.NaN,Number.NaN]}yCoordinateRange(){return[Number.NaN,Number.NaN]}getSeriesDomain(e){const{processedData:t,dataModel:i}=this;if(!t||!i||!this.calculatedBins.length)return{domain:[]};const s=i.getDomain(this,"groupAgg","aggregate",t).domain,a=this.calculatedBins[0].domain[0],o=this.calculatedBins[(this.calculatedBins?.length??0)-1].domain[1];return e===n.tv$.X?{domain:uo([a,o])}:{domain:uo(s)}}getSeriesRange(e,[t,i]){const{dataModel:s,processedData:a}=this;if(!s||"grouped"!==a?.type)return[Number.NaN,Number.NaN];const o=this.axes[n.tv$.X].scale;let r=-1/0;for(const{keys:e,aggregation:s}of a.groups){const[[a,l]=[0,0]]=s,[h,c]=e,[d,u]=(0,n.uYy)([o.convert(h),o.convert(c)]);u>=t&&d<=i&&(r=(0,n.cGV)(r,(0,n.mlo)(a,l)))}return 0>r?[Number.NaN,Number.NaN]:[0,(0,n.Roz)(r)]}frequency(e){return e.datumIndices.reduce(((e,t)=>e+t.length),0)}createNodeDatumContext(e,t){const{xKey:i,yKey:s,xName:a,yName:o,label:r}=this.properties,{contextNodeData:l,processedData:h}=this,c=null!=l?.nodeData&&null!=h?.changeDescription;return{xAxis:e,yAxis:t,xScale:e.scale,yScale:t.scale,yAxisReversed:t.isReversed(),rawData:[],xValues:[],xKey:i,yKey:s,xName:a,yName:o,label:r,labelFit:(0,n.A_g)(r,!r.collision.alwaysShow),animationEnabled:!this.ctx.animationManager.isSkipped(),canIncrementallyUpdate:c,nodes:c?l.nodeData:[],nodeIndex:0}}binParams(e){const{datum:t,binIndex:i,domain:n,aggregatedValue:s,frequency:a}=e;return{datum:void 0,datums:t,binIndex:i,binRange:n,aggregatedValue:s,frequency:a}}createLabelData(e,t,i,s,a,o,r){const{label:l,labelFit:h,yKey:c,xKey:d,xName:u,yName:p}=e,{total:g,datum:m}=t;if(!l.enabled||0===Number(g))return;const y=(0,n.$rL)(l.placement)[0]??"inside-center",f=y.startsWith("inside")?l.insideStyle:l.outsideStyle,x=(0,n.qlQ)((0,n.$rL)(l.orientation)[0]),b=(0,n.fjG)(l.orientation),v={x:i,y:s,width:a,height:o},S=(0,n.$rL)(l.placement).every((e=>e.startsWith("inside")))?uf(v,y,r,!0,l.spacing,Dt(l)):void 0,M={...this.binParams(t),value:g,xKey:d,yKey:c,xName:u,yName:p},k=this.getLabelText(g,m,c,"y",[],l,M);if((0,n.Yfy)(l.orientation,l.placement,l.collision.alwaysShow,h)){const e=(0,n.kzl)(k,l),t=(0,n.$rL)(l.placement);0===t.length&&t.push("inside-center");const i=(0,n.$rL)(l.orientation);0===i.length&&i.push("horizontal");const s=this.resolveLabelPlotRegion(l.collision),a=ff({isUpward:r,isVertical:!0,placements:t,orientations:i,spacing:l.spacing,label:l,textWidth:e.width,textHeight:e.height,rect:v,plotRegion:s,fitted:null!=h,text:k}),{anchor:o,region:c,placement:d}=a[0];return{x:o.x,y:o.y,textAlign:o.textAlign,textBaseline:o.textBaseline,placement:d,rotation:x,offsetX:0,offsetY:0,region:c,text:k,candidates:a}}const{text:D,fontSize:w}=b?{text:k,fontSize:void 0}:Wy(k,h,l,S?.container),{width:I,height:A}=0===x?{width:0,height:0}:(0,n.kzl)(D,(0,n.lad)(l,w)),{x:C,y:N,textAlign:L,textBaseline:P}
1=gf({isUpward:r,isVertical:!0,placement:y,spacing:l.spacing,boxPadding:wt(l,f),rect:v,rotation:x,labelWidth:I,labelHeight:A});return{x:C,y:N,textAlign:L,textBaseline:P,placement:y,rotation:x,offsetX:0,offsetY:0,region:b?S?.region:void 0,text:D,fittedFontSize:w}}createSkeletonNodeDatum(e,t){const{xKey:i,yKey:n}=e,{domain:s,datum:a,binIndex:o,frequency:r,total:l,aggregatedValue:h}=t,[c,d]=s,{getItemId:u}=this.properties;return{series:this,itemId:(null==u?void 0:this.cachedCallWithContext(u,this.binParams(t),`${this.id}:${c},${d}`))??`bin:${c},${d}`,datumIndex:o,datum:void 0,datums:a,binIndex:o,binRange:s,aggregatedValue:h,cumulativeValue:Number(l),cumulativeValueExact:l,frequency:r,yKey:n,xKey:i,x:0,y:0,xValue:0,yValue:0,width:0,height:0,midPoint:{x:0,y:0},topLeftCornerRadius:!1,topRightCornerRadius:!1,bottomRightCornerRadius:!1,bottomLeftCornerRadius:!1,label:void 0,crisp:!0}}updateNodeDatum(e,t,i){const{xScale:n,yScale:s,yAxisReversed:a}=e,{domain:o,datum:r,binIndex:l,frequency:h,total:c,aggregatedValue:d}=i,u=t,[p,g]=o,m=n.convert(p),y=n.convert(g),f=s.convert(0),x=s.convert(c),b=Math.abs(y-m),v=Math.abs(x-f),S=Math.min(m,y),M=Math.min(f,x),k=x<=f;u.datumIndex=l,u.datum=void 0,u.datums=r,u.binIndex=l,u.aggregatedValue=d,u.cumulativeValue=Number(c),u.cumulativeValueExact=c,u.frequency=h,u.binRange=o,u.x=S,u.y=M,u.xValue=m,u.yValue=x,u.width=b,u.height=v,u.midPoint?(u.midPoint.x=S+b/2,u.midPoint.y=M+v/2):u.midPoint={x:S+b/2,y:M+v/2},u.topLeftCornerRadius=!a,u.topRightCornerRadius=!a,u.bottomRightCornerRadius=a,u.bottomLeftCornerRadius=a,u.label=this.createLabelData(e,i,S,M,b,v,k)}createNodeDatum(e,t){const i=this.createSkeletonNodeDatum(e,t);return this.updateNodeDatum(e,i,t),i}populateNodeData(e){const{processedData:t}=this;if("grouped"===t?.type)for(const t of this.calculatedBins)Fx(e,t,((e,t)=>this.createNodeDatum(e,t)),((e,t,i)=>this.updateNodeDatum(e,t,i)))}initializeResult(e){return{itemId:this.properties.yKey??this.id,nodeData:e.nodes,labelData:e.nodes,scales:this.calculateScaling(),animationValid:!0,visible:this.visible||e.animationEnabled,styles:Sl(this.getItemStyle.bind(this))}}finalizeNodeData(e){super.finalizeNodeData(e),e.nodes.sort(((e,t)=>e.x-t.x))}nodeFactory(){return new Ge}updateDatumSelection(e){const{nodeData:t,datumSelection:i}=e;return gr(this.processedData)?i.update(t,void 0,(e=>Xr(...e.binRange))):i.update(t)}resolvedStyle(e){const{fill:t,fillOpacity:i,stroke:n,strokeWidth:s,strokeOpacity:a,lineDash:o,lineDashOffset:r,cornerRadius:l}=e;return{fill:t,fillOpacity:i,stroke:n,strokeWidth:s,strokeOpacity:a,lineDash:o,lineDashOffset:r,cornerRadius:l}}makeStylerParams(e){const{id:t}=this,{xKey:i,yKey:n}=this.properties;return{seriesId:t,xKey:i,yKey:n,...this.resolvedStyle(this.properties.getStyle()),highlightState:sl(e??0),selectionState:this.getSelectionStateString(void 0),candidateState:this.getCandidateStateString(void 0)}}makeItemStylerParams(e,t,i){const{id:n}=this,{xKey:s,yKey:a}=this.properties,o=this.ctx.highlightManager?.getActiveHighlight();return{seriesId:n,xKey:s,yKey:a,...this.binParams(e),highlightState:this.getHighlightStateString(o,t,e.binIndex),selectionState:this.getSelectionStateString(e.binIndex),candidateState:this.getCandidateStateString(e.binIndex),...this.resolvedStyle(i)}}getStyle(e,t,i,s){const{properties:a}=this,o=this.getHighlightStyle(t,i,s);let r=a.getStyle();const{styler:l}=a;if(!e&&null!=l){const e=this.ctx.optionsGraphService.resolvePartial(["series",`${this.declarationOrder}`],this.cachedCallWithContext(l,this.makeStylerParams(s))??{},{pick:!1})??{};r=(0,n.HFk)(e,r)}return(0,n.HFk)(o,r)}getItemStyle(e,t,i){let s=this.getStyle(void 0===e,t,e,i);const{itemStyler:a}=this.properties;if(null!=a&&null!=e){const i=this.calculatedBins[e];if(null!=i){const e=this.cachedDatumCallback(Xr(...i.domain,t?"highlight":"node"),(()=>this.ctx.optionsGraphService.resolvePartial(["series",`${this.declarationOrder}`],this.callWithContext(a,this.makeItemStylerParams(i,t,s)))));e&&(s=(0,n.HFk)(e,s))}}return s}updateDatumStyles(e){const{datumSelection:t,isHighlight:i}=e;t.each(((e,n)=>{t.isGarbage(e)||(n.style=this.getItemStyle(n.datumIndex,i))}))}updateDatumNodes(e){const{contextNodeData:t}=this;if(!t)return;const i=this.ctx.highlightManager.getActiveHighlight(),{shadow:n}=this.properties,s=this.getShapeFillBBox();e.datumSelection.each(((a,o)=>{const r=o.style??t.styles[this.getHighlightState(i,e.isHighlight,o.datumIndex)],{cornerRadius:l=0}=r,{topLeftCornerRadius:h,topRightCornerRadius:c,bottomRightCornerRadius:d,bottomLeftCornerRadius:u}=o;a.setStyleProperties(r,s),a.topLeftCornerRadius=h?l:0,a.topRightCornerRadius=c?l:0,a.bottomRightCornerRadius=d?l:0,a.bottomLeftCornerRadius=u?l:0,a.crisp=o.crisp,a.fillShadow=n}))}getLabelObstacles(){return af(this.properties.label,this.contextNodeData?.nodeData,this.contextNodeData?.labelData,this.isLabelEnabled()&&!this.usesPlacedLabels,(e=>e.label))}updateLabelSelection(e){const{labelData:t,labelSelection:i}=e;return i.update(t,(e=>{e.pointerEvents=1}))}makeLabelStylerParams(e){const{xKey:t,yKey:i,xName:n,yName:s}=this.properties;return{datum:void 0,datums:e.datums,binIndex:e.binIndex,binRange:e.binRange,aggregatedValue:e.aggregatedValue,frequency:e.frequency,value:e.cumulativeValue,xKey:t,yKey:i,xName:n,yName:s}}updateLabelNodes(e){const{isHighlight:t=!1}=e,i=this.ctx.highlightManager?.getActiveHighlight(),{label:s}=this.properties,a=(0,n.$rL)(s.placement)[0]??"inside-center";e.labelSelection.each(((e,o)=>{if(o.label?.hidden)return void(e.visible=!1);const r=this.makeLabelStylerParams(o),l=o.label?.placement??a,h=Zy(s,qy(l));e.fillOpacity=this.getHighlightStyle(t,o.datumIndex).opacity??1,lf(this,e,r,s,o.label,{isHighlight:t,activeHighlight:i},void 0,h,{placement:l,orientation:(0,n.afe)(o.label?.rotation??0)})}))}resolveUsesPlacedLabels(){return(0,n.qpr)(this.properties.label)}
1getLabelData(){if(!this.usesPlacedLabels||!this.isLabelEnabled())return[];const{label:e}=this.properties,{alwaysShow:t,collideWith:i,threshold:s,measureBox:a,fitFor:o}=sf(e);if((0,n.fD2)(e)){const e=[];for(const r of this.contextNodeData?.labelData??[]){const l=r.label;if(null==l?.candidates||""===l.text)continue;const{width:h,height:c}=a(l.text),d={x:r.x,y:r.y,width:r.width,height:r.height};e.push((0,n.Nv9)(l.text,h,c,l.candidates,l,d,t,i,s,!1,o(l.text),r))}return e}const r=(0,n.$rL)(e.orientation)[0]??"horizontal",l=(0,n.$rL)(e.placement)[0]??"inside-center",h=null!=e.itemStyler;return(0,n.AEW)(this.contextNodeData?.labelData,(t=>{const n=t.label,c=null!=n&&""!==n.text,d=c&&h?nf(of(this,e,this.makeLabelStylerParams(t)),t,n.placement??l,r,n.text):void 0;if(!0===d?.hidden)return;const u=null==n?void 0:o(n.text);return{label:n,config:e,size:d?.size??(c?a(n.text):void 0),collideWith:i,threshold:s,fit:null==u||null==d?u:{...u,font:d.font,boxPadding:d.boxPadding}}}))}getLabelCandidateResolver(){return Sf(this,this.properties.label,(e=>this.makeLabelStylerParams(e)))}updatePlacedLabelData(e){(0,n.she)(e),(0,n.HkM)(this.contextNodeData?.labelData,e,(e=>e.label)),this.refreshPlacedLabelNodes()}initQuadTree(e){const{value:t}=this.contentGroup.children().next();t instanceof ke&&Yf(e,t.children(),this.ctx.logger)}pickNodeClosestDatum(e){return Uf(this,e)}getTooltipContent(e){const{id:t,dataModel:i,processedData:s,axes:a,properties:o,ctx:{localeManager:r}}=this,{xKey:l,xName:h,yKey:c,yName:d,tooltip:u,legendItemName:p}=o,g=a[n.tv$.X],m=a[n.tv$.Y];if(!i||"grouped"!==s?.type||!g||!m)return;const y=this.calculatedBins[e];if(null==y)return;const{frequency:f,aggregatedValue:x,datum:b}=y,v=y.domain,[S,M]=v,k=[{label:h,fallbackLabel:l,value:`${this.getAxisValueText(g,"tooltip",S,b,l,p)} - ${this.getAxisValueText(g,"tooltip",M,b,l,p)}`},{label:r.t("seriesHistogramTooltipFrequency"),value:this.getAxisValueText(m,"tooltip",f,b,c,p)}];if(null!=c){let e;switch(o.aggregation){case"sum":e=r.t("seriesHistogramTooltipSum",{yName:d??c});break;case"mean":e=r.t("seriesHistogramTooltipMean",{yName:d??c});break;case"count":e=r.t("seriesHistogramTooltipCount",{yName:d??c})}k.push({label:e,value:this.getAxisValueText(m,"tooltip",x,b,c,p)})}return this.formatTooltipWithContext(u,{symbol:this.legendItemSymbol(),data:k},{seriesId:t,title:d,xKey:l,xName:h,yKey:c,yName:d,...this.binParams(y),...this.getItemStyle(e,!1)})}legendItemSymbol(){const{fill:e,fillOpacity:t,stroke:i,strokeWidth:s,strokeOpacity:a,lineDash:o,lineDashOffset:r}=this.properties;return{marker:{fill:(0,n.Go6)(e)??"rgba(0, 0, 0, 0)",stroke:i??"rgba(0, 0, 0, 0)",fillOpacity:t,strokeOpacity:a,strokeWidth:s,lineDash:o,lineDashOffset:r}}}getLegendData(e){if("category"!==e)return[];const{id:t,ctx:{legendManager:i},visible:n}=this,{xKey:s,yName:a,showInLegend:o}=this.properties;return[{legendType:"category",id:t,itemId:s,seriesId:t,enabled:n&&(i?.getItemEnabled({seriesId:t,itemId:s})??!0),label:{text:a??s??"Frequency"},symbol:this.legendItemSymbol(),hideInLegend:!o}]}resetDatumAnimation(e){zx([e.datumSelection])}animateEmptyUpdateReady({datumSelection:e,labelSelection:t}){const i=Rx(Tx(!0,this.axes,"normal"),"unknown");Vh(this.id,"datums",this.ctx.animationManager,[e],i),Af(this,"labels",this.ctx.animationManager,t)}animateWaitingUpdateReady(e){const t=Rx(Tx(!0,this.axes,"normal"),"added"),i={changed:!0,added:new Set,updated:new Set,removed:new Set,moved:new Set};Vh(this.id,"datums",this.ctx.animationManager,[e.datumSelection],t,(e=>Xr(...e.unsafeDatum.binRange)),i),i?.changed&&Af(this,"labels",this.ctx.animationManager,e.labelSelection)}isLabelEnabled(){return this.properties.label.enabled}computeFocusBounds({datumIndex:e}){return Bx(this,this.contextNodeData?.nodeData[e])}hasItemStylers(){return null!=this.properties.styler||null!=this.properties.itemStyler||null!=this.properties.label.itemStyler||this.properties.selection.enabled}};return e.className="HistogramSeries",e.type="histogram",e})(),QS=(()=>({series:{fill:{$applySwitch:[{$path:"type"},{$palette:"fill"},["gradient",n.Euh],["image",n.pwE],["pattern",n.eu4]]},stroke:{$palette:"stroke"},strokeWidth:1,fillOpacity:1,strokeOpacity:1,lineDash:[0],lineDashOffset:0,label:{...n.VTt,...n.F$C,enabled:!1,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},spacing:8,padding:8,collision:{threshold:4,alwaysShow:n.O2O,...(0,n.fs4)({collideWith:{seriesItems:!0}})}
1,insideStyle:(0,n.KVS)("chartBackgroundColor"),outsideStyle:(0,n.KVS)("textColor"),placement:"inside-center"},shadow:{enabled:!1,color:n.KU9,xOffset:3,yOffset:3,blur:5},highlight:n.fil}}))(),JS=pm({type:"series",name:"histogram",chartType:"cartesian",version:Ot,dependencies:[Wv],options:Kn,predictAxis:Rm,defaultAxes:{x:{type:n.uCf.NUMBER,position:n.v9C.BOTTOM},y:{type:n.uCf.NUMBER,position:n.v9C.LEFT}},axisKeys:{[n.tv$.X]:"xKeyAxis",[n.tv$.Y]:"yKeyAxis"},themeTemplate:QS,create:e=>new qS(e)});function eM(e,t,i,s,a,o,r,l){const h=e[o];if(void 0===h)return!1;const c=Number.isFinite(t)?(0,n.mYB)(h,t,i,r):(0,n.qUX)(o,l),d=(0,n.XBY)(c,a);return o===s[d+n.qbB]||o===s[d+n.IXP]||o===s[d+n.jBM]||o===s[d+n.BNK]}function tM(e,t,i,n,s,a,o,r){let l=0;for(let r=0;r<o;r++)eM(e,t,i,n,s,r,a,o)&&l++;const h=r?.length===l?r:new Uint32Array(l);let c=0;for(let r=0;r<o;r++)eM(e,t,i,n,s,r,a,o)&&(h[c++]=r);return h}function iM(e,t,i,n,s,a,o,r,l){let h=0;for(const l of e)eM(t,i,n,s,a,l,o,r)&&h++;const c=l?.length===h?l:new Uint32Array(h);let d=0;for(const l of e)eM(t,i,n,s,a,l,o,r)&&(c[d++]=l);return c}function nM(e,t,i,s){const a=t.length;if(a<n.n9_)return;const[o,r]=e,{xNeedsValueOf:l,yNeedsValueOf:h,existingFilters:c}=s;let d=(0,n.OLL)(t,o,r,{xNeedsValueOf:l});const u=c?.find((e=>e.maxRange===d));let{indexData:p,valueData:g}=(0,n.iPk)(t,i,i,o,r,d,{xNeedsValueOf:l,yNeedsValueOf:h,reuseIndexData:u?.indexData,reuseValueData:u?.valueData}),m=tM(t,o,r,p,d,l,a,u?.indices);const y=[{maxRange:d,indices:m,indexData:p,valueData:g}];for(;m.length>10&&d>64;){const e=d,i=Math.trunc(e/2),s=c?.find((e=>e.maxRange===i)),h=(0,n.THQ)(p,g,e,{reuseIndexData:s?.indexData,reuseValueData:s?.valueData});d=h.maxRange,p=h.indexData,g=h.valueData,m=iM(m,t,o,r,p,d,l,a,s?.indices),y.push({maxRange:d,indices:m,indexData:p,valueData:g})}return y.reverse(),y}function sM(e,t,i,n,s,a){return nM([i,n],e,t,{xNeedsValueOf:s,yNeedsValueOf:a})}var aM=(0,n.XB6)(sM);function oM(e,t,i,s,a,o,r){const l=t.resolveColumnById(a,"xValue",i,"object"),h=t.resolveColumnById(a,s,i,"mixed-numeric"),c=t.getDomain(a,"xValue","value",i),d=t.resolveColumnNeedsValueOf(a,"xValue",i),u=t.resolveColumnNeedsValueOf(a,s,i),{values:p,needsValueOf:g}=(0,n.QP0)(e,l,d),{xValues:m,domain:y}=(0,n.g3H)(e,p,c);return function(e,t,i,s){const a=t.length;if(a<n.n9_)return;const[o,r]=e,{xNeedsValueOf:l,yNeedsValueOf:h,targetRange:c,existingFilters:d}=s,u=(0,n.OLL)(t,o,r,{xNeedsValueOf:l}),p=Math.min(u,(0,n.Myt)(Math.max(c,n.gjy))),g=d?.find((e=>e.maxRange===p)),{indexData:m,valueData:y}=(0,n.iPk)(t,i,i,o,r,p,{xNeedsValueOf:l,yNeedsValueOf:h,reuseIndexData:g?.indexData,reuseValueData:g?.valueData}),f=tM(t,o,r,m,p,l,a,g?.indices);return{immediate:[{maxRange:p,indices:f,indexData:m,valueData:y}],computeRemaining:function(){const e=nM([o,r],t,i,{xNeedsValueOf:l,yNeedsValueOf:h,existingFilters:d});return e?.filter((e=>e.maxRange!==p))??[]}}}(y,m,u?h:(0,n.X_t)(h),{xNeedsValueOf:g,yNeedsValueOf:u,targetRange:o,existingFilters:r})}var rM=(()=>{var e=class extends ly{constructor(){super(...arguments),this.stroke="#874349",this.strokeWidth=2,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.interpolation=new n._eL,this.marker=new wd,this.label=new vt,this.tooltip=Of(),this.connectMissingData=!1,this.sparklineMode=!1}};return d([n.mAP],e.prototype,"xKey",2),d([n.mAP],e.prototype,"yKey",2),d([n.mAP],e.prototype,"xName",2),d([n.mAP],e.prototype,"yName",2),d([n.mAP],e.prototype,"selectedKey",2),d([n.mAP],e.prototype,"stackGroup",2),d([n.mAP],e.prototype,"normalizedTo",2),d([n.mAP],e.prototype,"title",2),d([n.mAP],e.prototype,"stroke",2),d([n.mAP],e.prototype,"strokeWidth",2),d([n.mAP],e.prototype,"strokeOpacity",2),d([n.mAP],e.prototype,"lineDash",2),d([n.mAP],e.prototype,"lineDashOffset",2),d([n.mAP],e.prototype,"interpolation",2),d([n.mAP],e.prototype,"styler",2),d([n.mAP],e.prototype,"marker",2),d([n.mAP],e.prototype,"label",2),d([n.mAP],e.prototype,"tooltip",2),d([n.mAP],e.prototype,"connectMissingData",2),d([n.mAP],e.prototype,"sparklineMode",2),e})(),lM=(()=>{var e=class e extends yS{constructor(e){super({moduleCtx:e,propertyKeys:oy,propertyNames:ry,categoryKey:"xValue",pickModes:[2,1,0],datumSelectionGarbageCollection:!1,segmentedDataNodes:!1,usesPlacedLabels:!0,animationResetFns:{path:tb({getVisible:()=>this.visible,getOpacity:()=>this.getOpacity()}),label:Nf,datum:(e,t)=>
1({opacity:1,scalingX:1,scalingY:1,...Ux(0,t)})},clipFocusBox:!1}),this.properties=new rM,this.aggregationManager=new kb,this.hideWithSize0=!1,this.markerNodesPickable=!0}createNodeParams(e){return{...super.createNodeParams(e),xKey:this.properties.xKey,yKey:this.properties.yKey}}hasPickableNodeShapes(){return this.markerNodesPickable}get pickModeAxis(){return this.properties.sparklineMode?"main":"main-category"}isNormalized(){return null!=this.properties.normalizedTo}renderToOffscreenCanvas(){return(this.contextNodeData?.nodeData?.length??0)>0&&"cutout"===this.getDrawingMode(!1)||super.renderToOffscreenCanvas()}async processData(e){if(null==this.data)return;const{data:t,visible:i,seriesGrouping:{groupIndex:s=this.id,stackCount:a=0}={}}=this,{xKey:o,yKey:r,selectedKey:l,connectMissingData:h,normalizedTo:c}=this.properties,d=this.axes[n.tv$.X]?.scale,u=this.axes[n.tv$.Y]?.scale,{isContinuousX:p,xScaleType:g,yScaleType:m}=this.getScaleInformation({xScale:d,yScale:u}),y=a>1||null!=c,f={invalidValue:null};h&&y&&(f.invalidValue=0),y&&!i&&(f.forceValue=0);const x={value:`area-stack-${s}-yValue`,marker:`area-stack-${s}-yValues-marker`},b=[],v=this.properties.allowNullKeys??!1;p&&!y||b.push(Mr(o,g,{id:"xKey",allowNullKey:v})),b.push(kr(o,g,{id:"xValue",allowNullKey:v}),kr(r,m,{id:"yValueRaw",...f,invalidValue:void 0})),null!=l&&b.push(kr(l,"category",{id:"selectedRaw"})),y&&b.push(...Cr(r,"normal",{id:"yValueCumulative",...f,groupId:x.marker},m)),(0,n.O9V)(c)&&b.push(kr(r,m,{id:"yValue",...f,groupId:x.value}),zr(Object.values(x),c)),this.needsDataModelDiff()&&(b.push(Wr(p?["xValue"]:void 0)),this.processedData&&b.push(Ur(this.id,this.processedData)));const{dataModel:S,processedData:M}=await this.requestDataModel(e,t,{props:b,groupByKeys:y,groupByData:!y});this.aggregateData(S,M),this.animationState.transition("updateData")}yValueKey(){return this.isNormalized()?"yValue":"yValueRaw"}yCumulativeKey(e){return"grouped"===e.type?"yValueCumulative":this.yValueKey()}xCoordinateRange(e,t){const{marker:i}=this.properties,s=this.axes[n.tv$.X].scale.convert(e),a=i.enabled?.5*i.size*t:0;return[s-a,s+a]}yCoordinateRange(e,t){const{marker:i}=this.properties,s=this.axes[n.tv$.Y].scale.convert(e[0]),a=i.enabled?.5*i.size*t:0;return[s-a,s+a]}getSeriesDomain(e){const{dataModel:t,processedData:i,axes:s}=this;if(!t||!i)return{domain:[]};const a=s[n.tv$.Y];if(e===n.tv$.X){const e=t.resolveProcessedDataDefById(this,"xValue"),s=t.getDomain(this,"xValue","value",i);if("value"===e?.def.type&&"category"===e.def.valueType){const e=t.getKeySortMetadata(this,"xValue",i);return{domain:s.domain,sortMetadata:e}}return{domain:uo((0,n.Xxv)(s.domain))}}const o=this.domainForClippedRange(n.tv$.Y,[this.yCumulativeKey(i)],"xValue");return this.isNormalized()&&a instanceof Jm&&!(a instanceof oS)?{domain:uo(po(o))}:{domain:uo(o)}}getSeriesRange(e,t){const[i,s]=this.domainForVisibleRange(n.tv$.Y,[this.yCumulativeKey(this.processedData)],"xValue",t);return[(0,n.Roz)(i),(0,n.Roz)(s)]}getZoomRangeFittingItems(e,t,i){return this.zoomFittingVisibleItems("xValue",[this.yCumulativeKey(this.processedData)],e,t,i)}getVisibleItems(e,t,i){return this.countVisibleItems("xValue",[this.yCumulativeKey(this.processedData)],e,t,i)}aggregateData(e,t){if(this.aggregationManager.markStale(t.input.count),"ungrouped"!==t.type)return;if(gr(t))return;const i=this.axes[n.tv$.X];if(null==i)return;const s=this.estimateTargetRange();this.aggregationManager.aggregate({computePartial:n=>oM(i.scale.type,e,t,this.yCumulativeKey(t),this,s,n),computeFull:s=>function(e,t,i,s,a,o){const r=t.resolveColumnById(a,"xValue",i,"object"),l=t.resolveColumnById(a,s,i,"mixed-numeric"),h=t.getDomain(a,"xValue","value",i),c=t.resolveColumnNeedsValueOf(a,"xValue",i),d=t.resolveColumnNeedsValueOf(a,s,i),{values:u,needsValueOf:p}=(0,n.QP0)(e,r,c),{xValues:g,domain:m}=(0,n.g3H)(e,u,h),y=d?l:(0,n.X_t)(l);return o?nM(m,g,y,{xNeedsValueOf:p,yNeedsValueOf:d,existingFilters:o}):aM(g,y,m[0],m[1],p,d)}(i.scale.type,e,t,this.yCumulativeKey(t),this,s),targetRange:s});const a=this.aggregationManager.filters;a&&a.length>0&&n.Xjz.record(`${this.type}:aggregation`,a.map((e=>e.maxRange)))}createBucketLookupFeature(){return new Ab({series:this,getXAxis:()=>this.axes[n.tv$.X],getDataModel:()=>this.dataModel,getProcessedData:()=>this.processedData,aggregationManager:this.aggregationManager,dataSelectionService:this.ctx.dataSelectionService,domainKey:"value",canonicalExtremaSlots:[n.BNK]})}estimateTargetRange(){const e=this.axes[n.tv$.X];if(e?.scale?.range){const[t,i]=e.scale.range;return Math.abs(i-t)}return this.ctx.scene?.canvas?.width??800}createNodeDatumContext(e,t){const{dataModel:i,processedData:s}=this;if(!i||!s)return;
1const a=e.scale,o=t.scale,r=s.dataSources.get(this.id)?.data??[],[l,h]=a.range,c=Math.abs(h-l);this.aggregationManager.ensureLevelForRange(c);const d=this.aggregationManager.getFilterForRange(c);this.ensureBucketLookupFeature()?.setActiveFilter(s,d);const u=this.canIncrementallyUpdateNodes(null!=d),{marker:p}=this.properties,g=p.enabled?p.size:0,m=this.resolveLabelContext(p.shape,g);return{xAxis:e,yAxis:t,rawData:r,xValues:i.resolveColumnById(this,"xValue",s,"object"),yRawValues:i.resolveColumnById(this,"yValueRaw",s,"mixed-numeric"),yCumulativeValues:i.resolveColumnById(this,this.yCumulativeKey(s),s,"mixed-numeric"),crossFilterSelectionValues:this.properties.selectedKey?i.resolveColumnById(this,"selectedRaw",s,"boolean"):void 0,xScale:a,yScale:o,xOffset:(a.bandwidth??0)/2,yOffset:(o.bandwidth??0)/2,size:g,yDomain:this.getSeriesDomain(n.tv$.Y).domain,labelsEnabled:m.labelsEnabled,labelPadding:m.labelPadding,labelTextMeasurer:m.labelTextMeasurer,labelFit:m.labelFit,labelFitOverflow:m.labelFitOverflow,labelStyled:m.labelStyled,labelInsideOffset:m.labelInsideOffset,labelInsideSize:m.labelInsideSize,labelAnchor:m.labelAnchor,emptyLabel:{text:"",width:0,height:0},animationEnabled:!this.ctx.animationManager.isSkipped(),canIncrementallyUpdate:u,dataAggregationFilter:d,range:c,xKey:this.properties.xKey,yKey:this.properties.yKey,xName:this.properties.xName,yName:this.properties.yName,legendItemName:this.properties.legendItemName,connectMissingData:this.properties.connectMissingData,capDefaults:{lengthRatioMultiplier:this.properties.marker.getDiameter(),lengthMax:1/0},nodes:u?this.contextNodeData.nodeData:[],spanPoints:[],nodeIndex:0}}handleDatum(e,t,i){if(t.datum=e.rawData[i],t.xDatum=e.xValues[i],t.yDatum=e.yRawValues[i],t.yCumulative=e.yCumulativeValues[i],t.crossFilterSelected=e.crossFilterSelectionValues?.[i],t.x=e.xScale.convert(t.xDatum)+e.xOffset,t.y=e.yScale.convert(t.yCumulative)+e.yOffset,Number.isFinite(t.x)){if(null!=t.yDatum){const s=e.labelsEnabled?this.getLabelText(t.yDatum,t.datum,e.yKey,"y",e.yDomain,this.properties.label,{value:t.yDatum,datum:t.datum,xKey:e.xKey,yKey:e.yKey,xName:e.xName,yName:e.yName,legendItemName:e.legendItemName}):void 0,a=e.labelsEnabled?this.measureLabel(e,s):e.emptyLabel,o=e.labelsEnabled?(0,n.lIw)(s,this.properties.label,e):void 0,r=e.size>0?e.size/2:n.Olx;if(e.canIncrementallyUpdate&&e.nodeIndex<e.nodes.length){const n=e.nodes[e.nodeIndex];n.datum=t.datum,n.datumIndex=i,n.point={x:t.x,y:t.y,size:e.size},n.midPoint={x:t.x,y:t.y},n.cumulativeValue=Number(t.yCumulative),n.cumulativeValueExact=t.yCumulative,n.yValue=t.yDatum,n.xValue=t.xDatum,n.labelText=s,n.label=a,n.fit=o,n.gap=r,n.crossFilterSelected=t.crossFilterSelected}else e.nodes.push({series:this,datum:t.datum,datumIndex:i,yKey:e.yKey,xKey:e.xKey,point:{x:t.x,y:t.y,size:e.size},midPoint:{x:t.x,y:t.y},cumulativeValue:Number(t.yCumulative),cumulativeValueExact:t.yCumulative,yValue:t.yDatum,xValue:t.xDatum,capDefaults:e.capDefaults,labelText:s,label:a,fit:o,anchor:e.labelAnchor,insideOffset:e.labelInsideOffset,insideSize:e.labelInsideSize,placement:"top",gap:r,crossFilterSelected:t.crossFilterSelected});e.nodeIndex++}this.updateSpanPoints(e,t)}}updateSpanPoints(e,t){const i=e.spanPoints.at(-1);if(null!=t.yDatum){const n={point:{x:t.x,y:t.y},xDatum:t.xDatum,yDatum:t.yCumulative};Array.isArray(i)?i.push(n):(null==i||(i.skip+=1),e.spanPoints.push([n]))}else e.connectMissingData||(Array.isArray(i)||null==i?e.spanPoints.push({skip:0}):i.skip+=1)}populateNodeData(e){const t={datum:void 0,xDatum:void 0,yDatum:void 0,yCumulative:0,crossFilterSelected:void 0,x:0,y:0},i=e.dataAggregationFilter?.indices;let[n,s]=this.visibleRangeIndices("xValue",e.xAxis.range,i);n=Math.max(n-1,0),s=Math.min(s+1,i?.length??e.xValues.length),this.processedData.input.count<1e3&&(n=0,s=this.processedData.input.count);for(let a=n;a<s;a+=1)this.handleDatum(e,t,i?.[a]??a)}initializeResult(e){return{itemId:e.yKey,nodeData:e.nodes,labelData:e.labelsEnabled?e.nodes:[],strokeData:{itemId:e.yKey,spans:[]},scales:this.calculateScaling(),visible:this.visible,crossFiltering:!1,styles:qx(this,this.properties,this.properties.marker),segments:void 0}}assembleResult(e,t){const i=e.spanPoints.flatMap((e=>Array.isArray(e)?Dx(e,this.properties.interpolation):[]));t.strokeData={itemId:e.yKey,spans:i},t.crossFiltering=null!=this.properties.selectedKey;const n=this.chart?.seriesRect;return null==n||(t.segments=Pm(this.properties.segmentation,e.xAxis,e.yAxis,n,this.ctx.scene,!1)),t}isPathOrSelectionDirty(){return this.properties.marker.isDirty()}updatePathNodes(e){const{paths:[t],visible:i,animationEnabled:s}=e,a=this.getHighlightStyle(),o=this.getSelectionStyle(),r=this.getStyle(void 0),l=(0,n.HFk)(o,a,r),{strokeWidth:h,stroke:c,strokeOpacity:d,lineDash:u,lineDashOffset:p,opacity:g}=l,m=this.contextNodeData?.segments;t.setProperties({segments:m,fill:void 0,lineJoin:"round",pointerEvents:1,opacity:g,stroke:c,strokeWidth:h,strokeOpacity:d,lineDash:u,lineDashOffset:p}),t.datum=m,s||(t.visible=i),ib(this,t)}updateDatumSelection(e){let{nodeData:t}=e;const{datumSelection:i}=e,{contextNodeData:n,processedData:s,axes:a,properties:o}=this,{marker:r}=o,l=Zx(o,n,s,a,r,r,this.chart?.isMiniChart);return this.hideWithSize0=l.hideWithSize0,this.markerNodesPickable=l.needsNodeData&&!l.hideWithSize0,t=l.needsNodeData?t:[],r.isDirty()&&(i.clear(),i.cleanup()),gr(this.processedData)?i.update(t,void 0,(e=>Xr(e.xValue))):i.update(t)}updateDatumStyles(t){const{hideWithSize0:i}=this,{datumSelection:n,isHighlight:s}=t,{marker:a}=this.properties,{itemStyler:o}=a;if(null==o)return void this.runMarkerStylePass(n,s,{marker:a,hideWithSize0:i,isHighlight:s},{compute:e.computeNoStylerMarkerStyle,apply:Td.assignCachedStyle});const r=this.dataModel,l=this.processedData,{xKey:h,yKey:c}=this.properties,d={marker:a,hideWithSize0:i,isHighlight:s,xColumn:r.resolve
vendor: 4,586 bytes, line 1
1ColumnById(this,"xValue",l,"object"),yColumn:r.resolveColumnById(this,"yValueRaw",l,"mixed-numeric"),xDomain:r.getDomain(this,"xValue","key",l).domain,yDomain:r.getDomain(this,this.yCumulativeKey(l),"value",l).domain,xKey:h,yKey:c};this.runMarkerStylePass(n,s,d,{compute:e.computeStylerStyle,apply:e.applyStylerDatum})}updateDatumNodes(e){const{contextNodeData:t,hideWithSize0:i}=this;if(!t)return;const{datumSelection:n,isHighlight:s}=e,a=this.ctx.animationManager.isSkipped(),o=this.getShapeFillBBox(),r=this.ctx.highlightManager.getActiveHighlight(),l=this.getDrawingMode(s,e.drawingMode),h="cutout"===l?void 0:l,c=Qx(t.styles),d=this;n.each((function(e,n){const u=n.style??t.styles[d.getHighlightState(r,s,n.datumIndex)];d.applyMarkerStyle(u,e,n.point,o,{applyPosition:a,crossFilterSelected:n.crossFilterSelected,hideWithSize0:i,pickInflation:c});const p=h??d.resolveMarkerDrawingModeForState(l,u);e.__drawingMode!==p&&(e.drawingMode=p)})),s||this.properties.marker.markClean()}get labelProperty(){return this.properties.label}getLabelData(){const e=super.getLabelData(),{marker:t}=this.properties;if(t.enabled&&null!=t.itemStyler)for(const t of e)(0,n.N3b)(t,t.style?.size);return e}writeLabelPoint(e,t,i){return{...e,point:{...e.point,x:t,y:i}}}readLabelPoint(e){return e.point}makeStylerParams(e,t,i){const{id:n}=this,{marker:s,lineDash:a,lineDashOffset:o,stroke:r,strokeOpacity:l,strokeWidth:h,xKey:c,yKey:d}=this.properties,u=sl(e??0),p=al(t),g=al(i);return{marker:{fill:s.fill,fillOpacity:s.fillOpacity,size:s.size,shape:s.shape,stroke:s.stroke,strokeOpacity:s.strokeOpacity,strokeWidth:s.strokeWidth,lineDash:s.lineDash,lineDashOffset:s.lineDashOffset},highlightState:u,selectionState:p,candidateState:g,lineDash:a,lineDashOffset:o,seriesId:n,stroke:r,strokeOpacity:l,strokeWidth:h,xKey:c,yKey:d}}makeItemStylerParams(e,t,i,n){const{xKey:s,yKey:a}=this.properties,o=e.resolveColumnById(this,"xValue",t,"object")[i],r=e.resolveColumnById(this,"yValueRaw",t,"mixed-numeric")[i],l=e.getDomain(this,"xValue","key",t).domain,h=e.getDomain(this,this.yCumulativeKey(t),"value",t).domain,c=this.filterItemStylerFillParams(n.fill)??n.fill;return{...xl(o,r,s,a,l,h),xValue:o,yValue:r,...n,fill:c}}makeLabelFormatterParams(){const{xKey:e,xName:t,yKey:i,yName:n,legendItemName:s}=this.properties;return{xKey:e,xName:t,yKey:i,yName:n,legendItemName:s}}getTooltipContent(e){const{id:t,dataModel:i,processedData:s,axes:a,properties:o}=this,{xKey:r,xName:l,yKey:h,yName:c,tooltip:d,legendItemName:u}=o,p=o.allowNullKeys??!1,g=a[n.tv$.X],m=a[n.tv$.Y];if(!(i&&s&&g&&m))return;const y=s.dataSources.get(this.id)?.data?.[e],f=i.resolveColumnById(this,"xValue",s,"object")[e],x=i.resolveColumnById(this,"yValueRaw",s,"mixed-numeric")[e];if(void 0===f&&!p)return;const b=this.getStyle(void 0),v=this.makeItemStylerParams(i,s,e,b.marker),S=this.getMarkerStyle(this.properties.marker,{datumIndex:e,datum:y},v,{isHighlight:!1},b.marker);return this.formatTooltipWithContext(d,{heading:this.getAxisValueText(g,"tooltip",f,y,r,u,p),symbol:this.legendItemSymbol(),data:[{label:c,fallbackLabel:h,value:this.getAxisValueText(m,"tooltip",x,y,h,u),missing:eu(x)}]},{seriesId:t,datum:y,title:c,xKey:r,xName:l,yKey:h,yName:c,...S,...this.getModuleTooltipParams()})}legendItemSymbol(){const{stroke:e,strokeOpacity:t,strokeWidth:i,lineDash:n,marker:s}=this.getStyle(void 0);return{marker:{...this.getMarkerStyle(this.properties.marker,{},void 0,{isHighlight:!1,checkForHighlight:!1},{size:s.size,shape:s.shape,fill:s.fill,fillOpacity:s.fillOpacity,stroke:s.stroke,strokeOpacity:s.strokeOpacity,strokeWidth:s.strokeWidth,lineDash:s.lineDash,lineDashOffset:s.lineDashOffset}),enabled:this.properties.marker.enabled},line:{enabled:!0,stroke:e,strokeOpacity:t,strokeWidth:i,lineDash:n}}}getLegendData(e){if("category"!==e)return[];const{id:t,ctx:{legendManager:i},visible:n}=this,{yKey:s,yName:a,title:o,legendItemName:r,showInLegend:l}=this.properties;return[{legendType:e,id:t,itemId:s,legendItemName:r,seriesId:t,enabled:n&&(i?.getItemEnabled({seriesId:t,itemId:s})??!0),label:{text:r??o??a??s},symbol:this.legendItemSymbol(),hideInLegend:!l}]}updatePaths(e){this.updateLinePaths(e.paths,e.contextData)}updateLinePaths(e,t){const i=t.strokeData.spans,[n]=e;n.path.clear(),Ix(n,i),n.markDirty("LineSeries")}resetDatumAnimation(e){Yx([e.datumSelection])}animateEmptyUpdateReady(e){const{datumSelection:t,labelSelection:i,annotationSelections:n,contextData:s,paths:a}=e,{animationManager:o}=this.ctx;this.updateLinePaths(a,s),Jx(this,o,...a),Wh([t],Ux),Gx(this,o,{...this.getAnimationDrawingModes(),phase:"initial"}
1,t),Af(this,"labels",o,i),Af(this,"annotations",o,...n)}animateReadyResize(e){const{contextData:t,paths:i}=e;this.updateLinePaths(i,t),super.animateReadyResize(e)}animateWaitingUpdateReady(e){const{animationManager:t}=this.ctx,{datumSelection:i,labelSelection:s,annotationSelections:a,contextData:o,paths:r,previousContextData:l}=e,[h]=r;if(!1===o.visible&&!1===l?.visible)return;this.resetDatumAnimation(e),this.resetLabelAnimation(e);const c=()=>{this.resetPathAnimation(e),this.updateLinePaths(r,o)},d=()=>{t.skipCurrentBatch(),c()};if(null==o||null==l)return c(),_x(this,t,"added",this.getAnimationDrawingModes(),i),$h(this.id,"path_properties",t,[h],{opacity:0},{opacity:this.getOpacity()},{phase:"add"}),Af(this,"labels",t,s),void Af(this,"annotations",t,...a);if(o.crossFiltering!==l.crossFiltering)return void d();const u=function(e,t,i,s=1){if("category"===e.scales.x?.type!=("category"===t.scales.x?.type)||!(0,n.z1w)(e.scales.x)||!(0,n.z1w)(t.scales.x))return;if(null==e.strokeData||null==t.strokeData)return;let a="updated";t.visible&&!e.visible?a="removed":!t.visible&&e.visible&&(a="added");const o=kx({scales:e.scales,data:e.strokeData.spans},{scales:t.scales,data:t.strokeData.spans},1);if(null==o)return;return{status:a,stroke:Cx(a,o,"fade",s),hasMotion:(i?.changed??!0)||!(0,n.wo0)(e.scales.x,t.scales.x)||!(0,n.wo0)(e.scales.y,t.scales.y)||"updated"!==a}}(o,l,this.processedData?.reduced?.diff?.[this.id],this.getOpacity());void 0!==u?"no-op"!==u.status&&(Vh(this.id,"path_properties",t,[h],u.stroke.pathProperties),"added"===u.status?this.updateLinePaths(r,o):"removed"===u.status?this.updateLinePaths(r,l):Vb(this.id,"path_update",t,[h],u.stroke.path),u.hasMotion&&(_x(this,t,void 0,this.getAnimationDrawingModes(),i),Af(this,"labels",t,s),Af(this,"annotations",t,...a)),this.ctx.animationManager.animate({id:this.id,groupId:"reset_after_animation",phase:"trailing",from:{},to:{},onComplete:()=>this.updateLinePaths(r,o)})):d()}isLabelEnabled(){return this.properties.label.enabled}getBandScalePadding(){return{inner:1,outer:.1}}nodeFactory(){return new Sd}getStyle(e){const{styler:t,marker:i,lineDash:n,lineDashOffset:s,stroke:a,strokeOpacity:o,strokeWidth:r}=this.properties,{size:l,shape:h,fill:c="transparent",fillOpacity:d}=i;let u={};if(t){const i=this.getDataSelectionState(void 0),n=this.getDataCandidacyState(void 0),s=this.makeStylerParams(e,i,n),a=this.cachedCallWithContext(t,s)??{};u=this.ctx.optionsGraphService.resolvePartial(["series",`${this.declarationOrder}`],a,{pick:!1})??{}}return u.marker??(u.marker={}),{lineDash:u.lineDash??n,lineDashOffset:u.lineDashOffset??s,stroke:u.stroke??a,strokeOpacity:u.strokeOpacity??o,strokeWidth:u.strokeWidth??r,marker:{fill:u.marker.fill??c,fillOpacity:u.marker.fillOpacity??d,shape:u.marker.shape??h,size:u.marker.size??l,lineDash:u.marker.lineDash??i.lineDash??n,lineDashOffset:u.marker.lineDashOffset??i.lineDashOffset??s,stroke:u.marker.stroke??i.stroke??a,strokeOpacity:u.marker.strokeOpacity??i.strokeOpacity??o,strokeWidth:u.marker.strokeWidth??i.strokeWidth??r}}}getFormattedMarkerStyle(e){const t=this.getStyle(void 0),i=this.makeItemStylerParams(this.dataModel,this.processedData,e.datumIndex,t.marker);return this.getMarkerStyle(this.properties.marker,e,i,{isHighlight:!0},void 0,t)}computeFocusBounds(e){return Xx(this,e)}hasItemStylers(){return this.properties.selection.enabled||null!=this.properties.styler||null!=this.properties.marker.itemStyler||null!=this.properties.label.itemStyler}};return e.className="LineSeries",e.type="line",e.computeNoStylerMarkerStyle=(e,t,i,n,s)=>{const a=e.getStyle(i);return e.getMarkerStyle(t.marker,s,void 0,{isHighlight:t.isHighlight,highlightState:i,selectionState:n,hideWithSize0:t.hideWithSize0},a.marker,{stroke:a.stroke,strokeWidth:a.strokeWidth,strokeOpacity:a.strokeOpacity})},e.computeStylerStyle=(e,t,i)=>e.getStyle(i),e.applyStylerDatum=(e,t,i,n,s,a)=>{const{stroke:o,strokeWidth:r,strokeOpacity:l}=a,h=a.marker,c=t.xColumn[i.datumIndex],d=t.yColumn[i.datumIndex],u=e.filterItemStylerFillParams(h.fill)??h.fill,p={...xl(c,d,t.xKey,t.yKey,t.xDomain,t.yDomain),xValue:c,yValue:d,...h,fill:u};i.style=e.getMarkerStyle(t.marker,i,p,{isHighlight:t.isHighlight,highlightState:n,selectionState:s,hideWithSize0:t.hideWithSize0},h,{stroke:o,strokeWidth:r,strokeOpacity:l})},e})(),hM=(()=>({series:{stroke:n.HHJ,strokeWidth:2,strokeOpacity:1,lineDash:[0],lineDashOffset:0,interpolation:{type:"linear"},marker:{shape:"circle",size:7,strokeWidth:{$isUserOption:["./stroke",1,0]},fill:{$applySwitch:[{$path:"type"},{$palette:"fill"},["gradient",n.pRl],["image",n.pwE],["pattern",n.eu4]]},stroke:{$palette:"stroke"}},label:{...n.VTt,...n.F$C,enabled:!1,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},padding:8,collision:{alwaysShow:n.O2O}
1,insideStyle:(0,n.KVS)("chartBackgroundColor"),outsideStyle:(0,n.KVS)("textColor"),placement:"top"},tooltip:{range:{$if:[{$eq:[{$path:["/tooltip/range","nearest"]},"area"]},"nearest",{$path:["/tooltip/range","nearest"]}]},position:{anchorTo:{$path:["/tooltip/position/anchorTo","node"]}}},highlight:n.U3R,selection:n.zg6,segmentation:n.IgM}}))(),cM=pm({type:"series",name:"line",chartType:"cartesian",stackable:!0,version:Ot,dependencies:[Wv],options:Zn,predictAxis:Rm,defaultAxes:{y:{type:n.uCf.NUMBER,position:n.v9C.LEFT},x:{type:n.uCf.CATEGORY,position:n.v9C.BOTTOM}},axisKeys:{[n.tv$.X]:"xKeyAxis",[n.tv$.Y]:"yKeyAxis"},themeTemplate:hM,create:e=>new lM(e)}),dM=(()=>{var e=class extends WS{constructor(){super(...arguments),this.properties=new $S}getSizeFloorOverride(e){return e.size}};return e.className="ScatterSeries",e.type="scatter",e})(),uM=(()=>({series:{shape:"circle",size:7,fill:{$applySwitch:[{$path:"type"},{$palette:"fill"},["gradient",n.pRl],["image",n.pwE],["pattern",n.eu4]]},stroke:{$palette:"stroke"},fillOpacity:.8,maxRenderedItems:2e3,label:{...n.VTt,...n.F$C,enabled:!1,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},padding:8,insideStyle:(0,n.KVS)("chartBackgroundColor"),outsideStyle:(0,n.KVS)("textColor"),collision:{alwaysShow:!1,...(0,n.fs4)({collideWith:{seriesArea:!1}})}},tooltip:{range:{$if:[{$eq:[{$path:["/tooltip/range","nearest"]},"area"]},"nearest",{$path:["/tooltip/range","nearest"]}]},position:{anchorTo:{$path:["/tooltip/position/anchorTo","node"]}}},highlight:n.fil,selection:n.zg6,colorScale:_S},gradientLegend:GS}))(),pM=pm({type:"series",name:"scatter",chartType:"cartesian",version:Ot,dependencies:[Wv],options:Qn,predictAxis:Om,defaultAxes:{x:{type:n.uCf.NUMBER,position:n.v9C.BOTTOM},y:{type:n.uCf.NUMBER,position:n.v9C.LEFT}},axisKeys:{[n.tv$.X]:"xKeyAxis",[n.tv$.Y]:"yKeyAxis"},themeTemplate:uM,create:e=>new dM(e)}),gM=(()=>{var e=class extends Yh{constructor(){super(...arguments),this.showInLegend=!1}};return d([n.mAP],e.prototype,"showInLegend",2),e})(),mM=(()=>{var e=class extends bt{constructor(){super(...arguments),this.spacing=2}set(e,t){return super.set(e)}};return d([n.mAP],e.prototype,"text",2),d([n.mAP],e.prototype,"spacing",2),e})(),yM=(()=>{var e=class extends n.XPE{constructor(){super(...arguments),this.fill="transparent",this.fillOpacity=1}};return d([n.mAP],e.prototype,"fill",2),d([n.mAP],e.prototype,"fillOpacity",2),e})(),fM=(()=>{var e=class extends bt{constructor(){super(...arguments),this.offset=3,this.minAngle=0,this.minSpacing=4,this.maxCollisionOffset=50,this.avoidCollisions=!0}};return d([n.mAP],e.prototype,"offset",2),d([n.mAP],e.prototype,"minAngle",2),d([n.mAP],e.prototype,"minSpacing",2),d([n.mAP],e.prototype,"maxCollisionOffset",2),d([n.mAP],e.prototype,"avoidCollisions",2),e})(),xM=(()=>{var e=class extends bt{constructor(){super(...arguments),this.positionOffset=0,this.positionRatio=.5}};return d([n.mAP],e.prototype,"positionOffset",2),d([n.mAP],e.prototype,"positionRatio",2),e})(),bM=(()=>{var e=class extends n.XPE{constructor(){super(...arguments),this.length=10,this.strokeWidth=1}};return d([n.mAP],e.prototype,"colors",2),d([n.mAP],e.prototype,"length",2),d([n.mAP],e.prototype,"strokeWidth",2),d([n.mAP],e.prototype,"itemStyler",2),e})(),vM=(()=>{var e=class extends ml{constructor(){super(...arguments),this.defaultColorRange=[],this.defaultPatternFills=[],this.fills=Object.values(ju),this.strokes=Object.values(Wu),this.fillOpacity=1,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.cornerRadius=0,this.rotation=0,this.outerRadiusOffset=0,this.outerRadiusRatio=1,this.strokeWidth=1,this.sectorSpacing=0,this.hideZeroValueSectorsInLegend=!1,this.innerLabels=new n.F_c(mM),this.title=new gM,this.innerCircle=new yM,this.shadow=new $b,this.calloutLabel=new fM,this.sectorLabel=new xM,this.calloutLine=new bM,this.tooltip=Of()}};return d([n.mAP],e.prototype,"angleKey",2),d([n.mAP],e.prototype,"angleName",2),d([n.mAP],e.prototype,"angleFilterKey",2),d([n.mAP],e.prototype,"radiusKey",2),d([n.mAP],e.prototype,"radiusName",2),d([n.mAP],e.prototype,"radiusMin",2),d([n.mAP],e.prototype,"radiusMax",2),d([n.mAP],e.prototype,"calloutLabelKey",2),d([n.mAP],e.prototype,"calloutLabelName",2),d([n.mAP],e.prototype,"sectorLabelKey",2),d([n.mAP],e.prototype,"sectorLabelName",2),d([n.mAP],e.prototype,"legendItemKey",2),d([n.mAP],e.prototype,"defaultColorRange",2),d([n.mAP],e.prototype,"defaultPatternFills",2),d([n.mAP],e.prototype,"fills",2),d([n.mAP],e.prototype,"strokes",2),d([n.mAP],e.prototype,"fillOpacity",2),d([n.mAP],e.prototype,"strokeOpacity",2),d([n.mAP],e.prototype,"lineDash",2),d([n.mAP],e.prototype,"lineDashOffset",2),d([n.mAP],e.prototype,"cornerRadius",2),d([n.mAP],e.prototype,"itemStyler",2),d([n.mAP],e.prototype,"rotation",2),d([n.mAP],e.prototype,"outerRadiusOffset",2),d([n.mAP],e.prototype,"outerRadiusRatio",2),d([n.mAP],e.prototype,"innerRadiusOffset",2),d([n.mAP],e.prototype,"innerRadiusRatio",2),d([n.mAP],e.prototype,"strokeWidth",2),d([n.mAP],e.prototype,"sectorSpacing",2),d([n.mAP],e.prototype,"hideZeroValueSectorsInLegend",2),d([n.mAP],e.prototype,"innerLabels",2),d([n.mAP],e.prototype,"title",2),d([n.mAP],e.prototype,"innerCircle",2),d([n.mAP],e.prototype,"shadow",2),d([n.mAP],e.prototype,"calloutLabel",2),d([n.mAP],e.prototype,"sectorLabel",2),d([n.mAP],e.prototype,"calloutLine",2),d([n.mAP],e.prototype,"tooltip",2),e})(),SM=[1,2,4,8];function MM(e,t,i,s,a,o,r){const l=(i,r,l,h)=>{const c=(0,n.K$y)(i).lineHeight(),d=Yy(s,a,c,h),u=(0,n.Hn4)((0,n.i9m)({x:d.centerX,y:d.centerY},((e,t)=>ky(e,t,a)),2*Math.abs(a.outerRadius)),Math.max(o.left,o.right)+l,Math.max(o.top,o.bottom)+l);if(!r&&(0,n.kzl)(e,i).width>(0,n.weC)(u,c))return;const p=r?t:{...t,overflowStrategy:"hide"}
1,g=(0,n.GYJ)(e,(0,n.eyx)(p,u),i,d.anchored);return{placed:{text:g.text,x:d.centerX+g.offsetX,y:d.centerY+g.offsetY},rectHeight:d.height}},h=(e,t)=>{let i,s=0;const o=l(e,t,s,i);if(null==o)return{placed:{text:"",x:0,y:0},inWedge:!1};let h,{placed:c,rectHeight:d}=o,u=0;for(let o=0;o<8&&(0,n.OQU)(c.text);o+=1){const y=r(c,e),f=y.every((e=>Sy(e,a))),x=f?(0,n.ftt)(c.text):0;x>0&&x>=u&&(h=c,u=x);const b=m.merge(y);if(f&&null!=i&&Math.abs(b.height-d)<1)break;const v=f?s:SM[Math.min(o,SM.length-1)],S=f?{width:b.width,height:b.height}:i;if(v===s&&(g=i,null==(p=S)||null==g?p===g:p.width===g.width&&p.height===g.height))break;s=v,i=S;const M=l(e,t,s,i);if(null==M)break;({placed:c,rectHeight:d}=M)}var p,g;const y=h??c,f=(0,n.OQU)(y.text)?y.text:"";return{placed:{...y,text:f},inWedge:null!=h}},c=(0,n.bJZ)(t.minimumFontSize,i.fontSize);if(c>=i.fontSize)return h(i,!0).placed;const d=function(e,t,i){if(Math.hypot(e.x,e.y)<1e-6)return{area:1/0,capacityAt:()=>1/0};const n=Uy(t),{bands:s}=Xy(e,n,i),a=2*n.outerRadius/48,o=s.map((e=>e.width)).toSorted(((e,t)=>t-e));return{area:o.reduce(((e,t)=>e+t*a),0),capacityAt:e=>o.slice(0,Math.floor(o.length*a/e)).reduce(((e,t)=>e+t),0)}}(s,a,(0,n.K$y)((0,n.lad)(i,c)).lineHeight());return(0,n.sH7)(c,i.fontSize,((t,s)=>{const a=(0,n.lad)(i,t),o=(0,n.K$y)(a).lineHeight(),r=(0,n.kzl)(e,a).width;if(!s&&(r*o>d.area||r>d.capacityAt(o)))return;const{placed:l,inWedge:c}=h(a,s);return c&&!(0,n.FNX)(l.text)?{...l,fontSize:t===i.fontSize?void 0:t}:void 0}))??h((0,n.lad)(i,c),!0).placed}function kM({nodes:e}){return{fromFn:(...t)=>{const{fill:i,stroke:n,...s}=e.fromFn(...t);return s},toFn:(...t)=>{const{fill:i,stroke:n,...s}=e.toFn(...t);return s}}}var DM=(()=>{var e=class extends ab{constructor(e){super({moduleCtx:e,categoryKey:void 0,propertyKeys:{...nb,sectorLabel:["sectorLabelKey"],calloutLabel:["calloutLabelKey"]},propertyNames:{...sb,sectorLabel:["sectorLabelName"],calloutLabel:["calloutLabelName"]},pickModes:[1,0],animationResetFns:{item:bv,label:Nf}}),this.properties=new vM,this.phantomNodeData=void 0,this.backgroundGroup=new we({name:`${this.id}-background`,zIndex:n.$5h.BACKGROUND}),this.noVisibleData=!1,this.previousRadiusScale=new Qm,this.radiusScale=new Qm,this.phantomGroup=this.contentGroup.appendChild(new ke({name:"phantom",zIndex:-1})),this.phantomSelection=_h.select(this.phantomGroup,(()=>this.nodeFactory()),!1),this.phantomHighlightGroup=this.highlightGroup.appendChild(new ke({name:"phantom",zIndex:-1})),this.phantomHighlightSelection=_h.select(this.phantomHighlightGroup,(()=>this.nodeFactory()),!1),this.calloutLabelGroup=this.contentGroup.appendChild(new ke({name:"pieCalloutLabels"})),this.calloutLabelSelection=_h.select(this.calloutLabelGroup,ke),this.zerosumRingsGroup=this.backgroundGroup.appendChild(new ke({name:`${this.id}-zerosumRings`})),this.zerosumOuterRing=this.zerosumRingsGroup.appendChild(new Sd({shape:"circle"})),this.zerosumInnerRing=this.zerosumRingsGroup.appendChild(new Sd({shape:"circle"})),this.innerLabelsGroup=this.contentGroup.appendChild(new ke({name:"innerLabels"})),this.innerCircleGroup=this.backgroundGroup.appendChild(new ke({name:`${this.id}-innerCircle`})),this.innerLabelsSelection=_h.select(this.innerLabelsGroup,Ue),this.innerCircleSelection=_h.select(this.innerCircleGroup,(()=>new Sd({shape:"circle"}))),this.innerCircleCutoutGroup=this.innerCircleGroup.appendChild(new ke({name:`${this.id}-innerCircleCutout`})),this.innerCircleCutoutSelection=_h.select(this.innerCircleCutoutGroup,(()=>this.nodeFactory()),!1),this.surroundingRadius=void 0,this.angleScale=new Qm,this.angleScale.domain=[0,1],this.angleScale.range=[-Math.PI,Math.PI].map((e=>e+Math.PI/2)),this.phantomGroup.opacity=.2,this.phantomHighlightGroup.opacity=.2,this.innerLabelsGroup.pointerEvents=1}get calloutNodeData(){return this.phantomNodeData??this.nodeData}attachSeries(e,t,i){super.attachSeries(e,t,i),e?.appendChild(this.backgroundGroup)}detachSeries(e,t,i){super.detachSeries(e,t,i),this.backgroundGroup.remove()}setZIndex(e){super.setZIndex(e),this.backgroundGroup.zIndex=[n.$5h.BACKGROUND,e]}nodeFactory(){const e=new Qb;return e.miterLimit=1e9,e}getSeriesDomain(e){return e===n.tv$.Angle?{domain:this.angleScale.domain}:{domain:this.radiusScale.domain}}async processData(e){if(null==this.data)return;const{visible:t,id:i,ctx:{legendManager:s}}=this,{angleKey:a,angleFilterKey:o,radiusKey:r,calloutLabelKey:l,sectorLabelKey:h,legendItemKey:c}=this.properties,d=()=>(e,n)=>t&&(s?.getItemEnabled({seriesId:i,itemId:n})??1)?e:0,u=!this.ctx.animationManager.isSkipped(),p=this.properties.allowNullKeys??!1,g=[],m=[];c?g.push(Mr(c,"category",{id:"legendItemKey",allowNullKey:p})):l?g.push(Mr(l,"category",{id:"calloutLabelKey",allowNullKey:p})):h&&g.push(Mr(h,"category",{id:"sectorLabelKey",allowNullKey:p}));const y=this.radiusScale.type,f=this.angleScale.type;r&&m.push(function(e,t={}){const{min:i=-1/0,max:s=1/0,processor:a,...o}=t;return{type:"value",property:e,valueType:"range",validation:mr,processor:wr(a,(function(){return function(e){return(0,n.BfI)(e)?(0,n.qE8)(i,e,s):e}})),...o}}(r,{id:"radiusValue",min:this.properties.radiusMin??0,max:this.properties.radiusMax,missingValue:this.properties.radiusMax??1,processor:d}),kr(r,y,{id:"radiusRaw",processor:d}),Fr("radiusValue",[0,1],1,this.properties.radiusMin??0,this.properties.radiusMax)),l&&m.push(kr(l,"category",{id:"calloutLabelValue",allowNullKey:p})),h&&m.push(kr(h,"category",{id:"sectorLabelValue",allowNullKey:p})),c&&m.push(kr(c,"category",{id:"legendItemValue",allowNullKey:p})),o&&m.push(Ir(o,f,{id:"angleFilterValue",onlyPositive:!0,invalidValue:0,processor:d}),kr(o,f,{id:"angleFilterRaw"}),Fr("angleFilterValue",[0,1],0,0)),u&&this.processedData?.reduced?.animationValidation?.uniqueKeys&&g.length>
10&&m.push(Ur(this.id,this.processedData)),m.push(Wr()),await this.requestDataModel(e,this.data,{props:[...g,Ir(a,f,{id:"angleValue",onlyPositive:!0,invalidValue:0,processor:d}),kr(a,f,{id:"angleRaw"}),Fr("angleValue",[0,1],0,0),...m]});for(const e of this.processedData?.defs?.values??[]){const{id:t,missing:i,property:n}=e,s=go(this,i);"angleRaw"!==t&&s>0&&this.ctx.logger.warnOnce(`no value was found for the key '${String(n)}' on ${s} data element${s>1?"s":""}`)}this.animationState.transition("updateData")}maybeRefreshNodeData(){if(!this.nodeDataRefresh)return;const{nodeData:e=[],phantomNodeData:t}=this.createNodeData()??{};this.nodeData=e,this.phantomNodeData=t,e.length>0&&n.Xjz.record(`${this.type}:nodeData`,e.length),this.nodeDataRefresh=!1}getProcessedDataValues(e,t){return{angleValues:e.resolveColumnById(this,"angleValue",t,"number"),angleRawValues:e.resolveColumnById(this,"angleRaw",t,"mixed-numeric"),angleFilterValues:null==this.properties.angleFilterKey?void 0:e.resolveColumnById(this,"angleFilterValue",t,"number"),angleFilterRawValues:null==this.properties.angleFilterKey?void 0:e.resolveColumnById(this,"angleFilterRaw",t,"number"),radiusValues:this.properties.radiusKey?e.resolveColumnById(this,"radiusValue",t,"number"):void 0,radiusRawValues:this.properties.radiusKey?e.resolveColumnById(this,"radiusRaw",t,"mixed-numeric"):void 0,calloutLabelValues:this.properties.calloutLabelKey?e.resolveColumnById(this,"calloutLabelValue",t,"object"):void 0,sectorLabelValues:this.properties.sectorLabelKey?e.resolveColumnById(this,"sectorLabelValue",t,"object"):void 0,legendItemValues:this.properties.legendItemKey?e.resolveColumnById(this,"legendItemValue",t,"object"):void 0}}createNodeData(){const{id:e,processedData:t,dataModel:i,angleScale:s,ctx:{legendManager:a},visible:o}=this,{rotation:r,innerRadiusRatio:l}=this.properties;if(!i||"ungrouped"!==t?.type)return;const h=this.getProcessedDataValues(i,t),{angleValues:c,angleRawValues:d,angleFilterValues:u,angleFilterRawValues:p,radiusValues:g,radiusRawValues:m,legendItemValues:y}=h,f=p?.some(((e,t)=>e>d[t]))??!1;let x=0,b=0;const v=[],S=null==p?void 0:[],M=t.dataSources.get(this.id)?.data??[],k=t.invalidData?.get(this.id);for(const[t,i]of M.entries()){if(!0===k?.[t])continue;const l=f?u[t]:c[t],M=null==p||f?1:Math.sqrt((0,n.Roz)(p[t])/(0,n.Roz)(d[t])),D=s.convert(x)+(0,n.ehJ)(r);x=l,b+=l;const w=s.convert(x)+(0,n.ehJ)(r),I=Math.abs(w-D),A=D+I/2,C=d[t],N=(g?.[t]??1)*M,L=m?.[t],P=y?.[t],T=this.getLabels(t,i,A,I,h),O=this.getItemStyle({datum:i,datumIndex:t},!1,!1),R={series:this,datum:i,datumIndex:t,angleValue:C,midAngle:A,midCos:Math.cos(A),midSin:Math.sin(A),startAngle:D,endAngle:w,radius:N,innerRadius:Math.max(this.radiusScale.convert(0),0),outerRadius:Math.max(this.radiusScale.convert(N),0),sectorFormat:O,radiusValue:L,legendItemValue:P,enabled:o&&(a?.getItemEnabled({seriesId:e,itemId:t})??!0),focusable:!0,...T};v.push(R),null!=S&&S.push({...R,radius:1,innerRadius:Math.max(this.radiusScale.convert(0),0),outerRadius:Math.max(this.radiusScale.convert(1),0),focusable:!1})}return this.zerosumOuterRing.visible=0===b,this.zerosumInnerRing.visible=0===b&&null!=l&&1!==l&&l>0,{itemId:e,nodeData:v,labelData:v,phantomNodeData:S}}getLabelContent(e,t,i){const{id:n,ctx:s,properties:a}=this,{formatManager:o}=s,{calloutLabel:r,sectorLabel:l,calloutLabelKey:h,sectorLabelKey:c,legendItemKey:d}=a,u=a.allowNullKeys??!1,p=i.calloutLabelValues?.[e],g=i.sectorLabelValues?.[e],m=i.legendItemValues?.[e],y={datum:t,angleKey:this.properties.angleKey,angleName:this.properties.angleName,radiusKey:this.properties.radiusKey,radiusName:this.properties.radiusName,calloutLabelKey:this.properties.calloutLabelKey,calloutLabelName:this.properties.calloutLabelName,sectorLabelKey:this.properties.sectorLabelKey,sectorLabelName:this.properties.sectorLabelName,legendItemKey:this.properties.legendItemKey},f={callout:void 0,sector:void 0,legendItem:void 0};if(h&&(f.callout=this.getLabelText(p,t,h,"calloutLabel",[],r,{...y,value:p},u)),c&&(f.sector=this.getLabelText(g,t,c,"sectorLabel",[],l,{...y,value:g},u)),null!=d&&(null!=m||u)){const e=m??"";f.legendItem=o.format(this.callWithContext.bind(this),{type:"category",value:u?m:e,datum:t,seriesId:n,legendItemName:void 0,key:d,source:"legend-label",property:"legendItem",domain:[],boundSeries:this.getFormatterContext("legendItem")})??e}return f}getLabels(e,t,i,s,a){const{properties:o}=this,{calloutLabel:r,sectorLabel:l,legendItemKey:h}=o,c=this.getLabelContent(e,t,a),d={};return r.enabled&&c.callout&&s>
1=(0,n.ehJ)(r.minAngle)&&(d.calloutLabel={...this.getTextAlignment(i),text:c.callout,hidden:!1,collisionTextAlign:void 0,collisionOffsetY:0,box:void 0}),l.enabled&&c.sector&&(d.sectorLabel={text:c.sector}),h&&c.legendItem&&(d.legendItem={key:h,text:c.legendItem}),d}getTextAlignment(e){const t=[{textAlign:"center",textBaseline:"bottom"},{textAlign:"left",textBaseline:"middle"},{textAlign:"center",textBaseline:"top"},{textAlign:"right",textBaseline:"middle"}],i=(0,n.KVy)(e)- -.75*Math.PI,s=Math.floor(i/(Math.PI/2));return t[(0,n.GTV)(s,t.length)]}getFillParams(e,t,i){if((0,n.MBc)(e)&&"item"!==e.bounds)return{centerX:0,centerY:0,innerRadius:t,outerRadius:i}}getItemStyle({datum:e,datumIndex:t},i,s,a,o){const{fills:r,strokes:l,itemStyler:h}=this.properties,c=this.getHighlightStyle(i,t,a,o),d=s?this.getSelectionStyle(t):void 0,u={fill:r[t],stroke:l[t]},{fill:p,fillOpacity:g,stroke:m,strokeWidth:y,strokeOpacity:f,lineDash:x,lineDashOffset:b,cornerRadius:v,opacity:S}=(0,n.HFk)(d,c,u,this.properties);let M;return h&&(M=this.cachedDatumCallback(this.getDatumId(t)+(i?"-highlight":"-hide"),(()=>{const n=this.makeItemStylerParams(e,t,i,{fill:p,fillOpacity:g,stroke:m,strokeWidth:y,strokeOpacity:f,lineDash:x,lineDashOffset:b,cornerRadius:v});return this.ctx.optionsGraphService.resolvePartial(["series",`${this.declarationOrder}`],this.callWithContext(h,n),{proxyPaths:{fill:["fills",`${t}`],stroke:["strokes",`${t}`]}})}))),{fill:M?.fill??p,fillOpacity:M?.fillOpacity??g,stroke:M?.stroke??m,strokeWidth:M?.strokeWidth??y,strokeOpacity:M?.strokeOpacity??f,lineDash:M?.lineDash??x,lineDashOffset:M?.lineDashOffset??b,cornerRadius:M?.cornerRadius??v,opacity:S}}makeItemStylerParams(e,t,i,n){const{angleKey:s,radiusKey:a,calloutLabelKey:o,sectorLabelKey:r,legendItemKey:l}=this.properties,h=this.filterItemStylerFillParams(n.fill)??n.fill;return{datum:e,angleKey:s,radiusKey:a,calloutLabelKey:o,sectorLabelKey:r,legendItemKey:l,...n,fill:h,highlightState:this.getHighlightStateString(this.ctx.highlightManager?.getActiveHighlight(),i,t),selectionState:this.getSelectionStateString(t),candidateState:this.getCandidateStateString(t),seriesId:this.id}}getCalloutLineStyle(e,t){const{properties:i}=this;let n={};if(i.calloutLine.itemStyler){const s=this.getHighlightStateString(this.ctx.highlightManager?.getActiveHighlight(),t,e.datumIndex),a=this.getSelectionStateString(e.datumIndex),o=this.getCandidateStateString(e.datumIndex),r={angleKey:i.angleKey,angleName:i.angleName??i.angleKey,calloutLabelKey:i.calloutLabelKey,calloutLabelName:i.calloutLabelName??i.calloutLabelKey,datum:e.datum,highlightState:s,selectionState:a,candidateState:o,legendItemKey:i.legendItemKey,radiusKey:i.radiusKey,radiusName:i.radiusName??i.radiusKey,sectorLabelKey:i.sectorLabelKey,sectorLabelName:i.sectorLabelName??i.sectorLabelKey,seriesId:this.id};n=this.cachedCallWithContext(i.calloutLine.itemStyler,r)??{}}return{length:n.length??i.calloutLine.length,strokeWidth:n.strokeWidth??i.calloutLine.strokeWidth,color:n.color,colors:i.calloutLine.colors}}getInnerRadius(){const{radius:e}=this,{innerRadiusRatio:t=1,innerRadiusOffset:i=0}=this.properties,n=e*t+i;return n===e||n<0?0:n}getOuterRadius(){const{outerRadiusRatio:e,outerRadiusOffset:t}=this.properties;return Math.max(this.radius*e+t,0)}updateRadiusScale(e){const t=[this.getInnerRadius(),this.getOuterRadius()];this.radiusScale.range=t,e&&(this.previousRadiusScale.range=t);const i=e=>({...e,innerRadius:Math.max(this.radiusScale.convert(0),0),outerRadius:Math.max(this.radiusScale.convert(e.radius),0)});this.nodeData=this.nodeData.map(i),this.phantomNodeData=this.phantomNodeData?.map(i)}getTitleTranslationY(){const e=Math.max(0,this.radiusScale.range[1]);if(0===e)return Number.NaN;return-e-(2+(this.properties.title?.spacing??0))-Math.max(0,-e)}update({seriesRect:e}){const{title:t}=this.properties,i={seriesRectWidth:e?.width,seriesRectHeight:e?.height},s=null!=(0,n.G4M)(this.nodeDataDependencies,i);if(s&&(this._nodeDataDependencies=i),this.maybeRefreshNodeData(),this.updateTitleNodes(),this.updateRadiusScale(s),this.contentGroup.translationX=this.centerX,this.contentGroup.translationY=this.centerY,this.highlightGroup.translationX=this.centerX,this.highlightGroup.translationY=this.centerY,this.backgroundGroup.translationX=this.centerX,this.backgroundGroup.translationY=this.centerY,this.labelGroup&&(this.labelGroup.translationX=this.centerX,this.labelGroup.translationY=this.centerY),t){const e=this.getTitleTranslationY();t.node.y=Number.isFinite(e)?e:0;const i=t.node.getBBox();t.node.visible=t.enabled&&Number.isFinite(e)&&!this.bboxIntersectsSurroundingSeries(i)}for(const e of[this.zerosumInnerRing,this.zerosumOuterRing])e.fillOpacity=0,e.stroke=this.properties.calloutLabel.color,e.strokeWidth=1,e.strokeOpacity=1;this.updateNodeMidPoint(),this.updateSelections(),this.updateNodes(e)}updateTitleNodes(){const{oldTitle:e}=this,{title:t}=this.properties;e!==t&&(e&&e.node.remove(),t&&(t.node.textBaseline="bottom",this.labelGroup?.appendChild(t.node)),this.oldTitle=t)}updateNodeMidPoint(){const e=e=>{const t=e.innerRadius+(e.outerRadius-e.innerRadius)/2;e.midPoint={x:e.midCos*Math.max(0,t),y:e.midSin*Math.max(0,t)}};for(const t of this.nodeData)e(t);if(this.phantomNodeData)for(const t of this.phantomNodeData)e(t)}updateSelections(){this.updateGroupSelection(),this.updateInnerCircleSelection(),this.updateInnerCircleCutoutSelection()}updateGroupSelection(){const{itemSelection:e,highlightSelection:t,phantomSelection:i,phantomHighlightSelection:n,calloutLabelSelection:s,labelSelection:a,highlightLabelSelection:o,innerL
1abelsSelection:r}=this,l=this.nodeData.map((e=>({...e,sectorFormat:{...e.sectorFormat}}))),h=this.phantomNodeData?.map((e=>({...e,sectorFormat:{...e.sectorFormat}}))),c=(e,t)=>{e.update(t,void 0,(e=>this.getDatumId(e.datumIndex))),this.ctx.animationManager.isSkipped()&&e.cleanup()};c(e,this.nodeData),c(t,l),c(i,this.phantomNodeData??[]),c(n,h??[]),s.update(this.calloutNodeData,(e=>{const t=new Gh;t.tag=0,t.pointerEvents=1,e.appendChild(t);const i=new Ue;i.tag=1,i.pointerEvents=1,e.appendChild(i)})),a.update(this.nodeData),o.update(l),r.update(this.properties.innerLabels,(e=>{e.pointerEvents=1}))}getInnerCircleFillRadius(){const e=this.getInnerRadius(),{fill:t}=this.properties.innerCircle;if(e<=0||null==t||"transparent"===t)return e;let i=e;for(const e of this.nodeData){const{cornerRadius:t=0,stroke:n,strokeWidth:s=0}=e.sectorFormat;if(t<=0)continue;const a=Math.max((this.properties.sectorSpacing+(null==n?0:s))/2,0),o=e.innerRadius>0?e.innerRadius+a:0,r=Math.max(e.outerRadius-a,0);if(o<=0||r<=o)continue;const{startAngle:l,endAngle:h}=Ny(e.startAngle,e.endAngle),c=h-l-2*a/o,d=c>0?2*o*Math.sin(c/2):0,u=r-o,p=Math.floor(Math.min(t,d/2,u/2));i=Math.max(i,o+p)}return Math.min(i,this.getOuterRadius())}updateInnerCircleSelection(){const{innerCircle:e}=this.properties;let t=0;if(this.getInnerRadius()>0){const e=1;t=Math.ceil(2*this.getInnerCircleFillRadius()+e)}const i=e?[{radius:t}]:[];this.innerCircleSelection.update(i)}updateInnerCircleCutoutSelection(){const e=this.getInnerCircleFillRadius()>this.getInnerRadius()&&(0,n.zEw)();this.innerCircleGroup.renderToOffscreenCanvas=e,this.innerCircleCutoutSelection.update(e?this.nodeData:[],void 0,(e=>this.getDatumId(e.datumIndex))),this.ctx.animationManager.isSkipped()&&this.innerCircleCutoutSelection.cleanup()}applySectorSpacing(e,t,i){const n=Math.max((this.properties.sectorSpacing+(t?i:0))/2,0);e.inset=n,e.lineJoin=this.properties.sectorSpacing>=0||n>0?"miter":"round"}applySelectedOffset(e,t){const i=this.ctx.dataSelectionService?.getDataSelectionState(this,t),{selectedOffset:n}=this.properties.selection;if(!ol(i)&&n>0){const t=(e.endAngle+e.startAngle)/2;e.centerX=n*Math.cos(t),e.centerY=n*Math.sin(t)}else e.centerX=0,e.centerY=0}updateNodes(e){const t=this.ctx.highlightManager.getActiveHighlight(),{visible:i,dataModel:n,processedData:s}=this;if(this.backgroundGroup.visible=i,this.contentGroup.visible=i,!n||!s)return;const{legendItemValues:a}=this.getProcessedDataValues(n,s),o=this.isSeriesHighlighted(t,a),r=this.ctx.chartService.highlight?.drawingMode??"overlay";this.highlightGroup.visible=i&&o,this.labelGroup.visible=i,this.innerCircleSelection.each(((e,{radius:t})=>{e.setProperties({fill:this.properties.innerCircle?.fill,opacity:this.properties.innerCircle?.fillOpacity,size:t})}));const l=this.radiusScale.range[0],h=this.radiusScale.range[1],c=this.getShapeFillBBox(),d=this.ctx.animationManager.isSkipped(),u=(e,t,i,n,s)=>{const o=this.getItemStyle(t,n,!0,void 0,a);t.sectorFormat.fill=o.fill,t.sectorFormat.stroke=o.stroke,d&&(e.startAngle=t.startAngle,e.endAngle=t.endAngle,e.innerRadius=t.innerRadius,e.outerRadius=t.outerRadius),(n||d)&&(e.fill=o.fill,e.stroke=o.stroke);
1const r=this.getFillParams(o.fill,l,h);e.setStyleProperties(o,c,r),e.drawingMode=s,e.cornerRadius=o.cornerRadius,e.fillShadow=this.properties.shadow,this.applySectorSpacing(e,null!=o.stroke,o.strokeWidth),this.applySelectedOffset(e,t.datumIndex)};this.itemSelection.each(((e,t,i)=>u(e,t,0,!1,"overlay"))),this.phantomSelection.each(((e,t,i)=>u(e,t,0,!1,"overlay"))),this.innerCircleCutoutSelection.each(((e,t)=>{const i=this.getItemStyle(t,!1,!0,void 0,a);d&&(e.startAngle=t.startAngle,e.endAngle=t.endAngle,e.innerRadius=t.innerRadius,e.outerRadius=t.outerRadius),e.fill=void 0,e.stroke=void 0,e.strokeWidth=0,e.fillShadow=void 0,e.drawingMode="cutout",e.cornerRadius=i.cornerRadius,this.applySectorSpacing(e,null!=i.stroke,i.strokeWidth),this.applySelectedOffset(e,t.datumIndex)})),this.highlightSelection.each(((e,i,n)=>{u(e,i,0,!0,r),e.visible=i.datumIndex===t?.datumIndex})),this.phantomHighlightSelection.each(((e,i,n)=>{u(e,i,0,!0,r),e.visible=i.datumIndex===t?.datumIndex})),this.updateCalloutLineNodes(a),this.updateCalloutLabelNodes(e,a),this.updateSectorLabelNodes(a),this.updateInnerLabelNodes(),this.updateZerosumRings(),this.animationState.transition("update")}updateCalloutLineNodes(e){const{strokes:t}=this.properties,{offset:i}=this.properties.calloutLabel,s=this.ctx.highlightManager?.getActiveHighlight(),a=this.isSeriesHighlighted(s,e);for(const o of this.calloutLabelSelection.selectByTag(0)){const r=o.unsafeClosestDatum(),l=a&&!0===this.isItemHighlighted(s,r.datumIndex),{length:h,strokeWidth:c,color:d,colors:u}=this.getCalloutLineStyle(r,!1),p=c,g=(0,n._JH)(u)?u:t,{calloutLabel:m,outerRadius:y,datumIndex:f}=r;if(m?.text&&!m.hidden&&0!==y){o.visible=!0,o.strokeWidth=p,o.stroke=d??g[f%g.length],o.strokeOpacity=this.getHighlightStyle(l,r.datumIndex,void 0,e).opacity??1,o.fill=void 0;const t=r.midCos*y,n=r.midSin*y;let s=r.midCos*(y+h),a=r.midSin*(y+h);if((m.collisionTextAlign??0!==m.collisionOffsetY)&&null!=m.box){const e=m.box;let t=s,n=a;s<e.x?t=e.x:s>e.x+e.width&&(t=e.x+e.width),a<e.y?n=e.y:a>e.y+e.height&&(n=e.y+e.height);const o=t-s,r=n-a,l=Math.sqrt(Math.pow(o,2)+Math.pow(r,2)),h=l-i;h>0&&(s+=o*h/l,a+=r*h/l)}o.x1=t,o.y1=n,o.x2=s,o.y2=a}else o.visible=!1}}getLabelOverflow(e,t){const i=-this.centerX,n=i+t.width,s=-this.centerY,a=s+t.height;let o=e.width;e.x+1<i?o=(e.x+e.width-i)/e.width:e.x+e.width-1>n&&(o=(n-e.x)/e.width);return{maxWidth:o,hasVerticalOverflow:e.y+1<s||e.y+e.height-1>a,hasSurroundingSeriesOverflow:this.bboxIntersectsSurroundingSeries(e)}}bboxIntersectsSurroundingSeries(e){const{surroundingRadius:t}=this;if(null==t)return!1;const i=[{x:e.x,y:e.y},{x:e.x+e.width,y:e.y},{x:e.x+e.width,y:e.y+e.height},{x:e.x,y:e.y+e.height}],n=t**2;return i.some((e=>e.x**2+e.y**2>n))}getCalloutLabelBBox(e){const{calloutLabel:t}=this.properties,i=e.calloutLabel,s=this.getLabelStyle(e,t,"calloutLabel"),a=St(s),o=this.getCalloutLineStyle(e,!1).length,r=e.outerRadius+o+t.offset,l=e.midCos*r,h=e.midSin*r+i.collisionOffsetY,c=i.collisionTextAlign??i.textAlign,d=i.textBaseline,u=this.fitCalloutLabel(i.text,s);return Ue.measureBBox(u.text,l,h,{font:(0,n.lad)(s,u.fontSize),textAlign:c,textBaseline:d}).grow(a)}computeCalloutLabelCollisionOffsets(){const{radiusScale:e}=this,{minSpacing:t}=this.properties.calloutLabel,i=e.convert(0),s=this.calloutNodeData,a=s.filter((e=>{return!(!(t=e).calloutLabel||0===t.outerRadius);var t}));for(const e of a){const t=e.calloutLabel;null!=t&&(t.hidden=!1,t.collisionTextAlign=void 0,t.collisionOffsetY=0)}if(a.length<=1)return;const o=a.filter((e=>e.midCos<0)).sort(((e,t)=>e.midSin-t.midSin)),r=a.filter((e=>e.midCos>=0)).sort(((e,t)=>e.midSin-t.midSin)),l=a.filter((e=>e.midSin<0&&"center"===e.calloutLabel?.textAlign)).sort(((e,t)=>e.midCos-t.midCos)),h=a.filter((e=>e.midSin>=0&&"center"===e.calloutLabel?.textAlign)).sort(((e,t)=>e.midCos-t.midCos)),c=(e,i,n)=>{const s=this.getCalloutLabelBBox(e).grow(t/2),a=this.getCalloutLabelBBox(i).grow(t/2);s.x<a.x+a.width&&s.x+s.width>a.x&&("to-top"===n?s.y<a.y+a.height:s.y+s.height>a.y)&&(i.calloutLabel.collisionOffsetY="to-top"===n?s.y-a.y-a.height:s.y+s.height-a.y)},d=e=>{const t=e.slice().sort(((e,t)=>Math.abs(e.midSin)-Math.abs(t.midSin)))[0],i=e.indexOf(t);for(let t=i-1;t>=0;t--){const i=e[t+1],n=e[t];c(i,n,"to-top")}for(let t=i+1;t<e.length;t++){const i=e[t-1],n=e[t];c(i,n,"to-bottom")}},u=s.map((e=>{const{startAngle:t,endAngle:n,outerRadius:s}=e,a={startAngle:t,endAngle:n,innerRadius:i,outerRadius:s};return{box:vy(a),ref:a}})),p=e=>{const i=a.some((e=>0!==e.calloutLabel.collisionOffsetY)),s=e.map((e=>this.getCalloutLabelBBox(e))),o=s.map((e=>e.clone().grow(t/2)));let r=!1;for(let t=0;t<o.length&&!r;t++){const i=o[t];
1for(let n=t+1;n<e.length;n++){const e=o[n];if(i.collidesBBox(e)){r=!0;break}}}const l=(0,n.S2m)(s,u,wy);if(r||i||l)for(const t of e){if("center"!==t.calloutLabel.textAlign)continue;const e=t.calloutLabel;t.midCos<0?e.collisionTextAlign="right":t.midCos>0?e.collisionTextAlign="left":e.collisionTextAlign="center"}};d(o),d(r),p(l),p(h)}fitCalloutLabel(e,t){return(0,n.xBv)(e,(0,n.A_g)(this.properties.calloutLabel,!1),t)}getLabelStyle(e,t,i,n=!1){const s=this.ctx.highlightManager?.getActiveHighlight();return rf(this,e,this.properties,t,n,s,["series",`${this.declarationOrder}`,i])}updateCalloutLabelNodes(e,t){const{radiusScale:i}=this,{calloutLabel:s}=this.properties,a=new Ue,o=this.ctx.highlightManager?.getActiveHighlight(),r=this.isSeriesHighlighted(o,t);for(const l of this.calloutLabelSelection.selectByTag(1)){const h=l.unsafeClosestDatum(),c=h.calloutLabel,d=i.convert(h.radius),u=Math.max(0,d);if(!c?.text||0===u||c.hidden){l.visible=!1;continue}const p=r&&!0===this.isItemHighlighted(o,h.datumIndex),g=this.getLabelStyle(h,s,"calloutLabel",p),m=u+this.getCalloutLineStyle(h,!1).length+s.offset,y=h.midCos*m,f=h.midSin*m+c.collisionOffsetY,x={textAlign:c.collisionTextAlign??c.textAlign,textBaseline:c.textBaseline},b=this.fitCalloutLabel(c.text,g),v=(0,n.lad)(g,b.fontSize);a.text=b.text,a.x=y,a.y=f,a.setFont(v),a.setAlign(x),a.setBoxing(g);const S=a.getBBox();let M=b.text,k=!0;if(s.avoidCollisions){const{maxWidth:t,hasVerticalOverflow:i}=this.getLabelOverflow(S,e);if(S.width>t){const e={font:v,textWrap:"on-space",overflow:"hide",maxWidth:t};M=(0,n.rHj)(b.text,e)}k=!i}l.text=M,l.x=y,l.y=f,l.setFont(v),l.setAlign(x),l.setBoxing(g),l.fill=g.color,l.fillOpacity=this.getHighlightStyle(p,h.datumIndex,void 0,t).opacity??1,l.visible=k}}computeLabelsBBox(e,t){const{calloutLabel:i}=this.properties,{offset:s,maxCollisionOffset:a,minSpacing:o}=i;if(!i.avoidCollisions)return null;this.maybeRefreshNodeData(),this.updateRadiusScale(!1),this.computeCalloutLabelCollisionOffsets();const r=[],l=new Ue;let h;const{title:c}=this.properties;if(c?.text&&c.enabled){const e=this.getTitleTranslationY();Number.isFinite(e)&&(l.text=c.text,l.x=0,l.y=e,l.setFont(c),l.setAlign({textBaseline:"bottom",textAlign:"center"}),h=l.getBBox(),r.push(h))}for(const c of this.calloutNodeData){const d=c.calloutLabel;if(!d||0===c.outerRadius)continue;const u=this.getLabelStyle(c,i,"calloutLabel"),p=this.getCalloutLineStyle(c,!1).length,g=c.outerRadius+p+s,y=c.midCos*g,f=c.midSin*g+d.collisionOffsetY,x=this.fitCalloutLabel(d.text,u);l.text=x.text,l.x=y,l.y=f,l.setFont((0,n.lad)(u,x.fontSize)),l.setAlign({textAlign:d.collisionTextAlign??d.textAlign,textBaseline:d.textBaseline}),l.setBoxing(u);const b=l.getBBox();if(d.box=b,Math.abs(d.collisionOffsetY)>a)d.hidden=!0;else{if(h){const e=-this.centerY,t=new m(h.x-o,e,h.width+2*o,h.y+h.height+o-e);if(b.collidesBBox(t)){d.hidden=!0;continue}}if(e.hideWhenNecessary){const{maxWidth:e,hasVerticalOverflow:i,hasSurroundingSeriesOverflow:n}=this.getLabelOverflow(b,t),s=b.width>e;if(i||s||n){d.hidden=!0;continue}}d.hidden=!1,r.push(b)}}return 0===r.length?null:m.merge(r)}updateSectorLabelNodes(e){const{properties:t}=this,{positionOffset:i,positionRatio:s}=this.properties.sectorLabel,a=(0,n.A_g)(this.properties.sectorLabel,!1),o=kt(this.properties.sectorLabel),r=this.ctx.highlightManager?.getActiveHighlight(),l=this.isSeriesHighlighted(r,e),h=this.radiusScale.convert(0),c=h<=0&&1===this.ctx.legendManager?.getData(this.id)?.filter((e=>e.enabled)).length,d={textAlign:"center",textBaseline:"middle"},u=u=>u.each(((u,p)=>{const{outerRadius:g,startAngle:m,endAngle:y}=p,f=l&&!0===this.isItemHighlighted(r,p.datumIndex);let x,b=!1;if(p.sectorLabel&&0!==g){const r=this.getLabelStyle(p,t.sectorLabel,"sectorLabel",f),l=h*(1-s)+g*s+i,S={startAngle:m,endAngle:y,innerRadius:h,outerRadius:g};if(u.fill=r.color,u.fillOpacity=this.getHighlightStyle(f,p.datumIndex,void 0,e).opacity??1,null==a)u.x=c?0:p.midCos*l,u.y=c?0:p.midSin*l,u.text=p.sectorLabel.text;else if(c){u.x=0,u.y=0;const e=g*Math.SQRT2,t={width:e,height:e},i=Wy(p.sectorLabel.text,a,r,t);u.text=i.text,x=i.fontSize}else{const e={x:p.midCos*l,y:p.midSin*l};u.setAlign(d),u.setBoxing(r);const t=MM(p.sectorLabel.text,a,r,e,S,o,(v=u,(e,t)=>(v.text=e.text,v.x=e.x,v.y=e.y,v.setFont(t),v.getLineBoxes())));u.text=t.text,u.x=t.x,u.y=t.y,x=t.fontSize}u.setFont((0,n.lad)(r,x)),u.setAlign(d),u.setBoxing(r),b=u.getLineBoxes().every((e=>Sy(e,S)))}var v;u.visible=b}));u(this.labelSelection),u(this.highlightLabelSelection)}updateInnerLabelNodes(){const e=[],t=[],i=this.getInnerRadius(),s=(i>0?i:this.getOuterRadius())*Math.SQRT2,a={width:s,height:s};this.innerLabelsSelection.each(((i,s)=>{const{fontStyle:o,fontWeight:r,fontSize:l,fontFamily:h,color:c}=s;i.fontStyle=o,i.fontWeight=r,i.fontSize=l,i.fontFamily=h,i.text=jy(s.text,(0,n.A_g)(s,!1),s,a),i.x=0,i.y=0,i.fill=c,i.textAlign="center",i.textBaseline="bottom",e.push(i.getBBox()),t.push(s.spacing)}));const o=e=>0===e?0:t[e],r=e=>e===t.length-1?0:t[e],l=e.reduce(((e,t)=>Math.max(e,t.width)),0),h=e.reduce(((e,t,i)=>e+t.height+o(i)+r(i)),0),c=Math.sqrt(Math.pow(l/2,2)+Math.pow(h/2,2))<=(i>0?i:this.getOuterRadius()),d=[];for(let t=0,i=-h/2;t<e.length;t++){const n=e[t].height+i+o(t);d.push(n),i=n+r(t)}this.innerLabelsSelection.each(((e,t,i)=>{e.visible=c,e.y=d[i]}))}updateZerosumRings(){this.zerosumOuterRing.size=2*this.getOuterRadius(),this.zerosumInnerRing.size=2*this.getInnerRadius()}createNodeParams(e){return{...super.createNodeParams(e),angleKey:this.properties.angleKey,radiusKey:this.properties.radiusKey,calloutLabelKey:this.properties.calloutLabelKey,sectorLabelKey:this.properties.sectorLabelKey}}pickNodeClosestDatum(e){return function(e,t){const i=t.y-e.centerY,s=t.x-e.centerX,a=Math.atan2(i,s),o=e.getItemNodes();for(const t of o)if(!0!==t.datum.missing&&(0,n.tF8)(a,t.startAngle,t.endAngle)){const n=Math.hypot(s,i);let a=0;return n<t.innerRadius?a=t.innerRadius-n:n>
1t.outerRadius&&(a=n-t.outerRadius),{datum:t.datum,distance:a,target:e.contentGroup}}}(this,e)}pickNodesInBBoxPredicate(){return vv(this)}getTooltipContent(e){const{id:t,dataModel:i,processedData:s,properties:a,ctx:{formatManager:o}}=this,{legendItemKey:r,calloutLabelKey:l,calloutLabelName:h,sectorLabelKey:c,sectorLabelName:d,angleKey:u,angleName:p,radiusKey:g,radiusName:m,tooltip:y}=a,f=this.properties.title.node.getPlainText();if(!i||!s)return;const x=s.dataSources.get(this.id)?.data?.[e],b=this.getProcessedDataValues(i,s),{angleRawValues:v}=b,S=v[e],M=this.getLabelContent(e,x,b),k=M.legendItem??M.callout??M.sector??p,D=(0,n.aX5)(i.getDomain(this,"angleRaw","value",s)),w=o.format(this.callWithContext.bind(this),{type:"number",value:S,datum:x,seriesId:t,legendItemName:void 0,key:u,source:"tooltip",property:"angle",domain:D,boundSeries:this.getFormatterContext("angle"),fractionDigits:void 0,visibleDomain:void 0})??(0,n.Fl2)(S,3);return this.formatTooltipWithContext(y,{title:f,symbol:this.legendItemSymbol(e),data:[{label:(0,n.boc)(k),fallbackLabel:u,value:w}]},{seriesId:t,datum:x,title:p,legendItemKey:r,calloutLabelKey:l,calloutLabelName:h,sectorLabelKey:c,sectorLabelName:d,angleKey:u,angleName:p,radiusKey:g,radiusName:m,...this.getItemStyle({datum:x,datumIndex:e},!1,!1)})}legendItemSymbol(e){const t=this.processedData?.dataSources.get(this.id)?.data?.[e],i=this.getItemStyle({datum:t,datumIndex:e},!1,!1),{fillOpacity:s,strokeOpacity:a,strokeWidth:o,lineDash:r,lineDashOffset:l}=this.properties;let{fill:h}=i;const{stroke:c}=i;return(0,n.MBc)(h)&&(h={...h,gradient:"linear",rotation:0,reverse:!1}),{marker:{fill:h,stroke:c,fillOpacity:s,strokeOpacity:a,strokeWidth:o,lineDash:r,lineDashOffset:l}}}getLegendData(e){const{visible:t,processedData:i,dataModel:s,id:a,ctx:{legendManager:o}}=this;if(!s||!i||"category"!==e)return[];const{angleKey:r,calloutLabelKey:l,sectorLabelKey:h,legendItemKey:c,showInLegend:d}=this.properties;if(!(c||l&&l!==r||h&&h!==r))return[];const u=this.getProcessedDataValues(s,i),{angleRawValues:p}=u,g=this.properties.title?.showInLegend&&this.properties.title.text,m=[],y=this.properties.hideZeroValueSectorsInLegend,f=i.dataSources.get(this.id)?.data,x=i.invalidData?.get(this.id);for(let e=0;e<i.input.count;e++){const i=f?.[e],s=p[e];if(!0===x?.[e]||y&&0===s)continue;const b=[];g&&b.push(g);const v=this.getLabelContent(e,i,u);c&&void 0!==v.legendItem?b.push(v.legendItem):l&&l!==r&&void 0!==v.callout?b.push(v.callout):h&&h!==r&&void 0!==v.sector&&b.push(v.sector),0!==b.length&&m.push({legendType:"category",id:a,datum:i,itemId:e,seriesId:a,hideToggleOtherSeries:!0,enabled:t&&(o?.getItemEnabled({seriesId:a,itemId:e})??!0),label:{text:b.map((e=>(0,n.boc)(e))).join(" - ")},symbol:this.legendItemSymbol(e),legendItemName:null==c?void 0:i[c],hideInLegend:!d})}return m}setLegendState(e){const{id:t,ctx:{legendManager:i,eventsHub:s}}=this;for(const[n,s]of e.entries())i?.toggleItem(s,t,n);s.emit("chart:request-update",{type:n.GvF.SERIES_UPDATE})}animateEmptyUpdateReady(e){const{animationManager:t}=this.ctx,i=xv(!0,this.properties.rotation,this.radiusScale,this.previousRadiusScale);Vh(this.id,"nodes",t,[this.itemSelection,this.highlightSelection,this.phantomSelection,this.phantomHighlightSelection],i.nodes,(e=>this.getDatumId(e.unsafeDatum.datumIndex))),Vh(this.id,"innerCircleCutout",t,[this.innerCircleCutoutSelection],kM(i),(e=>this.getDatumId(e.unsafeDatum.datumIndex))),Vh(this.id,"innerCircle",t,[this.innerCircleSelection],i.innerCircle),Af(this,"callout",t,this.calloutLabelSelection),Af(this,"sector",t,this.labelSelection,this.highlightLabelSelection),Af(this,"inner",t,this.innerLabelsSelection),this.previousRadiusScale.range=this.radiusScale.range}animateWaitingUpdateReady(){const{itemSelection:e,highlightSelection:t,phantomSelection:i,phantomHighlightSelection:n,processedData:s,radiusScale:a,previousRadiusScale:o}=this,{animationManager:r}=this.ctx,l=s?.reduced?.diff?.[this.id];this.ctx.animationManager.stopByAnimationGroupId(this.id);const h=0===(l?.moved.size??0),c=(s?.defs.keys.length??0)>0;h&&c&&(s?.reduced?.animationValidation?.uniqueKeys??!0)||this.ctx.animationManager.skipCurrentBatch();const d=!this.nodeData.some((e=>e.enabled)),u=xv(!1,this.properties.rotation,a,o);Vh(this.id,"nodes",r,[e,t,i,n],u.nodes,(e=>this.getDatumId(e.unsafeDatum.datumIndex)),l),Vh(this.id,"innerCircleCutout",r,[this.innerCircleCutoutSelection],kM(u),(e=>this.getDatumId(e.unsafeDatum.datumIndex)),l),Vh(this.id,"innerCircle",r,[this.innerCircleSelection],u.innerCircle),Af(this,"callout",this.ctx.animationManager,this.calloutLabelSelection),Af(this,"sector",this.ctx.animationManager,this.labelSelection,this.highlightLabelSelection),this.noVisibleData!==d&&(this.noVisibleData=d,Af(this,"inner",this.ctx.animationManager,this.innerLabelsSelection)),this.previousRadiusScale.range=this.radiusScale.range}animateClearingUpdateEmpty(){const{itemSelection:e,highlightSelection:t,phantomSelection:i,phantomHighlightSelection:n,radiusScale:s,previousRadiusScale:a}=this,{animationManager:o}=this.ctx,r=xv(!1,this.properties.rotation,s,a);Vh(this.id,"nodes",o,[e,t,i,n],r.nodes,(e=>this.getDatumId(e.unsafeDatum.datumIndex))),Vh(this.id,"innerCircleCutout",o,[this.innerCircleCutoutSelection],kM(r),(e=>this.getDatumId(e.unsafeDatum.datumIndex))),Vh(this.id,"innerCircle",o,[this.innerCircleSelection],r.innerCircle),Cf(this,"callout",this.ctx.animationManager,this.calloutLabelSelection),Cf(this,"sector",this.ctx.animationManager,this.labelSelection,this.highlightLabelSelection),Cf(this,"inner",this.ctx.animationManager,this.innerLabelsSelection),this.previousRadiusScale.range=this.radiusScale.range}getDatumId(e){const{dataModel:t,processedData:i}=this;if(!t||!i)return`${e}`;const{calloutLabelKey:n,sectorLabelKey:s,legendItemKey:a}=this.properties;if(!i.reduced?.animationValidation?.uniqueKeys)return`${e}`;if(a){return Xr(t.resolveKeysById(this,"legendItemKey",i)[e])}if(n){return Xr(t.resolveKeysById(this,"calloutLabelKey",i)[e])}if(s){return Xr(t.resolveKeysById(this,"sectorLabelKey",i)[e])}return`${e}`}hasItemStylers(){return!(!this.properties.selection.enabled&&null==this.properties.itemStyler&&null==this.properties.calloutLabel.itemStyler&&null==this.properties.sectorLabel.itemStyler&&this.properties.innerL
1abels.every((e=>null==e.itemStyler)))}};return e.className="DonutSeries",e.type="donut",e})(),wM={series:{title:{enabled:!0,fontWeight:{$ref:"fontWeight"},fontSize:{$rem:n.q8q.LARGE},fontFamily:{$ref:"fontFamily"},color:{$ref:"subtleTextColor"},spacing:5},calloutLabel:{...n.mgV,...n.F$C,enabled:!0,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"textColor"},offset:3,minAngle:.001},sectorLabel:{...n.mgV,...n.F$C,enabled:!0,fontWeight:{$ref:"fontWeight"},fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},color:{$ref:"chartBackgroundColor"},positionOffset:0,positionRatio:.5},calloutLine:{length:10,strokeWidth:2,colors:{$map:[{$if:[{$or:[{$isGradient:{$value:"$1"}},{$isPattern:{$value:"$1"}},{$isImage:{$value:"$1"}}]},{$path:["../../strokes/$index",{$ref:"foregroundColor"}]},{$value:"$1"}]},{$if:[{$eq:[{$path:"../strokeWidth"},0]},{$path:"../fills"},{$path:"../strokes"}]}]}},fills:{$applyCycle:[{$cacheMax:{$size:{$path:["./data",{$path:"/data"}]}}},{$palette:"fills"},{$applySwitch:[{$path:["/type",void 0,{$value:"$1"}]},{$value:"$1"},["gradient",n.p3y],["pattern",n.eu4],["image",n.pwE]]}]},strokes:{$applyCycle:[{$cacheMax:{$size:{$path:["./data",{$path:"/data"}]}}},{$palette:"strokes"}]},fillOpacity:1,strokeOpacity:1,strokeWidth:{$isUserOption:["./strokes/0",2,0]},lineDash:[0],lineDashOffset:0,rotation:0,sectorSpacing:1,shadow:{enabled:!1,color:n.KU9,xOffset:3,yOffset:3,blur:5},highlight:n.dUR,selection:n.zg6},legend:{enabled:!0}},IM={...wM,series:{...wM.series,innerRadiusRatio:{$if:[{$eq:[{$path:["./innerRadiusOffset",void 0]},void 0]},.7,void 0]},innerCircle:{fill:{$applySwitch:[{$path:"type"},{$value:"$1"},["pattern",{...n.eu4,fill:{$ref:"foregroundColor"},stroke:{$ref:"foregroundColor"}}]]}},innerLabels:{$apply:{...n.mgV,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"textColor"},spacing:2}},highlight:n.dUR,selection:n.zg6}},AM=pm({type:"series",name:"donut",chartType:"polar",version:Ot,dependencies:[Kv],options:ss,themeTemplate:IM,create:e=>new DM(e)}),CM=(()=>{var e=class extends DM{};return e.className="PieSeries",e.type="pie",e})(),NM=pm({type:"series",name:"pie",chartType:"polar",version:Ot,dependencies:[Kv],options:is,themeTemplate:wM,create:e=>new CM(e)}),LM=class extends n.UbG{constructor(e){super(),this.cleanup.register(e.chartState.observe((t=>{e.localeManager.setLocaleText(t("options","locale.localeText"))})),e.chartState.observe((t=>{e.localeManager.setLocaleTextFormatter(t("options","locale.getLocaleText"))})))}},PM=pm({type:"plugin",name:"locale",version:Ot,options:{localeText:n.Ikc,getLocaleText:(0,n.R3$)(n.YjP)},create:e=>new LM(e)}),TM=pm({type:"axis",name:"number",chartType:"cartesian",version:Ot,dependencies:[Wv],options:wn,themeTemplate:(0,n.HFk)({maxThicknessRatio:.3,line:{enabled:!1}},Im,Cm),create:(e,t,i)=>new Jm(e,t,void 0,i)}),OM=pm({type:"axis",name:"log",chartType:"cartesian",version:Ot,dependencies:[Wv],options:In,themeTemplate:(0,n.HFk)({base:10,maxThicknessRatio:.3,line:{enabled:!1}},Im,Cm),create:(e,t,i)=>new oS(e,t,i)}),RM=pm({type:"axis",name:"time",chartType:"cartesian",version:Ot,dependencies:[Wv],options:An,themeTemplate:(0,n.HFk)({maxThicknessRatio:.3,gridLine:{enabled:!1}},Im,Am,Cm),create:(e,t,i)=>new ty(e,t,i)}),EM=pm({type:"axis",name:"category",chartType:"cartesian",version:Ot,dependencies:[Wv],options:kn,themeTemplate:(0,n.HFk)({groupPaddingInner:.1,maxThicknessRatio:.3,label:{autoRotate:!0,wrapping:"on-space"},gridLine:{enabled:!1},interval:{placement:"between"}},Im,Cm),create:(e,t,i)=>new Rf(e,t,new yc,i)}),zM=pm({type:"axis",name:"grouped-category",chartType:"cartesian",version:Ot,dependencies:[Wv],options:Dn,themeTemplate:(0,n.HFk)({tick:{enabled:!0,stroke:{$ref:"groupedCategoryLineColor"}},label:{spacing:10,rotation:270,wrapping:"on-space"},maxThicknessRatio:.5,paddingInner:.4,groupPaddingInner:.2},Im,Cm),create:(e,t,i)=>new Gf(e,t,i)}),BM=(()=>{var e=class extends Ob{constructor(e,t,i){super(e,t,new Ac,i,!1),this.defaultTickMinSpacing=20,this.defaultUnit=void 0,this.scale.logger=e.logger}get primaryLabel(){const e=this.options.parentLevel;return e?.enabled?e.label:void 0}get primaryTick(){const e=this.options.parentLevel;return e?.enabled?e.tick:void 0}getLabelFormat(){const e=this.options.label.format;return e}getPrimaryLabelFormat(){const e=this.primaryLabel?.format;return e}hasDefinedDomain(){const{min:e,max:t}=this.options;return null!=e&&null!=t&&e<t}isCategoryLike(){return!0}processData(){let e;super.processData();const{domain:t}=this.dataDomain;if(2===t.length&&t[0].valueOf()===t[1].valueOf())e=(0,n.DSS)(t[0]);else{const{boundSeries:t,direction:i}=this,{min:n,max:s}=this.options;e=ny(t,i,ey(n),ey(s))}(0,n.DH9)(this.defaultUnit,e)||(this.defaultUnit=e)}updateScale(){super.updateScale(),this.scale.interval=this.options.unit??this.defaultUnit}normaliseDataDomain(e){const{min:t,max:i,preferredMin:s,preferredMax:a}=this.options,{extent:o,clipped:r}=(0,n.XKY)(e,ey(t),ey(i),ey(s),ey(a));return{domain:o,clipped:r}}tickFormatParams(e,t,i,s){s??(s=(0,n._cn)(t));const a=(0,n.pm8)(e);return{type:"date",unit:(0,n.u1v)(s),step:(0,n.SBk)(s),epoch:(0,n.Nam)(s),truncateDate:a}}datumFormatParams(e,t,i,s,a){const o=this.options.unit??this.defaultUnit??"millisecond";s??(s=o);
1const{datum:r,seriesId:l,legendItemName:h,key:c,source:d,property:u,domain:p,boundSeries:g}=t,m=(0,n.u1v)(s),y=(0,n.SBk)(s),f=(0,n.Nam)(s);return{type:"date",value:(0,n.qpA)(o,e),datum:r,seriesId:l,legendItemName:h,key:c,source:d,property:u,domain:p,boundSeries:g,unit:m,step:y,epoch:f,style:a}}};return e.className="UnitTimeAxis",e.type="unit-time",e})(),FM=pm({type:"axis",name:"unit-time",chartType:"cartesian",version:Ot,dependencies:[Wv],options:Cn,themeTemplate:(0,n.HFk)({groupPaddingInner:.1,maxThicknessRatio:.3,label:{autoRotate:!1},gridLine:{enabled:!1},parentLevel:{enabled:!0},interval:{placement:"between"}},Im,Am,Cm),create:(e,t,i)=>new BM(e,t,i)}),VM=[bS,NS,YS,JS,cM,pM],$M=[Kv,AM,NM,aS,PM],HM=[[[TM,OM,RM,EM,zM,FM],VM,Yv,aS,PM].flat(),$M,zv].flat(),jM={};h(jM,{Arc:()=>Yb,BBox:()=>m,Caption:()=>Yh,CategoryScale:()=>yc,Group:()=>ke,Line:()=>Gh,LinearScale:()=>Qm,Marker:()=>Sd,Path:()=>je,RadialColumnShape:()=>Xb,Rect:()=>Ge,Scene:()=>Yi,Sector:()=>Qb,Shape:()=>ce,TranslatableGroup:()=>we,getRadialColumnWidth:()=>Zb,toRadians:()=>n.ehJ});var WM,_M,GM={};h(GM,{ChartTheme:()=>Yu,getChartTheme:()=>Gp,resolveOperation:()=>UM,themeNames:()=>YM,themeSymbols:()=>KM,themes:()=>jp}),c(GM,WM=s,"default"),_M&&c(_M,WM,"default");var KM={DEFAULT_ANNOTATION_HANDLE_FILL:n.nW0,DEFAULT_ANNOTATION_STATISTICS_COLOR:n.KCM,DEFAULT_ANNOTATION_STATISTICS_DIVIDER_STROKE:n.Fn1,DEFAULT_ANNOTATION_STATISTICS_DOWN_FILL:n.Xg7,DEFAULT_ANNOTATION_STATISTICS_DOWN_STROKE:n.wAP,DEFAULT_ANNOTATION_STATISTICS_FILL:n.w9K,DEFAULT_ANNOTATION_STATISTICS_STROKE:n.lO7,DEFAULT_CAPTION_ALIGNMENT:n.fH_,DEFAULT_CAPTION_LAYOUT_STYLE:n.ILz,DEFAULT_FIBONACCI_STROKES:n.fsm,DEFAULT_FINANCIAL_CHARTS_ANNOTATION_BACKGROUND_FILL:n.zVM,DEFAULT_FINANCIAL_CHARTS_ANNOTATION_COLOR:n.oC3,DEFAULT_POLAR_SERIES_STROKE:n.iKe,DEFAULT_SHADOW_COLOUR:n.KU9,DEFAULT_SPARKLINE_CROSSHAIR_STROKE:n.kOz,DEFAULT_TEXTBOX_COLOR:n.vjx,DEFAULT_TEXTBOX_FILL:n.xFO,DEFAULT_TEXTBOX_STROKE:n.U4X,DEFAULT_TEXT_ANNOTATION_COLOR:n.yQs,DEFAULT_TOOLBAR_POSITION:n.QJY,IS_DARK_THEME:n.oxB,PALETTE_ALT_DOWN_FILL:n.v48,PALETTE_ALT_DOWN_STROKE:n.AmB,PALETTE_ALT_NEUTRAL_FILL:n.yYi,PALETTE_ALT_NEUTRAL_STROKE:n.HVx,PALETTE_ALT_UP_FILL:n.W_3,PALETTE_ALT_UP_STROKE:n.Ra$,PALETTE_DOWN_FILL:n.P04,PALETTE_DOWN_STROKE:n.qvb,PALETTE_NEUTRAL_FILL:n.olo,PALETTE_NEUTRAL_STROKE:n.ThM,PALETTE_UP_FILL:n.ENk,PALETTE_UP_STROKE:n.JsB},YM=Object.keys(jp);function UM(e){const t=Yu.getDefaultPublicParameters(),i=Yu.getDefaultColors();return new Xg({line:{operation:e}},{series:[{type:"line"}]},t,t,i).resolve(void 0).operation}var XM={};h(XM,{Color:()=>n.Q1f,interpolateColor:()=>_a})},zlFw(e,t,i){i.r(t),i.d(t,{$1N:()=>mo,$2g:()=>Ba,$5h:()=>Gr,$6F:()=>py,$8B:()=>fi,$8e:()=>br,$PY:()=>Wt,$VX:()=>Ya,$ZB:()=>ed,$_4:()=>Gn,$aV:()=>Hb,$rL:()=>m,$uD:()=>Qx,$zQ:()=>x,AE2:()=>za,AEW:()=>Kx,AFh:()=>Ds,A_g:()=>Ag,AmB:()=>Zh,AmM:()=>f,Amh:()=>Xx,Aus:()=>Hn,BF9:()=>yx,BHv:()=>js,BNK:()=>nh,BXc:()=>la,BbD:()=>Wo,Bcy:()=>ep,BfI:()=>Jt,Bk6:()=>an,BlP:()=>si,Bmc:()=>oi,Bqc:()=>Wc,Byv:()=>tn,C1g:()=>Np,CFZ:()=>Or,CGN:()=>Vn,CMD:()=>wl,CRU:()=>ft,CaF:()=>zg,Cn9:()=>Nt,Cr:()=>Lo,D$r:()=>Gc,D83:()=>bx,DBR:()=>Gs,DGK:()=>wf,DGc:()=>rb,DH9:()=>xo,DJB:()=>Bs,DKO:()=>Ks,DMO:()=>Fb,DRK:()=>St,DSS:()=>Kl,DTD:()=>xu,Dcv:()=>jr,DdV:()=>px,Dgf:()=>zs,DhX:()=>un,DjU:()=>Pl,Djl:()=>Cx,Dl4:()=>ob,Dos:()=>Eb,Dpz:()=>ql,DuJ:()=>Jr,E2r:()=>Sn,E3_:()=>Ld,EDy:()=>mx,EGs:()=>S,EJX:()=>Vb,EMg:()=>Kc,ENk:()=>Gh,ES1:()=>sb,EXR:()=>Fh,Efy:()=>Yo,EtT:()=>Qt,Euh:()=>or,F$C:()=>Cr,F4U:()=>cd,FAd:()=>zu,FAe:()=>lo,FFB:()=>Ao,FIO:()=>Bx,FJ6:()=>lp,FNX:()=>$p,FQL:()=>au,F_c:()=>Ur,Fl2:()=>Fd,Fn1:()=>dc,FqJ:()=>at,Fqr:()=>ol,Fun:()=>Nl,Fup:()=>Ps,G4M:()=>Qd,G8T:()=>Sc,GBn:()=>bt,GBz:()=>ot,GGi:()=>Ib,GIY:()=>gi,GTV:()=>lt,GYJ:()=>Pp,GYY:()=>Is,Go6:()=>eu,GvF:()=>Hr,Gvm:()=>Yt,H$f:()=>Ad,H0q:()=>It,H2A:()=>$l,H6P:()=>Wa,HBB:()=>Dh,HFk:()=>vo,HHJ:()=>nr,HRu:()=>Lp,HVx:()=>ec,Haz:()=>Wb,Hg5:()=>Aa,HkM:()=>$x,Hki:()=>yu,Hn4:()=>Mp,HnG:()=>Ab,Hre:()=>Wl,Hsq:()=>ir,HvY:()=>Gb,I5B:()=>ld,I5e:()=>Cc,IFU:()=>ao,IK$:()=>Wp,ILz:()=>Hh,IQA:()=>Zs,IUw:()=>Ec,IXP:()=>th,IXQ:()=>hh,I_s:()=>us,Ia$:()=>na,Ib:()=>ea,IbQ:()=>et,IgM:()=>zr,Iig:()=>Df,Ikc:()=>An,Isv:()=>hp,J$N:()=>Xn,JF9:()=>td,JGt:()=>Ch,JJe:()=>zc,JJy:()=>sl,JR6:()=>If,Jc$:()=>ou,JhA:()=>qs,JjJ:()=>ue,Jlv:()=>kc,JpK:()=>Ns,JsB:()=>Wh,JwX:()=>ya,JyQ:()=>yr,K$y:()=>Zu,K8K:()=>F,KCM:()=>cc,KCZ:()=>Wn,KQS:()=>Ni,KU9:()=>$h,KVS:()=>Ar,KVy:()=>Nc,KgX:()=>qt,Kj1:()=>Da,KpM:()=>Bu,Kq8:()=>Es,LGi:()=>Io,LLE:()=>su,LVV:()=>Xs,LW:()=>Jl,LXq:()=>bs,LYQ:()=>rd,LiA:()=>qd,Lln:()=>z,Lmq:()=>jt,LyW:()=>Rn,M2I:()=>hf,M7D:()=>_b,M7G:()=>mb,MBc:()=>ux,MM$:()=>jn,MPH:()=>ks,MPT:()=>Cg,MPX:()=>ll,MTZ:()=>ng,MX6:()=>En,MYX:()=>pp,Mg2:()=>sr,MnY:()=>qa,Msk:()=>ta,Myf:()=>Ed,Myt:()=>el,N3b:()=>Og,N7u:()=>wd,NKs:()=>kf,NQR:()=>E,Nam:()=>Rl,NdZ:()=>Bo,Neb:()=>ho,NlA:()=>Fn,NmG:()=>al,Nv9:()=>Fx,O2O:()=>Nr,O9V:()=>$t,O9d:()=>Ln,OEe:()=>Pn,OFF:()=>sh,OLL:()=>kh,OQ$:()=>Br,OQU:()=>jp,ORG:()=>Md,ORH:()=>ss,Ob_:()=>tp,OcC:()=>Dp,Ocl:()=>up,Odr:()=>Zl,Olx:()=>Lg,Oxg:()=>ub,P04:()=>Kh,PvU:()=>rl,Q06:()=>Nd,Q1f:()=>Vt,Q1u:()=>qu,QB3:()=>_a,QFm:()=>kl,QI3:()=>Px,QJY:()=>fc,QP0:()=>dh,QQ:()=>sa,QQF:()=>Af,QTQ:()=>er,QYe:()=>qo,QdQ:()=>Xt,Qi6:()=>Oa,QpR:()=>R,R3$:()=>Zn,RIy:()=>Zt,Ra$:()=>Xh,Rfy:()=>yh,RlK:()=>np,Roz:()=>Ke,Rp1:()=>ph,Rs9:()=>hr,S2m:()=>Ig,S3I:()=>hd,S6A:()=>Oh,SBk:()=>Ol,SG9:()=>Ko,SOl:()=>Oo,SQ:()=>ia,STs:()=>Eo,SWA:()=>mt,SXH:()=>Lf,SXo:()=>xp,SY0:()=>Qc,Sc7:()=>Nn,Si_:()=>No,Szu:()=>uo,TB$:()=>zx,THQ:()=>Ph,TLF:()=>Xa,TS0:()=>Zd,TSE:()=>Yx,TaA:()=>Rs,TfM:()=>wb,ThM:()=>Yh,Thr:()=>Rg,Tmp:()=>fr,TnJ:()=>Qy,Tnt:()=>Kt,Tou:()=>jb,Ttm:()=>il,U$B:()=>nd,U3R:()=>Pr,U4X:()=>mc,UFo:()=>Wi,UQv:()=>zl,UWw:()=>Pt,U_K:()=>rg,UbG:()=>$e,Ueb:()=>_n,UhS:()=>ip,Un7:()=>Di,Uo6:()=>mn,UpF:()=>Dg,UpN:()=>Co,VED:()=>Lt,VHq:()=>Jc,VKS:()=>ui,VTt:()=>wr,Vnh:()=>Nh,Vom:()=>Th,Vp2:()=>id,Vr1:()=>uf,VyI:()=>W,Vz0:()=>qe,W$8:()=>rn,W9P:()=>$a,WCd:()=>Sl,WDn:()=>zb,WIG:()=>vc,WTq:()=>Mc,WXi:()=>yp,W_3:()=>qh,Wa7:()=>Uu,Wkl:()=>qy,Wpy:()=>_c,Wse:()=>O,Wv_:()=>kt,Wwf:()=>Qe,Wx1:()=>Sr,Wyg:()=>Us,WzD:()=>Ti,XB6:()=>Eu,XBY:()=>Ah,XKY:()=>zd,XKp:()=>v,XPE:()=>Yr,X_t:()=>mh,Xaq:()=>ar,XeB:()=>$n,Xg7:()=>uc,Xjz:()=>ae,Xk0:()=>Qo,Xlo:()=>
1ai,Xlx:()=>_e,XxK:()=>Ea,Xxv:()=>Rd,Y6k:()=>Bn,YE8:()=>Tt,YEm:()=>A,YGA:()=>y,YIG:()=>qn,YOg:()=>bn,YRd:()=>ha,YTK:()=>ig,YXt:()=>nt,YXx:()=>da,YZY:()=>Mx,YcT:()=>Ac,YdT:()=>_o,Yfy:()=>jx,YjP:()=>Cn,Yn5:()=>Po,Yqy:()=>Vu,Yzf:()=>sp,Z37:()=>Ku,Z4x:()=>Ut,Z6N:()=>ge,Z8P:()=>xl,ZI_:()=>Ia,ZKh:()=>Ux,ZMr:()=>bl,ZOm:()=>Mt,ZVp:()=>Hd,ZY9:()=>Pf,Zbg:()=>Qf,Zdq:()=>As,ZpP:()=>pt,Zz1:()=>Kr,_9u:()=>N,_As:()=>zt,_JH:()=>gx,_L:()=>Ws,_LU:()=>Pa,_Le:()=>hn,_Pz:()=>Yc,_ZY:()=>ef,_a8:()=>Xr,_cn:()=>Gl,_eL:()=>Zr,_gn:()=>At,_hN:()=>Mf,_n:()=>Er,_o_:()=>ri,_uB:()=>Mr,_uV:()=>Ve,_ui:()=>Yu,a$r:()=>Cd,a0u:()=>Li,a6C:()=>Tb,aBg:()=>rp,aX5:()=>h,aXB:()=>ys,af4:()=>pb,afe:()=>Ax,aig:()=>wn,alK:()=>tr,am_:()=>Rb,amv:()=>Ju,asp:()=>Ka,bCV:()=>Kp,bDc:()=>io,bJZ:()=>Gp,bRJ:()=>Lx,bTN:()=>vi,bUc:()=>Bi,bVu:()=>Sf,bX:()=>le,bXA:()=>li,baU:()=>Rx,bfJ:()=>Go,bkB:()=>u,bnk:()=>Vl,boc:()=>$i,cDl:()=>Va,cEq:()=>ur,cGV:()=>Je,cIo:()=>st,cOG:()=>bd,cS7:()=>Ye,cUy:()=>Qa,cVk:()=>bc,ca$:()=>ad,cmH:()=>ua,cpn:()=>ff,crw:()=>Cl,ct0:()=>$s,cyL:()=>Ht,d16:()=>L,d8p:()=>fu,dC9:()=>he,dHK:()=>lr,dRv:()=>hi,dUR:()=>Tr,dV6:()=>Za,dVq:()=>Bb,dYl:()=>Kn,ddp:()=>Dt,dkg:()=>Ii,dvT:()=>zn,e8I:()=>Lu,eKe:()=>db,ePN:()=>$u,eWm:()=>Xd,efk:()=>Fo,ehJ:()=>Pc,ehc:()=>Qn,enB:()=>Ta,eu4:()=>mr,eyx:()=>Vp,f$c:()=>La,f6S:()=>Db,fD2:()=>Gx,fH_:()=>jh,fNL:()=>On,fQz:()=>El,fUl:()=>_r,fWL:()=>co,fa1:()=>sd,fd6:()=>pn,fh7:()=>Od,fil:()=>Lr,fjG:()=>Ex,fq3:()=>Bh,fs4:()=>Jo,fsm:()=>sc,ftt:()=>Hp,fyz:()=>Ca,g0D:()=>gp,g1P:()=>re,g3H:()=>vh,g3U:()=>vt,gEE:()=>Nx,gMZ:()=>gb,gUy:()=>ib,gdm:()=>Gt,gfe:()=>Ha,gjy:()=>lh,h0L:()=>to,h1I:()=>Do,h6n:()=>Td,hKy:()=>ab,hLv:()=>bf,hR_:()=>Yn,hZK:()=>ro,hcQ:()=>bu,hqp:()=>Wx,hu9:()=>eg,hzM:()=>xs,i$:()=>pi,i1O:()=>Uc,i9m:()=>bp,iIr:()=>Ga,iKe:()=>tc,iNG:()=>mi,iNY:()=>go,iNx:()=>Bc,iPk:()=>Lh,i_e:()=>_s,ieU:()=>qi,ioo:()=>dn,iru:()=>Cf,ist:()=>gn,iud:()=>Ue,jBM:()=>ih,jD8:()=>To,jH0:()=>Ox,jME:()=>Dd,jOZ:()=>yo,jVD:()=>qr,jal:()=>Cb,jgH:()=>mu,jjO:()=>xf,jjq:()=>Ua,jjy:()=>Ys,jk9:()=>Un,k5z:()=>yd,k8u:()=>$b,kF$:()=>Qu,kNJ:()=>cb,kNh:()=>lg,kOz:()=>ic,kRS:()=>Eh,kW4:()=>Fi,kXN:()=>gt,kmN:()=>ah,ksX:()=>Ct,kuK:()=>ii,kxA:()=>hb,kzl:()=>Bg,l9T:()=>Vd,lCp:()=>Jd,lIG:()=>Up,lIt:()=>Ho,lIw:()=>Zy,lJ1:()=>$o,lO7:()=>hc,laH:()=>Id,lad:()=>_p,lb7:()=>aa,lkB:()=>wu,lp6:()=>Ri,lty:()=>zi,lyf:()=>vl,m9s:()=>Wu,mAP:()=>ao,mA_:()=>Fu,mBh:()=>qc,mLn:()=>Os,mPJ:()=>rr,mYB:()=>Ih,mfG:()=>iu,mgV:()=>Dr,mlo:()=>Ze,mnw:()=>D,mrm:()=>ja,mw3:()=>ln,n9_:()=>oh,nFR:()=>ji,nHZ:()=>rt,nR2:()=>l,nVd:()=>w,nW0:()=>rc,nXd:()=>Pu,na4:()=>op,nfz:()=>H,ngZ:()=>Ei,nhz:()=>_l,nlf:()=>po,nmo:()=>M,nnz:()=>Hl,npH:()=>Fa,np_:()=>af,o3B:()=>ht,o76:()=>cr,oC3:()=>nc,olf:()=>zo,olo:()=>Uh,or:()=>yn,oxB:()=>Vh,ozM:()=>yf,p1d:()=>Nu,p3y:()=>pr,p6U:()=>kn,pB1:()=>fx,pQy:()=>Ci,pRZ:()=>Ja,pRl:()=>dr,pRw:()=>Ss,pej:()=>So,ph$:()=>Ou,pm8:()=>Yl,pmA:()=>od,psk:()=>vd,pwE:()=>vr,q2v:()=>di,q8q:()=>Uo,q8s:()=>Bl,qDM:()=>Mu,qDt:()=>Ts,qE8:()=>Ge,qKc:()=>p,qNV:()=>wo,qRQ:()=>ka,qUX:()=>wh,qbB:()=>eh,qlQ:()=>Ix,qpA:()=>fl,qpr:()=>_x,qr:()=>jo,qvb:()=>_h,qw7:()=>Wr,qze:()=>Vs,r1i:()=>b,r3t:()=>In,r4$:()=>it,rHj:()=>Cp,rR5:()=>nl,rRI:()=>dt,rTr:()=>sg,rTu:()=>Ls,rkG:()=>dd,rtC:()=>Xc,ru5:()=>nb,rxg:()=>kg,s1K:()=>ut,s1j:()=>tt,s29:()=>tl,s2x:()=>cn,s57:()=>Oc,s5l:()=>Rh,s8C:()=>Zc,s8j:()=>Eg,sAu:()=>ns,sG5:()=>cf,sH7:()=>Xp,sI5:()=>ei,sPu:()=>Ra,sR8:()=>Dc,sX_:()=>ku,sbr:()=>mp,sby:()=>V,sg1:()=>Hi,she:()=>Vx,sns:()=>Pb,swK:()=>Dn,syG:()=>ce,szN:()=>bh,t$7:()=>is,t5w:()=>Fs,t6W:()=>bo,tDR:()=>se,tF8:()=>Lc,tFZ:()=>gu,tUW:()=>Dl,tbn:()=>Ro,tfT:()=>on,tr_:()=>_,tv$:()=>$r,txz:()=>Il,u1v:()=>Tl,uCf:()=>Zo,uEe:()=>ni,uYy:()=>Qr,ubx:()=>zh,ujG:()=>rh,ur2:()=>Ql,v$:()=>xh,v48:()=>Qh,v4Y:()=>lf,v7K:()=>Fc,v9C:()=>Xo,vDS:()=>Oi,vIl:()=>fo,vKy:()=>Vr,vTE:()=>Ob,vdg:()=>_t,vgR:()=>Dx,vjx:()=>yc,vq9:()=>Nf,vqL:()=>B,vr$:()=>gr,w6e:()=>T,w8L:()=>c,w9K:()=>lc,wAP:()=>pc,wEO:()=>ap,wSY:()=>Ng,wUm:()=>Ai,wWH:()=>Du,weC:()=>fp,whe:()=>Qs,wiP:()=>ws,wjz:()=>Vc,wo0:()=>eb,wti:()=>Nb,wvA:()=>Tn,wxv:()=>Hs,xAp:()=>k,xBv:()=>tg,xFO:()=>gc,xQc:()=>Sd,xWn:()=>Tc,xpk:()=>wi,y17:()=>vf,y43:()=>Pg,y7D:()=>Js,yB$:()=>lu,yE:()=>nu,yFN:()=>hu,yGp:()=>tu,yI4:()=>sn,yIC:()=>P,yQs:()=>ac,yWT:()=>Mn,yYi:()=>Jh,yar:()=>g,yms:()=>xr,ypg:()=>vx,ys5:()=>d,yy6:()=>Hx,z1w:()=>tb,z90:()=>xx,zEw:()=>md,zMY:()=>vn,zP6:()=>yt,zVM:()=>oc,zZm:()=>ti,zd9:()=>eo,zey:()=>yb,zg6:()=>Rr,zkX:()=>C,zp8:()=>Rc});i("19CV"),i("4fTp"),i("WFxX"),i("g6Bo"),i("ezUZ"),i("d5A/"),i("pPCv"),i("+Qw0"),i("RhNM"),i("01Te"),i("Wd41"),i("VkU2"),i("IHgz"),i("EaqF"),i("VaRY"),i("p5S9"),i("9km/"),i("zEmq"),i("x6/l"),i("d0Mj"),i("3A/4"),i("oNPk");var n=i("Q3ZI"),s=Object.defineProperty,a=Object.getOwnPropertyDescriptor,o=(e,t)=>{for(var i in t)s(e,i,{get:t[i],enumerable:!0})},r=(e,t,i,n)=>{for(var o,r=n>1?void 0:n?a(t,i):t,l=e.length-1;l>=0;l--)(o=e[l])&&(r=(n?o(t,i,r):o(r))||r);return n&&r&&s(t,i,r),r},l=(e=>(e.Chart="chart",e.Axis="axis",e.Series="series",e.Plugin="plugin",e.AxisPlugin="axis:plugin",e.SeriesPlugin="series:plugin",e.Preset="preset",e))(l||{});function h(e){return e.domain}var c=(e=>(e[e.Leading=0]="Leading",e[e.Trailing=1]="Trailing",e[e.Interpolate=2]="Interpolate",e))(c||{}),d=class{constructor(e){this.length=e,this.buffer=new Uint32Array(Math.ceil(e/32))}clear(){this.buffer.fill(0)}getBit(e){return this.buffer[e>>>5]>>>(31&e)&1}setBit(e){this.buffer[e>>>5]|=1<<(31&e)}unsetBit(e){this.buffer[e>>>5]&=~(1<<(31&e))}toggleBit(e){this.buffer[e>>>5]^=1<<(31&e)}fill(e,t,i){if(t>=i)return;const n=t>>>5,s=31&t,a=i>>>5,o=31&i;if(n===a){const t=(1<<o-s)-1<<s;return void(e?this.buffer[n]|=t:this.buffer[n]&=~t)}const r=4294967295<<s;e?this.buffer[n]|=r:this.buffer[n]&=~r,this.buffer.fill(4294967295*e,n+1,a);const l=(1<<o)-1;e?this.buffer[a]|=l:this.buffer[a]&=~l}},u=class{constructor(){this.events=new Map}on(e,t){return this.events.has(e)||this.events.set(e,new Set),this.events.get(e)?.add(t),()=>this.off(e,t)}off(e,t){const i=this.events.get(e);i&&(i.delete(t),0===i.size&&this.events.delete(e))}hasListeners(e){return this.events.has(e)}emit(e,t){const i=this.events.get(e);if(i)for(const e of i)e(t)}clear(e){e?this.events.delete(e):this.events.clear()}},p=class{constructor(e){if(this.maxCacheSize=e,this.store=new Map,e<=0)throw new Error("LRUCache size must be greater than 0")}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 e=this.store.keys().next();e.done||this.store.delete(e.value)}return t}clear(){this.store.clear()}},g={};function m(e){return void 0===e?[]:Array.isArray(e)?e:[e]}function y(e){return Array.isArray(e)?e[0]:e}function f(e){return Array.from(new Set(e))}function x(e,t){return e.reduce(((e,i)=>{const n=t(i);return e[n]??(e[n]=[]),e[n].push(i),e}),{})}function b(e,t){if(e.length!==t.length)return!1;for(let i=0;i<e.length;i++)if(Array.isArray(e[i])&&Array.isArray(t[i])){if(!b(e[i],t[i]))return!1}else if(e[i]!==t[i])return!1;return!0}function v(e,t,i=0){if(0===e.length)return[];const n=[];for(let s=0;s<t;s++)n.push(e.at((s+i)%e.length));return n}function S(e,t){const i=new Map;for(const[e,n]of t.entries())i.set(n,e);return e.sort(((e,t)=>(i.get(e)??1/0)-(i.get(t)??1/0)))}function M(e,t){let i=0;for(;i<e.length&&t(e[i]);)i+=1;const n=i;0!==n&&e.splice(0,n)}function k(e,t){let i=e.length-1;for(;i>=0&&t(e[i]);)i-=1;const n=e.length-1-i;0!==n&&e.splice(e.length-n,n)}function D(e,t,i){const n=[e],s=Math.round((t-e)/(i-1));if(s>0)for(let a=e+s;a<t;a+=s){if(n.push(a)>=i-1)break}return n.push(t),n}function w(e,t){for(let i=t.length-1;i>=0;i--)e.push(t[i]);return e}o(g,{Time:()=>ne,check:()=>te,create:()=>ee,inDevelopmentMode:()=>ie});var I={};function A(e){return e?I.document?.[e]:I.document}function C(e){return e?I.window?.[e]:I.window}function N(e){I.document=e}function L(e){I.window=e}function P(){return I.window?.OffscreenCanvas??globalThis.OffscreenCanvas}function T(){return I.window?.Path2D??globalThis.Path2D}function O(){return I.window?.DOMMatrix??globalThis.DOMMatrix}function R(){return I.window?.Image??globalThis.Image}function E(){return I.window?.ResizeObserver??globalThis.ResizeObserver}void 0!==globalThis.window&&(I.window=globalThis.window),"undefined"!=typeof document?I.document=document:void 0!==globalThis.global&&(I.document=globalThis.document);function z(e){return null!=e&&"number"==typeof e.nodeType}function B(e){return null!=e&&1===e.nodeType}function F(e){return null!=e&&11===e.nodeType}function V(e){return null!=e&&1===e.nodeType&&"style"in e}var $=["error","warning","deprecation"];function H(e){return"string"==typeof e&&$.includes(e)}function j(e){if(e instanceof Error||"object"!=typeof e||null==e)return String(e);const t="function"==typeof e.toString&&e.toString!==Object.prototype.toString;try{return t?String(e):JSON.stringify(e)}catch{return"[object Object]"}}
1var W=class{constructor(){this.doOnceCache=new Set,this.onceIssues=new Map,this.groups=[],this.errorEnabled=!0,this.warningEnabled=!0,this.deprecationEnabled=!0,this.issues=new u}onIssue(e){return this.issues.on("issue",e)}setEnabledLevels(e){this.errorEnabled=e.includes("error"),this.warningEnabled=e.includes("warning"),this.deprecationEnabled=e.includes("deprecation")}log(...e){this.openGroups(),n.log(...e)}deprecation(e,...t){this.deprecationEnabled&&(this.openGroups(),n.warn(`AG Charts - ${e}`,...t)),this.emitIssue("deprecation",e,t)}warn(e,...t){this.warningEnabled&&(this.openGroups(),n.warn(`AG Charts - ${e}`,...t)),this.emitIssue("warning",e,t)}error(e,...t){this.errorEnabled&&(this.openGroups(),"object"==typeof e?n.error("AG Charts error",e,...t):n.error(`AG Charts - ${e}`,...t)),this.emitIssue("error",e,t)}emitIssue(e,t,i,n){if(!this.issues.hasListeners("issue"))return;const s=null==n?void 0:this.onceIssues.get(n);if(s)return void this.issues.emit("issue",s);const a=i.map(j),o=t instanceof Error?{severity:e,message:t.message,cause:t}:{severity:e,message:j(t)};t instanceof Error&&t.stack&&a.unshift(t.stack);const r=a.filter((e=>""!==e)).join("\n");""!==r&&(o.detail=r),null!=n&&this.onceIssues.set(n,o),this.issues.emit("issue",o)}table(...e){this.openGroups(),n.table(...e)}guardOnce(e,t,i,n){let s;s=e instanceof Error?e.message:"string"==typeof e?e:"object"==typeof e?j(e):String(e);const a=`${t}: ${s}`;this.doOnceCache.has(a)?this.emitIssue(t,e,i,a):(this.isEnabled(t)&&this.doOnceCache.add(a),n(e))}isEnabled(e){return"error"===e?this.errorEnabled:"warning"===e?this.warningEnabled:this.deprecationEnabled}deprecationOnce(e,...t){this.guardOnce(e,"deprecation",t,(e=>this.deprecation(e,...t)))}warnOnce(e,...t){this.guardOnce(e,"warning",t,(e=>this.warn(e,...t)))}errorOnce(e,...t){this.guardOnce(e,"error",t,(e=>this.error(e,...t)))}reset(){this.doOnceCache.clear(),this.onceIssues.clear()}destroy(){this.reset(),this.issues.clear()}logGroup(e,t){const i={name:e,opened:!1};this.groups.push(i);let n=!0;try{const e=t();return"object"==typeof(s=e)&&null!==s&&"then"in s?(n=!1,e.finally((()=>{this.closeGroup(i)}))):e}finally{n&&this.closeGroup(i)}var s}openGroups(){for(const e of this.groups)e.opened||(e.opened=!0,n.groupCollapsed(e.name))}closeGroup(e){const t=this.groups.lastIndexOf(e);if(-1!==t){for(let e=this.groups.length-1;e>=t;e--)this.groups[e].opened&&n.groupEnd();this.groups.length=t}}};var _=new W,G=(...e)=>_.log(...e),K=(e,...t)=>_.warn(e,...t),Y=(e,...t)=>_.error(e,...t),U=(...e)=>_.table(...e),X=(e,...t)=>_.warnOnce(e,...t),Z=(e,...t)=>_.errorOnce(e,...t),q=()=>_.reset(),Q=(e,t)=>_.logGroup(e,t),J=Date.now();function ee(...e){return Object.assign(((...t)=>{te(...e)&&("function"==typeof t[0]&&(t=m(t[0]())),function(){const e=Date.now()-J;if(e>2e3){const t=(Math.floor(e/100)/10).toFixed(1);G(`**** ${t}s since last log message ****`)}J=Date.now()}(),G(...t))}),{check:()=>te(...e),group:(t,i)=>te(...e)?Q(t,i):i()})}function te(...e){0===e.length&&e.push(!0);const t=C("agChartsDebug");return null!=t&&m(t).some((t=>e.includes(t)))}function ie(e){if(te("dev"))return e()}function ne(e,t={}){const{logResult:i=!0,logStack:n=!1,logArgs:s=!1,logData:a}=t;return function(t,o,r){const l=r.value;r.value=function(...t){const o=performance.now(),r=l.apply(this,t),h={duration:performance.now()-o};return i&&(h.result=r),s&&(h.args=t),n&&(h.stack=new Error("Stack trace for timing debug").stack),a&&(h.logData=a(this)),G(e,h),r}}}var se={};o(se,{error:()=>Y,errorOnce:()=>Z,log:()=>G,logGroup:()=>Q,reset:()=>q,table:()=>U,warn:()=>K,warnOnce:()=>X});var ae={};o(ae,{flush:()=>le,record:()=>re});var oe=new Map;function re(e,t){te("scene:stats:verbose")&&oe.set(e,t)}function le(){const e=Object.fromEntries(oe);return oe.clear(),e}var he={},ce={};function de(e,t){return t?.type===e}o(ce,{ModuleScope:()=>ue,RegistryMode:()=>me,clearRegistryModes:()=>xe,getAxisModule:()=>Ee,getChartModule:()=>ze,getModuleScopeKey:()=>Ae,getPresetModule:()=>Be,getSeriesModule:()=>Fe,hasModule:()=>Te,ifRegistryChanged:()=>Ce,isEnterprise:()=>be,isGlobalScope:()=>Ie,isIntegrated:()=>ve,isModuleType:()=>de,isUmd:()=>Se,listModules:()=>
1Oe,listModulesByType:()=>Re,register:()=>Ne,registerModules:()=>Le,reset:()=>Pe,resolveModuleScope:()=>we,setRegistryMode:()=>fe});var ue=class{constructor(e){this.parent=e,this.modules=new Map,this.revision=0}get(e){return this.modules.get(e)??this.parent?.get(e)}registerModuleDefinition(e){if(this.modules.set(e.name,e),this.revision++,e.dependencies)for(const t of e.dependencies)this.register(t)}register(e){const t=this.get(e.name);if(t){if(t.version!==e.version)throw new Error([`AG Charts - Module '${e.name}' already registered with different version:`,`${t.version} vs ${e.version}`,"","Check your package.json for conflicting dependencies - depending on your package manager","one of these commands may help:","- npm ls ag-charts-community","- yarn why ag-charts-community"].join("\n"));!t.enterprise&&e.enterprise&&this.registerModuleDefinition(e)}else this.registerModuleDefinition(e)}registerModules(e){for(const t of e.flat())this.register(t)}reset(){this.modules.clear(),this.revision++}ifRegistryChanged(e,t){const i=this.currentRevision();return i!==e&&t(),i}currentRevision(){return null==this.parent?this.revision:`${this.parent.currentRevision()}:${this.revision}`}get hasOwnModules(){return this.modules.size>0}hasModule(e){return this.modules.has(e)||(this.parent?.hasModule(e)??!1)}*listModules(){if(yield*this.modules.values(),null!=this.parent)for(const e of this.parent.listModules())this.modules.has(e.name)||(yield e)}*listModulesByType(e){for(const t of this.listModules())de(e,t)&&(yield t)}getAxisModule(e){const t=this.get(e);if(de("axis",t))return t}getChartModule(e){const t=this.get(e);if(de("chart",t))return t;throw new Error("AG Charts - Unknown chart type; Check options are correctly structured and series types are specified")}getPresetModule(e){const t=this.get(e);if(de("preset",t))return t}getSeriesModule(e){const t=this.get(e);if(de("series",t))return t}};function pe(e){return new ue(e)}function ge(e,t){let i=new WeakMap;return{for(n){let s=i.get(n);null==s&&(s={cache:e(),revision:-1},i.set(n,s));const{cache:a}=s;return s.revision=n.ifRegistryChanged(s.revision,(()=>t(a))),a},clear(){i=new WeakMap}}}var me=(e=>(e.Enterprise="enterprise",e.Integrated="integrated",e.UMD="umd",e))(me||{}),ye=new Set;function fe(e){ye.add(e)}function xe(){ye.clear()}function be(){return ye.has("enterprise")}function ve(){return ye.has("integrated")}function Se(){return ye.has("umd")}var Me=pe(),ke=new p(32),De=new WeakMap;function we(e){const t=e?.flat()??[];if(0===t.length)return Me;const i=function(e){return e.map((e=>`${e.name}@${e.version}${e.enterprise?":enterprise":""}`)).sort(((e,t)=>e.localeCompare(t))).join(",")}(t);let n=ke.get(i);if(null==n){const e=pe(Me);e.registerModules(t),n=e.hasOwnModules?e:Me,ke.set(i,n),n!==Me&&De.set(n,i)}return n}function Ie(e){return e===Me}function Ae(e){return De.get(e)??""}function Ce(e,t){return Me.ifRegistryChanged(e,t)}function Ne(e){Me.register(e)}function Le(e){Me.registerModules(e)}function Pe(){xe(),Me.reset(),ke.clear()}function Te(e){return Me.hasModule(e)}function Oe(){return Me.listModules()}function Re(e){return Me.listModulesByType(e)}function Ee(e){return Me.getAxisModule(e)}function ze(e){return Me.getChartModule(e)}function Be(e){return Me.getPresetModule(e)}function Fe(e){return Me.getSeriesModule(e)}var Ve=class{constructor(){this.callbacks=new Set}flush(){for(const e of this.callbacks)e();this.callbacks.clear()}merge(e){for(const t of e.callbacks)this.callbacks.add(t)}register(...e){for(const t of e)t&&this.callbacks.add(t)}},$e=class{constructor(){this.cleanup=new Ve}destroy(){this.cleanup.flush()}};var He=new WeakMap;function je(e){const t=He.get(e);if(!t)throw new Error("AG Charts - DynamicContext: missing internal state.");return t}var We=class e{constructor(e){const t={cleanup:new Ve,self:this,resolving:new Set,children:new Set,refs:new Set,parent:e,destroyed:!1};
1He.set(this,t),e&&je(e).children.add(this)}get cleanup(){return je(this).cleanup}constant(e,t){return this.assertNotDestroyed(),Object.defineProperty(this,e,{value:t,configurable:!0,enumerable:!0}),je(this).self}ref(e,t){this.assertNotDestroyed();const i=je(this);return i.refs.add(e),Object.defineProperty(this,e,{value:t,configurable:!0,enumerable:!0}),i.self}service(e,t){return this.assertNotDestroyed(),Object.defineProperty(this,e,{configurable:!0,enumerable:!0,get:()=>{const i=this.resolve(e,t);return Object.defineProperty(this,e,{value:i,configurable:!0,enumerable:!0}),i}}),je(this).self}factory(e,t){return this.assertNotDestroyed(),Object.defineProperty(this,e,{configurable:!0,enumerable:!0,get:()=>this.resolve(e,t)}),je(this).self}has(e){return e in this}child(){const t=new e(this);return Object.setPrototypeOf(t,this),t}destroy(){const e=je(this);if(e.destroyed)return;e.destroyed=!0;for(const t of e.children)t.destroy();e.children.clear();const t=Object.keys(this);for(let i=t.length-1;i>=0;i--){const n=t[i];if(e.refs.has(n))continue;const s=Object.getOwnPropertyDescriptor(this,n);null!=s?.value&&"object"==typeof s.value&&s.value.destroy?.()}e.cleanup.flush(),e.parent&&je(e.parent).children.delete(this)}resolve(e,t){const i=je(this);if(i.destroyed)throw new Error(`AG Charts - DynamicContext: cannot resolve '${e}' on a destroyed context.`);if(i.resolving.has(e))throw new Error(`AG Charts - DynamicContext: circular dependency detected while resolving '${e}'.`);i.resolving.add(e);try{return t(i.self)}finally{i.resolving.delete(e)}}assertNotDestroyed(){if(je(this).destroyed)throw new Error("AG Charts - DynamicContext: cannot register on a destroyed context.")}};function _e(){return new We}function Ge(e,t,i){return Math.min(i,Math.max(e,t))}function Ke(e){if("number"==typeof e)return e;const t=Number(e);return Number.isFinite(t)||X(`the value ${e} exceeds the representable Number range and cannot be rendered.`),t}function Ye(e){return"bigint"==typeof e?Ke(e):Number(e)}function Ue(e){return null==e?void 0:Number(e)}function Xe(e,t){return("bigint"==typeof e||Number.isInteger(e))&&("bigint"==typeof t||Number.isInteger(t))}function Ze(e,t){return"bigint"==typeof e||"bigint"==typeof t?Xe(e,t)?BigInt(e)+BigInt(t):Number(e)+Number(t):e+t}function qe(e,t){return"bigint"==typeof e||"bigint"==typeof t?Xe(e,t)?BigInt(e)-BigInt(t):Number(e)-Number(t):e-t}function Qe(e,t){return"number"==typeof e&&"number"==typeof t?Math.min(e,t):"number"==typeof e&&Number.isNaN(e)?e:"number"==typeof t&&Number.isNaN(t)?t:e<t?e:t}function Je(e,t){return"number"==typeof e&&"number"==typeof t?Math.max(e,t):"number"==typeof e&&Number.isNaN(e)?e:"number"==typeof t&&Number.isNaN(t)?t:e>t?e:t}function et(e){return"bigint"==typeof e?e<0n?-e:e:Math.abs(e)}function tt(e){return"bigint"==typeof e?0n:0}function it(e,t,i=1e-10){return e>=t[0]-i&&e<=t[1]+i}function nt(e,t,i=1e-10){return e===t||Math.abs(e-t)<i}function st(e){return"bigint"==typeof e?e<0n:-1===Math.sign(e)||Object.is(e,-0)}function at(e){return e%1==0}function ot(e,t=2){const i=10**t;return Math.round(e*i)/i}function rt(e,t=2){const i=10**t;return Math.ceil(e*i)/i}function lt(e,t){return Math.floor(e%t+(e<0?Math.abs(t):0))}function ht(e){if(Math.floor(e)===e)return 0;let t=String(e),i=0;if(e<1e-6||e>=1e21){let e;[t,e]=t.split("e"),null!=e&&(i=Number(e))}const n=t.split(".")[1]?.length??0;return Math.max(n-i,0)}function ct(e,t){for(let i=t+1;i<e.length;i++)if(null!=e[i]?.stop)return i;return e.length-1}function dt(e,t,i,n){const s=new Array(e.length);let a=0,o=-1;for(let r=0;r<e.length;r++){r>=o&&(o=ct(e,r));const l=Ue(e[r]?.stop);if(null==l){const l=Ue(e[a]?.stop),h=l??t,c=Ue(e[o]?.stop)??i,d=n&&null==l?1:0;s[r]=h+(c-h)*(r-a+d)/(o-a+d)}else s[r]=l,a=r}return s}function ut(e,t,i,n){if(null!=e.name)return e.name;const s=t===i.length-1;return Number.isInteger(e.start)&&Number.isInteger(e.end)&&!s&&e.end-e.start>=1?`${n(e.start,0)}â${n(e.end-1,0)}`:`${n(e.start)}â${n(e.end)}`}function pt(e,t,i){if(0===e.length)return{domain:[],range:[],bins:[]};const n=Ke(t[0]),s=Ke(t[1]),a="discrete"===i,o=dt(e,n,s,a),r=e.map((e=>e.color));return a?function(e,t,i,n,s){const a=[],o=[],r=[];for(let l=0;l<i.length;l++){const h=0===l?n:e[l-1],c=e[l],d=Ge(n,h,s),u=Math.max(d,Ge(n,c,s));a.push(d),o.push(t[l]),r.push({start:d,end:u,color:t[l],name:i[l].name})}return a.push(r.at(-1).end),{domain:a,range:o,bins:r}}(o,r,e,n,s):{domain:o,range:r,bins:[]}}function gt(e){const{domain:t,range:i,mode:n,displayDomain:s}=e;if(0===i.length)return[];const[a,o]=s?[Ke(s[0]),Ke(s[1])]:[t[0],t.at(-1)],r=o-a||1;if("discrete"===n){const e=[];for(let n=0;n<i.length;n++){const s=Ge(0,(t[n]-a)/r,1),o=Ge(0,(t[n+1]-a)/r,1);o<s||(e.push({stop:s,color:i[n]}),o>s&&e.push({stop:o,color:i[n]}))}return e}if(t.length<i.length){const e=Math.max(i.length-1,1);return i.map(((t,i)=>({stop:i/e,color:t})))}return t.map(((e,t)=>({stop:(e-a)/r,color:i[t]})))}function mt(e,t,i,n,s){return ut({start:e,end:t,color:""},i,{length:n},s)}function yt(e,t,i,n){const{domain:s,range:a,mode:o}=e;if("discrete"!==o||0===a.length)return;let r=0;for(;r<a.length-1&&i>=s[r+1];)r++;return t[r]?.name??mt(s[r],s[r+1],r,a.length,n)}function ft(e){return e.flatMap(((t,i)=>{const{stop:n}=t,s=e.at(i+1)?.color;return null==s?[t]:[t,{stop:n,color:s}]}))}var xt,bt="â¦",vt=/\r?\n/g,St="â",Mt=/[\s.,;:-]{1,5}$/,kt="âª",Dt="â¬",wt=new Map;function It(e){if(wt.has(e))return wt.get(e)??null;if(null==xt){const e=C("Option");xt=(new e).style}xt.color=e;const t=xt.color||null;return xt.color="",wt.size<4e3&&wt.set(e,t),t}function At(e){return"rtl"===e?.ownerDocument.defaultView?.getComputedStyle(e).direction}function Ct(e,t){if(!e)return;const{x:i,y:n,width:s,height:a}=function(e){let{x:t,y:i,width:n,height:s}=e;if((null==n||n>0)&&(null==s||s>0))return e;null!=t&&null!=n&&n<0&&(n=-n,t-=n);null!=i&&null!=s&&s<0&&(s=-s,i-=s);return{x:t,y:i,width:n,height:s}}(t);Ot(e.style,"width",s),Ot(e.style,"height",a),Ot(e.style,"left",i),Ot(e.style,"top",n)}function Nt(e){const t=Number.parseFloat(e.style.width),i=Number.parseFloat(e.style.height),n=Number.parseFloat(e.style.left),s=Number.parseFloat(e.style.top),a=Number.isFinite(t)?t:e.offsetWidth,o=Number.isFinite(i)?i:e.offsetHeight;return{x:Number.isFinite(n)?n:e.offsetLeft,y:Number.isFinite(s)?s:e.offsetTop,width:a,height:o}}function Lt(e){if(e.focus({preventScroll:!0}),null==e.lastChild?.textContent)return;const{ownerDocument:t}=e,i=t.createRange();i.setStart(e.lastChild,e.lastChild.textContent.length),i.setEnd(e.last
1Child,e.lastChild.textContent.length);const n=t.defaultView?.getSelection();n?.removeAllRanges(),n?.addRange(i)}function Pt(){const e=C("navigator");if("scheduling"in e){const t=e.scheduling;if("isInputPending"in t)return t.isInputPending({includeContinuous:!0})}return!1}function Tt(e){return`ag-charts-icon ag-charts-icon-${e}`}function Ot(e,t,i){null==i?e.removeProperty(t):e.setProperty(t,`${i}px`)}var Rt=(e,t,i)=>e*(1-i)+t*i,Et=/^\s*(oklab|lab|lch|color)\(/i;function zt(e){return Et.test(e)}var Bt=e=>{const t=e<0?-1:1,i=Math.abs(e);return i<=.04045?e/12.92:t*((i+.055)/1.055)**2.4},Ft=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},Vt=(()=>{var e=class e{constructor(e,t,i,n=1){this.r=Ge(0,e||0,1),this.g=Ge(0,t||0,1),this.b=Ge(0,i||0,1),this.a=Ge(0,n||0,1)}static validColorString(t){if(t.includes("#"))return!!e.parseHex(t);const i=t.toLowerCase();if(i.includes("hsl"))return!!e.stringToHsla(t);if(i.includes("oklch"))return!!e.stringToOklcha(t);if(i.includes("rgb")){const i=e.stringToRgba(t);return null!=i&&(3===i.length||4===i.length)}return e.nameToHex.has(i)}static fromString(t){if(t.includes("#"))return e.fromHexString(t);const i=t.toLowerCase(),n=e.nameToHex.get(i);if(n)return e.fromHexString(n);if(i.includes("hsl"))return e.fromHSLString(t);if(i.includes("oklch"))return e.fromOKLCHString(t);if(i.includes("rgb"))return e.fromRgbaString(t);throw new Error(`Invalid color string: '${t}'`)}static parseHex(e){let t;switch((e=e.replaceAll(" ","").slice(1)).length){case 6:case 8:t=[];for(let i=0;i<e.length;i+=2)t.push(Number.parseInt(`${e[i]}${e[i+1]}`,16));break;case 3:case 4:t=e.split("").map((e=>Number.parseInt(e,16))).map((e=>e+16*e))}if(t?.length>=3&&t.every((e=>e>=0)))return 3===t.length&&t.push(255),t}static fromHexString(t){const i=e.parseHex(t);if(i){const[t,n,s,a]=i;return new e(t/255,n/255,s/255,a/255)}throw new Error(`Malformed hexadecimal color string: '${t}'`)}static stringToRgba(e){const t=e.indexOf("("),i=e.indexOf(")");if(-1===t||-1===i||i<t)return;const n=e.substring(t+1,i),s=n.indexOf("/"),a=(-1===s?n:n.substring(0,s)).trim().split(/[\s,]+/);-1!==s&&a.push(n.substring(s+1).trim());const o=[];for(let e=0;e<a.length;e++){const t=a[e];let i=Number.parseFloat(t);if(!Number.isFinite(i))return;t.includes("%")?(i=Ge(0,i,100),i/=100):3===e?i=Ge(0,i,1):(i=Ge(0,i,255),i/=255),o.push(i)}return o}static fromRgbaString(t){const i=e.stringToRgba(t);if(i){if(3===i.length)return new e(i[0],i[1],i[2]);if(4===i.length)return new e(i[0],i[1],i[2],i[3])}throw new Error(`Malformed rgb/rgba color string: '${t}'`)}static parseHueDegrees(e){const t=Number.parseFloat(e);if(Number.isFinite(t))return e.includes("turn")?360*t:e.includes("grad")?.9*t:e.includes("rad")?180*t/Math.PI:t}static parsePercentage(e){const t=Number.parseFloat(e);if(Number.isFinite(t))return Ge(0,t/100,1)}static parseUnitInterval(e){const t=Number.parseFloat(e);if(Number.isFinite(t))return Ge(0,e.includes("%")?t/100:t,1)}static parseOklchChroma(e){const t=Number.parseFloat(e);if(Number.isFinite(t))return Math.max(0,e.includes("%")?t/100*.4:t)}static stringToHsla(t){const i=t.indexOf("("),n=t.indexOf(")");if(-1===i||-1===n||n<i)return;const s=t.substring(i+1,n),a=s.indexOf("/"),o=(-1===a?s:s.substring(0,a)).trim().split(/[\s,]+/);if(-1!==a&&o.push(s.substring(a+1).trim()),o.length<3||o.length>4)return;const r=e.parseHueDegrees(o[0]),l=e.parsePercentage(o[1]),h=e.parsePercentage(o[2]);if(void 0===r||void 0===l||void 0===h)return;const c=[r,l,h];if(4===o.length){const t=e.parseUnitInterval(o[3]);if(void 0===t)return;c.push(t)}return c}static fromHSLString(t){const i=e.stringToHsla(t);if(i){const[t,n,s,a]=i;return e.fromHSL(t,n,s,a??1)}throw new Error(`Malformed hsl/hsla color string: '${t}'`)}static stringToOklcha(t){const i=t.indexOf("("),n=t.indexOf(")");if(-1===i||-1===n||n<i)return;const s=t.substring(i+1,n),a=s.indexOf("/"),o=(-1===a?s:s.substring(0,a)).trim().split(/[\s,]+/);if(-1!==a&&o.push(s.substring(a+1).trim()),o.length<3||o.length>4)return;const r=e.parseUnitInterval(o[0]),l=e.parseOklchChroma(o[1]),h=e.parseHueDegrees(o[2]);if(void 0===r||void 0===l||void 0===h)return;const c=[r,l,h];if(4===o.length){const t=e.parseUnitInterval(o[3]);if(void 0===t)return;c.push(t)}return c}static fromOKLCHString(t){const i=e.stringToOklcha(t);if(i){const[t,n,s,a]=i;return e.fromOKLCH(t,n,s,a??1)}throw new Error(`Malformed oklch color string: '${t}'`)}static fromArray(t){if(4===t.length)return new e(t[0],t[1],t[2],t[3]);if(3===t.length)return new e(t[0],t[1],t[2]);throw new Error("The given array should contain 3 or 4 color components (numbers).")}static fromHSB(t,i,n,s=1){const a=e.HSBtoRGB(t,i,n);return new e(a[0],a[1],a[2],s)}static fromHSL(t,i,n,s=1){const a=e.HSLtoRGB(t,i,n);return new e(a[0],a[1],a[2],s)}static fromOKLCH(t,i,n,s=1){const a=e.OKLCHtoRGB(t,i,n);return new e(a[0],a[1],a[2],s)}static padHex(e){return 1===e.length?"0"+e:e}toHexString(){let t="#"+e.padHex(Math.round(255*this.r).toString(16))+e.padHex(Math.round(255*this.g).toString(16))+e.padHex(Math.round(255*this.b).toString(16));return this.a<1&&(t+=e.padHex(Math.round(255*this.a).toString(16))),t}toRgbaString(e=3){const t=[Math.round(255*this.r),Math.round(255*this.g),Math.round(255*this.b)],i=Math.pow(10,e);return 1!==this.a?(t.push(Math.round(this.a*i)/i),`rgba(${t.join(", ")})`):`rgb(${t.join(", ")})`}toString(){return 1===this.a?this.toHexString():this.toRgbaString()}toHSB(){return e.RGBtoHSB(this.r,this.g,this.b)}
1static RGBtoOKLCH(e,t,i){const n=Bt(e),s=Bt(t),a=Bt(i),o=Math.cbrt(.4122214708*n+.5363325363*s+.0514459929*a),r=Math.cbrt(.2119034982*n+.6806995451*s+.1073969566*a),l=Math.cbrt(.0883024619*n+.2817188376*s+.6299787005*a),h=.2104542553*o+.793617785*r-.0040720468*l,c=1.9779984951*o-2.428592205*r+.4505937099*l,d=.0259040371*o+.7827717662*r-.808675766*l,u=180*Math.atan2(d,c)/Math.PI;return[h,Math.hypot(c,d),u>=0?u:u+360]}static OKLCHtoRGB(e,t,i){const n=e,s=t*Math.cos(i*Math.PI/180),a=t*Math.sin(i*Math.PI/180),o=(n+.3963377774*s+.2158037573*a)**3,r=(n-.1055613458*s-.0638541728*a)**3,l=(n-.0894841775*s-1.291485548*a)**3,h=-1.2684380046*o+2.6097574011*r-.3413193965*l,c=-.0041960863*o-.7034186147*r+1.707614701*l;return[Ft(4.0767416621*o-3.3077115913*r+.2309699292*l),Ft(h),Ft(c)]}static RGBtoHSL(e,t,i){const n=Math.min(e,t,i),s=Math.max(e,t,i),a=(s+n)/2;let o,r;if(s===n)o=0,r=0;else{const l=s-n;r=a>.5?l/(2-s-n):l/(s+n),o=s===e?(t-i)/l+(t<i?6:0):s===t?(i-e)/l+2:(e-t)/l+4,o*=60}return[o,r,a]}static HSLtoRGB(e,t,i){if(0===t)return[i,i,i];const n=i<.5?i*(1+t):i+t-i*t,s=2*i-n;function a(e){return e<0&&(e+=1),e>1&&(e-=1),e<1/6?s+6*(n-s)*e:e<.5?n:e<2/3?s+(n-s)*(2/3-e)*6:s}return[a((e=(e%360+360)%360)/360+1/3),a(e/360),a(e/360-1/3)]}static RGBtoHSB(e,t,i){const n=Math.min(e,t,i),s=Math.max(e,t,i);let a=0;if(n!==s){const o=s-n,r=(s-e)/o,l=(s-t)/o,h=(s-i)/o;a=e===s?h-l:t===s?2+r-h:4+l-r,a/=6,a<0&&(a+=1)}return[360*a,0===s?0:(s-n)/s,s]}static HSBtoRGB(e,t,i){e=(e%360+360)%360/360;let n=0,s=0,a=0;if(0===t)n=s=a=i;else{const o=6*(e-Math.floor(e)),r=o-Math.floor(o),l=i*(1-t),h=i*(1-t*r),c=i*(1-t*(1-r));switch(Math.trunc(o)){case 0:n=i,s=c,a=l;break;case 1:n=h,s=i,a=l;break;case 2:n=l,s=i,a=c;break;case 3:n=l,s=h,a=i;break;case 4:n=c,s=l,a=i;break;case 5:n=i,s=l,a=h}}return[n,s,a]}static mix(t,i,n){return new e(Rt(t.r,i.r,n),Rt(t.g,i.g,n),Rt(t.b,i.b,n),Rt(t.a,i.a,n))}static lighten(t,i){const n=e.RGBtoOKLCH(t.r,t.g,t.b);return e.fromOKLCH(Ge(0,n[0]+i,1),n[1],n[2])}static darken(t,i){const n=e.RGBtoOKLCH(t.r,t.g,t.b);return e.fromOKLCH(Ge(0,n[0]-i,1),n[1],n[2])}static interpolate(t,i){const n=1/(t.length-1),s=t.map((t=>e.RGBtoOKLCH(t.r,t.g,t.b)));return Array.from({length:i},((a,o)=>{const r=o/(i-1),l=t.length<=2?0:Math.min(Math.floor(r*(t.length-1)),t.length-2),h=(r-l*n)/n,c=s[l],d=s[l+1];return e.fromOKLCH(Rt(c[0],d[0],h),Rt(c[1],d[1],h),Rt(c[2],d[2],h))}))}};return e.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","#F
1FEFD5"],["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"]]),e})();function $t(e){return null!=e}function Ht(e){return Array.isArray(e)}function jt(e){return"boolean"==typeof e}function Wt(e){return e instanceof Date}function _t(e){return Wt(e)&&!Number.isNaN(Number(e))}function Gt(e){return e instanceof RegExp}function Kt(e){return"function"==typeof e}function Yt(e){return"object"==typeof e&&null!==e&&!Ht(e)}function Ut(e){return Ht(e)||Xt(e)}function Xt(e){return"object"==typeof e&&null!==e&&"Object"===e.constructor?.name}function Zt(e){if("object"!=typeof e||null===e)return!1;for(const t in e)return!1;return!0}function qt(e){return"string"==typeof e}function Qt(e){return"number"==typeof e}function Jt(e){return Number.isFinite(e)}function ei(e){return"bigint"==typeof e}function ti(e){return"number"==typeof e||"bigint"==typeof e}function ii(e){return"bigint"==typeof e||Number.isFinite(e)}function ni(e){return null!=e&&1===e.nodeType&&"style"in e}function si(e,t){return qt(t)&&Object.keys(e).includes(t)}function ai(e,t){return Object.values(e).includes(t)}function oi(e){return"symbol"==typeof e}function ri(e){return qt(e)&&("none"===e||!zt(e)&&null!=It(e))}function li(e,t){return e in t}var hi=new Set(["serif","sans-serif","monospace","cursive","fantasy","system-ui","ui-serif","ui-sans-serif","ui-monospace","ui-rounded","emoji","math","fangsong"]),ci=new Map;function di({fontSize:e,fontStyle:t,fontWeight:i,fontFamily:n}){let s="";
1return t&&"normal"!==t&&(s+=`${t} `),i&&"normal"!==i&&400!==i&&(s+=`${700===i?"bold":i} `),s+=`${e}px`,s+=` ${function(e){if(!e)return"";const t=ci.get(e);if(void 0!==t)return t;const i=e.split(",").map((e=>{const t=e.trim();return t?t.startsWith('"')||t.startsWith("'")||hi.has(t)?t:/\s/.test(t)?`"${t}"`:t:t})).join(", ");return ci.size>=256&&ci.clear(),ci.set(e,i),i}(n)}`,s}function ui(e,t=1.15){return Math.round(e*t)}function pi(e){return String(e??"")}function gi(e){return Qt(e)||Wt(e)?pi(e):e}function mi(e){return fi(e.replace(Mt,""))+bt}var yi=new Set([1575,1577,1583,1584,1585,1586,1608]);function fi(e){if(!e)return e;const t=e.codePointAt(e.length-1);return(i=t)>=1568&&i<=1610&&!yi.has(i)?e+"â":e;var i}var xi=/[\u0590-\u065F\u066D-\u06EF\u06FA-\u08FF\uFB1D-\uFDFF\uFE70-\uFEFF\u200F\u202B\u202E\u2067]/u,bi=/[\p{L}\u200E\u202A\u202D\u2066]/u;function vi(e){return!xi.test(e)&&!bi.test(e)}var Si=/\p{Nd}/u,Mi=`(?:${/\p{Sc}\s?/u.source})?${/\p{Nd}+(?:[.,:'\u2019/\u066B\u066C\u00A0\u202F]\p{Nd}+)*(?:[eE][+\-\u2212]?\p{Nd}+)?/u.source}(?:${/[%\u066A\u2030\u00B0]|\p{Sc}/u.source})?(?:${/[A-Za-z\u00B5\u03BC]+/u.source})?`,ki=new RegExp(`(?:${/[+\-\u2212]\s?/u.source})?${Mi}(?:${/\s?[-\u2012-\u2015\u2212]\s?/u.source}${Mi})*`,"gu");function Di(e){return Si.test(e)?e.replace(ki,((t,i)=>function(e,t){for(let i=t-1;i>=0;i-=1){const t=e[i];if(xi.test(t))return!1;if(bi.test(t))return!0}return!1}(e,i)?t:kt+t+Dt)):e}function wi(e,t){return t||xi.test(e)?Di(e):e}function Ii(e){return St+e+St}function Ai(e){return e.replaceAll(St,"")}function Ci(e){return Ht(e)?Li(e.at(-1)):Ni(pi(e))}function Ni(e){return e.endsWith(bt)}function Li(e){return!(!e||"image"===e.type)&&pi(e.text).endsWith(bt)}var Pi=(()=>"undefined"!=typeof Intl&&"function"==typeof Intl.Segmenter?new Intl.Segmenter(void 0,{granularity:"grapheme"}):void 0)();function Ti(e){return function(e){for(let t=0;t<e.length;t++){const i=e.charCodeAt(t);if(i<32||i>126)return!1}return!0}(e)?e.split(""):Pi?Array.from(Pi.segment(e),(e=>e.segment)):Array.from(e)}function Oi(e,t){switch(e){case"start":return t?"right":"left";case"end":return t?"left":"right";default:return e}}function Ri(e,t="and",i=String,n=1/0){if(0===e.length)return"";if(1===e.length)return i(e[0]);const s=(e=e.map(i)).pop();if(e.length>=n){const i=e.length-(n-1);return`${e.slice(0,n-1).join(", ")}, and ${i} more ${t} ${s}`}return`${e.join(", ")} ${t} ${s}`}function Ei(e,t=1/0){if("number"==typeof e){if(Number.isNaN(e))return"NaN";if(e===1/0)return"Infinity";if(e===-1/0)return"-Infinity"}else if("bigint"==typeof e)return`${e}`;const i=JSON.stringify(e)??typeof e;return i.length>t?`${i.slice(0,t)}... (+${i.length-t} characters)`:i}function zi(e){let t=1;for(let i=0;i<e.length;i++)10===e.codePointAt(i)&&t++;return t}function Bi(e,t){if(e===t)return 0;const[i,n]=e.length<t.length?[e,t]:[t,e],s=i.length,a=n.length;let o=new Array(s+1).fill(0).map(((e,t)=>t)),r=new Array(s+1);for(let e=1;e<=a;e++){r[0]=e;for(let t=1;t<=s;t++){const s=n[e-1]===i[t-1]?0:1;r[t]=Math.min(o[t]+1,r[t-1]+1,o[t-1]+s)}[o,r]=[r,o]}return o[s]}function Fi(e){return e.replaceAll(Vi,((e,t)=>(t>0?"-":"")+e.toLowerCase()))}var Vi=/[A-Z]+(?![a-z])|[A-Z]/g;function $i(e,t=""){return null==e?t:Ht(e)?e.map((e=>"image"===e.type?e.alt??"":pi(e.text))).join(""):qt(e)?e:String(e)}function Hi(e,t=0,i){const{leading:n=!1,trailing:s=!0,maxWait:a=1/0}=i??{};let o,r;if(a<t)throw new Error("Value of maxWait cannot be lower than waitMs.");return Object.assign((function(...i){if(n&&!r)return r=Date.now(),o=setTimeout((()=>r=null),t),void e(...i);let l=t;if(a!==1/0&&r){const e=Date.now()-r;t>a-e&&(l=a-e)}clearTimeout(o),r??(r=Date.now()),o=setTimeout((()=>{r=null,s&&e(...i)}),l)}),{cancel(){clearTimeout(o),r=null}})}function ji(e,t,i){const{leading:n=!0,trailing:s=!0}=i??{};let a,o,r=!1;function l(){s&&o?(a=setTimeout(l,t),e(...o)):r=!1,o=null}return Object.assign((function(...i){r?o=i:(r=!0,a=setTimeout(l,t),n?e(...i):o=i)}),{cancel(){clearTimeout(a),r=!1,o=null}})}function Wi(e,t,i,n=""){try{return e(...t)}catch(e){const t=n?` \`${n}\``:"";i?.warnOnce(`Uncaught exception in user callback${t}`,e)}}var _i=Symbol("description"),Gi=Symbol("required"),Ki=Symbol("marked"),Yi=Symbol("undocumented"),Ui=Symbol("deprecated"),Xi=Symbol("enterprise"),Zi=Symbol("deprecatedValue"),qi=Symbol("union"),Qi=e=>Yt(e)&&Zi in e,Ji=new WeakMap,en=[["placement","position"],["padding","spacing","gap"],["color","fill","stroke"],["whisker","wick"],["src","url"],["
1width","thickness"],["show","visible","enabled"],["value","range"]].reduce(((e,t)=>{for(const i of t)e.set(i.toLowerCase(),new Set(t.filter((e=>e!==i))));return e}),new Map),tn=(e=>(e.Enterprise="enterprise",e.Invalid="invalid",e.Required="required",e.Unknown="unknown",e))(tn||{});function nn(e,t){return Jt(t)?`${e}[${t}]`:e?`${e}.${t}`:t}var sn=class{constructor(e,t,i,n,s){this.type=e,this.description=t,this.value=i,this.path=n,this.key=s}setUnionType(e,t){if(this.path.startsWith(t)){const i=this.path.slice(t.length);this.altPath=`${t}[type=${e}]${i}`}}getPrefix(){const{altPath:e=this.path,key:t}=this;return e||t?`Option \`${t?nn(e,t):e}\``:"Value"}toString(){const{description:e="unknown",type:t,value:i}=this;return"required"===t&&null==i?`${this.getPrefix()} is required and has not been provided; expecting ${e}, ignoring.`:"enterprise"===t?`${this.getPrefix()} is an AG Charts Enterprise feature; ignoring.`:`${this.getPrefix()} cannot be set to \`${Ei(i,50)}\`; expecting ${e}, ignoring.`}},an=class extends sn{constructor(e,t,i,n){super("unknown",void 0,t,i,n),this.suggestions=e,this.key=n}getPrefix(){return`Unknown option \`${nn(this.altPath??this.path,this.key)}\``}getPostfix(){const e=Ri(function(e,t,i=2){const n=e.toLowerCase(),s=en.get(n);return t.filter((e=>{const t=e.toLowerCase();return!0===s?.has(e)||t.includes(n)||Bi(n,t)<=i}))}(this.key,this.suggestions),"or",(e=>`\`${e}\``));return e?`; Did you mean ${e}? Ignoring.`:", ignoring."}toString(){return`${this.getPrefix()}${this.getPostfix()}`}};function on(e,t,i="",n){if(!Yt(e))return{cleared:null,invalid:[new sn("required","an object",e,i)]};const s={},a=[],o=new Set(Object.keys(e)),r=[],l=!0===n.skipDisabledNodeValidation&&!1===e.enabled;let h=Ji.get(t);void 0===h&&(h=Object.keys(t),Ji.set(t,h));const c=t;if(qi in t){const o=h,r=t[qi];if(null!=e.type&&o.includes(e.type)||null==e.type&&null!=r){const{type:t=r,...o}=e,l=on(o,c[t],i,n);Object.assign(s,{type:t},l.cleared);for(const e of l.invalid)e.setUnionType(t,i);a.push(...l.invalid)}else if(l)Object.assign(s,{enabled:!1});else{const t=Ri(o,"or",(e=>`'${e}'`));a.push(new sn("required",`a keyword such as ${t}`,e.type,i,"type"))}return{cleared:s,invalid:a}}for(const c of h){const h=t[c],d=h[Gi],u=e[c];if(o.delete(c),void 0===u&&(h[Yi]||r.push(c),!d||l))continue;const p=nn(i,c);if(Kt(h)){const t=h(u,{options:e,path:p,params:n});if("object"==typeof t){if(a.push(...t.invalid),t.valid){s[c]=t.cleared;continue}if(Qn(t.invalid,p))continue}else if(t){s[c]=u;continue}a.push(new sn(d?"required":"invalid",h[_i],u,i,c))}else{const e=on(u,h,p,n);null!=e.cleared&&(s[c]=e.cleared),a.push(...e.invalid)}}for(const t of o){const n=e[t];void 0!==n&&a.push(new an(r,n,i,t))}return{cleared:s,invalid:a}}function rn(e,t){if(Kt(e)){let i=function(t,i){return e(t,i)};return i[_i]=t,i}return{...e,[_i]:t}}function ln(e){if(e[Xi])throw new Error("`required()` cannot wrap an `enterprise()` validator; enterprise options must remain optional.");return Object.assign(Kt(e)?(t,i)=>e(t,i):pn(e),{[Gi]:!0,[_i]:e[_i]})}function hn(e){return Object.assign(Kt(e)?(t,i)=>e(t,i):pn(e),{[Yi]:!0,[_i]:e[_i]})}function cn(e){if(e[Gi])throw new Error("`enterprise()` cannot wrap a `required()` validator; enterprise options must remain optional.");const t=Kt(e)?e:pn(e),i=e[_i];return Object.assign(((e,n)=>void 0===e||be()?t(e,n):(n.params.logger.warnOnce(new sn("enterprise",i,e,n.path).toString()),{valid:!0,cleared:null,invalid:[]})),{[Xi]:!0,[_i]:i})}function dn(e,t){const i=Kt(e)?e:pn(e),n=e[_i];return Object.assign(((e,n)=>{if(void 0!==e&&!n.params?.silentAdvisories){const e=`Option \`${n.path}\` is deprecated. ${t}`;n.params.logger.deprecationOnce(e)}return i(e,n)}),{[Ui]:t,[_i]:n})}function un(e,t){return{[Zi]:t,value:e}}var pn=(e,t="an object",i=!1)=>rn(((t,n)=>{const s=on(t,e,n.path,n.params),a=!Qn(s.invalid,n.path);return{valid:a,cleared:a||!i?s.cleared:null,invalid:s.invalid}}),t),gn=(e,t,i)=>({...e,[_i]:t,[qi]:i}),mn=(...e)=>rn(((t,i)=>{const n=[];for(const s of e){const e=s(t,i);if("object"==typeof e){if(n.push(...e.invalid),!e.valid)return{valid:!1,cleared:t,invali
1d:n};t=e.cleared}else if(!e)return!1}return{valid:!0,cleared:t,invalid:n}}),Ri(e.filter((e=>!e[Yi])).map((e=>e[_i])).filter($t),"and")),yn=(...e)=>rn(((t,i)=>{for(const n of e){const e=n(t,i);if("object"==typeof e?e.valid:e)return e}return!1}),Ri(e.filter((e=>!e[Yi])).map((e=>e[_i])).filter($t),"or")),fn=e=>ii(e)||_t(e),xn=e=>Wt(e)||(Jt(e)||qt(e))&&_t(new Date(e)),bn=rn(Ht,"an array"),vn=rn(jt,"a boolean"),Sn=rn(Kt,"a function"),Mn=rn(ri,"a supported color string (hex, rgb(), hsl(), oklch() or a CSS color name)"),kn=rn(xn,"a date"),Dn=rn($t,"a defined value"),wn=rn(Jt,"a number"),In=rn(ii,"a number or bigint"),An=rn(Yt,"an object"),Cn=rn(qt,"a string"),Nn=rn(ni,"an html element"),Ln=(e,t=1/0)=>{let i;return i=t===1/0?`an array of at least ${e} items`:e===t?`an array of exactly ${e} items`:0===e?`an array of no more than ${t} items`:`an array of at least ${e} and no more than ${t} items`,rn((i=>Ht(i)&&i.length>=e&&i.length<=t),i)},Pn=(e,t=1/0)=>{let i;return i=t===1/0?`a string of at least ${e} characters`:e===t?`an string of exactly ${e} characters`:0===e?`an string of no more than ${t} characters`:`an string of at least ${e} and no more than ${t} characters`,rn((i=>qt(i)&&i.length>=e&&i.length<=t),i)},Tn=(e,t=!0)=>rn((i=>Jt(i)&&(i>e||t&&i===e)),`a number greater than ${t?"or equal to ":""}${e}`),On=(e,t)=>rn((i=>Jt(i)&&i>=e&&i<=t),`a number between ${e} and ${t} inclusive`),Rn=Tn(0),En=Tn(0,!1),zn=rn((e=>Jt(e)&&Number.isInteger(e)&&e>=0),"a non-negative integer"),Bn=rn((e=>ii(e)&&e>=0),"a number or bigint greater than or equal to 0"),Fn=rn((e=>ii(e)&&e>0),"a number or bigint greater than 0"),Vn=On(0,1),$n=e=>rn(((t,{options:i})=>!fn(t)||!fn(i[e])||t<i[e]),`the value to be less than \`${e}\``),Hn=e=>rn(((t,{options:i})=>!fn(t)||!fn(i[e])||t<=i[e]),`the value to be less than or equal to \`${e}\``),jn=e=>rn(((t,{options:i})=>!fn(t)||!fn(i[e])||t>i[e]),`the value to be greater than \`${e}\``);function Wn(...e){Yt(e[0])&&!Qi(e[0])&&(e=Object.values(e[0]));const t=new Map,i=e.map((e=>Qi(e)?(t.set(e.value,e[Zi]),e.value):e)),n=Ri(i.filter((e=>!t.has(e))),"or",(e=>`'${e}'`));return 0===t.size?rn((e=>i.includes(e)),`a keyword such as ${n}`):rn(((e,n)=>{if(!i.includes(e))return!1;const s=t.get(e);if(null!=s&&!n.params?.silentAdvisories){const t=`Value \`${Ei(e)}\` of option \`${n.path}\` is deprecated. ${s}`;n.params.logger.deprecationOnce(t)}return!0}),`a keyword such as ${n}`)}function _n(...e){const t=Wn(...e);return yn(t,rn(mn(Un(t),Ln(1)),"a non-empty array containing these keywords"))}function Gn(){return Wn}var Kn=e=>rn((t=>e===t),`the value ${JSON.stringify(e)}`),Yn=(e,t)=>rn((t=>t instanceof e),t??`an instance of ${e.name}`),Un=(e,t,i=!0)=>rn(((t,n)=>{if(!Ht(t))return!1;let s=i;const a=[],o=[],r=e=>{s=i?s&&e:s||e};if(0===t.length)return{valid:!0,cleared:a,invalid:o};for(let i=0;i<t.length;i++){const s=t[i],l=e(s,{options:s,path:`${n.path}[${i}]`,params:n.params});"object"==typeof l?(r(l.valid),o.push(...l.invalid),null!=l.cleared&&a.push(l.cleared)):(r(l),l&&a.push(s))}return{valid:s,cleared:s||!i?a:null,invalid:o}}),t??`${e[_i]} array`),Xn=(e,t="an object array")=>rn(((t,i)=>{if(!Ht(t))return!1;const n=[],s=[];for(let a=0;a<t.length;a++){const o=`${i.path}[${a}]`,r=on(t[a],e,o,i.params);Qn(r.invalid,o)||n.push(r.cleared),s.push(...r.invalid)}return{valid:!0,cleared:n,invalid:s}}),t),Zn=(e,t)=>rn(((i,n)=>{if(!Kt(i))return!1;if(Ki in i)return!0;const s=t??e[_i];return{valid:!0,cleared:Object.assign(((...t)=>{const a=Wi(i,t,n.params.logger,n.path);if(null==a)return;const o=e(a,{options:a,path:"",params:n.params});if("object"==typeof o){if(Jn(o,n,s),o.valid)return o.cleared}else{if(o)return a;n.params.logger.warnOnce(`Callback \`${n.path}\` returned an invalid value \`${Ei(a,50)}\`; expecting ${s}, ignoring.`)}}),{[Ki]:!0}),invalid:[]}}),"a function"),qn=(e,t="an object")=>rn(((i,n)=>{if(!Kt(i))return!1;if(Ki in i)return!0;const s=t;return{valid:!0,cleared:Object.assign(((...t)=>{const a=Wi(i,t,n.params.logger,n.path);if(null==a)return;const o=on(a,e,n.path,n.params);return Jn(o,n,s),o.cleared}),{[Ki]:!0}),invalid:[]}}),"a function");function Qn(e,t){return e.some((e=>"required"===e.type&&e.path===t))}function Jn(e,t,i){if(0!==e.invalid.length)for(const n of e.invali
1d){if(n instanceof an)return t.params.logger.warnOnce(`Callback \`${t.path}\` returned an unknown property \`${nn(n.path,n.key)}\`${n.getPostfix()}`);const e=Ei(n.value,50);t.params.logger.warnOnce(n.key?`Callback \`${t.path}\` returned an invalid property \`${nn(n.path,n.key)}\`: \`${e}\`; expecting ${n.description}, ignoring.`:`Callback \`${t.path}\` returned an invalid value \`${e}\`; expecting ${i??n.description}, ignoring.`)}}var es=/^(?:(.)?([<>=^]))?([+\-( ])?([$â¬Â£Â¥â£â¹#])?(0)?(\d+)?(,)?(?:\.(\d+))?(~)?([%a-z])?$/i,ts=/^((?:[^#]|#[^{])*)#{([^}]+)}(.*)$/;function is(e){if(!qt(e))return!1;const t=ts.exec(e);return es.test(t?t[2]:e)}function ns(e){let t,i;const n=ts.exec(e);n&&([,t,e,i]=n);const s=es.exec(e);if(!s)return void X(`The number formatter is invalid: ${e}`);const[,a,o,r,l,h,c,d,u,p,g]=s;return{fill:a,align:o,sign:r,symbol:l,zero:h,width:Number.parseInt(c),comma:d,precision:Number.parseInt(u),trim:Boolean(p),type:g,prefix:t,suffix:i}}function ss(e){const t="string"==typeof e?ns(e):e;if(null==t)return;const{fill:i,align:n,sign:s="-",symbol:a,zero:o,width:r,comma:l,type:h,prefix:c="",suffix:d="",precision:u}=t;let{trim:p}=t;const g=null==u||Number.isNaN(u);let m;if(h)if(h in os&&h in as)m=g?as[h]:os[h];else if(h in os)m=os[h];else{if(!(h in as))throw new Error(`The number formatter type is invalid: ${h}`);m=as[h]}else m=os.g,p=!0;const y=h?6:12;let f;g||(f=u);let x=n,b=i;return o&&(b??(b="0"),x??(x="=")),(e,t)=>{if("bigint"==typeof e)return`${c}${e.toLocaleString("en-US")}${d}`;let i;i=null!=f?f:"f"===h||"%"===h?t??y:h?y:t??y;let n=m(e,i);p&&(n=function(e){if(!e.endsWith("0")||!e.includes("."))return e;let t=e.length-1;for(;t>0;){if("0"!=e[t]){if("."==e[t]){t-=1;break}break}t-=1}return e.substring(0,t+1)}(n)),l&&(n=function(e,t){let i=e.indexOf(".");i<0&&(i=e.length);const n=e.substring(0,i).split(""),s=e.substring(i);for(let e=n.length-3;e>0;e-=3)n.splice(e,0,t);return`${n.join("")}${s}`}(n,l));const o=function(e,t){if("#"===e)switch(t){case"b":return"0b";case"o":return"0o";case"x":return"0x";case"X":return"0X";default:return""}return e??""}(a,h),u=o?.length??0;o&&(n=`${o}${n}`),"s"===h&&(n=`${n}${function(e){return hs[ds(e)]}(e)}`),"%"!==h&&"p"!==h||(n=`${n}%`);const{value:g,prefixLength:v}=function(e,t,i=""){if("("===i)return e>=0?{value:t,prefixLength:0}:{value:`(${t})`,prefixLength:1};let n="";e<0?n="â":"+"===i?n="+":" "===i&&(n=" ");return{value:`${n}${t}`,prefixLength:n.length}}(e,n,s),S=v+u;let M=g;return null==r||Number.isNaN(r)||(M=function(e,t,i=" ",n=">",s=0){const a=t-e.length;if(a<=0)return e;const o=i.repeat(a);if("="===n){const t=Math.min(Math.max(s,0),e.length);return`${e.slice(0,t)}${o}${e.slice(t)}`}if(">"===n||!n)return o+e;if("<"===n)return`${e}${o}`;if("^"===n){const t=Math.ceil(a/2),n=Math.floor(a/2);return`${i.repeat(t)}${e}${i.repeat(n)}`}return o+e}(M,r,b??" ",x,S)),M=`${c}${M}${d}`,M}}var as={b:e=>cs(e).toString(2),c:e=>String.fromCodePoint(e),d:e=>Math.round(Math.abs(e)).toFixed(0),o:e=>cs(e).toString(8),x:e=>cs(e).toString(16),X:e=>as.x(e).toUpperCase(),n:e=>as.d(e),"%":e=>`${cs(100*e).toFixed(0)}`},os={e:(e,t)=>Math.abs(e).toExponential(t),E:(e,t)=>os.e(e,t).toUpperCase(),f:(e,t)=>Math.abs(e).toFixed(t),F:(e,t)=>os.f(e,t).toUpperCase(),g:(e,t)=>{if(0===e)return"0";const i=Math.abs(e),n=Math.floor(Math.log10(i));return n>=-4&&n<t?i.toFixed(t-1-n):i.toExponential(t-1)},G:(e,t)=>os.g(e,t).toUpperCase(),n:(e,t)=>os.g(e,t),p:(e,t)=>os.r(100*e,t),r:(e,t)=>{if(0===e)return"0";const i=Math.abs(e),n=Math.floor(Math.log10(i))-(t-1);if(n<=0)return i.toFixed(-n);const s=10**n;return(Math.round(i/s)*s).toFixed()},s:(e,t)=>{const i=ds(e);return os.r(e/10**i,t)},"%":(e,t)=>os.f(100*e,t)},rs=-24,ls=24,hs={[rs]:"y",[-21]:"z",[-18]:"a",[-15]:"f",[-12]:"p",[-9]:"n",[-6]:"µ",[-3]:"m",0:"",3:"k",6:"M",9:"G",12:"T",15:"P",18:"E",21:"Z",[ls]:"Y"};function cs(e){return Math.floor(Math.abs(e))}function ds(e){return Ge(-24,e?3*Math.floor(Math.log10(Math.abs(e))/3):0,24)}var us=e=>{if(!Yt(e))return!1;const t=Object.keys(e);return 1===t.length&&t[0].startsWith("$")},ps=Wn("accentColor","axisLineColor","backgroundColor","borderColor","borderRadius","chartBackgroun
1dColor","chartPadding","focusShadow","foregroundColor","fontFamily","fontSize","fontWeight","gridLineColor","popupShadow","subtleTextColor","textColor","chromeBackgroundColor","chromeFontFamily","chromeFontSize","chromeFontWeight","chromeTextColor","chromeSubtleTextColor","buttonBackgroundColor","buttonBorder","buttonFontWeight","buttonTextColor","inputBackgroundColor","inputBorder","inputTextColor","menuBackgroundColor","menuBorder","menuTextColor","panelBackgroundColor","panelSubtleTextColor","tooltipBackgroundColor","tooltipBorder","tooltipTextColor","tooltipSubtleTextColor","crosshairLabelBackgroundColor","crosshairLabelTextColor","groupedCategoryLineColor");var gs=rn(pn({ref:ps,mix:Rn,onto:ps,ontoColor:rn((e=>"string"==typeof e&&(function(e){if(!e.startsWith("var(--")||!e.endsWith(")"))return!1;let t=0;for(let i=3;i<e.length;i++)if("("===e[i])t++;else if(")"===e[i]&&0==--t)return i===e.length-1;return!1}(e)||Vt.validColorString(e))),"a literal color or var()")}),"a color ref"),ms=mn(gs,rn((e=>!Yt(e)||!("onto"in e||"ontoColor"in e)||"mix"in e),"where a color ref with [onto] or [ontoColor] must also have [mix]")),ys=yn(Mn,us,ms),fs=pn({color:ys,stop:Vn},""),xs=rn((e=>{let t=-1/0;for(const i of e)if(null!=i?.stop){if(i.stop<t)return!1;t=i.stop}return!0}),"colour stops to be defined in ascending order"),bs=mn(Ln(2),Un(fs),xs),vs=pn({color:ln(ys),stop:In,name:Cn},"a color scale color stop"),Ss=pn({fills:mn(Ln(2),Un(vs),xs),domain:mn(Ln(2),Un(In),rn((e=>e[0]<=e[1]),"domain to be in ascending order")),mode:Wn("continuous","discrete"),missingDataFill:ys},"a colour scale configuration"),Ms=Wn("axis","item","series"),ks=pn((()=>({type:ln(Kn("gradient")),colorStops:ln(bs),rotation:wn,gradient:hn(Wn("linear","radial","conic")),bounds:hn(Ms),reverse:hn(vn),colorSpace:hn(Wn("rgb","oklch"))}))(),"a gradient object with colour stops"),Ds={stroke:ys,strokeWidth:Rn,strokeOpacity:Vn},ws=pn({type:ln(Kn("gradient")),gradient:ln(Wn("linear","radial","conic")),bounds:ln(Ms),colorStops:ln(yn(bs,mn(Ln(2),Un(ys)))),rotation:ln(wn),reverse:ln(vn),colorSpace:ln(Wn("rgb","oklch"))}),Is=pn({type:ln(Kn("pattern")),pattern:ln(Wn("vertical-lines","horizontal-lines","forward-slanted-lines","backward-slanted-lines","circles","squares","triangles","diamonds","stars","hearts","crosses")),path:Pn(2),width:ln(Rn),height:ln(Rn),fill:ln(ys),fillOpacity:ln(Vn),backgroundFill:ln(ys),backgroundFillOpacity:ln(Vn),padding:ln(Rn),rotation:ln(wn),scale:ln(Rn),stroke:ln(ys),strokeWidth:ln(Rn),strokeOpacity:ln(Vn)}),As=pn({type:ln(Kn("image")),url:Cn,width:Rn,height:Rn,rotation:ln(wn),backgroundFill:ln(ys),backgroundFillOpacity:Vn,fit:ln(Wn("stretch","contain","cover")),repeat:ln(Wn("repeat","repeat-x","repeat-y","no-repeat"))}),Cs=gn((()=>({gradient:{colorStops:bs,rotation:wn,gradient:hn(Wn("linear","radial","conic")),bounds:hn(Ms),reverse:hn(vn),colorSpace:hn(Wn("rgb","oklch"))},pattern:{pattern:Wn("vertical-lines","horizontal-lines","forward-slanted-lines","backward-slanted-lines","circles","squares","triangles","diamonds","stars","hearts","crosses"),path:Pn(2),width:Rn,height:Rn,rotation:wn,scale:Rn,fill:ys,fillOpacity:Vn,backgroundFill:ys,backgroundFillOpacity:Vn,...Ds,padding:hn(Rn)},image:{url:ln(Cn),backgroundFill:ys,backgroundFillOpacity:Vn,width:Rn,height:Rn,fit:Wn("stretch","contain","cover","none"),repeat:Wn("repeat","repeat-x","repeat-y","no-repeat"),rotation:wn}}))(),"a color object"),Ns=yn(Mn,pn(Cs,"a color object"),us,ms),Ls=yn(Mn,pn(Cs,"a color object")),Ps={fill:Ns,fillOpacity:Vn};Ps.fillGradientDefaults=hn(ws),Ps.fillPatternDefaults=hn(Is),Ps.fillImageDefaults=hn(As);var Ts={fill:ys,fillOpacity:Vn},Os=(()=>({lineDash:Un(Rn),lineDashOffset:wn}))(),Rs={...Ps,...Ds,...Os,opacity:Vn,cornerRadius:Rn},Es={...Ds,...Os,opacity:Vn},zs={...Ps,...Ds,...Os,opacity:Vn},Bs=zs,Fs=Gn()("any","all");function Vs(e){return{enabled:vn,range:Wn("tooltip","node"),highlightedItem:e,unhighlightedItem:e}}function $s(e){return{enabled:vn,containment:Fs,selectedItem:e,unselectedItem:e,unselectedSeries:e}}function Hs(e,t){return{enabled:vn,range:Wn("tooltip","node"),highlightedItem:e,unhighlightedItem:e,highlightedSeries:t,unhighlightedSeries:t,bringToFront:vn}}var js={start:Dn,stop:Dn,...Ds,...Ps,...Os},Ws={start:Dn,stop:Dn,...Ds,...Os},_s=pn({enabled:vn,key:ln(Wn("x","y")),segments:Xn(js,"path segments array")},"a segmentation object",!0),Gs=pn({enabled:vn,key:ln(Wn("x","y")),segments:Xn(Ws,"path segments array")},"a segmentation object",!0),Ks=pn({googleFont:Cn},"google font"),Ys=yn(Cn,us,Ks,Un(yn(Cn,Ks))),Us=yn(Rn,Wn("normal","bold","bolder","lighter")),Xs=(()=>({color:ys,fontFamily:Ys,fontSize:Rn,fontStyle:Wn("normal","italic","oblique"),fontWeight:Us}))(),Zs=Wn("never","always","hyphenate","on-space"),qs=Wn("left","center","right","start","end"),Qs=Wn("top","middle","bottom"),Js=Wn("ellipsis","hide"),ea=pn({top:Rn,right:Rn,bottom:Rn,left:Rn},"padding object"),ta=yn(Rn,ea),ia=pn({top:wn,right:wn,bottom:wn,left:wn},"padding object"),na=yn(wn,ia),sa={enabled:vn,stroke:ys,strokeWidth:Rn,strokeOpacity:Vn},aa={border:sa,cornerRadius:wn,padding:ta,...Ps},oa=["top","top-right","top-left","bottom","bottom-right","bottom-left","right","right-top","right-bottom","left","left-top","left-bottom"],ra=(()=>({floating:vn,placement:Wn(...oa),xOffset:wn,yOffset:wn}))(),la=rn(((e,t)=>{let i;if("string"==typeof e){oa.includes(e)?i=!0:(i={valid:!1,invalid:[],cleared:null},i.invalid.push(new sn("invalid",`a legend placement string: ["${oa.join('", "')}"]`,e,t.path)))}else{const{cleared:n,invalid:s}=on(e,ra,t.path,t.params);i={valid:0===s.length,cleared:n,invalid:s}}return i}),"a legend position object or placement string"),ha=yn(Wn("circle","cross","diamond","heart","plus","pin","square","star","triangle"),Sn),ca=_n("top","right","bottom","left","top-right","bottom-right","bottom-left","top-left","center"),da=yn(Rn,Wn("exact","nearest","area")),ua=yn(Rn,Wn("exact","nearest")),pa=Wn("baseline","top","middle","bottom"),ga=pn({type:Kn("text"),text:ln(Cn),verticalAlign:pa,lineHeight:Rn,minimumFontSize:mn(En,Hn("fontSize")),...Xs}),ma=pn({type:ln(Kn("image")),url:ln(Cn),width:ln(Rn),height:ln(Rn),alt:Cn,verticalAlign:pa,overflowStrategy:Wn("keep","hide"),padding:ta,cornerRadius:Rn,backgroundFill:Mn,block:vn}),ya=yn(Cn,In,kn,Un(yn(ga,ma),"text or image segments array",!1)),fa=(()=>({enabled:vn,text:ya,textAlign:qs,wrapping:Zs,spacing:Rn,maxWidth:Rn,maxHeight:Rn,minimumFontSize:mn(En,Hn("fontSize")),...Xs,...aa,tooltip:{visible:Wn("auto","always","never"),text:Cn,renderer:Zn(yn(Cn,wn,kn))},listeners:{click:Sn,doubleClick:Sn}}))();fa.truncate=hn(vn);var xa=(()=>({enabled:vn,text:ya,renderer:Zn(yn(Cn,wn,kn,Nn))}))(),ba=["defaults","download","zoom-to-cursor","pan-to-cursor","reset-zoom","toggle-series-visibility","toggle-other-series","separator"],va=(()=>({type:Gn()("action","separator"),showOn:Gn()("always","axis","caption","cross-line","series-area","series-node","legend-item"),label:ln(Cn),enabled:vn,action:Sn,items:(e,t)=>ka(e,t)}))();va.iconUrl=hn(Cn);var Sa=pn(va),Ma=rn(((e,t)=>{let i;if("string"==typeof e){ba.includes(e)?i=!0:(i={valid:!1,invalid:[],cleared:null},i.invalid.push(new sn("invalid",`a context menu item string alias: ["${ba.join('", "')}"]`,e,t.path)))}else i=Sa(e,t);return i}),`a context menu item object or string alias: [${ba.join(", ")}]`),ka=Un(Ma,"a menu items array",!1),Da=(()=>({label:Cn,ariaLabel:Cn,tooltip:Cn,iconPosition:Wn("before","after"),icon:Wn("align-center","align-left","align-right","arrow-drawing","arrow-down-drawing","arrow-up-drawing","callout-annotation","candlestick-series","chevron-filled-down","chevron-right","close","comment-annotation","date-range-drawing","date-price-range-drawing","delete","disjoint-channel-drawing","drag-handle","fill-color","line-style-solid","line-style-dashed","line-style-dotted","high-low-series","hlc-series","hollow-candlestick-series","horizontal-line-drawing","line-color","line-series","line-with-markers-series","locked","measurer-drawing","note-annotation","ohlc-series","pan-end","pan-left","pan-right","pan-start","parallel-channel-drawing","position-bottom","position-center","position-top","price-label-annotation","price-range-drawing","reset","settings","step-line-series","text-annotation","trend-line-drawing","fibonacci-retracement-drawing","fibonacci-retracement-trend-based-drawing","unlocked","vertical-line-drawing","zoom-in","zoom-out")}))(),wa=yn(Cn,Zn(ya)),Ia=pn({x:wa,y:wa,angle:wa,radius:wa,size:wa,color:wa,label:wa,secondaryLabel:wa,sectorLabel:wa,calloutLabel:wa,legendItem:wa}
1),Aa=rn(is,"a valid number format string"),Ca=Wn("millisecond","second","minute","hour","day","month","year"),Na=(()=>({unit:ln(Ca),step:En,epoch:kn,utc:vn}))();Na.every=Sn;var La=pn(Na,"a time interval object"),Pa=(()=>({enabled:vn,position:la,orientation:Wn("horizontal","vertical"),maxWidth:Rn,maxHeight:Rn,spacing:Rn,border:sa,cornerRadius:wn,padding:ta,fill:Ns,fillOpacity:Vn,preventHidingAll:vn,reverseOrder:vn,toggleSeries:vn,item:{marker:{size:Rn,shape:ha,padding:ta,strokeWidth:Rn,disabledStyle:{opacity:Vn,...Ps,...Ds}},line:{length:Rn,strokeWidth:Rn,disabledStyle:{opacity:Vn,stroke:ys,strokeOpacity:Vn,...Os}},label:{maxLength:Rn,formatter:Sn,...Xs,disabledStyle:{opacity:Vn,color:ys}},tooltip:{visible:Wn("auto","always","never"),text:Cn,renderer:Sn},maxWidth:Rn,padding:ta,showSeriesStroke:vn},pagination:{marker:{size:Rn,shape:ha,padding:ta},activeStyle:{...Ps,...Ds},inactiveStyle:{...Ps,...Ds},highlightStyle:{...Ps,...Ds},label:Xs},listeners:{legendItemClick:Sn,legendItemDoubleClick:Sn}}))(),Ta=(()=>({enabled:vn,position:la,spacing:Rn,reverseOrder:vn,border:sa,cornerRadius:wn,padding:ta,fill:Ns,fillOpacity:Vn,gradient:{preferredLength:Rn,thickness:Rn},scale:{label:{...Xs,minSpacing:Rn,format:Aa,formatter:Sn},padding:Rn,interval:{step:wn,values:bn,minSpacing:mn(Rn,$n("maxSpacing")),maxSpacing:mn(Rn,jn("minSpacing"))}}}))(),Oa=(()=>({width:Rn,height:Rn,minWidth:Rn,minHeight:Rn,suppressFieldDotNotation:vn,title:fa,subtitle:fa,footnote:fa,padding:yn(us,ta),seriesArea:{border:sa,clip:vn,cornerRadius:wn,padding:yn(us,ta)},legend:Pa,gradientLegend:Ta,listeners:{seriesNodeClick:Sn,seriesNodeDoubleClick:Sn,axisClick:Sn,axisDoubleClick:Sn,captionClick:Sn,captionDoubleClick:Sn,seriesVisibilityChange:Sn,activeChange:Sn,selectionChange:Sn,collapsedChange:Sn,click:Sn,doubleClick:Sn,crossLineClick:Sn,crossLineDoubleClick:Sn,annotations:Sn,zoom:Sn},loadGoogleFonts:vn,highlight:{enabled:vn,drawingMode:Wn("overlay","cutout"),range:Wn("tooltip","node"),mode:Wn("single","shared")},overlays:{loading:xa,noData:xa,noVisibleSeries:xa,unsupportedBrowser:xa},tooltip:{enabled:vn,showArrow:vn,pagination:vn,delay:Rn,range:da,wrapping:Zs,mode:Wn("single","shared","compact"),position:{anchorTo:Wn("pointer","node","chart"),placement:ca,xOffset:wn,yOffset:wn,offset:Rn}},animation:An,flashOnUpdate:An,contextMenu:An,context:()=>!0,dataSource:{getData:Sn},keyboard:{enabled:vn,tabIndex:wn,initialFocus:Gn()("data-start","data-end","viewport-start","viewport-end")},touch:{dragAction:Wn("none","drag","hover")},selection:An,ranges:{enabled:vn,enableOutOfRange:vn,position:Wn("top-left","top","top-right","bottom-left","bottom","bottom-right"),spacing:Rn,button:{...Ts,...Ds,textColor:ys,...Xs,cornerRadius:Rn,padding:ta,active:{...Ts,stroke:Ds.stroke,textColor:ys},disabled:{...Ts,stroke:Ds.stroke,textColor:ys},hover:{...Ts,stroke:Ds.stroke,textColor:ys}},dropdown:{visible:Wn("auto","always","never"),...Ts,...Ds,textColor:ys,...Xs,cornerRadius:Rn,padding:ta,active:{...Ts,stroke:Ds.stroke,textColor:ys},disabled:{...Ts,stroke:Ds.stroke,textColor:ys},hover:{...Ts,stroke:Ds.stroke,textColor:ys}},gap:Rn,...Ts,...Ds,textColor:ys,...Xs,cornerRadius:Rn,padding:ta,active:{...Ts,stroke:Ds.stroke,textColor:ys},disabled:{...Ts,stroke:Ds.stroke,textColor:ys},hover:{...Ts,stroke:Ds.stroke,textColor:ys},buttons:Xn({...Da,enabled:vn,value:yn(wn,mn(Un(yn(wn,kn)),Ln(2,2)),La,Ca,Sn)},"range button options array")},locale:{localeText:An,getLocaleText:Zn(Cn)},background:{visible:vn,fill:ys,image:{url:ln(Cn),top:wn,right:wn,bottom:wn,left:wn,width:Rn,height:Rn,opacity:Vn}},styleNonce:Cn,sync:An,zoom:An,scrollbar:An,formatter:yn(Zn(ya),Ia),enableRtl:vn}))();Oa.dataSource.requestThrottle=hn(Rn),Oa.dataSource.updateThrottle=hn(Rn),Oa.dataSource.updateDuringInteraction=hn(vn),Oa.statusBar=hn(Dn),Oa.ranges.minSize=hn(Rn),Oa.foreground=hn({visible:vn,text:Cn,image:{url:Cn,top:wn,right:wn,bottom:wn,left:wn,width:Rn,height:Rn,opacity:Vn},...Ps}),Oa.overrideDevicePixelRatio=hn(wn),Oa.displayNullData=hn(vn);var Ra=(()=>({cursor:Cn,context:()=>!0,showInLegend:vn,nodeClickRange:da,listeners:{seriesNodeClick:Sn,seriesNodeDoubleClick:Sn},highlight:Vs(zs),selection:$s(Bs)}))();Ra.allowNullKeys=hn(vn);var Ea={...Ra,id:Cn,visible:vn,context:()=>!0,data:bn};Ea.seriesGrouping=hn(Dn);var za={shape:ha,size:Rn,...Ps,...Ds,...Os},Ba=(()=>({enabled:vn,itemStyler:qn({...Ps,...Ds,...Os,shape:ha,size:Rn}),...za}
1))(),Fa=_n("inside","top","bottom","left","right","top-left","top-right","bottom-left","bottom-right"),Va=_n("horizontal","vertical","vertical-reversed"),$a={threshold:wn,alwaysShow:vn};$a.collideWith=hn({markers:vn,labels:vn,seriesItems:vn,seriesArea:vn});var Ha=(()=>({enabled:vn,formatter:Zn(ya),format:Aa,itemStyler:qn({enabled:vn,...aa,...Xs}),...aa,...Xs}))(),ja={maxWidth:Rn,maxHeight:Rn,wrapping:Zs,truncate:vn},Wa=(()=>({maxWidth:hn(Rn),maxHeight:hn(Rn),wrapping:hn(Zs),truncate:hn(vn)}))(),_a=(()=>({minimumFontSize:mn(En,Hn("fontSize"))}))(),Ga={...ja,collision:$a},Ka={color:ys,...aa},Ya={insideStyle:Ka,outsideStyle:Ka},Ua={...Ha,...Ga,..._a,...Ya,placement:Fa,spacing:Rn},Xa=(()=>({...Ha,lineHeight:Rn,minimumFontSize:mn(Rn,Hn("fontSize")),wrapping:Zs,overflowStrategy:Js}))(),Za={visible:vn,cap:{visible:vn,length:Rn,lengthRatio:Vn,...Ds,...Os},...Ds,...Os},qa=(()=>({...Za,xLowerKey:Cn,xUpperKey:Cn,yLowerKey:Cn,yUpperKey:Cn,xLowerName:Cn,xUpperName:Cn,yLowerName:Cn,yUpperName:Cn,itemStyler:qn({visible:vn,...Ds,...Os,cap:{visible:vn,length:Rn,lengthRatio:Vn,...Ds,...Os}})}))(),Qa=(()=>({enabled:vn,showArrow:vn,range:ua,renderer:Zn(yn(Cn,wn,kn,pn({heading:Cn,title:Cn,symbol:{marker:{enabled:vn,shape:ha,...Ps,stroke:ys,strokeOpacity:Vn,strokeWidth:Rn,...Os},line:{enabled:vn,stroke:ys,strokeWidth:Rn,strokeOpacity:Vn,...Os}},data:Xn({label:ln(Cn),value:ln(yn(Cn,wn,kn))})},"tooltip renderer result object"))),position:{anchorTo:Wn("node","pointer","chart"),placement:ca,xOffset:wn,yOffset:wn,offset:Rn},interaction:{enabled:vn}}))(),Ja={...Qa,range:da},eo={enabled:vn,xOffset:wn,yOffset:wn,blur:Rn,color:ys},to=gn({linear:{},smooth:{tension:Vn},step:{position:Wn("start","middle","end")}},"interpolation line options"),io=Symbol("BREAK"),no="__decorator_config",so="__decorator_accessors";function ao(e,t){oo(e,t).optional=!0}function oo(e,t){if(null==Object.getOwnPropertyDescriptor(e,no)&&Object.defineProperty(e,no,{value:{}}),null==Object.getOwnPropertyDescriptor(e,so)){const t=Object.getPrototypeOf(e)?.[so],i=t?.slice()??[];Object.defineProperty(e,so,{value:i})}const i=e[no],n=t.toString();if(null!=i[n])return i[n];i[n]={setters:[],getters:[],observers:[]};const s=Object.getOwnPropertyDescriptor(e,t);let a=s?.get,o=s?.set;if(null==a||null==o){const i=e[so];let n=i.indexOf(t);-1===n&&(n=i.push(t)-1),a??(a=function(){let e=this.__accessors;return null==e&&(e=i.slice().fill(void 0),Object.defineProperty(this,"__accessors",{value:e})),e[n]}),o??(o=function(e){let t=this.__accessors;null==t&&(t=i.slice().fill(void 0),Object.defineProperty(this,"__accessors",{value:t})),t[n]=e})}const r=i[n];return Object.defineProperty(e,t,{set:function(e){const i=r.setters,n=r.observers;let s;for(let e=0,t=i.length;e<t;e++)if(i[e].length>2){s=a.call(this);break}for(let n=0,a=i.length;n<a;n++)if((e=i[n](this,t,e,s))===io)return;o.call(this,e);for(let t=0,i=n.length;t<i;t++)n[t](this,e,s)},get:function(){const e=a.call(this),i=r.getters;if(0===i.length)return e;let n=e;for(let e=0,s=i.length;e<s;e++)if(n=i[e](this,t,n),n===io)return;return n},enumerable:!0,configurable:!1}),i[n]}function ro(e,t,i){return(n,s)=>{const a=oo(n,s);a.setters.push(e),t&&a.getters.unshift(t),i&&Object.assign(a,i)}}function lo(e){return(t,i)=>{oo(t,i).observers.push(e)}}function ho(e){return void 0!==e&&no in e}function co(e){const t=new Set;for(;ho(e);)t.add(e?.[no]),e=Object.getPrototypeOf(e);return Array.from(t).flatMap((e=>Object.keys(e)))}function uo(e){return co(e).reduce(((t,i)=>(t[String(i)]=e[i]??null,t)),{})}function*po(...e){for(const t of e)null!=t&&(t[Symbol.iterator]?yield*t:yield t)}function go(e){return null!=e&&"object"==typeof e&&Symbol.iterator in e?e:[e]}function mo(e){for(const t of e)return t;throw new Error("AG Charts - no first() value found")}function*yo(e){const t=[void 0,void 0];for(const i of Object.keys(e))t[0]=i,t[1]=e[i],yield t}function fo(e){return Object.keys(e)}function xo(e,t){return Array.isArray(e)?!!Array.isArray(t)&&(e.length===t.length&&e.every(((e,i)=>xo(e,t[i])))):Xt(e)?!!Xt(t)&&bo(e,t,xo):e===t}function bo(e,t,i){if(Object.is(e,t))return!0;for(const i of Object.keys(t))if(!(i in e))return!1;for(const n of Object.keys(e)){if(!(n in t))return!1;if(!i(e[n],t[n]))return!1}return!0}function vo(...e){return ko(e)}function So(...e){return ko(e,"$")}function Mo(e,t){return!0===Object.keys(e)[0]?.startsWith(t)}function ko(e,t){const i={};for(let n=0;n<e.length;n++){const s=e[n];if(!Yt(s))continue;const a=ho(s)?co(s):Object.keys(s);for(const e of a){const n=i[e],a=s[e];Xt(n)&&Xt(a)&&(null==t||!Mo(n,t)&&!Mo(a,t))?i[e]=ko([n,a],t):i[e]??(i[e]=a)}}return i}function Do(...e){const t={};for(const i of e){if(!Yt(i))continue;const e=ho(i)?co(i):Object.keys(i);for(const n of e)Xt(t[n])&&Xt(i[n])?t[n]=Do(t[n],i[n]):n in t||(t[n]??(t[n]=i[n]))}return t}function wo(e,...t){return t&&Ht(e)?e.map((e=>vo(e,...t))):e}function Io(e,t){const i={};for(const[n,s]of yo(e))i[n]=t(s,n,e);return i}function Ao(e,t){const i={...e};for(const e of t)delete i[e];return i}function Co(e,t){if(null==e)return;const i={};for(const n of t)Object.hasOwn(e,n)&&(i[n]=e[n]);return i}function No(e,t){if(null==e)return!0;for(const[i,n]of yo(e))if(!t(i,n))return!1;return!0}function Lo(e){const t={};if(null==e)return t;for(const[i,n]of e)t[i]=n;return t}function Po(e,t){return(Ht(t)?t:t.split(".")).reduce(((e,t)=>e?.[t]),e)}var To=new Set(["__proto__","constructor","prototype"]);function Oo(e,t,i){const n=Ht(t)?t.slice():t.split("."),s=n.pop();if(n.some((e=>To.has(e))))return;const a=n.reduce(((e,t)=>e[t]),e);return a[s]=i,a[s]}function Ro(e,t,i){if(void 0===i)return t;for(const n of e){const e=i[n];void 0!==e&&(t[n]=e)}return t}function Eo(e,t,i){const n=i??Object.keys(t);for(let i=0,s=n.length;i<s;i++){const s=n[i],a=t[s];e[s]!==a&&(e[s]=a)}return e}function zo(e){if(null==e||"object"!=typeof e||!Xt(e))return e;Object.freeze(e);for(const t of Object.getOwnPropertyNames(e)){const i=e[t];null===i||"object"!=typeof i&&"function"!=typeof i||Object.isFrozen(i)||zo(i)}return e}function Bo(e,t){return Xt(e)&&t in e}function Fo(e,t){return Bo(e,t)&&"string"==typeof e[t]}var Vo=(()=>({fills:mn(Ln(2),Un(pn({color:ys,stop:In},"")),xs),fillMode:Wn("continuous","discrete")}))(),$o=(()=>({value:ln(In),text:Cn,shape:yn(Wn("circle","cross","diamond","heart","plus","pin","square","star","triangle","line"),Sn),placement:Wn("before","after","middle"),spacing:Rn,size:Rn,rotation:wn,...Ps,...Ds,...Os}))(),Ho=(()=>({value:ln(In),text:Cn,shape:yn(Wn("circle","cross","diamond","heart","plus","pin","square","star","triangle","line"),Sn),placement:Wn("inside","outside","middle"),spacing:Rn,size:Rn,rotation:wn,label:{...Ha,spacing:Rn}
vendor: 10,381 bytes, line 1
1,...Ps,...Ds,...Os}))(),jo=(()=>({...Ao(Ra,["listeners"]),direction:Wn("horizontal","vertical"),cornerMode:Wn("container","item"),cornerRadius:Rn,thickness:Rn,scale:{min:mn(In,$n("max")),max:mn(In,jn("min")),label:{enabled:vn,formatter:Sn,rotation:wn,spacing:Rn,minSpacing:Rn,placement:Wn("before","after"),avoidCollisions:vn,format:Aa,...Xs},interval:{values:Un(In),step:In},...Vo,...Ps,...Ds,...Os},segmentation:{enabled:vn,spacing:Rn,interval:{values:Un(In),step:In,count:wn}},bar:{enabled:vn,thickness:Rn,thicknessRatio:Vn,...Vo,...Ps,...Ds,...Os},label:{...Xa,text:Cn,spacing:Rn,avoidCollisions:vn,placement:Wn("inside-start","outside-start","inside-end","outside-end","inside-center","bar-inside","bar-inside-end","bar-outside-end","bar-end")},tooltip:Qa}))(),Wo=(()=>({...Ao(Ea,["listeners"]),...jo,type:ln(Kn("linear-gauge")),value:ln(In),targets:Xn($o,"target options array")}))();Wo.margin=hn(wn),Wo.defaultColorRange=hn(Un(Mn)),Wo.defaultTarget=hn({...$o,value:wn,label:{...Ha,spacing:wn}}),Wo.defaultScale=hn(Wo.scale),Wo.scale.defaultFill=hn(Mn);var _o=(()=>({...Ao(Ra,["listeners"]),outerRadius:Rn,innerRadius:Rn,outerRadiusRatio:Vn,innerRadiusRatio:Vn,startAngle:wn,endAngle:wn,spacing:Rn,cornerMode:Wn("container","item"),cornerRadius:Rn,scale:{min:mn(In,$n("max")),max:mn(In,jn("min")),label:{enabled:vn,formatter:Sn,rotation:wn,spacing:Rn,minSpacing:Rn,avoidCollisions:vn,format:Aa,...Xs},interval:{values:Un(In),step:In},...Vo,...Ps,...Ds,...Os},segmentation:{enabled:vn,spacing:Rn,interval:{values:Un(In),step:In,count:wn}},bar:{enabled:vn,...Vo,...Ps,...Ds,...Os},needle:{enabled:vn,spacing:Rn,radiusRatio:Vn,...Ps,...Ds,...Os},label:{text:Cn,spacing:Rn,...Xa},secondaryLabel:{text:Cn,...Xa},tooltip:Qa}))(),Go=(()=>({...Ao(Ea,["listeners"]),..._o,type:ln(Kn("radial-gauge")),value:ln(In),targets:Xn(Ho,"target options array")}))();Go.defaultColorRange=hn(Un(Mn)),Go.defaultTarget=hn({...Ho,value:wn,label:{...Ha,spacing:wn}}),Go.scale.defaultFill=hn(Mn);var Ko=(e=>(e[e.SMALLEST=8]="SMALLEST",e[e.SMALLER=10]="SMALLER",e[e.SMALL=12]="SMALL",e[e.MEDIUM=13]="MEDIUM",e[e.LARGE=14]="LARGE",e[e.LARGEST=17]="LARGEST",e))(Ko||{}),Yo=12,Uo={SMALLEST:8/Yo,SMALLER:10/Yo,SMALL:12/Yo,MEDIUM:13/Yo,LARGE:14/Yo,LARGEST:17/Yo},Xo=(e=>(e.TOP="top",e.TOP_RIGHT="top-right",e.TOP_LEFT="top-left",e.RIGHT="right",e.RIGHT_TOP="right-top",e.RIGHT_BOTTOM="right-bottom",e.BOTTOM="bottom",e.BOTTOM_RIGHT="bottom-right",e.BOTTOM_LEFT="bottom-left",e.LEFT="left",e.LEFT_TOP="left-top",e.LEFT_BOTTOM="left-bottom",e))(Xo||{}),Zo=(e=>(e.CATEGORY="category",e.GROUPED_CATEGORY="grouped-category",e.ORDINAL_TIME="ordinal-time",e.UNIT_TIME="unit-time",e.TIME="time",e.NUMBER="number",e.LOG="log",e))(Zo||{}),qo=(e=>(e.ANGLE_CATEGORY="angle-category",e.ANGLE_NUMBER="angle-number",e.RADIUS_CATEGORY="radius-category",e.RADIUS_NUMBER="radius-number",e))(qo||{}),Qo=(e=>(e.CIRCLE="circle",e.POLYGON="polygon",e))(Qo||{});function Jo(e){return e}var er={x:{position:"bottom",type:{$if:[{$eq:[{$path:["/series/0/direction",void 0]},"horizontal"]},"number","category"]}},y:{position:"left",type:{$if:[{$eq:[{$path:["/series/0/direction",void 0]},"horizontal"]},"category","number"]}}},tr={$if:[{$or:[{$isGradient:{$palette:"fill"}},{$isPattern:{$palette:"fill"}},{$isImage:{$value:"$1"}}]},{$palette:"fillFallback"},{$palette:"fill"}]},ir={$if:[{$or:[{$isGradient:{$palette:"fill"}},{$isPattern:{$palette:"fill"}},{$isImage:{$value:"$1"}}]},{$palette:"fillsFallback"},{$palette:"fills"}]},nr={$if:[{$isGradient:{$palette:"fill"}},{$palette:"fillFallback"},{$if:[{$isPattern:{$palette:"fill"}},{$path:["/stroke",{$palette:"fillFallback"},{$palette:"fill"}]},{$palette:"fill"}]}]},sr={$if:[{$or:[{$isGradient:{$palette:"fill"}},{$isPattern:{$palette:"fill"}},{$isImage:{$value:"$1"}}]},[{$palette:"fillFallback"},{$palette:"fillFallback"}],{$palette:"range2"}]},ar={type:"gradient",gradient:"linear",bounds:"item",colorStops:[{color:"black"}],rotation:0,reverse:!1,colorSpace:"rgb"},or={type:"gradient",gradient:"linear",bounds:"item",colorStops:{$shallow:{$map:[{color:{$value:"$1"}},{$palette:"gradient"}]}},rotation:0,reverse:!1,colorSpace:"rgb"},rr={...or,colorStops:{$shallow:[{color:{$mix:[{$path:["/1",{$palette:"fill"},{$palette:"hierarchyColors"}]},"black",.15]}},{color:{$mix:[{$path:["/1",{$palette:"fill"},{$palette:"hierarchyColors"}]},"white",.15]}}]}},lr={...or,colorStops:{$map:[{color:{$value:"$1"}},{$path:["/0",void 0,{$palette:"gradients"}]}]}},hr=e=>({...or,colorStops:{$shallow:{$if:[{$or:[{$isGradient:{$palette:`${e}.fill`}},{$isPattern:{$palette:`${e}.fill`}},{$isImage:{$palette:`${e}.fill`}}]},{$path:["/colorStops",void 0,{$palette:`${e}.fill`}]},[{color:{$mix:[{$palette:`${e}.fill`},"black",.15]}},{color:{$mix:[{$palette:`${e}.fill`},"white",.15]}}]]}}}),cr={type:"gradient",gradient:"radial",bounds:"item",colorStops:{$shallow:{$map:[{color:{$value:"$1"}},{$palette:"gradient"}]}},rotation:0,reverse:!1,colorSpace:"rgb"},dr={...cr,reverse:!0},ur={...cr,bounds:"series"},pr={...cr,bounds:"series",reverse:!0},gr={type:"gradient",gradient:"conic",bounds:"series",colorStops:{$map:[{color:{$value:"$1"}},{$palette:"gradient"}]},rotation:0,reverse:!1,colorSpace:"rgb"},mr={type:"pattern",pattern:"forward-slanted-lines",width:{$isUserOption:["./height",{$path:"./height"},10]},height:{$isUserOption:["./width",{$path:"./width"},10]},padding:2,fill:{$if:[{$or:[{$isGradient:{$palette:"fill"}},{$isImage:{$palette:"fill"}}]},{$palette:"fillFallback"},{$if:[{$isPattern:{$palette:"fill"}},{$path:["/fill",{$palette:"fillFallback"},{$palette:"fill"}]},{$palette:"fill"}]}]},fillOpacity:1,stroke:nr,strokeOpacity:1,strokeWidth:{$switch:[{$path:"./pattern"},0,[["backward-slanted-lines","forward-slanted-lines","horizontal-lines","vertical-lines"],4]]},backgroundFill:"none",backgroundFillOpacity:1,rotation:0,scale:1},yr={...mr,stroke:{$if:[{$isGradient:{$palette:"fill"}},{$path:["/0",void 0,{$palette:"fillsFallback"}]},{$if:[{$isPattern:{$palette:"fill"}},{$path:["/stroke",{$path:["/0",void 0,{$palette:"fillsFallback"}]},{$path:["/0",void 0,{$palette:"fills"}]}]},{$path:["/0",void 0,{$palette:"fills"}]}]}]},fill:{$if:[{$or:[{$isGradient:{$palette:"fill"}},{$isImage:{$palette:"fill"}}]},{$path:["/0",void 0,{$palette:"fillsFallback"}]},{$if:[{$isPattern:{$palette:"fill"}},{$path:["/fill",{$path:["/0",void 0,{$palette:"fillsFallback"}]},{$path:["/0",void 0,{$palette:"fills"}]}]},{$path:["/0",void 0,{$palette:"fills"}]}]}]}},fr={type:"pattern",pattern:"forward-slanted-lines",width:8,height:8,padding:1,fill:"black",fillOpacity:1,backgroundFill:"white",backgroundFillOpacity:1,stroke:"black",strokeOpacity:1,strokeWidth:1,rotation:0,scale:1},xr={...mr,fill:{$path:["/1",{$palette:"fill"},{$palette:"hierarchyColors"}]},stroke:{$path:["/1",{$palette:"fill"},{$palette:"hierarchyColors"}]}},br=e=>({...mr,stroke:{$if:[{$isGradient:{$palette:`${e}.fill`}},{$palette:"fillFallback"},{$if:[{$isPattern:{$palette:`${e}.fill`}},{$path:["/stroke",{$palette:"fillFallback"},{$palette:`${e}.fill`}]},{$palette:`${e}.fill`}]}]}}),vr={type:"image",backgroundFill:{$palette:"fillFallback"},backgroundFillOpacity:1,repeat:"no-repeat",fit:"contain",rotation:0},Sr={type:"image",backgroundFill:"black",backgroundFillOpacity:1,rotation:0,repeat:"no-repeat",fit:"contain",width:8,height:8};function Mr(e){return Io(e,(e=>{const t=Vt.fromString(e);return[Vt.darken(t,.15).toString(),e,Vt.lighten(t,.15).toString()]}))}var kr={fill:{$if:[{$and:[{$eq:[{$path:"./fill/type"},"image"]},{$isUserOption:["./fill/backgroundFill",!1,!0]}]},{backgroundFill:"transparent"},void 0]}},Dr={...kr,padding:8,cornerRadius:4,border:{enabled:{$isUserOption:"../border"},strokeWidth:1,stroke:{$foregroundOpacity:.08}}},wr={...kr,cornerRadius:4,border:{enabled:{$isUserOption:"../border"},strokeWidth:1,stroke:{$foregroundOpacity:.08}}},Ir={border:{enabled:{$path:"../../border/enabled"}}},Ar=e=>({...Ir,color:{$isUserOption:["../color",{$path:"../color"},{$ref:e}]}}),Cr={wrapping:{$if:[{$or:[{$isUserOption:[["./maxWidth","./maxHeight","./truncate","./minimumFontSize"]]},{$isType:[{$path:"./placement"},"array"]},{$isType:[{$path:"./orientation"},"array"]}]},"on-space",void 0]},truncate:{$if:[{$or:[{$isUserOption:[["./maxWidth","./maxHeight","./wrapping","./minimumFontSize"]]},{$isType:[{$path:"./placement"},"array"]},{$isType:[{$path:"./orientation"},"array"]}]},!0,void 0]}},Nr={$if:[{$or:[{$isUserOption:[["../maxWidth","../maxHeight","../wrapping","../truncate","../minimumFontSize"]]},{$isType:[{$path:"../placement"},"array"]},{$isType:[{$path:"../orientation"},"array"]}]},!1,!0]},Lr={enabled:{$circular:{$path:"/highlight/enabled"}},unhighlightedItem:{opacity:.6},unhighlightedSeries:{opacity:.2}},Pr={enabled:{$circular:{$path:"/highlight/enabled"}},unhighlightedSeries:{opacity:.2}},Tr={enabled:{$circular:{$path:"/highlight/enabled"}},unhighlightedItem:{opacity:.2},unhighlightedSeries:{opacity:.2}},Or={enabled:{$circular:{$path:"/highlight/enabled"}},unhighlightedItem:{opacity:.2}},Rr={enabled:{$path:["/selection/enabled",!1]},containment:{$path:"/selection/containment"},selectedItem:{strokeWidth:2},unselectedItem:{opacity:.6},unselectedSeries:{opacity:.2}},Er={border:{enabled:!1,stroke:{$foregroundBackgroundMix:.25},strokeOpacity:1,strokeWidth:1},cornerRadius:4,fillOpacity:1,padding:{$if:[{$eq:[{$path:"./border/enabled"},!0]},5,{$isUserOption:["./fill",5,0]}]}},zr={enabled:!1,key:"x",segments:{$apply:{fill:{$applySwitch:[{$path:"type"},{$path:"../../../fill"},["gradient",or],["image",vr],["pattern",mr]]},stroke:{$path:"../../../stroke"},fillOpacity:{$path:"../../../fillOpacity"},strokeWidth:{$isUserOption:["./stroke",{$isUserOption:["../../../strokeWidth",{$path:"../../../strokeWidth"},{$if:[{$greaterThan:[{$path:"../../../strokeWidth"},0]},{$path:"../../../strokeWidth"},2]}]},{$path:"../../../strokeWidth"}]},strokeOpacity:{$path:"../../../strokeOpacity"},lineDash:{$path:"../../../lineDash"},lineDashOffset:{$path:"../../../lineDashOffset"}}}},Br=class e{constructor(e){this.version=e.split("-")[0]}save(...e){const t={version:this.version};for(const i of Object.values(e))t[i.mementoOriginatorKey]=this.encode(i,i.createMemento());return t}restore(e,t,...i){if(Yt(t))if("version"in t&&"string"==typeof t.version)for(const n of i){const i=this.decode(n,t[n.mementoOriginatorKey]),s=[];if(!n.guardMemento(i,s)){let t=`Could not restore [${n.mementoOriginatorKey}
1] data, value was invalid, ignoring.`;return s.length>0&&(t+=`\n\n${s.join("\n\n")}\n\n`),void e.warnOnce(t,i)}n.restoreMemento(this.version,t.version,i)}else e.warnOnce("Could not restore data, missing [version] string in object, ignoring.");else{const i=null===t?"null":typeof t;e.warnOnce(`Could not restore data of type [${i}], expecting an object, ignoring.`)}}encode(t,i){try{return JSON.parse(JSON.stringify(i,e.encodeTypes))}catch(e){throw new Error(`Failed to encode [${t.mementoOriginatorKey}] value [${e}].`,{cause:e})}}decode(t,i){if(null==i)return i;try{return JSON.parse(JSON.stringify(i),e.decodeTypes)}catch(e){throw new Error(`Failed to decode [${t.mementoOriginatorKey}] value [${e}].`,{cause:e})}}static encodeTypes(e,t){return Wt(this[e])?{__type:"date",value:this[e].toISOString()}:"bigint"==typeof this[e]?{__type:"bigint",value:this[e].toString()}:t}static decodeTypes(e,t){if(Yt(this[e])&&"__type"in this[e]){if("date"===this[e].__type)return new Date(this[e].value);if("bigint"===this[e].__type){const t=this[e].value;if("string"==typeof t&&/^-?\d+$/.test(t))return BigInt(t)}}return t}};function Fr(e,t){let i=e;for(const e of t){if(null==i||"object"!=typeof i)return;i=i[e]}return i}var Vr=class{constructor(){this.dirtyKeys=new Set,this.stateMap=new Map,this.isFlushing=!1}getState(e){let t=this.stateMap.get(e);return t||(t={value:void 0,flushedValue:void 0,observers:new Map},this.stateMap.set(e,t)),t}observe(e){const t=new Map;e(((e,i)=>{const n=i??"";let s=t.get(e);return null==s&&(s=new Set,t.set(e,s)),s.add(n),0===n.length?this.getValue(e):Fr(this.stateMap.get(e)?.value,n.split("."))}));for(const[i,n]of t)this.getState(i).observers.set(e,n);return()=>{for(const i of t.keys())this.stateMap.get(i)?.observers.delete(e)}}getValue(e,t=""){const i=this.stateMap.get(e)?.value;return 0===t.length?i:Fr(i,t.split("."))}setValue(e,t){this.getState(e).value=t,this.dirtyKeys.add(e)}flushChanges(e){if(!this.isFlushing){this.isFlushing=!0;try{const t=this.getValue.bind(this);let i;null==e?(i=new Set(this.dirtyKeys),this.dirtyKeys.clear()):(i=new Set(this.dirtyKeys.has(e)?[e]:[]),this.dirtyKeys.delete(e));for(const e of this.collectObservers(i))e(t)}finally{this.isFlushing=!1}}}destroy(){for(const{observers:e}of this.stateMap.values())e.clear();this.dirtyKeys.clear(),this.stateMap.clear()}collectObservers(e){const t=new Set;for(const i of e){const e=this.getState(i),{flushedValue:n,value:s}=e;if(n!==s){e.flushedValue=s;for(const[i,a]of e.observers)if(0===a.size||a.has(""))t.add(i);else for(const e of a){const a=e.split(".");if(Fr(n,a)!==Fr(s,a)){t.add(i);break}}}}return t}},$r=(e=>(e.X="x",e.Y="y",e.Angle="angle",e.Radius="radius",e))($r||{}),Hr=(e=>(e[e.FULL=0]="FULL",e[e.UPDATE_DATA=1]="UPDATE_DATA",e[e.PROCESS_DATA=2]="PROCESS_DATA",e[e.PROCESS_DOMAIN=3]="PROCESS_DOMAIN",e[e.PROCESS_RANGE=4]="PROCESS_RANGE",e[e.PERFORM_LAYOUT=5]="PERFORM_LAYOUT",e[e.PRE_SERIES_UPDATE=6]="PRE_SERIES_UPDATE",e[e.SERIES_UPDATE=7]="SERIES_UPDATE",e[e.PRE_SCENE_RENDER=8]="PRE_SCENE_RENDER",e[e.SCENE_RENDER=9]="SCENE_RENDER",e[e.NONE=10]="NONE",e))(Hr||{}),jr=(e=>(e[e.CHART_BACKGROUND=0]="CHART_BACKGROUND",e[e.SERIES_AREA_UNDERLAY=1]="SERIES_AREA_UNDERLAY",e[e.AXIS_BAND_HIGHLIGHT=2]="AXIS_BAND_HIGHLIGHT",e[e.AXIS_GRID=3]="AXIS_GRID",e[e.AXIS=4]="AXIS",e[e.SERIES_AREA_CONTAINER=5]="SERIES_AREA_CONTAINER",e[e.ZOOM_SELECTION=6]="ZOOM_SELECTION",e[e.SERIES_CROSSLINE_RANGE=7]="SERIES_CROSSLINE_RANGE",e[e.SERIES_LAYER=8]="SERIES_LAYER",e[e.AXIS_FOREGROUND=9]="AXIS_FOREGROUND",e[e.SERIES_CROSSHAIR=10]="SERIES_CROSSHAIR",e[e.SERIES_CROSSLINE_LINE=11]="SERIES_CROSSLINE_LINE",e[e.SERIES_ANNOTATION=12]="SERIES_ANNOTATION",e[e.CHART_ANNOTATION=13]="CHART_ANNOTATION",e[e.CHART_ANNOTATION_FOCUSED=14]="CHART_ANNOTATION_FOCUSED",e[e.STATUS_BAR=15]="STATUS_BAR",e[e.SERIES_LABEL=16]="SERIES_LABEL",e[e.LEGEND=17]="LEGEND",e[e.NAVIGATOR=18]="NAVIGATOR",e[e.FOREGROUND=19]="FOREGROUND",e))(jr||{}),Wr=(e=>(e[e.BACKGROUND=0]="BACKGROUND",e[e.ANY_CONTENT=1]="ANY_CONTENT",e))(Wr||{}),_r=(e=>(e[e.FOREGROUND=0]="FOREGROUND",e[e.HIGHLIGHT=1]="HIGHLIGHT",e[e.LABEL=2]="LABEL",e))(_r||{}),Gr=(e=>(e[e.BACKGROUND=0]="BACKGROUND",e[e.FOREGROUND=1]="FOREGROUND",e[e.HIGHLIGHT=2]="HIGHLIGHT",e[e.LABEL=3]="LABEL",e))(Gr||{});function Kr(e){const{placement:t="bottom",floating:i=!1,xOffset:n=0,yOffset:s=0}="string"==typeof e?{placement:e,floating:!1}:e;return{placement:t,floating:i,xOffset:n,yOffset:s}}var Yr=class{handleUnknownProperties(e,t){}set(e){const{className:t=this.constructor.name}=this.constructor;if(null==e)return this.clear(),this;if("object"!=typeof e)return K(`unable to set ${t} - expecting a properties object`),this;const i=new Set(Object.keys(e));for(const t of co(this))if(i.has(t)){const n=e[t],s=this;if(Xr(s[t]))if(s[t]instanceof Ur)if(null==n)s[t].clear();else{const e=s[t].reset(n);null==e?K(`unable to set [${String(t)}] - expecting a properties array`):s[t]=e}else s[t].set(n);else Xt(n)?s[t]=Do(n,s[t]??{}):s[t]=n;i.delete(t)}this.handleUnknownProperties(i,e);for(const e of i)K(`unable to set [${String(e)}] in ${t} - property is unknown`);return this}clear(){for(const e of co(this)){const t=this[e];Xr(t)?t.clear():this[e]=void 0}return this}toJson(){return co(this).reduce(((e,t)=>{const i=this[t];return e[String(t)]=Xr(i)?i.toJson():i,e}),{})}},Ur=class e extends Array{constructor(e,...t){super(t.length);const i=(n=e,Boolean(n?.prototype?.constructor?.name)?t=>(new e).set(t):e);var n;Object.defineProperty(this,"itemFactory",{value:i,enumerable:!1,
1configurable:!1}),this.set(t)}set(e){if(Ht(e)){this.length=e.length;for(let t=0;t<e.length;t++)this[t]=this.itemFactory(e[t])}return this}reset(t){if(Array.isArray(t))return new e(this.itemFactory,...t)}clear(){return this.length=0,this}toJson(){return this.map((e=>e?.toJson?.()??e))}};function Xr(e){return e instanceof Yr||e instanceof Ur}var Zr=(()=>{var e=class extends Yr{constructor(){super(...arguments),this.type="linear",this.tension=1,this.position="end"}};return r([ao],e.prototype,"type",2),r([ao],e.prototype,"tension",2),r([ao],e.prototype,"position",2),e})();function qr(e,t){const[i,n]=Qr(t);return Ge(i,e,n)}function Qr(e){if(0===e.length)return[];let t=1/0,i=-1/0;for(const n of e)n<t&&(t=n),n>i&&(i=n);return[t,i]}function Jr(e){const[t,i]=Qr(e);return i-t}function el(e){return(e=Math.trunc(e))<=0?1:1===e?2:1<<32-Math.clz32(e-1)}function tl(e){return(e=Math.trunc(e))<=0?0:1===e?1:1<<31-Math.clz32(e)}var il=1e3,nl=60*il,sl=60*nl,al=24*sl,ol=7*al,rl=30*al,ll=365*al,hl=(()=>(new Date).getTimezoneOffset()*nl)(),cl={millisecond:{milliseconds:1,hierarchy:"day",encode:e=>e.getTime(),decode:e=>new Date(e)},second:{milliseconds:il,hierarchy:"day",encode(e,t){const i=t?0:hl;return Math.floor((e.getTime()-i)/il)},decode:(e,t)=>new Date((t?0:hl)+e*il)},minute:{milliseconds:nl,hierarchy:"day",encode(e,t){const i=t?0:hl;return Math.floor((e.getTime()-i)/nl)},decode:(e,t)=>new Date((t?0:hl)+e*nl)},hour:{milliseconds:sl,hierarchy:"day",encode(e,t){const i=t?0:hl;return Math.floor((e.getTime()-i)/sl)},decode:(e,t)=>new Date((t?0:hl)+e*sl)},day:{milliseconds:al,hierarchy:"month",encode(e,t){const i=t?0:e.getTimezoneOffset()*nl;return Math.floor((e.getTime()-i)/al)},decode(e,t){let i;return t?(i=new Date(0),i.setUTCDate(i.getUTCDate()+e),i.setUTCHours(0,0,0,0)):(i=new Date(1970,0,1),i.setDate(i.getDate()+e)),i}},month:{milliseconds:rl,hierarchy:"year",encode:(e,t)=>t?12*e.getUTCFullYear()+e.getUTCMonth():12*e.getFullYear()+e.getMonth(),decode(e,t){if(t){const t=Math.floor(e/12),i=e-12*t;return new Date(Date.UTC(t,i,1))}{const t=Math.floor(e/12);return new Date(t,e-12*t,1)}}},year:{milliseconds:ll,hierarchy:void 0,encode:(e,t)=>t?e.getUTCFullYear():e.getFullYear(),decode(e,t){let i;return t?(i=new Date,i.setUTCFullYear(e),i.setUTCMonth(0,1),i.setUTCHours(0,0,0,0)):i=new Date(e,0,1,0,0,0,0),i}}};function dl(e){return"string"==typeof e?{unit:e,step:1,epoch:void 0,utc:!1}:{unit:e.unit,step:e.step??1,epoch:e.epoch,utc:e.utc??!1}}function ul(e,t,i,n){if(null==i)return 0;const s=cl[e];return Math.floor(s.encode(new Date(i),n))%t}function pl(e,t,i,n,s){const a=cl[t];return Math.floor((a.encode(new Date(e),n)-s)/i)}function gl(e,t,i,n,s){return cl[t].decode(e*i+s,n)}function ml(e,t,i,n,s){return gl(pl(new Date(e),t,i,n,s),t,i,n,s)}function yl(e,t,i,n,s){return gl(pl(new Date(Number(e)-1),t,i,n,s)+1,t,i,n,s)}function fl(e,t){const{unit:i,step:n,epoch:s,utc:a}=dl(e);return ml(t,i,n,a,ul(i,n,s,a))}function xl(e,t){const{unit:i,step:n,epoch:s,utc:a}=dl(e);return yl(t,i,n,a,ul(i,n,s,a))}function bl(e,t){const{unit:i,step:n,epoch:s,utc:a}=dl(e),o=ul(i,n,s,a);return gl(pl(yl(t,i,n,a,o),i,n,a,o)-1,i,n,a,o)}function vl(e,t){const{unit:i,step:n,epoch:s,utc:a}=dl(e),o=ul(i,n,s,a);return gl(pl(ml(t,i,n,a,o),i,n,a,o)+1,i,n,a,o)}function Sl(e,t,i){if(e.valueOf()>t.valueOf()&&([e,t]=[t,e],null!=i&&(i=[1-i[1],1-i[0]])),null!=i){const n=t.valueOf()-e.valueOf(),s=e.valueOf();e=new Date(s+i[0]*n),t=new Date(s+i[1]*n)}return[new Date(e),new Date(t)]}function Ml(e,t,i,{extend:n=!1,visibleRange:s=[0,1],limit:a,defaultAlignment:o="start"}={}){const r=dl(e),{unit:l,step:h,utc:c}=r;let d;d=null!=r.epoch?r.epoch:"interval"===o?void 0:t.valueOf()>i.valueOf()?i:t;const u=ul(r.unit,r.step,d,r.utc);let[p,g]=Sl(t,i,s);p=n?ml(p,l,h,c,u):yl(p,l,h,c,u),g=n?yl(g,l,h,c,u):ml(g,l,h,c,u);const m=pl(p,l,h,c,u);let y=pl(g,l,h,c,u);return null!=a&&y-m>a&&(y=m+a),{range:[m,y],unit:l,step:h,utc:c,offset:u}}function kl(e,t,i,n){const{range:[s,a]}=Ml(e,t,i,n);return Math.abs(a-s)}function Dl(e,t,i,n){const{range:[s,a],unit:o,step:r,utc:l,offset:h}=Ml(e,t,i,n),c=[];for(let e=s;e<=a;e+=1){const t=gl(e,o,r,l,h);c.push(t)}return c}function wl(e,t,i,n){const{range:[s,a],unit:o,step:r,utc:l,offset:h}=Ml(e,t,i,n),c=Math.max(0,a-s+1),d=new Array(c);for(let e=0;e<c;e++)d[e]=s+e;return{encodedValues:d,encodingParams:{unit:o,step:r,utc:l,offset:h}}}function Il(e,t){return gl(e,t.unit,t.step,t.utc,t.offset)}var Al=(()=>6e4*(new Date).getTimezoneOffset())();function Cl(e,t){const{unit:i,step:n,utc:s,offset:a}=t,o=e*n+a;switch(i){case"millisecond":return o;case"second":return(s?0:Al)+1e3*o;case"minute":return(s?0:Al)+6e4*o;case"hour":return(s?0:Al)+36e5*o;default:return cl[i].decode(o,s).valueOf()}}function Nl(e,t,i,{extend:n,visibleRange:s,limit:a,defaultAlignment:o}={}){const{range:[r]}=Ml(e,t,i,{extend:n,visibleRange:s,limit:a,defaultAlignment:o}),{range:[l]}=Ml(e,t,i,{extend:n,limit:a,defaultAlignment:o});return r-l}var Ll={millisecond:{adjust(e,t,i){const n=new Date;return n.setTime(e.getTime()+t),n}},second:{adjust(e,t,i){const n=new Date(e);return i?n.setUTCSeconds(e.getUTCSeconds()+t):n.setSeconds(e.getSeconds()+t),n}},minute:{adjust(e,t,i){const n=new Date(e);return i?n.setUTCMinutes(e.getUTCMinutes()+t):n.setMinutes(e.getMinutes()+t),n}},hour:{adjust(e,t,i){const n=new Date(e);return i?n.setUTCHours(e.getUTCHours()+t):n.setHours(e.getHours()+t),n}},day:{adjust(e,t,i){const n=new Date(e);return i?n.setUTCDate(e.getUTCDate()+t):n.setDate(e.getDate()+t),n}},month:{adjust(e,t,i){const n=new Date(e);if(i){if(n.setUTCMonth(e.getUTCMonth()+t),0!==t)for(;n.getUTCMonth()===e.getUTCMonth();)n.setUTCDate(n.getUTCDate()+(t>0?1:-1))}else if(n.setMonth(e.getMonth()+t),0!==t)for(;n.getMonth()===e.getMonth();)n.setDate(n.getDate()+(t>0?1:-1));return n}},year:{adjust(e,t,i){const n=new Date(e);return i?n.setUTCFullYear(e.getUTCFullYear()+t):n.setFullYear(e.getFullYear()+t),n}}};function Pl(e,t){const{unit:i,step:n,utc:s}=dl(e);
1return Ll[i].adjust(t,-n,s)}function Tl(e){return"string"==typeof e?e:e.unit}function Ol(e){return"string"==typeof e?1:e.step??1}function Rl(e){return"string"==typeof e?void 0:e.epoch}function El(e){return cl[Tl(e)].hierarchy}function zl(e){return Ol(e)*cl[Tl(e)].milliseconds}function Bl(e){return"string"==typeof e?{unit:e}:e}var Fl=["millisecond","second","minute","hour","day","month","year"];function Vl(e){return!!Xt(e)&&("unit"in e&&Fl.includes(e.unit))}function $l(e){return qt(e)&&Fl.includes(e)}function Hl(e){return e instanceof Date?e.getTime():e}function jl(e){return Math.abs(e)>864e13?Number.NaN:e}function Wl(e){return"number"==typeof e?jl(e):"bigint"==typeof e?jl(Number(e)):"string"==typeof e?Date.parse(e):e instanceof Date?e.getTime():e}function _l(e){return e<il?"millisecond":e<nl?"second":e<sl?"minute":e<23*sl?"hour":e<28*al?"day":e<ll?"month":"year"}function Gl(e){if(0===e.length)return"millisecond";if(1===e.length)return Kl(e[0]);let t=1/0;for(let i=1;i<e.length;i++)t=Math.min(t,Math.abs(e[i].valueOf()-e[i-1].valueOf()));return _l(t)}function Kl(e){return fl("second",e)<e?"millisecond":fl("minute",e)<e?"second":fl("hour",e)<e?"minute":fl("day",e)<e?"hour":fl("month",e)<e?"day":fl("year",e)<e?"month":"year"}function Yl(e){const[t,i]=0===e.length?[0,0]:Qr([e[0].valueOf(),e.at(-1).valueOf()]);if(new Date(t).getFullYear()!==new Date(i).getFullYear())return;if(new Date(t).getMonth()!==new Date(i).getMonth())return"year";return new Date(t).getDate()!==new Date(i).getDate()?"month":"day"}var Ul=new WeakMap;function Xl(e){return"string"==typeof e?Wl(e):e}function Zl(e){const t=Ul.get(e);if(void 0!==t)return t;const i=e.some((e=>"string"==typeof e))?e.map(Xl):e;return Ul.set(e,i),i}function ql(e){Ul.has(e)||Ul.set(e,e)}function Ql(e){return Ul.get(e)}function Jl(e){Ul.delete(e)}var eh=0,th=1,ih=2,nh=3,sh=4,ah=5,oh=1e3,rh=10,lh=64,hh=4294967295,ch=new Set(["time","unit-time","ordinal-time"]);function dh(e,t,i){const n=i||!ch.has(e)?t:Zl(t);return{values:n,needsValueOf:n===t&&i}}var uh=new WeakMap;function ph(e){const t=uh.get(e);if(void 0!==t)return t;let i=!1;for(let t=0;t<e.length;t++)if("bigint"==typeof e[t]){i=!0;break}const n=i?e.map((e=>"bigint"==typeof e?Number(e):e)):e;return uh.set(e,n),n}var gh=new WeakMap;function mh(e){const t=gh.get(e);if(void 0!==t)return t;let i,n;for(let t=0;t<e.length;t++){const n=e[t];"bigint"==typeof n&&(void 0===i||n<i)&&(i=n)}if(void 0===i)n=e;else{const t=i,s=Number(t);n=e.map((e=>"bigint"==typeof e?Number(e-t):"number"==typeof e?e-s:e))}return gh.set(e,n),n}function yh(e){uh.has(e)||uh.set(e,e),gh.has(e)||gh.set(e,e)}var fh=new WeakMap;function xh(e,t){const i=fh.get(e);if(i?.offset===t)return i.result;const n=Number(t),s=e.map((e=>"bigint"==typeof e?Number(e-t):"number"==typeof e?e-n:e));return fh.set(e,{offset:t,result:s}),s}function bh(e,t){if("number"!==e)return;const{domain:i,sortMetadata:n}=t;if(0===i.length)return;const s=i[0],a=i.at(-1);if(1===n?.sortOrder)return"bigint"==typeof s&&"bigint"==typeof a?{min:s,max:a}:void 0;if(-1===n?.sortOrder)return"bigint"==typeof s&&"bigint"==typeof a?{min:a,max:s}:void 0;let o,r;for(const e of i){if("bigint"!=typeof e)return;(void 0===o||e<o)&&(o=e),(void 0===r||e>r)&&(r=e)}return void 0!==o&&void 0!==r?{min:o,max:r}:void 0}function vh(e,t,i){const n=bh(e,i);return void 0!==n?{xValues:xh(t,n.min),domain:[0,Number(n.max-n.min)]}:{xValues:ph(t),domain:Dh(e,i)}}function Sh(e,t,i,n,s,a,o,r){let l=0;for(;l<100&&null==e[n]&&n<s;)n+=1,l+=1;for(;l<100&&null==e[s]&&s>n;)s-=1,l+=1;if(l>=100||n>=s)return a;const h=Number.isFinite(t)?Ih(e[s],t,i,r)-Ih(e[n],t,i,r):wh(s,e.length)-wh(n,e.length);if(0===h||!Number.isFinite(h))return a;const c=Math.abs(h)/(s-n);let d;if(d=o<3||!(o>20)&&c<=a,a=Math.min(a,c),!d)return a;const u=Math.floor((n+s)/2),p=Sh(e,t,i,n,u,a,o+1,r),g=Sh(e,t,i,u+1,s,a,o+1,r);return Math.min(p,g,a)}function Mh(e,t,i,n){return Sh(e,t,i,0,e.length-1,1/(e.length-1),0,n)}function kh(e,t,i,n){if(Number.isFinite(t)){const s=n?.smallestKeyInterval,a=null==s?Mh(e,t,i,n?.xNeedsValueOf??!0):Number(s)/(i-t);return Math.min(el(Math.trunc(1/a))>>3,el(e.length))}{let t=Math.ceil(Math.log2(e.length))-1;return t=Math.min(Math.max(t,0),24),Math.trunc(2**t)}}function Dh(e,t){const{domain:i,sortMetadata:n}=t;switch(e){case"category":return[Number.NaN,Number.NaN];case"number":case"time":case"ordinal-time":case"unit-time":{if(0===i.length)return[1/0,-1/0];if(1===n?.sortOrder)return[Number(i[0]),Number(i.at(-1))];if(-1===n?.sortOrder)return[Number(i.at(-1)),Number(i[0])];let e=1/0,t=-1/0;for(const n of i){const i=Number(n);e=Math.min(e,i),t=Math.max(t,i)}return[e,t]}case"color":case"log":case"mercator":return[0,0]}}function wh(e,t){return e/t}function Ih(e,t,i,n){return n?(e.valueOf()-t)/(i-t):(e-t)/(i-t)}function Ah(e,t){return Math.trunc(Math.min(Math.floor(e*t),t-1)*ah)}function Ch(e,t,i,n,s,{xNeedsValueOf:a=!0,xValuesLength:o}={}){const r=e[s];if(null==r)return-1;const l=o??e.length;return Ah(Number.isFinite(t)?Ih(r,t,i,a):wh(s,l),n)}function Nh(e,t,i,n){for(const s of n)if(i===e[t+s])return!0;return!1}function Lh(e,t,i,n,s,a,{positive:o,split:r=!1,xNeedsValueOf:l=!0,yNeedsValueOf:h=!0,reuseIndexData:c,reuseValueData:d,reuseNegativeIndexData:u,reuseNegativeValueData:p}={}){const g=Number.NaN,m=a*ah,y=c?.length===m?c:new Uint32Array(m),f=d?.length===m?d:new Float64Array(m);let x,b;r&&(x=u?.length===m?u:new Uint32Array(m),b=p?.length===m?p:new Float64Array(m));const v=Number.isFinite(n)&&Number.isFinite(s),S=e.length;v&&(f.fill(g),y.fill(hh),r&&(b.fill(g),x.fill(hh)));const M=v?a/(s-n):a*(1/S);let k=-1,D=-1,w=g,I=-1,A=g,C=-1,N=g,L=-1,P=g,T=-1,O=-1,R=g,E=-1,z=g,B=-1,F=g,V=-1,$=g;const H=e.length,j=t===i;for(let s=0;s<H;s++){const c=e[s];if(null==c)continue;const d=t[s],u=j?d:i[s];let p,m;h?(p=null==d?g:d.valueOf(),m=null==u?g:u.valueOf()):(p=d??g,m=u??g);let S,H=!0;if(r)H=p>=0;else if(null!=o&&p>=0!==o)continue;S=v?l?(c.valueOf()-n)*M:(c-n)*M:s*M;
1const W=Math.floor(S),_=(W<a?W:a-1)*ah;if(H){_!==k&&(-1!==k&&(y[k+eh]=D,y[k+th]=I,y[k+ih]=C,y[k+nh]=L,y[k+sh]=0,f[k+eh]=w,f[k+th]=A,f[k+ih]=N,f[k+nh]=P),k=_,D=-1,w=g,I=-1,A=g,C=-1,N=g,L=-1,P=g);const e=m==m,t=p==p;-1===D?(D=s,w=S,I=s,A=S,e&&(C=s,N=m),t&&(L=s,P=p)):(S<w&&(D=s,w=S),S>A&&(I=s,A=S),e&&m<N&&(C=s,N=m),t&&p>P&&(L=s,P=p))}else{_!==T&&(-1!==T&&(x[T+eh]=O,x[T+th]=E,x[T+ih]=B,x[T+nh]=V,x[T+sh]=0,b[T+eh]=R,b[T+th]=z,b[T+ih]=F,b[T+nh]=$),T=_,O=-1,R=g,E=-1,z=g,B=-1,F=g,V=-1,$=g);const e=m==m,t=p==p;-1===O?(O=s,R=S,E=s,z=S,e&&(B=s,F=m),t&&(V=s,$=p)):(S<R&&(O=s,R=S),S>z&&(E=s,z=S),e&&m<F&&(B=s,F=m),t&&p>$&&(V=s,$=p))}}return-1!==k&&(y[k+eh]=D,y[k+th]=I,y[k+ih]=C,y[k+nh]=L,y[k+sh]=0,f[k+eh]=w,f[k+th]=A,f[k+ih]=N,f[k+nh]=P),r&&-1!==T&&(x[T+eh]=O,x[T+th]=E,x[T+ih]=B,x[T+nh]=V,x[T+sh]=0,b[T+eh]=R,b[T+th]=z,b[T+ih]=F,b[T+nh]=$),{indexData:y,valueData:f,negativeIndexData:x,negativeValueData:b}}function Ph(e,t,i,{inPlace:n=!1,midpointData:s,reuseIndexData:a,reuseValueData:o}={}){const r=Math.trunc(i/2),l=r*ah;let h,c;h=n?e:a?.length===l?a:new Uint32Array(l),c=n?t:o?.length===l?o:new Float64Array(l);const d=s??new Uint32Array(r);for(let i=0;i<r;i+=1){const n=Math.trunc(i*ah),s=Math.trunc(2*n),a=Math.trunc(s+ah),o=e[a+eh]===hh,r=o||t[s+eh]<t[a+eh]?s:a,l=e[r+eh];h[n+eh]=l,c[n+eh]=t[r+eh];const u=o||t[s+th]>t[a+th]?s:a,p=e[u+th];h[n+th]=p,c[n+th]=t[u+th],d[i]=l+p>>1;const g=o||t[s+ih]<t[a+ih]?s:a;h[n+ih]=e[g+ih],c[n+ih]=t[g+ih];const m=o||t[s+nh]>t[a+nh]?s:a;h[n+nh]=e[m+nh],c[n+nh]=t[m+nh],h[n+sh]=e[s+sh]|e[a+sh]}return{maxRange:r,indexData:h,valueData:c,midpointData:d}}function Th(e){let t=0;for(let i=0;i<e.length;i++)1===e[i]&&t++;const i=new Uint32Array(t);let n=0;for(let t=0;t<e.length;t++)1===e[t]&&(i[n++]=t);return i}function Oh(e,t,i,n,s,a,o){for(let e=0;e<i;e++)t[e*ah+sh]=0;if(0===e.length)return;const r=Number.isFinite(s)&&Number.isFinite(a),l=n.length,h=r?i/(a-s):i*(1/l);for(let a=0;a<e.length;a++){const c=e[a];if(c>=l)continue;const d=n[c];if(null==d)continue;let u;u=r?o?(d.valueOf()-s)*h:(d-s)*h:c*h;const p=Math.floor(u);t[(p<i?p:i-1)*ah+sh]=1}}function Rh(e,t,i,n,s,a,o,r,l,h){for(let e=0;e<n;e++){const n=e*ah;t[n+sh]=0,i[n+sh]=0}if(0===e.length)return;const c=Number.isFinite(o)&&Number.isFinite(r),d=s.length,u=c?n/(r-o):n*(1/d);for(let r=0;r<e.length;r++){const p=e[r];if(p>=d)continue;const g=s[p];if(null==g)continue;const m=a[p];if(null==m)continue;const y=h?m.valueOf():m;if(y!=y)continue;let f;f=c?l?(g.valueOf()-o)*u:(g-o)*u:p*u;const x=Math.floor(f),b=(x<n?x:n-1)*ah;y>=0?t[b+sh]=1:i[b+sh]=1}}function Eh(e,t,i,n=eh,s=th,a=-1){const o=i?.length===e?i:new Uint32Array(e);for(let i=0,r=0;i<e;i+=1,r+=ah){const e=t[r+n],l=t[r+s];o[i]=e===a?a:e+l>>1}return o}function zh(e,{collectLevel:t,shouldContinue:i,minRange:n=lh,compactInPlace:s=!1}){let a=e,o=t(a);const r=[o];for(;a.maxRange>n&&i(o,a);){const e=Ph(a.indexData,a.valueData,a.maxRange,{inPlace:s});a={maxRange:e.maxRange,indexData:e.indexData,valueData:e.valueData,midpointData:e.midpointData},o=t(a),r.push(o)}return r.reverse(),r}function Bh(e,t,i,n,s){if(t.length<oh)return;const[a,o]=e,{smallestKeyInterval:r,xNeedsValueOf:l,yNeedsValueOf:h,existingFilters:c}=s;let d=kh(t,a,o,{smallestKeyInterval:r,xNeedsValueOf:l});const u=c?.find((e=>e.maxRange===d));let{indexData:p,valueData:g}=Lh(t,i,n,a,o,d,{xNeedsValueOf:l,yNeedsValueOf:h,reuseIndexData:u?.indexData,reuseValueData:u?.valueData}),m=Eh(d,p,u?.midpointIndices);const y=[{maxRange:d,indexData:p,valueData:g,midpointIndices:m}];for(;d>lh;){const e=d,t=Math.trunc(e/2),i=c?.find((e=>e.maxRange===t)),n=Ph(p,g,e,{reuseIndexData:i?.indexData,reuseValueData:i?.valueData});d=n.maxRange,p=n.indexData,g=n.valueData,m=n.midpointData??Eh(d,p,i?.midpointIndices),y.push({maxRange:d,indexData:p,valueData:g,midpointIndices:m})}return y.reverse(),y}function Fh(e,t,i,n,s){if(t.length<oh)return;const[a,o]=e,{smallestKeyInterval:r,targetRange:l,xNeedsValueOf:h,yNeedsValueOf:c,existingFilters:d}=s,u=kh(t,a,o,{smallestKeyInterval:r,xNeedsValueOf:h}),p=Math.min(u,el(Math.max(l,lh))),g=d?.find((e=>e.maxRange===p)),{indexData:m,valueData:y}=Lh(t,i,n,a,o,p,{xNeedsValueOf:h,yNeedsValueOf:c,reuseIndexData:g?.indexData,reuseValueData:g?.valueData}),f=Eh(p,m,g?.midpointIndices);return{immediate:[{maxRange:p,indexData:m,valueData:y,midpointIndices:f}],computeRemaining:function(){const e=Bh([a,o],t,i,n,{smallestKeyInterval:r,xNeedsValueOf:h,yNeedsValueOf:c,existingFilters:d});return e?.filter((e=>e.maxRange!==p))??[]}}}var Vh=Symbol("is-dark-theme"),$h=Symbol("default-shadow-colour"),Hh=Symbol("default-caption-layout-style"),jh=Symbol("default-caption-alignment"),Wh=Symbol("palette-up-stroke"),_h=Symbol("palette-down-stroke"),Gh=Symbol("palette-up-fill"),Kh=Symbol("palette-down-fill"),Yh=Symbol("palette-neutral-stroke"),Uh=Symbol("palette-neutral-fill"),Xh=Symbol("palette-alt-up-stroke"),Zh=Symbol("palette-alt-down-stroke"),qh=Symbol("palette-alt-up-fill"),Qh=Symbol("palette-alt-down-fill"),Jh=Symbol("palette-gray-fill"),ec=Symbol("palette-gray-stroke"),tc=Symbol("default-polar-series-stroke"),ic=Symbol("default-sparkline-crosshair-stroke"),nc=Symbol("default-financial-charts-annotation-stroke"),sc=Symbol("default-hierarchy-strokes"),ac=Symbol("default-text-annotation-color"),oc=Symbol("default-financial-charts-annotation-background-fill"),rc=Symbol("default-annotation-handle-fill"),lc=Symbol("default-annotation-statistics-fill"),hc=Symbol("default-annotation-statistics-stroke"),cc=Symbol("default-annotation-statistics-color"),dc=Symbol("default-annotation-statistics-divider-stroke"),uc=Symbol("default-annotation-statistics-fill"),pc=Symbol("default-annotation-statistics-stroke"),gc=Symbol("default-textbox-fill"),mc=Symbol("default-textbox-stroke"),yc=Symbol("default-textbox-color"),fc=Symbol("default-toolbar-position");function xc(e,t){return!(null==e||!function(e){return"context"in e}(e)||null==t||"object"!=typeof t||void 0!==t.context)&&(t.context=e.context,!0)}function bc(e,t,i){if(Array.isArray(e)){for(const t of e)if(xc(t,i))break}else xc(e,i);return t(i)}var vc=class{constructor(e){this.logger=e,this.cache=new WeakMap}call(e,t,i,n){let s,a=this.cache.get(t);
1try{s=n??JSON.stringify(i)}catch{return this.invoke(e,t,a,void 0,i)}return null==a&&(a=new Map,this.cache.set(t,a)),a.has(s)?a.get(s):this.invoke(e,t,a,s,i)}invoke(e,t,i,n,s){try{const a=bc(e,t,s);return i&&null!=n&&i.set(n,a),a}catch(e){return void this.logger.warnOnce("User callback errored, ignoring",e)}}invalidateCache(){this.cache=new WeakMap}destroy(){this.invalidateCache()}},Sc=class{constructor(e,t=e.defaultView){this.fallbackDocument=e,this.fallbackWindow=t,this.windowEvents=new Map}destroy(){this.removeWindowEvents(),this.container=void 0,this.cachedDocument=void 0,this.cachedWindow=void 0,this.windowEvents.clear()}get document(){return this.cachedDocument??this.fallbackDocument}get window(){return this.cachedWindow??this.fallbackWindow}getContainer(){return this.container}setContainer(e){if(this.container=e,null==e)return;const t=e.ownerDocument,i=t.defaultView??void 0,n=t!==this.document;n&&this.removeWindowEvents(),this.cachedDocument=t,this.cachedWindow=i,n&&this.reattachWindowEvents()}removeWindowEvents(){for(const[e,t]of this.windowEvents)for(const{listener:i,options:n}of t)this.window.removeEventListener(e,i,n)}reattachWindowEvents(){for(const[e,t]of this.windowEvents)for(const{listener:i,options:n}of t)this.window.addEventListener(e,i,n)}get devicePixelRatio(){return this.window.devicePixelRatio}get innerWidth(){return this.window.innerWidth}get innerHeight(){return this.window.innerHeight}get navigator(){return this.window.navigator}getComputedStyle(e,t){return this.window.getComputedStyle(e,t)}matchMedia(e){return this.window.matchMedia?.(e)}getSelection(){return this.window.getSelection()}requestAnimationFrame(e){return this.window.requestAnimationFrame(e)}cancelAnimationFrame(e){this.window.cancelAnimationFrame(e)}shimIdleCallback(e,t){return setTimeout((()=>e(null)),t?.timeout)}requestIdleCallback(e,t){return"function"==typeof this.window.requestIdleCallback?this.window.requestIdleCallback(e,t):this.shimIdleCallback(e,t)}cancelIdleCallback(e){return"function"==typeof this.window.cancelIdleCallback?this.window.cancelIdleCallback(e):clearTimeout(e)}attachListener(e,t,i){let n=this.windowEvents.get(e);null==n&&(n=new Set,this.windowEvents.set(e,n));const s=()=>{n?.delete(o),0===n?.size&&this.windowEvents.delete(e)},a=Yt(i)&&i.once?e=>{s(),t(e)}:t,o={listener:a,options:i};return n.add(o),this.window.addEventListener(e,a,i),()=>{s(),this.window.removeEventListener(e,a,i)}}get body(){return this.document.body}get head(){return this.document.head}isReady(){return"complete"===this.document.readyState}createElement(e,t,i){const n=this.document.createElement(e);if("object"==typeof t&&(i=t,t=void 0),t)for(const e of t.split(" "))n.classList.add(e);return i&&Object.assign(n.style,i),n}createSvgElement(e){return this.document.createElementNS("http://www.w3.org/2000/svg",e)}createResizeObserver(e){const t=this.window.ResizeObserver;if(null!=t)return new t(e)}createIntersectionObserver(e,t){const i=this.window.IntersectionObserver;if(null!=i)return new i(e,t)}createMutationObserver(e){const t=this.window.MutationObserver;if(null!=t)return new t(e)}};function Mc(e,t,i=1/0){const n=t,s=i,a=e%180*(Math.PI/180),o=Math.abs(Math.sin(a)),r=Math.abs(Math.cos(a));if(0===o)return{width:n,height:s};if(0===r)return{width:s,height:n};if(!Number.isFinite(s)){const e=r/o,t=n/(r+e*o);return{width:t,height:e*t}}const l=r*r-o*o;if(0===l){const e=Math.min(n,s)/Math.SQRT2;return{width:e,height:e}}return{width:Math.abs((n*r-s*o)/l),height:Math.abs((s*r-n*o)/l)}}function kc(e,t,i=1/0){const n=t,s=i,a=e%180*(Math.PI/180),o=Math.abs(Math.sin(a)),r=Math.abs(Math.cos(a));return 0===o?{width:n,height:s}:0===r?{width:s,height:n}:{width:n*r+s*o,height:n*o+s*r}}function Dc(e,t,i,n=0,s=0){const a=Math.cos(i),o=Math.sin(i),r=e-n,l=t-s;return{x:n+r*a-l*o,y:s+r*o+l*a}}var wc=2*Math.PI,Ic=Math.PI/2;function Ac(e){return e%=wc,e+=wc,e%=wc}function Cc(e){return e%=wc,(e+=wc)!==wc&&(e%=wc),e}function Nc(e){return(e%=wc)<-Math.PI?e+=wc:e>=Math.PI&&(e-=wc),e}function Lc(e,t,i){const n=Ac(e),s=Ac(t),a=Ac(i);return s<a?s<=n&&n<=a:s>a?s<=n||n<=a:t!==i}function Pc(e){return e/180*Math.PI}function Tc(e){return e/Math.PI*180}function Oc(e,t){return e=Ac(e),(t=Ac(t))-e+(e>t?wc:0)}function Rc(e){const t=Ac(e);return t<=Ic?t/Ic:t<=Math.PI?(Math.PI-t)/Ic:t<=1.5*Math.PI?(t-Math.PI)/Ic:(wc-t)/Ic}function Ec(e,t,i){const n=Rc(i);return e*n+t*Math.abs(1-n)}function zc(e){return e?Ac(Pc(e)):0}var Bc=class{constructor(){this.queue=[]}waitForCompletion(e=50){const t=this.queue;return new Promise((function(i){function n(){clearTimeout(s),i(!0)}const s=setTimeout((function(){const e=t.indexOf(n);e<0||(t.splice(e,1),i(!1))}),e);t.push(n)}))}notify(){for(const e of this.queue.splice(0))e()}};function Fc(e=0){return new Promise((function(t){setTimeout(t,e)}))}async function Vc(e,t,i=`Timeout after ${t}ms`){let n;const s=new Promise(((e,s)=>{n=setTimeout((()=>s(new Error(i))),t)}));try{return await Promise.race([e,s])}finally{clearTimeout(n)}}function $c(e){return"true"===e}function Hc(e){return e}var jc={role:Hc,"aria-checked":$c,"aria-controls":Hc,"aria-describedby":Hc,"aria-disabled":$c,"aria-expanded":$c,"aria-haspopup":Hc,"aria-hidden":$c,"aria-label":Hc,"aria-labelledby":Hc,"aria-live":Hc,"aria-orientation":Hc,"aria-selected":$c,"data-focus-override":$
1c,"data-focus-visible-override":$c,"data-preventdefault":$c,class:Hc,for:Hc,id:Hc,tabindex:function(e){return Number(e)},title:Hc,placeholder:Hc};function Wc(e,t,i){null==i||""===i||""===i?e?.removeAttribute(t):e?.setAttribute(t,i.toString())}function _c(e,t){if(null!=t)for(const[i,n]of yo(t))"class"!==i&&Wc(e,i,n)}function Gc(e,t,i){if(!V(e))return;const n=e.getAttribute(t);return null===n?i:jc[t]?.(n)??void 0}function Kc(e,t,i){null!=e&&(null==i?e.style.removeProperty(t):e.style.setProperty(t,i.toString()))}function Yc(e,t){for(const[i,n]of yo(t))Kc(e,i,n)}function Uc(e,t){const i=Array.isArray(e)?e:e.split(".");if(1===i.length){const[e]=i;return ro(((t,i,n)=>t[e]=n),(t=>t[e]),t)}return ro(((e,t,n)=>Oo(e,i,n)),(e=>Po(e,i)),t)}function Xc(e){return ro(((t,i,n)=>t[e]=n))}function Zc(e,t){return ro(((i,n,s)=>i[e][t??n]=s))}function qc(e){const{newValue:t,oldValue:i,changeValue:n}=e;return ro(((e,s,a,o)=>(a!==o&&(void 0!==o&&i?.call(e,o),void 0!==a&&t?.call(e,a),n?.call(e,a,o)),a)))}function Qc(e){return lo(e)}var Jc=(()=>{var e=class extends Yr{constructor(e){super(),this.node=e,this.enabled=!1,this.stroke="black",this.strokeOpacity=1,this.strokeWidth=1}};return r([qc({changeValue(e){this.node.strokeWidth=e?this.strokeWidth:0}}),ao],e.prototype,"enabled",2),r([Zc("node","stroke"),ao],e.prototype,"stroke",2),r([Zc("node","strokeOpacity"),ao],e.prototype,"strokeOpacity",2),r([qc({changeValue(e){this.enabled?this.node.strokeWidth=e:this.node.strokeWidth=0}}),ao],e.prototype,"strokeWidth",2),e})();function ed(e,t,i,n,s){return t<e.x+e.width&&t+n>e.x&&i<e.y+e.height&&i+s>e.y}function td(e,t,i,n=0,s=0){return t>=e.x&&t+n<=e.x+e.width&&i>=e.y&&i+s<=e.y+e.height}function id(e,t){return{x:e.x+t,y:e.y+t,width:e.width-2*t,height:e.height-2*t}}function nd(e,t,i){return{x:e.x+t,y:e.y+i,width:e.width-2*t,height:e.height-2*i}}function sd(e){return null==e||0===e.height||0===e.width||Number.isNaN(e.height)||Number.isNaN(e.width)}function ad(e,t){return e===t||null!=e&&null!=t&&(e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height)}function od(e,t){const{x:i=0,y:n=0}=t??{};return{currentX:e.canvasX-i,currentY:e.canvasY-n}}function rd(e,t){let{currentX:i,currentY:n}=e;return t?(i+=t.x,n+=t.y,i=Ge(t.x,i,t.x+t.width),n=Ge(t.y,n,t.y+t.height),{canvasX:i,canvasY:n}):{canvasX:i,canvasY:n}}function ld(e,t,i){if(e>t)return;let n;for(;t>=e;){const s=Math.floor((t+e)/2);i(s)?(n=s,e=s+1):t=s-1}return n}function hd(e,t,i){if(e>t)return;let n;for(;t>=e;){const s=Math.floor((t+e)/2);i(s)?(n=s,t=s-1):e=s+1}return n}function cd(e,t,i){if(e>t)return;let n;for(;t>=e;){const s=Math.floor((t+e)/2),a=i(s);null==a?t=s-1:(n=a,e=s+1)}return n}function dd(e,t,i){if(e>t)return;let n;for(;t>=e;){const s=Math.floor((t+e)/2),a=i(s);null==a?e=s+1:(n=a,t=s-1)}return n}var ud,pd="16px system-ui, -apple-system, sans-serif",gd="Hamburgefonstiv 0123456789";function md(){return ud??(ud=function(){const e=fd(0,0);if(null==e)return!0;if("function"!=typeof P())return!1;const t=xd(0,0);return e.font=pd,t.font=pd,e.measureText(gd).width===t.measureText(gd).width}()),ud}function yd(e=0,t=0){return(md()?null:fd(e,t))??xd(e,t)}function fd(e,t){const i=A()?.createElement("canvas");return null==i?null:(i.width=e,i.height=t,i.getContext("2d"))}function xd(e,t){return new(P())(e,t).getContext("2d")}var bd=800,vd=600,Sd={quality:1};function Md(e){const t=class extends e{constructor(...e){super(...e),this.gpu=!1}toBuffer(e,t){return super.toBuffer(e,{...t,msaa:!1})}transferToImageBitmap(){const{width:e,height:i}=this,n=new t(Math.max(1,e),Math.max(1,i));return e>0&&i>0&&n.getContext("2d").drawCanvas(this,0,0,e,i),Object.defineProperty(n,"close",{value:()=>{}}),n}};return t}var kd=!1;function Dd(e,t){kd||(kd=!0,Object.defineProperty(e.prototype,"fillText",{value:function(e,i,n){let s=this.outlineText(e);s=s.transform(new t([1,0,0,1,i,n])),this.fill(s)},writable:!0,configurable:!0}))}var wd=class{constructor(e){this.getter=e}get(){return this.result??(this.result=this.getter()),this.result}clear(){this.result=void 0}},Id=class{constructor(e){this.getter=e}get(){let e=this.result?.deref();return e||(e=this.getter(),this.result=new WeakRef(e),e)}clear(){this.result=void 0}};function Ad(e,t){return e.valueOf()-t.valueOf()}function Cd(e){const t=e.slice().sort(Ad);return null==Nd(t)?function(e){let t=Number.NaN;const i=[];for(const n of e){const e=n.valueOf();t!==e&&i.push(n),t=e}return i}(t):t}function Nd(e){if(0===e.length)return 1;const t=Number(e.at(-1))>Number(e[0])?1:-1;let i=-1/0*t;for(const n of e){const e=n.valueOf();if(Math.sign(e-i)!==t)return;i=e}return t}function Ld(e,t){const i=Math.max(e.length,t.length),n=new Set,s=new Set;for(let a=0;a<i;a++){const i=e[a],o=t[a];i!==o&&(s.has(o)?s.delete(o):o&&n.add(o),n.has(i)?n.delete(i):i&&s.add(i))}return{changed:n.size>0||s.size>0,added:n,removed:s}}function Pd(e,t,i,n){const s=e-i,a=t-n;return s*s+a*a}function Td(e,t,i,n,s,a,o){if(i===s&&n===a)return Math.min(o,Pd(e,t,i,n));const r=s-i,l=a-n,h=Math.max(0,Math.min(1,((e-i)*r+(t-n)*l)/(r*r+l*l))),c=i+h*r,d=n+h*l;return Math.min(o,Pd(e,t,c,d))}function Od(e,t,i,n,s,a,o,r,l){r&&([o,a]=[a,o]);if(!Lc(Math.atan2(t-n,e-i),a,o)){const o=i+Math.cos(a)*s,r=n+Math.sin(a)*s,h=i+Math.cos(a)*s,c=n+Math.sin(a)*s;return Math.min(l,Pd(e,t,o,r),Pd(e,t,h,c))}const h=s-Math.sqrt(Pd(e,t,i,n));return Math.min(l,h*h)}function Rd(e,t){if(0===e.length)return null;if(void 0!==t){const i=e.at(0),n=e.at(-1),s=i instanceof Date?i.getTime():i,a=n instanceof Date?n.getTime():n;if(ti(s)&&ti(a))return 1===t?[s,a]:[a,s]}let i=1/0,n=-1/0;for(const t of e){const e=t instanceof Date?t.getTime():t;ti(e)&&(e<i&&(i=e),e>n&&(n=e))}return ii(i)&&ii(n)?[i,n]:null}function Ed(e,t,i,n,s,a,o){let r=!1;const l=Rd(e,o),h=l&&a?[a(Number(l[0])),a(Number(l[1]))]:l;if(null==h){let e;return null!=t&&null!=i&&t<=i?e=[t,i]:null!=n&&null!=s&&n<=s&&(e=[n,s]),{extent:e??[],clipped:!1}}let[c,d]=h;return null!=t?(r||(r=t>c),c=t):null!=n&&n<c&&(c=n),null!=i?(r||(r=i<d),d=i):null!=s&&s>d&&(d=s),c>d?{extent:[],clipped:!1}:{extent:[c,d],clipped:r}}function zd(e,t,i,n,s){const{extent:a,clipped:o}=Ed(e.domain,Qt(t)?new Date(t):t,Qt(i)?new Date(i):i,Qt(n)?new Date(n):n,Qt(s)?new Date(s):s,(e=>new Date(e)),e.sortMetadata?.sortOrder);return{extent:a.map((e=>new Date(e))),clipped:o}}var Bd=new Intl.NumberFormat("en-US",{style:"percent"});function Fd(e,t=2){return"number"==typeof e?Hd(e,t):"bigint"==typeof e?e.toLocaleStr
1ing("en-US"):"string"==typeof e?e:String(e??"")}function Vd(e){return Bd.format(e)}var $d=(new Map).set(2,new Intl.NumberFormat("en-US",{maximumFractionDigits:2,useGrouping:!1}));function Hd(e,t){let i=$d.get(t);return i||(i=new Intl.NumberFormat("en-US",{maximumFractionDigits:t,useGrouping:!1}),$d.set(t,i)),i.format(e)}function jd(e){return Array.isArray(e)&&e.length>=2&&e.every(Jt)}function Wd(e){return Array.isArray(e)&&e.length>=2&&e.every(jd)}function _d(e){const t=e[0],i=e.at(-1);return void 0!==i&&(nt(t[0],i[0],.001)&&nt(t[1],i[1],.001))}function Gd(e){return Array.isArray(e)&&e.every(Wd)&&e.every(_d)}function Kd(e){if(null===e)return!0;if(!Yt(e)||null==e.type)return!1;const{type:t,coordinates:i}=e;switch(t){case"GeometryCollection":return Array.isArray(e.geometries)&&e.geometries.every(Kd);case"MultiPolygon":return Array.isArray(i)&&i.every(Gd);case"Polygon":return Gd(i);case"MultiLineString":return Array.isArray(i)&&i.every(Wd);case"LineString":case"MultiPoint":return Wd(i);case"Point":return jd(i);default:return!1}}function Yd(e){return Yt(e)&&"Feature"===e.type&&Kd(e.geometry)}function Ud(e){return Yt(e)&&"FeatureCollection"===e.type&&Array.isArray(e.features)&&e.features.every(Yd)}var Xd=rn(Ud,"a GeoJSON object"),Zd=class{constructor(e){this._vertexCount=0,this._edgeCount=0,this.pendingProcessingEdgesFrom=[],this.pendingProcessingEdgesTo=[],this.cachedNeighboursEdge=e?.cachedNeighboursEdge,this.processedEdge=e?.processedEdge,this.singleValueEdges=e?.
1singleValueEdges}clear(){this._vertexCount=0,this._edgeCount=0,this.pendingProcessingEdgesFrom=[],this.pendingProcessingEdgesTo=[],this.singleValueEdges?.clear()}getVertexCount(){return this._vertexCount}getEdgeCount(){return this._edgeCount}addVertex(e){const t=new qd(e);return this._vertexCount++,t}addEdge(e,t,i){i===this.cachedNeighboursEdge?e.updateCachedNeighbours().set(t.value,t):i===this.processedEdge&&(this.pendingProcessingEdgesFrom.push(e),this.pendingProcessingEdgesTo.push(t));const{edges:n}=e,s=n.get(i);s?s.includes(t)||(this.singleValueEdges?.has(i)?n.set(i,[t]):(s.push(t),this._edgeCount++)):(n.set(i,[t]),this._edgeCount++)}removeVertex(e){this._vertexCount--;const t=e.edges;if(t){for(const[,e]of t)this._vertexCount-=e.length;e.clear()}}removeEdge(e,t,i){const n=e.edges.get(i);if(!n)return;const s=n.indexOf(t);-1!==s&&(n.splice(s,1),0===n.length&&e.edges.delete(i),this._edgeCount--,i===this.cachedNeighboursEdge&&e.readCachedNeighbours()?.delete(t.value))}removeEdges(e,t){this._edgeCount-=e.edges.get(t)?.length??0,e.edges.delete(t)}getVertexValue(e){return e.value}*neighbours(e){for(const[,t]of e.edges)for(const e of t)yield e}*neighboursAndEdges(e){for(const[t,i]of e.edges)for(const e of i)yield[e,t]}neighboursWithEdgeValue(e,t){return e.edges.get(t)}findNeighbour(e,t){return e.edges.get(t)?.[0]}findNeighbourValue(e,t){const i=this.findNeighbour(e,t);if(i)return this.getVertexValue(i)}findNeighbourWithValue(e,t,i){const n=null==i?this.neighbours(e):this.neighboursWithEdgeValue(e,i);if(n)for(const e of n)if(this.getVertexValue(e)===t)return e}findVertexAlongEdge(e,t,i){if(i===this.cachedNeighboursEdge){let i;for(const n of t)if(i=(i??e).readCachedNeighbours()?.get(n),!i)return;return i}if(0===t.length)return;let n=e;for(const e of t){const t=n?this.neighboursWithEdgeValue(n,i):void 0;if(!t)return;n=t.find((t=>t.value===e))}return n}adjacent(e,t){for(const[,i]of e.edges)if(i.includes(t))return!0;return!1}},qd=class{constructor(e){this.value=e,this.edges=new Map}readCachedNeighbours(){return this._cachedNeighbours}updateCachedNeighbours(){return this._cachedNeighbours??(this._cachedNeighbours=new Map),this._cachedNeighbours}clear(){this.edges.clear(),this._cachedNeighbours?.clear()}};function Qd(e,t,i,n){if(Ht(t)){if(!Ht(e)||e.length!==t.length||t.some(((t,s)=>null!=Qd(e[s],t,i,n))))return t}else{if(Xt(t)){if(!Xt(e))return t;const s={},a=new Set([...Object.keys(e),...Object.keys(t)]);for(const o of a)if(e[o]!==t[o])if(void 0===n||o in t||void 0===e[o])if(i?.has(o))s[o]=t[o];else if(typeof e[o]==typeof t[o]){const a=Qd(e[o],t[o],i,n);null!==a&&(s[o]=a)}else s[o]=t[o];else s[o]=n;return Object.keys(s).length?s:null}if(e!==t)return t}return null}function Jd(e,t){for(const i of Object.keys(e))if(e[i]!==t?.[i])return!1;return!0}function eu(e,t){return Ht(e)?function(e,t){const i=[],n=t?.seen;for(const s of e)"object"==typeof s&&n?.includes(s)?K("cycle detected in array",s):(n?.push(s),i.push(eu(s,t)),n?.pop());return i}(e,t):Xt(e)?function(e,t){const i={};for(const n of Object.keys(e))t?.assign?.has(n)?i[n]=e[n]:t?.shallow?.has(n)?i[n]=tu(e[n]):i[n]=eu(e[n],t);return i}(e,t):e instanceof Map?new Map(eu(Array.from(e))):tu(e)}function tu(e){return Ht(e)?e.slice(0):Xt(e)?{...e}:Wt(e)?new Date(e):Gt(e)?new RegExp(e.source,e.flags):e}function iu(e,t,i,n,s,a){if(Ht(e)){a=t(e,n,s,a);let o=0;for(const r of e)a=iu(r,t,i,n?.[o],s,a),o++}else if(Xt(e)){a=t(e,n,s,a);for(const o of Object.keys(e)){if(i?.has(o))continue;a=iu(e[o],t,i,n?.[o],s,a)}}return a}function nu(e,t,i,n){return e.addEventListener(t,i,n),()=>e.removeEventListener(t,i,n)}function su(e,t,i){return nu(e,"keydown",(e=>{cu(e,...i?.()??["Escape"])&&t(e)}))}function au(e,t){const i=nu(e.ownerDocument.defaultView,"mousedown",(n=>{[0,2].includes(n.button)&&!ru(e,n)&&(t(),i())}));return i}function ou(e,t){const i=nu(e.ownerDocument.defaultView,"touchstart",(n=>{Array.from(n.targetTouches).some((t=>!ru(e,t)))&&(t(),i())}));return i}function ru(e,t){return!(!B(t.target)||null==t.target.shadowRoot)||z(t.target)&&e.contains(t.target)}function lu(e,t,i){const n=e=>{for(const i of t)Wc(i,"data-focus-visible-override",e)};return n(i),nu(e,"keydown",(()=>n(!0)),{once:!0})}function hu(e){return!(e.shiftKey||e.altKey||e.ctrlKey||e.metaKey)}
1function cu(e,...t){return hu(e)&&t.includes(e.key)}function du(e,t,i){return nu(e,"keydown",(e=>{cu(e,i)&&t.focus()}))}var uu={horizontal:{nextKey:"ArrowRight",prevKey:"ArrowLeft"},vertical:{nextKey:"ArrowDown",prevKey:"ArrowUp"}},pu={nextKey:"ArrowLeft",prevKey:"ArrowRight"};function gu(e,t){return t&&"horizontal"===e?pu:uu[e]}function mu(e){const{orientation:t,buttons:i,wrapAround:n=!1,onEscape:s,onFocus:a,onBlur:o}=e,{nextKey:r,prevKey:l}=gu(t,At(i[0])),h=e=>{if(e.target&&"tabIndex"in e.target){for(const e of i)e.tabIndex=-1;e.target.tabIndex=0}},[c,d]=n?[i.length,i.length]:[0,1/0],u=new Ve;for(let e=0;e<i.length;e++){const t=i[(c+e-1)%d],n=i[e],p=i[(c+e+1)%d];u.register(nu(n,"focus",h),a&&nu(n,"focus",a),o&&nu(n,"blur",o),s&&su(n,s),t&&du(n,t,l),p&&du(n,p,r),nu(n,"keydown",(e=>{cu(e,r,l)&&e.preventDefault()}))),n.tabIndex=0===e?0:-1}return u}function yu(e,t){return i=>{if("true"===e.ariaDisabled)return i.preventDefault();t(i)}}function fu(e){return"button"in e?0===e.button:hu(e)&&("Space"===e.code||"Enter"===e.key)}function xu(e){const t=e?.target;if(B(t)&&"tabindex"in t.attributes)return t}function bu(e){return nu(e,"keydown",(e=>{if(e.defaultPrevented)return;Gc(e.target,"data-preventdefault",!0)&&cu(e,"ArrowRight","ArrowLeft","ArrowDown","ArrowUp")&&e.preventDefault()}))}var vu=new Map,Su=1;function Mu(){vu.clear(),Su=1}function ku(e){const t=e.constructor;let i=Object.hasOwn(t,"className")?t.className:t.name;ie((()=>{if(!i)throw new Error(`The ${String(t)} is missing the 'className' property.`)})),i??(i="Unknown");const n=(vu.get(i)??0)+1;return vu.set(i,n),`${i}-${n}`}function Du(){return"ag-charts-"+Su++}function wu(){return crypto.randomUUID?.()??function(){const e=new Uint8Array(16);crypto.getRandomValues(e),e[6]=15&e[6]|64,e[8]=63&e[8]|128;let t="";for(let i=0;i<e.length;i++)4!==i&&6!==i&&8!==i&&10!==i||(t+="-"),t+=e[i].toString(16).padStart(2,"0");return t}()}var Iu=/^\d{4}-\d{2}-\d{2}(T([01]\d|2[0-3]):[0-5]\d(:[0-5]\d(\.\d+)?)?(Z|[+-]([01]\d|2[0-3]):[0-5]\d)?)?$/,Au=[31,28,31,30,31,30,31,31,30,31,30,31];function Cu(e,t,i){let n=0;for(let s=0;s<i;s++)n=10*n+(e.charCodeAt(t+s)-48);return n}function Nu(e){if("string"!=typeof e||!Iu.test(e))return!1;const t=Cu(e,5,2);if(t<1||t>12)return!1;const i=Cu(e,0,4),n=Cu(e,8,2);return n>=1&&n<=(2===t&&(i%4==0&&i%100!=0||i%400==0)?29:Au[t-1])}function Lu(e){return Nu(e)?new Date(e):e}function Pu(e,t,i){let n=e,s=n;for(const e of t)if(null==n||i(n.value,e)>0)n={value:e,next:n},s=n;else{for(;null!=s.next&&i(s.next.value,e)<=0;)s=s.next;s.next={value:e,next:s.next}}return n}var Tu=new WeakMap;function Ou(e,t){const i=JSON.stringify(e,null,0);return Tu.has(t)||Tu.set(t,new Map),Tu.get(t)?.has(i)||Tu.get(t)?.set(i,t(e)),Tu.get(t)?.get(i)}var Ru=class{constructor(){this.weak=new WeakMap,this.strong=new Map,this.set=!1,this.value=void 0}};function Eu(e,t){let i=new Ru;const n=(...n)=>{let s=i;for(const e of n){const t="object"==typeof e||"symbol"==typeof e?s.weak:s.strong;let i=t.get(e);null==i&&(i=new Ru,t.set(e,i)),s=i}if(s.set)return t?.("hit",e,n),s.value;{const i=e(...n);return s.set=!0,s.value=i,t?.("miss",e,n),i}};return n.reset=()=>{i=new Ru},n}function zu(e,t){const i=new Map,n={},s=new WeakMap;return(...a)=>{const o=0===a.length?[n]:((...e)=>e.map((e=>"object"==typeof e||"symbol"==typeof e?e:(i.has(e)||i.set(e,{v:e}),i.get(e)))))(...a);let r=s;for(const e of o.slice(0,-1))r.has(e)||r.set(e,new WeakMap),r=r.get(e);const l=o.at(-1);let h=r.get(l);return h?t?.("hit",e,a):(h=e(...a),r.set(l,h),t?.("miss",e,a)),h}}function Bu(e,t,i,n=1/0){const s={nearest:void 0,distanceSquared:n};for(const n of i){const i=n.distanceSquared(e,t);if(0===i)return{nearest:n,distanceSquared:0};i<s.distanceSquared&&(s.nearest=n,s.distanceSquared=i)}return s}function Fu(e,t,i,n=1/0){const{x:s=e,y:a=t}=i.transformPoint?.(e,t)??{},o={nearest:void 0,distanceSquared:n};for(const e of i.children){const{nearest:t,distanceSquared:i}=e.nearestSquared(s,a,o.distanceSquared);if(0===i)return{nearest:t,distanceSquared:i};i<o.distanceSquared&&(o.nearest=t,o.distanceSquared=i)}return o}var Vu=(()=>{var e=class extends Yr{constructor(e=0,t=e,i=e,n=t){super(),this.top=e,this.right=t,this.bottom=i,this.left=n}};return r([ao],e.prototype,"top",2),r([ao],e.prototype,"right",2),r([ao],e.prototype,"bottom",2),r([ao],e.prototype,"left",2),e})();
1function $u(e,t,i,n){let{top:s,right:a,bottom:o,left:r,width:l,height:h}=n;return null!=r?null!=l?a=i.width-r+l:null!=a&&(l=i.width-r-a):null!=a&&null!=l&&(r=i.width-a-l),null!=s?null!=h?o=i.height-s-h:null!=o&&(h=i.height-o-s):null!=o&&null!=h&&(s=i.height-o-h),null==l?null==h?(h=t,l=e):l=Math.ceil(e*h/t):h??(h=Math.ceil(t*l/e)),null==r&&(r=null==a?Math.floor((i.width-l)/2):i.width-a-l),null==s&&(s=null==o?Math.floor((i.height-h)/2):i.height-h-o),{x:r,y:s,width:l,height:h}}var Hu="color: green",ju="color: grey";function Wu(){return lo((()=>{}))}function _u(e,t){const i=co(t);if(0===i.length)return;const n=uo(e);for(const e of i)e in n&&(t[e]=n[e])}var Gu=class{transitionRoot(e,t){this.parent?this.parent.transitionRoot(e,t):this.transition(e,t)}},Ku=(()=>{var e=class e extends Gu{constructor(e,t,i){super(),this.defaultState=e,this.states=t,this.enterEach=i,this.debug=ee(!0,"animation"),this.state=e,this.debug(`%c${this.constructor.name} | init -> ${e}`,Hu)}transition(t,i){if(!this.transitionChild(t,i)||this.state===e.child||this.state===e.parent)return;const n=this.state,s=this.states[this.state];let a=s[t];const o=`%c${this.constructor.name} | ${this.state} -> ${t} ->`;if(Array.isArray(a))a=a.find((e=>{if(!e.guard)return!0;const t=e.guard(i);return t||this.debug(`${o} (guarded)`,e.target,ju),t}));else if("object"==typeof a&&!(a instanceof e)&&a.guard&&!a.guard(i))return void this.debug(`${o} (guarded)`,a.target,ju);if(!a)return void this.debug(`${o} ${this.state}`,ju);const r=this.getDestinationState(a),l=r===this.state?void 0:s.onExit;this.debug(`${o} ${r}`,Hu),this.state=r,"function"==typeof a?a(i):"object"!=typeof a||a instanceof e||a.action?.(i),l?.(),this.enterEach?.(n,r),r!==n&&r!==e.child&&r!==e.parent&&this.states[r].onEnter?.(n,i)}transitionAsync(e,t){setTimeout((()=>{this.transition(e,t)}),0)}is(t){return this.state===e.child&&this.childState?this.childState.is(t):this.state===t}resetHierarchy(){this.debug(`%c${this.constructor.name} | ${this.state} -> [resetHierarchy] -> ${this.defaultState}`,"color: green"),this.state=this.defaultState}transitionChild(t,i){return this.state!==e.child||!this.childState||(_u(this,this.childState),this.childState.transition(t,i),!this.childState.is(e.parent)||(this.debug(`%c${this.constructor.name} | ${this.state} -> ${t} -> ${this.defaultState}`,Hu),this.state=this.defaultState,this.states[this.state].onEnter?.(),this.childState.resetHierarchy(),!1))}getDestinationState(t){let i=this.state;return"string"==typeof t?i=t:t instanceof e?(this.childState=t,this.childState.parent=this,i=e.child):"object"==typeof t&&(t.target instanceof e?(this.childState=t.target,this.childState.parent=this,i=e.child):null!=t.target&&(i=t.target)),i}};return e.child="__child",e.parent="__parent",e})(),Yu=class extends Gu{constructor(...e){super(),this.stateMachines=e;for(const t of e)t.parent=this}transition(e,t){for(const i of this.stateMachines)_u(this,i),i.transition(e,t)}transitionAsync(e,t){for(const i of this.stateMachines)_u(this,i),i.transitionAsync(e,t)}},Uu=class{constructor(e,t){this.ctx=e,this.measureTextCached=t,this.baselineMap=new Map,this.charMap=new Map,this.lineHeightCache=null}baselineDistance(e){if("alphabetic"===e)return 0;if(this.baselineMap.has(e))return this.baselineMap.get(e);this.ctx.textBaseline=e;const{alphabeticBaseline:t}=this.ctx.measureText("");return this.baselineMap.set(e,t),this.ctx.textBaseline="alphabetic",t}lineHeight(){return this.lineHeightCache??(this.lineHeightCache=this.measureText("").height),this.lineHeightCache}measureText(e){const t=this.measureTextCached?.(e)??this.ctx.measureText(e),{width:i,fontBoundingBoxAscent:n=t.emHeightAscent,fontBoundingBoxDescent:s=t.emHeightDescent}=t;return{width:i,height:n+s,ascent:n,descent:s}}measureLines(e){const t="string"==typeof e?e.split(vt):e;let i=0,n=0;const s=t.map((e=>{const t=this.measureText(e);return i<t.width&&(i=t.width),n+=t.height,{text:e,...t}}));return{width:i,height:n,lineMetrics:s}}textWidth(e,t){if(t){let t=0;for(let i=0;i<e.length;i++)t+=this.textWidth(e.charAt(i));return t}return e.length>1?this.ctx.measureText(e).width:this.charMap.get(e)??this.charWidth(e)}charWidth(e){const{width:t}=this.ctx.measureText(e);return this.charMap.set(e,t),t}},Xu=new p(50);function Zu(e){"object"==typeof e&&(e=di(e));let t=Xu.get(e);if(t)return t;const i=new p(1e4),n=yd();
1return n.font=e,t=new Uu(n,(e=>{let t=i.get(e);return t||(t=n.measureText(e),i.set(e,t),t)})),Xu.set(e,t),t}function qu(e){return null==e?{top:0,right:0,bottom:0,left:0}:"number"==typeof e?{top:e,right:e,bottom:e,left:e}:{top:e.top??0,right:e.right??0,bottom:e.bottom??0,left:e.left??0}}function Qu(e){const t=qu(e.padding),i=e.width+t.left+t.right,n=e.height+t.top+t.bottom;return{width:i,height:n,ascent:n,descent:0}}function Ju(e){return"baseline"===e?"alphabetic":e}function ep(e,t,i,n){switch(e){case"top":case"hanging":return{above:i,below:t-i};case"bottom":case"ideographic":return{above:t-n,below:n};case"middle":{const e=(i-n)/2+t/2;return{above:e,below:t-e}}default:return{above:t,below:0}}}Zu.clear=()=>Xu.clear();var tp=4;function ip(e){if(0===e.length)return 0;let t=0;for(let i=0;i<e.length;i++)t+=e[i].textMetrics.width,i>0&&(t+=tp);return t}function np(e){let t=0;for(const i of e)t=Math.max(t,i.textMetrics.height);return t}function sp(e,t){const i=e[t];if("image"!==i?.type||!0!==i.block)return!1;let n=t;for(;n>0;){const t=e[n-1];if("image"!==t.type)return pi(t.text).endsWith("\n");if(!0!==t.block)return!1;n--}return!0}function ap(e,t){let i={segments:[],width:0,height:0,ascent:0,descent:0,textAscent:0,textDescent:0};const n=[i];let s=!1,a=null;function o(){if(null===a)return;let e=n.length;s&&e>a+1&&(e-=1),n[a].blockRowSpan=e-a,a=null}function r(){i={segments:[],width:0,height:0,ascent:0,descent:0,textAscent:0,textDescent:0},n.push(i),s=!0}for(let l=0;l<e.length;l++){const h=e[l];if(sp(e,l)){const t=l>0&&"image"===e[l-1].type&&!0===e[l-1].block;t||(o(),(i.segments.length>0||i.blockImages)&&r());const c=Qu(h),d={...h,textMetrics:c};i.blockImages??(i.blockImages=[]),i.blockImages.push(d),t||(a=n.length-1),s=!1;continue}if("image"===h.type){const e=Qu(h);i.width+=e.width,i.segments.push({...h,textMetrics:e}),s=!1;continue}const{text:c,fontSize:d=t.fontSize,fontStyle:u=t.fontStyle,fontWeight:p=t.fontWeight,fontFamily:g=t.fontFamily,lineHeight:m,minimumFontSize:y,...f}=h,x={fontSize:d,fontStyle:u,fontWeight:p,fontFamily:g},b=Zu(x),v=pi(c).split(vt);for(let e=0;e<v.length;e++){const t=v[e],n=b.measureText(t);e>0&&r(),t&&(i.width+=n.width,i.ascent=Math.max(i.ascent,n.ascent),i.descent=Math.max(i.descent,n.descent),i.height=Math.max(i.height,i.ascent+i.descent),"number"==typeof m&&m>i.height&&(i.descent=m-i.ascent,i.height=m),i.segments.push({...x,...f,text:t,textMetrics:n}),s=!1)}}o();for(const e of n){e.textAscent=e.ascent,e.textDescent=e.descent;for(const t of e.segments){if("image"!==t.type)continue;const{above:i,below:n}=ep(Ju(t.verticalAlign),t.textMetrics.height,e.textAscent,e.textDescent);e.ascent=Math.max(e.ascent,i),e.descent=Math.max(e.descent,n)}e.height=Math.max(e.height,e.ascent+e.descent)}let l=0,h=0;for(let e=0;e<n.length;){const t=n[e];if(t.blockImages?.length){const i=t.blockRowSpan??1,s=ip(t.blockImages),a=np(t.blockImages);let o=0,r=0;for(let t=0;t<i;t++){const i=n[e+t];o=Math.max(o,i.width),r+=i.height}const c=s+(o>0?tp+o:0),d=Math.max(a,r);l=Math.max(l,c),h+=d,e+=i}else l=Math.max(l,t.width),h+=t.height,e+=1}return{width:l,height:h,lineMetrics:n}}function op(e,t,i){const n=A().createElement(e);if("object"==typeof t&&(i=t,t=void 0),t)for(const e of t.split(" "))n.classList.add(e);return i&&Object.assign(n.style,i),n}function rp(e,t){const i=t?t.createElement("style"):op("style");return null!=e&&(i.nonce=e),i}function lp(e){return A().createElementNS("http://www.w3.org/2000/svg",e)}function hp(e,t){const i=A("body"),n=op("a",{display:"none"});n.href=e,n.download=t,i.appendChild(n),n.click(),setTimeout((()=>n.remove()))}var cp=(e,t,i,n)=>{const s=e.crossCentre-n/2;return e.vertical?{x:s,y:t,width:n,height:i-t}:{x:t,y:s,width:i-t,height:n}},dp=(e,t)=>e.extentLo+(e.extentHi-e.extentLo)*(t-e.spanLo)/(e.spanHi-e.spanLo);function up(e){return cp(e,e.spanLo,e.spanHi,Math.max(e.extentLo,e.extentHi))}function pp(e,t,i){if(e.spanHi<=e.spanLo)return Math.max(e.extentLo,e.extentHi);const n=Math.max(e.spanLo,Math.min(t,i)),s=Math.min(e.spanHi,Math.max(t,i));return n>s?0:Math.max(0,Math.min(dp(e,n),dp(e,s)))}function gp(e,t,i){return cp(e,e.spanLo,e.spanHi,pp(e,t,i))}function mp(e,t){const i=e.vertical?t.y:t.x,n=i+(e.vertical?t.height:t.width),s=Math.max(e.spanLo,i),a=Math.min(e.spanHi,n);if(s>=a)return!1;const o=e.spanHi>e.spanLo?Math.max(dp(e,s),dp(e,a)):Math.max(e.extentLo,e.extentHi);if(o<=0)return!1;const r=e.vertical?t.x:t.y,l=r+(e.vertical?t.width:t.height);return r<e.crossCentre+o/2&&l>e.crossCentre-o/2}function yp(e,t,i,n=0){const[s,a]=e.spanAt(t,i);return Math.max(0,2*Math.min(n-s,a-n))}function fp(e,t){const i=Math.floor((e.extentAbove+e.extentBelow)/t);if(i<1)return 0;const n=[];for(let i=-e.extentAbove;i+t<=e.extentBelow;i+=t/2)n.push(yp(e,i,i+t));return n.toSorted(((e,t)=>t-e)).slice(0,i).reduce(((e,t)=>e+t),0)}function xp(e,t){return{spanAt:(i,n)=>{const s=pp(e,t+i,t+n)/2;return[-s,s]},extentAbove:t-e.spanLo,extentBelow:e.spanHi-t}}function bp(e,t,i,n=20,s=5,a=16){const o=(o,r,l)=>
1{const h=Math.max(2,s),c=(r-o)/(h-1);return vp((i=>{const n=e.x+l*i;for(let i=0;i<h;i+=1)if(!t(n,e.y+o+c*i))return!1;return!0}),i,a,n)},r=s=>vp((i=>t(e.x,e.y+s*i)),i,a,n);return{spanAt:Sp(((e,t)=>[-o(e,t,-1),o(e,t,1)])),extentAbove:r(-1),extentBelow:r(1)}}function vp(e,t,i,n){const s=Math.max(1,i),a=t/s;let o=0,r=t;for(let i=1;i<=s;i+=1){const n=Math.min(i*a,t);if(!e(n)){r=n;break}o=n}if(o>=t)return t;for(let t=0;t<n;t+=1){const t=(o+r)/2;e(t)?o=t:r=t}return o}function Sp(e){const t=new Map;return(i,n)=>{const s=`${i},${n}`;let a=t.get(s);return null==a&&(a=e(i,n),t.set(s,a)),a}}function Mp(e,t,i){return{spanAt:(n,s)=>{const[a,o]=e.spanAt(n-i,s+i),r=(a+o)/2;return[Math.min(a+t,r),Math.max(o-t,r)]},extentAbove:Math.max(0,e.extentAbove-i),extentBelow:Math.max(0,e.extentBelow-i)}}var kp=[0,0];function Dp(e,t,i){const n=e.rows,s=e.top*t,a=e.rowHeight*t,{x:o,y:r}=i,l=e=>(r+e-s)/a;return{spanAt:(e,i)=>{const s=Math.max(0,Math.floor(l(e)-.5)),a=Math.min(n.length-1,Math.ceil(l(i)+.5)-1);if(s>a)return kp;let r=-1/0,h=1/0;for(let e=s;e<=a;e+=1){const i=n[e];if(null==i)return kp;r=Math.max(r,i[0]*t),h=Math.min(h,i[1]*t)}return r<=h?[r-o,h-o]:kp},extentAbove:r-s,extentBelow:s+n.length*a-r}}function wp(e,t,i){return null==e.maxWidthAt?e.maxWidth:Math.min(e.maxWidth,e.maxWidthAt(t,i))}function Ip(e,t){return"hide"===t.overflow&&e.some(Ni)}function Ap(e){return"preserve"===e.overflow}function Cp(e,t){return Ht(e)?lg(e,t):ng(pi(e),t).join("\n")}function Np(e,t){return ng(e,t).join("\n")}function Lp(e,t,i){if(null==t)return e;const{maxWidth:n,maxHeight:s,wrapping:a,overflowStrategy:o,region:r}=t;if(null==n&&null==s&&null==r)return e;const l=o??"preserve",h={font:i,maxWidth:n??1/0,maxHeight:"preserve"===l?void 0:s,textWrap:a,overflow:l};return null==r?Cp(e,h):zp(e,h,r,t.regionAlign??"center",!0).text}function Pp(e,t,i,n=!1){if(null==t?.region)return{text:Lp(e,t,i),offsetX:0,offsetY:0};const s=t.overflowStrategy??"preserve";return zp(e,{font:i,maxWidth:t.maxWidth??1/0,maxHeight:"preserve"===s?void 0:t.maxHeight,textWrap:t.wrapping,overflow:s},t.region,t.regionAlign??"center",n)}function Tp(e,t){return Ht(e)?ap(e,t):Zu(t).measureLines(pi(e))}function Op(e){return e.replaceAll(bt,"").replace(/\s/g,"").length}function Rp(e,t,i,n){if(t>=n)return-i.extentAbove;let s=-t/2;return"start"===e?s=0:"end"===e&&(s=-t),Math.min(Math.max(s,-i.extentAbove),i.extentBelow-t)}function Ep(e,t,i,n,s,a,o,r){const l=Math.min(o*a,s),h=Rp(n,l,i,s),c=[];for(let e=0;e<o;e+=1)c.push([h+e*a,h+(e+1)*a]);const d=r?0:function(e,t){const i=t.map((([t,i])=>e.spanAt(t,i))),n=[0];for(const[e,t]of i)e<t&&n.push((e+t)/2);let s=0,a=-1;for(const e of n){let t=0;for(const[n,s]of i)t+=Math.max(0,2*Math.min(e-n,s-e));t>a&&(a=t,s=e)}return s}(i,c),u=(e,t)=>yp(i,h+e,h+t,d),p=Cp(e,{...t,lineHeight:a,maxHeight:l,maxWidthAt:u}),g=function(e,t,i,n,s){if(""===e||"ellipsis"!==i.overflow||Ni(e))return e;if(Op(e)>=Op(t))return e;const a=e.split("\n"),o=a.length-1,r=n(o*s,(o+1)*s);return a[o]=sg(a[o],Zu(i.font),r,!0),a.join("\n")}(String(p),e,t,u,a);return{text:g,offsetX:d,offsetY:h+l/2,consistent:g.split("\n").length===o}}function zp(e,t,i,n,s=!1){const a=Math.min(t.maxHeight??1/0,i.extentAbove+i.extentBelow);if(Ht(e))return{text:Fp(e,t,i,n,a),offsetX:0,offsetY:0};const o=Zu(t.font).lineHeight(),r=pi(e),l=Op(r),h=Math.floor(a/Math.max(1,o)),c=Math.max(1,Math.min(h,r.length));let d,u=0;for(let e=1;e<=c;e+=1){const h=Ep(r,t,i,n,a,o,e,s),c=Op(h.text);if(Bp(h.consistent,c,d?.consistent,u)&&(u=c,d=h),u>=l&&!0===d?.consistent)break}return null==d?{text:e,offsetX:0,offsetY:0}:{text:d.text,offsetX:d.offsetX,offsetY:d.offsetY}}function Bp(e,t,i,n){return null==i||(e!==i?e:t>n)}function Fp(e,t,i,n,s){let a=Tp(e,t.font).height,o=1,r=e;for(let l=0;l<12;l+=1){const l=Rp(n,Math.min(a,s),i,s);r=Cp(e,{...t,lineHeight:a/o,maxHeight:s,maxWidthAt:(e,t)=>yp(i,l+e,l+t)});const h=Tp(r,t.font).height;if(o=Math.max(1,Math.round(h/(a/o))),h===a)break;a=h}return r}function Vp(e,t){return null==e||null==t?e:{...e,region:t}}function $p(e){return Ht(e)?0===e.length:0===String(e).length}function Hp(e){if(!Ht(e))return Op(pi(e));let t=0;for(const i of e)"image"!==i.type&&(t+=Op(pi(i.text)));return t}function jp(e){if(!Ht(e))return Op(pi(e))>0;for(const t of e)if("image"!==t.type&&Op(pi(t.text))>0)return!0;return!1}function Wp(e,t,i,n){const s=Lp(e,t,n);return null==i||!$p(s)||$p(e)?s:Lp(e,i,n)}function _p(e,t){return null==t||t===e.fontSize?e:{fontSize:t,fontStyle:e.fontStyle,fontWeight:e.fontWeight,fontFamily:e.fontFamily}}function Gp(e,t){return null==e?t:Math.min(e,t)}function Kp(e,t){const i=e-1;if(!(i<0))return t(i)??cd(0,i-1,t)}function Yp(e,t){const i=Math.floor(e)===e?e+1:Math.ceil(e),n=Math.ceil(t)===t?t-1:Math.floor(t),s=2+Math.max(0,n-i+1);return{steps:s,sizeAt:n=>0===n?e:n===s-1?t:i+n-1}}function Up(e,t,i){if(e>=t)return i(t,!0);const{steps:n,sizeAt:s}=Yp(e,t);return Kp(n,(e=>i(s(e),0===e)))}function Xp(e,t,i){if(e>=t)return i(t,!0);const{steps:n,sizeAt:s}=Yp(e,t);for(let e=n-1;e>=0;e--){const t=i(s(e),0===e);if(void 0!==t)return t}}function Zp(e,t){return{min:Gp(t,e),max:e}}function qp(e,t){return 1===t?e.max:e.min+(e.max-e.min)*t}function Qp(e,t,i){return Zp(e.fontSize??i.fontSize,e.minimumFontSize??t)}function Jp(e){return"image"!==e.type&&null!=e.minimumFontSize}function eg(e,t,i,n){const s=qp(Zp(i.fontSize,t),n);if(!Ht(e))return{text:e,fontSize:s};return{text:e.map((e=>{if("image"===e.type||null==e.fontSize&&null==e.minimumFontSize)return e;const s=Qp(e,t,i),a=qp(s,n);return{...e,fontSize:a,lineHeight:null==e.lineHeight?void 0:e.lineHeight*a/s.max}})),fontSize:s}}function tg(e,t,i){const n=null==t?void 0:function(e,t,i){const{minimumFontSize:n,maxWidth:s,maxHeight:a,region:o}=t;if(null==s&&null==a&&null==o)return;if(!(null!=n||Ht(e)&&e.some(Jp)))return;let r=Zp(i.fontSize,n);if(Ht(e))for(const t of e){if("image"===t.type)continue;
1const e=Qp(t,n,i);e.max-e.min>r.max-r.min&&(r=e)}return r.max>r.min?r:void 0}(e,t,i);if(null==t||null==n)return{text:Lp(e,t,i)};const{minimumFontSize:s}=t,a={...t,overflowStrategy:"hide"},o=Up(n.min,n.max,((o,r)=>{const l=(o-n.min)/(n.max-n.min),h=eg(e,s,i,l),c=Lp(h.text,r?t:a,_p(i,h.fontSize));if(!$p(c))return{text:c,fontSize:h.fontSize===i.fontSize?void 0:h.fontSize}}));if(o)return o;const r=eg(e,s,i,0);return{text:Lp(r.text,t,_p(i,r.fontSize))}}function ig(e,t,i,n){const s=tg(e,t,n);return null==i||!$p(s.text)||$p(e)?s:tg(e,i,n)}function ng(e,t){return ag(e,t)}function sg(e,t,i,n){const s=t.textWidth(bt),a=Ti(e);let o=0,r=0;for(const e of a){const n=t.textWidth(e);if(o+n>i)break;o+=n,r+=e.length}if(r===e.length&&(!n||o+s<=i))return n?mi(e):e;const l=Ti(e=e.slice(0,r).trimEnd());for(;l.length&&t.textWidth(e)+s>i;){for(l.pop();l.length&&""===l.at(-1).trim();)l.pop();e=l.join("")}return mi(e)}function ag(e,t,i=0,n=0){const s=e.split(vt),a=Zu(t.font),o=[],r=Ap(t),l=null==t.maxWidthAt?0:t.lineHeight??a.lineHeight(),h=()=>{const e=n+o.length*l;return wp(t,e,e+l)};if("never"===t.textWrap){if(r)return s.map((e=>e.trimEnd()));for(const e of s){const t=sg(e.trimEnd(),a,Math.max(0,h()-i));if(!t)break;o.push(t),i=0}return Ip(o,t)?[]:o}const c="hyphenate"===t.textWrap,d=null==t.textWrap||"on-space"===t.textWrap;for(const e of s){let t=e.trimEnd();if(""===t){o.push(t);continue}let n=Ti(t),s=0,l=0,u=0,p=0;const g=e=>{t=t.slice(e).trimStart(),n=Ti(t),s=0,l=0,u=0,p=0};for(o.length||(u=i);s<n.length;){const e=n[s];if(" "===e&&(p=l),u+=a.textWidth(e),u>h()){if(0===s){r||(t="");break}let n=a.textWidth(t.slice(0,l+e.length));if(o.length||(n+=i),n<=h()){u=n,l+=e.length,s++;continue}if(r&&d){const e=p||t.indexOf(" ",1);if(e<1)break;o.push(t.slice(0,e).trimEnd()),g(e);continue}if(p){const e=og(t,p+1);if(a.textWidth(e)<=h()){o.push(t.slice(0,p).trimEnd()),g(p);continue}if(d){const e=t.slice(p).trimStart();o.push(t.slice(0,p).trimEnd());const i=h();o.push(a.textWidth(e)<=i?e:sg(e,a,i,!0))}}else if(d){const e=sg(t,a,h(),!0);e&&o.push(e)}if(d){t="";break}const m=c?"-":"";let y=t.slice(0,l).trim();const f=Ti(y);for(;f.length&&a.textWidth(y+m)>h();){for(f.pop();f.length&&""===f.at(-1).trim();)f.pop();y=f.join("")}if(!y||y===St){r||(t="");break}o.push(fi(y)+m),g(y.length)}else l+=e.length,s++}t&&o.push(t)}!function(e,t,i){if(!1===i.avoidOrphans||e.length<2)return;const{length:n}=e,s=e[n-1],a=e[n-2];if(Ti(a).length<Ti(s).length)return;const o=a.lastIndexOf(" ");if(-1===o||o===a.indexOf(" ")||s.includes(" "))return;const r=a.slice(o+1),l=null==i.maxWidthAt?i.maxWidth:function(e,t,i){const{lineMetrics:n}=t.measureLines(e);let s=0;for(let e=0;e<n.length-1;e+=1)s+=n[e].height;return wp(i,s,s+n.at(-1).height)}(e,t,i),h=r+" "+s;t.textWidth(h)<=l&&(e[n-2]=a.slice(0,o),e[n-1]=h)}(o,a,t);const u=rg(o,a,t);return Ip(u,t)?[]:u}function og(e,t){const i=e.indexOf(" ",t);return-1===i?e.slice(t):e.slice(t,i)}function rg(e,t,i){if(!Jt(i.maxHeight))return e;const{height:n,lineMetrics:s}=t.measureLines(e);if(n<=i.maxHeight)return e;for(let n=0,a=0;n<s.length;n++){const o=a;if(a+=s[n].height,a>i.maxHeight){if("hide"===i.overflow||0===n)return[];const a=e.slice(0,n),r=a.pop(),l=wp(i,o-s[n-1].height,o);return a.concat(Ni(r)?r:sg(r,t,l,!0))}}return e}function lg(e,t){const i=function(e){const t=[];let i=null;for(let n=0;n<e.length;n++){const s=e[n];sp(e,n)?n>0&&"image"===e[n-1].type&&!0===e[n-1].block&&i?i.blockImages.push(s):(i&&t.push(i),i={blockImages:[s],segments:[]}):(i??(i={blockImages:[],segments:[]}),i.segments.push(s))}return i&&t.push(i),t}(e);if(0===i.length)return[];if(1===i.length&&0===i[0].blockImages.length&&!i[0].segments.some((e=>"image"===e.type))){const e=Sg(i[0].segments,t);return hg(i[0].segments,e,t)?[]:e}let n=t.maxHeight??1/0;const s=[];for(const e of i){if(n<=0)break;const i=ug(e,Number.isFinite(n)?{...t,maxHeight:n}:t);0!==i.length&&(s.push(...i),Number.isFinite(n)&&(n-=ap(i,t.font).height))}return hg(e,s,t)?[]:s}function hg(e,t,i){return"hide"===i.overflow&&(!!bg(t)||!(cg(t)>=cg(e))&&dg(t)<dg(e))}function cg(e){return e.reduce(((e,t)=>"image"===t.type?e:e+pi(t.text).length),0)}function dg(e){return e.reduce(((e,t)=>"image"===t.type?e:e+Op(pi(t.text))),0)}function ug(e,t){return 0===e.blockImages.length?pg(e.segments,t):function(e,t,i){const n=i.maxHeight??1/0,s=function(e,t){const i=t.maxHeight??1/0,n=[];for(const s of e){const e=Qu(s);e.width>t.maxWidth||e.height>i||n.push({...s,textMetrics:e})}const s=()=>ip(n)<=t.maxWidth;for(;!s()&&mg(n,fg("hide")););for(;!s()&&mg(n,fg("keep")););return n}(e,i);if(0===s.length)return pg(t,i);const a=s.every((e=>"keep"===(e.overflowStrategy??"hide"))),o=ip(s);if(0===t.length)return s;const r=i.maxWidth-o-tp;if(r<=0)return a?s:pg(t,i);const l={...i,maxWidth:r,maxHeight:Math.max(0,n)},h=function(e,t,i){if(!i)return pg(e,t);const n=e.slice();let s=pg(n,t);for(;(bg(s)||vg(n,s))&&mg(n,yg);)s=pg(n,t);return s}(t,l,a);if(!Ap(i)&&h.length>0&&ap(h,i.font).width>r)return s;return[...s,...h]}(e.blockImages,e.segments,t)}function pg(e,t){return 0===e.length?[]:e.some((e=>"image"===e.type))?function(e,t){const i=t.maxHeight??1/0,n=[];for(const s of e){if("image"===s.type){const e=Qu(s);if(e.width>t.maxWidth||e.height>i)continue}n.push(s)}let s=Sg(n,t);return s=gg(n,t,s,(()=>mg(n,fg("hide")))),s=gg(n,t,s,(()=>function(e,t){return e.some(fg(t))}(n,"keep")&&mg(n,yg))),s=gg(n,t,s,(()=>mg(n,fg("keep")))),s}(e,t):Sg(e,t)}function gg(e,t,i,n){for(;!xg(e,i)&&n();)i=Sg(e,t);return i}function mg(e,t){for(let i=e.length-1;i>=0;i--)if(t(e[i]))return e.splice(i,1),!0;return!1}var yg=e=>"image"!==e.type;function fg(e){return t=>"image"===t.type&&(t.overflowStrategy??"hide")===e}function xg(e,t){if(bg(t))return!1;const i=e.reduce(((e,t)=>e+("image"===t.type?1:0)),0);return t.reduce(((e,t)=>e+("image"===t.type?1:0)),0)>=i}function bg(e){return e.some((e=>"image"!==e.type&&Ni(e.text)))}function vg(e,t){const i=e.reduce(((e,t)=>"image"===t.type?e:e+1),0);return t.reduce(((e,t)=>"image"===t.type?e:e+1),0)<i}function Sg(e,t){const{maxHeight:i=1/0}=t,n=Ap(t),s=[];let a=0,o=0;const r=(e=0)=>wp(t,o,o+e);function l(){const e=s.pop();if(!e)return;if("image"===e.type)return;const t=Zu(e),i=sg(e.text,t,r(),!0),n=t.measureText(i);s.push({...e,text:i,textMetrics:n})}function h(e){const r=Zu(e),h=Ii(e.text),c={...t,font:e,maxHeight:i-o};let d=ag(h,{...c,overflow:"hide"},a,o);if(0===d.length)if("never"===t.textWrap)d=ag(h,c,a,o);else{d=ag(h,c,0,o);const e=s.at(-1);e&&"image"!==e.type&&(e.text+="\n",a=0)}if(0===d.length)return l(),!0;const u=n?-1:d.findIndex(Ni);-1!==u&&(d=d.slice(0,u+1));const p=e.text.slice(0,e.text.length-e.text.trimStart().length),g=e.text.slice(e.text.trimEnd().length),m=d.map(Ai),y=m.findIndex((e=>""!==e.trim())),f=m.findLastIndex((e=>""!==e.trim())),x=m.length-1;for(let t=0;t<m.length;t++){let i=m[t];p&&t===y&&(i=p+i.trimStart()),g&&t===f&&(i=i.trimEnd()+g);const n=r.measureText(i),l={...e,text:i,textMetrics:n};t===x?a+=n.width:(l.text+="\n",a=0),o+=n.height,s.push(l)}return-1!==u}let c=!0;for(const{width:d,height:u,segments:p}of ap(e,t.font).lineMetrics){if(c||(Mg(s,t.font),a=0),c=!1,o+u>i){s.length&&l();break}if(a+d<=r(u)){a+=d,o+=u,s.push(...p);continue}let e=0;for(const c of p)if(a+c.textMetrics.width<=r(c.textMetrics.height))a+=c.textMetrics.width,e=Math.max(e,c.textMetrics.height),s.push(c);else{if("image"===c.type){const h=c.textMetrics.width,d=c.textMetrics.height;if("never"!==t.textWrap&&a>0&&h<=r(d)&&o+e+d<=i){Mg(s,t.font),a=h,o+=e+d,e=0,s.push(c);continue}if(n){a+=h,e=Math.max(e,d),s.push(c);continue}return l(),s}if(h(c))break;e=0}}return s}function Mg(e,t){const i=e.at(-1);if(i&&"image"!==i.type)i.text+="\n";else if(i){const i=Zu(t);e.push({...t,text:"\n",textMetrics:i.measureText("")})}}var kg=class{constructor(){this.invCellSize=1,this.cols=0,this.rows=0,this.originX=0,this.originY=0,this.cellCount=0,this.cells=[]}reset(e,t){let i=Math.max(t,1);const n=Math.max(0,e.width)*Math.max(0,e.height);n>16384*i*i&&(i=Math.sqrt(n/16384)),this.invCellSize=1/i,this.originX=e.x,this.originY=e.y,this.cols=Math.max(1,Math.ceil(e.width/i)),this.rows=Math.max(1,Math.ceil(e.height/i));const s=this.cols*this.rows,a=Math.max(this.cellCount,s);for(let e=0;e<a;e++)null==this.cells[e]?this.cells[e]=[]:this.cells[e].length=0;this.cellCount=s}insert(e,t){const{cols:i,cells:n}=this,s=this.clampCol(e.x),a=this.clampCol(e.x+e.width),o=this.clampRow(e.y),r=this.clampRow(e.y+e.height);for(let e=o;e<=r;e++){const o=e*i;for(let e=s;e<=a;e++)n[o+e].push(t)}}query(e,t){const{cols:i,cells:n}=this,s=this.clampCol(e.x),a=this.clampCol(e.x+e.width),o=this.clampRow(e.y),r=this.clampRow(e.y+e.height);for(let e=o;e<=r;e++){const o=e*i;for(let e=s;e<=a;e++){const i=n[o+e];for(let e=0,n=i.length;e<n;e++)if(!0===t(i[e]))return!0}}return!1}clampCol(e){return Math.min(this.cols-1,Math.max(0,Math.floor((e-this.originX)
1*this.invCellSize)))}clampRow(e){return Math.min(this.rows-1,Math.max(0,Math.floor((e-this.originY)*this.invCellSize)))}};function Dg(e,t){return t>0?Math.max(1,e/t):1}var wg=new kg;function Ig(e,t,i){if(0===e.length||0===t.length)return!1;let n=1/0,s=1/0,a=-1/0,o=-1/0,r=0,l=0;const h=e=>{n=Math.min(n,e.x),s=Math.min(s,e.y),a=Math.max(a,e.x+e.width),o=Math.max(o,e.y+e.height),r+=e.width+e.height,l+=2};for(const t of e)h(t);for(const e of t)h(e.box);const c={x:n,y:s,width:a-n,height:o-s},d=wg;d.reset(c,Dg(r,l));for(const e of t)d.insert(e.box,e.ref);let u=null;const p=e=>null!=u&&i(u,e);for(const t of e)if(u=t,d.query(t,p))return!0;return!1}function Ag(e,t=!1,i=!1){const{maxWidth:n,maxHeight:s,wrapping:a,truncate:o,minimumFontSize:r}=e;let l;if(o||i?l="ellipsis":t&&(l="hide"),null!=l||null!=a||null!=r)return{maxWidth:n,maxHeight:s,wrapping:a,overflowStrategy:l,minimumFontSize:r}}function Cg(e,t,i){const n=Ag(e,i);return i=>null==n?void 0:{text:i,policy:n,font:e,boxPadding:t,boundByRegion:!0}}function Ng(e,t,i){return{alwaysShow:e.alwaysShow,spacing:i,threshold:e.threshold,collideWith:e.resolveCollideWith(),placements:t}}var Lg=2;function Pg(e){return null!=e&&"object"==typeof e.point&&"object"==typeof e.label}function Tg(e){return e.markerSize??e.point.size}function Og(e,t){e.markerSize=t}var Rg={horizontal:0,vertical:-90,"vertical-reversed":90};function Eg(e,t,i){let{x:n,y:s}=e;return"left"===e.textAlign||"start"===e.textAlign?n+=t/2:"right"!==e.textAlign&&"end"!==e.textAlign||(n-=t/2),"top"===e.textBaseline?s+=i/2:"bottom"===e.textBaseline&&(s-=i/2),{x:n,y:s}}function zg(e,t,i,n,s){const{x:a,y:o}=Eg(t,i,n);return e.x=a,e.y=o,"right"===t.textAlign||"end"===t.textAlign?e.x+=s.right:"left"!==t.textAlign&&"start"!==t.textAlign||(e.x-=s.left),"bottom"===t.textBaseline?e.y+=s.bottom:"top"===t.textBaseline&&(e.y-=s.top),e}function Bg(e,t){return Ht(e)?ap(e,t):Zu(t).measureLines(String(e))}var Fg,Vg,$g,Hg,jg,Wg,_g={inside:{x:0,y:0},top:{x:0,y:-1},bottom:{x:0,y:1},left:{x:-1,y:0},right:{x:1,y:0},"top-left":{x:-1,y:-1},"top-right":{x:1,y:-1},"bottom-left":{x:-1,y:1},"bottom-right":{x:1,y:1}},Gg=new kg,Kg=[],Yg=[],Ug={x:0,y:0,width:0,height:0},Xg={x:0,y:0,width:0,height:0},Zg={x:0,y:0,width:0,height:0},qg={x:0,y:0,width:0,height:0},Qg={x:0,y:0,width:0,height:0},Jg={x:0,y:0,width:0,height:0},em={x:0,y:0,width:0,height:0},tm=0,im=0,nm=0,sm=-1,am=!1,om={text:"",width:0,height:0,dropped:0,shrink:0,fontSize:void 0,maxWidth:1/0,maxHeight:1/0},rm={},lm={fontSize:0};function hm(e){return null==jg||jg>=e.fontSize?e:(lm.fontSize=jg,lm.fontStyle=e.fontStyle,lm.fontWeight=e.fontWeight,lm.fontFamily=e.fontFamily,lm)}var cm,dm,um,pm,gm,mm,ym,fm,xm,bm,vm=0,Sm=0,Mm=0,km=0,Dm=0,wm=0,Im=!1,Am=!1,Cm={width:0,height:0},Nm={width:0,height:0},Lm="",Pm={x:0,y:0},Tm={width:0,height:0};function Om(e,t,i){if(0===e)return Tm.width=t,void(Tm.height=i);const n=e%180*(Math.PI/180),s=Math.abs(Math.sin(n)),a=Math.abs(Math.cos(n));Tm.width=t*a+i*s,Tm.height=t*s+i*a}function Rm(e,t,i){e.x=t.x-i,e.y=t.y-i,e.width=t.width+2*i,e.height=t.height+2*i}function Em(e){return Math.min(e,0)}function zm(e,t,i){return 0===i?t:(e.x=t.x+i,e.y=t.y+i,e.width=Math.max(0,t.width-2*i),e.height=Math.max(0,t.height-2*i),e)}function Bm(e,t){return null==e||0===t?e:(Cm.width=Math.max(0,e.width-2*t),Cm.height=Math.max(0,e.height-2*t),Cm)}var Fm=0;function Vm(e){if(!Wm(e))return;const{x:t,y:i,width:n,height:s}=Ug,a=Math.min(t+n,e.box.x+e.box.width)-Math.max(t,e.box.x),o=Math.min(i+s,e.box.y+e.box.height)-Math.max(i,e.box.y);a>0&&o>0&&(Fm=Math.max(Fm,a*o))}function $m(e){const t=e.category??"seriesItem";return"inside"===Vg&&"marker"===t&&"circle"===e.kind&&e.cx===im&&e.cy===nm&&e.r===sm||(!(null==$g||am&&"label"===t||!ed(e.box,$g.x,$g.y,$g.width,$g.height))||!1===Fg?.[t])}function Hm(){return 0===tm?Ug:(Rm(qg,Ug,tm),qg.width<=0||qg.height<=0?void 0:qg)}function jm(e,t){const{x:i,y:n,width:s,height:a}=t;switch(e.kind){case"circle":return function(e,t,i,n,s,a,o){if(i<=0)return!1;let r=e;e<n?r=n:e>n+a&&(r=n+a);let l=t;t<s?l=s:t>s+o&&(l=s+o);const h=e-r,c=t-l;return h*h+c*c<i*i}(e.cx,e.cy,e.r,i,n,s,a);
1case"rect":return ed(e.box,i,n,s,a);case"custom":return e.overlaps(t)}}function Wm(e){if($m(e))return!1;const t=Hm();return null!=t&&jm(e,t)}var _m={left:0,right:0,top:0,bottom:0},Gm={width:0,height:0},Km=1/0,Ym=1/0,Um={x:0,y:0},Xm=0,Zm=0,qm=0,Qm=0,Jm={min:0,max:0},ey={left:1/0,right:1/0,top:1/0,bottom:1/0},ty=["left","right","top","bottom"];function iy(e,t){return 0===e||e>0!==t}function ny(e,t,i,n){return i&&e>=n&&e>0&&e<t?e:1/0}function sy(e){if($m(e))return;const t=Hm();if(null==t||!jm(e,t))return;const{x:i,y:n,width:s,height:a}=t;let o;!function(e,t,i){if("circle"!==e.kind)return Jm.min=e.box.x,void(Jm.max=e.box.x+e.box.width);const n=Math.max(0,e.cy-i,t-e.cy),s=Math.sqrt(Math.max(0,e.r*e.r-n*n));Jm.min=e.cx-s,Jm.max=e.cx+s}(e,n,n+a),ey.left=ny(Jm.max-i,s,iy(Xm,!0),qm),ey.right=ny(i+s-Jm.min,s,iy(Xm,!1),qm),function(e,t,i){if("circle"!==e.kind)return Jm.min=e.box.y,void(Jm.max=e.box.y+e.box.height);const n=Math.max(0,e.cx-i,t-e.cx),s=Math.sqrt(Math.max(0,e.r*e.r-n*n));Jm.min=e.cy-s,Jm.max=e.cy+s}(e,i,i+s),ey.top=ny(Jm.max-n,a,iy(Zm,!0),Qm),ey.bottom=ny(n+a-Jm.min,a,iy(Zm,!1),Qm);let r=1/0;for(const e of ty){const t=ey[e]/("left"===e||"right"===e?s:a);t<r&&(r=t,o=e)}return null!=o?(_m[o]=Math.max(_m[o],ey[o]),ay()):void 0}function ay(){return _m.left+_m.right>Km||_m.top+_m.bottom>Ym}function oy(e,t){return e>=t?e:0}function ry(e,t,i,n,s,a,o,r){return Km=a,Ym=o,_m.left=0,_m.right=0,_m.top=0,_m.bottom=0,Xm=e,Zm=t,qm=n,Qm=s,null!=r&&function(e){const{x:t,y:i,width:n,height:s}=Ug,a=Math.max(0,e.x-t),o=Math.max(0,t+n-(e.x+e.width)),r=Math.max(0,e.y-i),l=Math.max(0,i+s-(e.y+e.height));0===Xm?_m.left=_m.right=oy(Math.max(a,o),qm):(_m.left=iy(Xm,!0)?oy(a,qm):0,_m.right=iy(Xm,!1)?oy(o,qm):0),0===Zm?_m.top=_m.bottom=oy(Math.max(r,l),Qm):(_m.top=iy(Zm,!0)?oy(r,Qm):0,_m.bottom=iy(Zm,!1)?oy(l,Qm):0)}(r),Rm(Xg,Ug,i),!Gg.query(Xg,sy)&&!ay()&&(Gm.width=_m.left+_m.right,Gm.height=_m.top+_m.bottom,Um.x=0===e?(_m.left-_m.right)/2:0,Um.y=0===t?(_m.top-_m.bottom)/2:0,Gm.width>0||Gm.height>0)}var ly={cx:0,cy:0};function hy(e){const{x:t,y:i}=e.point,n=Tg(e);ly.cx=t,ly.cy=i,null!=e.anchor&&(ly.cx-=(e.anchor.x-.5)*n,ly.cy-=(e.anchor.y-.5)*n)}function cy(e){return!1===e.defaults?.alwaysShow||e.datums.some((e=>!1===e.alwaysShow))}function dy(e,t){if(!(e.alwaysShow??t?.alwaysShow??!0)||null!=e.positionedCandidates||!0===e.neverDrop||null!=e.fit)return!1;const i=e.placements??t?.placements;return(i?.length??1)<=1&&(Wy(e)?.length??1)<=1}function uy(e,t,i){Gg.reset(i,function(e,t){let i=0,n=0;for(const{datums:t}of e.values())for(const e of t){i+=e.label.width+e.label.height,n+=2;const t=Tg(e);t>0&&(i+=t,n+=1)}for(const e of t)i+=e.box.width+e.box.height,n+=2;return Dg(i,n)}(e,t));for(const e of t)Gg.insert(e.box,e);!function(e){let t=0;for(const{datums:i}of e.values())for(const e of i){const i=Tg(e);if(i<=0)continue;hy(e);const{cx:n,cy:s}=ly,a=i/2;let o=Kg[t];null==o&&(o={kind:"circle",box:{x:0,y:0,width:0,height:0},cx:0,cy:0,r:0,category:"marker"},Kg.push(o)),t++,o.cx=n,o.cy=s,o.r=a,o.box.x=n-a,o.box.y=s-a,o.box.width=i,o.box.height=i,Gg.insert(o.box,o)}}(e)}function py(e,t,i=5,n=[]){const s=new Map;if(!function(e){for(const t of e.values())if(null!=t.datums[0]?.label)return!0;return!1}(e))return s;const a=new Map(Array.from(e.entries(),(([e,t])=>[e,{datums:t.datums.toSorted(((e,t)=>Tg(t)-Tg(e))),defaults:t.defaults,resolveCandidateStyle:t.resolve
1CandidateStyle,resolveCandidate:t.resolveCandidate}]))),o=!function(e){for(const{datums:t,defaults:i}of e.values())for(const e of t)if(""!==e.label.text&&!dy(e,i))return!1;return!0}(a);o&&uy(a,n,t);let r=0;for(const[e,{datums:n,defaults:l,resolveCandidateStyle:h,resolveCandidate:c}]of function(e){const t=[],i=[];for(const n of e.entries())(cy(n[1])?i:t).push(n);return t.concat(i)}(a)){const a=[];if(n[0]?.label){for(let e=0,s=n.length;e<s;e++){const s=n[e];if(""===s.label.text)continue;const d=Oy(s,l,e,i,t,h,c);null!=d&&(a.push(d),o&&(r=gy(d,r)))}s.set(e,a)}}return s}function gy(e,t){const i=function(e){if(null==e.rotation)return e;const{width:t,height:i}=kc(e.rotation,e.width,e.height);return{x:e.x,y:e.y,width:t,height:i}}(e);let n=Yg[t];return null==n?(n={kind:"rect",box:i,category:"label"},Yg.push(n)):n.box=i,Gg.insert(i,n),t+1}function my(e){if(!Ht(e))return pi(e).length;let t=0;for(const i of e)"image"!==i.type&&(t+=pi(i.text).length);return t}function yy(e,t,i,n,s,a,o){const{text:r,policy:l}=e,h=Math.min(l.maxWidth??1/0,n?.width??1/0),c=Math.min(l.maxHeight??1/0,n?.height??1/0),d=i??Bg(r,t);om.maxWidth=h,om.maxHeight=c;const u=a??l.region,p=o??l.regionAlign;if(null==u&&d.width<=h&&d.height<=c)return om.text=r,om.width=d.width,om.height=d.height,om.dropped=0,om.shrink=0,om.fontSize=void 0,!0;rm.maxWidth=h===1/0?void 0:h,rm.maxHeight=c===1/0?void 0:c,rm.wrapping=l.wrapping,rm.overflowStrategy=l.overflowStrategy,rm.minimumFontSize=s?l.minimumFontSize:void 0,rm.region=u,rm.regionAlign=p;const{text:g,fontSize:m}=ig(r,rm,e.fitOverflow,t);if($p(g))return!1;const y=Bg(g,_p(t,m));return om.text=g,om.width=y.width,om.height=y.height,om.dropped=Math.max(0,my(r)-my(g)),om.shrink=function(e,t){const i=t.
1width*t.height;if(i<=0)return 0;const n=1-e.width*e.height/i;return n<=0?0:Math.min(n,zy)}(y,d),om.fontSize=m,!0}function fy(e,t){const i=di(t);if(i!==Lm){const{width:n,height:s}=Bg(e.text,t);Nm.width=n,Nm.height=s,Lm=i}return Nm}var xy={text:"",width:0,height:0,dropped:0,shrink:0,glyphWidth:0,glyphHeight:0,maxWidth:1/0,maxHeight:1/0};function by(e,t,i,n,s,a,o){const{fit:r}=e;if(Hg=void 0,null==r)return xy.text=e.label.text,xy.width=e.label.width,xy.height=e.label.height,xy.glyphWidth=e.label.width,xy.glyphHeight=e.label.height,xy.dropped=0,xy.shrink=0,xy.maxWidth=1/0,xy.maxHeight=1/0,!0;const l=hm(t?.font??r.font),h=t?.boxPadding??r.boxPadding,c=function(e,t,i,n,s){if("inside"!==t||null==e.insideSize)return;const a=Tg(e),o=n%180==0,r=(o?e.insideSize.width:e.insideSize.height)*a,l=(o?e.insideSize.height:e.insideSize.width)*a,h=2*Em(s);return Cm.width=Math.max(0,r-Ry(i)-h),Cm.height=Math.max(0,l-Ey(i)-h),Cm}(e,i,h,n,s)??(r.boundByRegion?function(e,t,i){if(null==e)return;const n=i%180==0,s=n?e.width:e.height,a=n?e.height:e.width;return Cm.width=Math.max(0,s-(null==t?0:t.left+t.right)),Cm.height=Math.max(0,a-(null==t?0:t.top+t.bottom)),Cm}(a,h,n):void 0);return!!yy(r,l,null==t&&null==jg?o:fy(r,l),c,null==jg)&&(vy(h,l),!0)}function vy(e,t){xy.text=om.text,xy.glyphWidth=om.width,xy.glyphHeight=om.height,xy.width=om.width+Ry(e),xy.height=om.height+Ey(e),xy.dropped=om.dropped,xy.shrink=om.shrink,xy.maxWidth=om.maxWidth,xy.maxHeight=om.maxHeight,Hg=om.fontSize??(null==jg?void 0:t.fontSize)}var Sy={width:0,height:0},My={x:0,y:0};function ky(e,t,i){return i>0?Math.max(0,Math.min(e,t-i)):e}function Dy(e,t,i,n,s,a){return Sy.width=ky(xy.maxWidth,xy.glyphWidth,s),Sy.height=ky(xy.maxHeight,xy.glyphHeight,a),!!yy(e,t,i,Sy,!1)&&(!!jp(om.text)&&(vy(n,t),!0))}function wy(e,t){const{x:i,y:n,width:s,height:a}=Ug;Ug.x=i+Um.x,Ug.y=n+Um.y,t&&(Ug.x=Gy(Ug.x,s,e.x,e.width),Ug.y=Gy(Ug.y,a,e.y,e.height)),My.x=Ug.x-i,My.y=Ug.y-n}var Iy={x:0,y:0};function Ay(e,t){if(Iy.x=0,Iy.y=0,!t)return;const{x:i,y:n,width:s,height:a}=Ug;Ug.x=Gy(i,s,e.x,e.width),Ug.y=Gy(n,a,e.y,e.height),Iy.x=Ug.x-i,Iy.y=Ug.y-n}function Cy(e,t){const{x:i,y:n,width:s,height:a}=Ug;return!!td(e,i,n,s,a)&&(Rm(Xg,Ug,t),!Gg.query(Xg,Wm))}function Ny(e){if(null!=ym)return ym;const{policy:t,text:i}=e,{wrapping:n,overflowStrategy:s}=t,a="hide"===s;let o=1/0;if((a||"ellipsis"===s)&&null==e.fitOverflow&&null==t.region&&!Ht(i)&&(null==n||"on-space"===n||"never"===n)){const e=pi(i).split(vt);a?1===e.length&&(o=function(e,t){const i=mm;let n=0;for(const s of"never"===t?[e.trimEnd()]:e.split(" "))""!==s&&(n=Math.max(n,Ly(i,s)));return n}(e[0],n)):o=function(e,t){const i=mm,n=i.textWidth(bt);let s=1/0;for(const a of e){const e=("never"===t?[a.trimEnd()]:a.split(" ")).find((e=>""!==e));if(null==e)continue;const o=i.textWidth(Ti(e)[0])+n;s=Math.min(s,Ly(i,e),o)}return s}(e,n)}return ym=o,o}function Ly(e,t){let i=0;for(const n of Ti(t))i+=e.textWidth(n);return Math.min(i,e.textWidth(t))}function Py(e,t,i,n){const s=e.fit;if(null==s)return!1;const a=Sm>0&&null!=i?_g[i]:void 0,o=n%180==0,r=hm(t?.font??s.font),l=null==t&&null==jg,h=(l?mm:Zu(r)).lineHeight(),c=o?0:h,d=o?h:0,u=l?Ny(s):1/0,p=u===1/0?1/0:xy.glyphWidth-u,g=l&&function(e){const{policy:t,text:i}=e;return"hide"===t.overflowStrategy&&null==e.fitOverflow&&null==t.region&&!Ht(i)&&!pi(i).includes("\n")}(s)?0:1/0,m=o?p:g,y=o?g:p;if(m<=0&&y<=0)return!1;if(!ry(a?.x??0,a?.y??0,km,c,d,m,y))return!1;const f=l?gm:fy(s,r),x=o?Gm.width:Gm.height,b=o?Gm.height:Gm.width;if(!Dy(s,r,f,t?.boxPadding??s.boxPadding,x,b))return!1;Xy(e,i,n,xy.width,xy.height,Sm,Mm),wy(fm,Im);const{x:v,y:S,width:M,height:k}=Ug,D=Uy(e,i,v,S,M,k);return Cy(null==D?xm:zm(Jg,D,wm),km)}function Ty(e,t,i,n,s,a){const o=e.fit,r=t.fitTo;if(null==o||null==r||(t.rotation??0)%360!=0)return!1;const l=Zu(r.font??o.font).lineHeight();if(!ry((h=r.anchor,"left"===h.textAlign||"start"===h.textAlign?1:"right"===h.textAlign||"end"===h.textAlign?-1:0),function(e){return"top"===e.textBaseline?1:"bottom"===e.textBaseline?-1:0}(r.anchor),a,0,l,1/0,1/0,s))return!1;var h;const c=r.font,d=null==c?i:fy(o,c),{width:u,height:p}=Gm;return!!Dy(o,c??o.font,d,r.padding,u,p)&&(jy(t,xy.width,xy.height),wy(n,null!=t.regi
1on&&!1!==t.flushToRegion),Cy(s,a))}function Oy(e,t,i,n,s,a,o){const r=e.alwaysShow??t?.alwaysShow??!0,l=e.placements??t?.placements,h=e.collideWith??t?.collideWith,c=function(e){return null==e.markerSize?e.gap??e.point.size/2:e.markerSize>0?e.markerSize/2:Lg}(e),d=e.spacing??t?.spacing??n,u=e.threshold??t?.threshold??0;if(dy(e,t)){const t=Yy(l,e.placement,0),n=Yy(Wy(e),_y(e),0),s=null==n?0:Rg[n];Lm="";const o=a?.(e,t,n);if(!0===o?.hidden)return;if(!by(e,o,t,s,u,e.region,void 0))return;const{text:r,width:h,height:p}=xy;Xy(e,t,s,h,p,c,d);const{x:g,y:m}=Ug;return{index:i,text:r,x:g,y:m,width:h,height:p,datum:e,placement:t,rotation:s||void 0,fontSize:Hg}}return function(e,t,i,n,s,a,o,r,l,h,c){if(By.tier=1/0,By.score=1/0,null!=e.positionedCandidates)return function(e,t,i,n,s,a){const o=e.positionedCandidates,r=Math.max(i,0);Fg=t,tm=i,Vg=void 0,im=Number.NaN,nm=Number.NaN,sm=-1,$g=e.ownBox,am=e.ownBoxLabelsCollide??!1;const{fit:l}=e,h=null==l?void 0:Bg(l.text,l.font);Lm="";const c=Em(i);for(let t=0,d=o.length;t<d;t++){const d=null==a?o[t]:a(e,o[t]);if(!0===d.hidden)continue;const u=d.region??s,p=zm(Qg,u,c);let{text:g}=e.label,{width:m,height:y}=d.size??e.label,f=0,x=0;if(Hg=void 0,Ug.x=d.box.x,Ug.y=d.box.y,Ug.width=d.box.width,Ug.height=d.box.height,null!=l&&null!=d.fitTo){const e=d.fitTo.font,t=null==e?h:fy(l,e),n=Bm(d.fitTo.container,i);if(!yy(l,e??l.font,t,n,null==jg,d.fitTo.shape,d.fitTo.shapeAlign))continue;if(n!==d.fitTo.container&&!jp(om.text)&&!yy(l,e??l.font,t,d.fitTo.container,null==jg,d.fitTo.shape,d.fitTo.shapeAlign))continue;({text:g,dropped:f,shrink:x}=om),vy(d.fitTo.padding,e??l.font),({width:m,height:y}=xy),jy(d,m,y)}Ay(u,null!=d.region&&!1!==d.flushToRegion);const{x:b,y:v,width:S,height:M}=Ug,{x:k,y:D}=Iy;Rm(Xg,Ug,r);const w=d.rotation??0;if(!td(p,b,v,S,M)||Gg.query(Xg,Wm)){if(!0===e.neverDrop){Fy(2,Ky(p,b,v,S,M),g,m,y,w,k,D,void 0,d)}Ty(e,d,h,u,p,r)&&Hy(w,void 0,d)}else{if(0===f)return{index:n,text:g,x:b,y:v,width:m,height:y,datum:e,placement:void 0,rotation:d.rotation,offsetX:k,offsetY:D,candidate:d,fontSize:Hg};Fy(0,f+x,g,m,y,w,k,D,void 0,d)}}return Vy(n,e)}(e,i,l,s,a,c);const{fit:d}=e,u=null!=h;gm=null==d||u?void 0:Bg(d.text,d.font),Lm="",ym=void 0,mm=null==d?void 0:Zu(d.font),Wg=e,vm=s,cm=t,dm=Wy(e),um=_y(e),pm=h,Sm=o,Mm=r,km=Math.max(l,0),Dm=l,Fg=i,tm=l,hy(e),im=ly.cx,nm=ly.cy,sm=Tg(e)/2,$g=e.ownBox,am=e.ownBoxLabelsCollide??!1,fm=e.region??a,wm=Em(l),xm=zm(Qg,fm,wm),bm=null==e.region?void 0:zm(em,e.region,l),Im=null!=e.region&&!0===e.neverDrop,Am=!0===e.neverDrop||n;const p=$y();if(null!=p)return p;const g=function(){const{fit:e}=Wg,t=e?.policy.minimumFontSize;if(null==e||null==t)return;const{fontSize:i}=e.font,n=Gp(t,i);if(n>=i)return;try{return Xp(n,i,(function(e){return jg=e,$y()}))}finally{jg=void 0}}();return null!=g?g:Vy(s,e)}(e,l,h,r,i,s,c,d,u,a,o)}function Ry(e){return null==e?0:e.left+e.right}function Ey(e){return null==e?0:e.top+e.bottom}var zy=.999,By={tier:1/0,score:1/0,text:"",x:0,y:0,width:0,height:0,rotation:0,offsetX:0,offsetY:0,placement:void 0,candidate:void 0,fontSize:void 0};function Fy(e,t,i,n,s,a,o,r,l,h){e>By.tier||e===By.tier&&t>=By.score||(By.tier=e,By.score=t,By.text=i,By.x=Ug.x,By.y=Ug.y,By.width=n,By.height=s,By.rotation=a,By.offsetX=o,By.offsetY=r,By.placement=l,By.candidate=h,By.fontSize=Hg)}function Vy(e,t){if(By.tier!==1/0)return{index:e,text:By.text,x:By.x,y:By.y,width:By.width,height:By.height,datum:t,placement:By.placement,rotation:By.rotation||void 0,offsetX:By.offsetX,offsetY:By.offsetY,candidate:By.candidate,fontSize:By.fontSize}}function $y(){const e=Wg,t=cm?.length??1,i=dm?.length??1,n=null==jg;for(let s=0;s<t;s++){const t=Yy(cm,e.placement,s);for(let s=0;s<i;s++){const i=Yy(dm,um,s),a=null==i?0:Rg[i],o=pm?.(e,t,i);if(!0===o?.hidden)continue;if(!by(e,o,t,a,Dm,bm,gm))continue;const{text:r,width:l,height:h,dropped:c,shrink:d}=xy;Xy(e,t,a,l,h,Sm,Mm),Ay(fm,Im);const{x:u,y:p,width:g,height:m}=Ug,{x:y,y:f}=Iy;Vg=t;const x=Uy(e,t,u,p,g,m),b=null==x?xm:zm(Jg,x,wm);Rm(Xg,Ug,km);const v=td(b,u,p,g,m);if(!v||Gg.query(Xg,Wm)){if(Am&&n){const e=Ky(b,u,p,g,m);let i=2,n=e;0===e&&(Fm=0,Gg.query(Xg,Vm),i=1,n=Fm),Fy(i,n,r,l,h,a,y,f,t,void 0)}v&&n&&Py(e,o,t,a)&&Hy(a,t,void 0)}else{if(0===c)return{index:vm,text:r,x:u,y:p,width:l,height:h,datum:e,placement:t,rotation:a||void 0,offsetX:y,offsetY:f,fontSize:Hg};n&&Fy(0,c+d,r,l,h,a,y,f,t,void 0)}}}}function Hy(e,t,i){Fy(0,xy.dropped+xy.shrink,xy.text,xy.width,xy.height,e,My.x,My.y,t,i)}function jy(e,t,i){const{anchor:n,padding:s}=e.fitTo;zg(Pm,n,t,i,s),Om(e.rotation??0,t,i),Ug.x=Pm.x-Tm.width/2,Ug.y=Pm.y-Tm.height/2,Ug.width=Tm.width,Ug.height=Tm.height}function Wy(e){return Array.isArray(e.orientation)?e.orientation:void 0}function _y(e){return Array.isArray(e.orientation)?void 0:e.orientation}function Gy(e,t,i,n){return t>n?e:Math.min(Math.max(e,i),i+n-t)}function Ky(e,t,i,n,s){return Math.max(0,e.x-t)+Math.max(0,t+n-(e.x+e.width))+Math.max(0,e.y-i)+Math.max(0,i+s-(e.y+e.height))}function Yy(e,t,i){return e?e[i]:t}function Uy(e,t,i,n,s,a){if("inside"!==t||null==e.insideSize)return;const o=Tg(e),r=e.insideSize.width*o,l=e.insideSize.height*o;return Zg.x=i+s/2-r/2,Zg.y=n+a/2-l/2,Zg.width=r,Zg.height=l,Zg}
1function Xy(e,t,i,n,s,a,o){Om(i,n,s),function(e,t,i,n,s,a,o){const{point:r,anchor:l}=t;let h=0,c=0;if(s>0&&null!=o){const e=_g[o];h=(i/2+s+a)*e.x,c=(n/2+s+a)*e.y}let d=r.x-i/2+h,u=r.y-n/2+c;const p=Tg(t);l&&(d-=(l.x-.5)*p,u-=(l.y-.5)*p),"inside"===o&&t.insideOffset&&(d+=t.insideOffset.x*p,u+=t.insideOffset.y*p),e.x=d,e.y=u}(Ug,e,Tm.width,Tm.height,a,o,t),Ug.width=Tm.width,Ug.height=Tm.height}function Zy(e,t,i,n=i.labelFit){if(null!=e&&(i.labelStyled||null!=n))return{text:e,policy:n??{},font:t,boxPadding:i.labelPadding,fitOverflow:i.labelFitOverflow,boundByRegion:!1}}function qy(e,t,i,n=i.labelFit){if(null==e)return{text:"",width:0,height:0};const{text:s,fontSize:a}=ig(e,n,i.labelFitOverflow,t);let{width:o,height:r}=null!=a||Ht(s)?Bg(s,_p(t,a)):i.labelTextMeasurer.measureLines(String(s));return o+=i.labelPadding.left+i.labelPadding.right,r+=i.labelPadding.top+i.labelPadding.bottom,{text:s,width:o,height:r,fontSize:a}}function Qy(e,[t,i],[n,s]){const a=s-n,o=i-t;return[(t+o*e[0]-n)/a,(t+o*e[1]-n)/a]}var Jy=(e,t)=>({duration:zl(e)*t,timeInterval:e,step:t}),ef=(()=>[Jy({unit:"second"},1),Jy({unit:"second"},5),Jy({unit:"second"},15),Jy({unit:"second"},30),Jy({unit:"minute"},1),Jy({unit:"minute"},5),Jy({unit:"minute"},15),Jy({unit:"minute"},30),Jy({unit:"hour"},1),Jy({unit:"hour"},3),Jy({unit:"hour"},6),Jy({unit:"hour"},12),Jy({unit:"day"},1),Jy({unit:"day"},2),Jy({unit:"day",step:7},1),Jy({unit:"day",step:7},2),Jy({unit:"day",step:7},3),Jy({unit:"month"},1),Jy({unit:"month"},2),Jy({unit:"month"},3),Jy({unit:"month"},4),Jy({unit:"month"},6),Jy({unit:"year"},1)])(),tf=[1,2,5,10];function nf(e,t){return Math.abs(Math.round(e)-e)<t}function sf(e,t,i){return Math.abs(t-e)>=i?Math.abs(t-e)/i+1:1}function af(e,t,i,n,s,a){if(e===t)return{ticks:[e],count:1,firstTickIndex:0};if(i<2)return{ticks:[e,t],count:2,firstTickIndex:0};const o=cf(e,t,i,n,s);if(!Number.isFinite(o))return{ticks:[],count:0,firstTickIndex:void 0};let r=e,l=t;nf(r/o,1e-12)||(r=Math.ceil(r/o)*o),nf(l/o,1e-12)||(l=Math.floor(l/o)*o),null!=a&&(a=Qy(a,[e,t],[r,l]));const{ticks:h}=vf(r,l,o,a),c=h.at(0);return{ticks:h,count:sf(r,l,o),firstTickIndex:null==c?void 0:Math.round((c-r)/o)}}var of=(()=>Math.floor(2*ol/rl*10)/10)();function rf({timeInterval:e,step:t}){const i=zl(e)*t,n=El(e);return i<=((n?zl(n):void 0)??1/0)*of}function lf(e,{weekStart:t}){if("day"===e.unit&&7===e.step)return t}function hf(e,t,i,n,s,{weekStart:a,primaryOnly:o=!1,targetInterval:r}){if(i<=0)return;const l=r??Math.abs(t-e)/Math.max(i,1),h=ef.findLast((e=>(!o||rf(e))&&l>e.duration)),c=ef.find((e=>(!o||rf(e))&&l<=e.duration));if(null==h){return{unit:"millisecond",step:Math.max(cf(e,t,i,n,s),1)}}if(null==c){return{unit:"year",step:null==r?cf(e/ll,t/ll,i,n,s):1}}const{timeInterval:d,step:u}=l-h.duration<c.duration-l?h:c;return{unit:d.unit,step:Ol(d)*u,epoch:lf(d,{weekStart:a})}}function cf(e,t,i,n=0,s=1/0){if(e===t)return Ge(1,n,s);if(i<1)return Number.NaN;const a=Math.abs(t-e),o=10**Math.floor(Math.log10(a/i));let r=Number.NaN,l=1/0,h=!1;for(const e of tf){const t=Math.ceil(a/(e*o)),c=t>=n&&t<=s;if(h&&!c)continue;const d=Math.abs(t-i);(l>d||h!==c)&&(h||(h=c),l=d,r=e)}return r*o}function df(e){for(let t=e.length-1;t>=0;t-=1)if("0"!==e[t])return t+1;return 0}function uf(e,t){const i=ns(t??",f");if(null==i)return;(null==i.precision||Number.isNaN(i.precision))&&(!i.type||"eEFgGnprs".includes(i.type)?i.precision=Math.max(...e.map((e=>{if(!Number.isFinite(e))return 0;const[t,n]=e.toExponential((i.type?6:12)-1).split(/[.e]/g);return("1"!==t&&"-1"!==t?1:0)+df(n)+1}))):"f%".includes(i.type)&&(i.precision=Math.max(...e.map((e=>{if(!Number.isFinite(e)||0===e)return 0;const t=Math.floor(Math.log10(Math.abs(e))),n=i.type?6:12,s=df(e.toExponential(n-1).split(/[.e]/g)[1]);return Math.max(0,s-t)})))));const n=ss(i);return e=>n("bigint"==typeof e?e:Number(e))}function pf(e,t){if(e.toString(2).length<4)return BigInt(Math.max(1,Math.round(cf(0,Number(e),t))));const i=e/BigInt(Math.max(1,Math.round(t)));let n=1n;for(;10n*n<=i;)n*=10n;let s=n,a=1/0;for(const i of tf){const o=BigInt(i)*n,r=Number(e/o)+1,l=Math.abs(r-t);l<a&&(a=l,s=o)}return s}function gf(e,t){const i=e%t;return 0n===i?e:e>0n?e-i+t:e-i}function mf(e,t){const i=e%t;return 0n===i?e:e<0n?e-i-t:e-i}function yf(e,t,i){if(e===t)return[e];if(i<2)return[e,t];const n=e<t,s=n?e:t,a=n?t:e,o=pf(a-s,i);if(o<=0n)return[e,t];const r=gf(s,o),l=mf(a,o),h=[];for(let e=r;e<=l;e+=o)h.push(e);return n?h:h.reverse()}function ff(e,t,i){const n=e<t?e:t,s=e<t?t:e;if(n===s)return[[n,s]];const a=BigInt(Number.isFinite(i)?Math.max(1,Math.floor(i)):1),o=s-n,r=[];for(let e=0n;e<a;e+=1n){const t=n+e*o/a,i=e===a-1n?s:n+(e+1n)*o/a;r.push([t,i])}return r}function xf(e,t,i){const n=e<t?e:t,s=e<t?t:e,a=n===s?0n:pf(s-n,i);if(a<=0n)return[[n,s]];const o=gf(n,a),r=mf(s,a),l=[[o-a,o]];for(let e=o;e<=r;e+=a)l.push([e,e+a]);return l}function bf(e,t,i){if(e===t)return[e,t];const n=e<t,s=n?e:t,a=n?t:e,o=pf(a-s,i);if(o<=0n)return[e,t];const r=mf(s,o),l=gf(a,o);return n?[r,l]:[l,r]}function vf(e,t,i,n){if(!Number.isFinite(i)||i<=0)return{ticks:[],count:0,firstTickIndex:void 0};if(e===t)return{ticks:[e],count:1,firstTickIndex:0};const s=10**ht(i),a=Math.min(e,t),o=Math.max(e,t);let r,l;if(null==n||0===n[0]&&1===n[1])r=a,l=o;else{const i=t-e,s=e+i*n[0],a=t-i*(1-n[1]);r=Math.min(s,a),l=Math.max(s,a)}r=Math.floor(r*s)/s,l=Math.ceil(l*s)/s;const h=[];for(let e=0;;e+=1){const t=Math.round((a+i*e)*s)/s;if(t>o)break;t>=r&&t<=l&&h.push(t)}const c=h.at(0);return{ticks:h,count:sf(a,o,i),firstTickIndex:null==c?void 0:Math.round((c-a)/i)}}function Sf(e,t,i){return e>=t&&(i?.warnOnce("the configured interval results in more than 1 item per pixel, ignoring. Supply a larger interval or omit this configuration"),!0)}function Mf(e,t){const i=Math.abs(t-e),n=10**Math.floor(Math.log10(i));let s=1/0,a=[e,t];for(const o of tf){const r=o*n,l=Math.floor(e/r)*r,h=Math.ceil(t/r)*r,c=1-i/Math.abs(h-l);s>c&&(s=c,a=[l,h])}return a}function kf(e,t,i,n,s,a){if(e<=0)return{minTickCount:0,maxTickCount:0,tickCount:0};a=Math.max(a,e/(s+1)),i??(i=a),n??(n=e),i>n&&(i===a?i=n:n=i),i=Math.max(i,1);const o=Math.max(1,Math.floor(e/(t*i))),r=Math.min(o,Math.ceil(e/(t*n)));return{minTickCount:r,maxTickCount:o,tickCount:Ge(r,Math.floor(s/t),o)}}function Df(){const e=new Map;return t=>{const i=e.get(t);return i?(e.set(t,i+1),`${t}_${i}`):(e.set(t,1),t)}}function wf(e){return null!=e&&Object.hasOwn(e,"toString")&&qt(e.toString())}function If(e){return null!=e&&Object.hasOwn(e,"valueOf")&&Jt(e.valueOf())}function Af(e){return Jt(e)||"bigint"==typeof e||_t(e)||If(e)}function Cf(e,t){return null!=e&&(!t||Af(e))}function Nf(e){return wf(e)&&Object.hasOwn(e,"id")?e.id:e}function Lf(e){return wf(e)&&Object.hasOwn(e,"value")?e.value:e}var Pf={};function Tf(e,t){return"number"==typeof t?{x:e.x+t,y:e.y+t}:{x:e.x+t.x,y:e.y+t.y}}function Of(e,t){return"number"==typeof t?{x:e.x-t,y:e.y-t}:{x:e.x-t.x,y:e.y-t.y}}function Rf(e,t){return"number"==typeof t?{x:e.x*t,y:e.y*t}:{x:e.x*t.x,y:e.y*t.y}}function Ef(e){return Math.hypot(e.x,e.y)}function zf(e){return e.x*e.x+e.y*e.y}function Bf(e,t){return Ef(Of(e,t))}function Ff(e,t){return zf(Of(e,t))}function Vf(e){const t=Ef(e);return{x:e.x/t,y:e.y/t}}function $f(e,t){return null==t?Math.atan2(e.y,e.x):Math.atan2(e.y,e.x)-Math.atan2(t.y,t.x)}function Hf(e,t,i={x:0,y:0}){const n=Ef(e);return{x:i.x+n*Math.cos(t),y:i.y+n*Math.sin(t)}}function jf(e,t,i){const n=t.x-e.x;return(null==i?t.y-e.y:i-t.y-(i-e.y))/n}function Wf(e,t,i){return(null==i?e.y:i-e.y)-t*e.x}function _f(e,t,i=0,n){return{x:e===1/0?1/0:(i-t)/e,y:null==n?i:n-i}}function Gf(e,t,i=0,n){const s=e===1/0?1/0:e*i+t;return{x:i,y:null==n?s:n-s}}function Kf(e,t=2){return{x:ot(e.x,t),y:ot(e.y,t)}}function Yf(e,t){return e.x===t.x&&e.y===t.y}function Uf(e,t){if("number"==typeof e)return{x:e,y:t};if("currentX"in e)return{x:e.currentX,y:e.currentY};if("offsetWidth"in e)return{x:e.offsetWidth,y:e.offsetHeight};if("width"in e)return[{x:e.x,y:e.y},{x:e.x+e.width,y:e.y+e.height}];if("x1"in e)return[{x:e.x1,y:e.y1},{x:e.x2,y:e.y2}];throw new Error(`Values can not be converted into a vector: [${JSON.stringify(e)}] [${t}]`)}function Xf(e,t){return e.x=t.x,e.y=t.y,e}function Zf(e){return{x:e?.x??0,y:e?.y??0}}function qf(){return{x:0,y:0}}o(Pf,{add:()=>Tf,angle:()=>$f,apply:()=>Xf,distance:()=>Bf,distanceSquared:()=>Ff,equal:()=>Yf,from:()=>Uf,gradient:()=>jf,intercept:()=>Wf,intersectAtX:()=>Gf,intersectAtY:()=>_f,length:()=>Ef,lengthSquared:()=>zf,multiply:()=>Rf,normalized:()=>Vf,origin:()=>qf,required:()=>Zf,rotate:()=>Hf,round:()=>Kf,sub:()=>Of});var Qf={};function Jf(e){return{x:e.x1,y:e.y1}}function ex(e){return{x:e.x2,y:e.y2}}function tx(e){return{x:(e.x1+e.x2)/2,y:Math.min(e.y1,e.y2)}}function ix(e){return{x:(e.x1+e.x2)/2,y:(e.y1+e.y2)/2}}function nx(e){return{x:(e.x1+e.x2)/2,y:Math.max(e.y1,e.y2)}}function sx(e){return Math.abs(e.x2-e.x1)}function ax(e){return Math.abs(e.y2-e.y1)}function ox(e){return{x1:Math.round(e.x1),y1:Math.round(e.y1),x2:Math.round(e.x2),y2:Math.round(e.y2)}}function rx(e){return{x1:e.x1,y1:e.y1,x2:e.x2,y2:e.y2}}function lx(e,t){const i=hx(e),n=hx(t);return i.x1<=n.x2&&i.x2>=n.x1&&i.y1<=n.y2&&i.y2>=n.y1}function hx(e){return{x1:Math.min(e.x1,e.x2),x2:Math.max(e.x1,e.x2),y1:Math.min(e.y1,e.y2),y2:Math.max(e.y1,e.y2)}}function cx(e,t,i,n){if("number"==typeof e)return{x1:e,y1:t,x2:i,y2:n};if("width"in e)return hx({x1:e.x,y1:e.y,x2:e.x+e.width,y2:e.y+e.height});throw new Error(`Values can not be converted into a vector4: [${JSON.stringify(e)}] [${t}] [${i}] [${n}]`)}function dx(){return{x1:0,y1:0,x2:0,y2:0}}function ux(e){return Yt(e)&&"gradient"==e.type}function px(e){return Ht(e)&&e.every(ux)}function gx(e){return Ht(e)&&e.every((e=>"string"==typeof e))}function mx(e){return null!==e&&Yt(e)&&"pattern"==e.type}function yx(e){return null!==e&&Yt(e)&&"image"==e.type}function fx(e){return ux(e)||mx(e)}function xx(e,t,i,n,s){return(1-s)**3*e+3*(1-s)**2*s*t+3*(1-s)*s**2*i+s**3*n}function bx(e,t,i,n,s){if(s<=Math.min(e,n))return e<n?0:1;if(s>=Math.max(e,n))return e<n?1:0;let a=0,o=1,r=Number.NaN;for(let l=0;l<12;l+=1){r=(a+o)/2;xx(e,t,i,n,r)<s?a=r:o=r}return r}function vx(e,t,i,n,s,a,o,r,l){const h=(1-l)*e+l*i,c=(1-l)*t+l*n,d=(1-l)*i+l*s,u=(1-l)*n+l*a,p=(1-l)*s+l*o,g=(1-l)*a+l*r,m=(1-l)*h+l*d,y=(1-l)*c+l*u,f=(1-l)*d+l*p,x=(1-l)*u+l*g,b=(1-l)*m+l*f,v=(1-l)*y+l*x;return[[{x:e,y:t},{x:h,y:c},{x:m,y},{x:b,y:v}],[{x:b,y:v},{x:f,y:x},{x:p,y:g},{x:o,y:r}]]}function Sx(e,t,i,n){const s=3*t-e-3*i+n,a=2*(e-2*t+i),o=-e+t;
1if(0===s){if(0!==a){const e=-o/a;if(e>0&&e<1)return[e]}return[]}const r=a*a-4*s*o;if(r>=0){const e=Math.sqrt(r);return[(-a+e)/(2*s),(-a-e)/(2*s)].filter((e=>e>0&&e<1))}return[]}function Mx(e,t,i,n,s,a,o,r){return[...Sx(e,i,s,o),...Sx(t,n,a,r)]}function kx(e,t,i){const n=xx(e[0].x,e[1].x,e[2].x,e[3].x,.5),s=xx(e[0].y,e[1].y,e[2].y,e[3].y,.5);return{points:e,distance:Math.hypot(n-t,s-i),minDistance: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))}}function Dx(e,t,i,n,s,a,o,r,l,h,c=1){let d,u={value:kx([{x:e,y:t},{x:i,y:n},{x:s,y:a},{x:o,y:r}],l,h),next:null};for(;null!=u;){const{points:e,distance:t,minDistance:i}=u.value;if(u=u.next,(null==d||t<d.distance)&&(d={distance:t,minDistance:i}),null!=d&&d.distance-i<=c)continue;const[n,s]=vx(e[0].x,e[0].y,e[1].x,e[1].y,e[2].x,e[2].y,e[3].x,e[3].y,.5);u=Pu(u,[kx(n,l,h),kx(s,l,h)].sort(wx),wx)}return d?.distance??1/0}o(Qf,{bottomCenter:()=>nx,center:()=>ix,clone:()=>rx,collides:()=>lx,end:()=>ex,from:()=>cx,height:()=>ax,normalise:()=>hx,origin:()=>dx,round:()=>ox,start:()=>Jf,topCenter:()=>tx,width:()=>sx});var wx=(e,t)=>t.minDistance-e.minDistance;function Ix(e){return null==e?0:Pc(Rg[e])}function Ax(e){return e<0?"vertical":e>0?"vertical-reversed":"horizontal"}function Cx(e,t,i,n){if("center"===e)return{min:0,max:0};const s=i?!t:t;return("start"===e?s:!s)?{min:n,max:0}:{min:0,max:n}}function Nx(e,t,i,n){return n?{x:e.x,y:e.y+t,width:e.width,height:e.height-t-i}:{x:e.x+t,y:e.y,width:e.width-t-i,height:e.height}}function Lx(e,t){return{width:Math.max(0,e.width-t.left-t.right),height:Math.max(0,e.height-t.top-t.bottom)}}function Px(e,t,i){const{startAngle:n,endAngle:s,innerRadius:a,outerRadius:o}=t,r=Math.abs(e.x),l=Math.abs(e.y),h=Math.hypot(r,l);if(h<1e-6)return{width:0,height:0};const c=r/h,d=l/h,u=Math.min(Math.abs(s-n)/2,Math.PI/2),p=h*Math.sin(u),g=[n,s].map((e=>({sin:Math.abs(Math.sin(e)),cos:Math.abs(Math.cos(e))}))),m=i/2,y=(e=>{const t=Math.sqrt(Math.max(0,o**2-(l+e)**2))-r,i=g.map((t=>t.sin>1e-6?(p-e*t.cos)/t.sin:1/0)),n=a>0&&c>1e-6?(h-a-e*d)/c:1/0;return Math.max(0,Math.min(t,n,...i))})(m);return{width:2*y,height:2*Math.max(m,(e=>{const t=Math.sqrt(Math.max(0,o**2-(r+e)**2))-l,i=g.map((t=>t.cos>1e-6?(p-e*t.sin)/t.cos:1/0)),n=a>0&&d>1e-6?(h-a-e*c)/d:1/0;return Math.max(0,Math.min(t,n,...i))})(y))}}var Tx={top:"bottom",bottom:"top",left:"right",right:"left"};function Ox(e,t,i,n,s){const a="top"===e||"bottom"===e;if(0===t)return s[e];const o=i+s.left+s.right,r=n+s.top+s.bottom,l=Math.abs(Math.sin(t)),h=Math.abs(Math.cos(t));return(a?o/2*l+r/2*h:o/2*h+r/2*l)-(a?n/2:i/2)+(s[e]-s[Tx[e]])/2}function Rx(e,t){const i=(t.right-t.left)/2,n=(t.bottom-t.top)/2,s=Math.sin(e),a=Math.cos(e);return{x:i*(1-a)+n*s,y:n*(1-a)-i*s}}function Ex(e){return Array.isArray(e)&&e.length>1}function zx(e,t,i,n,s){const a=t+n.left+n.right,o=i+n.top+n.bottom,r=Eg(e,t,i),l=r.x+(n.right-n.left)/2,h=r.y+(n.bottom-n.top)/2,{width:c,height:d}=kc(Tc(s),a,o);return{x:l-c/2,y:h-d/2,width:c,height:d}}function Bx(e,t,i,n,s,a,o,r,l,h){const{x:c,y:d}=Eg(e,i,n);return{point:{x:c,y:d,size:0},label:{text:t,width:i,height:n},fit:h,anchor:void 0,placement:void 0,orientation:s,gap:0,neverDrop:!0,collideWith:o,threshold:r,region:a,ownBox:a,target:l}}function Fx(e,t,i,n,s,a,o,r,l,h=!1,c,d){return{point:{x:0,y:0,size:0},label:{text:e,width:t,height:i},fit:c,anchor:void 0,placement:void 0,gap:0,neverDrop:o,collideWith:r,threshold:l,positionedCandidates:n,ownBox:a,ownBoxLabelsCollide:h,target:s,styleDatum:d}}function Vx(e){for(const{datum:t,rotation:i,offsetX:n,offsetY:s,candidate:a,text:o,fontSize:r}of e){const{target:e,fit:l}=t;if(e.rotation=Pc(i??0),e.offsetX=n??0,e.offsetY=s??0,e.fittedText=null==l?void 0:o,e.fittedFontSize=null==l?void 0:r,null!=a){const{anchor:t,placement:i}=a;e.x=t.x,e.y=t.y,e.textAlign=t.textAlign,e.textBaseline=t.textBaseline,e.placement=i}}}function $x(e,t,i){const n=new Set;for(const{datum:e}of t)n.add(e.target);for(const t of e??[]){const e=i(t);null!=e?.candidates&&(e.hidden=!n.has(e))}}function Hx(e){return Array.isArray(e)&&e.length>1}function jx(e,t,i,n){return Hx(t)||!i||null!=n&&!Ex(e)}function Wx(e,t,i,n){return Ex(e)||Hx(t)||!i||null!=n}function _x(e){const t=e.collision.alwaysShow;return Wx(e.orientation,e.placement,t,Ag(e,!t))}function Gx(e){const t=e.collision.alwaysShow;return jx(e.orientation,e.placement,t,Ag(e,!t))}function Kx(e,t){const i=[];for(const n of e??[]){const e=t(n);if(null==e?.label||""===e.label.text)continue;const{label:s,config:a}=e,o=m(a.orientation);if(o.length<=1)continue;const{width:r,height:l}=e.size??Bg(s.text,a);i.push(Bx(s,s.text,r,l,o,s.region,e.collideWith,e.threshold,s,e.fit))}return i}function Yx(e){if(null==e||0===e.length)return;const t=[];for(const{x:i,y:n,width:s,height:a,phantom:o}of e)!0===o||s<=0||a<=0||t.push({kind:"rect",box:{x:i,y:n,width:s,height:a},category:"seriesItem"});return t.length>0?t:void 0}function Ux(e,t){const i=[];for(const n of e??[]){const e=t(n),s=e?.label;if(null==e||null==s||""===s.text||!0===s.hidden)continue;const{width:a,height:o}=Bg(s.text,e.config),r=zx(s,a,o,e.box,s.rotation);i.push({kind:"rect",box:r,category:"label"})}return i.length>0?i:void 0}function Xx(e,t,i,n){const s=Yx(e);if(!i)return s;const a=Ux(t,n);return null==a?s:null==s?a:s.concat(a)}function Zx(e){return"continuous"===e.type||"log"===e.type}function qx(e){return"category"===e.type}function Qx(e){return"variant"in e&&"unit-time"===e.variant}function Jx(e){return!("variant"in e)}function eb(e,t){return void 0===e||void 0===t?void 0!==e||void 0!==t:Zx(e)&&Zx(t)?e.type===t.type&&b(e.domain,t.domain)&&b(e.range,t.range):!(!qx(e)||!qx(t))&&(Qx(e)&&Qx(t)?e.firstBandTime===t.firstBandTime&&e.lastBandTime===t.lastBandTime&&e.bandCount===t.bandCount&&e.intervalMs===t.intervalMs&&e.inset===t.inset&&e.step===t.step:!(!Jx(e)||!Jx(t))&&(e.inset===t.inset&&e.step===t.step&&b(e.domain,t.domain)))}function tb(e){return null!=e&&("category"===e.type?Qx(e)?Number.isFinite(e.firstBandTime)&&Number.isFinite(e.lastBandTime)&&Number.isFinite(e.bandCount)&&e.bandCount>0:e.domain.every((e=>null!=e)):e.domain.every((e=>Number.isFinite(e)||e instanceof Date))&&e.range.every((e=>Number.isFinite(e))))}function ib(e){switch(e.type){case"linear":case"step":case"multi-line":return[{x:e.x0,y:e.y0},{x:e.x1,y:e.y1}];case"cubic":return[{x:e.cp0x,y:e.cp0y},{x:e.cp3x,y:e.cp3y}]}}function nb(e,t){const{x:i,y:n}=t;switch(e.type){case"linear":return{type:"linear",moveTo:e.moveTo,x0:i,y0:n,x1:i,y1:n};case"step":return{type:"step",moveTo:e.moveTo,x0:i,y0:n,x1:i,y1:n,stepX:i};case"cubic":return{type:"cubic",moveTo:e.moveTo,cp0x:i,cp0y:n,cp1x:i,cp1y:n,cp2x:i,cp2y:n,cp3x:i,cp3y:n};case"multi-line":return{type:"multi-line",moveTo:e.moveTo,x0:i,y0:n,x1:i,y1:n,midPoints:e.midPoints.map((()=>({x:i,y:n})))}}}
1function sb(e,t,i){const[n,s]=ib(e),a=s.x===n.x?0:(i.x-t.x)/(s.x-n.x),o=s.y===n.y?0:(i.y-t.y)/(s.y-n.y);switch(e.type){case"linear":return{type:"linear",moveTo:e.moveTo,x0:t.x,y0:t.y,x1:i.x,y1:i.y};case"cubic":return{type:"cubic",moveTo:e.moveTo,cp0x:t.x,cp0y:t.y,cp1x:i.x-(e.cp2x-n.x)*a,cp1y:i.y-(e.cp2y-n.y)*o,cp2x:i.x-(e.cp1x-n.x)*a,cp2y:i.y-(e.cp1y-n.y)*o,cp3x:i.x,cp3y:i.y};case"step":return{type:"step",moveTo:e.moveTo,x0:t.x,y0:t.y,x1:i.x,y1:i.y,stepX:i.x-(e.stepX-n.x)*a};case"multi-line":return{type:"multi-line",moveTo:e.moveTo,x0:t.x,y0:t.y,x1:i.x,y1:i.y,midPoints:e.midPoints.map((e=>({x:t.x+(e.x-n.x)*a,y:t.y+(e.y-n.y)*o})))}}}function ab(e,t,i){const{moveTo:n}=e,[s,a]=function(e){const t=ib(e);return t[0].x>t[1].x&&t.reverse(),t}(e),{x:o,y:r}=s,{x:l,y:h}=a;if(i<o)return sb(e,s,s);if(t>l)return sb(e,a,a);switch(e.type){case"linear":{const e=r===h?void 0:(h-r)/(l-o);return{type:"linear",moveTo:n,x0:t,y0:null==e?r:e*(t-o)+r,x1:i,y1:null==e?r:e*(i-o)+r}}case"step":if(i<=e.stepX){const s=e.y0;return{type:"step",moveTo:n,x0:t,y0:s,x1:i,y1:s,stepX:i}}if(t>=e.stepX){const s=e.y1;return{type:"step",moveTo:n,x0:t,y0:s,x1:i,y1:s,stepX:t}}{const{y0:s,y1:a,stepX:o}=e;return{type:"step",moveTo:n,x0:t,y0:s,x1:i,y1:a,stepX:o}}case"cubic":{const s=bx(e.cp0x,e.cp1x,e.cp2x,e.cp3x,t);let[a,o]=vx(e.cp0x,e.cp0y,e.cp1x,e.cp1y,e.cp2x,e.cp2y,e.cp3x,e.cp3y,s);const r=bx(o[0].x,o[1].x,o[2].x,o[3].x,i);return[o,a]=vx(o[0].x,o[0].y,o[1].x,o[1].y,o[2].x,o[2].y,o[3].x,o[3].y,r),{type:"cubic",moveTo:n,cp0x:o[0].x,cp0y:o[0].y,cp1x:o[1].x,cp1y:o[1].y,cp2x:o[2].x,cp2y:o[2].y,cp3x:o[3].x,cp3y:o[3].y}}case"multi-line":{const{midPoints:s}=e,a=s.findLastIndex((e=>e.x<=t));let c=s.findIndex((e=>e.x>=i));-1===c&&(c=s.length);const d=a>=0?s[a]:void 0,u=d?.x??o,p=d?.y??r,g=c<s.length?s[c]:void 0,m=g?.x??l,y=g?.y??h,f=p===y?void 0:(y-p)/(m-u);return{type:"multi-line",moveTo:n,x0:t,y0:null==f?p:f*(u-o)+p,x1:i,y1:null==f?p:f*(m-o)+p,midPoints:s.slice(Math.max(a,0),c)}}}}var ob=(e=>(e[e.MoveTo=0]="MoveTo",e[e.LineTo=1]="LineTo",e[e.Skip=2]="Skip",e))(ob||{});function rb(e){const t=[];let i=0,n=Number.NaN,s=Number.NaN;for(const{x:a,y:o}of e){if(i>0){const e=1===i;t.push({type:"linear",moveTo:e,x0:n,y0:s,x1:a,y1:o})}i+=1,n=a,s=o}return t}var lb={start:0,middle:.5,end:1};function hb(e,t){const i=[];let n=0,s=Number.NaN,a=Number.NaN;const o="number"==typeof t?t:lb[t];for(const{x:t,y:r}of e){if(n>0){const e=1===n,l=s+(t-s)*o;i.push({type:"step",moveTo:e,x0:s,y0:a,x1:t,y1:r,stepX:l})}n+=1,s=t,a=r}return i}function cb(e,t){const i=Array.isArray(e)?e:Array.from(e);if(i.length<=1)return[];const n=.05,s=i.map(((e,t)=>{const s=0===t?e:i[t-1],a=t===i.length-1?e:i[t+1],o=0===t||t===i.length-1;if(Math.sign(s.y-e.y)===Math.sign(a.y-e.y))return 0;if(!o){const t=Math.abs(s.y-a.y),i=Math.abs(e.y-s.y)/t,o=Math.abs(e.y-a.y)/t;if(i<=n||1-i<=n||o<=n||1-o<=n)return 0}return(a.y-s.y)/(a.x-s.x)}));0===s[1]&&(s[0]*=2),0===s.at(-2)&&(s[s.length-1]*=2);const a=[];for(let e=1;e<i.length;e+=1){const n=i[e-1],o=s[e-1],r=i[e],l=s[e],h=r.x-n.x,c=r.y-n.y;let d=h*t/3,u=h*o*t/3,p=h*t/3,g=h*l*t/3;0===l&&Math.abs(u)>Math.abs(c)&&(d*=Math.abs(c/u),u=Math.sign(u)*Math.abs(c)),0===o&&Math.abs(g)>Math.abs(c)&&(p*=Math.abs(c/g),g=Math.sign(g)*Math.abs(c)),a.push({type:"cubic",moveTo:1===e,cp0x:n.x,cp0y:n.y,cp1x:n.x+d,cp1y:n.y+u,cp2x:r.x-p,cp2y:r.y-g,cp3x:r.x,cp3y:r.y})}return a}var db=0,ub=1;function pb(e){return{x:{min:e?.x?.min??db,max:e?.x?.max??ub},y:{min:e?.y?.min??db,max:e?.y?.max??ub}}}function gb(e,t){return"x"===t?e?.x:"y"===t?e?.y:void 0}function mb(e){let t,i;for(const n of Object.keys(e)){const s=e[n];s&&("x"===s.direction?t??(t={min:s.min,max:s.max}):"y"===s.direction&&(i??(i={min:s.min,max:s.max})))}if(t||i)return{x:t,y:i}}var yb=class extends Yr{constructor(){super(...arguments),this._dirty=!0}markDirty(){this._dirty=!0}markClean(e){this._dirty=!1}isDirty(){return this._dirty}onChangeDetection(e){this.markDirty()}},fb={periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]};function xb(e,t=new Date(e.getFullYear(),0,1)){const i=e.getTimezoneOffset()-t.getTimezoneOffset(),n=e.getTime()-t.getTime()+6e4*i;return Math.floor(n/864e5)}function bb(e,t){const i=(t-new Date(e.getFullYear(),0,1).getDay()+7)%7,n=new Date(e.getFullYear(),0,i+1);return n<=e?Math.floor(xb(e,n)/7)+1:0}function vb(e,t=e.getFullYear()){const i=new Date(t,0,1).getDay(),n=new Date(t,0,(4-i+7)%7-3+1);return n<=e?Math.floor(xb(e,n)/7)+1:vb(e,t-1)}var Sb={a:e=>fb.shortDays[e.getDay()],A:e=>fb.days[e.getDay()],b:e=>fb.shortMonths[e.getMonth()],B:e=>fb.months[e.getMonth()],c:"%x, %X",d:(e,t)=>kb(e.getDate(),2,t??"0"),e:"%_d",f:(e,t)=>kb(1e3*e.getMilliseconds(),6,t??"0"),H:(e,t)=>kb(e.getHours(),2,t??"0"),I:(e,t)=>{const i=e.getHours()%12;return 0===i?"12":kb(i,2,t??"0")},j:(e,t)=>kb(xb(e)+1,3,t??"0"),m:(e,t)=>
1kb(e.getMonth()+1,2,t??"0"),M:(e,t)=>kb(e.getMinutes(),2,t??"0"),L:(e,t)=>kb(e.getMilliseconds(),3,t??"0"),p:e=>e.getHours()<12?"AM":"PM",Q:e=>String(e.getTime()),s:e=>String(Math.floor(e.getTime()/1e3)),S:(e,t)=>kb(e.getSeconds(),2,t??"0"),u:e=>{let t=e.getDay();return t<1&&(t+=7),String(t%7)},U:(e,t)=>kb(bb(e,0),2,t??"0"),V:(e,t)=>kb(vb(e),2,t??"0"),w:(e,t)=>kb(e.getDay(),2,t??"0"),W:(e,t)=>kb(bb(e,1),2,t??"0"),x:"%-m/%-d/%Y",X:"%-I:%M:%S %p",y:(e,t)=>kb(e.getFullYear()%100,2,t??"0"),Y:(e,t)=>kb(e.getFullYear(),4,t??"0"),Z:e=>function(e){const t=e.getTimezoneOffset(),i=Math.abs(t);return`${t>0?"-":"+"}${kb(Math.floor(i/60),2,"0")}${kb(Math.floor(i%60),2,"0")}`}(e),"%":()=>"%"},Mb={_:" ",0:"0","-":""};function kb(e,t,i){const n=String(Math.floor(e));return n.length>=t?n:`${i.repeat(t-n.length)}${n}`}function Db(e){const t=[];for(;e.length>0;){let i=e.indexOf("%");if(0!==i){const n=i>0?e.substring(0,i):e;t.push(n)}if(i<0)break;const n=e[i+1],s=Mb[n];null!=s&&i++;const a=e[i+1],o=Sb[a];if("function"==typeof o)t.push([o,s]);else if("string"==typeof o){const e=Db(o);t.push([e,s])}else t.push(`${s??""}${a}`);e=e.substring(i+2)}return e=>{const i="number"==typeof e?new Date(e):e;return t.map((e=>"string"==typeof e?e:e[0](i,e[1]))).join("")}}function wb(e,t){const i=op("button",Lb("ag-charts-input ag-charts-button",t));return void 0===e.label?(i.append(Nb(e.icon)),i.ariaLabel=e.altText):i.append(e.label),i.addEventListener("click",e.onPress),_c(i,t),i}function Ib(e,t){const i=op("input",Lb("ag-charts-input ag-charts-checkbox",t));return i.type="checkbox",i.checked=e.checked,i.addEventListener("change",(t=>e.onChange(i.checked,t))),i.addEventListener("keydown",(e=>{fu(e)&&(e.preventDefault(),i.click())})),_c(i,t),i}function Ab(e,t){const i=op("select",Lb("ag-charts-input ag-charts-select",t));return i.append(...e.options.map((e=>{const t=op("option");return t.value=e.value,t.textContent=e.label,t}))),Wc(i,"data-preventdefault",!1),i.value=e.value,i.addEventListener("change",(t=>e.onChange(i.value,t))),_c(i,t),i}function Cb(e,t){const i=op("textarea",Lb("ag-charts-input ag-charts-textarea",t));return i.value=e.value,i.addEventListener("input",(t=>e.onChange(i.value,t))),_c(i,t),Wc(i,"data-preventdefault",!1),i}function Nb(e){const t=op("span",`ag-charts-icon ag-charts-icon-${e}`);return Wc(t,"aria-hidden",!0),t}function Lb(e,t){return null==t?e:`${e} ${t.class}`}var Pb=e=>e,Tb=e=>1-Math.cos(e*Math.PI/2),Ob=e=>Math.sin(e*Math.PI/2),Rb=e=>-(Math.cos(e*Math.PI)-1)/2,Eb=e=>e*e,zb=e=>1-(1-e)**2,Bb=e=>e<.5?2*e*e:1-(-2*e+2)**2/2,Fb=e=>2*Math.asin(e)/Math.PI,Vb=(e,t)=>e===t;function $b(e){return function(t,i){const n=`__${i}`;t[i]||Kb(t,i,n,e)}}function Hb(e){return $b(e)}function jb(e){return $b(e)}function Wb(e){return(e??{}).equals=b,$b(e)}function _b(e){return function(t,i){const n=`__${i}`;t[i]||Kb(t,i,n,e)}}function Gb(e){return function(t,i){const n=`__${i}`;t[i]||Kb(t,i,n,e)}}function Kb(e,t,i,n){const{changeCb:s,convertor:a,checkDirtyOnAssignment:o=!1}=n??{},r={changeCb:s,checkDirtyOnAssignment:o,convertor:a},l=function(e,t,i){const{checkDirtyOnAssignment:n}=i;if(n){let i=function(i){const n=t.call(this,i);return!0===i?._dirty&&this.markDirty(e),n};return i}return t}(i,function(e,t){const{changeCb:i}=t;if(i){let t=function(t){const i=e.call(this,t);return i!==Yb&&n.call(this,this),i};const n=i;return t}return e}(function(e,t){const{convertor:i}=t;if(i){let t=function(t){e.call(this,n(t))};const n=i;return t}return e}(function(e,t){const{equals:i=Vb}=t;function n(t){const n=this[e];return i(t,n)?Yb:(this[e]=t,this.onChangeDetection(e),t)}return n}(i,r),r),r),r);Object.defineProperty(e,t,{set:l,get:function(){return this[i]},enumerable:!0,configurable:!0})}var Yb=Symbol("no-change")},ow2d(e,t,i){i.d(t,{fK:()=>HL,hF:()=>jL,sy:()=>s.sy});i("19CV"),i("4fTp"),i("WFxX"),i("g6Bo"),i("ezUZ"),i("d5A/"),i("pPCv"),i("+Qw0"),i("01Te"),i("Wd41"),i("VkU2"),i("IHgz"),i("EaqF"),i("VaRY"),i("p5S9"),i("9km/"),i("zEmq"),i("x6/l"),i("d0Mj");var n=i("zlFw"),s=i("Vwos"),a=i("Q3ZI"),o=Object.defineProperty,r=Object.getOwnPropertyDescriptor,l=(e,t,i,n)=>{for(var s,a=n>1?void 0:n?r(t,i):t,l=e.length-1;l>=0;l--)(s=e[l])&&(a=(n?s(t,i,a):s(a))||a);return n&&a&&o(t,i,a),a},h={fill:{$ref:"foregroundColor"},fillOpacity:.08,stroke:{$ref:"backgroundColor"},strokeWidth:{$isUserOption:["./stroke",1,0]},label:{fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"}
1,padding:{$applyPadding:{$if:[{$path:"./border/enabled"},{left:12,right:12,top:8,bottom:8},5]}},color:{$ref:"textColor"},cornerRadius:4,border:{enabled:!1,stroke:{$ref:"foregroundColor"},strokeOpacity:1,strokeWidth:1}},marker:{strokeWidth:{$isUserOption:["./stroke",1,0]}}},c={$apply:[h,void 0,{$pathString:["/$seriesType/seriesArea/backgroundRegions",{seriesType:{$path:["/series/0/type","line"]}}]}]},d=(()=>{var e=class extends n.XPE{constructor(){super(),this.opacity=1,this.loadedSynchronously=!0,this.containerWidth=0,this.containerHeight=0,this.onLoad=void 0,this.onImageLoad=()=>{this.loadedSynchronously||(this.node.visible=!1,this.performLayout(this.containerWidth,this.containerHeight),this.onLoad?.())},this.imageElement=(0,n.na4)("img"),this.imageElement.onload=this.onImageLoad,this.node=new s.n1.Image(this.imageElement)}get complete(){return this.imageElement.width>0&&this.imageElement.height>0}performLayout(e,t){this.containerWidth=e,this.containerHeight=t;const i={width:e,height:t},s=(0,n.ePN)(this.imageElement.width,this.imageElement.height,i,this);return this.node.setProperties(this.complete?{visible:!0,opacity:this.opacity,...s}:{visible:!1}),s}};return l([n.mAP],e.prototype,"top",2),l([n.mAP],e.prototype,"right",2),l([n.mAP],e.prototype,"bottom",2),l([n.mAP],e.prototype,"left",2),l([n.mAP],e.prototype,"width",2),l([n.mAP],e.prototype,"height",2),l([n.mAP],e.prototype,"opacity",2),l([(0,n.i1O)("imageElement.src"),(0,n.SY0)((e=>e.loadedSynchronously=e.complete))],e.prototype,"url",2),e})(),u=class extends s.n1.Background{constructor(e){super(e),this.image=new d,this.node.appendChild(this.image.node),this.image.onLoad=()=>this.onImageLoad(),this.cleanup.register((()=>{this.image.node.remove(),this.image.onLoad=void 0}))}applyOptions(){super.applyOptions();const{image:e}=this.ctx.chartState.getValue("options","background");null!=e&&this.image.set(e)}onLayoutComplete(e){super.onLayoutComplete(e);const{width:t,height:i}=e.chart;this.image.performLayout(t,i)}onImageLoad(){this.ctx.eventsHub.emit("chart:request-update",{type:n.GvF.SCENE_RENDER})}},p=class extends s.n1.Background{constructor(e){super(e),this.image=new d,this.imageInScene=!1,this.image.onLoad=()=>this.onImageLoad(),this.cleanup.register((()=>{this.imageInScene&&this.image.node.remove(),this.image.onLoad=void 0}))}applyOptions(){const e=this.ctx.chartState.getValue("options","foreground");this.node.visible=e?.visible??!0,this.rectNode.fill=e?.fill??"transparent",this.rectNode.fillOpacity=e?.fillOpacity??1,null!=e?.image&&(this.imageInScene||(this.node.appendChild(this.image.node),this.imageInScene=!0),this.image.set(e.image)),this.textNode.text=e?.text}createNode(){return new s.n1.Group({name:"foreground",zIndex:n.Dcv.FOREGROUND})}onLayoutComplete(e){super.onLayoutComplete(e);const{width:t,height:i}=e.chart,n=this.image.performLayout(t,i);this.textNode.text&&this.updateTextNode(n)}onImageLoad(){this.ctx.eventsHub.emit("chart:request-update",{type:n.GvF.SCENE_RENDER})}updateTextNode(e){const{textNode:t}=this;t.fontWeight="bold",t.fontFamily="Impact, sans-serif",t.fontSize=19,t.opacity=.7,t.fill="#9b9b9b",t.textBaseline="top";const{width:i}=t.getBBox();t.x=e.x+e.width/2-i/2,t.y=e.y+e.height+10}},{bandRangeExpansion:g,isValidScaleValue:m}=s.n1,y={top:{regionH:0,regionV:-1,labelH:0,labelV:1},"inside-top":{regionH:0,regionV:-1,labelH:0,labelV:-1},"left-top":{regionH:-1,regionV:-1,labelH:1,labelV:-1},"top-left":{regionH:-1,regionV:-1,labelH:-1,labelV:1},"inside-top-left":{regionH:-1,regionV:-1,labelH:-1,labelV:-1}
1,left:{regionH:-1,regionV:0,labelH:1,labelV:0},"inside-left":{regionH:-1,regionV:0,labelH:-1,labelV:0},"left-bottom":{regionH:-1,regionV:1,labelH:1,labelV:1},"bottom-left":{regionH:-1,regionV:1,labelH:-1,labelV:-1},"inside-bottom-left":{regionH:-1,regionV:1,labelH:-1,labelV:1},bottom:{regionH:0,regionV:1,labelH:0,labelV:-1},"inside-bottom":{regionH:0,regionV:1,labelH:0,labelV:1},"right-bottom":{regionH:1,regionV:1,labelH:-1,labelV:1},"bottom-right":{regionH:1,regionV:1,labelH:1,labelV:-1},"inside-bottom-right":{regionH:1,regionV:1,labelH:1,labelV:1},right:{regionH:1,regionV:0,labelH:-1,labelV:0},"inside-right":{regionH:1,regionV:0,labelH:1,labelV:0},"right-top":{regionH:1,regionV:-1,labelH:-1,labelV:-1},"top-right":{regionH:1,regionV:-1,labelH:1,labelV:1},"inside-top-right":{regionH:1,regionV:-1,labelH:1,labelV:-1},inside:{regionH:0,regionV:0,labelH:0,labelV:0}},f=(()=>{var e=class{constructor(e){this.logger=e,this.internalId=(0,n.sX_)(this),this.regionGroup=new s.n1.Group({name:this.internalId}),this.labelGroup=new s.n1.Group({name:this.internalId}),this.regionNode=this.regionGroup.appendChild(new s.n1.Rect),this.labelNode=this.labelGroup.appendChild(new s.n1.TransformableText)}setOptions(e){this.opts=e}update(e){const t=this.getBounds(e);if(this.regionGroup.visible=null!=t,null==t)return void(this.labelGroup.visible=!1);this.updateRegionNode(t);const i=this.getSeriesAreaBounds(t);this.labelGroup.visible=null!=i,null!=i&&this.updateLabelNode(i)}updateRegionNode(e){const{opts:t}=this;this.regionNode.x=e.x1,this.regionNode.y=e.y1,this.regionNode.width=n.Zbg.width(e),this.regionNode.height=n.Zbg.height(e),this.regionNode.fill=t.fill,this.regionNode.fillOpacity=t.fillOpacity??1,this.regionNode.stroke=t.stroke,this.regionNode.strokeOpacity=t.strokeOpacity??1,this.regionNode.strokeWidth=t.strokeWidth??1}updateLabelNode(e){this.updateLabel(),this.positionLabel(e)}updateLabel(){const{labelNode:e,opts:{label:t}}=this;t&&t.text&&(e.fill=t.color,e.text=t.text,e.textAlign="center",e.textBaseline="middle",e.setFont(t),e.setBoxing(t))}positionLabel(e){const{labelNode:t,opts:{label:i}}=this;if(!i)return;const{padding:s,rotation:a,xOffset:o=0,yOffset:r=0}=i,l=this.getAnchor(),h=t.getBBox();if(!h)return;const{width:c,height:d}=h,u=(s.right??0)-(s.left??0),p=(s.bottom??0)-(s.top??0),g=c/2,m=d/2,y=e.x1+n.Zbg.width(e)*(l.regionH+1)/2,f=e.y1+n.Zbg.height(e)*(l.regionV+1)/2,x=y-g*l.labelH-u/2+o,b=f-m*l.labelV-p/2+r;t.rotation=(0,n.ehJ)(a??0),t.x=x,t.y=b,t.rotationCenterX=x,t.rotationCenterY=b}getBounds(e){const{opts:t,xAxis:i,yAxis:s}=this;if(!i||!s)return;const a=this.getAxisExtent(e,i.scale,t.xRange,"xRange"),o=this.getAxisExtent(e,s.scale,t.yRange,"yRange");if(!a||!o)return;const r=n.Zbg.from(a[0],o[0],a[1],o[1]),l=null!=t.xRange?.start&&null!=t.xRange?.end,h=null!=t.yRange?.start&&null!=t.yRange?.end;if(!(0===n.Zbg.width(r)&&l||0===n.Zbg.height(r)&&h))return r;this.logger.warnOnce(`\`seriesArea.backgroundRegions[${e}]\` region has no width or height, ignoring. Check that \`start\` and \`end\` differ.`)}getSeriesAreaBounds(e){const{xAxis:t,yAxis:i}=this;if(!t||!i)return;const s=n.Zbg.from((0,n.jVD)(e.x1,t.range),(0,n.jVD)(e.y1,i.range),(0,n.jVD)(e.x2,t.range),(0,n.jVD)(e.y2,i.range));return 0!==n.Zbg.width(s)&&0!==n.Zbg.height(s)?s:void 0}getAxisExtent(e,t,i,s){const{start:a,end:o}=i??{};if(null!=a&&!m(a,t)||null!=o&&!m(o,t))return void this.logger.warnOnce(`\`seriesArea.backgroundRegions[${e}].${s}\` does not match the axis type or domain, ignoring.`);let r=null==a?t.range[0]:t.convert(a,{alignment:n.w8L.Leading}),l=null==o?t.range[1]:t.convert(o,{alignment:n.w8L.Trailing}),h=null!=a,c=null!=o;r>l&&([r,l]=[l,r],[h,c]=[c,h]);const{bandwidth:d,rangePadding:u}=g(t);return h&&(r-=u),c&&(l+=d+u),[r,l]}getAnchor(){const{position:e="top"}=this.opts.label??{};return y[e]}};return e.className="BackgroundRegion",e})(),x=class extends s.n1.SeriesArea{constructor(e){super(e),this.instances=[],this.regionGroup=new s.n1.Group({name:"BackgroundRegions-Region"}),this.labelGroup=new s.n1.Group({name:"BackgroundRegions-Label"}),this.underlayGroup.appendChild(this.regionGroup),this.overlayGroup.appendChild(this.labelGroup),this.cleanup.register((()=>{this.detachInstances(),this.regionGroup.remove(),this.labelGroup.remove()}))}applyOptions(){this.applyRegionOptions(this.ctx.chartState.getValue("options","seriesArea")?.backgroundRegions)}onUpdate(e){this.regionGroup.setClipRectCanvasSpace(e);let t=0;for(const e of this.instances)e.update(t),t++}applyRegionOptions(e){this.optionsEquivalent(e)||(this.lastRegionOptions=e,this.detachInstances(),this.instances=e?.map((e=>{const t=new f(this.ctx.logger);return t.setOptions(e),this.attachInstance(t),this.initInstance(t,e),t}))??[])}attachInstance(e){this.regionGroup.appendChild(e.regionGroup),this.labelGroup.appendChild(e.labelGroup)}detachInstances(){for(const e of this.instances)e.regionGroup.remove(),e.labelGroup.remove();this.instances=[]}initInstance(e,t){e.xAxis=this.resolveAxis(n.tv$.X,t.xRange?.axis,"xRange"),e.yAxis=this.resolveAxis(n.tv$.Y,t.yRange?.axis,"y
1Range")}resolveAxis(e,t,i){const n=null==t?void 0:this.ctx.axisManager.getRemappedAxisId(t);return null!=t&&null==n&&this.ctx.logger.warnOnce(`No axis found matching \`seriesArea.backgroundRegions[].${i}.axis\` of \`${t}\`, using the primary axis.`),null==n?this.ctx.axisManager.getAxisContext(e).at(0):this.ctx.axisManager.getAxisIdContext(n)}optionsEquivalent(e){const t=this.lastRegionOptions;return e===t||null!=e&&null!=t&&null==(0,n.G4M)(t,e)}},b=class{constructor(){this.ieCompatibility=!1}init(){this.ieCompatibility="5d41402abc4b2a76b9719d911017c592"!=this.md5("hello")}md5cycle(e,t){let i=e[0],n=e[1],s=e[2],a=e[3];i=this.ff(i,n,s,a,t[0],7,-680876936),a=this.ff(a,i,n,s,t[1],12,-389564586),s=this.ff(s,a,i,n,t[2],17,606105819),n=this.ff(n,s,a,i,t[3],22,-1044525330),i=this.ff(i,n,s,a,t[4],7,-176418897),a=this.ff(a,i,n,s,t[5],12,1200080426),s=this.ff(s,a,i,n,t[6],17,-1473231341),n=this.ff(n,s,a,i,t[7],22,-45705983),i=this.ff(i,n,s,a,t[8],7,1770035416),a=this.ff(a,i,n,s,t[9],12,-1958414417),s=this.ff(s,a,i,n,t[10],17,-42063),n=this.ff(n,s,a,i,t[11],22,-1990404162),i=this.ff(i,n,s,a,t[12],7,1804603682),a=this.ff(a,i,n,s,t[13],12,-40341101),s=this.ff(s,a,i,n,t[14],17,-1502002290),n=this.ff(n,s,a,i,t[15],22,1236535329),i=this.gg(i,n,s,a,t[1],5,-165796510),a=this.gg(a,i,n,s,t[6],9,-1069501632),s=this.gg(s,a,i,n,t[11],14,643717713),n=this.gg(n,s,a,i,t[0],20,-373897302),i=this.gg(i,n,s,a,t[5],5,-701558691),a=this.gg(a,i,n,s,t[10],9,38016083),s=this.gg(s,a,i,n,t[15],14,-660478335),n=this.gg(n,s,a,i,t[4],20,-405537848),i=this.gg(i,n,s,a,t[9],5,568446438),a=this.gg(a,i,n,s,t[14],9,-1019803690),s=this.gg(s,a,i,n,t[3],14,-187363961),n=this.gg(n,s,a,i,t[8],20,1163531501),i=this.gg(i,n,s,a,t[13],5,-1444681467),a=this.gg(a,i,n,s,t[2],9,-51403784),s=this.gg(s,a,i,n,t[7],14,1735328473),n=this.gg(n,s,a,i,t[12],20,-1926607734),i=this.hh(i,n,s,a,t[5],4,-378558),a=this.hh(a,i,n,s,t[8],11,-2022574463),s=this.hh(s,a,i,n,t[11],16,1839030562),n=this.hh(n,s,a,i,t[14],23,-35309556),i=this.hh(i,n,s,a,t[1],4,-1530992060),a=this.hh(a,i,n,s,t[4],11,1272893353),s=this.hh(s,a,i,n,t[7],16,-155497632),n=this.hh(n,s,a,i,t[10],23,-1094730640),i=this.hh(i,n,s,a,t[13],4,681279174),a=this.hh(a,i,n,s,t[0],11,-358537222),s=this.hh(s,a,i,n,t[3],16,-722521979),n=this.hh(n,s,a,i,t[6],23,76029189),i=this.hh(i,n,s,a,t[9],4,-640364487),a=this.hh(a,i,n,s,t[12],11,-421815835),s=this.hh(s,a,i,n,t[15],16,530742520),n=this.hh(n,s,a,i,t[2],23,-995338651),i=this.ii(i,n,s,a,t[0],6,-198630844),a=this.ii(a,i,n,s,t[7],10,1126891415),s=this.ii(s,a,i,n,t[14],15,-1416354905),n=this.ii(n,s,a,i,t[5],21,-57434055),i=this.ii(i,n,s,a,t[12],6,1700485571),a=this.ii(a,i,n,s,t[3],10,-1894986606),s=this.ii(s,a,i,n,t[10],15,-1051523),n=this.ii(n,s,a,i,t[1],21,-2054922799),i=this.ii(i,n,s,a,t[8],6,1873313359),a=this.ii(a,i,n,s,t[15],10,-30611744),s=this.ii(s,a,i,n,t[6],15,-1560198380),n=this.ii(n,s,a,i,t[13],21,1309151649),i=this.ii(i,n,s,a,t[4],6,-145523070),a=this.ii(a,i,n,s,t[11],10,-1120210379),s=this.ii(s,a,i,n,t[2],15,718787259),n=this.ii(n,s,a,i,t[9],21,-343485551),e[0]=this.add32(i,e[0]),e[1]=this.add32(n,e[1]),e[2]=this.add32(s,e[2]),e[3]=this.add32(a,e[3])}cmn(e,t,i,n,s,a){return t=this.add32(this.add32(t,e),this.add32(n,a)),this.add32(t<<s|t>>>32-s,i)}ff(e,t,i,n,s,a,o){return this.cmn(t&i|~t&n,e,t,s,a,o)}gg(e,t,i,n,s,a,o){return this.cmn(t&n|i&~n,e,t,s,a,o)}hh(e,t,i,n,s,a,o){return this.cmn(t^i^n,e,t,s,a,o)}ii(e,t,i,n,s,a,o){return this.cmn(i^(t|~n),e,t,s,a,o)}md51(e){const t=e.length,i=[1732584193,-271733879,-1732584194,271733878];let n;for(n=64;n<=e.length;n+=64)this.md5cycle(i,this.md5blk(e.substring(n-64,n)));e=e.substring(n-64);const s=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];for(n=0;n<e.length;n++)s[n>>2]|=e.charCodeAt(n)<<(n%4<<3);if(s[n>>2]|=128<<(n%4<<3),n>55)for(this.md5cycle(i,s),n=0;n<16;n++)s[n]=0;return s[14]=8*t,this.md5cycle(i,s),i}md5blk(e){const t=[];for(let i=0;i<64;i+=4)t[i>>2]=e.charCodeAt(i)+(e.charCodeAt(i+1)<<8)+(e.charCodeAt(i+2)<<16)+(e.charCodeAt(i+3)<<24);return t}rhex(e){const t="0123456789abcdef".split("");let i="",n=0;for(;n<4;n++)i+=t[e>>8*n+4&15]+t[e>>8*n&15];return i}hex(e){for(let t=0;t<e.length;t++)e[t]=this.rhex(e[t]);return e.join("")}md5(e){return this.hex(this.md51(e))}add32(e,t){return this.ieCompatibility?this.add32Compat(e,t):this.add32Std(e,t)}add32Std(e,t){return e+t&4294967295}add32Compat(e,t){const i=(65535&e)+(65535&t);return(e>>16)+(t>>16)+(i>>16)<<16|65535&i}};function v(e){return null==e||0===e.length}
1var S={"01":"GRID","02":"CHARTS","0102":"BOTH"},M="https://www.ag-grid.com/charts/licensing/";var k=(()=>{var e=class e{constructor(e){this.watermarkMessage=void 0,this.validatedKey=void 0,this.validatedGridContext=!1,this.validated=!1,this.totalMessageLength=124,this.document=e,this.md5=new b,this.md5.init()}validateLicense(){const{licenseKey:t,gridContext:i}=e;if(this.validated&&this.validatedKey===t&&this.validatedGridContext===i)return;this.validated=!0,this.validatedKey=t,this.validatedGridContext=i,this.watermarkMessage=void 0;const n=this.getLicenseDetails(t,i),s=`AG ${"BOTH"===n.currentLicenseType?"Grid and ":""}Charts Enterprise`;let a="";if("BOTH"===n.suppliedLicenseType?a="AG Grid and AG Charts Enterprise":"GRID"===n.suppliedLicenseType?a="AG Grid Enterprise":void 0!==n.suppliedLicenseType&&(a="AG Charts Enterprise"),n.missing)this.isWebsiteUrl()&&!this.isForceWatermark()||this.outputMissingLicenseKey(s);else if(n.expired){const t=e.getChartsReleaseDate(),i=e.formatDate(t);this.outputExpiredKey(n.expiry,i,a)}else n.valid?n.isTrial&&n.trialExpired&&this.outputExpiredTrialKey(n.expiry,s,a):this.outputInvalidLicenseKey(!!n.incorrectLicenseType,s,a);e.licenseOutputLogged=!0}static extractExpiry(t){const i=t.substring(t.lastIndexOf("_")+1,t.length);return new Date(Number.parseInt(e.decode(i),10))}static extractLicenseComponents(t){let i=t.replaceAll(/[\u200B-\u200D\uFEFF]/g,"");if(i=i.replaceAll(/\r?\n|\r/g,""),t.length<=32)return{md5:null,license:t,version:null,isTrial:null};const n=i.length-32,s=i.substring(n),a=i.substring(0,n),[o,r,l]=e.extractBracketedInformation(i);return{md5:s,license:a,version:o,isTrial:r,type:l}}isLicenseKeySupplied(){return e.licenseKeySupplied}getLicenseDetails(t,i=!1){const n="CHARTS";if(v(t))return{licenseKey:t,valid:!1,missing:!0,currentLicenseType:n};const s=e.getChartsReleaseDate(),{md5:a,license:o,version:r,isTrial:l,type:h}=e.extractLicenseComponents(t);let c,d,u,p=a===this.md5.md5(o)&&!t.includes("For_Trialing_ag-Grid_Only"),g=null,m=!1;if(p&&(g=e.extractExpiry(o),p=!Number.isNaN(g.getTime()),p))switch(d=s>g,r){case"legacy":case"2":p=!1;break;case"3":v(h)?p=!1:(u=h,h!==S["02"]&&h!==S["0102"]?(p=!1,m=!0):l&&(c=g<new Date,d=void 0))}return p?{licenseKey:t,valid:p,expiry:e.formatDate(g),expired:d,version:r,isTrial:l,trialExpired:c,invalidLicenseTypeForCombo:i?"BOTH"!==u:void 0,incorrectLicenseType:m,currentLicenseType:n,suppliedLicenseType:u}:{licenseKey:t,valid:p,incorrectLicenseType:m,currentLicenseType:n,suppliedLicenseType:u}}isDisplayWatermark(){return this.isForceWatermark()||!this.isLocalhost()&&!this.isWebsiteUrl()&&!v(this.watermarkMessage)}getWatermarkMessage(){return this.watermarkMessage??""}getWatermarkForegroundConfig(){const e=this.getWatermarkMessage();if(e)return this.buildWatermarkConfig(e)}getWatermarkForegroundConfigForBrowser(){if(!this.isDisplayWatermark())return;const e=this.getWatermarkMessage();return e?this.buildWatermarkConfig(e):void 0}buildWatermarkConfig(e){return{text:e,image:{url:"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjU4IiBoZWlnaHQ9IjQwIiB2aWV3Qm94PSIwIDAgMjU4IDQwIiBmaWxsPSJub25lIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgo8cGF0aCBkPSJNMjUuNzc5IDI4LjY1N0gxMy4zNTlMMTEuMTczIDM0LjAxMkg1LjY3Mjk3TDE3LjE4MiA3LjA1OTk5SDIxLjk1M0wzMy40NjIgMzQuMDEySDI3Ljk2MkwyNS43NzYgMjguNjU3SDI1Ljc3OVpNMjQuMDY4IDI0LjM5N0wxOS41ODggMTMuNDM0TDE1LjEwNyAyNC4zOTdIMjQuMDY4Wk02Mi4wOTIgMTguODIzSDQ5LjgxN1YyMy4wODZINTYuNzc1QzU2LjU1NSAyNS4yMjIgNTUuNzU1IDI2LjkyNyA1NC4zNzIgMjguMjAyQzUyLjk4OSAyOS40NzYgNTEuMTY2IDMwLjExNSA0OC45MDkgMzAuMTE1QzQ3LjYyMiAzMC4xMTUgNDYuNDUgMjkuODg1IDQ1LjM5MyAyOS40MjNDNDQuMzU4MyAyOC45NzgxIDQzLjQzMjYgMjguMzEzOCA0Mi42OCAyNy40NzZDNDEuOTI3IDI2LjYzOSA0MS4zNDQgMjUuNjMxIDQwLjkzMSAyNC40NTNDNDAuNTE5IDIzLjI3NSA0MC4zMTEgMjEuOTcgNDAuMzExIDIwLjUzN0M0MC4zMTEgMTkuMTA1IDQwLjUxNiAxNy44IDQwLjkzMSAxNi42MjFDNDEuMzQ0IDE1LjQ0MyA0MS45MjcgMTQuNDM2IDQyLjY4IDEzLjU5OEM0My40Mzc2IDEyLjc1NzcgNDQuMzY5NiAxMi4wOTMyIDQ1LjQxMSAxMS42NTFDNDYuNDc4IDExLjE4OSA0Ny42NTYgMTAuOTYgNDguOTQ2IDEwLjk2QzUxLjYxMiAxMC45NiA1My42MzcgMTEuNjAyIDU1LjAyIDEyLjg4NUw1OC4zIDkuNjA0OTlDNTUuODE3IDcuNjY5OTkgNTIuNjc2IDYuNjk5OTkgNDguODcyIDYuNjk5OTlDNDYuNzYgNi42OTk5OSA0NC44NTMgNy4wMzQ5OSA0My4xNTQgNy43MDA5OUM0MS40NTUgOC4zNjc5OSAzOS45OTggOS4zMDM5OSAzOC43ODMgMTAuNTA0QzM3LjU2NyAxMS43MDcgMzYuNjM0IDEzLjE1OCAzNS45NzcgMTQuODU3QzM1LjMxOSAxNi41NTYgMzQuOTk0IDE4LjQ1MSAzNC45OTQgMjAuNTRDMzQuOTk0IDIyLjYzIDM1LjMyOSAyNC40OTQgMzUuOTk1IDI2LjIwNUMzNi42NjIgMjcuOTE2IDM3LjYwNSAyOS4zNzQgMzguODE3IDMwLjU3N0M0MC4wMzIgMzEuNzggNDEuNDg2IDMyLjcxMyA0My4xODggMzMuMzgzQzQ0Ljg4OCAzNC4wNDkgN
1DYuNzgyIDM0LjM4NCA0OC44NzIgMzQuMzg0QzUwLjk2MSAzNC4zODQgNTIuNzUgMzQuMDQ5IDU0LjM5IDMzLjM4M0M1Ni4wMzEgMzIuNzE2IDU3LjQyNiAzMS43OCA1OC41NzkgMzAuNTc3QzU5LjczMyAyOS4zNzQgNjAuNjE5IDI3LjkxNiA2MS4yMzkgMjYuMjA1QzYxLjg2IDI0LjQ5NCA2Mi4xNyAyMi42MDUgNjIuMTcgMjAuNTRDNjIuMTY5NiAxOS45Njg4IDYyLjE0NDUgMTkuMzk4IDYyLjA5NSAxOC44MjlMNjIuMDkyIDE4LjgyM1pNMTUxLjgxIDE2Ljk4MUMxNTMuNDEgMTQuNjA5IDE1Ny40MTkgMTQuMzU4IDE1OS4wMjIgMTQuMzU4VjE4LjkxQzE1Ni45NTcgMTguOTEgMTU0Ljk4NSAxOC45OTYgMTUzLjc1NyAxOS44OTJDMTUyLjUyOSAyMC43OTIgMTUxLjkxOSAyMS45ODIgMTUxLjkxOSAyMy40NjRWMzMuOTlIMTQ2Ljk2NFYxNC4zNThIMTUxLjczNkwxNTEuODEgMTYuOTgxWk0xNDMuMDExIDE0LjM2MVYzNC4wMzFIMTM4LjI0TDEzOC4xMzEgMzEuMDQ1QzEzNy40NjYgMzIuMDc2IDEzNi41NTEgMzIuOTIxOSAxMzUuNDcxIDMzLjUwNEMxMzQuMzc2IDM0LjA5OSAxMzMuMDY4IDM0LjM5NiAxMzEuNTM2IDM0LjM5NkMxMzAuMiAzNC4zOTYgMTI4Ljk2MyAzNC4xNTIgMTI3LjgyMiAzMy42NjhDMTI2LjcgMzMuMTk2NCAxMjUuNjg5IDMyLjQ5NSAxMjQuODU1IDMxLjYwOUMxMjQuMDE4IDMwLjcyMiAxMjMuMzU0IDI5LjY2MiAxMjIuODcxIDI4LjQyMkMxMjIuMzg0IDI3LjE4NSAxMjIuMTQyIDI1LjgxMSAxMjIuMTQyIDI0LjMwNEMxMjIuMTQyIDIyLjc5OCAxMjIuMzg0IDIxLjM3OCAxMjIuODcxIDIwLjExNkMxMjMuMzU3IDE4Ljg1NCAxMjQuMDE4IDE3Ljc3MiAxMjQuODU1IDE2Ljg3M0MxMjUuNjg4IDE1Ljk3NjQgMTI2LjY5OCAxNS4yNjM2IDEyNy44MjIgMTQuNzhDMTI4Ljk2MyAxNC4yODEgMTMwLjIwMyAxNC4wMzMgMTMxLjUzNiAxNC4wMzNDMTMzLjA0MyAxNC4wMzMgMTM0LjMzIDE0LjMxOCAxMzUuMzk3IDE0Ljg4OEMxMzYuNDYyIDE1LjQ1ODkgMTM3LjM3NSAxNi4yNzggMTM4LjA1NyAxNy4yNzZWMTQuMzYxSDE0My4wMTFaTTEzMi42MzEgMzAuMTMzQzEzNC4yNTYgMzAuMTMzIDEzNS41NjcgMjkuNTk0IDEzNi41NjUgMjguNTEyQzEzNy41NjEgMjcuNDMgMTM4LjA2IDI1Ljk5MSAxMzguMDYgMjQuMTk2QzEzOC4wNiAyMi40MDEgMTM3LjU2MSAyMC45OSAxMzYuNTY1IDE5Ljg5OUMxMzUuNTcgMTguODA3IDEzNC4yNTkgMTguMjU4IDEzMi42MzEgMTguMjU4QzEzMS4wMDMgMTguMjU4IDEyOS43MjkgMTguODA0IDEyOC43MzQgMTkuODk5QzEyNy43MzggMjAuOTkzIDEyNy4yMzkgMjIuNDM4IDEyNy4yMzkgMjQuMjMzQzEyNy4yMzkgMjYuMDI4IDEyNy43MzUgMjcuNDMzIDEyOC43MzQgMjguNTE1QzEyOS43MjkgMjkuNTk0IDEzMS4wMjggMzAuMTM2IDEzMi42MzEgMzAuMTM2VjMwLjEzM1pNOTMuNjk4IDI3Ljg3NkM5My41Nzk1IDI4LjAwMjUgOTMuNDU2NCAyOC4xMjQ2IDkzLjMyOSAyOC4yNDJDOTEuOTQ3IDI5LjUxNiA5MC4xMjMgMzAuMTU1IDg3Ljg2NiAzMC4xNTVDODYuNTggMzAuMTU1IDg1LjQwOCAyOS45MjYgODQuMzUgMjkuNDY0QzgzLjMxNTUgMjkuMDE4OSA4Mi4zODk4IDI4LjM1NDYgODEuNjM3IDI3LjUxN0M4MC44ODQgMjYuNjc5IDgwLjMwMSAyNS42NzIgNzkuODg5IDI0LjQ5NEM3OS40NzYgMjMuMzE1IDc5LjI2OSAyMi4wMSA3OS4yNjkgMjAuNTc4Qzc5LjI2OSAxOS4xNDUgNzkuNDczIDE3Ljg0IDc5Ljg4OSAxNi42NjJDODAuMzAxIDE1LjQ4NCA4MC44ODQgMTQuNDc2IDgxLjYzNyAxMy42MzlDODIuMzk0OSAxMi43OTg3IDgzLjMyNzMgMTIuMTM0MiA4NC4zNjkgMTEuNjkyQzg1LjQzNiAxMS4yMyA4Ni42MTQgMTEgODcuOTAzIDExQzkwLjU3IDExIDkyLjU5NSAxMS42NDIgOTMuOTc3IDEyLjkyNkw5Ny4yNTggOS42NDQ5OUM5NC43NzQgNy43MTA5OSA5MS42MzMgNi43Mzk5OSA4Ny44MjkgNi43Mzk5OUM4NS43MTggNi43Mzk5OSA4My44MTEgNy4wNzQ5OSA4Mi4xMTIgNy43NDE5OUM4MC40MTMgOC40MDc5OSA3OC45NTYgOS4zNDQ5OSA3Ny43NCAxMC41NDVDNzYuNTI1IDExLjc0NyA3NS41OTIgMTMuMTk5IDc0LjkzNCAxNC44OThDNzQuMjc3IDE2LjU5NyA3My45NTEgMTguNDkxIDczLjk1MSAyMC41ODFDNzMuOTUxIDIyLjY3IDc0LjI4NiAyNC41MzQgNzQuOTUzIDI2LjI0NUM3NS42MTkgMjcuOTU3IDc2LjU2MiAyOS40MTQgNzcuNzc0IDMwLjYxN0M3OC45OSAzMS44MiA4MC40NDQgMzIuNzUzIDgyLjE0NiAzMy40MjNDODMuODQ1IDM0LjA5IDg1LjczOSAzNC40MjQgODcuODI5IDM0LjQyNEM4OS45MTkgMzQuNDI0IDkxLjcwOCAzNC4wOSA5My4zNDggMzMuNDIzQzk0LjcxOCAzMi44NjUgOTUuOTE4IDMyLjEyMSA5Ni45NDggMzEuMTkxQzk3LjE0OSAzMS4wMDggOTcuMzQ4IDMwLjgxNSA5Ny41MzcgMzAuNjJMOTMuNzAxIDI3Ljg4NUw5My42OTggMjcuODc2Wk0xMTAuODAyIDE0LjAxNUMxMDkuMTk5IDE0LjAxNSAxMDYuODM2IDE0LjQ3MSAxMDUuNjExIDE2LjE1OEwxMDUuNTM3IDYuMDE1OTlIMTAwLjc2NVYzMy45MzlIMTA1LjcyVjIyLjY0MUMxMDUuNzcxIDIxLjQ2MDcgMTA2LjI4OCAyMC4zNDg4IDEwNy4xNTcgMTkuNTQ4OUMxMDguMDI3IDE4Ljc0OTEgMTA5LjE3OCAxOC4zMjY2IDExMC4zNTggMTguMzc0QzExMy4zOTcgMTguMzc0IDExNC4yNjggMjEuMTU5IDExNC4yNjggMjIuNjQxVjMzLjkzOUgxMTkuMjIzVjIxLjA1OUMxMTkuMjIzIDIxLjA1OSAxMTkuMTQyIDE0LjAxNSAxMTAuODAyIDE0LjAxNVpNMTczLjc2MyAxNC4zNThIMTY5Ljk5OVY4LjcxNDk5SDE2NS4wNDhWMTQuMzU4SDE2MS4yODRWMTguOTE2SDE2NS4wNDhWMzQuMDAzSDE2OS45OTlWMTguOTE2SDE3My43NjNWMTQuMzU4Wk0xOTAuNzg3IDI1LjI2MkMxOTAuMTI5IDI0LjUwMTQgMTg5LjMwNyAyMy44OTk0IDE4OC4zODQgMjMuNTAxQzE4Ny40ODggMjMuMTE3IDE4Ni4zMzEgMjIuNzMyIDE4NC45NDggMjIuMzY0QzE4NC4xNjUgMjIuMTQzOSAxODMuMzkgMjEuODk3OCAxODIuNjIzIDIxLjYyNkMxODIuMTYzIDIxLjQ2MjEgMTgxLjc0MSAyMS4yMDY2IDE4MS4zODMgMjAuODc1QzE4MS4yMzUgMjAuNzQyMSAxODEuMTE4IDIwLjU3ODkgMTgxLjAzOSAyMC4zOTY0QzE4MC45NjEgMjAuMjE0IDE4MC45MjIgMjAuMDE2NiAxODAuOTI3IDE5LjgxOEMxODAuOTI3IDE5LjI3MiAxODEuMTU2IDE4Ljg0NCAxODEuNjI1IDE4LjUxQzE4Mi4xMjEgMTguMTU2IDE4Mi44NjIgMTcuOTc2IDE4My44MjYgMTcuOTc2QzE4NC43OSAxNy45NzYgMTg1LjU4NyAxOC4yMDkgMTg2LjE0OCAxOC42NjhDMTg2LjcwNiAxOS4xMjQgMTg3LjAwNyAxOS43MjUgMTg3LjA3MiAyMC41TDE4Ny4wOTQgMjAuNzgySDE5MS42MzNMMTkxLjYxNyAyMC40NkMxOTEuNTIxIDE4LjQ4NSAxOTAuNzcxIDE2LjkgMTg5LjM4NSAxNS43NUMxODguMDEyIDE0LjYxMiAxODYuMTg1IDE0LjAzMyAxODMuOTYyIDE0LjAzM0MxODIuNDc3IDE0LjAzMyAxODEuMTQxIDE0LjI4NyAxNzkuOTk0IDE0Ljc4NkMxNzguODMxIDE1LjI5MSAxNzcuOTI2IDE1Ljk5NSAxNzcuMjk2IDE2Ljg4MkMxNzYuNjczIDE3Ljc0NTUgMTc2LjMzOCAxOC43ODQgMTc2LjM0MSAxOS44NDlDMTc2LjM0MSAyMS4xNjcgMTc2LjY5OCAyMi4yNDkgMTc3LjM5OSAyMy4wNjRDMTc4LjA2IDIzLjg0MzIgMTc4Ljg5OCAyNC40NTM0IDE3OS44NDIgMjQuODQ0QzE4MC43NDQgMjUuMjE2IDE4MS45MjggMjUuNjA3IDE4My4zNjEgMjZDMTg0LjgwNiAyNi40MSAxODUuODcyIDI2Ljc4NSAxODYuNTMgMjcuMTIzQzE4Ny4xIDI3LjQxNCAxODcuMzc5IDI3Ljg0NSAxODcuMzc5IDI4LjQ0NEMxODcuMzc5IDI5LjA0MiAxODcuMTIyIDI5LjQ2NyAxODYuNTk1IDI5LjgzOUMxODYuMDQzIDMwLjIyNiAxODUuMjM3IDMwLjQyNSAxODQuMjAxIDMwLjQyNUMxODMuMTY2IDMwLjQyNSAxODIuMzk0IDMwLjE3NCAxODEuNzQ5IDI5LjY3NEMxODEuMTEzIDI5LjE4MSAxODAuNzcyIDI4LjU4OSAxODAuNzEgMjcuODY0TDE4MC42ODUgMjcuNTgySDE3Ni4wMTNMMTc2LjAyNSAyNy45MDFDMTc2LjA2NyAyOS4wOTU1IDE3Ni40NzIgMzAuMjQ4NyAxNzcuMTg4IDMxLjIwNkMxNzcuOTA3IDMyLjE4IDE3OC44OTMgMzIuOTU4IDE4MC4xMTggMzMuNTE5QzE4MS4zMzYgMzQuMDc3IDE4Mi43MzIgMzQuMzYyIDE4NC4yNjYgMzQuMzYyQzE4NS44MDEgMzQuMzYyIDE4Ny4xMDkgMzQuMTA4IDE4OC4yMzggMzMuNjA5QzE4OS4zNzYgMzMuMTA0IDE5MC4yNzIgMzIuMzk0IDE5MC45MDEgMzEuNDk0QzE5MS41MzQgMzAuNTkyIDE5MS44NTMgMjkuNTU0IDE5MS44NTMgMjguNDAzQzE5MS44MjggMjcuMTEgMTkxLjQ2NiAyNi4wNTMgMTkwLjc3NyAyNS4yNjJIMTkwLjc4N1oiIGZpbGw9IiM5QjlCOUIiLz4KPHBhdGggZD0iTTI0MS45ODIgMjUuNjU4MlYxNy43MTE3SDIyOC40NDFMMjIwLjQ5NCAyNS42NTgySDI0MS45ODJaIiBmaWxsPSIjOUI5QjlCIi8+CjxwYXRoIGQ9Ik0yNTcuMjM5IDUuOTUwODFIMjQwLjI2NUwyMzIuMjU1IDEzLjg5NzNIMjU3LjIzOVY1Ljk1MDgxWiIgZmlsbD0iIzlCOUI5QiIvPgo8cGF0aCBkPSJNMjEyLjYxMSAzMy42MDQ4TDIxNi42OCAyOS41MzYxSDIzMC40MTJWMzcuNDgyN0gyMTIuNjExVjMzLjYwNDhaIiBmaWxsPSIjOUI5QjlCIi8+CjxwYXRoIGQ9Ik0yMTUuNTk5IDIxLjc4MDNIMjI0LjM3MkwyMzIuMzgyIDEzLjgzMzdIMjE1LjU5OVYyMS43ODAzWiIgZmlsbD0iIzlCOUI5QiIvPgo8cGF0aCBkPSJNMjA2IDMzLjYwNDdIMjEyLjYxMUwyMjAuNDk0IDI1LjY1ODJIMjA2VjMzLjYwNDdaIiBmaWxsPSIjOUI5QjlCIi8+CjxwYXRoIGQ9Ik0yNDAuMjY1IDUuOTUwODFMMjM2LjE5NyAxMC4wMTk0SDIxMC4yNTlWMi4wNzI4OEgyNDAuMjY1VjUuOTUwODFaIiBmaWxsPSIjOUI5QjlCIi8+Cjwvc3ZnPgo=",width:170,height:25,right:25,bottom:50,opacity:.7}}}getHostname(){const t=this.document?.defaultView;if(!t)return;const i=e.readHostname(t);if(""!==i)return i;try{return null!=t.top&&t.top!==t?e.readHostname(t.top):""}catch{return}}static readHostname(e){try{return e.location?.hostname??""}catch{return}}isForceWatermark(){if(!this.document)return!1;const e=this.document?.defaultView??null!=globalThis.window?globalThis:void 0;if(!e)return!1;const t=e.location?.pathname;return!!t&&t.includes("forceWatermark")}isWebsiteUrl(){const e=this.getHostname()??"";return null!==/^((?:[\w-]+\.)?ag-grid\.com)$/.exec(e)||null!==/^((?:[\w-]+\.)?bryntum\.com)$/.exec(e)}isLocalhost(){const e=this.getHostname()??"";return null!==/^(?:127\.0\.0\.1|localhost)$/.exec(e)}static formatDate(e){const t=e.getDate(),i=e.getMonth(),n=e.getFullYear();return t+" "+["January","February","March","April","May","June","July","August","September","October","November","December"][i]+" "+n}static getChartsReleaseDate(){return new Date(Number.parseInt(e.decode(e.RELEASE_INFORMATION),10))}static decode(t){const i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789
1+/=";let n,s,a,o,r,l,h,c="",d=0;const u=t.replaceAll(/[^A-Za-z0-9+/=]/g,"");for(;d<u.length;)o=i.indexOf(u.charAt(d++)),r=i.indexOf(u.charAt(d++)),l=i.indexOf(u.charAt(d++)),h=i.indexOf(u.charAt(d++)),n=o<<2|r>>4,s=(15&r)<<4|l>>2,a=(3&l)<<6|h,c+=String.fromCodePoint(n),64!=l&&(c+=String.fromCodePoint(s)),64!=h&&(c+=String.fromCodePoint(a));return c=e.utf8_decode(c),c}static utf8_decode(e){e=e.replaceAll("rn","n");let t="";for(let i=0;i<e.length;i++){const n=e.codePointAt(i);n<128?t+=String.fromCodePoint(n):n>127&&n<2048?(t+=String.fromCodePoint(n>>6|192),t+=String.fromCodePoint(63&n|128)):(t+=String.fromCodePoint(n>>12|224),t+=String.fromCodePoint(n>>6&63|128),t+=String.fromCodePoint(63&n|128))}return t}static setGridContext(t=!1){e.gridContext=t}static setLicenseKey(t){const i=function(e){if(null!=e)return"string"==typeof e?e:String(e)}(t);this.licenseKey&&this.licenseKey!==i&&a.warn("License Key being set multiple times with different values. This can result in an incorrect license key being used."),this.licenseKey!==i&&(e.licenseOutputLogged=!1),e.licenseKeySupplied=!0,e.licenseKey=i}static extractBracketedInformation(e){if(!e.includes("["))return["legacy",!1,void 0];const t=e.match(/\[(.*?)\]/g).map((e=>e.replace("[","").replace("]","")));if(!t||0===t.length)return["legacy",!1,void 0];const i=1===t.filter((e=>"TRIAL"===e)).length,n=t.find((e=>e.startsWith("v")));return[n?n.replace("v",""):"legacy",i,S[t.find((e=>S[e]))]]}centerPadAndOutput(t){if(e.licenseOutputLogged)return;const i=this.totalMessageLength-t.length;a.error(t.padStart(i/2+t.length,"*").padEnd(this.totalMessageLength,"*"))}padAndOutput(t,i="*",n=""){e.licenseOutputLogged||a.error(t.padEnd(this.totalMessageLength-n.length,i)+n)}outputInvalidLicenseKey(t,i,n){e.gridContext||(t?(this.centerPadAndOutput(""),this.centerPadAndOutput(` ${i} License `),this.centerPadAndOutput(" Incompatible License Key "),this.padAndOutput(`* Your license key is for ${n} only and does not cover you for ${i}.`," ","*"),this.padAndOutput(`* To troubleshoot your license key visit ${M}.`," ","*"),this.centerPadAndOutput(""),this.centerPadAndOutput("")):(this.centerPadAndOutput(""),this.centerPadAndOutput(` ${i} License `),this.centerPadAndOutput(" Invalid License Key "),this.padAndOutput("* Your license key is not valid."," ","*"),this.padAndOutput(`* To troubleshoot your license key visit ${M}.`," ","*"),this.centerPadAndOutput(""),this.centerPadAndOutput(""))),this.watermarkMessage="Invalid License"}outputExpiredTrialKey(t,i,n){e.gridContext||(this.centerPadAndOutput(""),this.centerPadAndOutput(` ${i} License `),this.centerPadAndOutput(" Trial Period Expired. "),this.padAndOutput(`* Your trial only license for ${n} expired on ${t}.`," ","*"),this.padAndOutput("* Please email [email protected] to purchase a license."," ","*"),this.centerPadAndOutput(""),this.centerPadAndOutput("")),this.watermarkMessage="Trial Period Expired"}outputMissingLicenseKey(t){e.gridContext||(this.centerPadAndOutput(""),this.centerPadAndOutput(` ${t} License `),this.centerPadAndOutput(" License Key Not Found "),this.padAndOutput(`* All ${t} features are unlocked for trial.`," ","*"),this.padAndOutput("* If you want to hide the watermark please email [email protected] for a trial license key."," ","*"),this.centerPadAndOutput(""),this.centerPadAndOutput("")),this.watermarkMessage="For Trial Use Only"}outputExpiredKey(t,i,n){e.gridContext||(this.centerPadAndOutput(""),this.centerPadAndOutput(` ${n} License `),this.centerPadAndOutput(" Incompatible Software Version "),this.padAndOutput(`* Your license key works with versions of ${n} released before ${t}.`," ","*"),this.padAndOutput(`* The version you are trying to use was released on ${i}.`," ","*"),this.padAndOutput("* Please contact [email protected] to renew your license key."," ","*"),this.centerPadAndOutput(""),this.centerPadAndOutput("")),this.watermarkMessage="License Expired"}};return e.RELEASE_INFORMATION="MTc4OTU0MjEzNTg4NQ==",e.licenseKeySupplied=!1,e.gridContext=!1,e.licenseOutputLogged=!1,e})();function D(e,t){const i=e.addChild("canvas-overlay","watermark"),s=(0,n.na4)("span");s.innerText=t,i.addEventListener("animationend",(()=>{e.removeChild("canvas-overlay","watermark"),e.removeStyles("watermark")})),i.classList.add("ag-watermark"),i.appendChild(s)}var w
vendor: 8,496 bytes, line 1
1='.ag-watermark{position:absolute;bottom:20px;right:25px;font-weight:700;font-family:Impact,sans-serif;font-size:19px;opacity:.7;animation:1s ease-out 3s ag-watermark-fadeout;color:#9b9b9b;pointer-events:none;&:before{content:"";display:block;height:40px;width:170px;background-image:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjU4IiBoZWlnaHQ9IjQwIiB2aWV3Qm94PSIwIDAgMjU4IDQwIiBmaWxsPSJub25lIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgo8cGF0aCBkPSJNMjUuNzc5IDI4LjY1N0gxMy4zNTlMMTEuMTczIDM0LjAxMkg1LjY3Mjk3TDE3LjE4MiA3LjA1OTk5SDIxLjk1M0wzMy40NjIgMzQuMDEySDI3Ljk2MkwyNS43NzYgMjguNjU3SDI1Ljc3OVpNMjQuMDY4IDI0LjM5N0wxOS41ODggMTMuNDM0TDE1LjEwNyAyNC4zOTdIMjQuMDY4Wk02Mi4wOTIgMTguODIzSDQ5LjgxN1YyMy4wODZINTYuNzc1QzU2LjU1NSAyNS4yMjIgNTUuNzU1IDI2LjkyNyA1NC4zNzIgMjguMjAyQzUyLjk4OSAyOS40NzYgNTEuMTY2IDMwLjExNSA0OC45MDkgMzAuMTE1QzQ3LjYyMiAzMC4xMTUgNDYuNDUgMjkuODg1IDQ1LjM5MyAyOS40MjNDNDQuMzU4MyAyOC45NzgxIDQzLjQzMjYgMjguMzEzOCA0Mi42OCAyNy40NzZDNDEuOTI3IDI2LjYzOSA0MS4zNDQgMjUuNjMxIDQwLjkzMSAyNC40NTNDNDAuNTE5IDIzLjI3NSA0MC4zMTEgMjEuOTcgNDAuMzExIDIwLjUzN0M0MC4zMTEgMTkuMTA1IDQwLjUxNiAxNy44IDQwLjkzMSAxNi42MjFDNDEuMzQ0IDE1LjQ0MyA0MS45MjcgMTQuNDM2IDQyLjY4IDEzLjU5OEM0My40Mzc2IDEyLjc1NzcgNDQuMzY5NiAxMi4wOTMyIDQ1LjQxMSAxMS42NTFDNDYuNDc4IDExLjE4OSA0Ny42NTYgMTAuOTYgNDguOTQ2IDEwLjk2QzUxLjYxMiAxMC45NiA1My42MzcgMTEuNjAyIDU1LjAyIDEyLjg4NUw1OC4zIDkuNjA0OTlDNTUuODE3IDcuNjY5OTkgNTIuNjc2IDYuNjk5OTkgNDguODcyIDYuNjk5OTlDNDYuNzYgNi42OTk5OSA0NC44NTMgNy4wMzQ5OSA0My4xNTQgNy43MDA5OUM0MS40NTUgOC4zNjc5OSAzOS45OTggOS4zMDM5OSAzOC43ODMgMTAuNTA0QzM3LjU2NyAxMS43MDcgMzYuNjM0IDEzLjE1OCAzNS45NzcgMTQuODU3QzM1LjMxOSAxNi41NTYgMzQuOTk0IDE4LjQ1MSAzNC45OTQgMjAuNTRDMzQuOTk0IDIyLjYzIDM1LjMyOSAyNC40OTQgMzUuOTk1IDI2LjIwNUMzNi42NjIgMjcuOTE2IDM3LjYwNSAyOS4zNzQgMzguODE3IDMwLjU3N0M0MC4wMzIgMzEuNzggNDEuNDg2IDMyLjcxMyA0My4xODggMzMuMzgzQzQ0Ljg4OCAzNC4wNDkgNDYuNzgyIDM0LjM4NCA0OC44NzIgMzQuMzg0QzUwLjk2MSAzNC4zODQgNTIuNzUgMzQuMDQ5IDU0LjM5IDMzLjM4M0M1Ni4wMzEgMzIuNzE2IDU3LjQyNiAzMS43OCA1OC41NzkgMzAuNTc3QzU5LjczMyAyOS4zNzQgNjAuNjE5IDI3LjkxNiA2MS4yMzkgMjYuMjA1QzYxLjg2IDI0LjQ5NCA2Mi4xNyAyMi42MDUgNjIuMTcgMjAuNTRDNjIuMTY5NiAxOS45Njg4IDYyLjE0NDUgMTkuMzk4IDYyLjA5NSAxOC44MjlMNjIuMDkyIDE4LjgyM1pNMTUxLjgxIDE2Ljk4MUMxNTMuNDEgMTQuNjA5IDE1Ny40MTkgMTQuMzU4IDE1OS4wMjIgMTQuMzU4VjE4LjkxQzE1Ni45NTcgMTguOTEgMTU0Ljk4NSAxOC45OTYgMTUzLjc1NyAxOS44OTJDMTUyLjUyOSAyMC43OTIgMTUxLjkxOSAyMS45ODIgMTUxLjkxOSAyMy40NjRWMzMuOTlIMTQ2Ljk2NFYxNC4zNThIMTUxLjczNkwxNTEuODEgMTYuOTgxWk0xNDMuMDExIDE0LjM2MVYzNC4wMzFIMTM4LjI0TDEzOC4xMzEgMzEuMDQ1QzEzNy40NjYgMzIuMDc2IDEzNi41NTEgMzIuOTIxOSAxMzUuNDcxIDMzLjUwNEMxMzQuMzc2IDM0LjA5OSAxMzMuMDY4IDM0LjM5NiAxMzEuNTM2IDM0LjM5NkMxMzAuMiAzNC4zOTYgMTI4Ljk2MyAzNC4xNTIgMTI3LjgyMiAzMy42NjhDMTI2LjcgMzMuMTk2NCAxMjUuNjg5IDMyLjQ5NSAxMjQuODU1IDMxLjYwOUMxMjQuMDE4IDMwLjcyMiAxMjMuMzU0IDI5LjY2MiAxMjIuODcxIDI4LjQyMkMxMjIuMzg0IDI3LjE4NSAxMjIuMTQyIDI1LjgxMSAxMjIuMTQyIDI0LjMwNEMxMjIuMTQyIDIyLjc5OCAxMjIuMzg0IDIxLjM3OCAxMjIuODcxIDIwLjExNkMxMjMuMzU3IDE4Ljg1NCAxMjQuMDE4IDE3Ljc3MiAxMjQuODU1IDE2Ljg3M0MxMjUuNjg4IDE1Ljk3NjQgMTI2LjY5OCAxNS4yNjM2IDEyNy44MjIgMTQuNzhDMTI4Ljk2MyAxNC4yODEgMTMwLjIwMyAxNC4wMzMgMTMxLjUzNiAxNC4wMzNDMTMzLjA0MyAxNC4wMzMgMTM0LjMzIDE0LjMxOCAxMzUuMzk3IDE0Ljg4OEMxMzYuNDYyIDE1LjQ1ODkgMTM3LjM3NSAxNi4yNzggMTM4LjA1NyAxNy4yNzZWMTQuMzYxSDE0My4wMTFaTTEzMi42MzEgMzAuMTMzQzEzNC4yNTYgMzAuMTMzIDEzNS41NjcgMjkuNTk0IDEzNi41NjUgMjguNTEyQzEzNy41NjEgMjcuNDMgMTM4LjA2IDI1Ljk5MSAxMzguMDYgMjQuMTk2QzEzOC4wNiAyMi40MDEgMTM3LjU2MSAyMC45OSAxMzYuNTY1IDE5Ljg5OUMxMzUuNTcgMTguODA3IDEzNC4yNTkgMTguMjU4IDEzMi42MzEgMTguMjU4QzEzMS4wMDMgMTguMjU4IDEyOS43MjkgMTguODA0IDEyOC43MzQgMTkuODk5QzEyNy43MzggMjAuOTkzIDEyNy4yMzkgMjIuNDM4IDEyNy4yMzkgMjQuMjMzQzEyNy4yMzkgMjYuMDI4IDEyNy43MzUgMjcuNDMzIDEyOC43MzQgMjguNTE1QzEyOS43MjkgMjkuNTk0IDEzMS4wMjggMzAuMTM2IDEzMi42MzEgMzAuMTM2VjMwLjEzM1pNOTMuNjk4IDI3Ljg3NkM5My41Nzk1IDI4LjAwMjUgOTMuNDU2NCAyOC4xMjQ2IDkzLjMyOSAyOC4yNDJDOTEuOTQ3IDI5LjUxNiA5MC4xMjMgMzAuMTU1IDg3Ljg2NiAzMC4xNTVDODYuNTggMzAuMTU1IDg1LjQwOCAyOS45MjYgODQuMzUgMjkuNDY0QzgzLjMxNTUgMjkuMDE4OSA4Mi4zODk4IDI4LjM1NDYgODEuNjM3IDI3LjUxN0M4MC44ODQgMjYuNjc5IDgwLjMwMSAyNS42NzIgNzkuODg5IDI0LjQ5NEM3OS40NzYgMjMuMzE1IDc5LjI2OSAyMi4wMSA3OS4yNjkgMjAuNTc4Qzc5LjI2OSAxOS4xNDUgNzkuNDczIDE3Ljg0IDc5Ljg4OSAxNi42NjJDODAuMzAxIDE1LjQ4NCA4MC44ODQgMTQuNDc2IDgxLjYzNyAxMy42MzlDODIuMzk0OSAxMi43OTg3IDgzLjMyNzMgMTIuMTM0MiA4NC4zNjkgMTEuNjkyQzg1LjQzNiAxMS4yMyA4Ni42MTQgMTEgODcuOTAzIDExQzkwLjU3IDExIDkyLjU5NSAxMS42NDIgOTMuOTc3IDEyLjkyNkw5Ny4yNTggOS42NDQ5OUM5NC43NzQgNy43MTA5OSA5MS42MzMgNi43Mzk5OSA4Ny44MjkgNi43Mzk5OUM4NS43MTggNi43Mzk5OSA4My44MTEgNy4wNzQ5OSA4Mi4xMTIgNy43NDE5OUM4MC40MTMgOC40MDc5OSA3OC45NTYgOS4zNDQ5OSA3Ny43NCAxMC41NDVDNzYuNTI1IDExLjc0NyA3NS41OTIgMTMuMTk5IDc0LjkzNCAxNC44OThDNzQuMjc3IDE2LjU5NyA3My45NTEgMTguNDkxIDczLjk1MSAyMC41ODFDNzMuOTUxIDIyLjY3IDc0LjI4NiAyNC41MzQgNzQuOTUzIDI2LjI0NUM3NS42MTkgMjcuOTU3IDc2LjU2MiAyOS40MTQgNzcuNzc0IDMwLjYxN0M3OC45OSAzMS44MiA4MC40NDQgMzIuNzUzIDgyLjE0NiAzMy40MjNDODMuODQ1IDM0LjA5IDg1LjczOSAzNC40MjQgODcuODI5IDM0LjQyNEM4OS45MTkgMzQuNDI0IDkxLjcwOCAzNC4wOSA5My4zNDggMzMuNDIzQzk0LjcxOCAzMi44NjUgOTUuOTE4IDMyLjEyMSA5Ni45NDggMzEuMTkxQzk3LjE0OSAzMS4wMDggOTcuMzQ4IDMwLjgxNSA5Ny41MzcgMzAuNjJMOTMuNzAxIDI3Ljg4NUw5My42OTggMjcuODc2Wk0xMTAuODAyIDE0LjAxNUMxMDkuMTk5IDE0LjAxNSAxMDYuODM2IDE0LjQ3MSAxMDUuNjExIDE2LjE1OEwxMDUuNTM3IDYuMDE1OTlIMTAwLjc2NVYzMy45MzlIMTA1LjcyVjIyLjY0MUMxMDUuNzcxIDIxLjQ2MDcgMTA2LjI4OCAyMC4zNDg4IDEwNy4xNTcgMTkuNTQ4OUMxMDguMDI3IDE4Ljc0OTEgMTA5LjE3OCAxOC4zMjY2IDExMC4zNTggMTguMzc0QzExMy4zOTcgMTguMzc0IDExNC4yNjggMjEuMTU5IDExNC4yNjggMjIuNjQxVjMzLjkzOUgxMTkuMjIzVjIxLjA1OUMxMTkuMjIzIDIxLjA1OSAxMTkuMTQyIDE0LjAxNSAxMTAuODAyIDE0LjAxNVpNMTczLjc2MyAxNC4zNThIMTY5Ljk5OVY4LjcxNDk5SDE2NS4wNDhWMTQuMzU4SDE2MS4yODRWMTguOTE2SDE2NS4wNDhWMzQuMDAzSDE2OS45OTlWMTguOTE2SDE3My43NjNWMTQuMzU4Wk0xOTAuNzg3IDI1LjI2MkMxOTAuMTI5IDI0LjUwMTQgMTg5LjMwNyAyMy44OTk0IDE4OC4zODQgMjMuNTAxQzE4Ny40ODggMjMuMTE3IDE4Ni4zMzEgMjIuNzMyIDE4NC45NDggMjIuMzY0QzE4NC4xNjUgMjIuMTQzOSAxODMuMzkgMjEuODk3OCAxODIuNjIzIDIxLjYyNkMxODIuMTYzIDIxLjQ2MjEgMTgxLjc0MSAyMS4yMDY2IDE4MS4zODMgMjAuODc1QzE4MS4yMzUgMjAuNzQyMSAxODEuMTE4IDIwLjU3ODkgMTgxLjAzOSAyMC4zOTY0QzE4MC45NjEgMjAuMjE0IDE4MC45MjIgMjAuMDE2NiAxODAuOTI3IDE5LjgxOEMxODAuOTI3IDE5LjI3MiAxODEuMTU2IDE4Ljg0NCAxODEuNjI1IDE4LjUxQzE4Mi4xMjEgMTguMTU2IDE4Mi44NjIgMTcuOTc2IDE4My44MjYgMTcuOTc2QzE4NC43OSAxNy45NzYgMTg1LjU4NyAxOC4yMDkgMTg2LjE0OCAxOC42NjhDMTg2LjcwNiAxOS4xMjQgMTg3LjAwNyAxOS43MjUgMTg3LjA3MiAyMC41TDE4Ny4wOTQgMjAuNzgySDE5MS42MzNMMTkxLjYxNyAyMC40NkMxOTEuNTIxIDE4LjQ4NSAxOTAuNzcxIDE2LjkgMTg5LjM4NSAxNS43NUMxODguMDEyIDE0LjYxMiAxODYuMTg1IDE0LjAzMyAxODMuOTYyIDE0LjAzM0MxODIuNDc3IDE0LjAzMyAxODEuMTQxIDE0LjI4NyAxNzkuOTk0IDE0Ljc4NkMxNzguODMxIDE1LjI5MSAxNzcuOTI2IDE1Ljk5NSAxNzcuMjk2IDE2Ljg4MkMxNzYuNjczIDE3Ljc0NTUgMTc2LjMzOCAxOC43ODQgMTc2LjM0MSAxOS44NDlDMTc2LjM0MSAyMS4xNjcgMTc2LjY5OCAyMi4yNDkgMTc3LjM5OSAyMy4wNjRDMTc4LjA2IDIzLjg0MzIgMTc4Ljg5OCAyNC40NTM0IDE3OS44NDIgMjQuODQ0QzE4MC43NDQgMjUuMjE2IDE4MS45MjggMjUuNjA3IDE4My4zNjEgMjZDMTg0LjgwNiAyNi40MSAxODUuODcyIDI2Ljc4NSAxODYuNTMgMjcuMTIzQzE4Ny4xIDI3LjQxNCAxODcuMzc5IDI3Ljg0NSAxODcuMzc5IDI4LjQ0NEMxODcuMzc5IDI5LjA0MiAxODcuMTIyIDI5LjQ2NyAxODYuNTk1IDI5LjgzOUMxODYuMDQzIDMwLjIyNiAxODUuMjM3IDMwLjQyNSAxODQuMjAxIDMwLjQyNUMxODMuMTY2IDMwLjQyNSAxODIuMzk0IDMwLjE3NCAxODEuNzQ5IDI5LjY3NEMxODEuMTEzIDI5LjE4MSAxODAuNzcyIDI4LjU4OSAxODAuNzEgMjcuODY0TDE4MC42ODUgMjcuNTgySDE3Ni4wMTNMMTc2LjAyNSAyNy45MDFDMTc2LjA2NyAyOS4wOTU1IDE3Ni40NzIgMzAuMjQ4NyAxNzcuMTg4IDMxLjIwNkMxNzcuOTA3IDMyLjE4IDE3OC44OTMgMzIuOTU4IDE4MC4xMTggMzMuNTE5QzE4MS4zMzYgMzQuMDc3IDE4Mi43MzIgMzQuMzYyIDE4NC4yNjYgMzQuMzYyQzE4NS44MDEgMzQuMzYyIDE4Ny4xMDkgMzQuMTA4IDE4OC4yMzggMzMuNjA5QzE4OS4zNzYgMzMuMTA0IDE5MC4yNzIgMzIuMzk0IDE5MC45MDEgMzEuNDk0QzE5MS41MzQgMzAuNTkyIDE5MS44NTMgMjkuNTU0IDE5MS44NTMgMjguNDAzQzE5MS44MjggMjcuMTEgMTkxLjQ2NiAyNi4wNTMgMTkwLjc3NyAyNS4yNjJIMTkwLjc4N1oiIGZpbGw9IiM5QjlCOUIiLz4KPHBhdGggZD0iTTI0MS45ODIgMjUuNjU4MlYxNy43MTE3SDIyOC40NDFMMjIwLjQ5NCAyNS42NTgySDI0MS45ODJaIiBmaWxsPSIjOUI5QjlCIi8+CjxwYXRoIGQ9Ik0yNTcuMjM5IDUuOTUwODFIMjQwLjI2NUwyMzIuMjU1IDEzLjg5NzNIMjU3LjIzOVY1Ljk1MDgxWiIgZmlsbD0iIzlCOUI5QiIvPgo8cGF0aCBkPSJNMjEyLjYxMSAzMy42MDQ4TDIxNi42OCAyOS41MzYxSDIzMC40MTJWMzcuNDgyN0gyMTIuNjExVjMzLjYwNDhaIiBmaWxsPSIjOUI5QjlCIi8+CjxwYXRoIGQ9Ik0yMTUuNTk5IDIxLjc4MDNIMjI0LjM3MkwyMzIuMzgyIDEzLjgzMzdIMjE1LjU5OVYyMS43ODAzWiIgZmlsbD0iIzlCOUI5QiIvPgo8cGF0aCBkPSJNMjA2IDMzLjYwNDdIMjEyLjYxMUwyMjAuNDk0IDI1LjY1ODJIMjA2VjMzLjYwNDdaIiBmaWxsPSIjOUI5QjlCIi8+CjxwYXRoIGQ9Ik0yNDAuMjY1IDUuOTUwODFMMjM2LjE5NyAxMC4wMTk0SDIxMC4yNTlWMi4wNzI4OEgyNDAuMjY1VjUuOTUwODFaIiBmaWxsPSIjOUI5QjlCIi8+Cjwvc3ZnPgo=);background-repeat:no-repeat;background-size:170px 40px}>span{padding-left:.7rem}}@keyframes ag-watermark-fadeout{0%{opacity:.5}to{opacity:0}}.ag-charts-
1dialog{display:flex;flex-direction:column;font-size:var(--ag-charts-chrome-font-size-large)}.ag-charts-dialog__tabs{display:flex;flex-direction:column}.ag-charts-dialog__header{border-bottom:1px solid var(--ag-charts-border-color);display:flex}.ag-charts-dialog__tab-list{display:flex;gap:calc(var(--ag-charts-spacing) * 2)}.ag-charts-dialog__drag-handle{align-items:center;color:inherit;cursor:grab;display:flex;padding:1px 6px;text-align:center}.ag-charts-dialog__drag-handle--dragging{cursor:grabbing}.ag-charts-dialog__tab-button{background:none;border:0;border-bottom:2px solid transparent;border-radius:0;color:var(--ag-charts-panel-subtle-text-color);margin-bottom:-1px;padding:var(--input-padding) calc(var(--input-padding) / 2)}.ag-charts-dialog__tab-button:hover{background:none}.ag-charts-dialog__tab-button--active{border-color:var(--ag-charts-accent-color);color:inherit}.ag-charts-dialog__drag-handle+.ag-charts-dialog__tab-button{margin-inline-start:calc(var(--ag-charts-spacing) * -2)}.ag-charts-button.ag-charts-dialog__close-button{background:none;border:0;margin-inline-start:auto;padding:1px 6px}.ag-charts-dialog__close-button:focus-visible{outline:var(--ag-charts-focus-border);box-shadow:var(--ag-charts-focus-border-shadow);z-index:calc(var(--ag-charts-layer-ui-overlay) + 1)}.ag-charts-dialog__tab-panel{display:none;flex-direction:column;gap:calc(var(--ag-charts-spacing) * 4);margin:0 calc(var(--ag-charts-spacing) * 4);padding:calc(var(--ag-charts-spacing) * 4) 0}.ag-charts-dialog__tab-panel--active{display:flex}.ag-charts-dialog__input-group-line{display:flex;gap:16px 18px;flex-wrap:wrap}.ag-charts-dialog__input-group{align-items:center;display:flex;font-size:var(--ag-charts-chrome-font-size)}.ag-charts-dialog__input-group-label{color:var(--ag-charts-panel-subtle-text-color);margin-inline-end:5px}.ag-charts-dialog__input-group-label[for]{cursor:pointer}.ag-charts-dialog__button{border-radius:0;margin-inline-end:-1px}.ag-charts-dialog__button.ag-charts-dialog__button--active{background:var(--ag-charts-button-focus-background-color);border-color:var(--ag-charts-input-focus-border-color);color:var(--ag-charts-input-focus-text-color);z-index:var(--input-layer-active)}.ag-charts-dialog__button:first-child,.ag-charts-dialog__input-group-label+.ag-charts-dialog__button{border-start-start-radius:var(--ag-charts-input-border-radius);border-end-start-radius:var(--ag-charts-input-border-radius)}.ag-charts-dialog__button:last-child{border-start-end-radius:var(--ag-charts-input-border-radius);border-end-end-radius:var(--ag-charts-input-border-radius)}.ag-charts-dialog__color-picker-button{--color: #000;background:var(--color);border:none;color:transparent;height:26px;width:26px}.ag-charts-dialog__color-picker-button:hover{background:var(--color)}.ag-charts-dialog__color-picker-button--multi-color,.ag-charts-dialog__color-picker-button--multi-color:hover{background:linear-gradient(135deg,red 0%,#ff0 calc(100% * 1 / 6),#0f0 calc(100% * 2 / 6),#0ff 50%,#00f calc(100% * 4 / 6),#f0f calc(100% * 5 / 6),red 100%)}.ag-charts-color-picker{width:190px;padding:8px;direction:ltr;cursor:default;--h: 0;--s: 0;--v: 0;--a: 0;--color: #000;--color-a: #000;--thumb-size: 18px;--inner-width: 172px;--track-height: 12px;--palette-height: 136px;--checker: url(\'data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="4" height="4"><rect x="0" y="0" width="4" height="4" fill="%23fff"/><path d="M0 0H2V4H4V2H0Z" fill="%23b2b2b2"/></svg>\
vendor: 19,924 bytes, line 1
1');--multi-color: linear-gradient( 135deg, #f00 0% , #ff0 calc(100% * 1 / 6), #0f0 calc(100% * 2 / 6), #0ff 50% , #00f calc(100% * 4 / 6), #f0f calc(100% * 5 / 6), #f00 100% )}.ag-charts-color-picker__content{display:flex;flex-direction:column}.ag-charts-color-picker__palette{position:relative;width:100%;height:var(--palette-height);margin-bottom:8px;background:linear-gradient(to bottom,#0000,#000),linear-gradient(to right,#fff,#fff0) hsl(var(--h),100%,50%);border-radius:calc(var(--ag-charts-border-radius) * 1.5);box-shadow:inset 0 0 0 1px #0003}.ag-charts-color-picker__palette:after{content:"";position:absolute;display:block;top:calc(var(--thumb-size) * -.5 + (1 - var(--v)) * 100%);left:calc(var(--thumb-size) * -.5 + var(--s) * 100%);background:var(--color);width:var(--thumb-size);height:var(--thumb-size);border-radius:calc(var(--ag-charts-border-radius) * 99);box-shadow:var(--box-shadow);--box-shadow: inset 0 0 0 3px white, inset 0 0 1px 3px #0006, 0 0 5px #00000038}.ag-charts-color-picker__palette:focus-visible:after{outline:var(--ag-charts-focus-border);box-shadow:var(--box-shadow),0 0 0 2px #fff8,var(--ag-charts-focus-border-shadow)}.ag-charts-color-picker__color-row{display:flex;gap:8px;align-items:center;margin-bottom:4px;--inset: calc((var(--thumb-size) - var(--track-height)) / 2)}.ag-charts-color-picker__hue-input,.ag-charts-color-picker__alpha-input{-webkit-appearance:none;display:block;position:relative;padding:0;margin:0 calc(var(--inset) * -1);border:0;height:var(--thumb-size);width:auto;background:transparent;--inset: calc((var(--thumb-size) - var(--track-height)) / 2)}.ag-charts-color-picker__hue-input::-moz-range-thumb,.ag-charts-color-picker__alpha-input::-moz-range-thumb{appearance:none;width:var(--thumb-size);height:var(--thumb-size);border-radius:calc(var(--ag-charts-border-radius) * 99);box-shadow:var(--box-shadow);--box-shadow: inset 0 0 0 3px white, inset 0 0 1px 3px #0006, 0 0 5px #00000038}.ag-charts-color-picker__hue-input::-webkit-slider-thumb,.ag-charts-color-picker__alpha-input::-webkit-slider-thumb{-webkit-appearance:none;width:var(--thumb-size);height:var(--thumb-size);border-radius:calc(var(--ag-charts-border-radius) * 99);box-shadow:var(--box-shadow);--box-shadow: inset 0 0 0 3px white, inset 0 0 1px 3px #0006, 0 0 5px #00000038;transform:translateZ(0)}.ag-charts-color-picker__hue-input::-moz-range-thumb{background:hsl(var(--h),100%,50%)}.ag-charts-color-picker__hue-input::-webkit-slider-thumb{background:hsl(var(--h),100%,50%)}.ag-charts-color-picker__alpha-input::-moz-range-thumb{background:transparent}.ag-charts-color-picker__alpha-input::-webkit-slider-thumb{background:transparent}.ag-charts-color-picker__alpha-input--opaque::-moz-range-thumb{background:var(--color)}.ag-charts-color-picker__alpha-input--opaque::-webkit-slider-thumb{background:var(--color)}.ag-charts-color-picker__hue-input:focus-visible::-moz-range-thumb,.ag-charts-color-picker__alpha-input:focus-visible::-moz-range-thumb{outline:var(--ag-charts-focus-border);box-shadow:var(--box-shadow),var(--ag-charts-focus-border-shadow)}.ag-charts-color-picker__hue-input:focus-visible::-webkit-slider-thumb,.ag-charts-color-picker__alpha-input:focus-visible::-webkit-slider-thumb{outline:var(--ag-charts-focus-border);box-shadow:var(--box-shadow),var(--ag-charts-focus-border-shadow)}.ag-charts-color-picker__hue-input::-moz-range-track,.ag-charts-color-picker__alpha-input::-moz-range-track{position:absolute;content:"";display:block;top:calc(50% - var(--track-height) / 2);left:var(--inset);right:var(--inset);height:var(--track-height);border-radius:calc(var(--ag-charts-border-radius) * 99);box-shadow:inset 0 0 0 1px #0003}.ag-charts-color-picker__hue-input:before,.ag-charts-color-picker__alpha-input:before{position:absolute;content:"";display:block;top:calc(50% - var(--track-height) / 2);left:var(--inset);right:var(--inset);height:var(--track-height);border-radius:calc(var(--ag-charts-border-radius) * 99);box-shadow:inset 0 0 0 1px #0003}.ag-charts-color-picker__multi-color-button{width:36px;margin-left:var(--inset);height:var(--track-height);border-radius:calc(var(--ag-charts-border-radius) * 99);border:0;background:var(--multi-color);box-shadow:inset 0 0 0 1px #0003}.ag-charts-color-picker__multi-color-button--hidden{display:none}.ag-charts-color-picker__multi-color-button--active{box-shadow:inset 0 0 0 1px #0003;outline-offset:1px;outline:2px solid #2196f3}.ag-charts-color-picker__hue-input{flex:1 0 0}.ag-charts-color-picker__hue-input::-moz-range-track{background:linear-gradient(to right,red,red calc((100% - var(--track-height)) * 0 / 6 + var(--track-height) / 2),#ff0 calc((100% - var(--track-height)) * 1 / 6 + var(--track-height) / 2),#0f0 calc((100% - var(--track-height)) * 2 / 6 + var(--track-height) / 2),#0ff calc((100% - var(--track-height)) * 3 / 6 + var(--track-height) / 2),#00f calc((100% - var(--track-height)) * 4 / 6 + var(--track-height) / 2),#f0f calc((100% - var(--track-height)) * 5 / 6 + var(--track-height) / 2),red calc((100% - var(--track-height)) * 6 / 6 + var(--track-height) / 2))}.ag-charts-color-picker__hue-input:before{background:linear-gradient(to right,red,red calc((100% - var(--track-height)) * 0 / 6 + var(--track-height) / 2),#ff0 calc((100% - var(--track-height)) * 1 / 6 + var(--track-height) / 2),#0f0 calc((100% - var(--track-height)) * 2 / 6 + var(--track-height) / 2),#0ff calc((100% - var(--track-height)) * 3 / 6 + var(--track-height) / 2),#00f calc((100% - var(--track-height)) * 4 / 6 + var(--track-height) / 2),#f0f calc((100% - var(--track-height)) * 5 / 6 + var(--track-height) / 2),red calc((100% - var(--track-height)) * 6 / 6 + var(--track-height) / 2))}.ag-charts-color-picker__alpha-input{margin-bottom:7px}.ag-charts-color-picker__alpha-input::-moz-range-track{background:linear-gradient(to right,transparent,var(--color)),var(--checker) top left / 4px 4px}.ag-charts-color-picker__alpha-input:before{background:linear-gradient(to right,transparent,var(--color)),var(--checker) top left / 4px 4px}.ag-charts-color-picker__color-field{display:flex;border:var(--ag-charts-border);background:var(--ag-charts-background-color);border-radius:var(--ag-charts-border-radius);overflow:hidden}.ag-charts-color-picker__color-field:has(:focus-visible){border-color:var(--ag-charts-accent-color);box-shadow:var(--ag-charts-focus-border-shadow)}.ag-charts-color-picker__color-label{width:16px;height:16px;margin:7px 0;margin-inline-start:7px;color:transparent;background:linear-gradient(to right,var(--color-a),var(--color-a)),var(--checker) top left / 4px 4px;border-radius:calc(var(--ag-charts-border-radius) / 2);box-shadow:inset 0 0 0 1px #0003}.ag-charts-color-picker__color-label--multi-color{background:var(--multi-color)}.ag-charts-color-picker__color-input{flex:1;min-width:0;padding:7px 7px 7px 8px;border:0;margin:0;color:inherit;background:transparent;font-variant:tabular-nums}.ag-charts-color-picker__color-input:focus-visible{border:none;outline:none}.ag-charts-annotations__line-stroke-width-menu,.ag-charts-annotations__line-style-type-menu,.ag-charts-annotations__text-size-menu{border-top-left-radius:0;border-top-right-radius:0;.ag-charts-menu__row:first-child{border-radius:0}}.ag-charts-annotations__text-size-menu{--item-padding: 4px 8px;min-width:34px;text-align:center}.ag-charts-annotations__line-stroke-width-menu{--item-padding: 6px;column-gap:6px}.ag-charts-annotations__line-style-type-menu{--item-padding: 6px;column-gap:0}.ag-charts-annotations__stroke-width-button:before{background:var(--ag-charts-foreground-color);content:"";margin-inline-end:var(--toolbar-button-padding);height:min(var(--stroke-width),20px);width:12px}.ag-charts-annotations__stroke-width-button[aria-disabled=true]:before{filter:grayscale(1);opacity:.5}.ag-charts-annotations__color-picker-button{--emblem: var(--color)}.ag-charts-annotations__color-picker-button--multi-color{--emblem: linear-gradient( to right, #f00 0% , #ff0 calc(100% * 1 / 6), #0f0 calc(100% * 2 / 6), #0ff 50% , #00f calc(100% * 4 / 6), #f0f calc(100% * 5 / 6), #f00 100% )}.ag-charts-annotations__color-picker-button:after{content:"";display:block;position:absolute;bottom:3px;left:5px;right:5px;height:4px;border-radius:99px;box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--ag-charts-foreground-color) 10%,transparent);background:var(--emblem)}.ag-charts-annotations__color-picker-button[aria-disabled=true]:after{filter:grayscale(1);opacity:.5}.ag-charts-annotations__toolbar-menu{min-width:200px}.ag-charts-annotations__axis-button--hidden{display:none}.ag-charts-annotations__axis-button{background-color:var(--ag-charts-crosshair-label-background-color);border-radius:calc(var(--ag-charts-border-radius) / 2);border:none;box-sizing:border-box;color:var(--ag-charts-crosshair-label-text-color);cursor:pointer;font-family:var(--ag-charts-button-font-family);font-size:var(--ag-charts-button-font-size);font-weight:var(--ag-charts-button-font-weight);left:0;line-height:16px;overflow:hidden;padding:0;position:absolute;top:0;user-select:none;white-space:nowrap;z-index:var(--ag-charts-layer-annotations)}.ag-charts-annotations__axis-button:hover{opacity:.8;color:var(--ag-charts-background-color)}.ag-charts-dialog--annotation-settings{min-height:233px;width:289px}.ag-charts-dialog--annotation-settings .ag-charts-textarea{height:calc(10px * 2 + var(--textarea-line-height) * 1em * 3 + 2px);overflow-y:auto;resize:vertical}.ag-charts-context-menu{font-family:var(--ag-charts-chrome-font-family);font-size:var(--ag-charts-chrome-font-size);font-weight:var(--ag-charts-chrome-font-weight);z-index:var(--ag-charts-layer-ui-overlay)}.ag-charts-context-menu__cover{position:fixed;left:0;top:0}.ag-charts-context-menu__menu{background:var(--ag-charts-menu-background-color);border-color:var(--ag-charts-menu-border-color);border-radius:var(--ag-charts-menu-border-radius);border-style:solid;border-width:var(--ag-charts-menu-border-width);box-shadow:var(--ag-charts-popup-shadow);color:var(--ag-charts-menu-text-color);display:flex;flex-direction:column;padding:.5em 0;transition:transform .1s ease;white-space:nowrap}.ag-charts-context-menu__menu:focus{outline:none}.ag-charts-context-menu__item{align-items:center;background:none;border:none;box-sizing:border-box;color:inherit;cursor:pointer;display:flex;font:inherit;justify-content:space-between;text-align:start;width:100%;-webkit-appearance:none;-moz-appearance:none}.ag-charts-context-menu__icon>img{width:var(--ag-charts-icon-size);height:var(--ag-charts-icon-size)}.ag-charts-context-menu__icon,.ag-charts-context-menu__cell{display:flex;align-items:center;flex-shrink:0}.ag-charts-context-menu__cell{flex-grow:1}.ag-charts-context-menu__cellpadding{padding:.5em 1em}.ag-charts-context-menu__icon{padding-inline-end:0}.ag-charts-context-menu__item[data-focus-override=true],.ag-charts-context-menu__item:focus,.ag-charts-context-menu__item:active{background:var(--ag-charts-focus-color)}.ag-charts-context-menu__item[data-focus-override=false]{background:inherit}.ag-charts-context-menu__item[data-focus-visible-override=true]:focus,.ag-charts-context-menu__item:focus-visible{outline:var(--ag-charts-focus-border);box-shadow:var(--ag-charts-focus-border-shadow);z-index:calc(var(--ag-charts-layer-ui-overlay) + 1)}.ag-charts-context-menu__item[data-focus-visible-override=false]{outline:inherit;box-shadow:inherit;z-index:inherit}.ag-charts-context-menu__item[aria-disabled=true]{border:none;color:color-mix(in srgb,var(--ag-charts-input-text-color) 50%,transparent)}.ag-charts-context-menu__item[aria-disabled=true]:focus{background:inherit;cursor:inherit}.ag-charts-wrapper[dir=rtl] .ag-charts-context-menu__item .ag-charts-icon-chevron-right{transform:scaleX(-1)}.ag-charts-context-menu__divider{padding:5px 0}.ag-charts-context-menu__divider:after{content:"";display:block;border-top:1px solid var(--ag-charts-border-color)}.ag-charts-crosshair-label{position:absolute;left:0;top:0;user-select:none;pointer-events:none;font-family:var(--ag-charts-font-family);font-size:var(--ag-charts-font-size);font-weight:var(--ag-charts-font-weight);overflow:hidden;white-space:nowrap;z-index:var(--ag-charts-layer-crosshair);box-sizing:border-box}.ag-charts-crosshair-label-content{padding:0 8px;border-radius:calc(var(--ag-charts-border-radius) / 2);line-height:calc(var(--ag-charts-font-size) + 8px);background-color:var(--ag-charts-crosshair-label-background-color);color:var(--ag-charts-crosshair-label-text-color)}.ag-charts-crosshair-label--hidden{visibility:hidden!important}.ag-charts-text-input{position:absolute}.ag-charts-text-input__textarea{--placeholder-text-color: var(--ag-charts-input-placeholder-text-color);display:block;height:100%;width:100%;border:0;background:none;line-height:1.38;outline:none;transform:translateY(.09em)}.ag-charts-text-input__textarea[placeholder]:empty:before{content:attr(placeholder);color:var(--placeholder-text-color);font-weight:400}.ag-charts-text-input__textarea[placeholder]:not(:empty):before{content:""}.ag-charts-chart-toolbar__menu{min-width:200px}.ag-charts-range-buttons{--toolbar-size: var(--ag-charts-ranges-min-size);--toolbar-border-radius: var(--ag-charts-ranges__button-corner-radius);--toolbar-button-background-color: var(--ag-charts-ranges__button-fill);--toolbar-button-border-color: var(--ag-charts-ranges__button-stroke);--toolbar-button-border-width: var(--ag-charts-ranges__button-stroke-width);--toolbar-button-gap: var(--ag-charts-ranges-gap);--toolbar-button-text-color: var(--ag-charts-ranges__button-text-color);--toolbar-button-background-color--active: var(--ag-charts-ranges__button-fill--active);--toolbar-button-border-color--active: var(--ag-charts-ranges__button-stroke--active);--toolbar-button-text-color--active: var(--ag-charts-ranges__button-text-color--active);--toolbar-button-background-color--disabled: var(--ag-charts-ranges__button-fill--disabled);--toolbar-button-border-color--disabled: var(--ag-charts-ranges__button-stroke--disabled);--toolbar-button-text-color--disabled: var(--ag-charts-ranges__button-text-color--disabled);--toolbar-button-background-color--hover: var(--ag-charts-ranges__button-fill--hover);--toolbar-button-border-color--hover: var(--ag-charts-ranges__button-stroke--hover);--toolbar-button-text-color--hover: var(--ag-charts-ranges__button-text-color--hover)}.ag-charts-range-buttons--dropdown{--toolbar-border-radius: var(--ag-charts-ranges__dropdown-corner-radius);--toolbar-button-background-color: var(--ag-charts-ranges__dropdown-fill);--toolbar-button-border-color: var(--ag-charts-ranges__dropdown-stroke);--toolbar-button-border-width: var(--ag-charts-ranges__dropdown-stroke-width);--toolbar-button-text-color: var(--ag-charts-ranges__dropdown-text-color);--toolbar-button-background-color--active: var(--ag-charts-ranges__dropdown-fill--active);--toolbar-button-border-color--active: var(--ag-charts-ranges__dropdown-stroke--active);--toolbar-button-text-color--active: var(--ag-charts-ranges__dropdown-text-color--active);--toolbar-button-background-color--disabled: var(--ag-charts-ranges__dropdown-fill--disabled);--toolbar-button-border-color--disabled: var(--ag-charts-ranges__dropdown-stroke--disabled);--toolbar-button-text-color--disabled: var(--ag-charts-ranges__dropdown-text-color--disabled);--toolbar-button-background-color--hover: var(--ag-charts-ranges__dropdown-fill--hover);--toolbar-button-border-color--hover: var(--ag-charts-ranges__dropdown-stroke--hover);--toolbar-button-text-color--hover: var(--ag-charts-ranges__dropdown-text-color--hover)}.ag-charts-range-buttons .ag-charts-toolbar__button{font-size:var(--ag-charts-ranges__button-font-size);font-family:var(--ag-charts-ranges__button-font-family);font-weight:var(--ag-charts-ranges__button-font-weight);padding-top:var(--ag-charts-ranges__button-padding-top);padding-right:var(--ag-charts-ranges__button-padding-right);padding-bottom:var(--ag-charts-ranges__button-padding-bottom);padding-left:var(--ag-charts-ranges__button-padding-left)}.ag-charts-range-buttons--dropdown .ag-charts-toolbar__button{flex:1;justify-content:space-between;font-size:var(--ag-charts-ranges__dropdown-font-size);font-family:var(--ag-charts-ranges__dropdown-font-family);font-weight:var(--ag-charts-ranges__dropdown-font-weight);padding-top:var(--ag-charts-ranges__dropdown-padding-top);padding-right:var(--ag-charts-ranges__dropdown-padding-right);padding-bottom:var(--ag-charts-ranges__dropdown-padding-bottom);padding-left:var(--ag-charts-ranges__dropdown-padding-left);.ag-charts-toolbar__icon{margin-top:calc(var(--ag-charts-ranges__dropdown-font-size) - 15px);margin-bottom:calc(var(--ag-charts-ranges__dropdown-font-size) - 15px);height:calc(var(--ag-charts-ranges__dropdown-font-size) + 8px);width:calc(var(--ag-charts-ranges__dropdown-font-size) + 8px)}}.ag-charts-toolbar--horizontal.ag-charts-range-buttons--gapped{.ag-charts-toolbar__button{border-radius:var(--toolbar-border-radius);border-width:var(--toolbar-button-border-width)}.ag-charts-toolbar__button:hover,.ag-charts-toolbar__button--active,.ag-charts-toolbar__button--active:hover{+.ag-charts-toolbar__button:not(:hover,.ag-charts-toolbar__button--active){border-inline-start-color:var(--toolbar-button-border-color)}+.ag-charts-toolbar__button[aria-disabled=true]{border-inline-start-color:var(--toolbar-button-border-color--disabled)}}.ag-charts-toolbar__button:hover:not(.ag-charts-toolbar__button--active){border-inline-start-color:var(--toolbar-button-border-color--hover)}}.ag-charts-range-buttons-menu{background:var(--ag-charts-ranges__dropdown-fill);border-color:var(--ag-charts-ranges__dropdown-stroke);border-radius:var(--ag-charts-ranges__dropdown-corner-radius);border-width:var(--ag-charts-ranges__dropdown-stroke-width);color:var(--ag-charts-ranges__dropdown-text-color);.ag-charts-menu__row{font-size:var(--ag-charts-ranges__dropdown-font-size);font-family:var(--ag-charts-ranges__dropdown-font-family);font-weight:var(--ag-charts-ranges__dropdown-font-weight);padding-top:var(--ag-charts-ranges__dropdown-padding-top);padding-right:var(--ag-charts-ranges__dropdown-padding-right);padding-bottom:var(--ag-charts-ranges__dropdown-padding-bottom);padding-left:var(--ag-charts-ranges__dropdown-padding-left)}.ag-charts-menu__row:focus{background:var(--ag-charts-ranges__dropdown-fill--hover)}.ag-charts-menu__row[aria-disabled=true]{background:var(--ag-charts-ranges__dropdown-fill--disabled);color:var(--ag-charts-ranges__dropdown-text-color--disabled)}}.ag-charts-zoom-buttons{direction:ltr;align-items:center;display:flex;height:44px;justify-content:center;overflow:hidden;padding-bottom:10px;pointer-events:none;width:100%;.ag-charts-toolbar{--toolbar-size: 24px;--toolbar-button-padding: 1px;display:flex;font-size:var(--ag-charts-chrome-font-size);height:var(--toolbar-size);justify-content:center;opacity:1;pointer-events:auto;transition:opacity .2s ease-in-out,transform .4s ease-in-out;.ag-charts-toolbar__button--first{border-end-start-radius:var(--ag-charts-button-border-radius);border-start-start-radius:var(--ag-charts-button-border-radius)}.ag-charts-toolbar__button--last{border-end-end-radius:var(--ag-charts-button-border-radius);border-start-end-radius:var(--ag-charts-button-border-radius)}.ag-charts-toolbar__label{padding-inline-start:var(--ag-charts-spacing);padding-inline-end:var(--ag-charts-spacing)}.ag-charts-toolbar__icon+.ag-charts-toolbar__label{padding-inline-start:0}.ag-charts-toolbar__button--group-first{margin-inline-start:calc(var(--ag-charts-spacing) * 2)}&.ag-charts-zoom-buttons__toolbar--hidden{opacity:0;transition:opacity .4s ease-in-out,transform .4s ease-in-out}}}.ag-charts-shared-toolbar{--toolbar-button-gap: calc(var(--ag-charts-spacing) * 2);.ag-charts-toolbar__button{border-radius:var(--ag-charts-button-border-radius);margin:0}.ag-charts-toolbar__button--active+.ag-charts-toolbar__button{border-inline-start-color:var(--ag-charts-border-color)}}
1\n';function I(e,t,i){const n=Math.floor(e.length/2);return A(e,t,n,t,i)||A(e,e.length-t,n,-t,i)}function A(e,t,i,n,s){let a=e[0];for(let o=t;n>0?o<=i:o>i;o+=n){const t=e[o];if(s(a,t))return!0;a=t}return!1}var{Path:C,RotatableText:N,Transformable:L,BBox:P,Selection:T,Line:O}=s.n1,R=class extends s.n1.PolarAxis{constructor(e,t,i,n){super(e,t,i,n),this.tickLineGroupSelection=T.select(this.tickLineGroup,O,!1),this.gridLineGroupSelection=T.select(this.gridLineGroup,O,!1),this.labelData=[],this.tickData=[],this.radiusLineGroup=this.axisGroup.appendChild(new s.n1.TransformableGroup),this.radiusLine=this.radiusLineGroup.appendChild(new C),this.includeInvisibleDomains=!0}get direction(){return n.tv$.Angle}calculateRotations(){const e=(0,n.ehJ)(this.options.startAngle);return{rotation:e,parallelFlipRotation:(0,n.YcT)(e),regularFlipRotation:(0,n.YcT)(e-Math.PI/2)}}calculateTickLayout(e){const{nice:t,scale:i}=this,s={nice:[t,t],interval:void 0,tickCount:void 0,minTickCount:0,maxTickCount:1/0},a=t?i.niceDomain(s,e):e,o=this.generateAngleTicks(a);this.tickData=o;const r=o.map((e=>e.value)),l=r.reduce(((e,t)=>Math.max("number"==typeof t?(0,n.o3B)(t):0,e)),0);return{niceDomain:a,tickDomain:a,ticks:r,rawTickCount:void 0,fractionDigits:l,timeInterval:void 0,bbox:this.getBBox()}}
1update(){super.update(),this.updateRadiusLine(),this.updateGridLines(),this.updateTickLines()}normalizedAngles(){const{startAngle:e,endAngle:t}=this.options,i=(0,n.YcT)(-Math.PI/2+(0,n.ehJ)(e));return[i,i+(null==t?2*Math.PI:(0,n.I5e)((0,n.ehJ)(t)-(0,n.ehJ)(e)))]}computeRange(){this.range=this.normalizedAngles()}updateSelections(){const e=this.tickData;this.gridLineGroupSelection.update(this.gridLength&&this.options.gridLine.enabled?e:[]),this.tickLineGroupSelection.update(this.options.tick.enabled?e:[]),this.tickLabelGroupSelection.update(this.options.label.enabled?e:[]),this.gridLineGroupSelection.cleanup(),this.tickLineGroupSelection.cleanup(),this.tickLabelGroupSelection.cleanup()}updatePosition(){super.updatePosition();const{translation:e,radiusLineGroup:t}=this,i=Math.floor(e.x),n=Math.floor(e.y);t.translationX=i,t.translationY=n}updateRadiusLine(){const e=this.radiusLine,{path:t}=e;t.clear(!0);const{points:i,closePath:n}=this.getAxisLinePoints();for(const{x:e,y:n,moveTo:s,arc:a,radius:o=0,startAngle:r=0,endAngle:l=0}of i)a?t.arc(e,n,o,r,l):s?t.moveTo(e,n):t.lineTo(e,n);n&&t.closePath();const{line:s}=this.options;e.visible=s.enabled,e.stroke=s.stroke,e.strokeWidth=s.width,e.fill=void 0}getAxisLinePoints(){const{scale:e,shape:t,gridLength:i}=this,[s,a]=this.range,o=(0,n.YXt)(a-s,2*Math.PI),r=[];if("circle"===t)o?r.push({x:i,y:0,moveTo:!0},{x:0,y:0,radius:i,startAngle:0,endAngle:2*Math.PI,arc:!0,moveTo:!1}):r.push({x:i*Math.cos(s),y:i*Math.sin(s),moveTo:!0},{x:0,y:0,radius:i,startAngle:(0,n.YcT)(s),endAngle:(0,n.YcT)(a),arc:!0,moveTo:!1});else if("polygon"===t){const t=e.ticks({nice:[this.nice,this.nice],interval:void 0,tickCount:void 0,minTickCount:0,maxTickCount:1/0})?.ticks?.map((t=>e.convert(t)));if(t&&t.length>2)for(const[e,n]of t.entries()){const t=i*Math.cos(n),s=i*Math.sin(n),a=0===e;r.push({x:t,y:s,moveTo:a})}}return{points:r,closePath:o}}updateGridLines(){const{scale:e,gridLength:t,innerRadiusRatio:i}=this,{style:n,width:s}=this.options.gridLine;if(!(n&&t>0))return;const a=t*i,o=n.length;this.gridLineGroupSelection.each(((i,r,l)=>{const{value:h}=r,{stroke:c,lineDash:d}=n[l%o],u=e.convert(h);i.x1=a*Math.cos(u),i.y1=a*Math.sin(u),i.x2=t*Math.cos(u),i.y2=t*Math.sin(u),i.stroke=c,i.strokeWidth=s,i.lineDash=d,i.fill=void 0})),this.gridLineGroupSelection.cleanup()}updateLabels(){const e=this.options.label,{tickLabelGroupSelection:t}=this;t.each(((t,i,n)=>{const s=this.labelData[n];s&&!s.hidden?(t.text=s.text,t.setFont(e),t.fill=e.color,t.x=s.x,t.y=s.y,t.setAlign(s),t.setBoxing(e),t.visible=!0,s.rotation?(t.rotation=s.rotation,t.rotationCenterX=s.x,t.rotationCenterY=s.y):t.rotation=0):t.visible=!1}))}updateTickLines(){const{scale:e,gridLength:t,tickLineGroupSelection:i}=this,n=this.options.tick;i.each(((i,s)=>{const{value:a}=s,o=e.convert(a),r=Math.cos(o),l=Math.sin(o);i.x1=t*r,i.y1=t*l,i.x2=(t+n.size)*r,i.y2=(t+n.size)*l,i.stroke=n.stroke,i.strokeWidth=n.width}))}createLabelNodeData(e,t,i){const s=this.options.label,{gridLength:a,scale:o}=this,r=this.options.tick;if(!s.enabled)return[];const l=new N,h=i.x-this.translation.x,c=i.x+i.width-this.translation.x,{fractionDigits:d}=this.layout.label,u=this.tickFormatter(this.scale.domain,this.tickData,!1,d),p=e.map(((i,d)=>{const{value:p}=i,g=a+s.spacing+r.size,m=o.convert(p),y=g*Math.cos(m),f=g*Math.sin(m),{textAlign:x,textBaseline:b}=this.getLabelAlign(m),v=d===e.length-1&&p!==e[0]&&(0,n.YXt)((0,n.YcT)(m),(0,n.YcT)(o.convert(e[0]))),S=this.getLabelRotation(m);let M=u(p,d);l.text=M,l.x=y,l.y=f,l.setFont(s),l.textAlign=x,l.textBaseline=b,l.rotation=S,S&&(l.rotationCenterX=y,l.rotationCenterY=f);let k=S?L.toCanvas(l):l.getBBox();if(k&&t.hideWhenNecessary&&!S){const e=h-k.x,t=k.x+k.width-c,i=1;if(e>i||t>i){const i={maxWidth:k.width-Math.max(e,t),font:s,textWrap:"never"};M=(0,n.rHj)(M,i),l.text=M,k=l.getBBox()}}return{text:M,x:y,y:f,textAlign:x,textBaseline:b,hidden:""===M||(i.hidden??v),rotation:S,box:k}}));return s.avoidCollisions&&this.avoidLabelCollisions(p),p}computeLabelsBBox(e,t){this.labelData=this.createLabelNodeData(this.tickData,e,t);const i=this.labelData.map((({box:e})=>e)).filter((e=>null!=e));return this.options.label.enabled&&0!==i.length?P.merge(i):null}getLabelOrientation(){return this.options.label.orientation}getLabelRotation(e){let t=(0,n.ehJ)(this.options.label.rotation??0);e=(0,n.YcT)(e);const i=this.getLabelOrientation();return"parallel"===i?(t+=e,e>=0&&e<Math.PI?t-=Math.PI/2:t+=Math.PI/2):"perpendicular"===i&&(t+=e,e>=Math.PI/2&&e<1.5*Math.PI&&(t+=Math.PI)),t}getLabelAlign(e){const t=Math.cos(e),i=Math.sin(e);let s,a;const o=this.getLabelOrientation(),r=(0,n.YXt)(t,0),l=(0,n.YXt)(i,0),h=(0,n.YXt)(t,1),c=(0,n.YXt)(i,-1),d=t>0&&!r,u=i>0&&!l;return"parallel"===o?(s="center",a=h&&l||u?"top":"bottom"):"perpendicular"===o?(s=c||d?"left":"right",a="middle"):(s="right",r?s="center"
1:d&&(s="left"),a="bottom",l?a="middle":u&&(a="top")),{textAlign:s,textBaseline:a}}computePolarLayout(){const e=this.gridLength;return{...this.calculateRotations(),shape:this.shape,axisOuterRadius:e,axisInnerRadius:e*this.innerRadiusRatio,ticks:this.tickData.map((e=>e.value))}}},{CategoryScale:E}=s.n1,z=(()=>{var e=class extends R{constructor(e,t,i){super(e,t,new E,i)}hasDefinedDomain(){return!1}generateAngleTicks(e){const{scale:t,gridLength:i}=this,{values:n,minSpacing:s}=this.options.interval??{},a={nice:[this.nice,this.nice],interval:void 0,tickCount:void 0,minTickCount:0,maxTickCount:1/0},o=n??t.ticks(a,e)?.ticks??[];if(o.length<2||null==s)return o.map((e=>({value:e,visible:!0})));const r=o[0],l=t.convert(r),h=i*Math.cos(l),c=i*Math.sin(l);for(let e=1;e<o.length-1;e++){const n=o[e],a=t.convert(n);if(a-l>Math.PI)break;const d=i*Math.cos(a),u=i*Math.sin(a);if(Math.hypot(d-h,u-c)>s){const t=new Set([r]);return I(o,e,((e,i)=>{t.add(i)})),o.map((e=>({value:e,visible:t.has(e)})))}}return[{value:r,visible:!0}]}avoidLabelCollisions(e){const t=this.options.label.minSpacing;if(e.length<3)return;const i=(e,i)=>{if(e.hidden||i.hidden)return!1;if(null==t)return e.box.collidesBBox(i.box);const n=e.box.clone().grow(t/2),s=i.box.clone().grow(t/2);return n.collidesBBox(s)},s=e[0],a=e.at(-1),o=new Set([s]),r=(0,n.YXt)(s.x,a.x)&&(0,n.YXt)(s.y,a.y),l=Math.floor(e.length/2);for(let t=1;t<=l;t++){const n=r?e.slice(0,-1):e;if(!I(n,t,i)){I(n,t,((e,t)=>{o.add(t)}));break}}for(const t of e)o.has(t)||(t.hidden=!0,t.box=void 0)}tickFormatParams(){return{type:"category"}}datumFormatParams(e,t){const{datum:i,seriesId:n,legendItemName:s,key:a,source:o,property:r,domain:l,boundSeries:h}=t;return{type:"category",value:e,datum:i,seriesId:n,legendItemName:s,key:a,source:o,property:r,domain:l,boundSeries:h}}};return e.className="AngleCategoryAxis",e.type="angle-category",e})(),B=(()=>({type:"axis",name:"angle-category",chartType:"polar",enterprise:!0,version:s.xv,dependencies:[s.T9],options:s.n1.angleCategoryAxisOptionsDefs,themeTemplate:(0,n.HFk)({startAngle:0,groupPaddingInner:0,paddingInner:0,label:{spacing:5},gridLine:{enabled:!1},shape:{$findFirstSiblingNotOperation:["polygon"]}},s.n1.commonAxisThemeTemplate),create:(e,t,i)=>new z(e,t,i)}))(),{LinearScale:F}=s.n1,V=class e extends F{constructor(){super(...arguments),this.arcLength=0}static getNiceStepAndTickCount(e,t){const[i,s]=t.map(n.Roz);let a=F.getTickStep(i,s,e);const o=Number.isNaN(e.maxTickCount)?1/0:e.maxTickCount,r=Math.abs(s-i)/a;let l=Math.pow(2,Math.ceil(Math.log(r)/Math.log(2)));return l>o&&(l/=2,a*=2),{count:l,step:a}}ticks(t,i=this.domain){const{arcLength:s}=this,a=i.map(n.Roz);if(a.length<2||a.some((e=>!Number.isFinite(e)))||s<=0)return{ticks:[],count:0};const{nice:o,interval:r}=t,[l,h]=a;if(r){const e=Math.abs((0,n.Roz)(r)),t=this.getPixelRange();if(!(0,n.bVu)((h-l)/e,t,this.logger)){const t=(0,n.y17)(l,h,e);return{ticks:t.ticks,count:t.count}}}let c;if(o&&this.hasNiceRange()){const n=super.niceDomain(t,i);c=e.getNiceStepAndTickCount(t,n).step}else c=F.getTickStep(l,h,t);const d=(0,n.y17)(l,h,c);return{ticks:d.ticks,count:d.count}}hasNiceRange(){const e=this.range.slice().sort(((e,t)=>e-t));return[Math.PI,2*Math.PI].some((t=>(0,n.YXt)(t,e[1]-e[0])))}niceDomain(t,i=this.domain){const s=super.niceDomain(t,i);if(!this.hasNiceRange())return s;const[a,o]=s.map(n.Roz),r=a>o,l=r?o:a,{step:h,count:c}=e.getNiceStepAndTickCount(t,s),d=1/h,u=h>=1?Math.ceil(l/h+c)*h:Math.ceil((l+c*h)*d)/d;return r?[u,l]:[l,u]}getPixelRange(){return this.arcLength}},$=(()=>{var e=class extends R{get shape(){return"circle"}constructor(e,t,i){super(e,t,new V,i)}getLabelFormat(){return this.options.label.format}hasDefinedDomain(){const{min:e,max:t}=this.options;return null!=e&&null!=t&&e<t}normaliseDataDomain(e){const{min:t,max:i,preferredMin:s,preferredMax:a}=this.options,{extent:o,clipped:r}=(0,n.Myf)(e.domain,t,i,s,a,void 0,e.sortMetadata?.sortOrder);return{domain:o,clipped:r}}getDomainExtentsNice(){return[null==this.options.min&&this.nice,null==this.options.max&&this.nice]}updateScale(){super.updateScale(),this.scale.arcLength=this.getRangeArcLength()}getRangeArcLength(){const{range:e}=this,t=Math.min(...e),i=Math.max(...e);return((0,n.s57)(t,i)||2*Math.PI)*this.gridLength}generateAngleTicks(e){const{scale:t,range:i,nice:s}
1=this,{values:a,step:o,minSpacing:r,maxSpacing:l}=this.options.interval??{};let h;if(null==a){const{arcLength:a}=t,c=l?Math.floor(a/l):1,d=r?Math.floor(a/r):1/0,u=Math.floor(4/Math.PI*Math.abs(i[0]-i[1])),p=Math.max(c,Math.min(d,u)),g={nice:[s,s],interval:(0,n.iud)(o),tickCount:p,minTickCount:c,maxTickCount:d};h=t.ticks(g,e)?.ticks??[]}else{const[t,i]=(0,n.uYy)(e.map(Number));h=a.filter((e=>e>=t&&e<=i)).sort(((e,t)=>e-t))}return h.map((e=>({value:e,visible:!0})))}avoidLabelCollisions(e){const t=this.options.label.minSpacing,i=(e,i)=>{if(e.hidden||i.hidden)return!1;if(null==t)return e.box.collidesBBox(i.box);const n=e.box.clone().grow(t/2),s=i.box.clone().grow(t/2);return n.collidesBBox(s)},s=e[0],a=e.at(-1);s!==a&&(0,n.YXt)(s.x,a.x)&&(0,n.YXt)(s.y,a.y)&&(a.hidden=!0);for(let t=1;t<e.length;t*=2){let n=!1;for(let s=t;s<e.length;s+=t){const a=e[s];if(i(e[s-t],a)){n=!0;break}}if(!n){for(const[i,n]of e.entries())i%t>0&&(n.hidden=!0,n.box=void 0);return}}for(const[t,i]of e.entries())t>0&&(i.hidden=!0,i.box=void 0)}tickFormatParams(e,t,i){return{type:"number",visibleDomain:void 0,fractionDigits:i}}datumFormatParams(e,t,i){const{datum:n,seriesId:s,legendItemName:a,key:o,source:r,property:l,domain:h,boundSeries:c}=t;return{type:"number",value:e,datum:n,seriesId:s,legendItemName:a,key:o,source:r,property:l,domain:h,boundSeries:c,fractionDigits:i,visibleDomain:void 0}}};return e.className="AngleNumberAxis",e.type="angle-number",e})(),H=(()=>({type:"axis",name:"angle-number",chartType:"polar",enterprise:!0,version:s.xv,dependencies:[s.T9],options:s.n1.angleNumberAxisOptionsDefs,themeTemplate:(0,n.HFk)({startAngle:0,shape:"circle",label:{spacing:5},gridLine:{enabled:!1}},s.n1.commonAxisThemeTemplate),create:(e,t,i)=>new $(e,t,i)}))();function j(e,t,i){return i?null!=e.listeners.axisDoubleClick||null!=t.listeners?.doubleClick:null!=e.listeners.axisClick||null!=t.listeners?.click}function W(e,t){return j(e,t,!1)||j(e,t,!0)}function _(e){const t=e.chartState.getValue("options");return!(!t?.zoom?.enabled||!t.zoom.enableAxisDragging)}var G=class extends n.UbG{constructor(e){super(),this.ctx=e,this.enabled=new Map,this.enableDoubleClick=new Map,this.enableDragging=new Map,this.enableScrolling=new Map,this.enableContextMenu=new Map,this.axes=[],this.overlappingAxisIds=new Set,e.widgets.seriesDragInterpreter&&this.cleanup.register(e.widgets.seriesDragInterpreter.events.on("dblclick",(e=>this.onSeriesAreaDoubleClick(e))),e.widgets.seriesDragInterpreter.events.on("drag-start",(e=>this.onSeriesAreaDragStart(e))),e.widgets.seriesDragInterpreter.events.on("drag-move",(e=>this.onSeriesAreaDragMove(e))),e.widgets.seriesDragInterpreter.events.on("drag-end",(e=>this.onSeriesAreaDragEnd(e)))),this.cleanup.register(e.eventsHub.on("layout:complete",(e=>this.onLayoutComplete(e))),e.eventsHub.on("axis-interaction:update",(e=>this.onUpdate(e))),e.eventsHub.on("series-area:hover",(e=>this.onSeriesAreaHover(e))),e.eventsHub.on("series-area:click",(e=>this.onSeriesAreaClick(e))),e.eventsHub.on("series-area:contextmenu",(e=>this.onSeriesAreaContextMenu(e))),(()=>this.teardown()))}teardown(){for(const e of this.axes)this.ctx.widgets.axisWidgets.releaseRegion(e.axisId)}onLayoutComplete(e){this.seriesRect=e.series.rect,this.refresh()}onUpdate(e){const{enabled:t,enableDoubleClick:i,enableDragging:n,enableScrolling:s,enableContextMenu:a,source:o}=e;this.enabled.set(o,t),this.enableDoubleClick.set(o,i),this.enableDragging.set(o,n),this.enableScrolling.set(o,s),this.enableContextMenu.set(o,a),this.refresh()}refresh(){const e=this.isEnabled()&&(this.isEnabledDoubleClick()||this.isEnabledDragging()||this.isEnabledScrolling()||this.isEnabledContextMenu())||this.hasClickListeners();for(const t of this.axes)t.div.setHidden(!e);e&&(this.processAxisDiff(),this.updateOverlappingAxisPointerEvents())}processAxisDiff(){const{ctx:{axisManager:e,chartService:t}}=this,i=[...e.getAxisContext(n.tv$.X),...e.getAxisContext(n.tv$.Y)],{removed:a,added:o}=this.diffAxisIds(i);a.length>0&&(this.axes=this.axes.filter((e=>!a.includes(e.axisId)||(this.ctx.widgets.axisWidgets.releaseRegion(e.axisId),this.overlappingAxisIds.delete(e.axisId),this.hoveredAxisId===e.axisId&&(this.hoveredAxisId=void 0),this.draggingAxisId===e.axisId&&(this.draggingAxisId=void 0),!1))));for(const e of o){const{axisId:t,direction:i}=e,n=this.createAxisInteraction(t,i);this.axes.push(n)}for(const e of this.axes){const a=i.find((t=>t.axisId===e.axisId)),o=a.getCanvasBounds();
1e.div.setHidden((0,n.fa1)(o)),null==o?e.bounds=void 0:(this.ctx.widgets.axisWidgets.setRegionBounds(e.axisId,o),e.bounds=new s.n1.BBox(o.x,o.y,o.width,o.height));const r=!_(this.ctx)&&W(t,a);e.div.setCursor(r?"pointer":void 0)}}onSeriesAreaHover(e){if(e.consumed)return void(this.hoveredAxisId&&(this.hoveredAxisId=void 0,this.ctx.eventsHub.emit("axis-interaction:mouseleave",{event:e})));if(!this.hasOverlappingAxes())return;const t=this.pickAxisAtPoint(e);t?(this.hoveredAxisId=t.axisId,this.ctx.eventsHub.emit("axis-interaction:mouseenter",{axisId:t.axisId,direction:t.direction,event:e})):(this.hoveredAxisId&&this.ctx.eventsHub.emit("axis-interaction:mouseleave",{event:e}),this.hoveredAxisId=void 0)}onSeriesAreaClick(e){if("dblclick"!==e.sourceEvent.type)return;if(e.consumed)return;if(!this.hasOverlappingAxes())return;const t=this.getAxis(this.hoveredAxisId);t&&this.ctx.eventsHub.emit("axis-interaction:dblclick",{event:e,axisId:t.axisId,direction:t.direction})}onSeriesAreaContextMenu(e){if(!this.isEnabled()||!this.isEnabledContextMenu())return;if(!this.hasOverlappingAxes())return;const t=this.pickAxisAtPoint(e);t&&(e.axis=this.pickAxisValue(t.axisId,e))}onSeriesAreaDoubleClick(e){if(!this.isEnabled()||!this.isEnabledDoubleClick())return;if(!this.hasOverlappingAxes())return;const t=this.getAxis(this.hoveredAxisId);t&&this.ctx.eventsHub.emit("axis-interaction:dblclick",{event:e,axisId:t.axisId,direction:t.direction})}onSeriesAreaDragStart(e){if(!this.isEnabled()||!this.isEnabledDragging())return;const t=this.getAxis(this.hoveredAxisId);t&&this.overlappingAxisIds.has(t.axisId)&&(this.draggingAxisId=t.axisId,this.ctx.eventsHub.emit("axis-interaction:drag-start",{axisId:t.axisId,direction:t.direction,event:e}),"touch"===e.device&&e.sourceEvent.preventDefault())}onSeriesAreaDragMove(e){if(!this.isEnabled()||!this.isEnabledDragging()||!this.draggingAxisId)return;if(!this.overlappingAxisIds.has(this.draggingAxisId))return;const t=this.getAxis(this.draggingAxisId);t&&this.ctx.eventsHub.emit("axis-interaction:drag-move",{axisId:t.axisId,direction:t.direction,event:e})}onSeriesAreaDragEnd(e){if(!this.draggingAxisId)return;if(!this.overlappingAxisIds.has(this.draggingAxisId))return;const t=this.getAxis(this.draggingAxisId);t&&(this.draggingAxisId=void 0,this.ctx.eventsHub.emit("axis-interaction:drag-end",{axisId:t.axisId,direction:t.direction,event:e}))}pickAxisValue(e,t){return this.ctx.axisManager.getAxisIdContext(e)?.pickValue(t)}toCanvasPoint(e,t){return{canvasX:t.currentX+e.cssLeft(),canvasY:t.currentY+e.cssTop()}}dispatchAxisClick(e,t){if("keyboard"===t.device)return;const i=this.axes.find((t=>t.axisId===e))?.div;if(!i)return;const s="dblclick"===t.type,a=this.ctx.axisManager.getAxisIdContext(e);if(null!=a&&!j(this.ctx.chartService,a,s))return void(this.enabled.get("zoom")||this.ctx.chartService.callListener({type:s?"doubleClick":"click",event:t.sourceEvent,coordinates:void 0}));const o=a?.pickValue(this.toCanvasPoint(i,t));if(!a||!o)return;const{direction:r,boundSeries:l,domain:h,value:c,index:d,depth:u,groupPercentage:p}=o,g={event:t.sourceEvent,axisId:o.axisId,direction:r,boundSeries:l,domain:h,value:c,index:d,depth:u,groupPercentage:p},m=s?a.listeners?.doubleClick:a.listeners?.click;if(m){const e={type:s?"doubleClick":"click",...g};(0,n.cVk)([o.caller,this.ctx.chartService],m,e)}const y=s?"axisDoubleClick":"axisClick";this.ctx.chartService.callListener({type:y,...g})}dispatchAxisContextMenu(e,t,i,n){const s=this.pickAxisValue(e,{canvasX:i,canvasY:n});s&&this.ctx.contextMenuRegistry?.dispatchContext("axis",{widgetEvent:t,canvasX:i,canvasY:n},s)}pickAxisAtPoint(e){for(const t of this.axes)if(this.overlappingAxisIds.has(t.axisId)&&t.bounds?.containsPoint(e.canvasX,e.canvasY))return{axisId:t.axisId,direction:t.direction}}hasOverlappingAxes(){return this.overlappingAxisIds.size>0}getAxis(e){if(!e)return;const t=this.axes.find((t=>t.axisId===e));return t?{axisId:t.axisId,direction:t.direction}:void 0}updateOverlappingAxisPointerEvents(){this.overlappingAxisIds.clear();const e=(this.isEnabledDragging()||this.isEnabledScrolling()||this.isEnabledContextMenu())&&this.seriesRect;for(const t of this.axes){if(!e){t.div.setPointerEvents(void 0);continue}
1Boolean(t.bounds?.clone().shrink(1).collidesBBox(this.seriesRect))?(this.overlappingAxisIds.add(t.axisId),t.div.setPointerEvents("none")):t.div.setPointerEvents(void 0)}this.cleanupAxisState()}cleanupAxisState(){this.hoveredAxisId&&!this.overlappingAxisIds.has(this.hoveredAxisId)&&(this.hoveredAxisId=void 0),this.draggingAxisId&&!this.overlappingAxisIds.has(this.draggingAxisId)&&(this.draggingAxisId=void 0)}createAxisInteraction(e,t){const i=this.ctx.widgets.axisWidgets.acquireRegion(e),n=i.widget,s=i.dragInterpreter.events;return s.on("drag-start",(i=>{this.isEnabled()&&this.isEnabledDragging()&&("touch"===i.device&&i.sourceEvent.preventDefault(),this.draggingAxisId=e,this.ctx.eventsHub.emit("axis-interaction:drag-start",{axisId:e,direction:t,event:i}))})),s.on("drag-move",(i=>{this.isEnabled()&&this.isEnabledDragging()&&this.ctx.eventsHub.emit("axis-interaction:drag-move",{axisId:e,direction:t,event:i})})),s.on("drag-end",(i=>{this.isEnabled()&&this.isEnabledDragging()&&(this.draggingAxisId=void 0,this.ctx.eventsHub.emit("axis-interaction:drag-end",{axisId:e,direction:t,event:i}))})),s.on("dblclick",(i=>{this.dispatchAxisClick(e,i),this.isEnabled()&&this.isEnabledDoubleClick()&&this.ctx.eventsHub.emit("axis-interaction:dblclick",{axisId:e,direction:t,event:i})}
1)),n.addListener("mouseenter",(i=>{this.isEnabled()&&(this.hoveredAxisId=e,this.ctx.eventsHub.emit("axis-interaction:mouseenter",{axisId:e,direction:t,event:i}))})),n.addListener("mouseleave",(e=>{this.isEnabled()&&(this.hoveredAxisId=void 0,this.ctx.eventsHub.emit("axis-interaction:mouseleave",{event:e}))})),n.addListener("wheel",(i=>{this.isEnabled()&&this.isEnabledScrolling()&&this.ctx.eventsHub.emit("axis-interaction:wheel",{axisId:e,direction:t,event:i})})),s.on("click",(t=>{this.dispatchAxisClick(e,t)})),n.addListener("contextmenu",(t=>{if(!this.isEnabled()||!this.isEnabledContextMenu())return;const i=t.currentX+n.cssLeft(),s=t.currentY+n.cssTop();this.dispatchAxisContextMenu(e,t,i,s)})),{axisId:e,div:n,direction:t}}diffAxisIds(e){const t=this.axes.map((e=>e.axisId)),i=e.map((e=>e.axisId));return{removed:t.filter((e=>!i.includes(e))),added:e.filter((e=>!t.includes(e.axisId)))}}isEnabled(){return this.isBooleanMap(this.enabled)}hasClickListeners(){const{axisManager:e,chartService:t}=this.ctx;return[...e.getAxisContext(n.tv$.X),...e.getAxisContext(n.tv$.Y)].some((e=>W(t,e)))}isEnabledDoubleClick(){return this.isBooleanMap(this.enableDoubleClick)}isEnabledDragging(){return this.isBooleanMap(this.enableDragging)}isEnabledScrolling(){return this.isBooleanMap(this.enableScrolling)}isEnabledContextMenu(){return this.isBooleanMap(this.enableContextMenu)}isBooleanMap(e){for(const t of e.values())if(t)return!0;return!1}},K={type:"plugin",name:"axis-interaction",version:s.xv,create:e=>new G(e)};function Y(e){return{...e,enterprise:!0,dependencies:[...e.dependencies??[],K]}}var U=Y(s.UV),X=Y(s.i8),Z=Y(s.A9),q=Y(s.ZK),Q=Y(s.Hj),J=Y(s.pP),{OrdinalTimeScale:ee,ApproximateOrdinalTimeScale:te,APPROXIMATE_THRESHOLD:ie,minimumTimeAxisDatumGranularity:ne}=s.n1,se=(()=>{var e=class extends s.n1.DiscreteTimeAxis{constructor(e,t,i){const n=new ee;super(e,t,n,i),this.accurateScale=n,this.approximateScale=new te,this.approximateScale.logger=e.logger,this.approximateScale.setSourceScale(n),Object.defineProperty(this,"scale",{get:()=>this.getActiveScale(),configurable:!0})}get primaryLabel(){const e=this.options.parentLevel;return e?.enabled?e.label:void 0}get primaryTick(){const e=this.options.parentLevel;return e?.enabled?e.tick:void 0}getLabelFormat(){const e=this.options.label.format;return e}getPrimaryLabelFormat(){const e=this.primaryLabel?.format;return e}getActiveScale(){const e=this.accurateScale.bandCount(this.visibleRange);return(this.accurateScale.getUniformityCache(this.visibleRange)?.isUniform??!1)&&e>=ie?this.approximateScale:this.accurateScale}processData(){super.processData();const{boundSeries:e,direction:t}=this;this.minimumTimeGranularity=ne(e,t,void 0,void 0)}tickFormatParams(e,t,i,s){s??(s=(0,n._cn)(t));const a=(0,n.pm8)(e);return{type:"date",unit:(0,n.u1v)(s),step:(0,n.SBk)(s),epoch:(0,n.Nam)(s),truncateDate:a}}datumFormatParams(e,t,i,s,a){if("number"==typeof e&&(e=new Date(e)),null==s){const{minimumTimeGranularity:t}=this,i=(0,n.DSS)(e);s=null!=t&&(0,n.UQv)(t)<(0,n.UQv)(i)?t:i}const{datum:o,seriesId:r,legendItemName:l,key:h,source:c,property:d,domain:u,boundSeries:p}=t;return{type:"date",value:e,datum:o,seriesId:r,legendItemName:l,key:h,source:c,property:d,domain:u,boundSeries:p,unit:(0,n.u1v)(s),step:(0,n.SBk)(s),epoch:(0,n.Nam)(s),style:a}}};return e.className="OrdinalTimeAxis",e.type="ordinal-time",e})(),ae=(()=>({type:"axis",name:"ordinal-time",chartType:"cartesian",enterprise:!0,version:s.xv,dependencies:[s.bI,K],options:s.n1.ordinalTimeAxisOptionsDefs,themeTemplate:(0,n.HFk)({groupPaddingInner:0,maxThicknessRatio:.3,label:{autoRotate:!1,minSpacing:40},gridLine:{enabled:!1},interval:{placement:"between"}},s.n1.titleAxisThemeTemplate,s.n1.parentLevelAxisThemeTemplate,s.n1.commonAxisThemeTemplate),create:(e,t,i)=>new se(e,t,i)}))(),{Group:oe,TransformableGroup:re,Path:le,Line:he,Selection:ce,generateTicks:de,getAxisLabelSideFlag:ue,AxisGroupZIndexMap:pe}=s.n1,ge=class extends s.n1.PolarAxis{constructor(e,t,i,s){super(e,t,i,s),this.gridLineGroupSelection=ce.select(this.gridLineGroup,he,!1),this.generatedTicks=void 0,this.headingLabelGroup=this.axisGroup.appendChild(new re({name:`${this.id}-Axis-heading`})),this.lineNodeGroup=this.axisGroup.appendChild(new re({name:`${this.id}-Axis-line`})),this.lineNode=this.lineNodeGroup.appendChild(new he({name:`${this.id}-Axis-line`,zIndex:pe.AxisLine})),this.gridPathGroup=this.gridGroup.appendChild(new oe({name:`${this.id}-gridPaths`,zIndex:n.Dcv.AXIS_GRID})),this.gridPathSelection=ce.select(this.gridPathGroup,le),this.headingLabelGroup.appendChild(this.caption.node),this.cleanup.register(this.caption.registerInteraction(this.moduleCtx,this.id))}get direction(){return n.tv$.Radius}getAxisTransform(){const e=this.scale.range[0],{translation:t,innerRadiusRatio:i}=this,s=e*i,a=(0,n.ehJ)(this.options.positionAngle);return{translationX:t.x,translationY:t.y-e-s,rotation:a,rotationCenterX:0,rotationCenterY:e+s}}
1update(){super.update(),this.updateTitle(),this.updateGridLines();const{enabled:e,stroke:t,width:i}=this.options.line;this.lineNode.setProperties({stroke:t,strokeWidth:e?i:0,x1:0,y1:this.range[0],x2:0,y2:this.range[1]})}updatePosition(){super.updatePosition();const e=this.getAxisTransform();this.tickLineGroup.setProperties(e),this.tickLabelGroup.setProperties(e),this.lineNodeGroup.setProperties(e),this.headingLabelGroup.setProperties(e)}calculateRotations(){return{rotation:0,parallelFlipRotation:0,regularFlipRotation:-Math.PI/2}}calculateTickLayout(e,t,i){const n=ue(this.mirrored),s=this.options.label.spacing,a=n*(this.getTickSize()+s+this.seriesAreaPadding),{range:o,defaultTickMinSpacing:r}=this,{reverse:l}=this.options,h=de({scale:this.scale,label:this.options.label,interval:this.options.interval,tickFormatter:(...e)=>this.tickFormatter(...e),domain:e,range:o,reverse:l,niceMode:t,visibleRange:[0,1],defaultTickMinSpacing:r,labelOffset:a,sideFlag:n,axisRotation:0,sizeLimit:void 0,primaryTickCount:void 0}),{tickData:c}=h,{ticks:d,rawTicks:u,rawTickCount:p,tickDomain:g,fractionDigits:m,niceDomain:y=e}=c,f=d.map((e=>this.getTickLabelProps(e,h)));return this.generatedTicks={ticks:d,labels:f},{ticks:u,tickDomain:g,niceDomain:y,rawTickCount:p,fractionDigits:m,timeInterval:void 0}}updateSelections(){const{generatedTicks:e}=this;if(!e)return;const{ticks:t,labels:i}=e;this.gridLineGroupSelection.update(this.gridLength?t:[]),this.tickLabelGroupSelection.update(i),this.gridPathSelection.update(this.options.gridLine.enabled?this.prepareGridPathTickData(t):[]),this.gridLineGroupSelection.cleanup(),this.tickLabelGroupSelection.cleanup(),this.gridPathSelection.cleanup()}updateLabels(){if(!this.options.label.enabled)return;const e=s.n1.resetAxisLabelSelectionFn();this.tickLabelGroupSelection.each(((t,i)=>{t.fill=i.color,t.text=i.text,t.textBaseline=i.textBaseline,t.textAlign=i.textAlign??"center",t.setFont(i),t.setBoxing(i),t.setProperties(e(t,i))}))}updateGridLines(){const{shape:e,generatedTicks:t}=this,{style:i,width:s}=this.options.gridLine;if(!i||!t)return;const a=i.length,[o,r]=this.gridRange??[0,2*Math.PI],l=(0,n.YXt)(r-o,2*Math.PI),h="circle"===e?(e,t)=>{const{path:i}=e;i.clear(!0);const s=this.getTickRadius(t);l?(i.moveTo(s,0),i.arc(0,0,s,0,2*Math.PI)):(i.moveTo(s*Math.cos(o),s*Math.sin(o)),i.arc(0,0,s,(0,n.YcT)(o),(0,n.YcT)(r))),l&&i.closePath()}:(e,t)=>{const{path:i}=e,n=this.gridAngles;if(i.clear(!0),!n||n.length<3)return;const s=this.getTickRadius(t);for(const[e,t]of n.entries()){const a=s*Math.cos(t),o=s*Math.sin(t);0===e?i.moveTo(a,o):i.lineTo(a,o);for(const[e,t]of n.entries()){const n=s*Math.cos(t),a=s*Math.sin(t);0===e?i.moveTo(n,a):i.lineTo(n,a)}i.closePath()}i.closePath()};this.gridPathSelection.each(((e,t,n)=>{((e,t)=>{const{stroke:n,lineDash:o}=i[t%a];e.stroke=n,e.strokeWidth=s,e.lineDash=o,e.fill=void 0})(e,n),h(e,t)}))}updateTitle(){const e=e=>e.defaultValue,{caption:t,range:i}=this,n=this.options.title,{formatter:s=e}=n;t.enabled=n.enabled,t.fontFamily=n.fontFamily,t.fontSize=n.fontSize,t.fontStyle=n.fontStyle,t.fontWeight=n.fontWeight,t.color=n.color,t.wrapping=n.wrapping,t.truncate=n.truncate,t.maxWidth=n.maxWidth,t.maxHeight=n.maxHeight;let a=!1;const o=t.node;if(n.enabled){const e=Math.abs(i[1]-i[0]);a=!0,o.rotation=Math.PI/2,o.x=Math.floor((i[0]+i[1])/2),o.y=-n.spacing,o.textAlign="center",o.textBaseline="bottom",o.text=this.cachedCallWithContext(s,this.getTitleFormatterParams(this.scale.domain)),t.text=o.text,t.computeTextWrap(e,1/0)}o.visible=a}computePolarLayout(){const e=this.range[0];return{...this.calculateRotations(),shape:this.shape,axisOuterRadius:e,axisInnerRadius:e*this.innerRadiusRatio,gridAngles:this.gridAngles}}getTickLabelProps(e,t){const i=this.options.label,{rotation:n,textBaseline:s,textAlign:a}=t,o=this.scale.range,r=e.tickLabel??"",l=ue(this.mirrored)*(this.getTickSize()+i.spacing+this.seriesAreaPadding),h=""!==r;return{...this.getLabelStyles({value:e.tick,formattedValue:e.tickLabel}),tickId:e.tickId,rotation:n,text:r,textAlign:a,textBaseline:s,visible:h,x:l,y:e.translation,rotationCenterX:l,rotationCenterY:e.translation,range:o}}},{CategoryScale:me}=s.n1,ye=(()=>{var e=class extends ge{get shape(){return"circle"}constructor(e,t,i){super(e,t,new me,i)}
1updateScale(){super.updateScale(),me.is(this.scale)&&(this.scale.paddingInner=this.options.paddingInner,this.scale.paddingOuter=this.options.paddingOuter)}hasDefinedDomain(){return!1}normaliseDataDomain(e){return{domain:e.domain,clipped:!1}}prepareGridPathTickData(e){return e.slice().reverse()}getTickRadius(e){const{scale:t,innerRadiusRatio:i}=this,n=t.range[0],s=n*i;if(me.is(t)){const i=t.domain,n=i.length-1-i.indexOf(e.tick);return 0===n?s:t.inset+t.step*(n-.5)+t.bandwidth/2}{const i=(n-s)/t.domain.length;return n-e.translation+s-i/2}}tickFormatParams(){return{type:"category"}}datumFormatParams(e,t){const{datum:i,seriesId:n,legendItemName:s,key:a,source:o,property:r,domain:l,boundSeries:h}=t;return{type:"category",value:e,datum:i,seriesId:n,legendItemName:s,key:a,source:o,property:r,domain:l,boundSeries:h}}};return e.className="RadiusCategoryAxis",e.type="radius-category",e})(),fe=(()=>({type:"axis",name:"radius-category",chartType:"polar",enterprise:!0,version:s.xv,dependencies:[s.T9],options:s.n1.radiusCategoryAxisOptionsDefs,themeTemplate:(0,n.HFk)({positionAngle:0,groupPaddingInner:0,paddingInner:0,paddingOuter:0,shape:"circle",line:{enabled:!1},label:{minSpacing:5},title:{spacing:10}},s.n1.titleAxisThemeTemplate,s.n1.commonAxisThemeTemplate),create:(e,t,i)=>new ye(e,t,i)}))(),{LinearScale:xe}=s.n1,be=(()=>{var e=class extends ge{constructor(e,t,i){super(e,t,new xe,i)}hasDefinedDomain(){const{min:e,max:t}=this.options;return null!=e&&null!=t&&e<t}getLabelFormat(){return this.options.label.format}prepareGridPathTickData(e){const{scale:t}=this;if(0===t.domain.length)return e;const i=(0,n.Roz)(t.domain[1]);return e.filter((({tick:e})=>(0,n.Roz)(e)!==i)).sort(((e,t)=>(0,n.Roz)(t.tick)-(0,n.Roz)(e.tick)))}getTickRadius(e){const{scale:t}=this,i=t.range[0],n=i*this.innerRadiusRatio;return i-e.translation+n}normaliseDataDomain(e){const{min:t,max:i,preferredMin:s,preferredMax:a}=this.options,{extent:o,clipped:r}=(0,n.Myf)(e.domain,t,i,s,a,void 0,e.sortMetadata?.sortOrder);return{domain:o,clipped:r}}getDomainExtentsNice(){return[null==this.options.min&&this.nice,null==this.options.max&&this.nice]}tickFormatParams(e,t,i){return{type:"number",visibleDomain:void 0,fractionDigits:i}}datumFormatParams(e,t,i){const{datum:n,seriesId:s,legendItemName:a,key:o,source:r,property:l,domain:h,boundSeries:c}=t;return{type:"number",value:e,datum:n,seriesId:s,legendItemName:a,key:o,source:r,property:l,domain:h,boundSeries:c,fractionDigits:i,visibleDomain:void 0}}};return e.className="RadiusNumberAxis",e.type="radius-number",e})(),ve=(()=>({type:"axis",name:"radius-number",chartType:"polar",enterprise:!0,version:s.xv,dependencies:[s.T9],options:s.n1.radiusNumberAxisOptionsDefs,themeTemplate:(0,n.HFk)({positionAngle:0,line:{enabled:!1},shape:{$findFirstSiblingNotOperation:["polygon"]},label:{minSpacing:5},title:{spacing:10}},s.n1.titleAxisThemeTemplate,s.n1.commonAxisThemeTemplate),create:(e,t,i)=>new be(e,t,i)}))(),{getCrossLineValue:Se,validateCrossLineValue:Me,BandScale:ke,ContinuousScale:De,Group:we,LabelStyle:Ie,Path:Ae,RotatableText:Ce,Sector:Ne}=s.n1,Le=(()=>{var e=class extends Ie{constructor(){super(...arguments),this.padding=5,this.positionAngle=void 0}};return l([n.mAP],e.prototype,"enabled",2),l([n.mAP],e.prototype,"padding",2),l([n.mAP],e.prototype,"text",2),l([n.mAP],e.prototype,"parallel",2),l([n.mAP],e.prototype,"overflow",2),l([n.mAP],e.prototype,"positionAngle",2),e})(),Pe=(()=>{var e=class extends n.XPE{constructor(e){super(),this.internalId=(0,n.sX_)(this),this.defaultColorRange=[],this.shape="polygon",this.label=new Le,this.scale=void 0,this.clippedRange=[-1/0,1/0],this.gridLength=0,this.gridPadding=0,this.sideFlag=-1,this.parallelFlipRotation=0,this.regularFlipRotation=0,this.axisInnerRadius=0,this.axisOuterRadius=0,this.ticks=[],this.lineGroup=new we({name:this.internalId}),this.rangeGroup=new we({name:this.internalId}),this.labelGroup=new we({name:this.internalId}),this.polygonNode=new Ae,this.sectorNode=new Ne,this.lineNode=new Ae,this.crossLineRange=new we,this.labelNode=new Ce,this.outerRadius=0,this.innerRadius=0,this._isRange=void 0,this.direction=e,this.crossLineRange.append(this.polygonNode),this.crossLineRange.append(this.sectorNode),e===n.tv$.Angle&&this.crossLineRange.append(this.lineNode),this.labelGroup.append(this.labelNode)}
1applyPolarLayout(e){this.shape=e.shape,this.axisOuterRadius=e.axisOuterRadius,this.axisInnerRadius=e.axisInnerRadius,this.ticks=e.ticks??[],this.gridAngles=e.gridAngles}update(e){this.direction===n.tv$.Angle?this.updateAngle(e):this.updateRadius(e)}updateAngle(e){const{scale:t}=this;if(!t||!Me(this,t)||!this.angleVisibilityCheck())return this.rangeGroup.visible=!1,this.lineGroup.visible=!1,void(this.labelGroup.visible=!1);this.rangeGroup.visible=e,this.lineGroup.visible=e,this.labelGroup.visible=e,this.updateAngleLineNode(e),this.updateAnglePolygonNode(e),this.updateAngleSectorNode(e),this.updateAngleLabelNode(e)}angleVisibilityCheck(){if(!De.is(this.scale))return!0;const[e,t]=this.scale.domain,i=Se(this);if("range"===this.type){const[n,s]=i;return n>=e&&n<=t&&s>=n&&s<=t}return i>=e&&i<=t}updateAngleLineNode(e){const{scale:t,type:i,value:n,lineNode:s}=this;if(!e||"line"!==i||!t)return void(s.visible=!1);const a=t.convert(n);if(Number.isNaN(a))return void(s.visible=!1);const{axisInnerRadius:o,axisOuterRadius:r}=this;s.visible=!0,s.stroke=this.stroke,s.strokeOpacity=this.strokeOpacity??1,s.strokeWidth=this.strokeWidth??1,s.fill=void 0,s.lineDash=this.lineDash;const l=r*Math.cos(a),h=r*Math.sin(a),c=o*Math.cos(a),d=o*Math.sin(a);s.path.clear(!0),s.path.moveTo(c,d),s.path.lineTo(l,h),this.assignCrossLineGroup(!1,this.crossLineRange)}updateAnglePolygonNode(e){const{polygonNode:t,range:i,scale:n,shape:s,type:a,ticks:o}=this;if(!e||"range"!==a||"polygon"!==s||!n||!i)return void(t.visible=!1);const{axisInnerRadius:r,axisOuterRadius:l}=this,h=o.indexOf(i[0]),c=o.indexOf(i[1]),d=(h<=c?o.slice(h,c+1):o.slice(h).concat(o.slice(0,c+1))).map((e=>n.convert(e)));t.visible=!0,this.setSectorNodeProps(t);const{path:u}=t;u.clear(!0);for(const[e,t]of d.entries()){const i=l*Math.cos(t),n=l*Math.sin(t);0===e?u.moveTo(i,n):u.lineTo(i,n)}if(0===r)u.lineTo(0,0);else{const e=d.slice().reverse();for(const t of e){const e=r*Math.cos(t),i=r*Math.sin(t);u.lineTo(e,i)}}t.path.closePath(),this.assignCrossLineGroup(!0,this.crossLineRange)}updateAngleSectorNode(e){const{sectorNode:t,range:i,scale:n,shape:s,type:a}=this;if(!e||"range"!==a||"circle"!==s||!n||!i)return void(t.visible=!1);const{axisInnerRadius:o,axisOuterRadius:r}=this,l=i.map((e=>n.convert(e))),h=n.step??0,c=n instanceof ke?h/2:0;t.visible=!0,this.setSectorNodeProps(t),t.centerX=0,t.centerY=0,t.innerRadius=o,t.outerRadius=r,t.startAngle=l[0]-c,t.endAngle=l[1]+c,this.assignCrossLineGroup(!0,this.crossLineRange)}updateAngleLabelNode(e){const{label:t,labelNode:i,range:s,scale:a,type:o,ticks:r}=this;if(!e||!1===t.enabled||!t.text||!a||"range"===o&&!s)return void(i.visible=!1);i.visible=!0;const{axisInnerRadius:l,axisOuterRadius:h}=this;let c,d,u,p;if("line"===o){const e=(0,n.YcT)(a.convert(this.value)),i=1.5*Math.PI,s=(0,n.YXt)(e,i)||e>i||e<Math.PI/2,o=(l+h)/2*Math.cos(e),r=(l+h)/2*Math.sin(e);c=o+t.padding*Math.cos(e+Math.PI/2),d=r+t.padding*Math.sin(e+Math.PI/2),p=s?"top":"bottom",u=s?e:e-Math.PI}else{const[e,i]=s.map((e=>(0,n.YcT)(a.convert(e))));let o=(e+i)/2;e>i&&(o-=Math.PI),o=(0,n.YcT)(o);const l=((0,n.YXt)(o,0)||o>0)&&o<Math.PI;let g;g="circle"===this.shape||r.length<3?h-t.padding:h*Math.cos(Math.PI/r.length)-t.padding,c=g*Math.cos(o),d=g*Math.sin(o),p=l?"bottom":"top",u=l?o-Math.PI/2:o+Math.PI/2}this.setLabelNodeProps(i,c,d,p,u)}updateRadius(e){const{scale:t}=this;if(!t||!Me(this,t))return this.rangeGroup.visible=!1,this.lineGroup.visible=!1,void(this.labelGroup.visible=!1);this.updateRadii();const{innerRadius:i,outerRadius:n}=this;e&&(e=i>=this.axisInnerRadius&&n<=this.axisOuterRadius),this.rangeGroup.visible=e,this.lineGroup.visible=e,this.labelGroup.visible=e,this.updateRadiusPolygonNode(e),this.updateRadiusSectorNode(e),this.updateRadiusLabelNode(e),this.assignCrossLineGroup("range"===this.type,this.crossLineRange)}updateRadii(){const{range:e,scale:t,type:i,axisInnerRadius:n,axisOuterRadius:s}=this;if(!t)return{innerRadius:0,outerRadius:0};const a=e=>s+n-e;let o,r;if("line"===i){const e=Math.abs(t.bandwidth??0);o=a(t.convert(this.value))+e/2,r=o}else{const i=Math.abs(t?.bandwidth??0),n=e.map((e=>t.convert(e)));o=a(Math.max(...n)),r=a(Math.min(...n))+i}this.outerRadius=o,this.innerRadius=r}drawRadiusPolygon(e,t,i){for(const[n,s]of t.entries()){const t=e*Math.cos(s),a=e*Math.sin(s);0===n?i.path.moveTo(t,a):i.path.lineTo(t,a)}i.path.closePath()}updateRadiusPolygonNode(e){const{gridAngles:t,polygonNode:i,scale:n,shape:s,type:a,innerRadius:o,outerRadius:r}=this;if(!e||"polygon"!==s||!n||!t)return void(i.visible=!1);i.visible=!0;const l=this.getRadiusPadding();
1i.path.clear(!0),this.drawRadiusPolygon(r-l,t,i);const h=t.slice().reverse(),c="line"===a?r-l:o+l;this.drawRadiusPolygon(c,h,i),this.setSectorNodeProps(i)}updateRadiusSectorNode(e){const{axisInnerRadius:t,axisOuterRadius:i,scale:s,sectorNode:a,shape:o,innerRadius:r,outerRadius:l,type:h}=this;if(e&&"circle"===o&&s){if(a.visible=!0,a.startAngle=0,a.endAngle=2*Math.PI,"line"===h){const e=(0,n.qE8)(t,l,i);a.innerRadius=e,a.outerRadius=e}else{const e=this.getRadiusPadding(),s=(0,n.qE8)(t,r+e,i),o=(0,n.qE8)(t,l-e,i);a.innerRadius=Math.min(s,o),a.outerRadius=Math.max(s,o)}this.setSectorNodeProps(a)}else a.visible=!1}updateRadiusLabelNode(e){const{innerRadius:t,label:i,labelNode:s,scale:a,shape:o,type:r}=this;if(!e||!1===i.enabled||!i.text||!a)return void(s.visible=!1);const l=(0,n.JJe)((i.positionAngle??0)-90),h=((0,n.YXt)(l,0)||l>0)&&l<Math.PI,c=h?l-Math.PI/2:l+Math.PI/2;let d;const u=this.gridAngles??[];d="line"===r?t+i.padding:"circle"===o||u.length<3?t-i.padding:t*Math.cos(Math.PI/u.length)-i.padding;const p=d*Math.cos(l),g=d*Math.sin(l);let m;m="line"===r?h?"top":"bottom":h?"bottom":"top",this.setLabelNodeProps(s,p,g,m,c)}getRadiusPadding(){const{scale:e}=this;if(!e)return 0;const t=Math.abs(e.bandwidth??0),i=Math.abs(e.step??0);return e instanceof ke?(i-t)/2:0}assignCrossLineGroup(e,t){e!==this._isRange&&(e?this.rangeGroup.appendChild(t):this.lineGroup.appendChild(t)),this._isRange=e}setSectorNodeProps(e){e.fill="range"===this.type?this.fill:void 0,e.fillOpacity=this.fillOpacity??1,e.stroke=this.stroke,e.strokeOpacity=this.strokeOpacity??1,e.strokeWidth=this.strokeWidth??1,e.lineDash=this.lineDash}setLabelNodeProps(e,t,i,n,s){const{label:a}=this;e.x=t,e.y=i,e.text=a.text,e.textAlign="center",e.textBaseline=n,e.rotation=s,e.rotationCenterX=t,e.rotationCenterY=i,e.fill=a.color,e.setFont(a),e.setBoxing(a),e.visible=!0}};return e.className="PolarCrossLine",l([n.mAP],e.prototype,"id",2),l([n.mAP],e.prototype,"enabled",2),l([n.mAP],e.prototype,"type",2),l([n.mAP],e.prototype,"range",2),l([n.mAP],e.prototype,"value",2),l([n.mAP],e.prototype,"defaultColorRange",2),l([n.mAP],e.prototype,"fill",2),l([n.mAP],e.prototype,"fillOpacity",2),l([n.mAP],e.prototype,"stroke",2),l([n.mAP],e.prototype,"strokeWidth",2),l([n.mAP],e.prototype,"strokeOpacity",2),l([n.mAP],e.prototype,"lineDash",2),l([n.mAP],e.prototype,"shape",2),l([n.mAP],e.prototype,"label",2),l([n.mAP],e.prototype,"listeners",2),e})(),Te={...s.wO,name:"polarCrossLines",optionsKey:"crossLines",chartType:"polar",axisTypes:["angle-category","angle-number","radius-category","radius-number"],enterprise:!0,register:e=>{e.factory("crossLine",(e=>{const{axisType:t}=e.parent;return t.startsWith("angle-")?new Pe(n.tv$.Angle):new Pe(n.tv$.Radius)}))}},Oe=class extends n.UbG{constructor(e){super(),e.animationManager.skip(!1),this.cleanup.register((()=>e.animationManager.skip(!0)),e.chartState.observe((t=>{e.animationManager.skip(!1===t("options","animation.enabled"))})),e.chartState.observe((t=>{const i=t("options","animation.duration");null!=i&&(e.animationManager.defaultDuration=i)})),e.chartState.observe((t=>{e.animationManager.maxAnimatableItems=t("options","animation.maxAnimatableItems")??1/0})))}},Re=(()=>{var e={type:"plugin",name:"animation",enterprise:!0,version:s.xv,options:{enabled:n.zMY,duration:n.LyW},themeTemplate:{enabled:{$if:[{$path:["../flashOnUpdate/enabled",!1]},!1,!0]}},create:e=>new Oe(e)};return e.options.maxAnimatableItems=(0,n._Le)(n.LyW),e})(),Ee=(()=>{var e=class e extends n.UbG{constructor(e){super(),this.ctx=e,this.activeSections=new Set,this.sectionButtons={annotations:[],chartToolbar:[]},this.container=this.ctx.domManager.addChild("canvas-overlay","shared-toolbar"),this.container.role="presentation",this.cleanup.register(e.eventsHub.on("font:load",(()=>this.invalidateWidthCache())),e.eventsHub.on("theme:params-change",(()=>this.invalidateWidthCache())))}getSharedToolbar(e){return this.sharedToolbar||this.createSharedToolbar(),"chartToolbar"===e&&this.sharedToolbar&&this.sharedToolbar.setAriaLabelId("ariaLabelFinancialCharts"),this.toolbarWithSection(e)}
1createSharedToolbar(){this.sharedToolbar=new s.n1.Toolbar(this.ctx,"ariaLabelAnnotationsToolbar","vertical"),this.sharedToolbar.addClass("ag-charts-shared-toolbar"),this.container.append(this.sharedToolbar.getElement()),this.cleanup.register((()=>{this.sharedToolbar&&(this.sharedToolbar.getElement().remove(),this.sharedToolbar.destroy(),this.sharedToolbar=void 0)}))}toolbarWithSection(t){const i=this.sharedToolbar,n={layout:(e,n=0)=>{if(null!=this.firstLayoutSection&&this.firstLayoutSection!==t&&this.activeSections.has(this.firstLayoutSection))return;this.firstLayoutSection=t;const s=this.measureWidth(i),{isRtl:a}=this.ctx.domManager;i.setBounds({x:a?e.x+e.width-s:e.x,y:e.y,width:s}),e.shrink(s+i.horizontalSpacing+n,a?"right":"left")},addToolbarListener:(e,n)=>i.addToolbarListener(e,(e=>{const i=this.getSectionIndex(t,e.button.index);if(i<0)return;const s={...e,button:this.sectionButtons[t][i]};n(s)})),updateButtons:n=>{this.sectionButtons[t]=n;const s=e.SECTION_ORDER.flatMap((e=>this.sectionButtons[e]));i.updateButtons(s)},updateButtonByIndex:(e,n)=>{i.updateButtonByIndex(this.getIndex(t,e),n)},toggleActiveButtonByIndex:e=>{i.toggleActiveButtonByIndex(this.getIndex(t,e))},toggleButtonEnabledByIndex:(e,n)=>{i.toggleButtonEnabledByIndex(this.getIndex(t,e),n)},setHidden:n=>{n?this.activeSections.delete(t):this.activeSections.add(t);let s=0;for(const a of e.SECTION_ORDER)if(a===t)for(const e of this.sectionButtons[t].keys())i.setButtonHiddenByIndex(s+e,n);else s+=this.sectionButtons[a].length},destroy:()=>{n.setHidden(!0),0===this.activeSections.size&&this.destroy()},clearActiveButton:i.clearActiveButton.bind(i),addListener:i.addListener.bind(i),removeListener:i.removeListener.bind(i)};return n.setHidden(!1),n}invalidateWidthCache(){this.cachedWidth=void 0}measureWidth(e){const t=this.widthSignature();if(void 0!==this.cachedWidth&&this.cachedWidthSignature===t)return this.cachedWidth;const i=e.getBounds().width;return 0===i||(this.cachedWidth=i,this.cachedWidthSignature=t),i}widthSignature(){return e.SECTION_ORDER.map((e=>`${e}:${this.activeSections.has(e)?"1":"0"}:${this.sectionButtons[e].map((e=>`${e.label??""}~${e.icon??""}~${e.iconPosition??""}`)).join(",")}`)).join("|")}getIndex(t,i){let n=0;for(const s of e.SECTION_ORDER){if(s===t)return n+i;n+=this.sectionButtons[s].length}return-1}getSectionIndex(t,i){let n=0;for(const s of e.SECTION_ORDER){if(s===t)return i>=n+this.sectionButtons[t].length?-1:i-n;n+=this.sectionButtons[s].length}return-1}};return e.SECTION_ORDER=["chartToolbar","annotations"],e})(),ze="text-input",Be="canvas-overlay",Fe=class{constructor(e){this.ctx=e,this.cleanup=new n._uV,this.layout={getTextInputCoords:()=>({x:0,y:0}),getTextPosition:()=>"center",alignment:"center",textAlign:"center"},this.visible=!1,this.element=e.domManager.addChild(Be,ze),this.element.classList.add("ag-charts-text-input"),this.cleanup.register((()=>e.domManager.removeChild(Be,ze)))}setKeyDownHandler(e){this.cleanup.register((0,n.yE)(this.element,"keydown",e))}show(e){this.element.innerHTML='<div contenteditable="plaintext-only" class="ag-charts-text-input__textarea" tabindex="0"></div>';const t=this.element.firstElementChild;(0,n.Wpy)(t,{role:"textbox","data-preventdefault":!1}),t.setAttribute("placeholder",this.ctx.localeManager.t(e.placeholderText??"inputTextareaPlaceholder")),e.styles?.placeholderColor&&t.style.setProperty("--placeholder-text-color",e.styles?.placeholderColor),t.innerText=e.text??"",t.style.color=e.styles?.color??"inherit",t.style.fontFamily=e.styles?.fontFamily??"inherit",t.style.fontSize=e.styles?.fontSize?`${e.styles.fontSize}px`:"inherit",t.style.fontStyle=e.styles?.fontStyle??"inherit",t.style.fontWeight="number"==typeof e.styles?.fontWeight?`${e.styles.fontWeight}`:e.styles?.fontWeight??"inherit",(0,n.VED)(t),t.addEventListener("input",(()=>{this.updatePosition(),e.onChange?.(this.getValue(),this.getBBox())})),e.layout&&(this.layout=e.layout,this.updatePosition()),e.onChange?.(this.getValue(),this.getBBox()),this.visible=!0}hide(){this.element.innerHTML="",this.layout={getTextInputCoords:()=>({x:0,y:0}),getTextPosition:()=>"center",alignment:"center",textAlign:"center"},this.visible=!1}isVisible(){return this.visible}updateColor(e){this.element.firstElementChild&&(this.element.firstElementChild.style.color=e)}updateFontSize(e){if(this.element.firstElementChild)return this.element.firstElementChild.style.fontSize=`${e}px`,this.updatePosition(),this.getBBox()}getValue(){if(this.element.firstElementChild)return this.element.firstElementChild.innerText.trim()}updatePosition(){const{element:e}=this,t=e.firstElementChild;if(!t)return;const i=this.ctx.domManager.getBoundingClientRect(),{width:n,getTextInputCoords:s,getTextPosition:a,alignment:o,textAlign:r}=this.layout;e.style.setProperty("width",n?`${n}px`:"unset");
1const l=t.getBoundingClientRect(),h=s(l.height);let c=h.x;"center"===o?c-=(n??l.width)/2:"right"===o&&(c-=n??l.width);const d=a();let u=h.y;"center"===d?u-=l.height/2:"bottom"===d&&(u-=l.height),e.style.setProperty("top",`${u}px`),e.style.setProperty("left",`${c}px`),e.style.setProperty("max-width",i.width-c+"px"),e.style.setProperty("text-align",o),t.style.setProperty("text-align",r)}getBBox(){const{left:e,top:t,width:i,height:a}=this.element.getBoundingClientRect();return new s.n1.BBox(e,t,(0,n.nHZ)(i,2),a)}destroy(){this.cleanup.flush()}},Ve=(()=>{var e=class extends n.XPE{constructor(){super(...arguments),this.enabled=!1,this.axes="y"}};return l([n.mAP],e.prototype,"enabled",2),l([n.mAP],e.prototype,"axes",2),e})(),$e=(e=>(e.Line="line",e.HorizontalLine="horizontal-line",e.VerticalLine="vertical-line",e.DisjointChannel="disjoint-channel",e.ParallelChannel="parallel-channel",e.FibonacciRetracement="fibonacci-retracement",e.FibonacciRetracementTrendBased="fibonacci-retracement-trend-based",e.Callout="callout",e.Comment="comment",e.Note="note",e.Text="text",e.Arrow="arrow",e.ArrowUp="arrow-up",e.ArrowDown="arrow-down",e.DateRange="date-range",e.PriceRange="price-range",e.DatePriceRange="date-price-range",e.QuickDatePriceRange="quick-date-price-range",e))($e||{}),He=Object.values($e);var je=(()=>{var e=class extends n.XPE{};return l([n.mAP],e.prototype,"x",2),l([n.mAP],e.prototype,"y",2),e})(),We=(()=>class extends(lt(ht(ot(n.XPE)))){})(),_e=(()=>{var e=class extends(lt(ht(rt(ct(n.XPE))))){constructor(){super(...arguments),this.cornerRadius=2,this.textAlign="center",this.formatter=void 0,this.padding=void 0}};return l([n.mAP],e.prototype,"enabled",2),l([n.mAP],e.prototype,"cornerRadius",2),l([n.mAP],e.prototype,"textAlign",2),l([n.mAP],e.prototype,"formatter",2),l([n.mAP],e.prototype,"padding",2),e})(),Ge=(()=>class extends(rt(n.XPE)){})(),Ke=(()=>class extends(lt(ht(rt(n.XPE)))){})(),Ye=(()=>{var e=class extends(ct(n.XPE)){constructor(){super(...arguments),this.label="",this.position="top",this.alignment="left"}};return l([n.mAP],e.prototype,"label",2),l([n.mAP],e.prototype,"position",2),l([n.mAP],e.prototype,"alignment",2),e})(),Ue=(()=>class extends(ct(n.XPE)){})(),Xe=(()=>{var e=class extends(ct(n.XPE)){constructor(){super(...arguments),this.label=""}}
1;return l([n.mAP],e.prototype,"label",2),l([n.mAP],e.prototype,"position",2),l([n.mAP],e.prototype,"alignment",2),e})();function Ze(e){class t extends(function(e){class t extends e{isWriteable(){return!this.locked&&!this.readOnly}isHoverable(){return!this.readOnly}}return l([n.mAP],t.prototype,"locked",2),l([n.mAP],t.prototype,"readOnly",2),t}(ot(e))){constructor(){super(...arguments),this.id=(0,n.lkB)()}}return t}function qe(e){class t extends e{constructor(){super(...arguments),this.start=new je,this.end=new je}}return l([n.mAP],t.prototype,"start",2),l([n.mAP],t.prototype,"end",2),t}function Qe(e){class t extends e{}return l([n.mAP],t.prototype,"x",2),l([n.mAP],t.prototype,"y",2),t}function Je(e){class t extends e{}return l([n.mAP],t.prototype,"value",2),t}function et(e){class t extends e{constructor(){super(...arguments),this.background=new Ge}}return l([n.mAP],t.prototype,"background",2),t}function tt(e){class t extends e{constructor(){super(...arguments),this.handle=new Ke}}return l([n.mAP],t.prototype,"handle",2),t}function it(e){class t extends e{constructor(){super(...arguments),this.axisLabel=new _e}}return l([n.mAP],t.prototype,"axisLabel",2),t}function nt(e){class t extends e{constructor(){super(...arguments),this.padding=void 0,this.textAlign="center",this.formatter=void 0}}return l([n.mAP],t.prototype,"padding",2),l([n.mAP],t.prototype,"textAlign",2),l([n.mAP],t.prototype,"formatter",2),t}function st(e){class t extends e{}return l([n.mAP],t.prototype,"extendStart",2),l([n.mAP],t.prototype,"extendEnd",2),t}function at(e){return class extends e{setLocaleManager(e){this.localeManager??(this.localeManager=e)}}}function ot(e){class t extends e{}return l([n.mAP],t.prototype,"visible",2),t}function rt(e){class t extends e{}return l([n.mAP],t.prototype,"fill",2),l([n.mAP],t.prototype,"fillOpacity",2),t}function lt(e){class t extends e{}return l([n.mAP],t.prototype,"stroke",2),l([n.mAP],t.prototype,"strokeOpacity",2),l([n.mAP],t.prototype,"strokeWidth",2),t}function ht(e){class t extends e{constructor(){super(...arguments),this.lineCap=void 0,this.computedLineDash=void 0}}return l([n.mAP],t.prototype,"lineDash",2),l([n.mAP],t.prototype,"lineDashOffset",2),l([n.mAP],t.prototype,"lineStyle",2),t}function ct(e){class t extends e{constructor(){super(...arguments),this.fontSize=n.SG9.SMALL,this.fontFamily='"IBM Plex Sans", -apple-system, "system-ui", "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif'}}return l([n.mAP],t.prototype,"fontStyle",2),l([n.mAP],t.prototype,"fontWeight",2),l([n.mAP],t.prototype,"fontSize",2),l([n.mAP],t.prototype,"fontFamily",2),l([n.mAP],t.prototype,"color",2),t}function dt(e){return(0,n.zZm)(e)||(0,n.KgX)(e)||(0,n.$PY)(e)?{value:e,groupPercentage:0}:e??{value:void 0,groupPercentage:0}}function ut(e){return dt(e)?.value}function pt(e,t){if(null==e.start||null==e.end)return;const i=gt(e.start,t),n=gt(e.end,t);return null!=i&&null!=n?{x1:i.x,y1:i.y,x2:n.x,y2:n.y}:void 0}function gt(e,t){return{x:mt(e.x,t.xAxis),y:mt(e.y,t.yAxis)}}function mt(e,t){if(null==e)return 0;const{value:i,groupPercentage:n}=dt(e),{scale:s,snapToGroup:a}=t,o=0===s.bandwidth?s.step??0:s.bandwidth??0,r=a?o/2:o*n;return s.convert(i)+r}function yt(e,t){return{x:ft(e.x,t.xAxis),y:ft(e.y,t.yAxis)}}function ft(e,t){const{scale:i}=t;if(t.continuous&&null==i.step)return t.scaleInvert(e);const n=t.scaleInvert(e),s=0===i.bandwidth?i.step:i.bandwidth??0,a=i.convert(n),o=a+s;return{value:n,groupPercentage:a===o?0:(e-a)/(o-a)}}var xt=(()=>class extends(Ze(qe(tt(n.XPE)))){constructor(){super(...arguments),this.snapToAngle=45}getDefaultColor(e){}getDefaultOpacity(e){}})(),bt=(()=>{var e=class extends(at(nt(ct(xt)))){constructor(){super(...arguments),this.text="",this.position="top",this.alignment="left",this.placement="inside",this.placeholderText="inputTextareaPlaceholder"}getDefaultColor(e){return this.color}getDefaultOpacity(e){}getPlaceholderColor(){}getPadding(){const{padding:e=0}=this;return{top:e,right:e,bottom:e,left:e}}getText(){const e=0==this.text.length;let t=this.text;return e&&(t=this.placeholderText??"",this.localeManager&&(t=this.localeManager.t(t))),{text:t,isPlaceholder:e}}getTextInputCoords(e,t){return gt(this.end,e)}getTextPosition(){return this.position}};return l([n.mAP],e.prototype,"text",2),e})(),vt={top:6,right:12,bottom:9,left:12},St=(()=>{var e=class extends(rt(lt(bt))){constructor(){super(...arguments),this.type="callout",this.position="bottom",this.alignment="left"}static is(e){return(0,n.Gvm)(e)&&"callout"===e.type}getDefaultColor(e){switch(e){case"fill-color":return this.fill;case"line-color":return this.stroke;default:return this.color}}getDefaultOpacity(e){switch(e){case"fill-color":return this.fillOpacity;case"line-color":return this.strokeOpacity;default:return}}getPlaceholderColor(){const{r:e,g:t,b:i}=n.Q1f.fromString(this.color??"#888888");return new n.Q1f(e,t,i,.66).toString()}getPadding(){const{padding:e}=this;return null==e?{...vt}:{top:e,right:e,bottom:e,left:e}}getTextInputCoords(e,t){const i=super.getTextInputCoords(e,t),n=this.getPadding(),s=n.left??0,a=n.bottom??0;return{x:i.x+s,y:i.y-a}}};return l([n.mAP],e.prototype,"type",2),e})(),Mt=(()=>{var e=class extends(Ze(Qe(tt(nt(ct(n.XPE)))))){constructor(){super(...arguments),this.text="",this.position="top",this.alignment="left",this.placement="inside",this.placeholderText="inputTextareaPlaceholder"}getDefaultColor(e){return this.color}getDefaultOpacity(e){}getPlaceholderColor(){}getPadding(){const{padding:e=0}=this;return{top:e,right:e,bottom:e,left:e}}getText(){const e=0==this.text.length;return{text:e?this.placeholderText??"":this.text,isPlaceholder:e}}getTextInputCoords(e,t){return gt(this,e)}getTextPosition(){return this.position}};return l([n.mAP],e.prototype,"text",2),e})(),kt=8,Dt=14,wt=8,It=14,At=(()=>{var e=class extends(rt(lt(Mt))){constructor(){super(...arguments),this.type="comment",this.position="bottom",this.alignment="left"}static is(e){return(0,n.Gvm)(e)&&"comment"===e.type}getDefaultColor(e){switch(e){case"fill-color":return this.fill;case"line-color":return this.stroke;default:return this.color}}getDefaultOpacity(e){switch(e){case"fill-color":return this.fillOpacity;case"line-color":return this.strokeOpacity;default:return}}getPlaceholderColor(){const{r:e,g:t,b:i}=n.Q1f.fromString(this.color??"#888888");return new n.Q1f(e,t,i,.66).toString()}getPadding(){const{padding:e,fontSize:t}=this;return null==e?{top:Math.max(.4*t,kt),bottom:Math.max(.4*t,wt),left:Math.max(.8*t,It),right:Math.max(.8*t,Dt)}:{top:e,right:e,bottom:e,left:e}}getTextInputCoords(e,t){const i=super.getTextInputCoords(e,t),n=this.getPadding();return{x:i.x+n.left,y:i.y-n.bottom}}};return l([n.mAP],e.prototype,"type",2),e})();
1function Ct(e,t){return e?"dashed":t??"solid"}function Nt(e,t){switch(t){case"solid":return[];case"dashed":return[4*e,2*e];case"dotted":return[0,2*e]}}function Lt(e,t,i,n){const s=Ct(e,i);return t??e??Nt(n??1,s)}function Pt(e,t,i){const n=Ct(t,i);return e??"dotted"===n?"round":void 0}var Tt=(()=>class extends(lt(n.XPE)){})(),Ot=(()=>{var e=class extends(ct(rt(lt(n.XPE)))){constructor(){super(...arguments),this.divider=new Tt}};return l([n.mAP],e.prototype,"divider",2),e})(),Rt=(()=>{var e=class extends(rt(lt(tt(n.XPE)))){constructor(){super(...arguments),this.statistics=new Ot}};return l([n.mAP],e.prototype,"statistics",2),e})(),Et=(()=>{var e=class extends(at(et(lt(ht(xt))))){constructor(){super(...arguments),this.direction="both",this.hasDateRange=!1,this.hasPriceRange=!1,this.statistics=new Ot,this.getVolume=()=>{},this.text=new Ye}getDefaultColor(e){switch(e){case"fill-color":return this.background.fill;case"line-color":return this.stroke;case"text-color":return this.text.color}}getDefaultOpacity(e){switch(e){case"fill-color":return this.background.fillOpacity;case"line-color":return this.strokeOpacity}}getLineDash(){return Lt(this.lineDash,this.computedLineDash,this.lineStyle,this.strokeWidth)}getLineCap(){return Pt(this.lineCap,this.lineDash,this.lineStyle)}};return l([n.mAP],e.prototype,"statistics",2),l([n.mAP],e.prototype,"text",2),e})();function zt(e){return class extends e{constructor(){super(...arguments),this.hasDateRange=!0}}}function Bt(e){return class extends e{constructor(){super(...arguments),this.hasPriceRange=!0}}}var Ft=(()=>{var e=class extends(zt(Et)){constructor(){super(...arguments),this.type="date-range",this.direction="horizontal"}static is(e){return(0,n.Gvm)(e)&&"date-range"===e.type}};return l([n.mAP],e.prototype,"type",2),l([n.mAP],e.prototype,"extendAbove",2),l([n.mAP],e.prototype,"extendBelow",2),e})(),Vt=(()=>{var e=class extends(Bt(Et)){constructor(){super(...arguments),this.type="price-range",this.direction="vertical"}static is(e){return(0,n.Gvm)(e)&&"price-range"===e.type}};return l([n.mAP],e.prototype,"type",2),l([n.mAP],e.prototype,"extendLeft",2),l([n.mAP],e.prototype,"extendRight",2),e})(),$t=(()=>{var e=class extends(zt(Bt(Et))){constructor(){super(...arguments),this.type="date-price-range",this.direction="both"}static is(e){return(0,n.Gvm)(e)&&"date-price-range"===e.type}};return l([n.mAP],e.prototype,"type",2),e})(),Ht=(()=>{var e=class extends(zt(Bt(Et))){constructor(){super(...arguments),this.type="quick-date-price-range",this.up=new Rt,this.down=new Rt,this.direction="both"}static is(e){return(0,n.Gvm)(e)&&"quick-date-price-range"===e.type}};return l([n.mAP],e.prototype,"type",2),l([n.mAP],e.prototype,"up",2),l([n.mAP],e.prototype,"down",2),e})(),{BBox:jt}=s.n1,Wt=1.38;function _t(e,t,i){return i?(0,n.C1g)(t,{maxWidth:i,font:e,textWrap:"always",avoidOrphans:!1}):t}function Gt(e,t,i,s){let a=s?.width??0,o=s?.height??0;if(!s){const i=null==e.width?t:_t(e,t,e.width);({width:a,height:o}=function(e,t){const{lineMetrics:i,width:s}=(0,n.K$y)(e).measureLines(t);return{width:s,height:i.length*(0,n.VKS)(e.fontSize,Wt)}}(e,i))}return new jt(i.x,i.y,a,o)}function Kt(e,t,i,s,{x:a,y:o},r){const{visible:l=!0,fontFamily:h,fontSize:c=14,fontStyle:d,fontWeight:u,textAlign:p}=s,g=(0,n.VKS)(c,Wt);r??(r="center"==s.position?"middle":s.position);const m=i?s.getPlaceholderColor():s.color;e.setProperties({x:a,y:o,visible:l,text:t,fill:m,fontFamily:h,fontSize:c,fontStyle:d,fontWeight:u,textAlign:p,lineHeight:g,textBaseline:r})}var Yt=(()=>class extends(rt(lt(n.XPE))){})(),Ut=(()=>{var e=class extends(rt(lt(Mt))){constructor(){super(...arguments),this.type="note",this.background=new Yt,this.position="bottom",this.alignment="center",this.width=200}static is(e){return(0,n.Gvm)(e)&&"note"===e.type}getDefaultColor(e){switch(e){case"line-color":return this.fill;case"text-color":return this.color}}getDefaultOpacity(e){switch(e){case"line-color":return this.fillOpacity;case"text-color":return}}getPadding(){const e=this.padding??10;return{top:e,right:e,bottom:e,left:e}}getTextInputCoords(e,t){const{width:i,text:s}=this,a=super.getTextInputCoords(e,t),o=this.getPadding().top,r=Gt(this,s,a);r.x=(0,n.qE8)(i/2,r.x,e.seriesRect.width-i/2);const l=r.y-30-2*o,h=r.y+11+2*o;return l-Math.max(r.height,t)-34<0?(r.y=h,this.position="top"):(r.y=l+o,this.position="bottom"),{x:r.x,y:r.y}}isHoverable(){return!0}};return l([n.mAP],e.prototype,"type",2),l([n.mAP],e.prototype,"background",2),e})(),Xt=(()=>class extends(Ze(Qe(tt(n.XPE)))){getDefaultColor(e){}getDefaultOpacity(e){}})(),Zt=(()=>class e extends(rt(Xt)){constructor(){super(...arguments),this.size=32}static is(t){return t instanceof e}getDefaultColor(e){return"fill-color"===e?this.fill:void 0}getDefaultOpacity(e){return"fill-color"===e?this.fillOpacity:void 0}})(),qt=(()=>{var e=class extends(Ze(Je(tt(it(lt(ht(n.XPE))))))){constructor(){super(...arguments),this.direction="horizontal",this.type="horizontal-line",this.text=new Ye}static is(e){return(0,n.Gvm)(e)&&"horizontal-line"===e.type}getDefaultColor(){return this.stroke}getDefaultOpacity(){return this.strokeOpacity}getLineDash(){return Lt(this.lineDash,this.computedLineDash,this.lineStyle,this.strokeWidth)}getLineCap(){return Pt(this.lineCap,this.lineDash,this.lineStyle)}
1};return l([n.mAP],e.prototype,"type",2),l([n.mAP],e.prototype,"text",2),e})(),Qt=(()=>{var e=class extends(Ze(Je(tt(it(lt(ht(n.XPE))))))){constructor(){super(...arguments),this.direction="vertical",this.type="vertical-line",this.text=new Ye}static is(e){return(0,n.Gvm)(e)&&"vertical-line"===e.type}getDefaultColor(){return this.stroke}getDefaultOpacity(){return this.strokeOpacity}getLineDash(){return Lt(this.lineDash,this.computedLineDash,this.lineStyle,this.strokeWidth)}getLineCap(){return Pt(this.lineCap,this.lineDash,this.lineStyle)}};return l([n.mAP],e.prototype,"type",2),l([n.mAP],e.prototype,"text",2),e})(),Jt=(()=>{var e=class extends(Ze(et(qe(tt(st(lt(ht(n.XPE)))))))){constructor(){super(...arguments),this.type="disjoint-channel",this.text=new Xe,this.snapToAngle=45}static is(e){return(0,n.Gvm)(e)&&"disjoint-channel"===e.type}getBottom(e){const t={start:{x:this.start.x,y:this.start.y},end:{x:this.end.x,y:this.end.y}};return(0,n.zZm)(t.start.y)&&(0,n.zZm)(t.end.y)?(t.start.y=(0,n.Vz0)(t.start.y,this.startHeight),t.end.y=(0,n.Vz0)(t.end.y,this.endHeight)):e.warnOnce(`Annotation [${this.type}] can only be used with a numeric y-axis.`),t}getDefaultColor(e){switch(e){case"fill-color":return this.background.fill;case"line-color":return this.stroke;case"text-color":return this.text.color}}getDefaultOpacity(e){switch(e){case"fill-color":return this.background.fillOpacity;case"line-color":return this.strokeOpacity}}getLineDash(){return Lt(this.lineDash,this.computedLineDash,this.lineStyle,this.strokeWidth)}getLineCap(){return Pt(this.lineCap,this.lineDash,this.lineStyle)}};return l([n.mAP],e.prototype,"type",2),l([n.mAP],e.prototype,"startHeight",2),l([n.mAP],e.prototype,"endHeight",2),l([n.mAP],e.prototype,"text",2),e})(),ei=(()=>{var e=class extends(at(function(e){return class extends e{}}(st(lt(ht(xt)))))){constructor(){super(...arguments),this.text=new Ye}getDefaultColor(e){switch(e){case"line-color":return this.stroke;case"text-color":return this.text.color}}getDefaultOpacity(){return this.strokeOpacity}getLineDash(){return Lt(this.lineDash,this.computedLineDash,this.lineStyle,this.strokeWidth)}getLineCap(){return Pt(this.lineCap,this.lineDash,this.lineStyle)}};return l([n.mAP],e.prototype,"text",2),e})(),ti=(()=>{var e=class extends ei{constructor(){super(...arguments),this.type="arrow",this.endCap="arrow"}static is(e){return(0,n.Gvm)(e)&&"arrow"===e.type}};return l([n.mAP],e.prototype,"type",2),e})(),ii=(()=>{var e=class extends ei{constructor(){super(...arguments),this.type="line"}static is(e){return(0,n.Gvm)(e)&&"line"===e.type}};return l([n.mAP],e.prototype,"type",2),e})(),ni=(()=>{var e=class extends ei{constructor(){super(...arguments),this.label=new Ue,this.reverse=!1,this.showFill=!0,this.isMultiColor=!0,this.strokes=[],this.bands=10}getDefaultColor(e){switch(e){case"line-color":return this.rangeStroke??this.stroke;case"text-color":return this.text.color}}};return l([n.mAP],e.prototype,"label",2),l([n.mAP],e.prototype,"reverse",2),l([n.mAP],e.prototype,"showFill",2),l([n.mAP],e.prototype,"isMultiColor",2),l([n.mAP],e.prototype,"strokes",2),l([n.mAP],e.prototype,"rangeStroke",2),l([n.mAP],e.prototype,"bands",2),e})(),si=(()=>{var e=class extends ni{constructor(){super(...arguments),this.type="fibonacci-retracement-trend-based",this.endRetracement=new je}static is(e){return(0,n.Gvm)(e)&&"fibonacci-retracement-trend-based"===e.type}};return l([n.mAP],e.prototype,"type",2),l([n.mAP],e.prototype,"endRetracement",2),e})(),ai=(()=>{var e=class extends ni{constructor(){super(...arguments),this.type="fibonacci-retracement"}static is(e){return(0,n.Gvm)(e)&&"fibonacci-retracement"===e.type}};return l([n.mAP],e.prototype,"type",2),e})(),oi=(()=>{var e=class extends(Ze(et(qe(tt(st(lt(ht(n.XPE)))))))){constructor(){super(...arguments),this.type="parallel-channel",this.middle=new We,this.text=new Xe,this.snapToAngle=45}static is(e){return(0,n.Gvm)(e)&&"parallel-channel"===e.type}getBottom(e){const t={start:{x:this.start.x,y:this.start.y},end:{x:this.end.x,y:this.end.y}};return(0,n.zZm)(t.start.y)&&(0,n.zZm)(t.end.y)?(t.start.y=(0,n.Vz0)(t.start.y,this.height),t.end.y=(0,n.Vz0)(t.end.y,this.height)):e.warnOnce(`Annotation [${this.type}] can only be used with a numeric y-axis.`),t}getDefaultColor(e){switch(e){case"fill-color":return this.background.fill;case"line-color":return this.stroke;case"text-color":return this.text.color}}getDefaultOpacity(e){switch(e){case"fill-color":return this.background.fillOpacity;case"line-color":return this.strokeOpacity}}getLineDash(){return Lt(this.lineDash,this.computedLineDash,this.lineStyle,this.strokeWidth)}getLineCap(){return Pt(this.lineCap,this.lineDash,this.lineStyle)}
1};return l([n.mAP],e.prototype,"type",2),l([n.mAP],e.prototype,"height",2),l([n.mAP],e.prototype,"middle",2),l([n.mAP],e.prototype,"text",2),e})(),ri=(()=>{var e=class extends Mt{constructor(){super(...arguments),this.type="text",this.position="bottom"}static is(e){return(0,n.Gvm)(e)&&"text"===e.type}};return l([n.mAP],e.prototype,"type",2),e})();function li(e){return Ht.is(e)}function hi(e){return ii.is(e)||qt.is(e)||Qt.is(e)||ti.is(e)||di(e)}function ci(e){return Jt.is(e)||oi.is(e)}function di(e){return ai.is(e)||si.is(e)}function ui(e){return St.is(e)||At.is(e)||Ut.is(e)||ri.is(e)}function pi(e){return Ft.is(e)||Vt.is(e)||$t.is(e)||Ht.is(e)}function gi(e){return ui(e)&&!Ut.is(e)}function mi(e){return hi(e)||ci(e)||pi(e)&&!Ht.is(e)}function yi(e){return hi(e)||ci(e)||pi(e)||St.is(e)||Ut.is(e)}function fi(e){return ci(e)||pi(e)||St.is(e)||At.is(e)||Zt.is(e)}function xi(e){return ui(e)&&!Ut.is(e)}function bi(e){return(hi(e)||ci(e)||pi(e))&&!li(e)&&(0,n.Gvm)(e.text)}function vi(e,t){"fontSize"in e&&(e.fontSize=t),bi(e)&&(e.text.fontSize=t)}function Si(e,t){const i=t?.strokeWidth??e.strokeWidth??1,n=t?.type??e.lineStyle,s=n??Ct(e.lineDash,n),a=Nt(i,s);e.strokeWidth=i,e.computedLineDash=a,e.lineStyle=s,e.lineCap="dotted"===s?"round":void 0}function Mi(e,t,i,n,s,a){switch(t){case"fill-color":"fill"in e&&(e.fill=n),"fillOpacity"in e&&(e.fillOpacity=s),"background"in e&&(e.background.fill=n,e.background.fillOpacity=s);break;case"line-color":"axisLabel"in e&&(e.axisLabel.fill=n,e.axisLabel.fillOpacity=s,e.axisLabel.stroke=n,e.axisLabel.strokeOpacity=s),"fill"in e&&"fillOpacity"in e&&function(e){return Ut.is(e)}(e)?(e.fill=n,e.fillOpacity=s):("strokeOpacity"in e&&(e.strokeOpacity=s),"isMultiColor"in e&&"rangeStroke"in e?(e.isMultiColor=a,e.rangeStroke=n):"stroke"in e&&(e.stroke=n));break;case"text-color":"color"in e&&(e.color=i),bi(e)&&(e.text.color=n)}}var ki=class{constructor(){this.mementoOriginatorKey="annotation-defaults",this.colors=new Map(Object.values($e).map((e=>[e,new Map([["line-color",void 0],["fill-color",void 0],["text-color",void 0]])]))),this.fontSizes=new Map([["callout",void 0],["comment",void 0],["text",void 0],["arrow",void 0],["line",void 0],["disjoint-channel",void 0],["parallel-channel",void 0],["date-range",void 0],["price-range",void 0],["date-price-range",void 0]]),this.lineStyles=new Map([["line",void 0],["horizontal-line",void 0],["vertical-line",void 0],["disjoint-channel",void 0],["parallel-channel",void 0],["arrow",void 0],["date-range",void 0],["price-range",void 0],["date-price-range",void 0]]),this.lineTextAlignments=new Map([["line",void 0],["horizontal-line",void 0],["vertical-line",void 0],["disjoint-channel",void 0],["parallel-channel",void 0],["arrow",void 0],["date-range",void 0],["price-range",void 0],["date-price-range",void 0]]),this.lineTextPositions=new Map([["line",void 0],["horizontal-line",void 0],["vertical-line",void 0],["disjoint-channel",void 0],["parallel-channel",void 0],["arrow",void 0],["date-range",void 0],["price-range",void 0],["date-price-range",void 0]]),this.fibonacciOptions=new Map([["fibonacci-retracement",{bands:void 0,reverse:void 0,showFill:void 0}],["fibonacci-retracement-trend-based",{bands:void 0,reverse:void 0,showFill:void 0}]])}createMemento(){return{colors:(0,n.Go6)(this.colors),fontSizes:(0,n.Go6)(this.fontSizes),lineStyles:(0,n.Go6)(this.lineStyles),lineTextAlignments:(0,n.Go6)(this.lineTextAlignments),lineTextPositions:(0,n.Go6)(this.lineTextPositions),fibonacciOptions:(0,n.Go6)(this.fibonacciOptions)}}guardMemento(e){return!0}restoreMemento(e,t,i){this.colors=(0,n.Go6)(i.colors),this.fontSizes=(0,n.Go6)(i.fontSizes),this.lineStyles=(0,n.Go6)(i.lineStyles),this.lineTextAlignments=(0,n.Go6)(i.lineTextAlignments),this.lineTextPositions=(0,n.Go6)(i.lineTextPositions),this.fibonacciOptions=(0,n.Go6)(i.fibonacciOptions)}setDefaultColor(e,t,i,n,s,a){this.colors.get(e)?.set(t,[i,n,s,a])}setDefaultFontSize(e,t){this.fontSizes.set(e,t)}setDefaultLineStyleType(e,t){const i=this.lineStyles.get(e);i?i.type=t:this.lineStyles.set(e,{type:t})}setDefaultLineStyleWidth(e,t){const i=this.lineStyles.get(e);i?i.strokeWidth=t:this.lineStyles.set(e,{strokeWidth:t})}setDefaultLineTextAlignment(e,t){this.lineTextAlignments.set(e,t)}setDefaultLineTextPosition(e,t){this.lineTextPositions.set(e,t)}setDefaultFibonacciOptions(e,t,i){if("fibonacci-retracement"!=e&&"fibonacci-retracement-trend-based"!=e)return;const n=this.fibonacciOptions.get(e);n[t]=i,this.fibonacciOptions.set(e,n)}applyDefaults(e){for(const[t,i]of this.colors)if(e.type===t)for(const[t,[n,s,a,o]=[]]of i)n&&s&&null!=a&&null!=o&&Mi(e,t,n,s,a,o);for(const[t,i]of this.fontSizes)e.type===t&&null!=i&&vi(e,i);for(const[t,i]of this.lineStyles)e.type===t&&null!=i&&Si(e,i);for(const[t,i]of this.lineTextPositions)e.type===t&&null!=i&&(e.text.position=i);for(const[t,i]of this.lineTextAlignments)e.type===t&&null!=i&&(e.text.alignment=i);for(const[t,i]of this.fibonacciOptions)if(e.type===t&&null!=i)for(const t of Object.keys(i)){const n=i[t];null!=n&&e.set({[t]:n})}}},Di=e=>{try{const t=n.Q1f.fromString(e),[i,s,a]=t.toHSB();return[i,s,a,t.a]}catch{return}},wi=class extends s.n1.AnchoredPopover{constructor(e,t){super(e,"color-picker",t),this.hasChanged=!1,this.hideFns.push((()=>{this.i18nUpdater=void 0,this.hasChanged&&this.onChangeHide?.()})),this.cleanup.register(this.ctx.eventsHub.on("locale:change",(()=>this.i18nUpdater?.())))}show(e){this.hasChanged=!1,this.onChangeHide=e.onChangeHide;const{element:t,initialFocus:i}=this.createColorPicker(e),n=this.showWithChildren([t],{initialFocus:i,...e});n.classList.add("ag-charts-color-picker"),n.setAttribute("role","dialog")}createColorPicker(e){const{localeManager:t}=this.ctx;let i=e.isMultiColor??!1,[s,a,o,r]=Di(e.color??"#f00")??[0,1,.5,1];r=e.opacity??r;const l=this.ctx.agDocument,h=l.createElement("div","ag-charts-color-picker__content");h.innerHTML='<div class="ag-charts-color-picker__palette" role="slider" tabindex="0"></div><div class="ag-charts-color-picker__color-row" role="presentation"><button class="ag-charts-color-picker__multi-color-button" tabindex="0" type="button" role="switch"></button> <input class="ag-charts-color-picker__hue-input" tabindex="0" type="range" min="0" max="360" value="
10"></div><input class="ag-charts-color-picker__alpha-input" tabindex="0" type="range" min="0" max="1" value="1" step="0.01"> <label class="ag-charts-color-picker__color-field" role="presentation"><span class="ag-charts-color-picker__color-label" aria-hidden="true"></span> <input class="ag-charts-color-picker__color-input" tabindex="0" value="#000"></label>',h.ariaLabel=this.ctx.localeManager.t("ariaLabelColorPicker");const c=h.querySelector(".ag-charts-color-picker__palette"),d=h.querySelector(".ag-charts-color-picker__hue-input"),u=h.querySelector(".ag-charts-color-picker__multi-color-button"),p=h.querySelector(".ag-charts-color-picker__alpha-input"),g=h.querySelector(".ag-charts-color-picker__color-input"),m=h.querySelector(".ag-charts-color-picker__color-label"),y=e=>{const i={s:"ariaValueColorPalette",v:"ariaValueColorPaletteFirstV"}[e];c.ariaValueText=t.t(i,{s:a,v:o})};this.i18nUpdater=()=>{c.ariaRoleDescription=t.t("ariaRoleDescription2DSlider"),c.ariaLabel=t.t("ariaLabelColorPickerPalette"),d.ariaLabel=t.t("ariaLabelColorPickerHue"),u.ariaLabel=t.t("ariaLabelColorPickerMultiColor"),p.ariaLabel=t.t("ariaLabelColorPickerAlpha"),g.ariaLabel=t.t("ariaLabelColor"),y("s")},this.i18nUpdater(),u.classList.toggle("ag-charts-color-picker__multi-color-button--hidden",!e.hasMultiColorOption);const f=(l=!0)=>{const c=n.Q1f.fromHSB(s,a,o,r).toHexString();if(h.style.setProperty("--h",`${s}`),h.style.setProperty("--s",`${a}`),h.style.setProperty("--v",`${o}`),h.style.setProperty("--a",`${r}`),h.style.setProperty("--color",c.slice(0,7)),h.style.setProperty("--color-a",c),d.value=`${s}`,p.value=`${r}`,p.classList.toggle("ag-charts-color-picker__alpha-input--opaque",1===r),u.classList.toggle("ag-charts-color-picker__multi-color-button--active",i),m.classList.toggle("ag-charts-color-picker__color-label--multi-color",i),document.activeElement!==g&&(u.ariaChecked=i.toString(),g.value=i?t.t("ariaLabelColorPickerMultiColor"):c.toUpperCase()),l||null==e.color){const t=n.Q1f.fromHSB(s,a,o,1).toHexString();e.onChange?.(c,t,r,i)}l&&(this.hasChanged=!0)};f(!1);const x=e=>e.preventDefault();return h.addEventListener("keydown",(e=>{switch(e.key){case"Enter":case"Escape":this.hide();break;default:return}e.preventDefault()})),c.addEventListener("pointerdown",(e=>{const t=e.currentTarget;t.focus();const n=t.getBoundingClientRect(),s=({clientX:e,clientY:t})=>{i=!1,a=Math.min(Math.max((e-n.left)/n.width,0),1),o=1-Math.min(Math.max((t-n.top)/n.height,0),1),f(),y("s")};s(e);const r=l.attachListener("pointermove",s);l.attachListener("pointerup",(()=>r()),{once:!0})})),c.addEventListener("mousedown",x),c.addEventListener("touchstart",x,{passive:!1}),c.addEventListener("touchmove",x,{passive:!1}),c.addEventListener("keydown",(e=>{if("ArrowLeft"===e.key)a=(0,n.qE8)(0,a-.01,1),y("s");else if("ArrowRight"===e.key)a=(0,n.qE8)(0,a+.01,1),y("s");else if("ArrowUp"===e.key)o=(0,n.qE8)(0,o+.01,1),y("v");else{if("ArrowDown"!==e.key)return;o=(0,n.qE8)(0,o-.01,1),y("v")}e.preventDefault(),f()})),c.addEventListener("focus",(()=>{y("s")})),u.addEventListener("click",(()=>{i=!i,f()})),d.addEventListener("input",(e=>{i=!1,s=e.currentTarget.valueAsNumber??0,f()})),(0,n.Bqc)(d,"data-preventdefault",!1),p.addEventListener("input",(e=>{i=!1,r=e.currentTarget.valueAsNumber??0,f()})),(0,n.Bqc)(p,"data-preventdefault",!1),g.addEventListener("input",(e=>{i=!1;const t=Di(e.currentTarget.value);null!=t&&([s,a,o,r]=t,f())}
1)),(0,n.Bqc)(g,"data-preventdefault",!1),g.addEventListener("blur",(()=>f())),g.addEventListener("keydown",(e=>{"Enter"===e.key&&(e.currentTarget.blur(),f())})),{element:h,initialFocus:c}}},Ii=(()=>{var e=class extends n.XPE{};return l([n.mAP],e.prototype,"icon",2),l([n.mAP],e.prototype,"iconPosition",2),l([n.mAP],e.prototype,"label",2),l([n.mAP],e.prototype,"ariaLabel",2),l([n.mAP],e.prototype,"tooltip",2),e})();function Ai(e){return!(e instanceof s.n1.LogScale||e instanceof s.n1.BandScale)}var Ci=[{label:"toolbarAnnotationsTrendLine",icon:"trend-line-drawing",value:"line"},{label:"toolbarAnnotationsHorizontalLine",icon:"horizontal-line-drawing",value:"horizontal-line"},{label:"toolbarAnnotationsVerticalLine",icon:"vertical-line-drawing",value:"vertical-line"},{label:"toolbarAnnotationsParallelChannel",icon:"parallel-channel-drawing",value:"parallel-channel",visible:Ai},{label:"toolbarAnnotationsDisjointChannel",icon:"disjoint-channel-drawing",value:"disjoint-channel",visible:Ai}],Ni=[{label:"toolbarAnnotationsFibonacciRetracement",icon:"fibonacci-retracement-drawing",value:"fibonacci-retracement"},{label:"toolbarAnnotationsFibonacciRetracementTrendBased",icon:"fibonacci-retracement-trend-based-drawing",value:"fibonacci-retracement-trend-based"}],Li=[{label:"Fibonacci - Extended",value:10},{label:"Fibonacci - 6 Band",value:6},{label:"Fibonacci - 4 Band",value:4}],Pi=[{label:"toolbarAnnotationsText",icon:"text-annotation",value:"text"},{label:"toolbarAnnotationsComment",icon:"comment-annotation",value:"comment"},{label:"toolbarAnnotationsCallout",icon:"callout-annotation",value:"callout"},{label:"toolbarAnnotationsNote",icon:"note-annotation",value:"note"}],Ti=[{label:"toolbarAnnotationsArrow",icon:"arrow-drawing",value:"arrow"},{label:"toolbarAnnotationsArrowUp",icon:"arrow-up-drawing",value:"arrow-up"},{label:"toolbarAnnotationsArrowDown",icon:"arrow-down-drawing",value:"arrow-down"}],Oi=[{label:"toolbarAnnotationsQuickDatePriceRange",icon:"measurer-drawing",value:"quick-date-price-range"},{label:"toolbarAnnotationsDateRange",icon:"date-range-drawing",value:"date-range"},{label:"toolbarAnnotationsPriceRange",icon:"price-range-drawing",value:"price-range"},{label:"toolbarAnnotationsDatePriceRange",icon:"date-price-range-drawing",value:"date-price-range"}],Ri=[{strokeWidth:1,label:"1",value:1},{strokeWidth:2,label:"2",value:2},{strokeWidth:3,label:"3",value:3},{strokeWidth:4,label:"4",value:4},{strokeWidth:8,label:"8",value:8}],Ei=[{icon:"line-style-solid",altText:"iconAltTextLineStyleSolid",value:"solid"},{icon:"line-style-dashed",altText:"iconAltTextLineStyleDashed",value:"dashed"},{icon:"line-style-dotted",altText:"iconAltTextLineStyleDotted",value:"dotted"}],zi=[{label:"10",value:10},{label:"12",value:12},{label:"14",value:14},{label:"16",value:16},{label:"18",value:18},{label:"22",value:22},{label:"28",value:28},{label:"36",value:36},{label:"46",value:46}],{FloatingToolbar:Bi,Menu:Fi,ToolbarButtonWidget:Vi}=s.n1,$i=(()=>{var e=class extends Ii{constructor(){super(...arguments),this.type="button",this.checkedOverrides=new Ii}};return l([n.mAP],e.prototype,"type",2),l([n.mAP],e.prototype,"value",2),l([n.mAP],e.prototype,"checkedOverrides",2),l([n.mAP],e.prototype,"color",2),l([n.mAP],e.prototype,"strokeWidth",2),l([n.mAP],e.prototype,"isMultiColor",2),e})(),Hi=class extends Vi{constructor(e){super(e,!1)}update(e,t){super.update(e,t),"line-stroke-width"===e.value&&this.updateLineStrokeWidth(e),"fill-color"!==e.value&&"line-color"!==e.value&&"text-color"!==e.value||this.updateFillColor(e)}updateFillColor(e){const t=this.getElement();t.classList.add("ag-charts-annotations__color-picker-button"),t.classList.toggle("ag-charts-annotations__color-picker-button--multi-color",e.isMultiColor),t.style.setProperty("--color",e.color??null)}updateLineStrokeWidth(e){const t=this.getElement();t.classList.add("ag-charts-annotations__stroke-width-button"),t.style.setProperty("--stroke-width",`${e.strokeWidth}px`)}},ji=class extends Bi{createButtonWidget(){return new Hi(this.localeManager)}},Wi=(()=>{var e=class extends n.XPE{constructor(e,t){super(),this.ctx=e,this.getActiveDatum=t,this.enabled=!0,this.buttons=new n.F_c($i),this.cleanup=new n._uV,this.events=new n.bkB,this.visibleButtons=[],this.toolbar=ne
1w ji(this.ctx,"ariaLabelAnnotationOptionsToolbar","annotation-options"),this.colorPicker=new wi(this.ctx),this.textSizeMenu=new Fi(this.ctx,"text-size"),this.lineStyleTypeMenu=new Fi(this.ctx,"annotations-line-style-type"),this.lineStrokeWidthMenu=new Fi(this.ctx,"annotations-line-stroke-width"),this.cleanup.register(this.toolbar.addToolbarListener("button-pressed",this.onButtonPress.bind(this)),this.toolbar.addToolbarListener("toolbar-moved",this.onToolbarMoved.bind(this)),e.widgets.seriesWidget.addListener("drag-start",this.onDragStart.bind(this)),e.widgets.seriesWidget.addListener("drag-end",this.onDragEnd.bind(this)),(()=>{this.colorPicker.destroy(),this.toolbar.destroy()}))}onDragStart(){this.toolbar.ignorePointerEvents()}onDragEnd(){this.toolbar.capturePointerEvents()}destroy(){this.cleanup.flush()}show(){this.enabled&&this.toolbar.show()}hide(){this.toolbar.hide()}updateButtons(e){if(!this.enabled)return;const t={"line-style-type":mi(e),"line-stroke-width":mi(e),"line-color":yi(e),"text-color":xi(e),"fill-color":fi(e),"text-size":gi(e),settings:bi(e),lock:!0,delete:!0};this.visibleButtons=this.buttons.filter((e=>t[e.value])),this.toolbar.clearButtons(),this.toolbar.updateButtons(this.visibleButtons),this.refreshButtons(e)}setAnchorScene(e){this.toolbar.hasBeenDragged()||this.toolbar.setAnchor(e.getAnchor())}hideOverlays(){this.toolbar.clearActiveButton(),this.colorPicker.hide({lastFocus:null}),this.textSizeMenu.hide(),this.lineStyleTypeMenu.hide(),this.lineStrokeWidthMenu.hide(),this.events.emit("hid-overlays",null)}clearActiveButton(){this.toolbar.clearActiveButton()}updateColors(e){this.updateColorPickerColor("line-color",e.getDefaultColor("line-color"),e.getDefaultOpacity("line-color"),"isMultiColor"in e&&e?.isMultiColor),this.updateColorPickerColor("fill-color",e.getDefaultColor("fill-color"),e.getDefaultOpacity("fill-color"),"isMultiColor"in e&&e?.isMultiColor),this.updateColorPickerColor("text-color",e.getDefaultColor("text-color"),e.getDefaultOpacity("text-color"),"isMultiColor"in e&&e?.isMultiColor)}updateColorPickerColor(e,t,i,s){if(null!=t&&null!=i){const{r:e,g:s,b:a}=n.Q1f.fromString(t);t=n.Q1f.fromArray([e,s,a,i]).toHexString()}this.updateButtonByValue(e,{color:t,isMultiColor:s})}updateFontSize(e){this.updateButtonByValue("text-size",{label:null==e?void 0:String(e)})}updateLineStyleType(e){this.updateButtonByValue("line-style-type",{icon:e.icon})}updateStrokeWidth(e){this.updateButtonByValue("line-stroke-width",{label:e.label,strokeWidth:e.value})}onButtonPress({event:e,button:t,buttonWidget:i}){const n=this.getActiveDatum();if(n)switch(this.hideOverlays(),t.value){case"line-style-type":{const e=mi(n)?Ct(n.lineDash,n.lineStyle):void 0;this.lineStyleTypeMenu.show(i,{items:Ei,ariaLabel:this.ctx.localeManager.t("toolbarAnnotationsLineStyle"),value:e,minWidth:this.lineStyleTypeMenuMinWidth,onPress:e=>this.onLineStyleTypeMenuPress(e,n),class:"ag-charts-annotations__line-style-type-menu"});break}case"line-stroke-width":{const e=mi(n)?n.strokeWidth:void 0;this.lineStrokeWidthMenu.show(i,{items:Ri,ariaLabel:this.ctx.localeManager.t("toolbarAnnotationsLineStrokeWidth"),value:e,minWidth:this.lineStrokeWidthMenuMinWidth,onPress:e=>this.onLineStrokeWidthMenuPress(e,n),class:"ag-charts-annotations__line-stroke-width-menu"});break}case"line-color":case"fill-color":case"text-color":this.toolbar.toggleActiveButtonByIndex(t.index),this.colorPicker.show({color:n?.getDefaultColor(t.value),opacity:n?.getDefaultOpacity(t.value),sourceEvent:e.sourceEvent,hasMultiColorOption:"isMultiColor"in n,isMultiColor:"isMultiColor"in n&&n?.isMultiColor,onChange:null==n?void 0:this.onColorPickerChange.bind(this,t.value,n),onChangeHide:(e=>{this.events.emit("saved-color",{type:n.type,colorPickerType:t.value,color:n.getDefaultColor(e)})}).bind(this,t.value)});break;case"text-size":{const e=ui(n)?n.fontSize:void 0;this.textSizeMenu.show(i,{items:zi,ariaLabel:this.ctx.localeManager.t("toolbarAnnotationsTextSize"),value:e,minWidth:this.textSizeMenuMinWidth,onPress:e=>this.onTextSizeMenuPress(e,n),class:"ag-charts-annotations__text-size-menu"});break}case"delete":this.events.emit("pressed-delete",null);break;case"lock":n.locked=!n.locked,this.refreshButtons(n),this.events.emit("pressed-lock",{locked:n.locked});break;case"settings":this.toolbar.toggleActiveButtonByIndex(t.index),this.events.emit("pressed-settings",e)}}onToolbarMoved(e){const{buttonBounds:t,popoverBounds:i}=e,n={x:i.x,y:i.y+i.height+4},s={y:i.y-4};this.colorPicker.setAnchor(n,s);for(const[e,i]of t.entries()){const t=this.visibleButtons.at(e);if(!t)continue;const n={x:i.x,y:i.y+i.height-1},s={y:i.y};switch(t.value){case"line-stroke-width":this.lineStrokeWidthMenuMinWidth=i.width+1,this.lineStrokeWidthMenu.setAnchor(n,s);break;case"line-style-type":this.lineStyleTypeMenuMinWidth=i.width+1,this.lineStyleTypeMenu.setAnchor(n,s);break;case"text-size":this.textSizeMenuMinWidth=i.width+1,this.textSizeMenu.setAnchor(n,s)}}}onColorPickerChange(e,t,i,n,s,a){this.events.emit("updated-color",{type:t.type,colorPickerType:e,colorOpacity:i,color:n,opacity:s,isMultiColor:a}),this.updateColorPickerColor(e,i,s,a)}onTextSizeMenuPress(e,t){if(!gi(t))return;const i=e.value;this.events.emit("updated-font-size",{type:t.type,fontSize:i}),this.textSizeMenu.hide(),this.updateFontSize(i)}onLineStyleTypeMenuPress(e,t){if(!mi(t))return;const i=e.value;this.events.emit("updated-line-style",{type:t.type,lineStyleType:i}),this.lineStyleTypeMenu.hide(),this.updateLineStyleType(e)}onLineStrokeWidthMenuPress(e,t){if(!mi(t))return;const i=e.value;this.events.emit("updated-line-width",{type:t.type,strokeWidth:i}),this.lineStrokeWidthMenu.hide(),this.updateStrokeWidth(e)}refreshButtons(e){const t=e.locked??!1;for(const[e,i]of this.visibleButtons.entries())i&&("switch"===i.type?(this.toolbar.toggleSwitchCheckedByIndex(e,t),this.updateButtonByIndex(e,t?i.checkedOverrides.toJson():i.toJson())):this.toolbar.toggleButtonEnabledByIndex(e,!t));gi(e)&&this.updateFontSize(e.fontSize),this.updateColors(e),this.updateLineStyles(e)}updateLineStyles(e){if(!mi(e))return;const t=e.strokeWidth??1,i=Ct(e.lineDash,e.lineStyle);this.updateStrokeWidth({strokeWidth:t,value:t,label:String(t)}),this.updateLineStyleType(Ei.find((e=>e.value===i))??Ei[0])}updateButtonByValue(e,t){const i=this.visibleButtons.findIndex((t=>t.value===e));-1!==i&&this.updateButtonByIndex(i,t)}updateButtonByIndex(e,t){const i=this.visibleButtons.at(e);i&&this.toolbar.updateButtonByIndex(e,{...i.toJson(),...t,type:t.type??i.type,value:t.value??i.value})}};return l([n.mAP],e.prototype,"enabled",2),l([n.mAP],e.prototype,"buttons",2),e})(),_i=(()=>{var e=class extends n.Z37{constructor(e){const t=({context:t})=>{this.node?.drag(this.datum,this.offset,t,this.snapping),e.update(
1)};super("idle",{idle:{dragStart:{target:"dragging",action:({offset:e,context:t})=>{this.hasMoved=!1,this.dragStart=e,this.offset=e,this.node?.dragStart(this.datum,e,t)}}},dragging:{keyDown:t,keyUp:t,drag:({offset:t,context:i})=>{this.hasMoved=n.ZY9.lengthSquared(n.ZY9.sub(t,this.dragStart))>0,this.offset=t,this.node?.drag(this.datum,t,i,this.snapping),e.update()},dragEnd:{target:n.Z37.parent,action:()=>{this.node?.stopDragging(),this.hasMoved&&e.recordAction("Move annotation"),e.update()}}}}),this.debug=n.yar.create(!0,"annotations"),this.hasMoved=!1,this.snapping=!1}};return l([(0,n.m9s)()],e.prototype,"snapping",2),l([(0,n.m9s)()],e.prototype,"datum",2),l([(0,n.m9s)()],e.prototype,"node",2),e})(),Gi=(()=>{var e=class extends Zt{constructor(){super(...arguments),this.type="arrow-down"}static is(e){return(0,n.Gvm)(e)&&"arrow-down"===e.type}};return l([n.mAP],e.prototype,"type",2),e})(),Ki=class extends s.n1.Marker{isPointInPath(e,t){return this.updatePathIfDirty(),this.isPointInSharedPath(e,t)}},Yi=(()=>{var e=class e extends s.n1.Group{constructor(){super(...arguments),this.active=!1,this.locked=!1,this.visible=!1,this.zIndex=1}drag(e){const{handle:t,locked:i}=this;return i?{point:{x:t.x,y:t.y},offset:{x:0,y:0}}:{point:e,offset:{x:e.x-t.x,y:e.y-t.y}}}toggleActive(t){this.active=t,t||(this.handle.strokeWidth=e.INACTIVE_STROKE_WIDTH)}toggleHovered(e){this.glow.visible=!this.locked&&e,this.glow.dirtyPath=!0}toggleDragging(e){this.locked||(this.handle.visible=!e,this.glow.visible=this.glow.visible&&!e,this.handle.dirtyPath=!0,this.glow.dirtyPath=!0)}toggleLocked(e){this.locked=e}getCursor(){}containsPoint(e,t){return this.handle.containsPoint(e,t)}};return e.INACTIVE_STROKE_WIDTH=2,e})(),Ui=Yi,Xi=(()=>{var e=class e extends Ui{constructor(){super(),this.handle=new Ki({shape:"circle"}),this.glow=new Ki({shape:"circle"}),this.append([this.handle]),this.handle.size=e.HANDLE_SIZE,this.handle.strokeWidth=Ui.INACTIVE_STROKE_WIDTH,this.handle.zIndex=2}update(e){this.handle.setProperties({...e,strokeWidth:Ui.INACTIVE_STROKE_WIDTH})}drag(e){return{point:e,offset:{x:0,y:0}}}};return e.HANDLE_SIZE=7,e.GLOW_SIZE=9,e})(),Zi=(()=>{var e=class e extends Ui{constructor(){super(),this.handle=new s.n1.Rect,this.glow=new s.n1.Rect,this.gradient="horizontal",this.append([this.glow,this.handle]),this.handle.cornerRadius=e.CORNER_RADIUS,this.handle.width=e.HANDLE_SIZE,this.handle.height=e.HANDLE_SIZE,this.handle.strokeWidth=Ui.INACTIVE_STROKE_WIDTH,this.handle.zIndex=2,this.glow.cornerRadius=e.CORNER_RADIUS,this.glow.width=e.GLOW_SIZE,this.glow.height=e.GLOW_SIZE,this.glow.strokeWidth=0,this.glow.fillOpacity=.2,this.glow.zIndex=1,this.glow.visible=!1}toggleLocked(t){if(super.toggleLocked(t),t){const t=(e.HANDLE_SIZE-Xi.HANDLE_SIZE)/2;this.handle.cornerRadius=1,this.handle.fill=this.handle.stroke,this.handle.strokeWidth=0,this.handle.x+=t,this.handle.y+=t,this.handle.width=Xi.HANDLE_SIZE,this.handle.height=Xi.HANDLE_SIZE,this.glow.width=Xi.GLOW_SIZE,this.glow.height=Xi.GLOW_SIZE}else this.handle.cornerRadius=e.CORNER_RADIUS,this.handle.width=e.HANDLE_SIZE,this.handle.height=e.HANDLE_SIZE,this.glow.width=e.GLOW_SIZE,this.glow.height=e.GLOW_SIZE,this.cachedStyles&&this.handle.setProperties(this.cachedStyles)}update(t){if(this.cachedStyles={...t},this.active||delete t.strokeWidth,this.locked){delete t.fill,delete t.strokeWidth;const i=(e.HANDLE_SIZE-Xi.HANDLE_SIZE)/2;t.x-=i,t.y-=i,this.cachedStyles.x-=i,this.cachedStyles.y-=i}this.handle.setProperties(t),this.glow.setProperties({...t,x:(t.x??this.glow.x)-2,y:(t.y??this.glow.y)-2,strokeWidth:0,fill:t.stroke})}drag(e){return this.locked?{point:e,offset:{x:0,y:0}}:"vertical"===this.gradient?{point:{x:e.x,y:this.handle.y},offset:{x:e.x-this.handle.x,y:0}}:{point:{x:this.handle.x,y:e.y},offset:{x:0,y:e.y-this.handle.y}}}getCursor(){if(!this.locked)return"vertical"===this.gradient?"col-resize":"row-resize"}};return e.HANDLE_SIZE=12,e.GLOW_SIZE=16,e.CORNER_RADIUS=4,e})(),qi=(()=>{var e=class e extends Ui{constructor(){super(),this.handle=new Ki({shape:"circle"}),this.glow=new Ki({shape:"circle"}),this.append([this.glow,this.handle]),this.handle.size=e.HANDLE_SIZE,this.handle.strokeWidth=Ui.INACTIVE_STROKE_WIDTH,this.handle.zIndex=2,this.glow.size=e.GLOW_SIZE,this.glow.strokeWidth=0,this.glow.fillOpacity=.2,this.glow.zIndex=1,this.glow.visible=!1}toggleLocked(t){super.toggleLocked(t),t?(this.handle.fill=this.handle.stroke,this.handle.strokeWidth=0,this.handle.size=Xi.HANDLE_SIZE,this.glow.size=Xi.GLOW_SIZE):(this.handle.size=e.HANDLE_SIZE,this.glow.size=e.GLOW_SIZE,this.cachedStyles&&this.handle.setProperties(this.cachedStyles))}update(e){this.cachedStyles={...e},this.active||delete e.strokeWidth,this.locked&&(delete e.fill,delete e.strokeWidth),this.handle.setProperties(e),this.glow.setProperties({...e,strokeWidth:0,fill:e.stroke})}getCursor(){return"pointer"}};return e.HANDLE_SIZE=11,e.GLOW_SIZE=17,e})(),Qi=class extends s.n1.Group{constructor(){super(...arguments),this.name="AnnotationScene",this.zIndex=n.Dcv.CHART_ANNOTATION}static isCheck(e,t){return(0,n.Gvm)(e)&&Object.hasOwn(e,"type")&&e.type===t}toggleHovered(e,t,i){!0!==i&&this.toggleHandles(e||t)}computeBBoxWithoutHandles(){return s.n1.Transformable.toCanvas(this,s.n1.Group.computeChildrenBBox(this.excludeChildren({instance:Ui})))}updateNode(e,t,i){if(i||!t)return i&&null==t&&(t=new e,this.appendChild(t)),t;t.remove()}},{ContinuousScale:Ji,Transformable:en}=s.n1;function tn(e,t,i=!1,s,a=1){if(!i)return yt(e,t);return yt(nn(e,s?gt(s,t):n.ZY9.origin(),a),t)}function nn(e,t,i){const s=n.ZY9.sub(e,t),a=(0,n.ehJ)(i),o=Math.round(n.ZY9.angle(s)/a)*a;return n.ZY9.rotate(s,o,t)}function sn(e,t){const i={};for(const[s,a]of(0,n.jOZ)(e))i[s]=gt(a,t);return i}function an(e,t,i,s={overflowContinuous:0,translateVectors:void 0,invertYVectors:void 0,snap:void 0}){const{xAxis:a,yAxis:o}=i,r=Object.keys(e),l=[],h=[],c=new Set(s.translateVectors??r),d=new Set(s.invertYVectors??[]),u=new Set([...c,...d]),p=n.ZY9.multiply(t,n.ZY9.from(1,-1));for(const i of r)u.has(i)&&(e[i]=n.ZY9.add(e[i],d.has(i)?p:t),s.snap&&(e[i]=nn(e[i],s.snap.vectors[i],s.snap.angle))),l.push(a.getRangeOverflow(e[i].x)),h.push(o.getRangeOverflow(e[i].y));const g=(e,t)=>Math.abs(e)-Math.abs(t),m=(e,t,i)=>{if(0===s.overflowContinuous||!Ji.is(e))return i.toSorted(g).at(-1)??0;if(r.length===u.size)return i.toSorted(g).at(-s.overflowContinuous-1)??0;if(i.filter((e=>0!==e)).length<=s.overflowContinuous)return 0;return i.filter(((e,i)=>0!==e&&Math.abs(e)<=Math.abs(t)&&u.has(r[i]))).toSorted(g).at(-1)??0},y=n.ZY9.from(m(a.scale,t.x,l),m(o.scale,t.y,h));if(!n.ZY9.equal(y,n.ZY9.origin()))for(const t of r)u.has(t)&&(e[t]=n.ZY9.round(n.ZY9.sub(e[t],y),4));const f={};for(const t of r)f[t]=yt(e[t],i);return f}function on(e,t,i){const s=n.Zbg.topCenter(i),{canvasX:a,canvasY:o}=en.toCanvasPoint(e,s.x,s.y);n.ZY9.apply(t,{x:a,y:o})}var rn=class extends Qi{constructor(){super(...arguments),this.handle=new qi,this.anchor={x:0,y:0,position:"above"}}update(e,t){const i=gt(e,t);this.updateHandle(e,i),this.anchor=this.updateAnchor(e,i,t)}dragStart(e,t,i){this.dragState={offset:t,...sn({handle:e},i)}}drag(e,t,i){const{dragState:s}=this;if(!e.isWriteable()||!s)return;const{point:a}=an({point:s.handle},n.ZY9.sub(t,s.offset),i);e.x=a.x,e.y=a.y}translate(e,t,i){if(!e.isWriteable())return;const{point:n}=an({point:gt(e,i)},t,i);e.x=n.x,e.y=n.y}toggleHandles(e){this.handle.visible=Boolean(e),this.handle.toggleHovered("handle"===this.activeHandle)}toggleActive(e){this.toggleHandles(e),this.handle.toggleActive(e)}stopDragging(){this.handle.toggleDragging(!1)}copy(e,t,i){const n=gt(e,i),s=yt({x:n.x-30,y:n.y-30},i);return t.x=s.x,t.y=s.y,t}getAnchor(){return this.anchor}getCursor(){return"pointer"}containsPoint(e,t){const{handle:i}=this;return this.activeHandle=void 0,!!i.containsPoint(e,t)&&(this.activeHandle="handle",!0)}getNodeAtCoords(e,t){if(this.handle.containsPoint(e,t))return"handle"}updateHandle(e,t,i){const{x:n,y:s}=this.getHandleCoords(e,t,i),a=this.getHandleStyles(e);this.handle.update({...a,x:n,y:s}),this.handle.toggleLocked(e.locked??!1)}updateAnchor(e,t,i){const n=this.getHandleCoords(e,t);return{x:n.x+i.seriesRect.x,y:n.y+i.seriesRect.y,position:this.anchor.position}}getHandleCoords(e,t,i){return{x:t.x,y:t.y}}getHandleStyles(e){return{fill:e.handle.fill,stroke:e.handle.stroke,strokeOpacity:e.handle.strokeOpacity,strokeWidth:e.handle.strokeWidth}}},ln=class extends rn{constructor(){super(),this.append([this.handle])}update(e,t){super.update(e,t);const i=gt(e,t);this.updateShape(e,i)}updateShape(e,t){this.updateShapeStyles(e),this.updateShapePath(e,t)}updateShapeStyles(e){const{shape:t}=this;t.fill=e.fill,t.fillOpacity=e.fillOpacity??1}updateShapePath(e,t){const{shape:i}=this;i.x=t.x,i.y=t.y,i.size=e.size}containsPoint(e,t){return super.containsPoint(e,t)||this.shape.containsPoint(e,t)}getNodeAtCoords(e,t){return this.shape.containsPoint(e,t)?"shape":super.getNodeAtCoords(e,t)}},hn=[[.5,0],[1,.5],[.75,.5],[.75,1],[.25,1],[.25,.5],[0,.5]];function cn(e){s.n1.drawMarkerUnitPolygon(e,hn)}cn.anchor={x:.5,y:0};var dn=class extends ln{constructor(){super(),this.type="arrow-up",this.shape=new Ki({shape:cn}),this.append([this.shape])}static is(e){return Qi.isCheck(e,"arrow-up")}getHandleCoords(e,t){const i=qi.HANDLE_SIZE/2,n=super.getHandleCoords(e,t);return n.y-=i,n}},un=hn.map((([e,t])=>[e,1-t]));function pn(e){s.n1.drawMarkerUnitPolygon(e,un)}
1pn.anchor={x:.5,y:1};var gn=class extends ln{constructor(){super(),this.type="arrow-down",this.shape=new Ki({shape:pn}),this.append([this.shape])}static is(e){return Qi.isCheck(e,"arrow-down")}updateAnchor(e,t,i){const n=super.updateAnchor(e,t,i);return n.y-=e.size,n}getHandleCoords(e,t){const i=qi.HANDLE_SIZE/2,n=super.getHandleCoords(e,t);return n.y+=i,n}},mn=(()=>{var e=class extends n.Z37{constructor(e){const t=({point:t})=>{const i=this.createDatum();i.set({x:t.x,y:t.y}),e.create(i)};super("start",{start:{click:{target:"waiting-first-render",action:t},drag:{target:"waiting-first-render",action:t},cancel:n.Z37.parent,reset:n.Z37.parent},"waiting-first-render":{render:{target:n.Z37.parent,action:()=>{this.node?.toggleActive(!0),e.showAnnotationOptions(),e.update()}}}}),this.debug=n.yar.create(!0,"annotations")}};return l([(0,n.m9s)()],e.prototype,"node",2),e})(),yn=class extends mn{createDatum(){return new Gi}},fn={type:"arrow-down",datum:Gi,scene:gn,isDatum:Gi.is,translate:(e,t,i,n)=>{Gi.is(t)&&gn.is(e)&&e.translate(t,i,n)},copy:(e,t,i,n)=>{if(Gi.is(t)&&Gi.is(i)&&gn.is(e))return e.copy(t,i,n)},update:(e,t,i)=>{Gi.is(t)&&gn.is(e)&&e.update(t,i)},createState:(e,{createDatum:t})=>new yn({...e,create:t("arrow-down")}),dragState:e=>new _i(e)},xn=(()=>{var e=class extends Zt{constructor(){super(...arguments),this.type="arrow-up"}static is(e){return(0,n.Gvm)(e)&&"arrow-up"===e.type}};return l([n.mAP],e.prototype,"type",2),e})(),bn=class extends mn{createDatum(){return new xn}},vn={type:"arrow-up",datum:xn,scene:dn,isDatum:xn.is,translate:(e,t,i,n)=>{xn.is(t)&&dn.is(e)&&e.translate(t,i,n)},copy:(e,t,i,n)=>{if(xn.is(t)&&xn.is(i)&&dn.is(e))return e.copy(t,i,n)},update:(e,t,i)=>{xn.is(t)&&dn.is(e)&&e.update(t,i)},createState:(e,{createDatum:t})=>new bn({...e,create:t("arrow-up")}),dragState:e=>new _i(e)},Sn=class extends Qi{constructor(){super(...arguments),this.overflowContinuous=0}extendLine({x1:e,y1:t,x2:i,y2:s},a,o){const r={x1:e,y1:t,x2:i,y2:s};if(!a.extendStart&&!a.extendEnd)return r;const[l,h]=function(e,t){const[i,s]=n.ZY9.from(e),a=t.height,o=n.ZY9.gradient(s,i,a),r=n.ZY9.intercept(s,o,a),l=[{x:i.x,y:a??0},{x:i.x,y:null==a?t.height:a-t.height}];if(o===1/0)return l;let h=[n.ZY9.intersectAtY(o,r,0,a),n.ZY9.intersectAtY(o,r,t.height,a),n.ZY9.intersectAtX(o,r,0,a),n.ZY9.intersectAtX(o,r,t.width,a)];return h=h.filter((e=>e.x>=t.x&&e.x<=t.width&&e.y>=t.y&&e.y<=t.height)).sort(((e,t)=>e.x===t.x?0:e.x<t.x?-1:1)),2!==h.length?l:h}(r,o.yAxis.bounds),c=r.x2<r.x1,d=r.y1>=r.y2,u=r.x2===r.x1;return a.extendEnd&&(u?r.y2=d?h.y:l.y:(r.x2=c?l.x:h.x,r.y2=c?l.y:h.y)),a.extendStart&&(u?r.y1=d?l.y:h.y:(r.x1=c?h.x:l.x,r.y1=c?h.y:l.y)),r}dragStart(e,t,i){this.dragState={offset:t,...sn({start:e.start,end:e.end},i)}}drag(e,t,i,n){e.isWriteable()&&(this.activeHandle?this.dragHandle(e,t,i,n):this.dragAll(e,t,i))}dragAll(e,t,i){const{dragState:s}=this;s&&this.translatePoints(e,s.start,s.end,n.ZY9.sub(t,s.offset),i)}translate(e,t,i){e.isWriteable()&&this.translatePoints(e,gt(e.start,i),gt(e.end,i),t,i)}copy(e,t,i){const s=pt(e,i);if(!s)return;const a=this.computeBBoxWithoutHandles(),o={x:-a.width/2,y:-a.height/2};return this.translatePoints(t,n.Zbg.start(s),n.Zbg.end(s),o,i),t}translatePoints(e,t,i,n,s){const a=an(this.getTranslatePointsVectors(t,i),n,s,{overflowContinuous:this.overflowContinuous});e.start.x=a.start.x,e.end.x=a.end.x,e.start.y=a.start.y,e.end.y=a.end.y}getTranslatePointsVectors(e,t){return{start:e,end:t}}},Mn=class extends Sn{constructor(){super(...arguments),this.start=new qi,this.end=new qi,this.anchor={x:0,y:0,position:"above"}}update(e,t){const i=pt(e,t);null!=i&&(this.updateHandles(e,i),this.updateAnchor(e,i,t))}toggleHandles(e){if("boolean"==typeof e)this.start.visible=e,this.end.visible=e;else for(const[t,i]of(0,n.jOZ)(e))this[t].visible=i;this.start.toggleHovered("start"===this.activeHandle),this.end.toggleHovered("end"===this.activeHandle)}toggleActive(e){this.toggleHandles(e),this.start.toggleActive(e),this.end.toggleActive(e)}dragHandle(e,t,i,s){const{activeHandle:a,dragState:o}=this;if(!a||!o)return;this[a].toggleDragging(!0);const r="start"===a?"end":"start",l=s?{vectors:{[a]:gt(e[r],i)},angle:e.snapToAngle}:void 0,{[a]:h}=an({[a]:o[a]},n.ZY9.sub(t,o.offset),i,{overflowContinuous:0,snap:l});e[a].x=h.x,e[a].y=h.y}stopDragging(){this.start.toggleDragging(!1),this.end.toggleDragging(!1)}getAnchor(){return this.anchor}getCursor(){return"pointer"}containsPoint(e,t){const{start:i,end:n}=this;return this.activeHandle=void 0,i.containsPoint(e,t)?(this.activeHandle="start",!0):!!n.containsPoint(e,t)&&(this.activeHandle="end",!0)}getNodeAtCoords(e,t){if(this.start.containsPoint(e,t)||this.end.containsPoint(e,t))return"handle"}updateHandles(e,t,i){this.start.update({...this.getHandleStyles(e,"start"),...this.getHandleCoords(e,t,"start")}),this.end.update({...this.getHandleStyles(e,"end"),...this.getHandleCoords(e,t,"end",i)}),this.start.toggleLocked(e.locked??!1),this.end.toggleLocked(e.locked??!1)}updateAnchor(e,t,i,n){this.anchor={x:t.x1+i.seriesRect.x,y:t.y1+i.seriesRect.y,position:this.anchor.position}}getHandleCoords(e,t,i,s){return"start"===i?n.Zbg.start(t):n.Zbg.end(t)}getHandleStyles(e,t){return{fill:e.handle.fill,stroke:e.handle.stroke,strokeOpacity:e.handle.strokeOpacity,strokeWidth:e.handle.strokeWidth}}},kn=class extends Mn{constructor(){super(...arguments),this.label=new s.n1.Text({zIndex:1}),this.anchor={x:0,y:0,position:"above-left"}}setTextInputBBox(e){this.textInputBBox=e,this.markDirty("TextualStartEndScene")}update(e,t){const i=pt(e,t);if(null==i)return;const n=this.getTextBBox(e,i);this.updateLabel(e,n,i,t),this.updateHandles(e,i,n),this.updateShape(e,n,i),this.updateAnchor(e,i,t,n)}containsPoint(e,t){return super.containsPoint(e,t)||this.label.containsPoint(e,t)}getNodeAtCoords(e,t){return this.label.containsPoint(e,t)?"text":super.getNodeAtCoords(e,t)}getTextBBox(e,t){const{text:i}=e.getText();return Gt(e,i,n.Zbg.end(t),this.textInputBBox)}updateLabel(e,t,i,n){const{text:s,isPlaceholder:a}=e.getText(),o=this.getLabelCoords(e,t,i);n.isRtl&&(o.x+=t.width),Kt(this.label,s,a,e,o)}updateShape(e,t,i){}getLabelCoords(e,t,i){return n.Zbg.end(i)}getHandleStyles(e,t){return{...super.getHandleStyles(e,t),stroke:e.handle.stroke??e.color}}},{drawCorner:Dn,Path:wn}=s.n1,In=class extends kn{constructor(){super(),this.type="callout",this.shape=new wn,this.append([this.shape,this.label,this.start,this.end])}static is(e){return Qi.isCheck(e,"callout")}drag(e,t,i,n){e.isWriteable()&&("end"===this.activeHandle?this.dragHandle(e,t,i,n):this.dragAll(e,t,i))}getLabelCoords(e,t,i){const n=e.getPadding(),{bodyBounds:s={x:0,y:0,width:0,height:0}}=this.getDimensions(e,t,i)??{};return{x:s.x+n.left,y:s.y-n.bottom}}getHandleStyles(e,t){return"start"===t?{fill:e.handle.fill,stroke:e.handle.stroke??e.stroke,strokeOpacity:e.handle.strokeOpacity,strokeWidth:e.handle.strokeWidth}:{fill:void 0,strokeWidth:0}}updateAnchor(e,t,i,n){const{bodyBounds:s}=this.getDimensions(e,n,t)??{},a=s??n;this.anchor={x:a.x+i.seriesRect.x,y:a.y+i.seriesRect.y-a.height,position:this.anchor.position}}updateShape(e,t,i){const{shape:n}=this;n.fill=e.fill,n.fillOpacity=e.fillOpacity??1,n.stroke=e.stroke,n.strokeWidth=e.strokeWidth??1,n.strokeOpacity=e.strokeOpacity??1;const{tailPoint:s,bodyBounds:a}=this.getDimensions(e,t,i)??{};s&&a&&this.updatePath(s,a)}updatePath(e,t){const{x:i,y:n}=e,{x:s,y:a,width:o,height:r}=t,l=a-r,h=s+o,c=this.calculateCalloutPlacement({x:i,y:n}
1,t),d=[{coordinates:{x0:s,x1:s+8,y0:l+8,y1:l,cx:"topLeft"===c?i:s+8,cy:"topLeft"===c?n:l+8},type:"topLeft"===c?"calloutCorner":"corner"},{coordinates:{x0:s+8,x1:h-8,y0:l,y1:l,cx:i,cy:n},type:"top"===c?"calloutSide":"side"},{coordinates:{x0:h-8,x1:h,y0:l,y1:l+8,cx:"topRight"===c?i:h-8,cy:"topRight"===c?n:l+8},type:"topRight"===c?"calloutCorner":"corner"},{coordinates:{x0:h,x1:h,y0:l+8,y1:a-8,cx:i,cy:n},type:"right"===c?"calloutSide":"side"},{coordinates:{x0:h,x1:h-8,y0:a-8,y1:a,cx:"bottomRight"===c?i:h-8,cy:"bottomRight"===c?n:a-8},type:"bottomRight"===c?"calloutCorner":"corner"},{coordinates:{x0:h-8,x1:s+8,y0:a,y1:a,cx:i,cy:n},type:"bottom"===c?"calloutSide":"side"},{coordinates:{x0:s+8,x1:s,y0:a,y1:a-8,cx:"bottomLeft"===c?i:s+8,cy:"bottomLeft"===c?n:a-8},type:"bottomLeft"===c?"calloutCorner":"corner"},{coordinates:{x0:s,x1:s,y0:a-8,y1:l+8,cx:i,cy:n},type:"left"===c?"calloutSide":"side"}],{path:u}=this.shape;u.clear(),u.moveTo(s,l+8);for(const{coordinates:e,type:t}of d)this.drawPath(u,e,8,t);u.closePath()}drawPath(e,{x0:t,y0:i,x1:n,y1:s,cx:a,cy:o},r,l){switch(l){case"calloutCorner":e.lineTo(a,o),e.lineTo(n,s);break;case"corner":Dn(e,{x0:t,x1:n,y0:i,y1:s,cx:a,cy:o},r,!1);break;case"calloutSide":if(t===n){const r=i>s?-1:1,l=Math.min(i,s)+Math.abs(i-s)/2;e.lineTo(t,l-6*r),e.lineTo(a,o),e.lineTo(t,l+6*r),e.lineTo(n,s)}else{const r=t>n?-1:1,l=Math.min(t,n)+Math.abs(n-t)/2;e.lineTo(l-6*r,i),e.lineTo(a,o),e.lineTo(l+6*r,i),e.lineTo(n,s)}break;default:e.lineTo(n,s)}}calculateCalloutPlacement(e,t){const i=t.x+t.width,n=t.y-t.height;let s,a;return e.x>i?s="right":e.x<t.x&&(s="left"),e.y>t.y?a="bottom":e.y<n&&(a="top"),s&&a?`${a}${s[0].toUpperCase()}${s.substring(1)}`:a??s}getDimensions(e,t,i){const{fontSize:n}=e,s=e.getPadding(),a=s.left+s.right,o=s.top+s.bottom,r=t.width+a,l=Math.max(t.height+o,n+o);return{tailPoint:{x:i.x1,y:i.y1},bodyBounds:{x:t.x,y:t.y,width:r,height:l}}}containsPoint(e,t){const{start:i,end:n,shape:s}=this;if(this.activeHandle=void 0,i.containsPoint(e,t))return this.activeHandle="start",!0;const a=n.containsPoint(e,t)||s.containsPoint(e,t);return a&&(this.activeHandle="end"),a}};function An({key:e}){return"Escape"===e}function Cn({key:e,shiftKey:t}){return!t&&"Enter"===e}var Nn=(()=>{var e=class extends n.Z37{constructor(e){const t=({point:t})=>{const i=this.createDatum();i.set({start:t,end:t,visible:!0}),e.create(i)},i=({point:t})=>{const{datum:i,node:n}=this;i?.set({end:t}),n?.toggleActive(!0),n?.toggleHandles({end:!1}),e.update()},s=()=>{e.showAnnotationOptions(),this.node?.toggleHandles({end:!0})},a=()=>{e.delete()},o=({textInputValue:t,bbox:i})=>{const{datum:n}=this;if(null!=i&&null!=t&&t.length>0){if(!ui(n))return;const s=_t(n,t,i.width);n?.set({text:s}),e.update(),e.recordAction(`Create ${n?.type} annotation`)}else e.delete()};super("start",{start:{click:{target:"waiting-first-render",action:t},dragStart:{target:"waiting-first-render",action:t},cancel:n.Z37.parent,reset:n.Z37.parent},"waiting-first-render":{render:{target:"end",action:()=>{const{node:e}=this;e?.toggleActive(!0),e?.toggleHandles({start:!0})}}},end:{hover:i,drag:i,click:{target:"edit",action:s},dragEnd:{target:"edit",action:s},reset:{target:n.Z37.parent,action:a},cancel:{target:n.Z37.parent,action:a}},edit:{onEnter:()=>{e.showTextInput(),this.datum&&(this.datum.visible=!1)},updateTextInputBBox:t=>{this.node?.setTextInputBBox(t),e.update()},color:({colorPickerType:t,colorOpacity:i,color:n,opacity:s,isMultiColor:a})=>{const{datum:o}=this;o&&("text-color"===t&&e.updateTextInputColor(n),Mi(o,t,i,n,s,a),e.update())},fontSize:t=>{const{datum:i,node:n}=this;i&&n&&ui(i)&&(i.fontSize=t,e.updateTextInputFontSize(t),e.update())},textInput:[{guard:An,target:n.Z37.parent,action:a},{guard:Cn,target:n.Z37.parent,action:o}],click:{target:n.Z37.parent,action:o},dragStart:{target:n.Z37.parent,action:o},resize:{target:n.Z37.parent,action:o},onExit:()=>{e.hideTextInput(),this.node?.setTextInputBBox(),this.datum&&(this.datum.visible=!0),e.deselect()},cancel:{target:n.Z37.parent,action:a}}}),this.debug=n.yar.create(!0,"annotations")}};return l([(0,n.m9s)()],e.prototype,"datum",2),l([(0,n.m9s)()],e.prototype,"node",2),e})(),Ln=class extends Nn{createDatum(){return new St}},Pn={type:"callout",datum:St,scene:In,isDatum:St.is,translate:(e,t,i,n)=>{if(St.is(t)&&In.is(e))return e.translate(t,i,n)},copy:(e,t,i,n)=>{if(St.is(t)&&St.is(i)&&In.is(e))return e.copy(t,i,n)},update:(e,t,i)=>{St.is(t)&&In.is(e)&&e.update(t,i)},createState:(e,{createDatum:t})=>new Ln({...e,create:t("callout")}),dragState:e=>new _i(e)},Tn=class extends rn{constructor(){super(...arguments),this.label=new s.n1.Text({zIndex:1}),this.anchor={x:0,y:0,position:"above-left"}}setTextInputBBox(e){this.textInputBBox=e,this.markDirty("TextualPointScene")}update(e,t){const i=gt(e,t),n=this.getTextBBox(e,i,t);this.updateLabel(e,n,t),this.updateHandle(e,i,n),this.updateShape(e,n),this.anchor=this.updateAnchor(e,n,t)}copy(e,t,i){const n=gt(e,i),s=this.getTextBBox(e,n,i),a=e.getPadding(),o=a.left+a.right,r=a.top+a.bottom,l=(s.width+o)/2,h=s.height+r,c=yt({x:n.x-l,y:n.y-h},i);return t.x=c.x,t.y=c.y,t}containsPoint(e,t){const{label:i}=this;return super.containsPoint(e,t)||i.visible&&i.containsPoint(e,t)}getNodeAtCoords(e,t){return this.label.visible&&this.label.containsPoint(e,t)?"text":super.getNodeAtCoords(e,t)}getTextBBox(e,t,i){const{text:n}=e.getText();return Gt(e,n,{x:t.x,y:t.y},this.textInputBBox)}updateLabel(e,t,i){const{text:n,isPlaceholder:s}=e.getText(),a=this.getLabelCoords(e,t);i.isRtl&&(a.x+=t.width),Kt(this.label,n,s,e,a,this.getTextBaseline(e))}updateShape(e,t){}updateAnchor(e,t,i){return{x:i.isRtl?t.x-t.width+i.seriesRect.x:t.x+i.seriesRect.x,y:t.y+i.seriesRect.y-t.height,position:this.anchor.position}}getLabelCoords(e,t){return t}getTextBaseline(e){return"center"==e.position?"middle":e.position}getHandleCoords(e,t,i){return i}getHandleStyles(e){const t=super.getHandleStyles(e);return t.stroke=e.handle.stroke??e.color,t}},{drawCorner:On}=s.n1,Rn=class extends Tn{constructor(){super(),this.type="comment",this.shape=new s.n1.Path,this.append([this.shape,this.label,this.handle])}static is(e){return Qi.isCheck(e,"comment")}updateShape(e,t){const{shape:i}=this;i.fill=e.fill,i.fillOpacity=e.fillOpacity??1,i.stroke=e.stroke??"transparent",i.strokeWidth=e.strokeWidth??1,i.strokeOpacity=e.strokeOpacity??1,this.updatePath(e,t)}getLabelCoords(e,t){const i=e.getPadding();return{x:t.x+i.left,y:t.y-i.bottom}}getHandleStyles(e){return{fill:e.handle.fill,stroke:e.handle.stroke??e.stroke??e.fill,strokeOpacity:e.handle.strokeOpacity,strokeWidth:e.handle.strokeWidth}}updateAnchor(e,t,i){const n=super.updateAnchor(e,t,i),s=e.getPadding();return n.y-=s.bottom+s.top,n}updatePath(e,t){const i=e.getPadding(),{x:s,y:a}=t;let{width:o,height:r}=t;const{fontSize:l}=e,h=i.left+i.right,c=i.top+i.bottom;o+=h,r=Math.max(r+c,l+c);const d=a-r,u=s+o,p=((0,n.VKS)(l,Wt)+c)/2,{path:g}=this.shape;
1g.clear(),g.moveTo(s,a),g.lineTo(s,d+p),On(g,{x0:s,x1:s+p,y0:d+p,y1:d,cx:s+p,cy:d+p},p,!1),g.lineTo(u-p,d),On(g,{x0:u-p,x1:u,y0:d,y1:d+p,cx:u-p,cy:d+p},p,!1),g.lineTo(u,a-p),On(g,{x0:u,x1:u-p,y0:a-p,y1:a,cx:u-p,cy:a-p},p,!1),g.closePath()}containsPoint(e,t){return super.containsPoint(e,t)||this.shape.containsPoint(e,t)}},En=(()=>{var e=class extends n.Z37{constructor(e){const t=({point:t})=>{const i=this.createDatum();i.set({x:t.x,y:t.y}),e.create(i)},i=()=>{e.delete()},s=({textInputValue:t,bbox:i})=>{if(null!=i&&null!=t&&t.length>0){const{datum:n}=this;if(!ui(n))return;const s=_t(n,t,i.width);n?.set({text:s}),e.update(),e.recordAction(`Create ${n?.type} annotation`)}else e.delete()};super("start",{start:{click:{target:"waiting-first-render",action:t},dragStart:{target:"waiting-first-render",action:t},cancel:n.Z37.parent,reset:n.Z37.parent},"waiting-first-render":{render:{target:"edit",action:()=>{this.node?.toggleActive(!0),e.showAnnotationOptions(),e.update()}}},edit:{onEnter:()=>{e.showTextInput(),this.datum&&(this.datum.visible=!1)},updateTextInputBBox:t=>{this.node?.setTextInputBBox(t),e.update()},color:({colorPickerType:t,colorOpacity:i,color:n,opacity:s,isMultiColor:a})=>{this.datum&&("text-color"===t&&e.updateTextInputColor(n),Mi(this.datum,t,i,n,s,a),e.update())},fontSize:t=>{const{datum:i,node:n}=this;i&&n&&ui(i)&&(i.fontSize=t,e.updateTextInputFontSize(t),e.update())},textInput:[{guard:An,target:n.Z37.parent,action:i},{guard:Cn,target:n.Z37.parent,action:s}],click:{target:n.Z37.parent,action:s},dragStart:{target:n.Z37.parent,action:s},resize:{target:n.Z37.parent,action:s},onExit:()=>{e.hideTextInput(),this.node?.setTextInputBBox(),this.datum&&(this.datum.visible=!0),e.deselect()},cancel:{target:n.Z37.parent,action:i}}}),this.debug=n.yar.create(!0,"annotations")}};return l([(0,n.m9s)()],e.prototype,"datum",2),l([(0,n.m9s)()],e.prototype,"node",2),e})(),zn=class extends En{createDatum(){return new At}},Bn={type:"comment",datum:At,scene:Rn,isDatum:At.is,translate:(e,t,i,n)=>{At.is(t)&&Rn.is(e)&&e.translate(t,i,n)},copy:(e,t,i,n)=>{if(At.is(t)&&At.is(i)&&Rn.is(e))return e.copy(t,i,n)},update:(e,t,i)=>{At.is(t)&&Rn.is(e)&&e.update(t,i)},createState:(e,{createDatum:t})=>new zn({...e,create:t("comment")}),dragState:e=>new _i(e)},{calculateLabelTranslation:Fn}=s.n1;var Vn=(()=>{var e=class extends s.n1.Group{constructor(){super({name:"AnnotationAxisLabelGroup"}),this.label=new s.n1.Text({zIndex:1}),this.rect=new s.n1.Rect;const{label:e}=this;e.fontSize=12,e.fontFamily='"IBM Plex Sans", -apple-system, "system-ui", "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif',e.fill="black",e.textBaseline="middle",e.textAlign="center",this.append([this.rect,this.label])}update(e){this.updateLabel(e),this.updateRect(e),this.updatePosition(e)}updateLabel({value:e,styles:t,context:i}){const{fontWeight:n,fontSize:s,fontStyle:a,fontFamily:o,textAlign:r,color:l="white",formatter:h}=t,c=h?h({value:e}):i.formatScaleValue(e,"annotation-label");this.label.setProperties({fontWeight:n,fontSize:s,fontStyle:a,fontFamily:o,textAlign:r,fill:l,text:c})}updateRect({styles:e}){const{rect:t}=this,{cornerRadius:i,fill:n,fillOpacity:s,stroke:a,strokeOpacity:o}=e;t.fill=n,t.fillOpacity=s??1,t.stroke=a,t.strokeOpacity=o??1,t.cornerRadius=i??0}updatePosition({x:e,y:t,context:i,styles:{padding:n}}){const{label:s,rect:a}=this,o=s.getBBox()?.clone(),{top:r,right:l,bottom:h,left:c}=function(e){if("number"==typeof e)return{top:e,right:e,bottom:e,left:e};const{top:t=4,right:i=8,bottom:n=4,left:s=8}=e??{};return{top:t,right:i,bottom:n,left:s}}(n),{xTranslation:d,yTranslation:u}=Fn({yDirection:!0,padding:i.labelPadding,position:i.position??"left",bbox:o}),p=e+d,g=t+u;s.x=p,s.y=g,a.x=p-Math.round(o.width/2)-c,a.y=g-Math.round(o.height/2)-r,a.width=o.width+c+l,a.height=o.height+r+h}};return e.className="AxisLabel",e})(),$n=class extends s.n1.Line{constructor(){super(...arguments),this.growCollisionBox=9,this.clipMask=new Map}setProperties(e){return super.setProperties(e),this.updateCollisionBBox(),this}updateCollisionBBox(){const{growCollisionBox:e,strokeWidth:t,x1:i,y1:a,x2:o,y2:r}=this;let l=t+e;l%2==0&&(l+=1);const h=n.ZY9.from(i,a-Math.floor(l/2)),c=n.ZY9.from(o,r),d=n.ZY9.distance(h,c);this.collisionBBox=new s.n1.BBox(h.x,h.y,d,l)}isPointInPath(e,t){const{collisionBBox:i,x1:s,y1:a,x2:o,y2:r}=this;if(!i)return!1;const l=n.ZY9.from(s,a),h=n.ZY9.from(o,r),c=n.ZY9.sub(n.ZY9.from(e,t),l),d=n.ZY9.sub(h,l),u=n.ZY9.rotate(c,n.ZY9.angle(c,d),l);return i.containsPoint(u.x,u.y)??!1}render(e){const{clipMask:t}=this,{ctx:i}=e;if(0!==t.size){i.save();try{for(const e of this.clipMask.values()){const{x:t,y:n,radius:s}=e;i.beginPath(),i.rect(0,0,i.canvas.width,i.canvas.height),i.ellipse(t,n,s,s,0,2*Math.PI,0,!0),i.clip()}super.render(e)}
1finally{i.restore()}}else super.render(e)}setClipMask(e,t){const i=this.clipMask.get(e);null!=(0,n.G4M)(i,t)&&this.markDirty("CollidableLine"),t?this.clipMask.set(e,t):this.clipMask.delete(e)}},Hn=class extends s.n1.TransformableText{constructor(){super(...arguments),this.growCollisionBox={top:4,right:4,bottom:4,left:4}}isPointInPath(e,t){const i=this.fromParentPoint(e,t),n=this.computeBBoxWithoutTransforms();return!!n&&n.grow(this.growCollisionBox).containsPoint(i.x,i.y)}};function jn(e,t,i,s,a,o,r){if(!o||!a||!s)return void t.setClipMask(e);const{alignment:l,position:h}=s,c=_n(i,s.fontSize,r),{point:d,textBaseline:u}=Gn(c,h,l);Kn(a,o,s,d,c.angle,u);const{x:p,y:g,width:m,height:y}=a.getBBox(),f={x:p+m/2,y:g+y/2,radius:n.ZY9.length(n.ZY9.from(m,y))/2+n.ZY9.length(c.offset)};return"center"===h?t.setClipMask(e,f):t.setClipMask(e),{clipMask:f,numbers:c}}function Wn(e,t,i,n,s,a,o){if(!o||!a)return;const{alignment:r,position:l}=n,[h,c]=t.y1<=i.y1?[t,i]:[i,t];let d=h;"bottom"===l?d=c:"inside"===l&&(d={x1:(h.x1+c.x1)/2,y1:(h.y1+c.y1)/2,x2:(h.x2+c.x2)/2,y2:(h.y2+c.y2)/2});const u=_n(d,n.fontSize,s),{point:p,textBaseline:g}=Gn(u,"inside"===l?"center":l,r,e);Kn(a,o,n,p,u.angle,g)}function _n(e,t,i){let[s,a]=n.ZY9.from(e);s.x>a.x&&([s,a]=[a,s]);const o=n.ZY9.normalized(n.ZY9.sub(a,s));return{left:s,right:a,normal:o,angle:n.ZY9.angle(o),inset:n.ZY9.multiply(o,qi.HANDLE_SIZE/2+(t??14)/2),offset:n.ZY9.multiply(o,(i??2)/2+(t??14)/3)}}function Gn({left:e,right:t,normal:i,angle:s,inset:a,offset:o},r,l,h){let c;c="right"===l?n.ZY9.sub(t,a):"center"===l?n.ZY9.add(e,n.ZY9.multiply(i,n.ZY9.distance(e,t)/2)):n.ZY9.add(e,a);let d="bottom";return"bottom"===r?(c=n.ZY9.rotate(o,s+Math.PI/2,c),d="top"):"center"!==r||h?c=n.ZY9.rotate(o,s-Math.PI/2,c):d="middle",{point:c,textBaseline:d}}function Kn(e,t,i,n,s,a){e.setProperties({text:t,x:n.x,y:n.y,rotation:s,rotationCenterX:n.x,rotationCenterY:n.y,fill:i.color,fontFamily:i.fontFamily,fontSize:i.fontSize,fontStyle:i.fontStyle,fontWeight:i.fontWeight,textAlign:i.alignment,textBaseline:a})}var Yn=class extends Qi{constructor(){super(),this.type="cross-line",this.line=new $n,this.middle=new Zi,this.isHorizontal=!1,this.append([this.line,this.middle])}static is(e){return Qi.isCheck(e,"cross-line")}update(e,t){const{seriesRect:i}=t;this.seriesRect=i,this.isHorizontal=qt.is(e);const n=this.isHorizontal?t.yAxis:t.xAxis,s=this.convertCrossLine(e,n);null!=s?(this.visible=e.visible??!0,this.visible&&(this.updateLine(e,s),this.updateHandle(e,s),this.updateText(e,s),this.updateAxisLabel(e,n,s))):this.visible=!1}updateLine(e,t){const{line:i}=this,{lineDashOffset:n,stroke:s,strokeWidth:a,strokeOpacity:o}=e,{x1:r,y1:l,x2:h,y2:c}=t;i.setProperties({x1:r,y1:l,x2:h,y2:c,lineCap:e.getLineCap(),lineDash:e.getLineDash(),lineDashOffset:n,stroke:s,strokeWidth:a,strokeOpacity:o,fillOpacity:0})}updateHandle(e,t){const{middle:i}=this,{locked:s,stroke:a,strokeWidth:o,strokeOpacity:r}=e,l={fill:e.handle.fill,stroke:e.handle.stroke??a,strokeOpacity:e.handle.strokeOpacity??r,strokeWidth:e.handle.strokeWidth??o},h=n.ZY9.sub(n.Zbg.center(t),n.ZY9.from(i.handle.width/2,i.handle.height/2));i.gradient=this.isHorizontal?"horizontal":"vertical",i.update({...l,...h}),i.toggleLocked(s??!1)}updateText(e,t){this.text=this.updateNode(Hn,this.text,!!e.text.label),jn(this.line.id,this.line,t,e.text,this.text,e.text.label,e.strokeWidth)}createAxisLabel(e){const t=new Vn;return e.attachLabel(t),t}updateAxisLabel(e,t,i){this.axisLabel??(this.axisLabel=this.createAxisLabel(t));const{axisLabel:s,seriesRect:a}=this,{direction:o,position:r}=t;if(e.axisLabel.enabled){s.visible=this.visible;const l="left"===r||"top"===r?n.Zbg.start(i):n.Zbg.end(i),h=o===n.tv$.X?l.x:l.y;if(!t.inRange(h))return void(s.visible=!1);const c=ut(e.value);s.update({...n.ZY9.add(l,n.ZY9.required(a)),value:c,styles:e.axisLabel,context:t})}else s.visible=!1}setAxisLabelOpacity(e){this.axisLabel&&(this.axisLabel.opacity=e)}setAxisLabelVisible(e){this.axisLabel&&(this.axisLabel.visible=e)}toggleHandles(e){this.middle.visible=e,this.middle.toggleHovered("middle"===this.activeHandle)}destroy(){super.destroy(),this.axisLabel?.destroy()}toggleActive(e){this.toggleHandles(e),this.middle.toggleActive(e)}dragStart(e,t,i){const n=qt.is(e)?{x:t.x,y:mt(e.value,i.yAxis)}:{x:mt(e.value,i.xAxis),y:t.y};this.dragState={offset:t,middle:n}}drag(e,t,i){const{activeHandle:s,dragState:a}=this;e.isWriteable()&&a&&(s&&this[s].toggleDragging(!0),this.translatePoint(e,a.middle,n.ZY9.sub(t,a.offset),i))}translate(e,t,i){if(!e.isWriteable())return;const s=qt.is(e)?n.ZY9.from(0,mt(e.value,i.yAxis)):n.ZY9.from(mt(e.value,i.xAxis),0
1);this.translatePoint(e,s,t,i)}translatePoint(e,t,i,n){const s=qt.is(e);s?i.x=0:i.y=0;const{point:a}=an({point:t},i,n);e.value=s?a.y:a.x}stopDragging(){this.middle.toggleDragging(!1)}copy(e,t,i){const n=qt.is(e),s=this.isHorizontal?i.yAxis:i.xAxis,a=this.convertCrossLine(e,s);if(!a)return;const o=n?-30:0,r=n?0:-30,l=yt({x:a.x1+r,y:a.y1+o},i);return t.set({value:n?l.y:l.x}),t}getCursor(){return null==this.activeHandle?"pointer":this[this.activeHandle].getCursor()}containsPoint(e,t){const{middle:i,line:n,text:s}=this;return this.activeHandle=void 0,i.containsPoint(e,t)?(this.activeHandle="middle",!0):n.isPointInPath(e,t)||Boolean(s?.containsPoint(e,t))}getNodeAtCoords(e,t){return this.text?.containsPoint(e,t)?"text":this.line.isPointInPath(e,t)?"line":this.middle.containsPoint(e,t)?"handle":void 0}getAnchor(){const e=this.computeBBoxWithoutHandles();return this.isHorizontal?{x:e.x+e.width/2,y:e.y}:{x:e.x+e.width,y:e.y+e.height/2,position:"right"}}convertCrossLine(e,t){if(null==e.value)return;let i,n,s=0,a=0;const{bounds:o}=t,r=mt(e.value,t);return qt.is(e)?(i=o.width,a=r,n=r):(s=r,i=r,n=o.height),{x1:s,y1:a,x2:i,y2:n}}},Un=(()=>{var e=class extends n.Z37{constructor(e,t){const i=({point:i})=>{const n="horizontal"===e,s=n?new qt:new Qt;s.set({value:n?i.y:i.x}),t.create(s),t.recordAction(`Create ${n?"horizontal-line":"vertical-line"} annotation`)};super("start",{start:{click:{target:"waiting-first-render",action:i},drag:{target:"waiting-first-render",action:i},reset:n.Z37.parent,cancel:n.Z37.parent},"waiting-first-render":{render:{target:n.Z37.parent,action:()=>{this.node?.toggleActive(!0),t.showAnnotationOptions(),t.update()}}}}),this.debug=n.yar.create(!0,"annotations")}};return l([(0,n.m9s)()],e.prototype,"node",2),e})(),Xn={type:"horizontal-line",datum:qt,scene:Yn,isDatum:qt.is,translate:(e,t,i,n)=>{qt.is(t)&&Yn.is(e)&&e.translate(t,i,n)},copy:(e,t,i,n)=>{if(qt.is(t)&&qt.is(i)&&Yn.is(e))return e.copy(t,i,n)},update:(e,t,i)=>{qt.is(t)&&Yn.is(e)&&e.update(t,i)},createState:(e,{createDatum:t})=>new Un("horizontal",{...e,create:t("horizontal-line")}),dragState:e=>new _i(e)},Zn={type:"vertical-line",datum:Qt,scene:Yn,isDatum:Qt.is,translate:(e,t,i,n)=>{Qt.is(t)&&Yn.is(e)&&e.translate(t,i,n)},copy:(e,t,i,n)=>{if(Qt.is(t)&&Qt.is(i)&&Yn.is(e))return e.copy(t,i,n)},update:(e,t,i)=>{Qt.is(t)&&Yn.is(e)&&e.update(t,i)},createState:(e,{createDatum:t})=>new Un("vertical",{...e,create:t("vertical-line")}),dragState:e=>new _i(e)}
1,qn=class{static updateBackground(e,t,i,s){const{background:a}=this,{seriesRect:o}=s;a.path.clear(!0);const r=n.Zbg.from(0,0,o.width,o.height),l=this.getBackgroundPoints(e,t,i,r);for(let e=0;e<l.length;e++){const t=l[e];0===e?a.path.moveTo(t.x,t.y):a.path.lineTo(t.x,t.y)}a.path.closePath(),a.checkPathDirty();const h=this.getBackgroundStyles?.(e)??e.background;a.fill=h.fill,a.fillOpacity=h.fillOpacity??1}},Qn=class extends Sn{constructor(){super(...arguments),this.handles={},this.overflowContinuous=2,this.topLine=new $n,this.bottomLine=new $n,this.background=new s.n1.Path({zIndex:-1}),this.anchor={x:0,y:0},this.updateBackground=qn.updateBackground.bind(this)}update(e,t){const{locked:i,visible:n}=e,s=pt(e,t),a=pt(e.getBottom(t.logger),t);if(null==s||null==a)return void(this.visible=!1);this.visible=n??!0;const o=this.extendLine(s,e,t),r=this.extendLine(a,e,t);this.updateLines(e,o,r,t,s,a),this.updateHandles(e,s,a),this.updateText(e,s,a),this.updateBackground(e,o,r,t),this.updateAnchor(s,a);for(const e of Object.values(this.handles))e.toggleLocked(i??!1)}toggleHandles(e){const{handles:t}=this;if("boolean"!=typeof e)for(const[i,n]of Object.entries(e)){const e=t[i];e.visible=n??!0,e.toggleHovered(this.activeHandle===i)}else for(const[i,n]of Object.entries(t))n.visible=e,n.toggleHovered(this.activeHandle===i)}toggleActive(e){this.toggleHandles(e);for(const t of Object.values(this.handles))t.toggleActive(e)}stopDragging(){const{activeHandle:e,handles:t}=this;null!=e&&t[e].toggleDragging(!1)}getAnchor(){return this.anchor}getCursor(){return null==this.activeHandle?"pointer":this.handles[this.activeHandle].getCursor()}containsPoint(e,t){const{handles:i,topLine:n,bottomLine:s,text:a}=this;this.activeHandle=void 0;for(const[n,s]of Object.entries(i))if(s.containsPoint(e,t))return this.activeHandle=n,!0;return n.containsPoint(e,t)||s.containsPoint(e,t)||Boolean(a?.containsPoint(e,t))}getNodeAtCoords(e,t){if(this.text?.containsPoint(e,t))return"text";if(this.topLine.containsPoint(e,t)||this.bottomLine.containsPoint(e,t))return"line";for(const[,i]of Object.entries(this.handles))if(i.containsPoint(e,t))return"handle"}updateAnchor(e,t){const i=s.n1.Transformable.toCanvasPoint(this.topLine,(e.x1+e.x2)/2,Math.min(e.y1,e.y2,t.y1,t.y2));this.anchor.x=i.canvasX,this.anchor.y=i.canvasY}},Jn=class extends Qn{constructor(){super(),this.type="disjoint-channel",this.handles={topLeft:new qi,topRight:new qi,bottomLeft:new qi,bottomRight:new Zi},this.append([this.background,this.topLine,this.bottomLine,...Object.values(this.handles)])}static is(e){return Qi.isCheck(e,"disjoint-channel")}dragHandle(e,t,i,s){const{activeHandle:a,handles:o}=this;if(null==a)return;const{offset:r}=o[a].drag(t);o[a].toggleDragging(!0),"bottomRight"===a&&(r.x=0);let l=[],h=[],c=s;switch(a){case"topLeft":l=["topLeft"],h=["bottomLeft"];break;case"bottomLeft":l=["bottomLeft"],h=["topLeft"];break;case"topRight":l=["topRight"],h=["bottomRight"];break;case"bottomRight":l=["bottomLeft","bottomRight"],c=!1}const d=pt(e,i),u=pt(e.getBottom(i.logger),i);if(!d||!u)return;const p={topLeft:n.Zbg.start(d),topRight:n.Zbg.end(d),bottomLeft:n.Zbg.start(u),bottomRight:n.Zbg.end(u)},g={vectors:{topLeft:p.topRight,bottomLeft:p.bottomRight,topRight:p.topLeft,bottomRight:p.bottomLeft},angle:e.snapToAngle},m=an(p,r,i,{overflowContinuous:this.overflowContinuous,translateVectors:l,invertYVectors:h,snap:c?g:void 0});e.start.x=m.topLeft.x,e.start.y=m.topLeft.y,e.end.x=m.topRight.x,e.end.y=m.topRight.y,e.startHeight=m.topLeft.y-m.bottomLeft.y,e.endHeight=m.topRight.y-m.bottomRight.y}getTranslatePointsVectors(e,t){const{bottomLeft:i,bottomRight:s,topLeft:a,topRight:o}=this.handles,r=i.getBBox().y-a.getBBox().y,l=s.getBBox().y-o.getBBox().y;return{start:e,end:t,bottomStart:n.ZY9.add(e,n.ZY9.from(0,r)),bottomEnd:n.ZY9.add(t,n.ZY9.from(0,l))}}updateLines(e,t,i){const{topLine:n,bottomLine:s}=this,{lineDashOffset:a,stroke:o,strokeOpacity:r,strokeWidth:l}=e,h={lineCap:e.getLineCap(),lineDash:e.getLineDash(),lineDashOffset:a,stroke:o,strokeOpacity:r,strokeWidth:l};n.setProperties({...t,...h}),s.setProperties({...i,...h})}updateHandles(e,t,i){const{handles:{topLeft:s,topRight:a,bottomLeft:o,bottomRight:r}}=this,l={fill:e.handle.fill,stroke:e.handle.stroke??e.stroke,strokeOpacity:e.handle.strokeOpacity??e.strokeOpacity,strokeWidth:e.handle.strokeWidth??e.strokeWidth};s.update({...l,...n.Zbg.start(t)}),a.update({...l,...n.Zbg.end(t)}),o.update({...l,...n.Zbg.start(i)}),r.update({...l,...n.ZY9.sub(n.Zbg.end(i),n.ZY9.from(r.handle.width/2,r.handle.height/2))})}updateText(e,t,i){this.text=this.updateNode(Hn,this.text,!!e.text.label),Wn(!1,t,i,e.text,e.strokeWidth,this.text,e.text.label)}
1getBackgroundPoints(e,t,i,s){const a=t.x1>t.x2,o=t.y1>t.y2,r=o?s.y2:s.y1,l=o?s.y1:s.y2,h=n.ZY9.from(t);return e.extendEnd&&t.y2===l&&h.push(n.ZY9.from(a?s.x1:s.x2,o?s.y1:s.y2)),e.extendEnd&&i.y2===r&&h.push(n.ZY9.from(a?s.x1:s.x2,o?s.y2:s.y1)),h.push(...n.ZY9.from(i).reverse()),e.extendStart&&i.y1===l&&h.push(n.ZY9.from(a?s.x2:s.x1,o?s.y1:s.y2)),e.extendStart&&t.y1===r&&h.push(n.ZY9.from(a?s.x2:s.x1,o?s.y2:s.y1)),h}},es=(()=>{var e=class extends n.Z37{constructor(e){const t=({point:t})=>{const i=new Jt;i.set({start:t,end:t,startHeight:0,endHeight:0}),e.create(i)},i=({offset:t,context:i})=>{const{datum:n,snapping:s}=this;n&&(n.set({end:tn(t,i,s,n.start,n.snapToAngle)}),e.update())},s=()=>{this.node?.toggleHandles({topRight:!0}),e.update()},a=({point:t})=>{const{datum:i,node:s}=this,a=ut(i?.end.y),o=ut(i?.start.y),{y:r}=t;if(null==i||!(0,n.EtT)(o)||!(0,n.EtT)(a)||!(0,n.EtT)(r))return;const l=a-(r??0),h=2*(o-a)+l,c={x:i.start.x,y:o-l},d={x:i.end.x,y:t.y};s?.toggleHandles(!0),e.validatePoint(c,{overflowContinuous:!0})&&e.validatePoint(d,{overflowContinuous:!0})&&(i.set({startHeight:h,endHeight:l}),e.recordAction("Create disjoint-channel annotation"),e.showAnnotationOptions(),e.update())},o=()=>e.delete();super("start",{start:{click:{target:"waiting-first-render",action:t},drag:{target:"waiting-first-render",action:t},reset:n.Z37.parent},"waiting-first-render":{render:{target:"end",action:()=>{const{node:e}=this;e?.toggleActive(!0),e?.toggleHandles({topLeft:!0,topRight:!1,bottomLeft:!1,bottomRight:!1})}}},end:{hover:i,drag:i,click:{target:"height",action:s},dragEnd:{target:"height",action:s},reset:{target:n.Z37.parent,action:o},cancel:{target:n.Z37.parent,action:o}},height:{hover:({point:t})=>{const{datum:i,node:s}=this,a=ut(i?.end.y),o=ut(i?.start.y),{y:r}=t;if(null==i||!(0,n.EtT)(o)||!(0,n.EtT)(a)||!(0,n.EtT)(r))return;const l=a-(r??0),h=2*(o-a)+l,c={x:i?.start.x,y:o-h},d={x:i?.end.x,y:t.y};s?.toggleHandles({bottomLeft:!0,bottomRight:!0}),e.validatePoint(c,{overflowContinuous:!0})&&e.validatePoint(d,{overflowContinuous:!0})&&(i.set({startHeight:h,endHeight:l}),e.update())},click:{target:n.Z37.parent,action:a},drag:{target:n.Z37.parent,action:a},reset:{target:n.Z37.parent,action:o},cancel:{target:n.Z37.parent,action:o}}}),this.debug=n.yar.create(!0,"annotations"),this.snapping=!1}};return l([(0,n.m9s)()],e.prototype,"datum",2),l([(0,n.m9s)()],e.prototype,"node",2),l([(0,n.m9s)()],e.prototype,"snapping",2),e})(),ts={type:"disjoint-channel",datum:Jt,scene:Jn,isDatum:Jt.is,translate:(e,t,i,n)=>{Jt.is(t)&&Jn.is(e)&&e.translate(t,i,n)},copy:(e,t,i,n)=>{if(Jt.is(t)&&Jt.is(i)&&Jn.is(e))return e.copy(t,i,n)},update:(e,t,i)=>{Jt.is(t)&&Jn.is(e)&&e.update(t,i)},createState:(e,{createDatum:t})=>new es({...e,create:t("disjoint-channel")}),dragState:e=>new _i(e)},is=[0,23.6,38.2,50,61.8,78.6,100],ns={10:[...is,161.8,261.8,361.8,423.6],6:is,4:[0,38.2,50,61.8,100]};function ss({x1:e,y1:t,x2:i,y2:n},s,a,o,r=10){const l=t-n,h=a?-1:1,c=[],{yAxis:d,isRtl:u}=s;let p=o;for(const[t,n]of ns[r].entries()){const s=o+l*(n/100)*h,a=d.scaleInvert(s);c.push({id:t,x1:e,x2:i,y1:p,y2:s,tag:100==n?0:1,label:{x1:u?Math.max(e,i)+10:Math.min(e,i)-10,x2:i,y1:s,y2:s,text:u?`(${a.toFixed(2)}) ${(n/100).toFixed(3)}`:`${(n/100).toFixed(3)} (${a.toFixed(2)})`}}),p=s}return c}var as=class extends Qi{constructor(){super(),this.trendLine=new $n,this.rangeFillsGroup=new s.n1.Group({name:`${this.id}-range-fills`}),this.rangeFillsGroupSelection=s.n1.Selection.select(this.rangeFillsGroup,s.n1.Range),this.rangeStrokesGroup=new s.n1.Group({name:`${this.id}-range-strokes`}),this.rangeStrokesGroupSelection=s.n1.Selection.select(this.rangeStrokesGroup,$n),this.labelsGroup=new s.n1.Group({name:`${this.id}-ranges-labels`}),this.labelsGroupSelection=s.n1.Selection.select(this.labelsGroup,Hn),this.anchor={x:0,y:0,position:"above"},this.append([this.trendLine,this.rangeFillsGroup,this.rangeStrokesGroup,this.labelsGroup])}update(e,t){let i=pt(e,t);if(null==i)return void(this.visible=!1);if(i=n.Zbg.round(i),this.visible=e.visible??!0,!this.visible)return;this.updateLine(e,i,this.trendLine),this.updateHandles(e,i),this.updateAnchor(e,i,t);const{reverse:s}=e,a=this.extendLine(i,e,t),o=s?a.y1:a.y2,r=s?a.y2:a.y1,l=ss(a,t,e.reverse,o,e.bands);this.updateRanges(e,l,t);const h={...a,y1:r,y2:r};this.updateText(e,h)}extendLine({x1:e,y1:t,x2:i,y2:n},s,a){const o={x1:e,y1:t,x2:i,y2:n};if(!s.extendStart&&!s.extendEnd)return o;const{x:r,width:l}=a.xAxis.bounds;return s.extendEnd&&(o[e>i?"x1":"x2"]=r+l),s.extendStart&&(o[e>i?"x2":"x1"]=r),o}updateLine(e,t,i){if(!t||!i)return;const{lineDashOffset:n,strokeWidth:s,strokeOpacity:a,stroke:o}=e;i.setProperties({...t,lineCap:e.getLineCap(),lineDash:[3,4],lineDashOffset:n,strokeWidth:s,strokeOpacity:a,fillOpacity:0,stroke:o})}updateRangeStrokes(e){const{lineDashOffset:t,strokeWidth:i,strokeOpacity:n,strokes:s,rangeStroke:a,isMultiColor:o}=e;this.rangeStrokesGroupSelection.each(((r,{x1:l,x2:h,y2:c,tag:d},u)=>
1{const p=c,g=o?s[u%s.length]:a;r.setProperties({x1:l,x2:h,y1:p,y2:p,stroke:g,strokeOpacity:n,strokeWidth:i,lineCap:e.getLineCap(),lineDash:e.getLineDash(),lineDashOffset:t,tag:d})}))}updateRanges(e,t,i){const n=e=>e.id;this.rangeFillsGroupSelection.update(t,void 0,n),this.rangeStrokesGroupSelection.update(t,void 0,n),this.labelsGroupSelection.update(t,void 0,n),this.updateRangeFills(e),this.updateRangeStrokes(e),this.updateRangeLabels(e,i)}updateRangeFills(e){const{lineDashOffset:t,strokeWidth:i,strokeOpacity:n,strokes:s,rangeStroke:a,showFill:o,isMultiColor:r}=e;this.rangeFillsGroupSelection.each(((l,{x1:h,x2:c,y1:d,y2:u},p)=>{const g=r?s[p%s.length]:a;o?l.setProperties({x1:h,x2:c,y1:d,y2:u,startLine:!1,endLine:!1,stroke:g,strokeOpacity:n,fill:g,fillOpacity:.15*(n??1),strokeWidth:i,lineCap:e.getLineCap(),lineDash:e.getLineDash(),lineDashOffset:t,visible:!0}):l.visible=!1}))}updateRangeLabels(e,{xAxis:t,isRtl:i}){const{rangeStrokesGroupSelection:n}=this,{strokes:s,strokeWidth:a,rangeStroke:o,isMultiColor:r,label:{fontFamily:l,fontSize:h,fontStyle:c,fontWeight:d,color:u}}=e,p={fontFamily:l,fontSize:h,fontStyle:c,fontWeight:d},g=this.checkWithinBounds(t,p,i,this.labelsGroupSelection.at(0));this.labelsGroupSelection.each(((e,t,l)=>{const h=u??(r?s[l%s.length]:o),c=n.at(l);if(!c)return;const{text:d,...m}=t.label;if(g)e.setProperties({...p,text:d,x:m.x1,y:m.y1,textBaseline:"middle",textAlign:i?"left":"end",fill:h}),jn(e.id,c,m);else{const t={...p,label:d,position:"center",alignment:i?"right":"left",color:h};jn(e.id,c,m,t,e,d,a)}}))}checkWithinBounds(e,t,i,n){if(!n)return!1;const{text:s,...a}=n.unsafeNonNullDatum.label;n.setProperties({...t,text:s,x:a.x1,y:a.y1,textBaseline:"middle",textAlign:i?"left":"end"});const o=n.getBBox(),r=o.x,l=o.x+o.width,h=e.bounds.x,c=e.bounds.x+e.bounds.width;return r>=h&&l<=c}updateText(e,t){const i=this.rangeStrokesGroupSelection.selectByTag(0)[0];if(!i)return;const{text:n,strokeWidth:s}=e;this.text=this.updateNode(Hn,this.text,!!n.label),jn(i.id,i,t,n,this.text,n.label,s)}updateAnchor(e,t,i,n){on(this.trendLine,this.anchor,t)}containsPoint(e,t){const{trendLine:i,rangeStrokesGroupSelection:n,text:s}=this;let a=!1;return n.each((i=>a||(a=i.isPointInPath(e,t)))),a||i.isPointInPath(e,t)||Boolean(s?.containsPoint(e,t))}getNodeAtCoords(e,t){return this.text?.containsPoint(e,t)?"text":this.trendLine.isPointInPath(e,t)?"line":void 0}getHandleStyles(e){return{fill:e.handle.fill,stroke:e.handle.stroke??e.stroke,strokeOpacity:e.handle.strokeOpacity??e.strokeOpacity,strokeWidth:e.handle.strokeWidth??e.strokeWidth}}drag(e,t,i,n){e.isWriteable()&&(this.activeHandle?this.dragHandle(e,t,i,n):this.dragAll(e,t,i))}getAnchor(){return this.anchor}getCursor(){return"pointer"}},{ContinuousScale:os}=s.n1;function rs(e,t,i={overflowContinuous:!1},n){if(null==t.x||null==t.y)return n&&e.logger.warnOnce(`${n}requires both an [x] and [y] property, ignoring.`),!1;const{xAxis:s,yAxis:a}=e,o=i.overflowContinuous&&os.is(s.scale),r=i.overflowContinuous&&os.is(a.scale),l=o||ls(t.x,s),h=r||ls(t.y,a);if(l&&h)return!0;if(n){let i="x & y domains";l&&(i="y domain"),h&&(i="x domain");const s=ut(t.x),a=ut(t.y);e.logger.warnOnce(`${n}is outside the ${i}, ignoring. - x: [${s}], y: ${a}]`)}return!1}function ls(e,t){const{domain:i}=t.scale,n=ut(e);return!i||null==n||!t.continuous||n>=i[0]&&n<=i.at(-1)}var hs=class extends as{constructor(){super(),this.type="fibonacci-retracement-trend-based",this.endRetracementLine=new $n,this.start=new qi,this.end=new qi,this.endRetracement=new qi,this.append([this.endRetracementLine,this.start,this.end,this.endRetracement])}static is(e){return Qi.isCheck(e,"fibonacci-retracement-trend-based")}update(e,t){let{coords1:i,coords2:s}=this.getCoords(e,t);if(null==i||null==s)return void(this.visible=!1);if(i=n.Zbg.round(i),s=n.Zbg.round(s),this.visible=e.visible??!0,!this.visible)return;null!=e.endRetracement.x&&null!=e.endRetracement.y||(s=void 0),this.updateLine(e,i,this.trendLine),this.updateLine(e,s,this.endRetracementLine),this.updateHandles(e,i,s),this.updateAnchor(e,s??i,t);const{reverse:a,bands:o}=e,r=function(e,t){const{x2:i,y1:n,y2:s}=e,a=n-s;return null==t?{x1:i,x2:i,y1:s-a,y2:s}:{x1:t.x1,x2:t.x2,y1:t.y2-a,y2:t.y2}}(i,s),l=this.extendLine(r,e,t),h=l.y2,c=l.y1,d=s?ss(l,t,a,h,o):[];this.updateRanges(e,d,t);const u={...l,y1:c,y2:c};this.updateText(e,u)}containsPoint(e,t){const{start:i,end:n,endRetracement:s,endRetracementLine:a}=this;return this.activeHandle=void 0,i.containsPoint(e,t)?(this.activeHandle="start",!0):n.containsPoint(e,t)?(this.activeHandle="end",!0):s.containsPoint(e,t)?(this.activeHandle="endRetracement",!0):a.isPointInPath(e,t)||super.containsPoint(e,t)}getNodeAtCoords(e,t){return this.start.containsPoint(e,t)||this.end.containsPoint(e,t)||this.endRetracement.containsPoint(e,t)?"handle":this.endRetracementLine.isPointInPath(e,t)?"line":super.getNodeAtCoords(e,t)}dragStart(e,t,i){this.dragState={offset:t,...sn({start:e.start,end:e.end,endRetracement:e.endRetracement},i)}}stopDragging(){this.start.toggleDragging(!1),this.end.toggleDragging(!1),this.endRetracement.toggleDragging(!1)}dragAll(e,t,i){const{dragState:s}=this;s&&this.translatePoints({datum:e,start:s.start,end:s.end,endRetracement:s.endRetracement,translation:n.ZY9.sub(t,s.offset),context:i})}dragHandle(e,t,i,n){const{activeHandle:s,dragState:a}=this;if(!s||!a)return;this[s].toggleDragging(!0);const o=n?this.snapToAngle(e,t,i):yt(this[s].drag(t).point,i);o&&rs(i,o)&&(e[s].x=o.x,e[s].y=o.y)}snapToAngle(e,t,i){const{activeHandle:n}=this,s=["start","end","endRetracement"];if(!n)return;const a=(s.indexOf(n)+1)%s.length,o=s[a];this[n].toggleDragging(!0);return yt(nn(t,gt(e[o],i),e.snapToAngle),i)}translatePoints({datum:e,start:t,end:i,endRetracement:n,translation:s,context:a}){const o=an({start:t,end:i,endRetracement:n},s,a,{overflowContinuous:2});e.start.x=o.start.x,e.end.x=o.end.x,e.endRetracement.x=o.endRetracement.x,e.start.y=o.start.y,e.end.y=o.end.y,e.endRetracement.y=o.endRetracement.y}translate(e,t,i){this.translatePoints({datum:e,start:gt(e.start,i),end:gt(e.end,i),endRetracement:gt(e.endRetracement,i),translation:t,context:i})}copy(e,t,i){const{coords1:s,coords2:a}=this.getCoords(e,i);if(!s||!a)return;const o=this.computeBBoxWithoutHandles();return this.translatePoints({datum:t,start:n.Zbg.start(s),end:n.Zbg.end(s),endRetracement:n.Zbg.end(a),translation:{x:-o.width/2,y:-o.height/2},context:i}),t}
1getCoords(e,t){return{coords1:pt(e,t),coords2:pt({start:e.end,end:e.endRetracement},t)}}toggleHandles(e){if("boolean"==typeof e)this.start.visible=e,this.end.visible=e,this.endRetracement.visible=e;else for(const[t,i]of(0,n.jOZ)(e))this[t].visible=i;this.start.toggleHovered("start"===this.activeHandle),this.end.toggleHovered("end"===this.activeHandle),this.endRetracement.toggleHovered("endRetracement"===this.activeHandle)}toggleActive(e){this.toggleHandles(e),this.start.toggleActive(e),this.end.toggleActive(e),this.endRetracement.toggleActive(e)}updateHandles(e,t,i,n){this.start.update({...this.getHandleStyles(e),...this.getHandleCoords(e,t,"start")}),this.end.update({...this.getHandleStyles(e),...this.getHandleCoords(e,t,"end",n)}),i&&this.endRetracement.update({...this.getHandleStyles(e),...this.getHandleCoords(e,i,"endRetracement",n)}),this.start.toggleLocked(e.locked??!1),this.end.toggleLocked(e.locked??!1),this.endRetracement.toggleLocked(e.locked??!1)}getHandleCoords(e,t,i,s){return"start"===i?n.Zbg.start(t):n.Zbg.end(t)}},cs=(()=>{var e=class extends n.Z37{constructor(e){const t=({point:t})=>{const i=this.createDatum();i.set({start:t,end:t}),e.create(i)},i=({offset:t,context:i})=>{const{datum:n,snapping:s}=this;n&&(n.set({end:tn(t,i,s,n.start,n.snapToAngle)}),e.update())},s=()=>{const{datum:t}=this;t&&(t.endRetracement.x=t.end.x,t.endRetracement.y=t.end.y,this.node?.toggleHandles({end:!0}),e.update())},a=()=>{this.node?.toggleHandles({endRetracement:!0}),e.update()},o=()=>e.delete();super("start",{start:{click:{target:"waiting-first-render",action:t},drag:{target:"waiting-first-render",action:t},reset:n.Z37.parent},"waiting-first-render":{render:{target:"end",action:()=>{const{node:e}=this;e?.toggleActive(!0),e?.toggleHandles({start:!0,end:!1,endRetracement:!1})}}},end:{hover:i,click:{target:"endRetracement",action:s},drag:i,dragEnd:{target:"endRetracement",action:s},reset:{target:n.Z37.parent,action:o},cancel:{target:n.Z37.parent,action:o},onExit:()=>{e.showAnnotationOptions(),e.recordAction(`Create ${this.datum?.type} annotation`)}},endRetracement:{hover:({offset:t,context:i})=>{const{datum:n,snapping:s}=this;n&&(n.set({endRetracement:tn(t,i,s,n.end,n.snapToAngle)}),e.update())},click:{target:n.Z37.parent,action:a},drag:{target:n.Z37.parent,action:a},reset:{target:n.Z37.parent,action:o},cancel:{target:n.Z37.parent,action:o}}}),this.debug=n.yar.create(!0,"annotations"),this.snapping=!1}createDatum(){return new si}};return l([(0,n.m9s)()],e.prototype,"datum",2),l([(0,n.m9s)()],e.prototype,"node",2),l([(0,n.m9s)()],e.prototype,"snapping",2),e})(),ds={type:"fibonacci-retracement-trend-based",datum:si,scene:hs,isDatum:si.is,translate:(e,t,i,n)=>{si.is(t)&&hs.is(e)&&e.translate(t,i,n)},copy:(e,t,i,n)=>{if(si.is(t)&&si.is(i)&&hs.is(e))return e.copy(t,i,n)},update:(e,t,i)=>{si.is(t)&&hs.is(e)&&e.update(t,i)},createState:(e,{createDatum:t})=>new cs({...e,create:t("fibonacci-retracement-trend-based")}),dragState:e=>new _i(e)},us=class extends as{constructor(){super(),this.type="fibonacci-retracement",this.start=new qi,this.end=new qi,this.append([this.start,this.end])}static is(e){return Qi.isCheck(e,"fibonacci-retracement")}containsPoint(e,t){const{start:i,end:n}=this;return this.activeHandle=void 0,i.containsPoint(e,t)?(this.activeHandle="start",!0):n.containsPoint(e,t)?(this.activeHandle="end",!0):super.containsPoint(e,t)}getNodeAtCoords(e,t){return this.start.containsPoint(e,t)||this.end.containsPoint(e,t)?"handle":super.getNodeAtCoords(e,t)}dragStart(e,t,i){this.dragState={offset:t,...sn({start:e.start,end:e.end},i)}}stopDragging(){this.start.toggleDragging(!1),this.end.toggleDragging(!1)}dragAll(e,t,i){const{dragState:s}=this;s&&this.translatePoints({datum:e,start:s.start,end:s.end,translation:n.ZY9.sub(t,s.offset),context:i})}dragHandle(e,t,i,n){const{activeHandle:s,dragState:a}=this;if(!s||!a)return;this[s].toggleDragging(!0);const o=n?this.snapToAngle(e,t,i):yt(this[s].drag(t).point,i);o&&rs(i,o)&&(e[s].x=o.x,e[s].y=o.y)}snapToAngle(e,t,i){const{activeHandle:n}=this,s=["start","end"].find((e=>e!==n));if(!n||!s)return;this[n].toggleDragging(!0);return yt(nn(t,gt(e[s],i),e.snapToAngle),i)}translatePoints({datum:e,start:t,end:i,translation:n,context:s}){const a=an({start:t,end:i},n,s,{overflowContinuous:1});e.start.x=a.start.x,e.end.x=a.end.x,e.start.y=a.start.y,e.end.y=a.end.y}translate(e,t,i){this.translatePoints({datum:e,start:gt(e.start,i),end:gt(e.end,i),translation:t,context:i})}copy(e,t,i){const n=pt(e,i);if(!n)return;const s=this.computeBBoxWithoutHandles();return this.translatePoints({datum:t,start:{x:n.x1,y:n.y1},end:{x:n.x2,y:n.y2},translation:{x:-s.width/2,y:-s.height/2},context:i}),t}toggleHandles(e){if("boolean"==typeof e)this.start.visible=e,this.end.visible=e;else for(const[t,i]of(0,n.jOZ)(e))this[t].visible=i;this.start.toggleHovered("start"===this.activeHandle),this.end.toggleHovered("end"===this.activeHandle)}toggleActive(e){this.toggleHandles(e),this.start.toggleActive(e),this.end.toggleActive(e)}updateHandles(e,t,i,n){this.start.update({...this.getHandleStyles(e),...this.getHandleCoords(e,t,"start")}),this.end.update({...this.getHandleStyles(e),...this.getHandleCoords(e,t,"end",n)}),this.start.toggleLocked(e.locked??!1),this.end.toggleLocked(e.locked??!1)}getHandleCoords(e,t,i,s){return"start"===i?n.Zbg.start(t):n.Zbg.end(t)}},ps=(()=>{var e=class extends n.Z37{constructor(e){const t=({point:t})=>{const i=this.createDatum();i.set({start:t,end:t}),e.create(i)},i=({offset:t,context:i})=>{const{datum:n,snapping:s}=this;n&&(n.set({end:tn(t,i,s,n.start,n.snapToAngle)}
1),e.update())},s=()=>{this.node?.toggleHandles({end:!0}),e.update()},a=()=>e.delete();super("start",{start:{click:{target:"waiting-first-render",action:t},drag:{target:"waiting-first-render",action:t},reset:n.Z37.parent},"waiting-first-render":{render:{target:"end",action:()=>{const{node:e}=this;e?.toggleActive(!0),e?.toggleHandles({start:!0,end:!1})}}},end:{hover:i,click:{target:n.Z37.parent,action:s},drag:i,dragEnd:{target:n.Z37.parent,action:s},reset:{target:n.Z37.parent,action:a},cancel:{target:n.Z37.parent,action:a},onExit:()=>{e.showAnnotationOptions(),e.recordAction(`Create ${this.datum?.type} annotation`)}}}),this.debug=n.yar.create(!0,"annotations"),this.snapping=!1}};return l([(0,n.m9s)()],e.prototype,"datum",2),l([(0,n.m9s)()],e.prototype,"node",2),l([(0,n.m9s)()],e.prototype,"snapping",2),e})(),gs=class extends ps{createDatum(){return new ti}},ms=class extends ps{createDatum(){return new ii}},ys=class extends ps{createDatum(){return new ai}},fs={type:"fibonacci-retracement",datum:ai,scene:us,isDatum:ai.is,translate:(e,t,i,n)=>{ai.is(t)&&us.is(e)&&e.translate(t,i,n)},copy:(e,t,i,n)=>{if(ai.is(t)&&ai.is(i)&&us.is(e))return e.copy(t,i,n)},update:(e,t,i)=>{ai.is(t)&&us.is(e)&&e.update(t,i)},createState:(e,{createDatum:t})=>new ys({...e,create:t("fibonacci-retracement")}),dragState:e=>new _i(e)},xs=class extends s.n1.Group{},bs=class extends xs{constructor(){super(),this.type="arrow",this.path=new s.n1.Path,this.armLength=6,this.append([this.path])}update(e){const{path:t}=this,{x:i,y:s,angle:a,...o}=e,r=n.ZY9.from(i,s),l=3*Math.PI/4,h=this.armLength+2*(e.strokeWidth??0),c=n.ZY9.rotate(n.ZY9.from(0,h),a+l,r),d=n.ZY9.rotate(n.ZY9.from(h,0),a-l,r);t.setProperties(o),t.fillOpacity=0,t.path.clear(),t.path.moveTo(c.x,c.y),t.path.lineTo(r.x,r.y),t.path.lineTo(d.x,d.y)}},vs=class extends Mn{constructor(){super(),this.type="line",this.line=new $n,this.append([this.line,this.start,this.end])}static is(e){return Qi.isCheck(e,"line")}update(e,t){let i=pt(e,t);null!=i?(i=n.Zbg.round(i),this.visible=e.visible??!0,this.visible&&(this.updateLine(e,i,t),this.updateHandles(e,i),this.updateText(e,i),this.updateCaps(e,i),this.updateAnchor(e,i,t))):this.visible=!1}updateLine(e,t,i){const{line:n}=this,{lineDashOffset:s,stroke:a,strokeWidth:o,strokeOpacity:r}=e,l=this.extendLine(t,e,i);n.setProperties({...l,lineCap:e.getLineCap(),lineDash:e.getLineDash(),lineDashOffset:s,stroke:a,strokeWidth:o,strokeOpacity:r,fillOpacity:0})}updateText(e,t){this.text=this.updateNode(Hn,this.text,!!e.text.label),jn(this.line.id,this.line,t,e.text,this.text,e.text.label,e.strokeWidth)}updateCaps(e,t){if(!e.startCap&&this.startCap&&(this.startCap.remove(),this.startCap=void 0),!e.endCap&&this.endCap&&(this.endCap.remove(),this.endCap=void 0),!e.startCap&&!e.endCap)return;const{stroke:i,strokeWidth:s,strokeOpacity:a}=e,[o,r]=n.ZY9.from(t),l=n.ZY9.angle(n.ZY9.sub(r,o));e.startCap&&(this.startCap&&this.startCap.type!==e.startCap&&(this.startCap.remove(),this.startCap=void 0),null==this.startCap&&(this.startCap=new bs,this.append([this.startCap])),this.startCap.update({x:o.x,y:o.y,angle:l-Math.PI,stroke:i,strokeWidth:s,strokeOpacity:a})),e.endCap&&(this.endCap&&this.endCap.type!==e.endCap&&(this.endCap.remove(),this.endCap=void 0),null==this.endCap&&(this.endCap=new bs,this.append([this.endCap])),this.endCap.update({x:r.x,y:r.y,angle:l,stroke:i,strokeWidth:s,strokeOpacity:a}))}updateAnchor(e,t,i,n){on(this.line,this.anchor,t)}containsPoint(e,t){const{line:i,text:n}=this;return super.containsPoint(e,t)||i.isPointInPath(e,t)||Boolean(n?.containsPoint(e,t))}getNodeAtCoords(e,t){return this.text?.containsPoint(e,t)?"text":this.line.isPointInPath(e,t)?"line":super.getNodeAtCoords(e,t)}getHandleCoords(e,t,i,s){const{startCap:a,endCap:o}=this;let[r,l]=n.ZY9.from(t);const h=n.ZY9.angle(n.ZY9.sub(l,r));return a&&(r=n.ZY9.rotate(n.ZY9.from(0,-qi.HANDLE_SIZE/2),h,r)),o&&(l=n.ZY9.rotate(n.ZY9.from(0,qi.HANDLE_SIZE/2),h,l)),"start"===i?r:l}getHandleStyles(e){return{fill:e.handle.fill,stroke:e.handle.stroke??e.stroke,strokeOpacity:e.handle.strokeOpacity??e.strokeOpacity,strokeWidth:e.handle.strokeWidth??e.strokeWidth}}},Ss={type:"line",datum:ii,scene:vs,isDatum:ii.is,translate:(e,t,i,n)=>{ii.is(t)&&vs.is(e)&&e.translate(t,i,n)},copy:(e,t,i,n)=>{if(ii.is(t)&&ii.is(i)&&vs.is(e))return e.copy(t,i,n)},update:(e,t,i)=>{ii.is(t)&&vs.is(e)&&e.update(t,i)},createState:(e,{createDatum:t})=>new ms({...e,create:t("line")}),dragState:e=>new _i(e)},Ms={type:"arrow",datum:ti,scene:vs,isDatum:ti.is,translate:(e,t,i,n)=>{ti.is(t)&&vs.is(e)&&e.translate(t,i,n)},copy:(e,t,i,n)=>{if(ti.is(t)&&ti.is(i)&&vs.is(e))return e.copy(t,i,n)},update:(e,t,i)=>{ti.is(t)&&vs.is(e)&&e.update(t,i)},createState:(e,{createDatum:t})=>new gs({...e,create:t("arrow")}),dragState:e=>new _i(e)};function ks(e,t=0,i=0){let n=t,a=0;for(const t of e){const e=Array.isArray(i)?i[a]??0:i;if(Array.isArray(t)){for(const e of t)Cs(e,n),Is(e,n);n+=s.n1.Group.computeChildrenBBox(t).width+e}else Cs(t,n),Is(t,n),n+=t.getBBox().width+e;a++}}function Ds(e,t=0,i=0){let n=t,a=0;for(const t of e){const e=Array.isArray(i)?i[a]??0:i;if(Array.isArray(t)){for(const e of t)Ns(e,n),ws(e,n);n+=s.n1.Group.computeChildrenBBox(t).height+e}else Ns(t,n),ws(t,n),n+=t.getBBox().height+e;a++}}function ws(e,t){const i=t-e.getBBox().y;0!==i&&Ns(e,function(e){return"y1"in e?e.y1:"translationY"in e?e.translationY:e.y}(e)+i)}function Is(e,t){const i=t-e.getBBox().x;0!==i&&Cs(e,Ls(e)+i)}function As(e,t,i){switch(i){case"right":return t;case"center":return(e+t)/2;default:return e}}function Cs(e,t){"x1"in e?(e.x2=t+(e.x2-e.x1),e.x1=t):"translationX"in e?e.translationX=t:e.x=t}function Ns(e,t){"y1"in e?(e.y2=t+(e.y2-e.y1),e.y1=t):"translationY"in e?e.translationY=t:e.y=t}function Ls(e){return"x1"in e?e.x1:"translationX"in e?e.translationX:e.x}function Ps(e,t){"x1"in e?(e.x1+=t,e.x2+=t):"translationX"in e?e.translationX+=t:e.x+=t}function Ts(e,t){"y1"in e?(e.y1+=t,e.y2+=t):"translationY"in e?e.translationY+=t:e.y+=t}var Os=class extends s.n1.Group{constructor(){super(),this.name="MeasurerStatisticsScene",this.background=new s.n1.Rect,this.dateRangeBarsText=new s.n1.Text,this.dateRangeDivider=new s.n1.Line,this.dateRangeValueText=new s.n1.Text,this.priceRangeValueText=new s.n1.Text,this.priceRangeDivider=new s.n1.Line,this.priceRangePercentageText=new s.n1.Text,this.volumeText=new s.n1.Text,this.volumeFormatter=new Intl.NumberFormat("en-US",{notation:"compact",minimumFractionDigits:2,maximumFractionDigits:2}),this.append([this.background,this.dateRangeBarsText,this.dateRangeDivider,this.dateRangeValueText,this.priceRangeValueText,this.priceRangeDivider,this.priceRangePercentageText,this.volumeText])}update(e,t,i,n,a,o,r){this.verticalDirection=o;const l=this.updateStatistics(e,t,i,r),h=s.n1.Group.computeChildrenBBox(l.flat());
1h.grow(10),this.updateBackground(e,h,10),this.reposition(l,10,a),this.checkVisibility(e,a,n)}checkVisibility(e,t,i){const s=n.Zbg.from(t.seriesRect);this.visible=n.Zbg.collides(i,s)&&(e.visible??!0)}updateStatistics(e,t,i,n){const{dateRangeBarsText:s,dateRangeDivider:a,dateRangeValueText:o,priceRangeValueText:r,priceRangeDivider:l,priceRangePercentageText:h,volumeText:c}=this,d=e.statistics.fontSize+3,u=this.getTextStyles(e),p={...this.getDividerStyles(e),x1:0,y1:0,x2:0,y2:d},g=[s,a,o],m=[r,l,h],y=[];return t.priceRange&&(r.setProperties({...u,text:this.formatPriceRangeValue(t.priceRange.value,n)}),l.setProperties(p),h.setProperties({...u,text:this.formatPriceRangePercentage(t.priceRange.percentage,n)}),ks(m,i.x,8),y.push(m)),t.dateRange&&(s.setProperties({...u,text:this.formatDateRangeBars(t.dateRange.bars,n)}),a.setProperties(p),o.setProperties({...u,text:this.formatDateRangeValue(t.dateRange.value)}),ks(g,i.x,8),y.push(g)),null==t.volume?c.visible=!1:(c.setProperties({...u,x:i.x,text:this.formatVolume(t.volume,n),visible:!0}),y.push(c)),Ds(y,i.y,6),l.y1+=-2,l.y2+=-2,a.y1+=-2,a.y2+=-2,y}
vendor: 3,803 bytes, line 1
1updateBackground(e,t,i){const n=this.getBackgroundStyles(e);this.background.setProperties({...n,...t,x:t.x-t.width/2+i,y:t.y})}reposition(e,t,i){const{width:a,height:o}=i.seriesRect,r=n.Zbg.from(this.background.getBBox());let l=0;r.x1<0&&(l=-r.x1),r.x2>a&&(l=a-r.x2);const h=Math.min(t,o-r.y2);for(const t of e)if(Array.isArray(t)){const e=s.n1.Group.computeChildrenBBox(t).width;for(const i of t)Ps(i,l-e/2),Ts(i,h)}else Ps(t,l-t.getBBox().width/2),Ts(t,h);this.background.x+=l,this.background.y+=h}getTextStyles(e){return{fill:e.statistics.color,fontFamily:e.statistics.fontFamily,fontSize:e.statistics.fontSize,fontStyle:e.statistics.fontStyle,fontWeight:e.statistics.fontWeight,textAlign:"left",textBaseline:"top"}}getDividerStyles(e){return{stroke:e.statistics.divider.stroke,strokeOpacity:e.statistics.divider.strokeOpacity,strokeWidth:e.statistics.divider.strokeWidth}}getBackgroundStyles(e){return{fill:e.statistics.fill,stroke:e.statistics.stroke,strokeOpacity:e.statistics.strokeOpacity,strokeWidth:e.statistics.strokeWidth,cornerRadius:4}}formatDateRangeBars(e,t){return t?.t("measurerDateRangeBars",{value:e})??`${e}`}formatDateRangeValue(e){const t=[],i=e>=0?"":"-";e=Math.abs(e);const n=6e4,s=36e5,a=24*s,o=Math.floor(e/n),r=Math.floor(e/s),l=Math.floor(e/a),h=r%24,c=o%60;return l>=1&&t.push(`${l}d`),r>=1&&(e<a||0!==h)&&t.push(`${h}h`),(e<s||0!==c)&&t.push(`${c}m`),t[0]=`${i}${t[0]}`,t.join(" ")}formatPriceRangeValue(e,t){return t?.t("measurerPriceRangeValue",{value:Number(e.toFixed(2))})??`${e}`}formatPriceRangePercentage(e,t){return t?.t("measurerPriceRangePercent",{value:e})??`${e}`}formatVolume(e,t){const i="number"==typeof e&&Number.isNaN(e)?"":this.volumeFormatter.format(e);return t?.t("measurerVolume",{value:i})??i}},Rs=class extends Os{getDirectionStyles(e){return"down"===this.verticalDirection?e.down.statistics:e.up.statistics}getTextStyles(e){const t=this.getDirectionStyles(e);return{...super.getTextStyles(e),fill:t.color,fontFamily:t.fontFamily,fontSize:t.fontSize,fontStyle:t.fontStyle,fontWeight:t.fontWeight}}getDividerStyles(e){const t=this.getDirectionStyles(e);return{stroke:t.divider.stroke,strokeOpacity:t.divider.strokeOpacity,strokeWidth:t.divider.strokeWidth}}getBackgroundStyles(e){const t=this.getDirectionStyles(e);return{...super.getBackgroundStyles(e),fill:t.fill,stroke:t.stroke,strokeOpacity:t.strokeOpacity,strokeWidth:t.strokeWidth}}},Es=class extends Mn{constructor(){super(),this.type="measurer",this.horizontalLine=new $n,this.verticalLine=new $n,this.horizontalStartLine=new $n,this.horizontalEndLine=new $n,this.verticalStartLine=new $n,this.verticalEndLine=new $n,this.horizontalEndCap=new bs,this.verticalEndCap=new bs,this.background=new s.n1.Path({zIndex:-1}),this.updateBackground=qn.updateBackground.bind(this),this.statistics=this.createStatisticsScene(),this.statistics.zIndex=1,this.append([this.background,this.verticalStartLine,this.verticalEndLine,this.horizontalStartLine,this.horizontalEndLine,this.horizontalLine,this.verticalLine,this.horizontalEndCap,this.verticalEndCap,this.start,this.end,this.statistics])}static is(e){return Qi.isCheck(e,"measurer")}createStatisticsScene(){return new Os}update(e,t){const i=pt(e,t);if(null==i)return void(this.visible=!1);if(this.visible=e.visible??!0,!this.visible)return;const n=this.extendPerpendicular(i,e,t),s={...n,y2:n.y1},a={...n,y1:n.y2};this.verticalDirection=i.y1<i.y2?"down":"up",this.updateVisibilities(e),this.updateLines(e,i),this.updateHandles(e,i),this.updateText(e,i),this.updateCaps(e,i),this.updateBoundingLines(e,n),this.updateBackground(e,s,a,t),this.updateStatistics(e,i,t),this.updateAnchor(e,i,t)}extendPerpendicular(e,t,i){const s={x1:Math.min(e.x1,e.x2),x2:Math.max(e.x1,e.x2),y1:Math.min(e.y1,e.y2),y2:Math.max(e.y1,e.y2)},[a,o]=n.ZY9.from(i.yAxis.bounds);
1return Ft.is(t)?(t.extendAbove&&(s.y1=a.y),t.extendBelow&&(s.y2=o.y)):Vt.is(t)&&(t.extendLeft&&(s.x1=a.x),t.extendRight&&(s.x2=o.x)),s}updateVisibilities(e){const{horizontalStartLine:t,horizontalEndLine:i,horizontalEndCap:n,verticalStartLine:s,verticalEndLine:a,verticalEndCap:o}=this,{direction:r}=e;s.visible="vertical"!==r,a.visible="vertical"!==r,n.visible="vertical"!==r,t.visible="horizontal"!==r,i.visible="horizontal"!==r,o.visible="horizontal"!==r}updateLines(e,t){const{horizontalLine:i,verticalLine:s}=this,{direction:a}=e,{x1:o,y1:r,x2:l,y2:h}=t,c=n.ZY9.round(n.Zbg.center(t),0),d=this.getLineStyles(e);"vertical"!==a&&i.setProperties({...d,x1:o,x2:l,y1:c.y,y2:c.y}),"horizontal"!==a&&s.setProperties({...d,x1:c.x,x2:c.x,y1:r,y2:h})}updateText(e,t){const{direction:i}=e,s=n.ZY9.round(n.Zbg.center(t),0);let a;const o={...t};"vertical"===i?(a=this.verticalLine,o.x1=s.x,o.x2=s.x):(a=this.horizontalLine,o.y1=s.y,o.y2=s.y),this.text=this.updateNode(Hn,this.text,!!e.text.label);const{id:r}=a,l=jn(r,a,o,e.text,this.text,e.text.label,e.strokeWidth);let h;if("both"===i&&l&&this.text){const e=n.Zbg.from(this.text.getBBox()),{offset:t}=l.numbers;e.x1<=s.x+t.x&&e.x2>=s.x-t.x&&(h={x:s.x,y:l.clipMask.y,radius:this.text.getBBox().height/2+n.ZY9.length(t)})}this.verticalLine.setClipMask(r,h)}updateCaps(e,t){const{horizontalEndCap:i,verticalEndCap:s}=this,{direction:a}=e,{x1:o,y1:r,x2:l,y2:h}=t,c=n.ZY9.round(n.Zbg.center(t),0),{stroke:d,strokeWidth:u,strokeOpacity:p}=this.getLineStyles(e),g={stroke:d,strokeWidth:u,strokeOpacity:p};if("vertical"!==a){const e=o<=l?0:Math.PI;let t=l;"horizontal"===a&&(t+=o<=l?-2:2),i.update({...g,x:t,y:c.y,angle:e})}if("horizontal"!==a){const e=r<=h?Math.PI/2:Math.PI/-2;let t=h;"vertical"===a&&(t+=r<=h?-2:2),s.update({...g,x:c.x,y:t,angle:e})}}updateBoundingLines(e,t){const{verticalStartLine:i,verticalEndLine:n,horizontalStartLine:s,horizontalEndLine:a}=this,{direction:o}=e,{x1:r,y1:l,x2:h,y2:c}=t,d=this.getLineStyles(e);"horizontal"===o&&(i.setProperties({...d,x1:r,y1:l,x2:r,y2:c}),n.setProperties({...d,x1:h,y1:l,x2:h,y2:c})),"vertical"===o&&(s.setProperties({...d,x1:r,y1:l,x2:h,y2:l}),a.setProperties({...d,x1:r,y1:c,x2:h,y2:c}))}updateStatistics(e,t,i){const s=n.ZY9.add(n.Zbg.bottomCenter(t),n.ZY9.from(0,10)),a={volume:this.getVolume(e)};e.hasPriceRange&&(a.priceRange={percentage:this.getPriceRangePercentage(e),value:this.getPriceRangeValue(e)}),e.hasDateRange&&(a.dateRange={bars:this.getDateRangeBars(t,i),value:this.getDateRangeValue(e)}),this.statistics.update(e,a,s,t,i,this.verticalDirection,e.localeManager)}updateAnchor(e,t,i,n){on(this.horizontalLine,this.anchor,t)}getBackgroundPoints(e,t,i,s){const[a,o]=n.ZY9.from(t),[r,l]=n.ZY9.from(i);return[a,o,l,r]}getLineStyles(e){const{lineDashOffset:t,stroke:i,strokeWidth:n,strokeOpacity:s}=e;return{lineCap:e.getLineCap(),lineDash:e.getLineDash(),lineDashOffset:t,stroke:i,strokeWidth:n,strokeOpacity:s,fillOpacity:0}}getBackgroundStyles(e){const{background:t}=e;return{fill:t.fill,fillOpacity:t.fillOpacity}}getHandleStyles(e){return{fill:e.handle.fill,stroke:e.handle.stroke??e.stroke,strokeOpacity:e.handle.strokeOpacity??e.strokeOpacity,strokeWidth:e.handle.strokeWidth??e.strokeWidth}}containsPoint(e,t){const{horizontalLine:i,text:n,verticalLine:s,horizontalStartLine:a,horizontalEndLine:o,verticalStartLine:r,verticalEndLine:l}=this;return super.containsPoint(e,t)||i.isPointInPath(e,t)||s.isPointInPath(e,t)||a.visible&&a.isPointInPath(e,t)||o.visible&&o.isPointInPath(e,t)||r.visible&&r.isPointInPath(e,t)||l.visible&&l.isPointInPath(e,t)||Boolean(n?.containsPoint(e,t))}getNodeAtCoords(e,t){return this.text?.containsPoint(e,t)?"text":this.start.containsPoint(e,t)||this.end.containsPoint(e,t)?"handle":"line"}getDateRangeBars(e,t){const{step:i}=t.xAxis.scale,s=e.x1<=e.x2?1:-1;return i?Math.round(n.Zbg.width(e)/i)*s:0}getDateRangeValue(e){const t=ut(e.start.x),i=ut(e.end.x);if(!(0,n.$PY)(t)||!(0,n.$PY)(i))throw new Error("Can not create a date range measurement of non-date x-axis.");return i.getTime()-t.getTime()}getPriceRangePercentage(e){if(null==e.start.y||null==e.end.y)throw new Error("Can not create a price range measurement of a non-numeric y-axis");const t=ut(e.end.y),i=ut(e.start.y);if(!(0,n.zZm)(t)||!(0,n.zZm)(i))throw new Error("Can not create a price range measurement of a non-numeric y-axis");return((0,n.Roz)(t)-(0,n.Roz)(i))/(0,n.Roz)(i)}getPriceRangeValue(e){if(null==e.start.y||null==e.end.y)throw new Error("Can not create a price range measurement of a non-numeric y-axis");const t=ut(e.end.y),i=ut(e.start.y);if(!(0,n.zZm)(t)||!(0,n.zZm)(i))throw new Error("Can not create a price range measurement of a non-numeric y-axis");return(0,n.Roz)(t)-(0,n.Roz)(i)}getVolume(e){return e.getVolume(e.start.x,e.end.x)}}
1,zs=class extends Es{constructor(){super(...arguments),this.type="quick-measurer"}static is(e){return Qi.isCheck(e,"quick-measurer")}createStatisticsScene(){return new Rs}getDirectionStyles(e){return"down"===this.verticalDirection?e.down:e.up}getLineStyles(e){const t=this.getDirectionStyles(e);return{...super.getLineStyles(e),stroke:t.stroke,strokeWidth:t.strokeWidth,strokeOpacity:t.strokeOpacity}}getBackgroundStyles(e){const t=this.getDirectionStyles(e);return{fill:t.fill,fillOpacity:t.fillOpacity}}getHandleStyles(e){const t=this.getDirectionStyles(e);return{fill:t.handle.fill,stroke:t.handle.stroke??t.stroke,strokeOpacity:t.handle.strokeOpacity??t.strokeOpacity,strokeWidth:t.handle.strokeWidth??t.strokeWidth}}},Bs=(()=>{var e=class extends n.Z37{constructor(e){const t=({point:t})=>{const i=this.createDatum();i.set({start:t,end:t}),e.create(i)},i=({point:t})=>{const{datum:i,node:n}=this;i?.set({end:t}),n?.toggleActive(!0),n?.toggleHandles({end:!1}),e.update()},s=()=>{this.node?.toggleHandles({end:!0})},a=()=>e.delete();super("start",{start:{reset:n.Z37.parent,click:{target:"end",action:t},drag:{target:"end",action:t}},end:{hover:i,drag:i,click:{target:n.Z37.parent,action:s},dragEnd:{target:n.Z37.parent,action:s},reset:{target:n.Z37.parent,action:a},cancel:{target:n.Z37.parent,action:a},onExit:()=>{e.showAnnotationOptions(),e.recordAction(`Create ${this.node?.type} annotation`)}}}),this.debug=n.yar.create(!0,"annotations")}};return l([(0,n.m9s)()],e.prototype,"datum",2),l([(0,n.m9s)()],e.prototype,"node",2),e})(),Fs=class extends Bs{createDatum(){return new Ft}},Vs=class extends Bs{createDatum(){return new Vt}},$s=class extends Bs{createDatum(){return new $t}},Hs=class extends Bs{createDatum(){return new Ht}},js={type:"date-range",datum:Ft,scene:Es,isDatum:Ft.is,translate:(e,t,i,n)=>{Ft.is(t)&&Es.is(e)&&e.translate(t,i,n)},copy:(e,t,i,n)=>{if(Ft.is(t)&&Ft.is(i)&&Es.is(e))return e.copy(t,i,n)},update:(e,t,i)=>{Ft.is(t)&&Es.is(e)&&e.update(t,i)},createState:(e,{createDatum:t})=>new Fs({...e,create:t("date-range")}),dragState:e=>new _i(e)},Ws={type:"price-range",datum:Vt,scene:Es,isDatum:Vt.is,translate:(e,t,i,n)=>{Vt.is(t)&&Es.is(e)&&e.translate(t,i,n)},copy:(e,t,i,n)=>{if(Vt.is(t)&&Vt.is(i)&&Es.is(e))return e.copy(t,i,n)},update:(e,t,i)=>{Vt.is(t)&&Es.is(e)&&e.update(t,i)},createState:(e,{createDatum:t})=>new Vs({...e,create:t("date-range")}),dragState:e=>new _i(e)},_s={type:"date-price-range",datum:$t,scene:Es,isDatum:$t.is,translate:(e,t,i,n)=>{$t.is(t)&&Es.is(e)&&e.translate(t,i,n)},copy:(e,t,i,n)=>{if($t.is(t)&&$t.is(i)&&Es.is(e))return e.copy(t,i,n)},update:(e,t,i)=>{$t.is(t)&&Es.is(e)&&e.update(t,i)},createState:(e,{createDatum:t})=>new $s({...e,create:t("date-range")}),dragState:e=>new _i(e)},Gs={type:"quick-date-price-range",datum:Ht,scene:zs,isDatum:Ht.is,translate:(e,t,i,n)=>{Ht.is(t)&&zs.is(e)&&e.translate(t,i,n)},copy:(e,t,i,n)=>{if(Ht.is(t)&&Ht.is(i)&&zs.is(e))return e.copy(t,i,n)},update:(e,t,i)=>{Ht.is(t)&&zs.is(e)&&e.update(t,i)},createState:(e,{createDatum:t})=>new Hs({...e,create:t("quick-date-price-range")}),dragState:e=>new _i(e)},Ks=class extends Tn{constructor(){super(),this.type="note",this.shape=new s.n1.Rect,this.iconBackground=new s.n1.TranslatableSvgPath("M22 1.83333C22 0.820811 21.1792 0 20.1667 0H1.83333C0.820811 0 0 0.82081 0 1.83333V13.9868C0 14.9994 0.820811 15.8202 1.83333 15.8202L5.88971 15.8202C6.44575 15.8202 6.97175 16.0725 7.31971 16.5062L9.57006 19.3112C10.304 20.2259 11.6962 20.2259 12.4301 19.3112L14.6804 16.5062C15.0284 16.0725 15.5544 15.8202 16.1104 15.8202L20.1667 15.8202C21.1792 15.8202 22 14.9994 22 13.9868V1.83333Z"),this.iconLines=new s.n1.TranslatableSvgPath("M17.1114 5.75C17.1114 6.16421 16.7756 6.5 16.3614 6.5H5.63916C5.22495 6.5 4.88916 6.16421 4.88916 5.75V5.75C4.88916 5.33579 5.22495 5 5.63916 5H16.3614C16.7756 5 17.1114 5.33579 17.1114 5.75V5.75ZM17.1114 9.25C17.1114 9.66421 16.7756 10 16.3614 10H5.63916C5.22495 10 4.88916 9.66421 4.88916 9.25V9.25C4.88916 8.83579 5.22495 8.5 5.63916 8.5H16.3614C16.7756 8.5 17.1114 8.83579 17.1114 9.25V9.25Z"),this.active=!1,this.shape.visible=!1,this.label.visible=!1,this.iconBackgroun
1d.fillShadow=new s.n1.DropShadow,this.append([this.shape,this.label,this.iconBackground,this.iconLines,this.handle])}static is(e){return Qi.isCheck(e,"note")}update(e,t){this.updateIcon(e,t),super.update(e,t)}getTextBBox(e,t,i){const s=super.getTextBBox(e,t,i);s.x-=e.width/2,s.x=(0,n.qE8)(0,s.x,i.seriesRect.width-e.width);const a=e.getPadding().top,o=s.y-30-2*a,r=s.y+qi.HANDLE_SIZE+2*a;return o-s.height-34<0?(s.y=r,e.position="top"):(s.y=o+a,e.position="bottom"),s}updateLabel(e,t,i){const s=!1!==e.visible&&this.label.visible;super.updateLabel(e,t,i),i.isRtl&&(this.label.x+=e.width-t.width),this.label.visible=s,this.label.text=(0,n.C1g)(e.text,{maxWidth:200,font:e,textWrap:"always",avoidOrphans:!1})}updateShape(e,t){const{shape:i}=this;i.fill=e.background.fill,i.fillOpacity=e.background.fillOpacity??1,i.stroke=e.background.stroke,i.strokeOpacity=e.background.strokeOpacity??1,i.strokeWidth=e.background.strokeWidth??1,i.cornerRadius=4;const n=e.getPadding().top,s="top"===e.position;i.x=t.x-n,i.width=e.width+2*n,i.height=t.height+2*n,i.y=t.y+(s?0:-t.height)-n}updateIcon(e,t){const{active:i,iconBackground:n,iconLines:s}=this,{x:a,y:o}=gt(e,t);n.translationX=a-11,n.translationY=o-20,s.translationX=n.translationX,s.translationY=n.translationY,n.fill=e.fill,n.fillOpacity=e.fillOpacity??1,n.stroke=e.stroke,n.strokeOpacity=e.strokeOpacity??1,n.strokeWidth=e.strokeWidth??1,s.fill=e.stroke,n.fillShadow.color=i?e.fill??"rgba(0, 0, 0, 0.22)":"rgba(0, 0, 0, 0.22)"}updateAnchor(e,t,i){const n=e.getPadding().top,s="top"===e.position,a=s?1:-1;return{x:t.x+i.seriesRect.x+e.width/2,y:t.y+i.seriesRect.y+a*(t.height+n),position:s?"below":"above"}}getLabelCoords(e,t){const i="top"===e.position,s=e.getPadding().top+(0,n.VKS)(e.fontSize,Wt)/2;return{x:t.x,y:t.y+(i?s/2:0)}}getTextBaseline(e){return"top"===e.position?"middle":e.position}getHandleCoords(e,t,i){return{x:t.x,y:t.y+qi.HANDLE_SIZE/2+4}}getHandleStyles(e){return{fill:e.handle.fill,stroke:e.handle.stroke??e.fill,strokeOpacity:e.handle.strokeOpacity,strokeWidth:e.handle.strokeWidth}}toggleHovered(e,t,i){super.toggleHovered(e,t,i);const s=e||t&&!i;this.label.visible=s,this.shape.visible=s,this.zIndex=s?n.Dcv.CHART_ANNOTATION_FOCUSED:n.Dcv.CHART_ANNOTATION}toggleActive(e){super.toggleActive(e),this.label.visible=e,this.shape.visible=e,this.active=e}containsPoint(e,t){return!(!this.shape.visible||!this.shape.containsPoint(e,t))||(!!this.iconBackground.containsPoint(e,t)||super.containsPoint(e,t))}},Ys=class extends En{createDatum(){return new Ut}},Us={type:"note",datum:Ut,scene:Ks,isDatum:Ut.is,translate:(e,t,i,n)=>{Ut.is(t)&&Ks.is(e)&&e.translate(t,i,n)},copy:(e,t,i,n)=>{if(Ut.is(t)&&Ut.is(i)&&Ks.is(e))return e.copy(t,i,n)},update:(e,t,i)=>{Ut.is(t)&&Ks.is(e)&&e.update(t,i)},createState:(e,{createDatum:t})=>new Ys({...e,create:t("note")}),dragState:e=>new _i(e)},Xs=class extends Qn{constructor(){super(),this.type="parallel-channel",this.handles={topLeft:new qi,topMiddle:new Zi,topRight:new qi,bottomLeft:new qi,bottomMiddle:new Zi,bottomRight:new qi},this.middleLine=new $n,this.append([this.background,this.topLine,this.middleLine,this.bottomLine,...Object.values(this.handles)])}static is(e){return Qi.isCheck(e,"parallel-channel")}dragHandle(e,t,i,s){const{activeHandle:a,handles:o}=this;if(null==a)return;const{offset:r}=o[a].drag(t);o[a].toggleDragging(!0),"topMiddle"!==a&&"bottomMiddle"!==a||(r.x=0);let l=[],h=s;switch(a){case"topLeft":case"bottomLeft":l=["topLeft","bottomLeft"];break;case"topMiddle":l=["topLeft","topRight"],r.y-=Zi.HANDLE_SIZE/2,h=!1;break;case"topRight":case"bottomRight":l=["topRight","bottomRight"];break;case"bottomMiddle":l=["bottomLeft","bottomRight"],r.y-=Zi.HANDLE_SIZE/2,h=!1}const c=pt(e,i),d=pt(e.getBottom(i.logger),i);if(!c||!d)return;const u={topLeft:n.Zbg.start(c),topRight:n.Zbg.end(c),bottomLeft:n.Zbg.start(d),bottomRight:n.Zbg.end(d)},p={vectors:{topLeft:u.topRight,bottomLeft:u.bottomRight,topRight:u.topLeft,bottomRight:u.bottomLeft},angle:e.snapToAngle},g=an(u,r,i,{overflowContinuous:this.overflowContinuous,translateVectors:l,snap:h?p:void 0});e.start.x=g.topLeft.x,e.start.y=g.topLeft.y,e.end.x=g.topRight.x,e.end.y=g.to
1pRight.y,e.height=g.topLeft.y-g.bottomLeft.y}getTranslatePointsVectors(e,t){const{bottomLeft:i,topLeft:s}=this.handles,a=i.getBBox().y-s.getBBox().y;return{start:e,end:t,bottomStart:n.ZY9.add(e,n.ZY9.from(0,a)),bottomEnd:n.ZY9.add(t,n.ZY9.from(0,a))}}containsPoint(e,t){return super.containsPoint(e,t)||this.middleLine.visible&&this.middleLine.strokeWidth>0&&this.middleLine.containsPoint(e,t)}getNodeAtCoords(e,t){return this.middleLine.visible&&this.middleLine.strokeWidth>0&&this.middleLine.containsPoint(e,t)?"line":super.getNodeAtCoords(e,t)}updateLines(e,t,i,n,s,a){const{topLine:o,middleLine:r,bottomLine:l}=this,{lineDashOffset:h,stroke:c,strokeOpacity:d,strokeWidth:u}=e,p=e.getLineDash(),g={lineCap:e.getLineCap(),lineDash:p,lineDashOffset:h,stroke:c,strokeOpacity:d,strokeWidth:u};o.setProperties({...t,...g}),l.setProperties({...i,...g});const m=this.extendLine({x1:s.x1,y1:a.y1+(s.y1-a.y1)/2,x2:s.x2,y2:a.y2+(s.y2-a.y2)/2},e,n);r.setProperties({...m,lineDash:e.middle.lineDash??p,lineDashOffset:e.middle.lineDashOffset??h,stroke:e.middle.stroke??c,strokeOpacity:e.middle.strokeOpacity??d,strokeWidth:e.middle.strokeWidth??u,visible:e.middle.visible??!0})}updateHandles(e,t,i){const{handles:{topLeft:s,topMiddle:a,topRight:o,bottomLeft:r,bottomMiddle:l,bottomRight:h}}=this,c={fill:e.handle.fill,stroke:e.handle.stroke??e.stroke,strokeOpacity:e.handle.strokeOpacity??e.strokeOpacity,strokeWidth:e.handle.strokeWidth??e.strokeWidth};s.update({...c,...n.Zbg.start(t)}),o.update({...c,...n.Zbg.end(t)}),r.update({...c,...n.Zbg.start(i)}),h.update({...c,...n.Zbg.end(i)}),a.update({...c,...n.ZY9.sub(n.Zbg.center(t),n.ZY9.from(a.handle.width/2,a.handle.height/2))}),l.update({...c,...n.ZY9.sub(n.Zbg.center(i),n.ZY9.from(l.handle.width/2,l.handle.height/2))})}updateText(e,t,i){this.text=this.updateNode(Hn,this.text,!!e.text.label),Wn(!0,t,i,e.text,e.strokeWidth,this.text,e.text.label)}getBackgroundPoints(e,t,i,s){const a=t.x1>t.x2,o=t.y1>t.y2,r=t.x1!==i.x1&&t.y1!==i.y1,l=t.x2!==i.x2&&t.y2!==i.y2,h=n.ZY9.from(t);return e.extendEnd&&l&&h.push(n.ZY9.from(a?s.x1:s.x2,o?s.y1:s.y2)),h.push(...n.ZY9.from(i).reverse()),e.extendStart&&r&&h.push(n.ZY9.from(a?s.x2:s.x1,o?s.y2:s.y1)),h}},Zs=(()=>{var e=class extends n.Z37{constructor(e){const t=({point:t})=>{const i=new oi;i.set({start:t,end:t,height:0}),e.create(i)},i=({offset:t,context:i})=>{const{datum:n,snapping:s}=this;n&&(n.set({end:tn(t,i,s,n.start,n.snapToAngle)}),e.update())},s=()=>{this.node?.toggleHandles({topRight:!0}),e.update()},a=({point:t})=>{const{datum:i,node:s}=this,a=ut(i?.end.y),o=ut(i?.start.y),{y:r}=t;if(null==i||!(0,n.EtT)(o)||!(0,n.EtT)(a)||!(0,n.EtT)(r))return;const l=a-(r??0),h=o-l;s?.toggleHandles(!0),e.validatePoint({x:i.start.x,y:h},{overflowContinuous:!0})&&e.validatePoint({x:i.end.x,y:t.y},{overflowContinuous:!0})&&(i.set({height:l}),e.recordAction("Create parallel-channel annotation"),e.showAnnotationOptions(),e.update())},o=()=>e.delete();super("start",{start:{click:{target:"waiting-first-render",action:t},drag:{target:"waiting-first-render",action:t},reset:n.Z37.parent},"waiting-first-render":{render:{target:"end",action:()=>{const{node:e}=this;e?.toggleActive(!0),e?.toggleHandles({topLeft:!0,topMiddle:!1,topRight:!1,bottomLeft:!1,bottomMiddle:!1,bottomRight:!1})}}},end:{hover:i,drag:i,click:{target:"height",action:s},dragEnd:{target:"height",action:s},reset:{target:n.Z37.parent,action:o},cancel:{target:n.Z37.parent,action:o}},height:{hover:({point:t})=>{const{datum:i,node:s}=this,a=ut(i?.end.y),o=ut(i?.start.y),{y:r}=t;if(null==i||!(0,n.EtT)(o)||!(0,n.EtT)(a)||!(0,n.EtT)(r))return;const l=a-(r??0),h=o-l;s?.toggleHandles({bottomLeft:!0,bottomRight:!0}),e.validatePoint({x:i.start.x,y:h},{overflowContinuous:!0})&&e.validatePoint({x:i.end.x,y:t.y},{overflowContinuous:!0})&&(i.set({height:l}),e.update())},click:{target:n.Z37.parent,action:a},drag:{target:n.Z37.parent,action:a},reset:{target:n.Z37.parent,action:o},cancel:{target:n.Z37.parent,action:o}}}),this.debug=n.yar.create(!0,"annotations"),this.snapping=!1}};return l([(0,n.m9s)()],e.prototype,"datum",2),l([(0,n.m9s)()],e.prototype,"node",2),l([(0,n.m9s)()],e.prototype,"snapping",2),e})(),qs={type:"parallel-channel",datum:oi,scene:Xs,isDatum:oi.is,translate:(e,t,i,n)=>{oi.is(t)&&Xs.is(e)&&e.translate(t,i,n)},copy:(e,t,i,n)=>{if(oi.is(t)&&oi.is(i)&&Xs.is(e))return e.copy(t,i,n)},update:(e,t,i)=>{oi.is(t)&&Xs.is(e)&&e.update(t,i)},createState:(e,{createDatum:t})=>new Zs({...e,create:t("parallel-channel")}),dragState:e=>new _i(e)},Qs=class extends Tn{constructor(){super(),this.type="text",this.append([this.label,this.handle])}static is(e){return Qi.isCheck(e,"text")}getHandleCoords(e,t){const i=qi.HANDLE_SIZE/2;return{x:t.x+i,y:t.y+2+i}}}
1,Js=class extends En{createDatum(){return new ri}},ea={type:"text",datum:ri,scene:Qs,isDatum:ri.is,translate:(e,t,i,n)=>{ri.is(t)&&Qs.is(e)&&e.translate(t,i,n)},copy:(e,t,i,n)=>{if(ri.is(t)&&ri.is(i)&&Qs.is(e))return e.copy(t,i,n)},update:(e,t,i)=>{ri.is(t)&&Qs.is(e)&&e.update(t,i)},createState:(e,{createDatum:t})=>new Js({...e,create:t("text")}),dragState:e=>new _i(e)},ta={[Ss.type]:Ss,[Xn.type]:Xn,[Zn.type]:Zn,[qs.type]:qs,[ts.type]:ts,[fs.type]:fs,[ds.type]:ds,[Pn.type]:Pn,[Bn.type]:Bn,[Us.type]:Us,[ea.type]:ea,[Ms.type]:Ms,[vn.type]:vn,[fn.type]:fn,[js.type]:js,[Ws.type]:Ws,[_s.type]:_s,[Gs.type]:Gs};function ia(e){for(const{isDatum:t}of Object.values(ta))if(t(e))return e}var na=(()=>{var e=class extends n._ui{constructor(e){super(new sa((e=>{this.snapping=e})),new aa((()=>{this.node=null==this.active?void 0:e.node(this.active)})),new oa(e,(t=>{this.active=t,this.datum=null==this.active?void 0:e.datum(this.active),this.node=null==this.active?void 0:e.node(this.active)}))),this.snapping=!1}getActive(){return this.active}isActive(e){return e===this.active}};return l([(0,n.m9s)()],e.prototype,"snapping",2),l([(0,n.m9s)()],e.prototype,"datum",2),l([(0,n.m9s)()],e.prototype,"node",2),e})(),sa=class extends n.Z37{constructor(e){super("idle",{idle:{hover:({shiftKey:t})=>e(t),keyDown:({shiftKey:t})=>e(t),keyUp:({shiftKey:t})=>e(t),click:({shiftKey:t})=>e(t),drag:({shiftKey:t})=>e(t)},dragging:{},translating:{},"text-input":{}})}},aa=class extends n.Z37{constructor(e){super("idle",{idle:{onEnter:e,render:e},dragging:{onEnter:e,render:e},translating:{onEnter:e,render:e},"text-input":{render:e}})}},oa=(()=>{var e=class extends n.Z37{constructor(e,t){const i=()=>{null!=this.active&&e.delete(this.active),this.active=void 0,e.select()},s={createDatum:t=>i=>{e.create(t,i),this.active=e.selectLast()}},a={...e,delete:i,showTextInput:()=>{null!=this.active&&e.showTextInput(this.active)},deselect:()=>{const t=this.active;this.active=void 0,this.hovered=void 0,e.select(this.active,t)},showAnnotationOptions:()=>{null!=this.active&&e.showAnnotationOptions(this.active)}},o=({colorPickerType:t,colorOpacity:i,color:n,opacity:s,isMultiColor:a})=>{this.datum&&("text-color"===t&&e.updateTextInputColor(n),Mi(this.datum,t,i,n,s,a),e.update())},r=t=>{const{datum:i,node:n}=this;i&&n&&(ui(i)?(i.fontSize=t,e.updateTextInputFontSize(t)):bi(i)&&(i.text.fontSize=t),e.update())},l=t=>{const{node:i}=this;i&&"setTextInputBBox"in i&&(i.setTextInputBBox(t),e.update())},h=({textInputValue:t,bbox:i})=>{const{datum:n}=this;if(null!=i&&null!=t&&t.length>0){if(!ui(n))return;const s=_t(n,t,i.width);n.set({text:s}),e.update(),e.recordAction(`Change ${n.type} annotation text`)}else e.delete(this.active),e.recordAction(`Delete ${n?.type} annotation`)},c=()=>{e.updateTextInputBBox(void 0)},d=()=>null!=this.active,u=()=>{const{active:e,datum:t}=this;return null!=e&&(!!t&&(bi(t)&&t.isWriteable()))},p=()=>null!=this.active&&!li(this.datum);super("idle",{idle:{onEnter:()=>{e.select(this.active,this.active),this.hoverCoords&&(this.hovered=e.hoverAtCoords(this.hoverCoords,this.active,this.hovered))},hover:({offset:t})=>{this.hovered=e.hoverAtCoords(t,this.active,this.hovered),this.hoverCoords=t},translate:{guard:d,target:"translating",action:({translation:t})=>{e.startInteracting(),e.translate(this.active,t),e.update()}},copy:{guard:p,action:()=>{this.copied=e.copy(this.active)}},cut:{guard:p,action:()=>{this.copied=e.copy(this.active),i()}},paste:{guard:()=>null!=this.copied,action:()=>{e.paste(this.copied)}},selectLast:()=>{const t=this.active;this.active=e.selectLast(),e.select(this.active,t)},click:[{guard:()=>{const{active:e,hovered:t,datum:i}=this;return null!=e&&t===e&&(!!i&&(ui(i)&&i.isWriteable()))},target:"text-input"},{action:()=>{const t=this.active;this.active=this.hovered,e.select(this.active,t)}}],dblclick:{guard:u,action:({offset:t})=>{const i="text"===e.getNodeAtCoords(t,this.active)?"text":"line";e.showAnnotationSettings(this.active,void 0,i)}},dragStart:[{guard:()=>null!=this.hovered,target:"dragging",action:()=>{const t=this.active;this.active=this.hovered,e.select(this.active,t),e.startInteracting()}},{action:()=>{const t=this.active;this.active=this.hovered,e.select(this.active,t)}}],color:{guard:d,action:o},fontSize:{guard:d,action:r},lineProps:{guard:d,action:t=>{const i=ia(this.datum);
1i?.set(t),e.update(),e.recordAction(`Change ${i?.type} ${Object.entries(t).map((([e,t])=>`${e} to ${t}`)).join(", ")}`)}},lineStyle:{guard:d,action:t=>{const{datum:i,node:n}=this;i&&n&&mi(i)&&(Si(i,t),e.update())}},lineText:{guard:d,action:t=>{const i=ia(this.datum);bi(i)&&(ci(i)&&"center"===t.position&&(t.position="inside"),i.text.set(t),e.update())}},updateTextInputBBox:{guard:d,action:l},toolbarPressSettings:{guard:u,action:t=>{e.showAnnotationSettings(this.active,t)}},reset:()=>{null!=this.active&&this.node?.toggleActive(!1),this.hovered=void 0,this.active=void 0,e.select(),e.resetToIdle()},delete:()=>{null!=this.active&&(e.delete(this.active),li(this.datum)||e.recordAction(`Delete ${this.datum?.type} annotation`))},deleteAll:()=>{e.deleteAll()},...Object.fromEntries(Object.entries(ta).map((([e,t])=>[e,t.createState(a,s)])))},dragging:{onEnter:(t,i)=>{if(null==this.active)return;const n=e.getAnnotationType(this.active);n&&(e.startDragging(this.active),this.transitionRoot(n),this.transitionRoot("dragStart",i))},...Object.fromEntries(Object.entries(ta).map((([t,i])=>[t,i.dragState(e,s)])))},translating:{onEnter:()=>{},translate:{guard:d,target:"translating",action:({translation:t})=>{e.startInteracting(),e.translate(this.active,t),e.update()}},translateEnd:{guard:d,target:"idle"},onExit:()=>{e.stopInteracting(),e.update(),e.recordAction("Translate annotation")}},"text-input":{onEnter:()=>{if(null==this.active)return;const t=ia(this.datum);t&&"getTextInputCoords"in t&&(e.startInteracting(),e.showTextInput(this.active),t.visible=!1,e.update())},updateTextInputBBox:{guard:d,action:l},resize:{target:"idle",action:h},click:{target:"idle",action:h},drag:{target:"idle",action:h},textInput:[{guard:An,target:"idle",action:c},{guard:Cn,target:"idle",action:h}],color:{guard:d,action:o},fontSize:{guard:d,action:r},cancel:{target:"idle",action:c},onExit:()=>{e.stopInteracting(),e.hideTextInput();const t=this.active;if(this.active=this.hovered=void 0,e.select(this.active,t),null==t)return;const i=e.datum(t),n=e.node(t);i&&n&&("setTextInputBBox"in n&&n.setTextInputBBox(),i.visible=!0)}}}),this.setActive=t,this.debug=n.yar.create(!0,"annotations"),this.snapping=!1}};return l([(0,n.mBh)({changeValue(e){this.setActive(e)}}),(0,n.m9s)()],e.prototype,"active",2),l([(0,n.m9s)()],e.prototype,"hovered",2),l([(0,n.m9s)()],e.prototype,"hoverCoords",2),l([(0,n.m9s)()],e.prototype,"copied",2),l([(0,n.m9s)()],e.prototype,"snapping",2),l([(0,n.m9s)()],e.prototype,"datum",2),l([(0,n.m9s)()],e.prototype,"node",2),e})(),{LayoutElement:ra,Menu:la}=s.n1,ha=(()=>{var e=class extends Ii{};return l([n.mAP],e.prototype,"value",2),e})(),ca=(()=>{var e=class extends n.XPE{constructor(e){super(),this.ctx=e,this.enabled=!0,this.padding=20,this.buttons=new n.F_c(ha),this.events=new n.bkB,this.annotationMenu=new la(this.ctx,"annotations"),this.cleanup=new n._uV,this.menuMargin=6,this.toolbar=e.sharedToolbar.getSharedToolbar("annotations");const t=this.onKeyDown.bind(this);this.toolbar.addListener("keydown",t),this.cleanup.register(this.toolbar.addToolbarListener("button-pressed",this.onToolbarButtonPress.bind(this)),e.layoutManager.registerElement(ra.ToolbarLeft,this.onLayoutStart.bind(this)),(()=>{this.toolbar.removeListener("keydown",t),this.toolbar.destroy()}))}destroy(){this.cleanup.flush()}toggleClearButtonEnabled(e){const t=this.buttons.findIndex((e=>"clear"===e.value));this.toolbar.toggleButtonEnabledByIndex(t,e)}resetButtonIcons(){for(const[e,t]of this.buttons.entries())switch(t.value){case"line-menu":this.updateButtonByIndex(e,{icon:"trend-line-drawing",value:"line-menu"});break;case"fibonacci-menu":this.updateButtonByIndex(e,{icon:"fibonacci-retracement-drawing",value:"fibonacci-menu"});break;case"text-menu":this.updateButtonByIndex(e,{icon:"text-annotation",value:"text-menu"});break;case"shape-menu":this.updateButtonByIndex(e,{icon:"arrow-drawing",value:"shape-menu"});break;case"measurer-menu":this.updateButtonByIndex(e,{icon:"measurer-drawing",value:"measurer-menu"})}}hideOverlays(){this.annotationMenu.hide()}clearActiveButton(){this.toolbar.clearActiveButton()}onLayoutStart(e){this.enabled&&(this.toolbar.updateButtons(this.buttons),this.toolbar.layout(e.layoutBox,this.padding))}refreshButtonsEnabled(e){for(const[t,i]of this.buttons.entries())i&&this.toolbar.toggleButtonEnabledByIndex(t,e)}onToolbarButtonPress({event:e,button:t,buttonBounds:i,buttonWidget:s}){const a=this.ctx.axisManager.getAxisContext(n.tv$.Y)[0].scale;switch(t.value){case"line-menu":this.onToolbarButtonPressShowMenu(e,i,s,t.value,"toolbarAnnotationsLineAnnotations",Ci.filter((e=>!e.visible||e.visible(a))));break;case"fibonacci-menu":this.onToolbarButtonPressShowMenu(e,i,s,t.value,"toolbarAnnotationsFibonacciAnnotations",Ni);break;case"text-menu":this.onToolbarButtonPressShowMenu(e,i,s,t.value,"toolbarAnnotationsTextAnnotations",Pi);break;case"shape-menu":this.onToolbarButtonPressShowMenu(e,i,s,t.value,"toolbarAnnotationsShapeAnnotations",Ti);break;case"measurer-menu":this.onToolbarButtonPressShowMenu(e,i,s,t.value,"toolbarAnnotationsMeasurerAnnotations",Oi);break;case"line":this.onButtonPressCreateAnnotation(t.value,"line");break;case"horizontal-line":this.onButtonPressCreateAnnotation(t.value,"horizontal-line");break;case"vertical-line":this.onButtonPressCreateAnnotation(t.value,"vertical-line");break;case"parallel-channel":this.onButtonPressCreateAnnotation(t.value,"parallel-channel");break;case"disjoint-channel":this.onButtonPressCreateAnnotation(t.value,"disjoint-channel");break;case"fibonacci-retracement":this.onButtonPressCreateAnnotation(t.value,"fibonacci-retracement");break;case"fibonacci-retracement-trend-based":this.onButtonPressCreateAnnotation(t.value,"fibonacci-retracement-trend-based");break;case"text":this.onButtonPressCreateAnnotation(t.value,"text");break;case"comment":this.onButtonPressCreateAnnotation(t.value,"comment");break;case"callout":this.onButtonPressCreateAnnotation(t.value,"callout");break;case"note":this.onButtonPressCreateAnnotation(t.value,"note");break;case"clear":this.events.emit("pressed-clear",null)}}onToolbarButtonPressShowMenu(e,t,i,n,s,a){this.events.emit("pressed-show-menu",null);const o=this.buttons.findIndex((e=>e.value===n));this.toolbar.toggleActiveButtonByIndex(o);const r=this.ctx.domManager.isRtl?t.x-this.menuMargin:t.x+t.width+this.menuMargin;this.annotationMenu.setAnchor({x:r,y:t.y}),this.annotationMenu.show(i,{items:a,ariaLabel:this.ctx.localeManager.t(s),class:"ag-charts-annotations__toolbar-menu",sourceEvent:e.sourceEvent,onPress:this.onButtonPressMenuCreateAnnotation.bind(this,n)})}onButtonPressMenuCreateAnnotation(e,t){const i=this.buttons.findIndex((t=>t.value===e));this.updateButtonByIndex(i,{icon:t.icon}),this.events.emit("pressed-create-annotation",{annotation:t.value}),this.annotationMenu.hide()}onButtonPressCreateAnnotation(e,t){const i=this.buttons.findIndex((t=>t.value===e));this.toolbar.toggleActiveButtonByIndex(i),this.events.emit("pressed-create-annotation",{annotation:t})}onKeyDown({sourceEvent:e}){"Escape"===e.key&&this.events.emit("cancel-create-annotation",null)}updateButtonByIndex(e,t){const i=this.buttons.at(e);
1i&&(i.set({...i.toJson(),...t,value:t.value??i.value}),this.toolbar.updateButtonByIndex(e,{...i.toJson()}))}};return l([n.mAP,(0,n.mBh)({changeValue(e){this.toolbar?.setHidden(!e)}})],e.prototype,"enabled",2),l([n.mAP],e.prototype,"padding",2),l([n.mAP],e.prototype,"buttons",2),e})(),{InteractionState:da}=s.n1,ua="ag-charts-annotations__axis-button",pa=(()=>{var e=class extends n.UbG{constructor(e,t,i,n){super(),this.ctx=e,this.axisCtx=t,this.onButtonClick=i,this.seriesRect=n,this.enabled=!0,this.snap=!1,this.padding=0,this.button=this.setup(),this.toggleVisibility(!1),this.updateButtonElement(),this.snap=Boolean(t.scale.bandwidth),e.domManager.addEventListener("focusin",(({target:t})=>{const i=t instanceof HTMLElement?t:void 0;i&&e.domManager.contains(i,"series-area")||i===this.button.getElement()||this.hide()})),this.cleanup.register(e.widgets.seriesWidget.addListener("drag-move",(e=>this.onMouseDrag(e))),e.widgets.seriesWidget.addListener("mousemove",(e=>this.onMouseMove(e))),e.widgets.seriesWidget.addListener("mouseleave",(()=>this.onMouseLeave())),e.widgets.seriesDragInterpreter?.events.on("click",(e=>this.onClick(e))),e.eventsHub.on("series:focus-change",(()=>this.onKeyPress())),e.eventsHub.on("zoom:pan-start",(()=>this.hide())),e.eventsHub.on("zoom:change-complete",(()=>this.hide())),(()=>this.destroyElements()),(()=>this.button.destroy()))}update(e,t){this.seriesRect=e,this.padding=t}setup(){const e=new s.uB.ButtonWidget;return e.addClass(ua),e.setTabIndex(-1),e.setAriaLabel(this.ctx.localeManager.t("ariaLabelAddHorizontalLine")),this.ctx.widgets.seriesWidget.getElement().appendChild(e.getElement()),e}destroyElements(){this.ctx.domManager.removeChild("canvas-overlay",ua)}onMouseMove(e){this.ctx.interactionManager.isState(da.Hoverable)&&this.show(e)}onMouseDrag(e){this.ctx.interactionManager.isState(da.AnnotationsMoveable)&&this.show(e)}onMouseLeave(){this.ctx.interactionManager.isState(da.Hoverable)&&this.hide()}onClick(e){this.ctx.interactionManager.isState(da.Clickable)&&"touch"===e.device&&this.show(e)}show(e){const{sourceEvent:t,currentX:i,currentY:n}=e;if(!this.enabled||!this.ctx.widgets.seriesWidget.getElement().contains(t.target))return void this.hide();this.toggleVisibility(!0);const s=this.getButtonCoordinates({x:i,y:n});this.coords={x:s.x+this.button.clientWidth/2,y:s.y+this.button.clientHeight/2},this.updatePosition(s)}hide(){this.toggleVisibility(!1)}onKeyPress(){this.snap&&this.ctx.interactionManager.isState(da.Default)||this.hide()}getButtonCoordinates({x:e,y:t}){const{axisCtx:{direction:i,position:s},seriesRect:a,snap:o,axisCtx:r,padding:l}=this,{clientWidth:h,clientHeight:c}=this.button,[d,u]=[0,a.height],[p,g]=[0,a.width];if(o&&(e=mt(ft(e-a.x,r),r)+a.x,t=mt(ft(t-a.y,r),r)+a.y),i===n.tv$.X){const i=5,n=c-Math.max(0,l-i);e-=h/2,t="top"===s?d-c+n:u-n}else{const i=9,n=h-Math.max(0,l-i);e="left"===s?p-h+n:g-n,t-=c/2}return{x:e,y:t}}toggleVisibility(e){const{button:t}=this;if(null==t)return;const i=this.enabled&&e;this.toggleClass("-hidden",!i)}toggleClass(e,t){this.button.toggleClass(`${ua}-${e}`,t)}updatePosition({x:e,y:t}){this.button.getElement().style.transform=`translate(${Math.round(e)}px, ${Math.round(t)}px)`}updateButtonElement(){const{button:e}=this;e.addListener("click",(()=>this.onButtonClick(this.coords))),e.addListener("touchend",(()=>this.onButtonClick(this.coords))),e.addListener("drag-start",(()=>{})),e.setInnerHTML(`<span class="${(0,n.YE8)("zoom-in")} ${ua}-icon"></span>`)}};return l([n.mAP],e.prototype,"enabled",2),e})(),{DraggablePopover:ga,NativeWidget:ma}=s.n1,ya=(()=>{var e=class e extends ga{constructor(e,t){super(e,t),this.dragHandleDraggingClass="ag-charts-dialog__drag-handle--dragging",this.colorPicker=new wi(this.ctx,{detached:!0}),this.cleanup.register(e.eventsHub.on("layout:complete",this.onLayoutComplete.bind(this)))}showWithChildren(e,t){const i=super.showWithChildren(e,t);return i.classList.add("ag-charts-dialog"),i.setAttribute("role","dialog"),i.addEventListener("mousedown",(e=>{e.target.classList?.contains("ag-charts-dialog__color-picker-button")||this.colorPicker.hide()})),i.addEventListener("keydown",this.onKeyDown.bind(this)),this.ctx.agDocument.requestAnimationFrame((()=>this.reposition())),this.colorPicker.attachTo(this),i}updatePosition(e){super.updatePosition(e);const{anchor:t,fallbackAnchor:i}=this.getColorPickerAnchors()??{};t&&this.colorPicker.setAnchor(t,i)}createTabs(e,t,i){const s=(0,n.na4)("div","ag-charts-dialog__tabs"),a=(0,n.LGi)(i,(()=>(0,n.wWH)())),o=(0,n.LGi)(i,(()=>(0,n.wWH)()));for(const[e,t]of(0,n.jOZ)(i))(0,n.Wpy)(t.panel,{id:o[e],role:"tabpanel","aria-labelledby":a[e]});const r=e=>{for(const[t,s]of(0,n.jOZ)(i))s.panel.classList.toggle("ag-charts-dialog__tab-panel--active",t===e),c[t].classList.toggle("ag-charts-dialog__tab-button--active",t===e),(0,n.Bqc)(c[t],"aria-selected",t===e),t===e&&s.onShow?.()},l=new ma((0,n.na4)("div","ag-charts-dialog__header"));l.addListener("drag-start",(e=>{const{sourceEvent:t}=e;t.target instanceof Element&&t.target.classList.contains("ag-charts-dialog__header")&&this.onDragStart(e)})),l.addListener("drag-move",(e=>this.onDragMove(e))),l.addListener("drag-end",(()=>this.onDragEnd()));const h=new fa;this.setDragHandle(h);const c=(0,n.LGi)(i,((e,t)=>(0,n.TfM)({label:this.ctx.localeManager.t(e.label),onPress:()=>r(t)},{id:a[t],class:"ag-charts-dialog__tab-button",role:"tab","aria-controls":o[t]}))),d=(0,n.na4)("div","ag-charts-dialog__tab-list");(0,n.Wpy)(d,{role:"tablist","aria-label":this.ctx.localeManager.t(e)}),d.append(...Object.values(c));const u=this.createHeaderCloseButton();return l.getElement().append(h.getElement(),d,u),s.append(l.getElement(),...Object.values(i).map((e=>e.panel))),r(t),(0,n.jgH)({orientation:"horizontal",buttons:Object.values(c)}),{tabs:s,initialFocus:c[t]}}createTabPanel(){return(0,n.na4)("div","ag-charts-dialog__tab-panel")}createInputGroupLine(){return(0,n.na4)("div","ag-charts-dialog__input-group-line")}createRadioGroup({label:e,options:t,value:i,onChange:s}){const a=this.createInputGroup(e);(0,n.Wpy)(a,{role:"radiogroup",tabindex:-1,"aria-label":this.ctx.localeManager.t(e)});const o="ag-charts-dialog__button--active",r=[];for(const e of t){const{icon:t,altText:l}=e,h=this.ctx.localeManager.t(l),c=(0,n.TfM)({icon:t,altText:h,onPress:()=>{for(const e of Array.from(a.children))e.classList.remove(o),e.ariaChecked="false";c.classList.add(o),c.ariaChecked="true",s(e.value)}},{"aria-checked":e.value===i,class:"ag-charts-dialog__button",role:"radio",title:h});e.value===i&&c.classList.add(o),a.appendChild(c),r.push(c)}return(0,n.jgH)({orientation:"horizontal",buttons:r}),a}createSelect({altText:e,label:t,options:i,value:s,onChange:a}){const o=this.createInputGroup(t),r=this.ctx.localeManager.t(e),l=(0,n.HnG)({value:s,options:i,onChange:a},{class:"ag-charts-dialog__select","aria-label":r,title:r});return o.append(l),o}createTextArea({placeholder:e,value:t,onChange:i}){const s=e?this.ctx.localeManager.t(e):void 0;return(0,n.jal)({value:t,onChange:i},{placeholder:s})}createCheckbox({label:e,checked:t,onChange:i}){const s=(0,n.wWH)(),a=this.createInputGroup(e,{for:s}),o=(0,n.GGi)({checked:t,onChange:i},{class:"ag-charts-dialog__checkbox",role:"switch",id:s});return a.append(o),a}createColorPicker({color:e,opacity:t,label:i,altText:s,onChange:a,onChangeHide:o,isMultiColor:r,hasMultiColorOption:l}){const h=this.createInputGroup(i),c=this.ctx.localeManager.t(s),d=(0,n.TfM)({label:c,onPress:i=>{const{anchor:n,fallbackAnchor:s}=this.getColorPickerAnchors(d)??{};this.colorPicker.show({anchor:n,fallbackAnchor:s,color:e,opacity:t,isMultiColor:r,hasMultiColorOption:l,sourceEvent:i,onChange:(e,t,i,n)=>{d.style.setProperty("--color",e),d.classList.toggle("ag-charts-dialog__color-picker-button--multi-color",n),a(e,t,i,n)},onChangeHide:o})}},{"aria-label":c,tabindex:0,class:"ag-charts-dialog__color-picker-button",title:c});if(r)d.classList.toggle("ag-charts-dialog__color-picker-button--multi-color");else if(e){const i=n.Q1f.fromString(e),s=new n.Q1f(i.r,i.g,i.b,t);d.style.setProperty("--color",s.toHexString())}return h.append(d),this.hideFns.push((()=>{this.colorPicker.hide()})),h}createHeaderCloseButton(){return(0,n.TfM)({icon:"close",altText:this.ctx.localeManager.t("iconAltTextClose"),onPress:()=>this.hide()},{class:"ag-charts-dialog__close-button"})}createInputGroup(e,t){const i=(0,n.na4)("div","ag-charts-dialog__input-group"),s=(0,n.na4)("label","ag-charts-dialog__input-group-label");return s.innerText=this.ctx.localeManager.t(e),(0,n.Bqc)(s,"for",t?.for),i.appendChild(s),i}onLayoutComplete(e){this.seriesRect=e.series.paddedRect,this.reposition()}onKeyDown(e){e.altKey||e.ctrlKey||e.metaKey||e.isComposing||"Escape"!==e.key||this.hide()}reposition(){const{seriesRect:t,ctx:i}=this,s=this.getPopoverElement();if(!t||!s)return;const a=i.domManager.getBoundingClientRect(),o=n.ZY9.from(0,t.y),r=n.ZY9.from(a.width,t.height),l=n.ZY9.from(s),h=n.ZY9.from(.5,1);let c;if(t.width>1e3){const t=n.ZY9.sub(n.ZY9.add(o,n.ZY9.multiply(r,h)),n.ZY9.multiply(l,h));c=n.ZY9.sub(t,n.ZY9.from(0,e.offset))}else{const t=n.ZY9.sub(n.ZY9.add(o,r),l);c=n.ZY9.sub(t,e.offset)}this.updatePosition(c)}getColorPickerAnchors(e){if(e&&(this.colorPickerAnchorElement=e),!this.colorPickerAnchorElement)return;const t=this.colorPickerAnchorElement.getBoundingClientRect(),i=this.ctx.domManager.getBoundingClientRect(),s=n.ZY9.sub(n.ZY9.from(t.x,t.y),n.ZY9.from(i.left,i.top));return{anchor:n.ZY9.add(s,n.ZY9.from(0,t.height+5)),fallbackAnchor:n.ZY9.sub(s,n.ZY9.from(0,5))}}};return e.offset=60,e})(),fa=class extends ma{constructor(){super((0,n.na4)("div","ag-charts-dialog__drag-handle"));const e=new ma((0,n.na4)("span",(0,n.YE8)("drag-handle")));e.setAriaHidden(!0),this.addChild(e)}},xa=class extends ya{constructor(e){super(e,"settings"),this.events=new n.bkB,this.hideFns.push((()=>this.events.emit("hidden",null)))}show(e,t){const i=this.createLinearLineTab(e,t),n=this.createLinearTextTab(e,t);let s="dialogHeaderLine";ci(e)?s="dialogHeaderChannel":di(e)?s="dialogHeaderFibonacciRange":"date-range"===e.type?s="dialogHeaderDateRange":"price-range"===e.type?s="dialogHeaderPriceRange":"date-price-range"===e.type&&(s="dialogHeaderDatePriceRange");const{tabs:a,initialFocus:o}=this.createTabs("ariaLabelSettingsTabBar",t.initialSelectedTab,{line:{label:s,panel:i},text:{label:"dialogHeaderText",panel:n.panel,onShow:n.onShow}});t.initialFocus=o;this.showWithChildren([a],t).classList.add("ag-charts-dialog--annotation-settings")}createLinearLineTab(e,t){const i=this.createTabPanel(),n=this.createInputGroupLine(),s=this.createInputGroupLine(),a="isMultiColor"in e,o=this.createColorPickerInput("line-color",e.getDefaultColor("line-color"),e.getDefaultOpacity("line-color"),!!a&&e.isMultiColor,a,t.onChangeLineColor,t.onCh
1angeHideLineColor),r=this.createStrokeWidthSelect(e.strokeWidth??2,t.onChangeLineStyleWidth),l=this.createLineStyleRadioGroup(e.lineStyle??"solid",t.onChangeLineStyleType);if(n.append(o),"background"in e){const i=this.createColorPickerInput("fill-color",e.getDefaultColor("fill-color"),e.getDefaultOpacity("fill-color"),!1,!1,t.onChangeFillColor,t.onChangeHideFillColor);n.append(i),s.append(r)}else"showFill"in e?(n.append(this.createCheckbox({label:"dialogInputShowFill",checked:e.showFill??!0,onChange:e=>t.onChangeLine({showFill:e})})),s.append(r)):n.append(r);return s.append(l),i.append(n,s),"bands"in e&&i.append(this.createFibonacciRatioSelect(e.bands??10,(e=>t.onChangeLine({bands:e})))),"extendStart"in e&&"extendEnd"in e&&i.append(this.createCheckbox({label:ci(e)?"dialogInputExtendChannelStart":"dialogInputExtendLineStart",checked:e.extendStart??!1,onChange:e=>t.onChangeLine({extendStart:e})}),this.createCheckbox({label:ci(e)?"dialogInputExtendChannelEnd":"dialogInputExtendLineEnd",checked:e.extendEnd??!1,onChange:e=>t.onChangeLine({extendEnd:e})})),"extendAbove"in e&&"extendBelow"in e&&i.append(this.createCheckbox({label:"dialogInputExtendAbove",checked:e.extendAbove??!1,onChange:e=>t.onChangeLine({extendAbove:e})}),this.createCheckbox({label:"dialogInputExtendBelow",checked:e.extendBelow??!1,onChange:e=>t.onChangeLine({extendBelow:e})})),"extendLeft"in e&&"extendRight"in e&&i.append(this.createCheckbox({label:"dialogInputExtendLeft",checked:e.extendLeft??!1,onChange:e=>t.onChangeLine({extendLeft:e})}),this.createCheckbox({label:"dialogInputExtendRight",checked:e.extendRight??!1,onChange:e=>t.onChangeLine({extendRight:e})})),"reverse"in e&&"showFill"in e&&i.append(this.createCheckbox({label:"dialogInputReverse",checked:e.reverse??!1,onChange:e=>t.onChangeLine({reverse:e})})),i}createLinearTextTab(e,t){const i=this.createTabPanel(),s=this.createTextArea({placeholder:"inputTextareaPlaceholder",value:e.text.label,onChange:e=>t.onChangeText({label:e})}),a=this.createFontSizeSelect(e.text.fontSize,t.onChangeTextFontSize),o=this.createColorPickerInput("text-color",e.text.color,1,!1,!1,t.onChangeTextColor,t.onChangeHideTextColor),r="inside"===e.text.position?"center":e.text.position,l=this.createPositionRadioGroup(r??"top",(e=>t.onChangeText({position:e}))),h=this.createAlignmentRadioGroup(e.text.alignment??"center",(e=>t.onChangeText({alignment:e}))),c=this.createInputGroupLine();return c.append(a,o,l,h),i.append(s,c),{panel:i,onShow:()=>(0,n.VED)(s)}}createColorPickerInput(e,t,i,n,s,a,o){const r="fill-color"===e?"dialogInputFillColorPicker":"dialogInputColorPicker",l="fill-color"===e?"dialogInputFillColorPickerAltText":"dialogInputColorPickerAltText";
1return this.createColorPicker({label:r,altText:l,color:t,opacity:i,isMultiColor:n,hasMultiColorOption:s,onChange:a,onChangeHide:o})}createStrokeWidthSelect(e,t){return this.createSelect({label:"dialogInputStrokeWidth",altText:"dialogInputStrokeWidthAltText",options:Ri.map((({label:e,value:t})=>({label:e,value:`${t}`}))),value:String(e),onChange:e=>t(Number(e))})}createFibonacciRatioSelect(e,t){return this.createSelect({label:"dialogInputFibonacciBands",altText:"dialogInputFibonacciBandsAltText",options:Li.map((({label:e,value:t})=>({label:e,value:`${t}`}))),value:String(e),onChange:e=>t(Number(e))})}createLineStyleRadioGroup(e,t){return this.createRadioGroup({label:"dialogInputLineStyle",options:[{icon:"line-style-solid",altText:"iconAltTextLineStyleSolid",value:"solid"},{icon:"line-style-dashed",altText:"iconAltTextLineStyleDashed",value:"dashed"},{icon:"line-style-dotted",altText:"iconAltTextLineStyleDotted",value:"dotted"}],value:e,onChange:t})}createFontSizeSelect(e,t){return this.createSelect({label:"dialogInputFontSize",altText:"dialogInputFontSizeAltText",options:zi.map((({label:e,value:t})=>({label:e,value:String(t)}))),value:String(e),onChange:e=>t(Number(e))})}createPositionRadioGroup(e,t){return this.createRadioGroup({label:"dialogInputPosition",options:[{icon:"position-top",altText:"iconAltTextPositionTop",value:"top"},{icon:"position-center",altText:"iconAltTextPositionCenter",value:"center"},{icon:"position-bottom",altText:"iconAltTextPositionBottom",value:"bottom"}],value:e,onChange:t})}createAlignmentRadioGroup(e,t){const i=[["iconAltTextAlignLeft","left"],["iconAltTextAlignRight","right"]];this.ctx.domManager.isRtl&&i.reverse();const[[n,s],[a,o]]=i;return this.createRadioGroup({label:"dialogInputAlign",options:[{icon:"align-left",altText:n,value:s},{icon:"align-center",altText:"iconAltTextAlignCenter",value:"center"},{icon:"align-right",altText:a,value:o}],value:e,onChange:t})}};function ba(e){return e.gridPadding+e.seriesAreaPadding+e.tickSize+e.label.spacing+e.label.boxOffset}var{InteractionState:va,keyProperty:Sa,valueProperty:Ma,Selection:ka,BBox:Da,DataSet:wa}=s.n1,Ia=class e extends n.UbG{constructor(t){super(),this.ctx=t,this.toolbar=new ca(this.ctx),this.optionsToolbar=ne
1w Wi(this.ctx,(()=>{const e=this.state.getActive();if(null!=e)return ia(this.annotationData.at(e))})),this.axesButtons=new Ve,this.annotationData=new n.F_c(e.createAnnotationDatum),this.defaults=new ki,this.container=new s.n1.Group({name:"static-annotations"}),this.annotations=new ka(this.container,this.createAnnotationScene.bind(this)),this.settingsDialog=new xa(this.ctx),this.textInput=new Fe(this.ctx),this.postUpdateFns=[],this.isRestoringMemento=!1,this.state=this.setupStateMachine(),this.setupListeners(),this.setupDOM(),t.annotationManager&&this.ctx.historyManager.addMementoOriginator(t.annotationManager),this.ctx.historyManager.addMementoOriginator(this.defaults),this.textInput.setKeyDownHandler(this.onTextInput.bind(this)),this.cleanup.register(t.chartState.observe((e=>{const t=e("options","annotations"),i=t?.enabled??!1;this.toolbar.enabled=i,this.optionsToolbar.enabled=i,this.axesButtons.enabled=i,null!=t?.toolbar&&this.toolbar.set(t.toolbar),null!=t?.optionsToolbar&&this.optionsToolbar.set(t.optionsToolbar),null!=t?.axesButtons&&this.axesButtons.set(t.axesButtons)})),(()=>{this.clear(),this.xAxis?.button?.destroy(),this.yAxis?.button?.destroy(),this.textInput.destroy()}))}get opts(){return this.ctx.chartState.getValue("options","annotations")}setupStateMachine(){const{ctx:e}=this;return new na({resetToIdle:()=>{e.domManager.updateCursor("annotations"),this.popAnnotationState(va.Annotations),this.hideOverlays(),this.optionsToolbar.hide(),this.deleteEphemeralAnnotations(),this.update()},hoverAtCoords:(t,i,n)=>{let s;return this.annotations.each(((e,n,a)=>{if(!n.isHoverable())return;const o=e.containsPoint(t.x,t.y);o&&(s??(s=a)),e.toggleHovered(o,i===a,n.readOnly)})),null!=s?e.tooltipManager.suppressTooltip("annotations"):this.isAnnotationState()||e.tooltipManager.unsuppressTooltip("annotations"),null!=s&&this.annotationData.at(s)?.readOnly||this.ctx.domManager.updateCursor("annotations",null==s?void 0:this.annotations.at(s)?.getCursor()),s!==n&&this.update(),s},getNodeAtCoords:(e,t)=>{const i=this.annotations.at(t);return i?.getNodeAtCoords(e.x,e.y)},translate:(e,t)=>
1{const i=this.annotations.at(e),n=ia(this.annotationData.at(e));if(i&&n)return this.translateNode(i,n,t)},copy:e=>{const t=this.annotations.at(e),i=ia(this.annotationData.at(e));if(t&&i)return this.createAnnotationDatumCopy(t,i)},paste:e=>{this.createAnnotation(e.type,e,!1),this.postUpdateFns.push((()=>{this.state.transitionAsync("selectLast"),this.state.transitionAsync("copy")}))},select:(e,t)=>{const{annotations:i,optionsToolbar:n}=this;this.hideOverlays(),this.textInput.isVisible()||(this.toolbar.clearActiveButton(),this.toolbar.resetButtonIcons());const s=null==e?null:i.at(e),a=null==t?null:i.at(t),o=null==e?null:this.annotationData.at(e);a===s&&null!=s||(a?.toggleActive(!1),n.hide(),s&&!o?.readOnly?(this.pushAnnotationState(va.AnnotationsSelected),s.toggleActive(!0),li(o)||(n.updateButtons(this.annotationData.at(e)),this.postUpdateFns.push((()=>{n.show(),n.setAnchorScene(s)})))):(this.popAnnotationState(va.AnnotationsSelected),this.popAnnotationState(va.Annotations)),li(o)||this.deleteEphemeralAnnotations(),this.update())},selectLast:()=>(this.pushAnnotationState(va.AnnotationsSelected),this.annotationData.length-1),startInteracting:()=>{this.pushAnnotationState(va.Annotations)},stopInteracting:()=>{this.popAnnotationState(va.Annotations)},startDragging:e=>{this.onStartDragging(e)},create:(e,t)=>{this.createAnnotation(e,t)},delete:e=>{this.annotationData.splice(e,1)},deleteAll:()=>{const e=this.annotationData.filter((e=>!!e.readOnly&&e));this.annotationData.splice(0,this.annotationData.length,...e)},validatePoint:(e,t)=>{const i=this.getAnnotationContext();return!i||rs(i,e,t)},getAnnotationType:e=>function(e){for(const t of He)if(t===e)return t}(this.annotationData[e].type),datum:e=>this.annotationData.at(e),node:e=>this.annotations.at(e),recordAction:e=>{this.recordActionAfterNextUpdate(e)},update:()=>{this.postUpdateFns.push((()=>{const e=this.state.getActive(),t=null==e?null:this.annotations.at(e);null!=t&&this.optionsToolbar.setAnchorScene(t)})),this.update()},showTextInput:e=>{const t=ia(this.annotationData.at(e));if(!(this.annotations.at(e)&&t&&"getTextInputCoords"in t&&"getTextPosition"in t))return;const i={color:t.color,fontFamily:t.fontFamily,fontSize:t.fontSize,fontStyle:t.fontStyle,fontWeight:t.fontWeight,placeholderColor:t.getPlaceholderColor()},s=this.getAnnotationContext();this.textInput.show({styles:i,layout:{getTextInputCoords:e=>n.ZY9.add(t.getTextInputCoords(s,e),n.ZY9.required(this.seriesRect)),getTextPosition:()=>t.getTextPosition(),alignment:t.alignment,textAlign:t.textAlign,width:t.width},text:t.text,placeholderText:t.placeholderText,onChange:(e,t)=>
1{this.state.transition("updateTextInputBBox",t)}}),this.ctx.domManager.updateCursor("annotations")},hideTextInput:()=>{this.textInput.hide()},updateTextInputColor:e=>{this.textInput.updateColor(e)},updateTextInputFontSize:e=>{const t=this.textInput.updateFontSize(e);this.state.transition("updateTextInputBBox",t)},updateTextInputBBox:e=>{this.state.transition("updateTextInputBBox",e)},showAnnotationOptions:e=>{const t=this.annotations.at(e);t&&!li(this.annotationData.at(e))&&(this.optionsToolbar.updateButtons(this.annotationData.at(e)),this.optionsToolbar.show(),this.optionsToolbar.setAnchorScene(t))},showAnnotationSettings:(e,t,i="line")=>{const n=this.annotationData.at(e);if(!hi(n)&&!ci(n)&&!pi(n))return;if(li(n))return;const s=e=>(t,i,s,a)=>{this.setColorAndDefault(n.type,e,t,i,s,a),this.optionsToolbar.updateColorPickerColor(e,i,s,a)},a=e=>()=>{this.recordActionAfterNextUpdate(`Change ${n.type} ${e} to ${n.getDefaultColor(e)}`,["annotations","defaults"]),this.update()},o={initialSelectedTab:i,ariaLabel:this.ctx.localeManager.t("ariaLabelAnnotationSettingsDialog"),sourceEvent:t,onChangeLine:e=>{this.state.transition("lineProps",e),null!=e.bands&&this.defaults.setDefaultFibonacciOptions(n.type,"bands",e.bands),null!=e.reverse&&this.defaults.setDefaultFibonacciOptions(n.type,"reverse",e.reverse),null!=e.showFill&&this.defaults.setDefaultFibonacciOptions(n.type,"showFill",e.showFill)},onChangeText:e=>{this.state.transition("lineText",e),e.alignment&&this.defaults.setDefaultLineTextAlignment(n.type,e.alignment),e.position&&this.defaults.setDefaultLineTextPosition(n.type,e.position),this.recordActionAfterNextUpdate(`Change ${n.type} text ${Object.keys(e).map((t=>`${t} to ${e[t]}`)).join(", ")}`)},onChangeFillColor:s("fill-color"),onChangeHideFillColor:a("fill-color"),onChangeLineColor:s("line-color"),onChangeHideLineColor:a("line-color"),onChangeLineStyleType:e=>{this.setLineStyleTypeAndDefault(n.type,e),this.optionsToolbar.updateLineStyleType(Ei.find((t=>t.value===e))??Ei[0])},onChangeLineStyleWidth:e=>{this.setLineStyleWidthAndDefault(n.type,e),this.optionsToolbar.updateStrokeWidth({strokeWidth:e,value:e,label:String(e)})},onChangeTextColor:s("text-color"),onChangeHideTextColor:a("text-color"),onChangeTextFontSize:e=>{this.setFontSizeAndDefault(n.type,e)}};this.settingsDialog.show(n,o)}})}setupListeners(){const{ctx:e,optionsToolbar:t,settingsDialog:i,toolbar:n}=this,{seriesWidget:s,seriesDragInterpreter:a,chartWidget:o}=e.widgets;a&&this.cleanup.register(a.events.on("click",this.hoverTouchPreHandler.bind(this)),a.events.on("drag-start",this.hoverTouchPreHandler.bind(this)),a.events.on("drag-move",this.dragMoveTouchPreHandler.bind(this)),a.events.on("mousemove",this.onHover.bind(this)),a.events.on("click",this.onClick.bind(this)),a.events.on("dblclick",this.onDoubleClick.bind(this)),a.events.on("drag-start",this.onDragStart.bind(this)),a.events.on("drag-move",this.onDrag.bind(this)),a.events.on("drag-end",this.onDragEnd.bind(this))),this.cleanup.register(s.addListener("keydown",this.onKeyDown.bind(this)),s.addListener("keyup",this.onKeyUp.bind(this)),o.addListener("click",this.onCancel.bind(this)),e.eventsHub.on("annotations:restore",this.onRestoreAnnotations.bind(this)),e.eventsHub.on("layout:complete",this.onLayoutComplete.bind(this)),e.eventsHub.on("update:pre-scene-render",this.onPreRender.bind(this)),e.eventsHub.on("zoom:change-complete",(()=>this.onResize())),e.eventsHub.on("dom:resize",(()=>this.onResize())),n.events.on("cancel-create-annotation",(()=>{this.cancel(),this.reset(),this.update()})),n.events.on("pressed-create-annotation",(({annotation:e})=>{this.cancel(),this.pushAnnotationState(va.Annotations),this.state.transition(e),this.update()})),n.events.on("pressed-clear",(()=>{this.clear(),this.recordActionAfterNextUpdate("Clear all")})),n.events.on("pressed-show-menu",(()=>{this.cancel(),this.reset()})),n.events.on("pressed-unrelated",(()=>{this.reset()})),t.events.on("pressed-delete",(()=>{this.cancel(),this.delete(),this.reset()})),t.events.on("pressed-settings",(({sourceEvent:e})=>{this.state.transition("toolbarPressSettings",e)})),t.events.on("pressed-lock",(({locked:e})=>{this.recordActionAfterNextUpdate(e?"Locked":"Unlocked"),this.update()})),t.events.on("hid-overlays",(()=>{this.settingsDialog.hide()})),t.events.on("saved-color",(({type:e,colorPickerType:t,color:i})=>{this.recordActionAfterNextUpdate(`Change ${e} ${t} to ${i}`,["annotations","defaults"])})),t.events.on("updated-color",(({type:e,colorPickerType:t,colorOpacity:i,color:n,opacity:s,isMultiColor:a})=>{this.setColorAndDefault(e,t,i,n,s,a)})),t.events.on("updated-font-size",(({type:e,fontSize:t})=>{this.setFontSizeAndDefault(e,t)})),t.events.on("updated-line-style",(({type:e,lineStyleType:t})=>{this.setLineStyleTypeAndDefault(e,t)})),t.events.on("updated-line-width",(({type:e,strokeWidth:t})=>{this.setLineStyleWidthAndDefault(e,t)})),i.events.on("hidden",(()=>{this.optionsToolbar.clearActiveButton()})))}setupDOM(){const{ctx:e,toolbar:t,optionsToolbar:i}=this;this.cleanup.register(e.annotationManager.attachNode(this.container),(()=>{e.domManager.removeStyles(ua),t.destroy(),i.destroy()}))}async processData(e){const t=this.opts;if(!(t.enabled??!0)||null==t.data||null==t.xKey||null==t.volumeKey)return;const i=[Sa(t.xKey,void 0,{id:"date"}),Ma(t.volumeKey,"number",{id:"volume"})],n=wa.wrap(t.data,this.ctx.logger)??wa.empty(this.ctx.logger),{dataModel:s,processedData:a}=await e.request("annotations",n,{props:i});this.dataModel=s,this.processedData=a}createAnnotationScene(e){if(e.type in ta)return new ta[e.type].scene;throw new Error(`AG Charts - Cannot create annotation scene of type [${e.type}], expected one of [${Object.keys(ta)}], ignoring.`)}static createAnnotationDatum(e){if(e.type in ta)return(new ta[e.type].datum).set(e);throw new Error(`AG Charts - Cannot create annotation datum of unknown type [${e.type}], expected one of [${Object.keys(ta)}], ignoring.`)}createAnnotation(e,t,i=!0){if(this.annotationData.push(t),i){const i=this.ctx.annotationManager?.getAnnotationTypeStyles(e);i&&t.set(i),this.defaults.applyDefaults(t)}this.injectDatumDependencies(t),this.update()}injectDatumDependencies(e){"setLocaleManager"in e&&e.setLocaleManager(this.ctx.localeManager),"getVolume"in e&&(e.getVolume=this.getDatumRangeVolume.bind(this))}getDatumRangeVolume(e,t){const{dataModel:i,processedData:s}=this;let a=ut(e),o=ut(t);if(!((0,n.vdg)(a)&&(0,n.vdg)(o)&&i&&s&&null!=this.opts.volumeKey))return;a>o&&([a,o]=[o,a]);const r=i.resolveKeysById({id:"annotations"},"date",s),l=i.resolveColumnById({id:"annotations"},"volume",s,"mixed-numeric");let h=0;for(let e=0;e<s.input.count;e++){const t=r[e];(0,n.vdg)(t)&&t>=a&&t<=o&&(h=(0,n.mlo)(h,l[e]))}return h}translateNode(e,t,i){const n=this.getAnnotationConfig(t),s=this.getAnnotationContext();s&&n.translate(e,t,i,s)}createAnnotationDatumCopy(e,t){const i=this.getAnnotationConfig(t),n=new i.datum;n.set(t.toJson());const s=this.getAnnotationContext();if(s)return i.copy(e,t,n,s)}getAnnotationConfig(e){if(e.type in ta)return ta[e.type];throw new Error(`AG Charts - Cannot get annotation config of unknown type [${e.type}], expected one of [${Object.keys(ta)}], ignoring.`)}dropUnsupportedColors(e){const t=e;for(const e of["color","stroke","fill"]){const i=t[e];"string"==typeof i&&(0,n._As)(i)&&(this.ctx.logger.warnOnce(`Annotation property [${e}] cannot be set to [${i}]; expecting a supported color string, ignoring.`),delete t[e])}return e}onRestoreAnnotations(e){if(!(this.opts.enabled??1))return;const t=e.annotations.map((e=>this.dropUnsupportedColors(e))),i=this.annotationData.length===t.length&&t.every(((e,t)=>{const i=this.annotationData.at(t);return i?.type===e.type}));this.isRestoringMemento=!0;try{if(i)for(let e=0;e<t.length;e+=1)this.annotationData[e].set(t[e]);else this.reset(),this.annotationData.set(t)}finally{this.isRestoringMemento=!1}this.postUpdateFns.push((()=>{this.ctx.annotationManager?.fireChangedEvent()})),this.update()}onLayoutComplete(e){if(!(this.opts.enabled??1))return;const t=e.series.paddedRect;this.seriesRect=t,this.container.setClipRect(t),this.xAxis=this.getAxis(e.axes[n.tv$.X],t,this.xAxis?.button),this.yAxis=this.getAxis(e.axes[n.tv$.Y],t,this.yAxis?.button),this.showAnnotations()?this.animateAnnotations({from:0,to:1,phase:"trailing"}):this.animateAnnotations({from:1,to:0,phase:"remove"})}showAnnotations(){if(!this.yAxis||!this.xAxis)return!1;const e=this.ctx.chartService.series.some((e=>e.hasData)),t=this.yAxis.context.seriesIds().some((e=>{const t=this.ctx.chartService.series.find((t=>t.id===e));return t?.visible}));return e&&t}animateAnnotations({from:e,to:t,phase:i}){const{annotations:n}=this;this.ctx.animationManager?.animate({from:e,to:t,id:"chart-annotations",phase:i,groupId:"opacity",onUpdate(e){n.each((t=>{const i=t;i.opacity=e,"setAxisLabelOpacity"in i&&i.setAxisLabelOpacity(e)}))},onStop(){n.each((e=>{const i=e;i.opacity=t,"setAxisLabelOpacity"in i&&i.setAxisLabelOpacity(t)}))}})}
1onPreRender(){(this.opts.enabled??1)&&(this.updateAnnotations(),this.state.transition("render"))}getAxis(e,t,i){const s=this.ctx.axisManager.getAxisContext(e.direction)[0],{position:a="bottom",direction:o}=s,r=e.gridPadding+e.seriesAreaPadding,l=new Da(0,0,t.width,t.height).grow(r,a),h=o===n.tv$.X?"vertical":"horizontal",c=this.opts,d=c.enabled??!0,u=c.snap??!1,{axesButtons:p}=this;if(d&&p.enabled&&("xy"===p.axes||p.axes===o)){i??(i=new pa(this.ctx,{...s,snapToGroup:u},(e=>this.onAxisButtonClick(e,h)),t));const n=ba(e);i.update(t,n)}else i?.destroy(),i=void 0;return{layout:e,context:s,bounds:l,button:i}}recordActionAfterNextUpdate(e,t=["annotations"]){const{defaults:i,ctx:{historyManager:n},ctx:s}=this,a=s.annotationManager;if(!a)return;if(this.isRestoringMemento)return;const o=t.map((e=>"defaults"===e?i:a));this.postUpdateFns.push((()=>{n.record(e,...o),a.fireChangedEvent()}))}setColorAndDefault(e,t,i,n,s,a){this.state.transition("color",{colorPickerType:t,colorOpacity:i,color:n,opacity:s,isMultiColor:a}),this.defaults.setDefaultColor(e,t,i,n,s,a)}setFontSizeAndDefault(e,t){this.state.transition("fontSize",t),this.defaults.setDefaultFontSize(e,t),this.recordActionAfterNextUpdate(`Change ${e} font size to ${t}`,["annotations","defaults"])}setLineStyleTypeAndDefault(e,t){this.state.transition("lineStyle",{type:t}),this.defaults.setDefaultLineStyleType(e,t),this.recordActionAfterNextUpdate(`Change ${e} line style to ${t}`,["annotations","defaults"])}setLineStyleWidthAndDefault(e,t){this.state.transition("lineStyle",{strokeWidth:t}),this.defaults.setDefaultLineStyleWidth(e,t),this.recordActionAfterNextUpdate(`Change ${e} stroke width to ${t}`,["annotations","defaults"])}updateAnnotations(){const{annotationData:e,annotations:t,seriesRect:i,ctx:n}=this,s=n.annotationManager,a=this.getAnnotationContext();if(!i||!a)return;s?.updateData(e.toJson());const o=this.showAnnotations();this.toolbar.refreshButtonsEnabled(o),this.toolbar.toggleClearButtonEnabled(e.length>0&&o),t.update(e??[],void 0,(e=>e.id)).each(((e,t)=>{const i=e;if(!o)return i.visible=!1,void("setAxisLabelVisible"in i&&i.setAxisLabelVisible(!1));"setAxisLabelVisible"in i&&i.setAxisLabelVisible(!0),this.injectDatumDependencies(t),function(e,t,i){for(const n of Object.values(ta))n.update(e,t,i)}(i,t,a)}));for(const e of this.postUpdateFns)e();this.postUpdateFns=[]}getAnnotationContext(){const{seriesRect:e,xAxis:t,yAxis:i,ctx:n}=this;if(!e||!t||!i)return;const s=this.opts.snap??!1;return{logger:n.logger,seriesRect:e,isRtl:n.domManager.isRtl,xAxis:{...t.context,bounds:t.bounds,labelPadding:ba(t.layout),snapToGroup:s},yAxis:{...i.context,bounds:i.bounds,labelPadding:ba(i.layout),snapToGroup:s}}}onHover(e){const{state:t}=this,i=this.getAnnotationContext();if(!i)return;const s=e.sourceEvent.shiftKey,a=n.ZY9.from(e),o=yt(a,i);t.transition("hover",{offset:a,point:o,shiftKey:s,context:i})}onClick(e){const{state:t}=this,i=this.getAnnotationContext();if(!i)return;const s=e.sourceEvent.shiftKey,a=yt(n.ZY9.from(e),i),o=this.textInput.getValue(),r=this.textInput.getBBox();t.transition("click",{point:a,shiftKey:s,textInputValue:o,bbox:r})}onDoubleClick(e){const{state:t}=this;if(!this.getAnnotationContext())return;const i=n.ZY9.from(e);t.transition("dblclick",{offset:i})}onAxisButtonClick(e,t){this.cancel(),this.reset();const i=this.getAnnotationContext();if(!this.annotationData||!i)return;const{state:n}=this;this.pushAnnotationState(va.Annotations),this.ctx.widgets.seriesWidget.focus({preventScroll:!0});const s="horizontal"===t;if(n.transition(s?"horizontal-line":"vertical-line"),this.optionsToolbar.hide(),!e)return;const a=yt(e,i);rs(i,a)&&(n.transition("click",{point:a,shiftKey:!1}),this.update())}onResize(){const e=this.textInput.getValue(),t=this.textInput.getBBox();this.state.transition("resize",{textInputValue:e,bbox:t})}hoverTouchPreHandler(e){"touch"===e.device&&this.onHover(e)}dragMoveTouchPreHandler(e){"touch"===e.device&&this.ctx.interactionManager.isState(va.AnnotationsSelected)&&e.sourceEvent.preventDefault()}onDragStart(e){if(!this.ctx.interactionManager.isState(va.AnnotationsDraggable))return;const t=this.getAnnotationContext();if(!t)return;const i=n.ZY9.from(e),s=yt(i,t),a=this.textInput.getValue(),o=this.textInput.getBBox();this.state.transition("dragStart",{context:t,offset:i,point:s,textInputValue:a,bbox:o})}onDrag(e){if(!this.ctx.interactionManager.isState(va.AnnotationsDraggable))return;const t=this.getAnnotationContext();if(!t)return;const i=n.ZY9.from(e),s=yt(i,t),a=e.sourceEvent.shiftKey,o=this.textInput.getValue(),r=this.textInput.getBBox();this.state.transition("drag",{context:t,offset:i,point:s,shiftKey:a,textInputValue:o,bbox:r})}onDragEnd(){this.state.transition("dragEnd")}onCancel(e){const{sourceEvent:t}=e??{};t?.currentTarget===t?.target&&(this.cancel(),this.reset())}onDelete(){this.textInput.isVisible()||(this.cancel(),this.delete(),this.reset(),this.update())}onTextInput(e){const{state:t}=this,i=this.getAnnotationContext();if(!i)return;const{key:n,shiftKey:s}=e,a=this.textInput.getValue(),o=this.textInput.getBBox();t.transition("textInput",{key:n,shiftKey:s,textInputValue:a,bbox:o,context:i})}onKeyDown(e){const{state:t}=this,i=this.getAnnotationContext();if(!i)return;const{sourceEvent:n}=e,{shiftKey:s,ctrlKey:a,metaKey:o}=n,r=a||o,l=a||s;
1t.transition("keyDown",{shiftKey:s,context:i});const h={x:0,y:0},c=Math.max(i?.xAxis.scale.bandwidth??0,l?10:1),d=Math.max(i?.yAxis.scale.bandwidth??0,l?10:1);switch(n.key){case"ArrowDown":h.y=d;break;case"ArrowUp":h.y=-d;break;case"ArrowLeft":h.x=-c;break;case"ArrowRight":h.x=c;break;case"Escape":return void this.onCancel();case"Backspace":case"Delete":return void this.onDelete()}if((h.x||h.y)&&(t.transition("translate",{translation:h}),n.preventDefault()),r)switch(n.key){case"c":return void t.transition("copy");case"x":return t.transition("cut"),void this.recordActionAfterNextUpdate("Cut annotation");case"v":return t.transition("paste"),void this.recordActionAfterNextUpdate("Paste annotation")}}onKeyUp(e){const{shiftKey:t}=e.sourceEvent,i=this.getAnnotationContext();i&&(this.state.transition("keyUp",{shiftKey:t,context:i}),this.state.transition("translateEnd"))}clear(){this.cancel(),this.deleteAll(),this.reset()}reset(){this.state.transition("reset")}cancel(){this.state.transition("cancel")}delete(){this.state.transition("delete")}deleteAll(){this.state.transition("deleteAll")}deleteEphemeralAnnotations(){let e=!1;for(const[t,i]of this.annotationData.entries())li(i)&&(this.annotationData.splice(t,1),e=!0);e&&this.recordActionAfterNextUpdate("Delete ephemeral annotations")}hideOverlays(){this.settingsDialog.hide(),this.toolbar.hideOverlays(),this.optionsToolbar.hideOverlays()}onStartDragging(e){const t=this.annotationData.at(e),i=qt.is(t);if(!i&&!Qt.is(t))return;if(!t.axisLabel.enabled)return;const n=i?this.yAxis:this.xAxis;n&&this.ctx.eventsHub.emit("annotations:axis-label-drag-start",{axisId:n.context.axisId})}pushAnnotationState(e){this.ctx.interactionManager.pushState(e),this.ctx.tooltipManager.suppressTooltip("annotations")}popAnnotationState(e){this.ctx.interactionManager.popState(e),this.ctx.tooltipManager.unsuppressTooltip("annotations")}isAnnotationState(){return this.ctx.interactionManager.isState(va.Annotations)||this.ctx.interactionManager.isState(va.AnnotationsSelected)}update(e=n.GvF.PRE_SCENE_RENDER){this.ctx.eventsHub.emit("chart:request-update",{type:e})}},Aa={stroke:{$ref:"foregroundColor"},strokeOpacity:1,strokeWidth:2},Ca={fill:n.nW0,strokeOpacity:1,strokeWidth:2},Na={color:{$ref:"chartBackgroundColor"},fontSize:{$rem:n.q8q.LARGE},fontFamily:{$ref:"fontFamily"}},La={...Na,enabled:!0,fill:{$ref:"foregroundColor"},fontSize:{$ref:"fontSize"}},Pa={...Na,textAlign:"start"},Ta={...Na,position:"top",alignment:"center",color:{$ref:"textColor"}},Oa={...Na,position:"top",alignment:"center",color:{$ref:"textColor"}},Ra={...Na,fontSize:{$ref:"fontSize"},color:n.KCM,fill:n.w9K,stroke:n.lO7,strokeWidth:1,divider:{stroke:n.Fn1,strokeWidth:1,strokeOpacity:.5}},Ea={...Aa,background:{fill:{$ref:"foregroundColor"},fillOpacity:.075},handle:{...Ca},text:{...Ta},statistics:{...Ra}},za={enabled:!1,line:{...Aa,handle:{...Ca},text:{...Ta}},"horizontal-line":{...Aa,handle:{...Ca},axisLabel:{...La},text:{...Ta}},"vertical-line":{...Aa,handle:{...Ca},axisLabel:{...La},text:{...Ta}},"disjoint-channel":{...Aa,background:{fill:{$ref:"foregroundColor"},fillOpacity:.075},handle:{...Ca},text:{...Oa}},"parallel-channel":{...Aa,middle:{lineDash:[6,5],strokeWidth:1},background:{fill:{$ref:"foregroundColor"},fillOpacity:.075},handle:{...Ca},text:{...Oa}},"fibonacci-retracement":{...Aa,strokes:n.fsm,rangeStroke:{$ref:"foregroundColor"},handle:{...Ca},text:{...Ta,position:"center"},label:{...Na,color:void 0,fontSize:{$rem:n.q8q.SMALLER}}},"fibonacci-retracement-trend-based":{...Aa,strokes:n.fsm,rangeStroke:{$ref:"foregroundColor"},handle:{...Ca},text:{...Ta,position:"center"},label:{...Na,color:void 0,fontSize:{$rem:n.q8q.SMALLER}}},callout:{...Aa,...Pa,color:{$ref:"textColor"},handle:{...Ca},fill:{$ref:"foregroundColor"},fillOpacity:.075},comment:{...Pa,fontWeight:700,handle:{...Ca},fill:{$ref:"foregroundColor"}},note:{...Pa,color:n.vjx,fill:n.oC3,stroke:{$ref:"chartBackgroundColor"},strokeWidth:1,strokeOpacity:1,handle:{...Ca},background:{fill:n.xFO,stroke:n.U4X,strokeWidth:1}},text:{...Pa,color:{$ref:"textColor"},handle:{...Ca}},arrow:{...Aa,handle:{...Ca},text:{...Ta}},"arrow-up":{fill:{$palette:"up.fill"},handle:{...Ca,stroke:{$ref:"foregroundColor"}}},"arrow-down":{fill:{$palette:"down.fill"},handle:{...Ca,stroke:{$ref:"foregroundColor"}}},"date-range":{...Ea},"price-range":{...Ea},"date-price-range":{...Ea},"quick-date-price-range":{up:{...Aa,fill:n.zVM,fillOpacity:.2,handle:{...Ca},statistics:{...Ra,color:"#fff",fill:n.zVM,strokeWidth:0,divider:{stroke:"#fff",strokeWidth:1,strokeOpacity:.5}}},down:{...Aa,stroke:n.wAP,fill:n.Xg7,fillOpacity:.2,handle:{...Ca,stroke:n.wAP},statistics:{...Ra,color:"#fff",fill:n.Xg7,strokeWidth:0,divider:{stroke:"#fff",strokeWidth:1,strokeOpacity:.5}}}},axesButtons:{},toolbar:{buttons:{$shallowSimple:[{icon:"text-annotation",tooltip:"toolbarAnnotationsTextAnnotations",value:"text-menu"},{icon:"trend-line-drawing",tooltip:"toolbarAnnotationsLineAnnotations",value:"line-menu"},{icon:"arrow-drawing",tooltip:"toolbarAnnotationsShapeAnnotations",value:"shape-menu"},{icon:"delete",tooltip:"toolbarAnnotationsClearAll",value:"clear"}]},padding:{$ref:"chartPadding"}},optionsToolbar:{buttons:{$shallowSimple:[{icon:"text-annotation",tooltip:"toolbarAnnotationsTextColor",value:"text-color"},{icon:"line-color",tooltip:"toolbarAnnotationsLineColor",value:"line-color"},{icon:"fill-color",tooltip:"toolbarAnnotationsFillColor",value:"fill-color"},{tooltip:"toolbarAnnotationsTextSize",value:"text-size"},{tooltip:"toolbarAnnotationsLineStrokeWidth",value:"line-stroke-width"},{icon:"line-style-solid",tooltip:"toolbarAnnotationsLineStyle",value:"line-style-type"},{icon:"settings",tooltip:"toolbarAnnotationsSettings",value:"settings"},{type:"switch",icon:"unlocked",tooltip:"toolbarAnnotationsLock",ariaLabel:"toolbarAnnotationsLock",checkedOverrides:{icon:"locked",tooltip:"toolbarAnnotationsUnlock"},value:"lock"},{icon:"delete",tooltip:"toolbarAnnotationsDelete",value:"delete"}]}}},Ba={type:"plugin",name:"annotations",chartType:"cartesian",enterprise:!0,version:s.xv,options:s.n1.annotationOptionsDef,themeTemplate:za,create:e=>new Ia(e),register:e=>{e.has("annotationManager")||e.service("annotationManager",(e=>new s.n1.AnnotationManager(e))),e.has("sharedToolbar")||e.service("sharedToolbar",(e=>new Ee(e)))}},{Range:Fa,TranslatableGroup:Va,BBox:$a,FillGradientDefaults:Ha,FillImageDefaults:ja,FillPatternDefaults:Wa,getShapeFill:_a,InteractionState:Ga}=s.n1,Ka=(()=>{var e=class extends n.UbG{constructor(e){super(),this.ctx=e,this.id=(0,n.sX_)(this),this.fillGradientDefaults=new Ha,this.fillPatternDefaults=new Wa,this.fillImageDefaults=new ja,this.bounds=new $a(0,0,0,0),this.bandHighlightGroup=new Va({name:"bandHighlight",zIndex:n.Dcv.AXIS_BAND_HIGHLIGHT}),this.rangeNode=this.bandHighlightGroup.appendChild(new Fa),this.activeAxisHighlight=void 0,this.axisCtx=e.parent,this.hideBand(),e.domManager.addEventListener("focusin",(({target:t})=>{const i=t instanceof HTMLElement&&e.domManager.contains(t,"series-area");this.bandHighlightGroup.visible&&!i&&(this.hideBand(),this.ctx.eventsHub.emit("chart:request-update",{type:n.GvF.SCENE_RENDER}))}));const{widgets:{seriesWidget:t,seriesDragInterpreter:i},animationManager:s,eventsHub:a}=e;this.cleanup.register(e.scene.attachNode(this.bandHighlightGroup),t.addListener("mousemove",(e=>this.onHoverLikeEvent(e))),t.addListener("mouseleave",(()=>this.clearAllHighlight())),s.addListener("animation-start",(()=>this.clearAllHighlight())),a.on("layout:complete",(e=>this.layout(e))),a.on("series:focus-change",(()=>this.onKeyPress())),a.on("zoom:pan-start",(()=>this.clearAllHighlight())),a.on("zoom:change-complete",(()=>this.clearAllHighlight())),a.on("dom:resize",(()=>this.clearAllHighlight())),a.on("axis:change",(()=>this.axisChange()))),i&&this.cleanup.register(i.events.on("drag-move",(e=>this.onHoverLikeEvent(e))),i.events.on("click",(e=>this.onClick(e))))}applyOptions(e){this.options=e}axisChange(){this.onHighlightChange()}isHover(e){return"mousemove"===e.type||"click"===e.type||"touch"===e.device&&"hover"===this.ctx.chartState.getValue("options","touch").dragAction}onClick(e){"touch"===e.device&&this.onHoverLikeEvent(e)}clearAllHighlight(){this.ctx.interactionManager.isState(Ga.Hoverable)&&this.onHighlightChange()}onKeyPress(){this.ctx.interactionManager.isState(Ga.Default)&&this.onHighlightChange()}onHoverLikeEvent(e){const t=this.isHover(e)?Ga.Hoverable:Ga.AnnotationsMoveable;this.ctx.interactionManager.isState(t)&&this.handleHoverHighlight(e)}handleHoverHighlight(e){if(!e)return;const{currentX:t,currentY:i}=e;this.onHighlightChange(this.axisCtx.pickBand({x:t,y:i}))}layout({series:{rect:e,visible:t},axes:i}){if(!t||!i||!this.options?.enabled)return;const{position:n="left",axisId:s}=this.axisCtx,a=i[s];if(!a)return;this.axisLayout=a,this.bounds=e.clone().grow(a.gridPadding,n);const{bandHighlightGroup:o,bounds:r}=this;o.translationX=Math.round(r.x),o.translationY=Math.round(r.y),this.updateBand()}updateBand(){const{rangeNode:e,axisLayout:t,options:i}=this;if(!t||!i)return;const{stroke:n,strokeWidth:s,strokeOpacity:a,lineDash:o,fill:r,fillOpacity:l,lineDashOffset:h}=i;e.stroke=n,e.strokeWidth=s,e.strokeOpacity=a,e.lineDash=o,e.lineDashOffset=h,e.fill=_a(r,this.fillGradientDefaults,this.fillPatternDefaults,this.fillImageDefaults),e.fillOpacity=l,e.startLine=!0,e.endLine=!0}isVertical(){return this.axisCtx.direction===n.tv$.X}onHighlightChange(e){this.options?.enabled&&(this.activeAxisHighlight=e,this.activeAxisHighlight?this.showBand():this.hideBand(),this.ctx.eventsHub.emit("chart:request-update",{type:n.GvF.SCENE_RENDER}))}updateBandPosition(){const{rangeNode:e,bounds:t}=this,{band:i}=this.activeAxisHighlight??{};if(null==i)return void this.hideBand();let n=Math.min(...i),s=Math.max(...i);if(s-n<1){const e=(n+s)/2;n=e-.5,s=e+.5}this.isVertical()?(e.y1=0,e.y2=t.height,e.x1=n,e.x2=s,e.horizontal=!0):(e.y1=n,e.y2=s,e.x1=0,e.x2=t.width,e.horizontal=!1)}showBand(){this.updateBandPosition(),this.bandHighlightGroup.visible=!0}hideBand(){this.bandHighlightGroup.visible=!1}};return e.className="BandHighlight",e})(),Ya={type:"axis:plugin",name:"bandHighlight",chartType:"cartesian",axisTypes:["category","ordinal-time","unit-time","grouped-category"],enterprise:!0,version:s.xv,themeTemplate:{enabled:!1,stroke:"rgb(195, 195, 195)",strokeWidth:0,strokeOpacity:1,lineDash:[],lineDashOffset:0,fill:{$foregroundBackgroun
1dMix:.05},fillOpacity:1},create:e=>new Ka(e)},{LayoutElement:Ua,Menu:Xa}=s.n1,Za=[{label:"toolbarSeriesTypeOHLC",icon:"ohlc-series",value:"ohlc"},{label:"toolbarSeriesTypeCandles",icon:"candlestick-series",value:"candlestick"},{label:"toolbarSeriesTypeHollowCandles",icon:"hollow-candlestick-series",value:"hollow-candlestick"},{label:"toolbarSeriesTypeLine",icon:"line-series",value:"line"},{label:"toolbarSeriesTypeStepLine",icon:"step-line-series",value:"step-line"},{label:"toolbarSeriesTypeHLC",icon:"hlc-series",value:"hlc"},{label:"toolbarSeriesTypeHighLow",icon:"high-low-series",value:"high-low"}],qa=class extends n.UbG{constructor(e){super(),this.ctx=e,this.menuMargin=6,this.menuShowing=!1,this.menu=new Xa(e,"chart-toolbar"),this.toolbar=e.sharedToolbar.getSharedToolbar("chartToolbar"),this.cleanup.register(this.toolbar.addToolbarListener("button-pressed",this.onButtonPressed.bind(this)),e.layoutManager.registerElement(Ua.ToolbarLeft,this.onLayoutStart.bind(this)),e.eventsHub.on("series-area:click",(()=>this.hidePopover())),e.chartState.observe((e=>{this.toolbar.setHidden(!e("options","chartToolbar")?.enabled)})),(()=>this.toolbar.destroy()))}onLayoutStart(e){this.ctx.chartState.getValue("options","chartToolbar")?.enabled&&(this.updateButton(),this.toolbar.layout(e.layoutBox))}onButtonPressed({event:e,buttonBounds:t,buttonWidget:i}){const n=this.ctx.domManager.isRtl?t.x-this.menuMargin:t.x+t.width+this.menuMargin;this.menu.setAnchor({x:n,y:t.y}),this.menu.show(i,{items:Za,menuItemRole:"menuitemradio",ariaLabel:this.ctx.localeManager.t("toolbarSeriesTypeDropdown"),class:"ag-charts-chart-toolbar__menu",value:this.getChartType(),sourceEvent:e.sourceEvent,onPress:e=>{this.setChartType(e.value),this.hidePopover()},onHide:()=>{this.toolbar.clearActiveButton(),this.menuShowing=!1}}),this.menuShowing=!0,this.toolbar.toggleActiveButtonByIndex(0)}updateButton(){const e=this.getChartType(),t=Za.find((t=>t.value===e))?.icon;null!=t&&this.toolbar.updateButtons([{icon:t,tooltip:"toolbarSeriesTypeDropdown",value:"menu"}])}hidePopover(){this.menuShowing&&(this.menuShowing=!1,this.toolbar.clearActiveButton()),this.menu.hide()}setChartType(e){const t={chartType:e};this.ctx.chartService.publicApi?.updateDelta(t).catch((e=>this.ctx.logger.error(e)))}getChartType(){const e=this.ctx.chartService.publicApi?.getOptions()?.chartType;return null!=e&&Za.some((t=>t.value===e))?e:"candlestick"}},Qa={type:"plugin",name:"chartToolbar",chartType:"cartesian",enterprise:!0,version:s.xv,options:{enabled:n.zMY},themeTemplate:{enabled:!1},create:e=>new qa(e),register:e=>{e.has("sharedToolbar")||e.service("sharedToolbar",(e=>new Ee(e)))}};function Ja(e,t){return"always"===e||("series-area"===e?t.has("series-area")||t.has("series-node"):t.has(e))}function eo(e,t,i){let n=!0;if("separator"===t.type){const e=i.at(-1);n=void 0!==e&&"separator"!==e.type}if(n&&(n=Ja(t.showOn??"always",e)),n){const e=new ao(t);return i.push(e),e}}function to(e,t,i,n){t.isVisible(i)&&eo(e,t.builtins.items[i],n)}function io(e,t,i,s){const{builtins:a}=t;if((0,n.bXA)(i,a.lists))for(const n of a.lists[i])to(e,t,n,s);else to(e,t,i,s)}function no(e,t,i){const s=[],{builtins:a}=i;for(const e of t)if("string"==typeof e&&(0,n.bXA)(e,a.lists))for(const t of a.lists[e])s.push(t);else s.push(e);return s.filter((t=>{if("string"==typeof t){const n=i.builtins.items[t].showOn??"always";return i.isVisible(t)&&Ja(n,e)}return Ja(t.showOn??"always",e)}))}function so(e,t,i,n){for(const s of i)if("string"==typeof s)io(e,t,s,n);else{const i=eo(e,s,n);s.items&&i&&s.items.length>0&&so(e,t,s.items,i.items)}"separator"===n.at(-1)?.type&&n.pop()}var ao=class{constructor(e){this.type="action",this.showOn="always",this.label="",this.iconUrl=void 0,this.enabled=!0,this.items=[],this.action=void 0,e&&this.setOptions(e),this.items=[]}setField(e,t,i){t[e]=i}setOptions(e){let t;for(t in e)void 0!==e[t]&&this.setField(t,this,e[t])}},oo="ag-charts-context-menu",{getItemId:ro,ContextMenuRegistry:lo}=s.n1,ho="context-menu",co=["angleKey","calloutLabelKey","colorKey","labelKey","radiusKey","sectorLabelKey","sizeKey","xKey","yKey"],uo=class extends n.UbG{constructor(e){if(super(),this.ctx=e,this.x=0,this.y=0,this.collapsingSubMenus=0,this.menuWidget=new s.uB.MenuWidget,this.interactionManager=e.interactionManager,this.element=e.domManager.addChild("canvas-overlay",ho),this.element.classList.add(oo),this.element.style.display="none",this.element.addEventListener("contextmenu",(e=>e.preventDefault())),this.element.addEventListener("focusout",(({relatedTarget:e})=>{this.collapsingSubMenus>0||(null==e||e instanceof Node&&!this.element.contains(e))&&this.hide()})),this.cleanup.register((()=>this.element.remove()),(()=>this.menuWidget.destroy()),e.eventsHub.on("dom:hidden",(()=>this.hide())),this.menuWidget.addListener("collapse-widget",(()=>this.onCollapse()))),this.menuWidget.addClass(`${oo}__menu`),"undefined"!=typeof MutationObserver){const e=new MutationObserver((()=>{this.element.contains(this.menuWidget.getElement())&&this.reposition()}));e.observe(this.element,{childList:!0}),this.mutationObserver=e,this.cleanup.register((()=>e.disconnect()))}this.ctx.contextMenuRegistry.builtins.items.download.action=()=>{const t=e.chartService.title;let i="image";t?.enabled&&(i=t.node.getPlainText().replace(/\.+/,"")),this.ctx.chartService.publicApi?.download({fileName:i}
1).catch((e=>{this.ctx.logger.error("Unable to download chart",e)}))},this.cleanup.register(this.ctx.eventsHub.on("context-menu:complete",(e=>this.onContext(e))),this.ctx.eventsHub.on("layout:complete",(()=>this.updateAxisInteraction())))}get opts(){return this.ctx.chartState.getValue("options","contextMenu")??{}}updateAxisInteraction(){const e=this.opts.enabled??!0;this.ctx.eventsHub.emit("axis-interaction:update",{source:ho,enabled:e,enableDoubleClick:!1,enableDragging:!1,enableScrolling:!1,enableContextMenu:e})}axisRegion(e){const{axisId:t,boundSeries:i,direction:n,domain:s,value:a,index:o,depth:r,groupPercentage:l}=e;return{showOn:"axis",axisId:t,boundSeries:i,direction:n,domain:s,value:a,index:o,depth:r,groupPercentage:l}}crossLineRegions(e){const t=[];for(const i of e){const{crossLineId:e,axisId:n,direction:s,crossLineType:a,value:o,range:r}=i;t.push({showOn:"cross-line",crossLineId:e,axisId:n,direction:s,crossLineType:a,value:o,range:r})}return t}plotOverlapRegions(e){const t=[];return e.has("series-area")&&t.push({showOn:"series-area"}),e.has("axis")&&null!=this.pickedAxisCtx&&t.push(this.axisRegion(this.pickedAxisCtx)),e.has("cross-line")&&null!=this.pickedCrossLine&&t.push(...this.crossLineRegions(this.pickedCrossLine)),t}makeGetItemsParams(e,t){const{showOn:i}=e,n={defaultItems:no(t,this.opts.items??["defaults"],this.ctx.contextMenuRegistry),coordinates:this.ctx.chartService.toAgCoordinates(e),active:t};switch(i){case"always":return this.makeGetItemsParamsAlways(n);case"series-area":return this.makeGetItemsParamsSeriesArea(n);case"series-node":return this.makeGetItemsParamsSeriesNode(n);case"axis":return this.makeGetItemsParamsAxis(n);case"cross-line":return this.makeGetItemsParamsCrossLine(n);case"caption":return this.makeGetItemsParamsCaption(n);case"legend-item":return this.makeGetItemsParamsLegendItem(n);default:return i}}makeGetItemsParamsAlways(e){const{defaultItems:t,active:i}=e;return[{showOn:"always",defaultItems:t,coordinates:void 0,allShowOnParams:this.plotOverlapRegions(i)},[this.ctx.chartService]]}makeGetItemsParamsSeriesArea(e){const{defaultItems:t,active:i,coordinates:n}=e;return[{showOn:"series-area",defaultItems:t,coordinates:n,allShowOnParams:this.plotOverlapRegions(i)},[this.ctx.chartService]]}makeGetItemsParamsSeriesNode(e){const{defaultItems:t,active:i,coordinates:n}=e;if(null==this.pickedNodes)throw new Error("this.pickedNodes is null");const s=this.pickedNodes.map((e=>{const t=ro(e,e.series.data?.dataIdKey),i={showOn:"series-node",seriesId:e.series.id,itemId:t,datum:e.datum,selectionState:e.series.getSelectionStateString(e.datumIndex),isCollapsed:e.series.getCollapsedState(t)};for(const t of co)void 0!==e[t]&&(i[t]=e[t]);if(void 0!==e.binIndex){const{datums:t,binIndex:n,binRange:s,aggregatedValue:a,frequency:o}=e;Object.assign(i,{datums:t,binIndex:n,binRange:s,aggregatedValue:a,frequency:o})}return i}));if(0===s.length)throw new Error("this.pickedNodes is empty");const a=[...this.plotOverlapRegions(i),...s];return[{...s[0],defaultItems:t,coordinates:n,allShowOnParams:a},[this.pickedNodes[0].series.properties,this.ctx.chartService]]}makeGetItemsParamsAxis(e){const{defaultItems:t,active:i}=e;if(null==this.pickedAxisCtx)throw new Error("this.pickedAxisCtx is null");const n=this.axisRegion(this.pickedAxisCtx),s=[n];i.has("series-area")&&s.push({showOn:"series-area"}),i.has("cross-line")&&null!=this.pickedCrossLine&&s.push(...this.crossLineRegions(this.pickedCrossLine));return[{...n,defaultItems:t,coordinates:void 0,allShowOnParams:s},[this.pickedAxisCtx.caller,this.ctx.chartService]]}makeGetItemsParamsCrossLine(e){const{defaultItems:t,active:i,coordinates:n}=e;if(null==this.pickedCrossLine)throw new Error("this.pickedCrossLine is null");const s=this.crossLineRegions(this.pickedCrossLine);if(0===s.length)throw new Error("this.pickedCrossLine is empty");const a=[...s];i.has("series-area")&&a.push({showOn:"series-area"}),i.has("axis")&&null!=this.pickedAxisCtx&&a.push(this.axisRegion(this.pickedAxisCtx));return[{showOn:"cross-line",axisId:s[0].axisId,crossLineId:s[0].crossLineId,crossLineType:s[0].crossLineType,direction:s[0].direction,value:s[0].value,range:s[0].range,defaultItems:t,coordinates:n,allShowOnParams:a},[this.ctx.chartService]]}makeGetItemsParamsCaption(e){const{defaultItems:t}=e,i=this.pickedCaptionCtx;if(null==i)throw new Error("this.pickedCaptionCtx is null");const n={showOn:"caption",captionType:i.captionType,text:i.text};return[{...n,defaultItems:t,coordinates:void 0,allShowOnParams:[n]},[this.ctx.chartService]]}makeGetItemsParamsLegendItem(e){const{defaultItems:t}=e;if(null==this.pickedLegendItem)throw new Error("this.pickedLegendItem is null");const{itemId:i,seriesId:s,label:a,enabled:o}=this.pickedLegendItem,r={showOn:"legend-item",itemId:i,seriesId:s,text:(0,n.boc)(a.text),visible:o};return[{...r,defaultItems:t,coordinates:void 0,allShowOnParams:[r]},[this.ctx.chartService]]}expandItemsOptions(e){const t=[],i=this.opts,s=new Set(e.regions);let a;
1if(i.getItems){const[t,o]=this.makeGetItemsParams(e,s);a=(0,n.cVk)(o,i.getItems,t)}return a??(a=i.items??["defaults"]),so(s,this.ctx.contextMenuRegistry,a,t),t}onContext(e){if(!(this.opts.enabled??1))return;e.widgetEvent.sourceEvent.preventDefault(),this.x=e.canvasX,this.y=e.canvasY;const{contexts:t}=e;this.pickedNodes=t["series-node"],this.pickedAxisCtx=t.axis,this.pickedCaptionCtx=t.caption,this.pickedLegendItem=t["legend-item"]?.legendItem,this.pickedCrossLine=t["cross-line"];const i=this.expandItemsOptions(e);0!==i.length&&this.show(e,i)}show(e,t){const{sourceEvent:i}=e.widgetEvent;this.interactionManager.pushState(s.n1.InteractionState.ContextMenu),this.element.style.display="block";const n="touch"!==i.pointerType&&void 0;void 0!==n&&this.ctx.chartService.overrideFocusVisible(n),this.createMenu(e,t),this.element.appendChild(this.menuWidget.getElement()),this.menuWidget.expand({sourceEvent:i,overrideFocusVisible:n})}hide(){this.menuWidget.collapse()}onCollapse(){this.interactionManager.popState(s.n1.InteractionState.ContextMenu),this.menuWidget.getElement().remove(),this.element.style.display="none"}onSubMenuExpand(e,t){const i=e.getBounds();e.setFocusOverride(!0),e.getElement().insertAdjacentElement("afterend",t.getElement()),t.getElement().style.position="absolute";const{isRtl:n}=this.ctx.domManager,s=this.ctx.domManager.getBoundingClientRect(),a=e.getBoundingClientRect(),o=s.right-a.right,r=a.left-s.left,{offsetWidth:l,offsetHeight:h}=t.getElement();let c=i.y;if(s.height>h){const e=s.bottom-a.top;e<h&&(c-=h-e)}const d=n?"left":"right";if(("right"===d?o:r)>=l){const e="right"===d?i.x+i.width:i.x-l;t.setBounds({x:e,y:c})}else{const e="right"===d?i.x-l:i.x+i.width,n=("right"===d?r:o)-l;n>=0?t.setBounds({x:e,y:c}):t.setBounds({x:e+("right"===d?-n:n),y:c})}}onSubMenuCollapse(e,t){e.setFocusOverride(void 0),this.collapsingSubMenus++,t.remove(),this.collapsingSubMenus--}createMenu(e,t){const{menuWidget:i}=this;i.clear(),i.setTabIndex(-1),this.createMenuItems(e,i,t)}createMenuItems(e,t,i){for(const n of i)switch(n.type){case"separator":t.addSeparator().classList.add(`${oo}__divider`);break;case"action":if(0===n.items.length){const i=new s.uB.MenuItemWidget;this.initButtonElement(e,i,n),t.addChild(i)}else{const{subMenuButton:i,subMenu:s}=t.addSubMenu();s.addClass(`${oo}__menu`),s.addListener("expand-widget",(()=>this.onSubMenuExpand(i,s))),s.addListener("collapse-widget",(()=>this.onSubMenuCollapse(i,s))),this.initButtonElement(e,i,n),this.createMenuItems(e,s,n.items)}break;default:throw new Error("unhandled case")}}createButtonOnClick(e,t,i){const s=e.widgetEvent.sourceEvent;return lo.checkCallback("legend-item",t,i)?e=>{if(this.pickedLegendItem){const{seriesId:t,itemId:s,label:a}=this.pickedLegendItem,{chartService:o}=this.ctx,r=o.series.find((e=>e.id===t)),l=[r?.properties,o],h={type:"contextmenu",seriesId:t,itemId:s,text:(0,n.boc)(a.text),event:e.sourceEvent};(0,n.cVk)(l,i,h),this.hide()}else this.ctx.logger.error("legend item not found")}:lo.checkCallback("series-area",t,i)?()=>{const t=this.ctx.chartService.toAgCoordinates(e),a=this.ctx.chartService,o={type:"seriesContextMenuAction",event:s,coordinates:t};(0,n.cVk)(a,i,o),this.hide()}:lo.checkCallback("series-node",t,i)?()=>{const{chartService:t}=this.ctx,a=this.pickedNodes;if(!a?.[0])return;const o=this.ctx.chartService.toAgCoordinates(e),r=[a[0].series.properties,t],l=a[0]?.series.createNodeContextMenuActionEvent({event:s,datums:a,winner:0,coordinates:o});l?(0,n.cVk)(r,i,l):this.ctx.logger.error("series node not found"),this.hide()}:lo.checkCallback("axis",t,i)?()=>{if(this.pickedAxisCtx){const{axisId:e,direction:t,boundSeries:a,domain:o,value:r,index:l,depth:h,groupPercentage:c}=this.pickedAxisCtx,d=[this.pickedAxisCtx.caller,this.ctx.chartService],u={type:"axisContextMenuAction",event:s,axisId:e,direction:t,boundSeries:a,domain:o,value:r,index:l,depth:h,groupPercentage:c};(0,n.cVk)(d,i,u)}else this.ctx.logger.error("axis item not found");this.hide()}:lo.checkCallback("cross-line",t,i)?()=>{if(this.pickedCrossLine&&this.pickedCrossLine.length>0){const{crossLineId:t,axisId:a,direction:o,crossLineType:r,value:l,range:h}=this.pickedCrossLine[0],c=this.ctx.chartService.toAgCoordinates(e),d=this.ctx.chartService,u={type:"crossLineContextMenuAction",event:s,coordinates:c,crossLineId:t,axisId:a,direction:o,crossLineType:r,value:l,range:h};(0,n.cVk)(d,i,u)}else this.ctx.logger.error("cross line item not found");this.hide()}:lo.checkCallback("caption",t,i)?()=>{if(this.pickedCaptionCtx){const{captionType:e,text:t}=this.pickedCaptionCtx,a=this.ctx.chartService,o={type:"captionContextMenuAction",captionType:e,text:t,event:s};(0,n.cVk)(a,i,o)}else this.ctx.logger.error("caption item not found");this.hide()}:()=>{const t=this.ctx.chartService,a=this.ctx.chartService.toAgCoordinates(e),o={type:"contextMenuEvent",event:s,coordinates:a};(0,n.cVk)(t,i,o),this.hide()}}initTableCells(e){const t=(0,n.na4)("div"),i=(0,n.na4)("div"),s=(0,n.na4)("div");return t.classList.toggle(`${oo}__icon`,!0),i.classList.toggle(`${oo}__cell`,!0),s.classList.toggle(`${oo}__cell`,!0),t.ariaHidden="true",i.role="presentation",s.ariaHidden="true",e.append(t,i,s),{cellIcon:t,cellLabel:i,cellArrow:s}}initButtonElement(e,t,i){t.addClass(`${oo}__item`),t.setEnabled(i.enabled);const s=this.ctx.localeManager.t(i.label),a=`${oo}__cellpadding`,{cellIcon:o,cellLabel:r,cellArrow:l}=this.initTableCells(t.getElement());if(r.textContent=s,r.classList.add(a),null!=i.iconUrl){const e=(0,n.na4)("img");e.src=i.iconUrl,o.append(e),o.classList.add(a)}if(i.items.length>0){const e=(0,n.na4)("span",(0,n.YE8)("chevron-right"));l.append(e),l.classList.add(a)}const{showOn:h,action:c}=i;null!=c&&t.addListener("click",this.createButtonOnClick(e,h,c)),0===i.items.length&&(t.addListener("mouseleave",(()=>t.setFocusOverride(!1))),t.addListener("mouseenter",(()=>t.setFocusOverride(void 0))))}reposition(){const{isRtl:e}=this.ctx.domManager;let{x:t,y:i}=this;this.element.style.top="unset",this.element.style.bottom="unset";const s=this.ctx.domManager.getBoundingClientRect(),{offsetWidth:a,offsetHeight:o}=this.element;t=(0,n.qE8)(0,e?t-a:t,s.width-a),i=(0,n.qE8)(0,i,s.height-o),this.element.style.left=`${t}px`,this.element.style.top=`calc(${i}px - 0.5em)`}destroy(){super.destroy(),this.mutationObserver?.disconnect(),this.ctx.domManager.removeStyles(ho),this.ctx.domManager.removeChild("canvas-overlay",ho)}},po=(()=>{var e={type:"plugin",name:"contextMenu",enterprise:!0,version:s.xv,depen
1dencies:[K],options:{enabled:n.zMY,items:n.qRQ,getItems:(0,n.R3$)(n.qRQ,"a menu items array")},themeTemplate:{enabled:!0,darkTheme:n.oxB},create:e=>new uo(e),register:e=>{e.has("contextMenuRegistry")||e.service("contextMenuRegistry",(e=>new s.n1.ContextMenuRegistry(e)))}};return e.options.darkTheme=(0,n._Le)(n.zMY),e})();function go(e){return"object"==typeof e?.datum?e.datum:null}var mo=(()=>{var e=class{constructor(e,t,i){this.domManager=e,this.id=(0,n.sX_)(this),this.xOffset=0,this.yOffset=0,this.elementProxy=e.addDeferredProxyChild("canvas-overlay",`crosshair-label-${this.id}`),this.elementProxy.toggleClass("ag-charts-crosshair-label",!0),this.elementProxy.setAttr("aria-hidden","true"),this.elementProxy.setAttr("data-key",t),this.elementProxy.setAttr("data-axis-id",i)}show(e){const t=Math.round(e.x+this.xOffset),i=Math.round(e.y+this.yOffset);this.elementProxy.setProperty("left",`${t}px`),this.elementProxy.setProperty("top",`${i}px`);const n=e.translateX||e.translateY?`${e.translateX??"0"} ${e.translateY??"0"}`:"";this.elementProxy.setProperty("translate",n),this.toggle(!0)}setLabelHtml({html:e,styles:t}){void 0!==e&&this.elementProxy.setInnerHTML(e),void 0!==t&&this.elementProxy.setContentStyles(t)}toggle(e){this.elementProxy.toggleClass("ag-charts-crosshair-label--hidden",!e)}destroy(){this.domManager.removeChild("canvas-overlay",`crosshair-label-${this.id}`)}toLabelHtml(e,t){if("string"==typeof e)return{html:e,styles:{}};t=t??{};const{text:i=t.text??"",color:n=t.color,backgroundColor:s=t.backgroundColor,opacity:a=t.opacity??1}=e;return{html:`<div class="ag-charts-crosshair-label-content">\n <span>${i}</span>\n </div>`,styles:{opacity:a,"background-color":s?.toLowerCase(),color:n}}}};return e.className="CrosshairLabel",e})(),{Group:yo,TranslatableGroup:fo,Line:xo,BBox:bo,FormatManager:vo,InteractionState:So}=s.n1,Mo=(()=>{var e=class extends n.UbG{constructor(e){super(),this.ctx=e,this.id=(0,n.sX_)(this),this.seriesRect=new bo(0,0,0,0),this.bounds=new bo(0,0,0,0),this.crosshairGroup=new fo({name:"crosshairs",zIndex:n.Dcv.SERIES_CROSSHAIR}),this.lineGroup=this.crosshairGroup.appendChild(new yo({name:`${this.id}-crosshair-lines`,zIndex:n.Dcv.SERIES_CROSSHAIR})),this.lineGroupSelection=s.n1.Selection.select(this.lineGroup,xo,!1),this.activeHighlight=void 0,this.activeHighlightInViewport=!1,this.annotationLabelDragging=!1,this.axisCtx=e.parent,this.labels={},this.hideCrosshairs(),e.domManager.addEventListener("focusin",(({target:t})=>{if(this.checkInteractionState())return;const i=t instanceof HTMLElement&&e.domManager.contains(t,"series-area");this.crosshairGroup.visible&&!i&&(this.hideCrosshairs(),this.ctx.eventsHub.emit("chart:request-update",{type:n.GvF.SCENE_RENDER}))}));const{seriesDragInterpreter:t}=e.widgets;this.cleanup.register(e.scene.attachNode(this.crosshairGroup),e.widgets.seriesWidget.addListener("mousemove",(e=>this.onMouseHoverLike(e))),e.widgets.seriesWidget.addListener("mouseleave",(()=>this.onMouseOut())),e.eventsHub.on("series:focus-change",(()=>this.onKeyPress())),e.eventsHub.on("zoom:pan-start",(()=>this.onMouseOut())),e.eventsHub.on("zoom:change-complete",(()=>this.onMouseOut())),e.eventsHub.on("highlight:change",(e=>this.onHighlightChange(e))),e.eventsHub.on("layout:complete",(e=>this.layout(e))),e.eventsHub.on("annotations:axis-label-drag-start",(e=>this.onAnnotationAxisLabelDragStart(e))),(()=>{for(const e of Object.values(this.labels))e.destroy()})),t&&this.cleanup.register(t.events.on("drag-move",(e=>this.onMouseHoverLike(e))),t.events.on("drag-end",(()=>this.onDragEnd())),t.events.on("click",(e=>this.onClick(e))))}get labelEnabled(){return(this.options?.enabled&&this.options.label.enabled)??!1}applyOptions(e){this.options=e}formatValue(e,t,i,n){const s=this.options?.label;if(!s)return;const{formatter:a,format:o}=s,{domain:r,boundSeries:l}=n;let h;if(null!=a){h=e(a,{value:i,domain:r,fractionDigits:"number"===n.type?n.fractionDigits:void 0,unit:"date"===n.type?n.unit:void 0,step:"date"===n.type?n.step:void 0,boundSeries:l})}if(null!=o){let e=this.cachedFormatter;e?.type===t&&e?.format===o||(e={type:t,format:o,formatter:vo.getFormatter(t,o)},this.cachedFormatter=e),h??(h=e.formatter?.(i))}return null==h?void 0:String(h)}checkInteractionState(){return this.ctx.interactionManager.isState(So.Frozen)}layout({series:{rect:e,visible:t},axes:i}){const n=this.options;if(!t||!i||!n?.enabled)return;this.seriesRect=e;const{position:s="left",axisId:a}=this.axisCtx,o=i[a];if(!o)return;this.axisLayout=o,this.bounds=e.clone().grow(o.gridPadding+o.seriesAreaPadding,s);const{crosshairGroup:r,bounds:l}=this;r.translationX=Math.round(l.x),r.translationY=Math.round(l.y);const h=["pointer",...this.axisCtx.seriesKeyProperties()];this.updateSelections(h),!n.snap&&this.activeHighlight||(this.updateLines(),this.updateLabels(h),n.snap&&!this.activeHighlightInViewport||this.refreshPositions())}updateSelections(e){this.lineGroupSelection.update(e,void 0,(e=>e))}updateLabels(e){const{labels:t,ctx:i}=this,n=this.options?.label;for(const s of e)n?.enabled&&(t[s]??(t[s]=new mo(i.domManager,s,this.axisCtx.axisId))),t[s]&&this.updateLabel(t[s])}updateLabel(e){const t=this.options?.label;t&&(e.xOffset=t.xOffset,e.yOffset=t.yOffset)}updateLines(){const e=this.options,{lineGroupSelection:t,bounds:i,axisLayout:n}=this;if(!n||!e)return;const{stroke:s,strokeWidth:a,strokeOpacity:o,lineDash:r,lineDashOffset:l}=e,h=this.isVertical();t.each((e=>{e.stroke=s,e.strokeWidth=a,e.strokeOpacity=o,e.lineDash=r,e.lineDashOffset=l,e.y1=0,e.y2=h?i.height:0,e.x1=0,e.x2=h?0:i.width}))}isVertical(){return this.axisCtx.direction===n.tv$.X}isHover(e){return"mousemove"===e.type||"click"===e.type||"touch"===e.device&&"hover"===this.ctx.chartState.getValue("options","touch").dragAction}formatScaleText(e){return(0,n.boc)(this.axisCtx.formatScaleValue(e,"crosshair",this))}onClick(e){"touch"===e.device&&this.onMouseHoverLike(e)}onMouseHoverLike(e){const t=this.options;if(!t?.enabled||t.snap)return;const i=this.isHover(e)?So.Hoverable|So.Frozen:So.AnnotationsMoveable;this.ctx.interactionManager.isState(i)&&(this.updatePositions(this.getData(e)),this.crosshairGroup.visible=!0,this.ctx.eventsHub.emit("chart:request-update",{type:n.GvF.SCENE_RENDER}))}onMouseOut(){const e=this.options?.snap??!0?So.Hoverable:So.Hoverable|So.Frozen;this.ctx.interactionManager.isState(e)&&(this.hideCrosshairs(),this.ctx.eventsHub.emit("chart:request-update",{type:n.GvF.SCENE_RENDER}))}onAnnotationAxisLabelDragStart({axisId:e}){if(e===this.axisCtx.axisId){this.annotationLabelDragging=!0;for(const e of Object.keys(this.labels))this.hideLabel(e)}}onDragEnd(){this.annotationLabelDragging&&(this.annotationLabelDragging=!1,this.options?.snap&&this.crosshairGroup.visible&&this.refreshPositions())}onKeyPress(){const e=this.options;e?.enabled&&!e.snap&&this.ctx.interactionManager.isState(So.Default)&&this.hideCrosshairs()}onHighlightChange(e){const t=this.options;if(!t?.enabled)return;const{crosshairGroup:i,axisCtx:s}=this,{datum:a,datums:o,series:r}=e.currentHighlight??{},l=!(null==a&&null==o||r?.axes.x?.id!==s.axisId&&r?.axes.y?.id!==s.axisId);if(this.activeHighlight=l?e.currentHighlight:void 0,this.activeHighlightInViewport=e.highlightInViewport,this.activeHighlight){if(t.snap)if(e.highlightInViewport){const e=this.getActiveHighlightData(this.activeHighlight);this.updatePositions(e),i.visible=!0}else this.hideCrosshairs()}else this.hideCrosshairs();this.ctx.eventsHub.emit("chart:request-update",{type:n.GvF.SCENE_RENDER})}isInRange(e){return this.axisCtx.inRange(e)}refreshPositions(){this.activeHighlight&&this.updatePositions(this.getActiveHighlightData(this.activeHighlight))}updatePositions(e){const{seriesRect:t,lineGroupSelection:i}=this,n=(this.options?.label.enabled??!1)&&!this.annotationLabelDragging;i.each(((i,s)=>{const a=e[s];if(!a)return i.visible=!1,void this.hideLabel(s);i.visible=!0;const{value:o,position:r}=a;let l=0,h=0;this.isVertical()?(l=r,i.x=l):(h=r,i.y=h),n?this.showLabel(l+t.x,h+t.y,o,s):this.hideLabel(s)}))}getData(e){const{axisCtx:t}=this,i="pointer",{xKey:n="",yKey:s=""}=this.activeHighlight??{},{currentX:a,currentY:o}=e,r=go(this.activeHighlight),l=this.isVertical(),h=l?a:o;let c=r?.[l?n:s]??"";return t.continuous&&(c=t.scaleInvert(h)),{[i]:{position:h,value:c}}}getActiveHighlightData(e){const{axisCtx:t}=this,{series:i,xKey:n="",aggregatedValue:s,cumulativeValue:a,cumulativeValueExact:o,midPoint:r}=e,l=go(e),h=i.getKeyProperties(t.direction),c=(t.scale.bandwidth??0)/2,d=i.axes[t.direction]?.id===t.axisId,u=h.includes("yKey")&&d,p=h.includes("xKey")&&d,g=o??a??s;if(u&&void 0!==g){const e=t.scale.convert(g)+c;return this.isInRange(e)?{yKey:{value:g,position:e}}:{}}if(p){const e=(this.isVertical()?r?.x:r?.y)??0,i=t.continuous?t.scaleInvert(e):l?.[n];return this.isInRange(e)?{xKey:{value:i,position:e}}:{}}const m={};for(const e of h){const n=e,s=i.properties[n];if(void 0===s)continue;const a=l?.[s],o=t.scale.convert(a)+c;
1this.isInRange(o)&&(m[n]={value:a,position:o})}return m}getLabelHtml(e,t){const i=this.axisLayout?.label?.fractionDigits??0,s={text:(0,n.xpk)(this.formatScaleText(e),this.ctx.domManager.isRtl)},a=this.options?.label.renderer?.({value:e,fractionDigits:i});return null==a?t.toLabelHtml(s):t.toLabelHtml((0,n.GIY)(a),s)}showLabel(e,t,i,s){if(!this.axisLayout)return;const{bounds:a}=this,o=this.labels[s],r=this.getLabelHtml(i,o);o.setLabelHtml(r);const l=this.axisCtx.position;let h=this.axisLayout.label.spacing+this.axisLayout.tickSize;const c=this.axisLayout.crosshairOffset??{x:0,y:0};if(this.axisCtx.direction===n.tv$.X){h=Math.max(h-4,0);const t="bottom"===l,i=(t?a.y+a.height:a.y)+c.y;o.show({x:e,y:t?i+h:i-h,translateX:"-50%",translateY:t?"0":"-100%"})}else{h=Math.max(h-8,0);const e="right"===l,i=(e?a.x+a.width:a.x)+c.x;o.show({x:e?i+h:i-h,y:t,translateX:e?"0":"-100%",translateY:"-50%"})}}hideCrosshairs(){this.crosshairGroup.visible=!1;for(const e of Object.keys(this.labels))this.hideLabel(e)}hideLabel(e){this.labels[e]?.toggle(!1)}};return e.className="Crosshair",e})(),ko={type:"axis:plugin",name:"crosshair",chartType:"cartesian",enterprise:!0,version:s.xv,themeTemplate:{enabled:{$if:[{$or:[{$eq:[{$path:"../type"},"number"]},{$eq:[{$path:"../type"},"log"]},{$eq:[{$path:"../type"},"time"]},{$eq:[{$path:"../type"},"unit-time"]},{$eq:[{$path:"../type"},"ordinal-time"]}]},!0,!1]},snap:!0,stroke:{$ref:"subtleTextColor"},strokeWidth:1,strokeOpacity:1,lineDash:[5,6],lineDashOffset:0,label:{enabled:!0,xOffset:0,yOffset:0}},create:e=>new Mo(e)},Do=class extends n.UbG{constructor(e){super();const{dataService:t}=e;let i=!1;this.cleanup.register(e.eventsHub.on("data:load",(()=>{i=!0})),e.eventsHub.on("layout:complete",(()=>{i&&e.zoomManager?.updateZoom({source:"data-update",sourceDetail:"dataSource"})})),e.chartState.observe((e=>{const i=e("options","dataSource.enabled")??!0,n=e("options","dataSource.getData");i&&null!=n?t.updateCallback(n):t.clearCallback()})),e.chartState.observe((e=>{const i=e("options","dataSource.requestThrottle");null!=i&&(t.requestThrottle=i)})),e.chartState.observe((e=>{const i=e("options","dataSource.updateThrottle");null!=i&&(t.dispatchThrottle=i)})),e.chartState.observe((e=>{const i=e("options","dataSource.updateDuringInteraction");null!=i&&(t.dispatchOnlyLatest=!i)})))}},wo=(()=>({type:"plugin",name:"dataSource",enterprise:!0,version:s.xv,options:{getData:n.E2r,requestThrottle:(0,n._Le)(n.LyW),updateThrottle:(0,n._Le)(n.LyW),updateDuringInteraction:(0,n._Le)(n.zMY)},create:e=>new Do(e)}))(),{BBox:Io}=s.n1,Ao=class{constructor(e){this.components=e,this.union=Io.merge(e)}containsPoint(e,t){if(!this.union.containsPoint(e,t))return!1;for(const i of this.components)if(i.containsPoint(e,t))return!0;return!1}},Co=class extends s.n1.Group{constructor(){super(),this.capLength=Number.NaN,this._datum=void 0,this.whiskerPath=new s.n1.Path,this.capsPath=new s.n1.Path,this.bboxes=new Ao([]),this.append([this.whiskerPath,this.capsPath])}get datum(){return this._datum}set datum(e){this._datum=e}calculateCapLength(e,t){const{lengthRatio:i=1,length:n}=e,{lengthRatioMultiplier:s,lengthMax:a}=t,o=n??i*s;return Math.min(o,a)}getItemStylerParams(e,t,i,n,s){const{datum:a}=this;if(null==a||null==e.itemStyler)return;const{xLowerKey:o,xUpperKey:r,yLowerKey:l,yUpperKey:h}=e;return{...t,datum:a.datum,seriesId:a.series.id,xKey:a.xKey,yKey:a.yKey,xLowerKey:o,xUpperKey:r,yLowerKey:l,yUpperKey:h,highlightState:i,selectionState:n,candidateState:s}}formatStyles(e,t,i,s,a,o){let{cap:r,...l}=e;const h=this.getItemStylerParams(t,e,s,a,o);if(null!=h&&null!=t.itemStyler){const e=i.callWithContext(t.itemStyler,h);l=(0,n.HFk)(e,l),r=(0,n.HFk)(e?.cap,e,r)}return{whiskerStyle:l,capsStyle:r}}applyStyling(e,t){(0,n.tbn)(["visible","stroke","strokeWidth","strokeOpacity","lineDash","lineDashOffset"],e,t)}update(e,t,i,n,s,a){if(void 0===this.datum)return;const{whiskerStyle:o,capsStyle:r}=this.formatStyles(e,t,i,n,s,a),{xBar:l,yBar:h,capDefaults:c}=this.datum,d=this.whiskerPath;this.applyStyling(d,o),d.path.clear(!0),void 0!==h&&(d.path.moveTo(h.lowerPoint.x,h.lowerPoint.y),d.path.lineTo(h.upperPoint.x,h.upperPoint.y)),void 0!==l&&(d.path.moveTo(l.lowerPoint.x,l.lowerPoint.y),d.path.lineTo(l.upperPoint.x,l.upperPoint.y)),d.path.closePath(),this.capLength=this.calculateCapLength(r??{},c);const u=this.capLength/2,p=this.capsPath;this.applyStyling(p,r),p.path.clear(!0),void 0!==h&&(p.path.moveTo(h.lowerPoint.x-u,h.lowerPoint.y),p.path.lineTo(h.lowerPoint.x+u,h.lowerPoint.y),p.path.moveTo(h.upperPoint.x-u,h.upperPoint.y),p.path.lineTo(h.upperPoint.x+u,h.upperPoint.y)),void 0!==l&&(p.path.moveTo(l.lowerPoint.x,l.lowerPoint.y-u),p.path.lineTo(l.lowerPoint.x,l.lowerPoint.y+u),p.path.moveTo(l.upperPoint.x,l.upperPoint.y-u),p.path.lineTo(l.upperPoint.x,l.upperPoint.y+u)),p.path.closePath()}updateBBoxes(){const{capLength:e,whiskerPath:t,capsPath:i}=this,{yBar:n,xBar:s}=this.datum??{},a=e/2,o=[];if(void 0!==n){const s=n.lowerPoint.y-n.upperPoint.y;o.push(new Io(n.lowerPoint.x,n.upperPoint.y,t.strokeWidth,s),new Io(n.lowerPoint.x-a,n.lowerPoint.y,e,i.strokeWidth),new Io(n.up
1perPoint.x-a,n.upperPoint.y,e,i.strokeWidth))}if(void 0!==s){const n=s.upperPoint.x-s.lowerPoint.x;o.push(new Io(s.lowerPoint.x,s.upperPoint.y,n,t.strokeWidth),new Io(s.lowerPoint.x,s.lowerPoint.y-a,i.strokeWidth,e),new Io(s.upperPoint.x,s.upperPoint.y-a,i.strokeWidth,e))}this.bboxes.components=o,this.bboxes.union=Io.merge(o)}containsPoint(e,t){return this.bboxes.containsPoint(e,t)}pickNode(e,t){return this.containsPoint(e,t)?this:void 0}nearestSquared(e,t,i){const{bboxes:s}=this;if(s.union.distanceSquared(e,t)>i)return{nearest:void 0,distanceSquared:1/0};const{distanceSquared:a}=(0,n.KpM)(e,t,s.components);return{nearest:this,distanceSquared:a}}},No=class extends s.n1.Group{nearestSquared(e,t){const{nearest:i,distanceSquared:s}=(0,n.mA_)(e,t,{children:this.children()});if(void 0!==i&&!Number.isNaN(s))return{unsafeDatum:i.unsafeDatum,distanceSquared:s}}},Lo=(()=>{var e=class extends n.XPE{};return l([n.mAP],e.prototype,"visible",2),l([n.mAP],e.prototype,"stroke",2),l([n.mAP],e.prototype,"strokeWidth",2),l([n.mAP],e.prototype,"strokeOpacity",2),l([n.mAP],e.prototype,"lineDash",2),l([n.mAP],e.prototype,"lineDashOffset",2),l([n.mAP],e.prototype,"length",2),l([n.mAP],e.prototype,"lengthRatio",2),e})(),Po=(()=>{var e=class extends n.XPE{constructor(){super(...arguments),this.visible=!0,this.stroke="black",this.strokeWidth=1,this.strokeOpacity=1,this.cap=new Lo}};return l([n.mAP],e.prototype,"yLowerKey",2),l([n.mAP],e.prototype,"yLowerName",2),l([n.mAP],e.prototype,"yUpperKey",2),l([n.mAP],e.prototype,"yUpperName",2),l([n.mAP],e.prototype,"xLowerKey",2),l([n.mAP],e.prototype,"xLowerName",2),l([n.mAP],e.prototype,"xUpperKey",2),l([n.mAP],e.prototype,"xUpperName",2),l([n.mAP],e.prototype,"visible",2),l([n.mAP],e.prototype,"stroke",2),l([n.mAP],e.prototype,"strokeWidth",2),l([n.mAP],e.prototype,"strokeOpacity",2),l([n.mAP],e.prototype,"lineDash",2),l([n.mAP],e.prototype,"lineDashOffset",2),l([n.mAP],e.prototype,"itemStyler",2),l([n.mAP],e.prototype,"cap",2),e})(),{fixNumericExtent:To,groupAccumulativeValueProperty:Oo,valueProperty:Ro}=s.n1,Eo=class e extends n.UbG{constructor(e){super(),this.ctx=e,this.properties=new Po;const t=e.series,{annotationGroup:i,annotationSelections:n}=t;this.cartesianSeries=t,this.groupNode=new No({name:`${i.id}-errorBars`}),i.appendChild(this.groupNode),this.sceneSelection=s.n1.Selection.select(this.groupNode,(()=>this.errorBarFactory())),n.add(this.sceneSelection),this.cleanup.register(t.events.on("visibility-change",(e=>this.onToggleSeriesItem(e))),t.events.on("data-processed",(e=>this.onDataProcessed(e))),t.events.on("data-update",(e=>this.onDataUpdate(e))),t.events.on("data-selection-change",(e=>this.onDataSelectionChange(e))),e.eventsHub.on("highlight:change",(e=>this.onHighlightChange(e))),(()=>this.groupNode.remove()),(()=>n.delete(this.sceneSelection)))}hasErrorBars(){const{xLowerKey:e,xUpperKey:t,yLowerKey:i,yUpperKey:s}=this.properties;return(0,n.O9V)(e)&&(0,n.O9V)(t)||(0,n.O9V)(i)&&(0,n.O9V)(s)}isStacked(){const e=this.cartesianSeries.seriesGrouping?.stackCount;return null!=e&&e>0}getUnstackPropertyDefinition(e){const t=[],{xLowerKey:i,xUpperKey:n,yLowerKey:s,yUpperKey:a,xErrorsID:o,yErrorsID:r}=this.getMaybeFlippedKeys(),{xScaleType:l,yScaleType:h}=e;return null!=s&&null!=a&&t.push(Ro(s,h,{id:`${r}-lower`}),Ro(a,h,{id:`${r}-upper`})),null!=i&&null!=n&&t.push(Ro(i,l,{id:`${o}-lower`}),Ro(n,l,{id:`${o}-upper`})),t}getStackPropertyDefinition(e){const t=[],{cartesianSeries:i}=this,{xLowerKey:n,xUpperKey:s,yLowerKey:a,yUpperKey:o,xErrorsID:r,yErrorsID:l}=this.getMaybeFlippedKeys(),{xScaleType:h,yScaleType:c}=e,d=i.seriesGrouping?.groupIndex??i.id,u={invalidValue:null,missingValue:0,separateNegative:!0,...i.visible?{}:{forceValue:0}},p=(e,t,i,n)=>Oo(e,"normal",{id:`${t}-${i}`,groupId:`errorGroup-${d}-${i}`,...u},n),g=(e,i,n,s)=>{t.push(...p(e,n,"lower",s),...p(i,n,"upper",s))};return null!=a&&null!=o&&g(a,o,l,c),null!=n&&null!=s&&g(n,s,r,h),t}getPropertyDefinitions(e){return this.isStacked()?this.getStackPropertyDefinition(e):this.getUnstackPropertyDefinition(e)}onDataProcessed(e){this.dataModel=e.dataModel,this.processedData=e.processedData}getDomain(e){const{xLowerKey:t,xUpperKey:i,xErrorsID:s,yLowerKey:a,yUpperKey:o,yErrorsID:r}=this.getMaybeFlippedKeys();if(e===n.tv$.X?(0,n.O9V)(t)&&(0,n.O9V)(i):(0,n.O9V)(a)&&(0,n.O9V)(o)){const{dataModel:t,processedData:i,cartesianSeries:a}=this;if(null!=t&&null!=i){const o={x:s,y:r}[e],l=t.getDomain(a,`${o}-lower`,"value",i).domain,h=t.getDomain(a,`${o}-upper`,"value",i).domain,c=(0,n.uYy)([...l,...h]);return To(c)}}return[]}onDataUpdate(e){this.dataModel=e.dataModel,this.processedData=e.processedData,(0,n.O9V)(e.dataModel)&&(0,n.O9V)(e.processedData)&&(this.createNodeData(),this.update())}onDataSelectionChange(e){this.update()}getNodeData(){return this.hasErrorBars()?this.cartesianSeries.contextNodeData?.nodeData:void 0}createNodeData(){const e=this.getNodeData(),t=this.cartesianSeries.axes[n.tv$.X]?.scale,i=this.cartesianSeries.axes[n.tv$.Y]?.scale;if(t&&i&&e)for(let s=0;s<e.length;s++){const{midPoint:a,xLower:o,xUpper:r,yLower:l,yUpper:h}=this.getDatum(e,s);if(null!=a){let c,d;(0,n.O9V)(o)&&(0,n.O9V)(r)&&(c={lowerPoint:{x:this.convert(t,o),y:a.y},upperPoint:{x:this.convert(t,r),y:a.y}}
1),(0,n.O9V)(l)&&(0,n.O9V)(h)&&(d={lowerPoint:{x:a.x,y:this.convert(i,l)},upperPoint:{x:a.x,y:this.convert(i,h)}}),e[s].xBar=c,e[s].yBar=d}}}getMaybeFlippedKeys(){let{xLowerKey:e,xUpperKey:t,yLowerKey:i,yUpperKey:n}=this.properties,[s,a]=["xValue-errors","yValue-errors"];return this.cartesianSeries.shouldFlipXY()&&([e,i]=[i,e],[t,n]=[n,t],[s,a]=[a,s]),{xLowerKey:e,xUpperKey:t,xErrorsID:s,yLowerKey:i,yUpperKey:n,yErrorsID:a}}static getDatumKey(e,t,i,n){if(null==t)return;const s=go(e),a=s?.[t];if(null!=a){if("number"==typeof a||"bigint"==typeof a)return Number(a)+i;n.warnOnce(`Found [${t}] error value of type ${typeof a}. Expected number type`)}}getDatum(t,i){const{xLowerKey:n,xUpperKey:s,yLowerKey:a,yUpperKey:o}=this.getMaybeFlippedKeys(),r=t[i],l=null!=r.cumulativeValue&&this.isStacked()?r.cumulativeValue-r.yValue:0,[h,c]=this.cartesianSeries.shouldFlipXY()?[l,0]:[0,l];return{midPoint:r.midPoint,xLower:e.getDatumKey(r,n,h,this.ctx.logger),xUpper:e.getDatumKey(r,s,h,this.ctx.logger),yLower:e.getDatumKey(r,a,c,this.ctx.logger),yUpper:e.getDatumKey(r,o,c,this.ctx.logger)}}convert(e,t){const i=(e.bandwidth??0)/2;return e.convert(t)+i}update(){this.groupNode.visible=this.cartesianSeries.visible,this.groupNode.opacity=this.cartesianSeries.getOpacity();const e=this.getNodeData();this.sceneSelection.update(e??[]),null!=e&&this.sceneSelection.each(((e,t,i)=>this.updateNode(e,t,i)))}updateNode(e,t,i){const n=this.ctx.highlightManager.getActiveHighlight(),s=n?.series.id===t.series.id&&n.datumIndex===t.datumIndex,a=this.cartesianSeries.getHighlightStateString(n,s,t.datumIndex),o=this.cartesianSeries.getSelectionStateString(t.datumIndex),r=this.cartesianSeries.getCandidateStateString(t.datumIndex);e.datum=t,e.update(this.getDefaultStyle(),this.properties,this.cartesianSeries,a,o,r),e.updateBBoxes()}pickNodeExact(e){const{x:t,y:i}=e,n=this.groupNode.pickNode(t,i);if(null!=n)return{unsafeDatum:n.unsafeDatum,distanceSquared:0}}pickNodeNearest(e){return this.groupNode.nearestSquared(e.x,e.y)}pickNodeMainAxisFirst(e,t){let i,s=[1/0,1/0];const a=[e.x,e.y];t===n.tv$.Y&&a.reverse();for(const e of this.groupNode.children()){const o=e.getBBox(),r=[o.x+o.width/2,o.y+o.height/2];t===n.tv$.Y&&r.reverse();const l=[];for(let e=0;e<a.length;e++)l.push(Math.abs(a[e]-r[e]));(l[0]<s[0]||l[0]==s[0]&&l[1]<s[1])&&(i=e.unsafeDatum,s=l)}if(i)return{unsafeDatum:i,distanceSquared:Math.pow(s[0],2)+Math.pow(s[1],2)}}getTooltipParams(){const{xLowerKey:e,xUpperKey:t,yLowerKey:i,yUpperKey:n,xLowerName:s=e,xUpperName:a=t,yLowerName:o=i,yUpperName:r=n}=this.properties;return{xLowerKey:e,xLowerName:s,xUpperKey:t,xUpperName:a,yLowerKey:i,yLowerName:o,yUpperKey:n,yUpperName:r}}onToggleSeriesItem(e){this.groupNode.visible=e.visible}makeStyle(e){return{visible:e.visible,lineDash:e.lineDash,lineDashOffset:e.lineDashOffset,stroke:e.stroke,strokeWidth:e.strokeWidth,strokeOpacity:e.strokeOpacity,cap:(0,n.HFk)(this.properties.cap,e)}}getDefaultStyle(){return this.makeStyle(this.getWhiskerProperties())}getHighlightStyle(){return this.makeStyle(this.getWhiskerProperties())}restyleHighlightChange(e,t,i){const n=this.getNodeData();if(null!=n)for(let s=0;s<n.length;s++)if(e===n[s]){const e=this.cartesianSeries.getSelectionStateString(n[s].datumIndex),a=this.cartesianSeries.getCandidateStateString(n[s].datumIndex);this.sceneSelection.at(s)?.update(t,this.properties,this.cartesianSeries,i?"highlighted-item":"unhighlighted-item",e,a);break}}onHighlightChange(e){const{previousHighlight:t,currentHighlight:i}=e;i?.series===this.cartesianSeries&&this.cartesianSeries.isHighlightEnabled()&&this.restyleHighlightChange(i,this.getHighlightStyle(),!0),t?.series===this.cartesianSeries&&this.restyleHighlightChange(t,this.getDefaultStyle(),!1),this.groupNode.opacity=this.cartesianSeries.getOpacity()}errorBarFactory(){return new Co}getWhiskerProperties(){const{stroke:e,strokeWidth:t,visible:i,strokeOpacity:n,lineDash:s,lineDashOffset:a}=this.properties;return{stroke:e,strokeWidth:t,visible:i,strokeOpacity:n,lineDash:s,lineDashOffset:a}}},zo={type:"series:plugin",name:"errorBar",chartType:"cartesian",seriesTypes:["bar","line","scatter"],enterprise:!0,version:s.xv,options:n.MnY,themeTemplate:{visible:!0,stroke:{$ref:"foregroundColor"},strokeWidth:1,strokeOpacity:1,cap:{lengthRatio:{$if:[{$eq:[{$path:"../../type"},"bar"]},.3,1]}}},create:e=>
1new Eo(e)},{Group:Bo,Rect:Fo,Selection:Vo,TranslatableGroup:$o}=s.n1,Ho={remove:0,update:1,add:2};function jo(e,t,i,n){for(const s of t)e.has(s)||n?.has(s)||e.set(s,i)}function Wo(e,t,i,n){const s=Math.min(e[i],t[i]),a=Math.max(e[i]+e[n],t[i]+t[n]);e[i]=s,e[n]=a-s}var _o=class extends n.UbG{constructor(e){super(),this.ctx=e,this.id=(0,n.sX_)(this),this.flashGroup=new Bo({name:"flash-on-update",zIndex:n.Dcv.AXIS_BAND_HIGHLIGHT}),this.pendingDiffs=[],this.chartFlashRect=this.flashGroup.appendChild(new Fo({name:"chart-flash-on-update"})),this.chartFlashRect.fillOpacity=0,this.bandGroup=this.flashGroup.appendChild(new $o({name:"bands-flash-on-update"})),this.bandSelection=Vo.select(this.bandGroup,(()=>new Fo({name:"flash-on-update-band"}))),this.cleanup.register(this.ctx.scene.attachNode(this.flashGroup),this.ctx.eventsHub.on("layout:complete",(e=>this.onLayoutComplete(e))),this.ctx.eventsHub.on("datamodel:diff",(e=>this.onDataModelDiff(e))),this.ctx.eventsHub.on("update:pre-scene-render",(e=>this.onPreSceneRender(e))))}get opts(){return this.ctx.chartState.getValue("options","flashOnUpdate")}get enabled(){return this.opts.enabled}destroy(){this.ctx.animationManager.stopByAnimationGroupId(this.id),super.destroy()}onLayoutComplete({chart:e,series:t}){this.opts.enabled&&(this.chartFlashRect.x=0,this.chartFlashRect.y=0,this.chartFlashRect.width=e.width,this.chartFlashRect.height=e.height,this.seriesRect=t.rect.clone(),this.bandGroup.translationX=Math.round(this.seriesRect.x),this.bandGroup.translationY=Math.round(this.seriesRect.y),this.bandGroup.setClipRect(this.seriesRect),this.axisCtx=function(e){for(const t of[n.tv$.X,n.tv$.Y])for(const i of e.axisManager.getAxisContext(t))if(s.n1.BandScale.is(i.scale))return i}(this.ctx))}resolveDomainValue(e){const t=this.axisCtx?.scale.domain;if(!t?.length||!Array.isArray(t[0]))return e;for(const i of t)if(String(i)===e)return i;return e}onDataModelDiff({diff:e}){const t=this.opts;t.enabled&&(this.pendingDiffs.push(e),"category"===t.item&&this.cachePreviousBounds(e))}onPreSceneRender({apiUpdate:e}){const t=this.opts,i=this.pendingDiffs.length>0;if(!t.enabled||!e)return void(this.pendingDiffs.length=0);if(!i)return;const n=this.pendingDiffs.some((e=>Object.values(e).some((e=>e.changed)))),s=this.ctx.animationManager.isSkipped(),a=n?function(e,t){const i=new Map;for(const n of e.flatMap((e=>Object.values(e)))){const e=t?n.moved:void 0;jo(i,n.updated,"update",e);for(const e of n.removed)i.set(e,"remove");for(const e of n.added)i.set(e,"add")}return i}(this.pendingDiffs,s):void 0;if(this.pendingDiffs.length=0,!n)return;this.stopFlash();const o=null!=a&&a.size>0;"category"===t.item&&o?this.flashCategoryBands(a):this.flashChart()}flashChart(){this.chartFlashRect.width&&this.chartFlashRect.height&&(this.chartFlashRect.fill=this.opts.fill,this.chartFlashRect.fillOpacity=0,this.animate([this.chartFlashRect],"update"))}cacheBounds(e){const t=this.measureBandBounds(e);t&&(this.previousBoundsCache??(this.previousBoundsCache=new Map),this.previousBoundsCache.set(e,t))}cachePreviousBounds(e){let t=!1;for(const i of Object.values(e)){(i.added.size>0||i.removed.size>0)&&(t=!0);for(const e of[...i.removed,...i.updated,...i.moved])this.cacheBounds(e)}if(t)for(const e of this.axisCtx?.scale.domain??[])this.previousBoundsCache?.has(String(e))||this.cacheBounds(String(e))}measureBandBounds(e){if(!this.axisCtx||!this.seriesRect)return;const t=this.axisCtx.measureBand(this.resolveDomainValue(e))?.band;if(!t)return;const[i,s]=t,a=Math.max(s-i,1);return this.axisCtx.direction===n.tv$.X?{x:i,y:0,width:a,height:this.seriesRect.height}:{x:0,y:i,width:this.seriesRect.width,height:a}}flashCategoryBands(e){const t=this.ctx.animationManager.isSkipped();if(t)for(const[t,i]of e)"remove"===i&&e.delete(t);if(!t&&this.hasScaleChange(e)){const t=this.axisCtx?.scale.domain??[];for(const i of t){const t=String(i);e.has(t)||e.set(t,"update")}}const i=this.createBandFlashData(e);i&&(this.updateSelection(i,t),this.animateBands())}hasScaleChange(e){for(const t of e.values())if("add"===t||"remove"===t)return!0;return!1}createBandFlashData(e){if(!this.axisCtx||!this.seriesRect)return void this.ctx.logger.warnOnce("flashOnUpdate item 'category' requires a cartesian category based axis such as 'category', 'ordinal-time', 'unit-time'");const{direction:t}=this.axisCtx,i=this.axisCtx.scale,s=t===n.tv$.X,a=s?this.seriesRect.width:this.seriesRect.height,o=this.measureBandsBatch(i,e,s);return this.previousBoundsCache=void 0,0!==o.length?function(e,t,i){if(0===e.length)return e;if(!function(e,t){return t>0&&e>0&&t/e<2}(e.length,i))return e;const n=t?"x":"y",s=t?"width":"height",a=[...e].sort(((e,t)=>{const i=Ho[e.phase]-Ho[t.phase];return 0==i?e.bounds[n]-t.bounds[n]:i})),o=[a[0]];let r=o[0];for(let e=1;e<a.length;
1e++){const t=a[e],i=r.bounds[n]+r.bounds[s];t.phase===r.phase&&t.bounds[n]<=i+1e-6?(Wo(r.bounds,t.bounds,n,s),r.lastKey=t.lastKey,r.prevBounds&&t.prevBounds&&Wo(r.prevBounds,t.prevBounds,n,s)):(o.push(t),r=t)}return o}(o,s,a):void 0}measureBandsBatch(e,t,i){const n=e.bandwidth??0,s=((e.step??0)-n)/2,[a,o]=e.range,r=Math.min(a,o),l=Math.max(a,o),h=(i?this.seriesRect?.height:this.seriesRect?.width)??0,c=[];for(const[a,o]of t){if("remove"===o){const e=this.previousBoundsCache?.get(a);e&&c.push({firstKey:a,lastKey:a,bounds:e,phase:o});continue}const t=e.convert(this.resolveDomainValue(a)),d=Math.max(t-s,r),u=Math.min(t+n+s,l),p=Math.max(u-d,1),g=i?{x:d,y:0,width:p,height:h}:{x:0,y:d,width:h,height:p},m=this.previousBoundsCache?.get(a);c.push({firstKey:a,lastKey:a,bounds:g,prevBounds:m,phase:o})}return c}updateSelection(e,t){this.bandSelection.update(e);const{fill:i}=this.opts;this.bandSelection.each(((e,n)=>{const s=t?n.bounds:n.prevBounds??n.bounds;e.fill=i,e.fillOpacity=0,e.x=s.x,e.y=s.y,e.width=s.width,e.height=s.height}))}animateBands(){const e=Array.from(this.bandSelection.nodes());if(this.ctx.animationManager.isSkipped())return void this.animate(e,"update");const t=[],i=[],n=[];for(const s of e)"remove"===s.unsafeNonNullDatum.phase?t.push(s):"add"===s.unsafeNonNullDatum.phase?n.push(s):i.push(s);this.animate(t,"remove"),this.animate(i,"update"),this.animate(n,"add")}stopFlash(){this.ctx.animationManager.stopByAnimationGroupId(this.id)}animate(e,t){if(0===e.length)return;const{animationManager:i}=this.ctx,s=this.getCustomTiming(t),a=s?.duration,o=s?.ease;i.animate({id:`${this.id}_${t}`,groupId:this.id,forceAnimation:!0,phase:t,duration:a,ease:o,from:{fillOpacity:this.opts.fillOpacity},to:{fillOpacity:0},onUpdate:({fillOpacity:t},i)=>{if(!i)for(const i of e)i.fillOpacity=t},onStop:()=>{for(const t of e)t.fillOpacity=0}}),"update"!==t||i.isSkipped()||i.animate({id:`${this.id}_${t}_position`,groupId:this.id,forceAnimation:!0,phase:t,ease:n.vTE,from:{t:0},to:{t:1},onUpdate:({t},i)=>{if(!i)for(const i of e){const e=i.datum?.prevBounds;if(e){const n=i.unsafeNonNullDatum.bounds;i.x=e.x+(n.x-e.x)*t,i.y=e.y+(n.y-e.y)*t,i.width=e.width+(n.width-e.width)*t,i.height=e.height+(n.height-e.height)*t}}}})}getCustomTiming(e){const{flashDuration:t,fadeOutDuration:i}=this.opts;if(null==t&&null==i)return;const{animationManager:n}=this.ctx,{defaultDuration:a}=n,o=t??0,r=o+(i??0);if(r<=0)return;let l;if(n.isSkipped())l=Math.min(r,2*a)/a;else{const t=s.n1.PHASE_METADATA[e].animationDuration;l=Math.min(r/a,2)*t}const h=o/r;return{duration:l,ease:h>=1?()=>0:e=>e<=h?0:(e-h)/(1-h)}}},Go=(()=>({type:"plugin",name:"flashOnUpdate",enterprise:!0,version:s.xv,options:{enabled:n.zMY,item:(0,n.$_4)()("chart","category"),fill:n.yWT,fillOpacity:n.CGN,flashDuration:n.LyW,fadeOutDuration:n.LyW},themeTemplate:{enabled:!1,item:"chart",fill:"#cfeeff",fillOpacity:1,flashDuration:100,fadeOutDuration:900},create:e=>new _o(e)}))(),{TranslatableGroup:Ko}=s.n1,Yo=(()=>{var e=class extends Ko{constructor(){super(...arguments),this.inset=0,this.cornerRadius=0}applyClip(e,t){const{cornerRadius:i,inset:n}=this,{x:s,y:a,width:o,height:r}=t;e.beginPath(),e.roundRect(s+n,a+n,o-2*n,r-2*n,i),e.clip()}};return l([(0,n.k8u)()],e.prototype,"inset",2),l([(0,n.k8u)()],e.prototype,"cornerRadius",2),e})(),{CategoryAxis:Uo,Group:Xo,BBox:Zo,stackCartesianSeries:qo}=s.n1,Qo=(()=>{var e=class extends n.UbG{constructor(e){super(),this.ctx=e,this.root=new Xo({name:"root"}),this.seriesRoot=this.root.appendChild(new Yo({name:"Series-root",zIndex:n.Dcv.SERIES_LAYER,renderToOffscreenCanvas:!0})),this.axisGridGroup=this.root.appendChild(new Xo({name:"Axes-Grids",zIndex:n.Dcv.AXIS_GRID})),this.axisGroup=this.root.appendChild(new Xo({name:"Axes-Grids",zIndex:n.Dcv.AXIS_GRID})),this.axisLabelGroup=this.root.appendChild(new Xo({name:"Axes-Labels",zIndex:n.Dcv.SERIES_LABEL})),this.axisCrosslineRangeGroup=this.root.appendChild(new Xo({name:"Axes-Crosslines-Range",zIndex:n.Dcv.SERIES_CROSSLINE_RANGE})),this.axisCrosslineLineGroup=this.root.appendChild(new Xo({name:"Axes-Crosslines-Line",zIndex:n.Dcv.SERIES_CROSSLINE_LINE})),this.axisCrosslineLabelGroup=this.root.appendChild(new Xo({name:"Axes-Crosslines-Label",zIndex:n.Dcv.SERIES_LABEL})),this._destroyed=!1,this.miniChartAnimationPhase="initial",this.seriesRect=void 0,this.axes=new s.n1.ChartAxes,this.series=[],this.cleanup.register(this.ctx.chartState.observe((e=>{e("options","navigator.miniChart.enabled")?(this._unregisterLoader?.(),this._unregisterLoader=this.ctx.dataService.registerSecondaryLoader("mini-chart",["chart-update","data-update","range-check","state-change","sync"],(e=>this.updateData(e)))):this._unregisterLoader?.()})),(()=>this._unregisterLoader?.()))}get enabled(){return this.ctx.chartState.getValue("options","navigator.miniChart.enabled")??!1}destroy(){this._destroyed||(super.destroy(),this.destroySeries(this.series),this.axes.destroy(),this._destroyed=!0)}onSeriesChange(e,t){const i=t?.filter((t=>!e.includes(t)))??[];this.destroySeries(i);for(const i of e)this.ctx.dataService.isLazy()?i.disconnectData():i.reconnectData(),t?.includes(i)||(i.attachSeries(this.seriesRoot,this.seriesRoot,void 0),i.chart={},Object.defineProperty(i.chart,"mode",{get:()=>"standalone"}),Object.defineProperty(i.chart,"isMiniChart",{get:()=>!0}),Object.defineProperty(i.chart,"flashOnUpdateEnabled",{get:()=>!1}),Object.defineProperty(i.chart,"seriesRect",{get:()=>this.seriesRect}),i.resetAnimation("initial"===this.miniChartAnimationPhase?"initial":"disabled"));this.seriesRect=void 0}destroySeries(e){if(e)for(const t of e)t.destroy(),t.detachSeries(this.seriesRoot,this.seriesRoot,void 0),t.chart=void 0}assignSeriesToAxes(){for(const e of this.axes)e.boundSeries=this.series.filter((t=>t.axes[e.direction]===e))}assignAxesToSeries(){const e={};for(const t of this.axes){const i=t.direction;(e[i]??(e[i]=[])).push(t)}for(const e of this.series)for(const t of e.directions){const i=e.getKeyAxis(t)??t,n=this.axes.findById(i);if(!n)return void this.ctx.logger.warnOnce(`no matching axis for direction [${t}] and id [${i}]; check series and axes configuration.`);e.axes[t]=n}}updateData(e){const t=s.n1.DataSet.wrap(e,this.ctx.logger);for(const e of this.series)e.setChartData(t);"initial"===this.miniChartAnimationPhase&&this.ctx.animationManager.onBatchStop((()=>{this.miniChartAnimationPhase="ready";for(const e of this.series)e.resetAnimation("disabled")}))}async processData(e){this.series.some((e=>e.canHaveAxes))&&(this.assignAxesToSeries(),this.assignSeriesToAxes());const t=this.ctx.dataService.isLazy()?new s.n1.DataController(this.ctx.chartState.getValue("options","mode"),this.ctx.chartState.getValue("options","suppressFieldDotNotation"),this.ctx.eventsHub,this.ctx.logger):e,i=[];for(const e of this.series)e.resetDatumCallbackCache(),i.push(e.processData(t)??Promise.resolve());this.ctx.dataService.isLazy()&&t.execute(void 0,void 0),await Promise.all(i);for(const e of this.axes)e.processData()}computeAxisPadding(){const e=new n.Yqy;if(!this.enabled)return e;for(const t of this.axes){if(!(t instanceof s.n1.CartesianAxis))continue;const{position:i}=t;if(null==i)continue;const{thickness:a,label:o,line:r}=t.options;let l;l=a||(r.enabled?r.width:0)+(o.enabled?(0,n.VKS)(o.fontSize)+o.spacing:0),e[i]=Math.ceil(l)}return e}async layout(e,t){var i;const n=this.ctx.chartState.getValue("options","navigator.miniChart.padding"),a=null!=this.seriesRect,o=new Zo(0,0,e,t-(n.top+n.bottom)),r=this.seriesRect?.width!==e||this.seriesRect?.height!==t;this.seriesRect=o,this.seriesRoot.translationY=n.top,this.seriesRoot.setClipRectCanvasSpace(new Zo(0,-n.top,e,t));for(const r of this.axes){const{position:l="left"}=r;switch(l){case"top":case"bottom":r.range=[n.left,o.width-n.right],r.gridLength=o.height;break;case"right":case"left":{const e=r instanceof Uo;r.range=e?[0,o.height]:[o.height,0],r.gridLength=o.width;break}}r.gridPadding=0,r.translation.x=0,r.translation.y=0,"right"===l?r.translation.x=e:"bottom"===l&&(r.translation.y=t),a||r.resetAnimation("initial");const h=s.n1.getCrossLinesPlugin(r)?.getInstances();if(h)for(const e of h)e instanceof s.n1.CartesianCrossLine&&(e.position=r.position??"top",(i=e.label).parallel??(i.parallel=r.parallel));
1r.calculateLayout(),r.update()}r&&qo(this.series),await Promise.all(this.series.map((async e=>e.update({seriesRect:o}))))}};return l([(0,n.i1O)(["seriesRoot","inset"])],e.prototype,"inset",2),l([(0,n.i1O)(["seriesRoot","cornerRadius"])],e.prototype,"cornerRadius",2),l([(0,n.mBh)({changeValue(e,t=new s.n1.ChartAxes){const i={axisNode:this.axisGroup,gridNode:this.axisGridGroup,labelNode:this.axisLabelGroup,overlayLowNode:this.axisCrosslineRangeGroup,overlayMidNode:this.axisCrosslineLineGroup,overlayHighNode:this.axisCrosslineLabelGroup};for(const i of t)e.includes(i)||(i.detachAxis(),i.destroy());for(const n of e)t?.includes(n)||n.attachAxis(i)}})],e.prototype,"axes",2),l([(0,n.mBh)({changeValue(e,t){this.onSeriesChange(e,t)}})],e.prototype,"series",2),e})(),{SliderWidget:Jo}=s.n1,er=class{constructor(e,t){this.ctx=e,this.sliderHandlers=t,this._min=0,this._max=1,this.minRange=.001,this.dragStartX=0,this.ctx=e,this.toolbar=e.proxyInteractionService.createProxyContainer({type:"toolbar",domManagerId:"navigator-toolbar",classList:["ag-charts-proxy-navigator-toolbar"],orientation:"vertical",ariaLabel:{id:"ariaLabelNavigator"}}),this.sliders=[e.proxyInteractionService.createProxyElement({type:"slider",domIndex:1,ariaLabel:{id:"ariaLabelNavigatorMinimum"},parent:this.toolbar,cursor:"ew-resize"}),e.proxyInteractionService.createProxyElement({type:"slider",domIndex:-1/0,ariaLabel:{id:"ariaLabelNavigatorRange"},parent:this.toolbar,cursor:"grab"}),e.proxyInteractionService.createProxyElement({type:"slider",domIndex:2,ariaLabel:{id:"ariaLabelNavigatorMaximum"},parent:this.toolbar,cursor:"ew-resize"})];for(const[e,t]of["min","pan","max"].entries()){const i=this.sliders[e];i.step=Jo.STEP_HUNDRETH,i.keyboardStep=Jo.STEP_ONE,i.orientation="horizontal",i.setPreventsDefault(!1),i.addListener("blur",(()=>this.clearFocusOverride(i))),i.addListener("focus",(()=>this.clearFocusOverride(i))),i.addListener("keydown",(()=>this.onKeyDown(i))),i.addListener("drag-start",(i=>this.onDragStart(e,i,t))),i.addListener("drag-move",(e=>this.onDrag(i,e,t))),i.addListener("drag-end",(()=>this.updateSliderRatios())),i.addListener("contextmenu",(e=>this.onContextMenu(i,e)))}this.sliders[0].addListener("change",(()=>this.onMinSliderChange())),this.sliders[1].addListener("change",(()=>this.onPanSliderChange())),this.sliders[2].addListener("change",(()=>this.onMaxSliderChange())),this.updateSliderRatios(),this.updateVisibility(!1)}destroy(){this.toolbar.destroy()}updateVisibility(e){this.toolbar.setHidden(!e)}updateZoom(){const{_min:e,_max:t}=this;null!=e&&null!=t&&this.ctx.zoomManager?.updateZoom({source:"user-interaction",sourceDetail:"navigatorDOM"},{x:{min:e,max:t}})}updateBounds(e){this.toolbar.setBounds(e)}updateSliderBounds(e,t){this.sliders[e].setBounds(t)}updateMinMax(e,t){this._min=e,this._max=t,this.updateSliderRatios()}updateSliderRatios(){let{_min:e,_max:t}=this;e=Math.round(100*e)/100,t=Math.round(100*t)/100;const i=this.ctx.localeManager.t("ariaValuePanRange",{min:e,max:t});this.sliders[0].setValueRatio(e),this.sliders[1].setValueRatio(e,{ariaValueText:i}),this.sliders[2].setValueRatio(t)}toCanvasOffsets(e){return{offsetX:this.dragStartX+e.originDeltaX}}moveToFront(e){if(1===e)return;const t=this.sliders[e],i=this.sliders[2-e];this.toolbar.moveChild(i,t.domIndex-1)}clearFocusOverride(e){e.setFocusOverride(void 0)}onKeyDown(e){const t=e.getElement();t===t.ownerDocument.activeElement&&e.setFocusOverride(!0)}onDragStart(e,t,i){const n=this.sliders[e],s=this.toolbar.cssLeft(),a=n.cssLeft();this.dragStartX=s+a+t.offsetX,this.moveToFront(e),t.sourceEvent.preventDefault(),n.focus(),n.setFocusOverride(!1),this.sliderHandlers.onDragStart(i,this.toCanvasOffsets(t))}onDrag(e,t,i){t.sourceEvent.preventDefault(),this.sliderHandlers.onDrag(i,this.toCanvasOffsets(t))}onContextMenu(e,t){const{offsetX:i,offsetY:n}=t,{x:s,y:a}=this.toolbar.getBounds(),{x:o,y:r}=e.getBounds(),l=i+s+o,h=n+a+r;this.ctx.contextMenuRegistry?.dispatchContext("always",{widgetEvent:t,canvasX:l,canvasY:h},void 0)}onPanSliderChange(){const e=this.sliders[1].getValueRatio(),t=this._max-this._min;this._min=(0,n.qE8)(0,e,1-t),this._max=this._min+t,this.updateZoom()}onMinSliderChange(){this._min=this.sliders[0].clampValueRatio(0,this._max-this.minRange),this.updateZoom()}onMaxSliderChange(){this._max=this.sliders[2].clampValueRatio(this._min+this.minRange,1),this.updateZoom()}},{BBox:tr,ExtendedPath2D:ir}=s.n1,nr=(()=>{var e=class extends s.n1.Path{constructor(){super(...arguments),this.zIndex=3,this.centerX=0,this.centerY=0,this.width=8,this.height=16,this.cornerRadius=4,this.grip=!0,this.gripPath=new ir}setCenter(e,t){this.dirtyPath=!0,this.centerX===e&&this.centerY===t||(this.centerX=e,this.centerY=t,this.markDirty("center"))}static align(e,t,i,n,s,a,o,r,l){const h=e.align(i+s*o)+l,c=h+e.align(i+s*o,s*(r-o))-2*l,d=e.align(n+a/2);e.setCenter(h,d),t.setCenter(c,d)}computeBBox(){const{centerX:e,centerY:t,width:i,height:n}=this;
1return new tr(e-i/2,t-n/2,i,n)}isPointInPath(e,t){return this.getBBox().containsPoint(e,t)}updatePath(){const{centerX:e,centerY:t,path:i,gripPath:n,strokeWidth:s,cornerRadius:a,grip:o}=this,r=s/2,l=this.layerManager?.canvas?.pixelRatio??1;i.clear(),n.clear();const h=Math.floor(this.width/2*l)/l,c=Math.floor(this.height/2*l)/l;i.roundRect(e-h+r,t-c+r,2*(h-r),2*(c-r),a);if(o)for(let i=-.5;i<=.5;i+=1)for(let s=-1;s<=1;s+=1)n.arc(e+3*i,t+3*s,1,0,2*Math.PI),n.closePath()}renderFill(e,t,i){const{stroke:n}=this;super.renderFill(e,t,i),e.fillStyle="string"==typeof n?n:"black",e.fill(this.gripPath.getPath2D())}};return e.className="RangeHandle",l([n.mAP,(0,n.k8u)()],e.prototype,"width",2),l([n.mAP,(0,n.k8u)()],e.prototype,"height",2),l([n.mAP,(0,n.k8u)()],e.prototype,"cornerRadius",2),l([n.mAP,(0,n.k8u)()],e.prototype,"grip",2),e})(),{Path:sr,BBox:ar,ExtendedPath2D:or,clippedRoundRect:rr}=s.n1,lr=(()=>{var e=class extends sr{constructor(){super(...arguments),this.cornerRadius=4,this.zIndex=2,this.x=0,this.y=0,this.width=200,this.height=30,this.min=0,this.max=1,this.visiblePath=new or}layout(e,t,i,n,s,a){s=Number.isNaN(s)?this.min:s,a=Number.isNaN(a)?this.max:a,e===this.x&&t===this.y&&i===this.width&&this.height===n&&s===this.min&&a===this.max||(this.x=e,this.y=t,this.width=i,this.height=n,this.min=s,this.max=a,this.dirtyPath=!0,this.markDirty("RangeMask.layout"))}computeBBox(){const{x:e,y:t,width:i,height:n}=this;return new ar(e,t,i,n)}computeVisibleRangeBBox(){const{x:e,y:t,width:i,height:n,min:s,max:a}=this,o=e+i*s;return new ar(o,t,e+i*a-o,n)}updatePath(){const{path:e,visiblePath:t,x:i,y:n,width:s,height:a,min:o,max:r,strokeWidth:l,cornerRadius:h}=this,c=l/2;e.clear(),t.clear();const d=this.align(i)+c,u=this.align(n)+c,p=this.align(i,s)-2*c,g=this.align(n,a)-2*c,m=this.align(i+s*o)+c,y=m+this.align(i+s*o,s*(r-o))-2*c,f={topLeft:h,topRight:h,bottomRight:h,bottomLeft:h},x=(e,t,i)=>{if(i-t<1)return;const n=new ar(t,u,i-t,g);rr(e,d,u,p,g,f,n)};x(e,d,m),x(e,y,p+d),x(t,m,y)}renderStroke(e,t){super.renderStroke(e,t),super.renderStroke(e,this.visiblePath.getPath2D())}};return e.className="RangeMask",l([n.mAP,(0,n.k8u)()],e.prototype,"cornerRadius",2),e})(),hr=class extends s.n1.Group{constructor(e){super({name:"rangeSelectorGroup",zIndex:n.Dcv.NAVIGATOR}),this.x=0,this.y=0,this.width=200,this.height=30,this.lOffset=0,this.rOffset=0,this.background=this.appendChild(new s.n1.TranslatableGroup({name:"navigator-background",zIndex:1})),this.append(e)}layout(e,t,i,n,s,a){this.x=e,this.y=t,this.width=i,this.height=n,this.lOffset=s,this.rOffset=a,this.background.translationX=e,this.background.translationY=t,this.markDirty("RangeSelector")}
1updateBackground(e,t){null!=e&&e.remove(),null!=t&&this.background.appendChild(t),this.markDirty("RangeSelector")}computeBBox(){const{x:e,y:t,width:i,height:n,lOffset:a,rOffset:o}=this;return new s.n1.BBox(e-a,t,i+(a+o),n)}},cr=class extends n.UbG{constructor(e){super(),this.ctx=e,this.mask=new lr,this.minHandle=new nr,this.maxHandle=new nr,this.maskVisibleRange={id:"navigator-mask-visible-range",getBBox:()=>this.mask.computeVisibleRangeBBox(),toCanvasBBox:()=>this.mask.computeVisibleRangeBBox()},this.x=0,this.y=0,this.width=0,this.rangeSelector=new hr([this.mask,this.minHandle,this.maxHandle]),this.miniChart=new Qo(e),this.updateBackground(void 0,this.miniChart.root),this.domProxy=new er(e,this),this.cleanup.register(e.scene.attachNode(this.rangeSelector),e.eventsHub.on("locale:change",(()=>this.updateZoom())),e.layoutManager.registerElement(s.n1.LayoutElement.Navigator,(e=>this.onLayoutStart(e))),e.eventsHub.on("layout:complete",(e=>this.onLayoutComplete(e))),e.eventsHub.on("zoom:change-complete",(e=>this.onZoomChange(e))),e.chartState.observe((t=>{const i=t("options","navigator.enabled")??!1;e.zoomManager?.setNavigatorEnabled(Boolean(i)),this.updateGroupVisibility()})),e.chartState.observe((e=>{this.mask.cornerRadius=e("options","navigator.cornerRadius")??0})),e.chartState.observe((e=>{const t=e("options","navigator.mask");null!=t&&this.applyShapeOptions(this.mask,t)})),e.chartState.observe((e=>{const t=e("options","navigator.minHandle");null!=t&&this.applyHandleOptions(this.minHandle,t)})),e.chartState.observe((e=>{const t=e("options","navigator.maxHandle");null!=t&&this.applyHandleOptions(this.maxHandle,t)}))),this.updateGroupVisibility()}get opts(){return this.ctx.chartState.getValue("options","navigator")}get enabled(){return this.opts.enabled}applyShapeOptions(e,t){null!=t.fill&&(e.fill=t.fill),null!=t.fillOpacity&&(e.fillOpacity=t.fillOpacity),null!=t.stroke&&(e.stroke=t.stroke),null!=t.strokeWidth&&(e.strokeWidth=t.strokeWidth)}applyHandleOptions(e,t){this.applyShapeOptions(e,t),null!=t.width&&(e.width=t.width),null!=t.height&&(e.height=t.height),null!=t.cornerRadius&&(e.cornerRadius=t.cornerRadius),null!=t.grip&&(e.grip=t.grip)}
1updateBackground(e,t){this.rangeSelector?.updateBackground(e,t)}updateGroupVisibility(){const{enabled:e}=this;null!=this.rangeSelector&&e!==this.rangeSelector.visible&&(this.rangeSelector.visible=e,this.domProxy.updateVisibility(e),e&&this.updateZoom())}onLayoutStart({layoutBox:e}){const t=this.opts,{enabled:i,height:n,spacing:s}=t;if(i?(e.shrink(n+s,"bottom"),this.y=e.y+e.height+s):this.y=0,i&&this.miniChart){const{top:t,bottom:i}=this.miniChart.computeAxisPadding();e.shrink(t+i,"bottom"),this.y-=i,this.miniChart.inset=this.mask.strokeWidth/2,this.miniChart.cornerRadius=this.mask.cornerRadius}}onLayoutComplete(e){const{x:t,width:i}=e.series.rect,{y:n}=this,{enabled:s,height:a}=this.opts;if(this.domProxy.updateVisibility(s),s){const{_min:e,_max:s}=this.domProxy;this.layoutNodes(t,n,i,a,e,s),this.domProxy.updateBounds({x:t,y:n,width:i,height:a})}this.x=t,this.width=i,this.miniChart?.layout(i,a).catch((e=>this.ctx.logger.error(e)))}canDrag(){return this.enabled&&this.ctx.interactionManager.isState(s.n1.InteractionState.ZoomDraggable)}onDragStart(e,{offsetX:t}){this.canDrag()&&("pan"===e&&(this.panStart=(t-this.x)/this.width-this.domProxy._min),this.ctx.zoomManager?.fireZoomPanStartEvent("navigator"))}onDrag(e,{offsetX:t}){if(!this.canDrag())return;const{panStart:i,x:s,width:a}=this,{minRange:o}=this.domProxy,r=this.ctx.chartState.getValue("zoom");if(!r?.x)return;let{min:l,max:h}=r.x;const c=(t-s)/a;if("min"===e)l=(0,n.qE8)(0,c,h-o);else if("max"===e)h=(0,n.qE8)(l+o,c,1);else if("pan"===e&&null!=i){const e=h-l;l=(0,n.qE8)(0,c-i,1-e),h=l+e}this.domProxy._min=l,this.domProxy._max=h,this.updateZoom()}onZoomChange(e){const{x:t}=e;if(!t)return;const{x:i,y:n,width:s}=this,{height:a}=this.opts,{min:o,max:r}=t;this.domProxy.updateMinMax(o,r),this.layoutNodes(i,n,s,a,o,r)}layoutNodes(e,t,i,n,s,a){const{rangeSelector:o,mask:r,minHandle:l,maxHandle:h}=this;r.layout(e,t,i,n,s,a),o.layout(e,t,i,n,l.width/2,h.width/2),nr.align(l,h,e,t,i,n,s,a,r.strokeWidth/2),s+(a-s)/2<.5?(l.zIndex=3,h.zIndex=4):(l.zIndex=4,h.zIndex=3);for(const[i,n]of[l,this.maskVisibleRange,h].entries()){const s=n.getBBox(),a={x:s.x-e,y:s.y-t,height:s.height,width:s.width};this.domProxy.updateSliderBounds(i,a)}}updateZoom(){this.enabled&&this.domProxy.updateZoom()}async processData(e){return this.miniChart?.processData(e)}};var{Path:dr,Scalable:ur,ExtendedPath2D:pr,BBox:gr,clippedRoundRect:mr}=s.n1,yr=(()=>{var e=class extends(ur(dr)){constructor(){super(...arguments),this.wickPath=new pr,this.horizontal=!1,this.center=0,this.thickness=0,this.min=0,this.q1=0,this.median=0,this.q3=0,this.max=0,this.cornerRadius=0,this.crisp=!1,this.strokeAlignment=0,this.wickStroke=void 0,this.wickStrokeWidth=void 0,this.wickStrokeOpacity=void 0,this.capLengthRatio=1,this.wickStrokeAlignment=0}computeBBox(){const{horizontal:e,center:t,thickness:i,min:n,max:s}=this;return e?new gr(Math.min(n,s),t-i/2,Math.abs(s-n),i):new gr(t-i/2,Math.min(n,s),i,Math.abs(s-n))}computeDefaultGradientFillBBox(){const{horizontal:e,center:t,thickness:i,q1:n,q3:s}=this;return e?new gr(Math.min(n,s),t-i/2,Math.abs(s-n),i):new gr(t-i/2,Math.min(n,s),i,Math.abs(s-n))}isPointInPath(e,t){return this.getBBox().containsPoint(e,t)}distanceSquared(e,t){return this.getBBox().distanceSquared(e,t)}get midPoint(){return this.horizontal?{x:(this.min+this.max)/2,y:this.center}:{x:this.center,y:(this.min+this.max)/2}}alignedCoordinates(){const{thickness:e,crisp:t}=this;let{center:i,min:n,q1:s,median:a,q3:o,max:r}=this,l=i-e/2,h=i+e/2;if(t&&e>1){n=this.align(n),s=this.align(s),a=this.align(a),o=this.align(o),r=n+this.align(n,r-n);const t=this.align(e/2);i=this.align(i),l=i-t,h=i+t}return{center:i,x0:l,x1:h,min:n,max:r,q1:s,median:a,q3:o}}updatePath(){const{path:e,stroke:t,strokeWidth:i,strokeOpacity:n,lineDash:s,lineDashOffset:a,wickStroke:o,wickStrokeWidth:r,wickStrokeOpacity:l,wickLineDash:h,wickLineDashOffset:c,strokeAlignment:d,cornerRadius:u,capLengthRatio:p,horizontal:g}=this,{center:m,x0:y,x1:f,min:x,max:b,q1:v,median:S,q3:M}=this.alignedCoordinates(),k=this.layerManager?.canvas.pixelRatio??1,D=this.wickStrokeAlignment>0?k/this.wickStrokeAlignment/2%1:0;this.path.clear(),this.wickPath.clear();const w=null!=o&&o!==t||null!=r&&r!==i||null!=l&&l!==n||null!=h&&h!==s||null!=c&&c!==a?this.wickPath:e;if(Math.abs(f-y)<=3)return fr(w,g,m,x),void xr(w,g,m,b);const I=Math.min(x,b),A=Math.max(x,b),C=Math.min(v,M),N=Math.max(v,M),L=m-Math.abs((f-y)*p)/2,P=m+Math.abs((f-y)*p)/2;fr(w,g,L,I-D),xr(w,g,P,I-D),fr(w,g,m-D,I-D),xr(w,g,m-D,C+i/2),fr(w,g,m-D,A+D),xr(w,g,m-D,N-i/2),fr(w,g,L,A+D),xr(w,g,P,A+D);const T=i/2+d,O=i/2-d,R=N-C-2*O;if(R>0){const t=y+T,i=C+O,n=f-y-2*T,s={topLeft:u,topRight:u,bottomRight:u,bottomLeft:u};br(e,g,t,i,n,R,s,new gr(t,i,n,S-i)),br(e,g,t,i,n,R,s,new gr(t,S,n,i+R-S))}else{const t=(C+N)/2;fr(e,g,y,t),xr(e,g,f,t)}}drawPath(e,t){super.drawPath(e,t);const{wickPath:i}=this;if(i.isEmpty())return;const{stroke:n,strokeWidth:s,strokeOpacity:a,lineDash:o,lineDashOffset:r,wickStroke:l=n,wickStrokeWidth:h=s,wickStrokeOpacity:c=a,wickLineDash:d=o,wickLineDashOffset:u=r}=this;
10!==h&&(e.globalAlpha*=c,"string"==typeof l&&(e.strokeStyle=l),e.lineWidth=h,null!=d&&e.setLineDash([...d]),e.lineDashOffset=u,e.stroke(i.getPath2D()))}};return l([(0,n.k8u)()],e.prototype,"horizontal",2),l([(0,n.k8u)()],e.prototype,"center",2),l([(0,n.k8u)()],e.prototype,"thickness",2),l([(0,n.k8u)()],e.prototype,"min",2),l([(0,n.k8u)()],e.prototype,"q1",2),l([(0,n.k8u)()],e.prototype,"median",2),l([(0,n.k8u)()],e.prototype,"q3",2),l([(0,n.k8u)()],e.prototype,"max",2),l([(0,n.k8u)()],e.prototype,"cornerRadius",2),l([(0,n.k8u)()],e.prototype,"crisp",2),l([(0,n.k8u)()],e.prototype,"strokeAlignment",2),l([(0,n.k8u)()],e.prototype,"wickStroke",2),l([(0,n.k8u)()],e.prototype,"wickStrokeWidth",2),l([(0,n.k8u)()],e.prototype,"wickStrokeOpacity",2),l([(0,n.Haz)()],e.prototype,"wickLineDash",2),l([(0,n.k8u)()],e.prototype,"wickLineDashOffset",2),l([(0,n.k8u)()],e.prototype,"capLengthRatio",2),l([(0,n.k8u)()],e.prototype,"wickStrokeAlignment",2),e})();function fr(e,t,i,n){t?e.moveTo(n,i):e.moveTo(i,n)}function xr(e,t,i,n){t?e.lineTo(n,i):e.lineTo(i,n)}function br(e,t,i,n,s,a,o,r){t?mr(e,n,i,a,s,o,null==r?void 0:new gr(r.y,r.x,r.height,r.width)):mr(e,i,n,s,a,o,r)}var{AbstractBarSeriesProperties:vr,makeSeriesTooltip:Sr}=s.n1,Mr=(()=>{var e=class extends n.XPE{constructor(){super(...arguments),this.lengthRatio=.5}};return l([n.mAP],e.prototype,"lengthRatio",2),e})(),kr=(()=>{var e=class extends n.XPE{};return l([n.mAP],e.prototype,"stroke",2),l([n.mAP],e.prototype,"strokeWidth",2),l([n.mAP],e.prototype,"strokeOpacity",2),l([n.mAP],e.prototype,"lineDash",2),l([n.mAP],e.prototype,"lineDashOffset",2),e})(),Dr=(()=>{var e=class extends vr{constructor(){super(...arguments),this.fill="#c16068",this.fillOpacity=1,this.stroke="#333",this.strokeWidth=1,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.cornerRadius=0,this.cap=new Mr,this.whisker=new kr,this.tooltip=Sr()}toJson(){const{stroke:e,strokeWidth:t,strokeOpacity:i,lineDash:s,lineDashOffset:a}=this,o=super.toJson();return o.whisker=(0,n.HFk)(o.whisker,{stroke:e,strokeWidth:t,strokeOpacity:i,lineDash:s,lineDashOffset:a}),o}};return l([n.mAP],e.prototype,"xKey",2),l([n.mAP],e.prototype,"minKey",2),l([n.mAP],e.prototype,"q1Key",2),l([n.mAP],e.prototype,"medianKey",2),l([n.mAP],e.prototype,"q3Key",2),l([n.mAP],e.prototype,"maxKey",2),l([n.mAP],e.prototype,"xName",2),l([n.mAP],e.prototype,"yName",2),l([n.mAP],e.prototype,"minName",2),l([n.mAP],e.prototype,"q1Name",2),l([n.mAP],e.prototype,"medianName",2),l([n.mAP],e.prototype,"q3Name",2),l([n.mAP],e.prototype,"maxName",2),l([n.mAP],e.prototype,"fill",2),l([n.mAP],e.prototype,"fillOpacity",2),l([n.mAP],e.prototype,"stroke",2),l([n.mAP],e.prototype,"strokeWidth",2),l([n.mAP],e.prototype,"strokeOpacity",2),l([n.mAP],e.prototype,"lineDash",2),l([n.mAP],e.prototype,"lineDashOffset",2),l([n.mAP],e.prototype,"cornerRadius",2),l([n.mAP],e.prototype,"styler",2),l([n.mAP],e.prototype,"itemStyler",2),l([n.mAP],e.prototype,"cap",2),l([n.mAP],e.prototype,"whisker",2),l([n.mAP],e.prototype,"tooltip",2),e})(),{fixNumericExtent:wr,keyProperty:Ir,SeriesNodePickMode:Ar,SMALLEST_KEY_INTERVAL:Cr,valueProperty:Nr,diff:Lr,animationValidation:Pr,computeBarFocusBounds:Tr,createDatumId:Or,HighlightState:Rr,motion:Er,getItemStyles:zr,calculateSegments:Br,toHighlightString:Fr,toSelectionString:Vr,processedDataIsAnimatable:$r,upsertNodeDatum:Hr}=s.n1,jr=(()=>{var e=class extends s.n1.AbstractBarSeries{constructor(e){super({moduleCtx:e,pickModes:[Ar.NEAREST_NODE,Ar.EXACT_SHAPE_MATCH],propertyKeys:{x:["xKey"],y:["medianKey","q1Key","q3Key","minKey","maxKey"]},propertyNames:{x:["xName"],y:["medianName","q1Name","q3Name","minName","maxName"]},categoryKey:"xValue",pathsPerSeries:[]}),this.properties=new Dr}createNodeParams(e){return{...super.createNodeParams(e),xKey:this.properties.xKey,minKey:this.properties.minKey,q1Key:this.properties.q1Key,medianKey:this.properties.medianKey,q3Key:this.properties.q3Key,maxKey:this.properties.maxKey}}async processData(e){if(!this.visible)return;const{xKey:t,minKey:i,q1Key:n,medianKey:s,q3Key:a,maxKey:o}=this.properties,r=!this.ctx.animationManager.isSkipped(),l=this.getCategoryAxis()?.scale,h=this.getValueAxis()?.scale,{isContinuousX:c,xScaleType:d,yScaleType:u}=this.getScaleInformation({xScale:l,yScale:h}),p=[];this.needsDataModelDiff()&&this.processedData&&p.push(Lr(this.id,this.processedData)),r&&p.push(Pr());const g=this.properties.allowNullKeys??!1,{processedData:m}=await this.requestDataModel(e,this.data,{props:[Ir(t,d,{id:"xValue",allowNullKey:g}),Nr(i,u,{id:"minValue"}),Nr(n,u,{id:"q1Value"}),Nr(s,u,{id:"medianValue"}),Nr(a,u,{id:"q3Value"}
1),Nr(o,u,{id:"maxValue"}),...c?[Cr]:[],...p]});this.smallestDataInterval=m.reduced?.smallestKeyInterval,this.animationState.transition("updateData")}getSeriesDomain(e){const{processedData:t,dataModel:i}=this;if(!t||!i)return{domain:[]};if(e!==this.getBarDirection()){const{index:e,def:n}=i.resolveProcessedDataDefById(this,"xValue"),s=t.domain.keys[e];if("key"===n.type&&"category"===n.valueType){return{domain:s,sortMetadata:i.getKeySortMetadata(this,"xValue",t)}}return{domain:this.padBandExtent(s)}}const n=this.domainForClippedRange(e,["minValue","maxValue"],"xValue");return{domain:wr(n)}}getSeriesRange(e,t){const[i,s]=this.domainForVisibleRange(n.tv$.Y,["maxValue","minValue"],"xValue",t);return[(0,n.Roz)(i),(0,n.Roz)(s)]}createNodeDatumContext(e,t){const{dataModel:i,processedData:n,contextNodeData:s}=this;if(!i||!n)return;const a=this.visible&&null!=s?.nodeData&&null!=n.changeDescription,o=!this.ctx.animationManager.isSkipped(),{groupOffset:r,barOffset:l,barWidth:h}=this.getBarDimensions();return{xAxis:e,yAxis:t,rawData:n.dataSources.get(this.id)?.data??[],xValues:i.resolveKeysById(this,"xValue",n),minValues:i.resolveColumnById(this,"minValue",n,"mixed-numeric"),q1Values:i.resolveColumnById(this,"q1Value",n,"mixed-numeric"),medianValues:i.resolveColumnById(this,"medianValue",n,"mixed-numeric"),q3Values:i.resolveColumnById(this,"q3Value",n,"mixed-numeric"),maxValues:i.resolveColumnById(this,"maxValue",n,"mixed-numeric"),xScale:e.scale,yScale:t.scale,groupOffset:r,barOffset:l,barWidth:h,isVertical:this.isVertical(),xKey:this.properties.xKey,animationEnabled:o,canIncrementallyUpdate:a,nodes:a?s.nodeData:[],nodeIndex:0}}validateBoxPlotValues(e,t,i,s,a){return[e,t,i,s,a].every(n.zZm)&&e<=t&&t<=i&&i<=s&&s<=a}computeScaledValues(e,t,i){const n=e.xScale.convert(e.xValues[i]);return!!Number.isFinite(n)&&(t.xValue=n+e.groupOffset+e.barOffset+e.barWidth/2,t.minValue=e.yScale.convert(e.minValues[i]),t.q1Value=e.yScale.convert(e.q1Values[i]),t.medianValue=e.yScale.convert(e.medianValues[i]),t.q3Value=e.yScale.convert(e.q3Values[i]),t.maxValue=e.yScale.convert(e.maxValues[i]),!0)}createSkeletonNodeDatum(e,t){return{series:this,datum:t.datum,datumIndex:t.datumIndex,xKey:e.xKey,bandwidth:e.barWidth,scaledValues:{xValue:0,minValue:0,q1Value:0,medianValue:0,q3Value:0,maxValue:0},midPoint:{x:0,y:0},focusRect:{x:0,y:0,width:0,height:0}}}updateNodeDatum(e,t,i){const{isVertical:n,barWidth:s}=e,a=i.scaledValues,o=t;o.datum=i.datum,o.datumIndex=i.datumIndex,o.bandwidth=s;const r=o.scaledValues;r.xValue=a.xValue,r.minValue=a.minValue,r.q1Value=a.q1Value,r.medianValue=a.medianValue,r.q3Value=a.q3Value,r.maxValue=a.maxValue;const l=Math.abs(a.q3Value-a.q1Value),h=a.xValue,c=Math.min(a.q3Value,a.q1Value)+l/2,d=n?h:c,u=n?c:h;o.midPoint?(o.midPoint.x=d,o.midPoint.y=u):o.midPoint={x:d,y:u};const p=o.focusRect;n?(p.x=d-s/2,p.y=a.minValue,p.width=s,p.height=a.maxValue-a.minValue):(p.x=a.minValue,p.y=u-s/2,p.width=a.maxValue-a.minValue,p.height=s)}createNodeDatum(e,t){const i=this.createSkeletonNodeDatum(e,t);return this.updateNodeDatum(e,i,t),i}initializeResult(e){return{itemId:this.properties.xKey,nodeData:e.nodes,labelData:[],scales:this.calculateScaling(),visible:this.visible,groupScale:void 0,styles:void 0,segments:void 0}}populateNodeData(e){if(!this.visible)return;const t={xValue:0,minValue:0,q1Value:0,medianValue:0,q3Value:0,maxValue:0},i={datumIndex:0,datum:void 0,scaledValues:t};for(let n=0;n<e.rawData.length;n++){const s=e.rawData[n];if(void 0===e.xValues[n]&&!this.properties.allowNullKeys)continue;const a=e.minValues[n],o=e.q1Values[n],r=e.medianValues[n],l=e.q3Values[n],h=e.maxValues[n];this.validateBoxPlotValues(a,o,r,l,h)&&(this.computeScaledValues(e,t,n)&&(i.datumIndex=n,i.datum=s,Hr(e,i,((e,t)=>this.createNodeDatum(e,t)),((e,t,i)=>this.updateNodeDatum(e,t,i)))))}}finalizeNodeData(e){e.canIncrementallyUpdate&&e.nodeIndex<e.nodes.length&&(e.nodes.length=e.nodeIndex)}assembleResult(e,t){t.groupScale=this.getScaling(this.ctx.seriesStateManager.getGroupScale(this)),t.styles=zr(this.getItemStyle.bind(this));const i=this.chart?.seriesRect;return null!=i&&(t.segments=Br(this.properties.segmentation,e.xAxis,e.yAxis,i,this.ctx.scene)),t}legendItemSymbol(){const{fill:e,stroke:t,strokeWidth:i,fillOpacity:s,strokeOpacity:a,lineDash:o,lineDashOffset:r}=this.getStyle(!1,Rr.None,void 0,void 0);return{marker:{fill:(0,n.Go6)(e),fillOpacity:s,stroke:t,strokeOpacity:a,strokeWidth:i,lineDash:o,lineDashOffset:r}}}getLegendData(e){const{id:t,ctx:{legendManager:i},visible:n}=this,{xKey:s,yName:a,showInLegend:o,legendItemName:r}=this.properties;
1return s&&"category"===e?[{legendType:"category",id:t,itemId:t,seriesId:t,enabled:n&&(i?.getItemEnabled({seriesId:t,itemId:t})??!0),label:{text:r??a??t},symbol:this.legendItemSymbol(),legendItemName:r,hideInLegend:!o}]:[]}getTooltipContent(e){const{id:t,dataModel:i,processedData:n,properties:a}=this,{xKey:o,xName:r,yName:l,medianKey:h,medianName:c,q1Key:d,q1Name:u,q3Key:p,q3Name:g,minKey:m,minName:y,maxKey:f,maxName:x,legendItemName:b,tooltip:v}=a,S=this.getCategoryAxis(),M=this.getValueAxis();if(!(i&&n&&S&&M))return;const k=n.dataSources.get(this.id)?.data[e],D=i.resolveKeysById(this,"xValue",n)[e],w=i.resolveColumnById(this,"minValue",n,"mixed-numeric")[e],I=i.resolveColumnById(this,"q1Value",n,"mixed-numeric")[e],A=i.resolveColumnById(this,"medianValue",n,"mixed-numeric")[e],C=i.resolveColumnById(this,"q3Value",n,"mixed-numeric")[e],N=i.resolveColumnById(this,"maxValue",n,"mixed-numeric")[e],L=this.properties.allowNullKeys??!1;if(void 0===D&&!L)return;const P=this.getItemStyle(e,!1,void 0,void 0,void 0),T=[{label:y,fallbackLabel:m,value:this.getAxisValueText(M,"tooltip",w,k,m,b),missing:s.n1.isTooltipValueMissing(w)},{label:u,fallbackLabel:d,value:this.getAxisValueText(M,"tooltip",I,k,d,b),missing:s.n1.isTooltipValueMissing(I)},{label:c,fallbackLabel:h,value:this.getAxisValueText(M,"tooltip",A,k,h,b),missing:s.n1.isTooltipValueMissing(A)},{label:g,fallbackLabel:p,value:this.getAxisValueText(M,"tooltip",C,k,p,b),missing:s.n1.isTooltipValueMissing(C)},{label:x,fallbackLabel:f,value:this.getAxisValueText(M,"tooltip",N,k,f,b),missing:s.n1.isTooltipValueMissing(N)}];return this.formatTooltipWithContext(v,{heading:this.getAxisValueText(S,"tooltip",D,k,o,b),title:b??l,symbol:this.legendItemSymbol(),data:T},{seriesId:t,datum:k,title:l,xKey:o,xName:r,yName:l,medianKey:h,medianName:c,q1Key:d,q1Name:u,q3Key:p,q3Name:g,minKey:m,minName:y,maxKey:f,maxName:x,...P})}animateEmptyUpdateReady({datumSelection:e}){const t=this.isVertical(),{from:i,to:n}=function(e){return{from:e?{scalingX:1,scalingY:0}:{scalingX:0,scalingY:1},to:{scalingX:1,scalingY:1}}}(t);Er.resetMotion([e],function(e){return(t,i)=>e?{scalingCenterY:i.scaledValues.medianValue}:{scalingCenterX:i.scaledValues.medianValue}}(t)),Er.staticFromToMotion(this.id,"datums",this.ctx.animationManager,[e],i,n,{phase:"initial"})}isLabelEnabled(){return!1}updateDatumSelection(e){const t=e.nodeData??[];return $r(this.processedData)?e.datumSelection.update(t,void 0,(e=>Or(e.datumIndex))):e.datumSelection.update(t)}makeStylerParams(e,t,i){const{id:n}=this,{cornerRadius:s,cap:{lengthRatio:a},fill:o,fillOpacity:r,lineDash:l,lineDashOffset:h,stroke:c,strokeOpacity:d,strokeWidth:u,maxKey:p,maxName:g,medianKey:m,medianName:y,minKey:f,minName:x,q1Key:b,q1Name:v,q3Key:S,q3Name:M,whisker:{lineDash:k,lineDashOffset:D,stroke:w,strokeOpacity:I,strokeWidth:A},xKey:C,xName:N,yName:L}=this.properties;return{cap:{lengthRatio:a},cornerRadius:s,fill:o,fillOpacity:r,highlightState:Fr(e??Rr.None),selectionState:Vr(t),candidateState:Vr(i),lineDash:l,lineDashOffset:h,maxKey:p,maxName:g??p,medianKey:m,medianName:y??m,minKey:f,minName:x??f,q1Key:b,q1Name:v??b,q3Key:S,q3Name:M??S,seriesId:n,stroke:c,strokeOpacity:d,strokeWidth:u,whisker:{lineDash:k??l,lineDashOffset:D??h,stroke:w??c,strokeOpacity:I??d,strokeWidth:A??u},xKey:C,xName:N??C,yName:L}}getStyle(e,t,i,n){const{cap:s,cornerRadius:a,fill:o,fillOpacity:r,lineDash:l,lineDashOffset:h,stroke:c,strokeOpacity:d,strokeWidth:u,styler:p,whisker:g}=this.properties;let m={};if(!e&&p){const e=this.makeStylerParams(t,i,n);m=this.ctx.optionsGraphService.resolvePartial(["series",`${this.declarationOrder}`],this.cachedCallWithContext(p,e)??{},{pick:!1})??{}}return{cornerRadius:m.cornerRadius??a,fill:m.fill??o,fillOpacity:m.fillOpacity??r,lineDash:m.lineDash??l,lineDashOffset:m.lineDashOffset??h,opacity:1,stroke:m.stroke??c,strokeOpacity:m.strokeOpacity??d,strokeWidth:m.strokeWidth??u,cap:{lengthRatio:m.cap?.lengthRatio??s.lengthRatio},whisker:{lineDash:m.whisker?.lineDash??g.lineDash,lineDashOffset:m.whisker?.lineDashOffset??g.lineDashOffset,stroke:m.whisker?.stroke??g.stroke,strokeOpacity:m.whisker?.strokeOpacity??g.strokeOpacity,strokeWidth:m.whisker?.strokeWidth??g.strokeWidth}}}getItemStyle(e,t,i,s,a){const{properties:o}=this,{itemStyler:r}=o,l=this.getHighlightStyle(t,e,i),h=this.getSelectionStyle(e,s,a);
1let c=(0,n.HFk)(h,l,this.getStyle(void 0===e,i,s,a));if(null!=r&&null!=e){const i=this.cachedDatumCallback(Or(e,t?"highlight":"node"),(()=>{const i=this.makeItemStylerParams(e,t,c);return this.ctx.optionsGraphService.resolvePartial(["series",`${this.declarationOrder}`],this.callWithContext(r,i))}));i&&(c=(0,n.HFk)(i,c))}const{stroke:d,strokeWidth:u,strokeOpacity:p,lineDash:g,lineDashOffset:m}=c;return c.whisker=(0,n.HFk)(c.whisker,{stroke:d,strokeWidth:u,strokeOpacity:p,lineDash:g,lineDashOffset:m}),c}makeItemStylerParams(e,t,i){const{id:n}=this,{xKey:s,minKey:a,q1Key:o,medianKey:r,q3Key:l,maxKey:h}=this.properties,c=this.processedData?.dataSources.get(n)?.data[e],d=this.ctx.highlightManager?.getActiveHighlight(),u=this.getHighlightStateString(d,t,e),p=this.getSelectionStateString(e),g=this.getCandidateStateString(e),m=this.filterItemStylerFillParams(i.fill)??i.fill;return{seriesId:n,datum:c,xKey:s,minKey:a,q1Key:o,medianKey:r,q3Key:l,maxKey:h,highlightState:u,selectionState:p,candidateState:g,...i,fill:m}}updateDatumStyles({datumSelection:e,isHighlight:t}){const{itemStyler:i}=this.properties,n=this.ctx.highlightManager.getActiveHighlight();if(null!=i)e.each(((e,i)=>{const s=this.getHighlightState(n,t,i.datumIndex),a=this.getDataSelectionState(i.datumIndex),o=this.getDataCandidacyState(i.datumIndex);i.style=this.getItemStyle(i.datumIndex,t,s,a,o)}));else{const i=new Map,s=this;e.each((function(e,a){const o=s.getHighlightState(n,t,a.datumIndex),r=s.getDataSelectionState(a.datumIndex),l=s.getDataCandidacyState(a.datumIndex),h=`${o}:${r??"-"}:${l??"-"}`;let c=i.get(h);void 0===c&&(c=s.getItemStyle(a.datumIndex,t,o,r,l),i.set(h,c)),a.style=c}))}}updateDatumNodes({datumSelection:e,isHighlight:t}){const{contextNodeData:i,properties:n}=this;if(!i)return;const s=this.isVertical(),a=this.ctx.highlightManager.getActiveHighlight(),o=this.getShapeFillBBox(),r=this.getStyle(!1,Rr.None,void 0,void 0).strokeWidth/2,l=n.whisker.strokeWidth??n.strokeWidth;e.each(((e,n)=>{const h=n.style??i.styles[this.getHighlightState(a,t,n.datumIndex)];e.setFillProperties(h.fill,o);const c=h.opacity??1,d=h.whisker?.strokeOpacity??h.strokeOpacity;e.fill=h.fill,e.fillOpacity=h.fillOpacity*c,e.stroke=h.stroke,e.strokeWidth=h.strokeWidth,e.strokeOpacity=h.strokeOpacity*c,e.lineDash=h.lineDash,e.lineDashOffset=h.lineDashOffset,e.wickStroke=h.whisker.stroke,e.wickStrokeWidth=h.whisker.strokeWidth,e.wickStrokeOpacity=d*c,e.wickLineDash=h.whisker.lineDash,e.wickLineDashOffset=h.whisker.lineDashOffset,e.cornerRadius=h.cornerRadius,e.crisp=!0,e.horizontal=!s,e.center=n.scaledValues.xValue,e.thickness=n.bandwidth,e.min=n.scaledValues.minValue,e.q1=n.scaledValues.q1Value,e.median=n.scaledValues.medianValue,e.q3=n.scaledValues.q3Value,e.max=n.scaledValues.maxValue,e.capLengthRatio=h.cap.lengthRatio,e.strokeAlignment=r,e.wickStrokeAlignment=l}))}updateLabelNodes(){}updateLabelSelection(e){const{labelData:t,labelSelection:i}=e;return i.update(t)}nodeFactory(){return new yr}computeFocusBounds({datumIndex:e}){return Tr(this,this.contextNodeData?.nodeData[e].focusRect)}hasItemStylers(){return this.properties.selection.enabled||null!=this.properties.itemStyler||null!=this.properties.styler}};return e.className="BoxPlotSeries",e.type="box-plot",e})(),{boxPlotSeriesThemeableOptionsDef:Wr}=s.n1,_r=(()=>({...n.XxK,...Wr,type:(0,n.mw3)((0,n.dYl)("box-plot")),xKey:(0,n.mw3)(n.YjP),minKey:(0,n.mw3)(n.YjP),q1Key:(0,n.mw3)(n.YjP),medianKey:(0,n.mw3)(n.YjP),q3Key:(0,n.mw3)(n.YjP),maxKey:(0,n.mw3)(n.YjP),xKeyAxis:n.YjP,yKeyAxis:n.YjP,xName:n.YjP,yName:n.YjP,minName:n.YjP,q1Name:n.YjP,medianName:n.YjP,q3Name:n.YjP,maxName:n.YjP,grouped:n.zMY,legendItemName:n.YjP,segmentation:n.i_e,width:n.MX6,widthRatio:n.CGN}))(),Gr={series:{direction:"vertical",fill:{$applySwitch:[{$path:"type"},{$if:[{$or:[{$isGradient:{$palette:"fill"}},{$isPattern:{$palette:"fill"}},{$isImage:{$palette:"fill"}}]},{$palette:"fill"},{$mix:[n.alK,{$ref:"chartBackgroundColor"},.7]}]},["gradient",n.Euh],["image",n.pwE],["pattern",n.eu4]]},stroke:{$palette:"stroke"},strokeWidth:2,fillOpacity:1,strokeOpacity:1,lineDash:void 0,lineDashOffset:0,highlight:{enabled:{$path:["/highlight/enabled",!0]},unhighlightedItem:{opacity:.5},unhighlightedSeries:{opacity:.1}},selection:n.zg6,segmentation:n.IgM},axes:{[n.uCf.NUMBER]:{crosshair:{snap:!1}},[n.uCf.CATEGORY]:{groupPaddingInner:.2,crosshair:{enabled:!1,snap:!1}}}},{predictCartesianNonPrimitiveAxis:Kr}=s.n1,Yr={type:"series",name:"box-plot",chartType:"cartesian",enterprise:!0,groupable:!0,version:s.xv,depen
1dencies:[s.bI],options:_r,matchingKeys:["xKey","lowKey","q1Key","medianKey","q3Key","highKey","outlierKey","normalizedTo"],predictAxis:Kr,defaultAxes:n.QTQ,axisKeys:{[n.tv$.X]:"xKeyAxis",[n.tv$.Y]:"yKeyAxis"},axisKeysFlipped:{[n.tv$.X]:"yKeyAxis",[n.tv$.Y]:"xKeyAxis"},themeTemplate:Gr,create:e=>new jr(e)};function Ur(e,t,i,s,a,o,r,l){return(0,n.fq3)([s,a],e,t,i,{smallestKeyInterval:o,xNeedsValueOf:r,yNeedsValueOf:l})}var Xr=(0,n.XB6)(Ur);var{Path:Zr,BBox:qr}=s.n1,Qr=(()=>{var e=class extends Zr{constructor(){super(...arguments),this.centerX=0,this.y=0,this.width=0,this.height=0,this.yOpen=0,this.yClose=0,this.crisp=!1}setStaticProperties(e,t,i,n,s,a,o){this.__centerX=e,this.__width=t,this.__y=i,this.__height=n,this.__yOpen=s,this.__yClose=a,this.__crisp=o,this.dirtyPath=!0,this.markDirty()}computeBBox(){const{__centerX:e,__y:t,__width:i,__height:n}=this;return new qr(e-i/2,t,i,n)}isPointInPath(e,t){return this.getBBox().containsPoint(e,t)}distanceSquared(e,t){return this.getBBox().distanceSquared(e,t)}get midPoint(){return{x:this.__centerX,y:this.__y+this.__height/2}}alignedCoordinates(){const{__y:e,__width:t,__height:i,__crisp:n}=this;let{__centerX:s,__yOpen:a,__yClose:o}=this,r=s-t/2,l=s+t/2,h=e,c=e+i;if(n&&t>1){if(s=this.align(s),a<=o){const e=this.align(a,o-a);a=this.align(a),o=a+e}else{const e=this.align(o,a-o);o=this.align(o),a=o+e}const n=this.align(t/2);r=s-n,l=s+n,h=this.align(e),c=h+this.align(h,i)}return{centerX:s,x0:r,x1:l,y0:h,y1:c,yOpen:a,yClose:o}}executeStroke(e,t){const{__width:i,strokeWidth:n}=this;i<n&&(e.lineWidth=i),super.executeStroke(e,t)}};return l([(0,n.M7D)()],e.prototype,"centerX",2),l([(0,n.M7D)()],e.prototype,"y",2),l([(0,n.M7D)()],e.prototype,"width",2),l([(0,n.M7D)()],e.prototype,"height",2),l([(0,n.M7D)()],e.prototype,"yOpen",2),l([(0,n.M7D)()],e.prototype,"yClose",2),l([(0,n.M7D)()],e.prototype,"crisp",2),e})(),Jr=(()=>{var e=class extends Qr{constructor(){super(...arguments),this.strokeAlignment=0}updatePath(){const{path:e}=this,{centerX:t,x0:i,x1:n,y0:s,y1:a,yOpen:o,yClose:r}=this.alignedCoordinates(),l=this.layerManager?.canvas.pixelRatio??1,h=this.__strokeAlignment>0?l/this.__strokeAlignment/2%1:0;e.clear(),e.moveTo(t-h,s),e.lineTo(t-h,a),Math.abs(n-i)>1&&(e.moveTo(i,o-h),e.lineTo(t-h,o-h),e.moveTo(t-h,r-h),e.lineTo(n,r-h))}};return l([(0,n.M7D)()],e.prototype,"strokeAlignment",2),e})(),el=n.qbB,tl=n.BNK,il=n.jBM,nl=n.IXP,sl=n.kmN,{AggregationManager:al,fixNumericExtent:ol,keyProperty:rl,createDatumId:ll,SeriesNodePickMode:hl,SMALLEST_KEY_INTERVAL:cl,valueProperty:dl,diff:ul,animationValidation:pl,computeBarFocusBounds:gl,visibleRangeIndices:ml,BandScale:yl,processedDataIsAnimatable:fl,getItemStylesPerItemId:xl}=s.n1;var bl=class extends s.n1.AbstractBarSeries{constructor(e){super({moduleCtx:e,pickModes:[hl.AXIS_ALIGNED,hl.EXACT_SHAPE_MATCH],propertyKeys:{x:["xKey"],y:["lowKey","highKey","openKey","closeKey"]},propertyNames:{x:["xName"],y:["lowName","highName","openName","closeName"]},categoryKey:"xValue",pathsPerSeries:[]}),this.aggregationManager=new al}createNodeParams(e){return{...super.createNodeParams(e),xKey:this.properties.xKey,openKey:this.properties.openKey,closeKey:this.properties.closeKey,highKey:this.properties.highKey,lowKey:this.properties.lowKey}}async processData(e){if(!this.visible)return;const{xKey:t,openKey:i,closeKey:n,highKey:s,lowKey:a}=this.properties,o=!this.ctx.animationManager.isSkipped(),r=this.getCategoryAxis()?.scale,l=this.getValueAxis()?.scale,{isContinuousX:h,xScaleType:c,yScaleType:d}=this.getScaleInformation({xScale:r,yScale:l}),u=[];this.needsDataModelDiff()&&this.processedData&&u.push(ul(this.id,this.processedData)),o&&u.push(pl()),i&&u.push(dl(i,d,{id:"openValue",invalidValue:void 0,missingValue:void 0}));const p=this.properties.allowNullKeys??!1,{dataModel:g,processedData:m}=await this.requestDataModel(e,this.data,{props:[rl(t,c,{id:"xValue",allowNullKey:p}),dl(n,d,{id:"closeValue"}),dl(s,d,{id:"highValue"}),dl(a,d,{id:"lowValue"}),...h?[cl]:[],...u]});this.smallestDataInterval=m.reduced?.smallestKeyInterval,this.aggregateData(g,m),this.animationState.transition("updateData")}aggregateData(e,t){if(this.aggregationManager.markStale(t.input.count),"ungrouped"!==t.type)return;if(fl(t))return;const i=this.axes[n.tv$.X];if(null==i)return;const s=this.estimateTargetRange();this.aggregationManager.aggregate({computePartial:a=>function(e,t,i,s,a,o){const r=t.resolveKeysById(s,"xValue",i),l=t.resolve
1ColumnById(s,"highValue",i,"mixed-numeric"),h=t.resolveColumnById(s,"lowValue",i,"mixed-numeric"),c=t.getDomain(s,"xValue","key",i),d=t.resolveColumnNeedsValueOf(s,"xValue",i),u=t.resolveColumnNeedsValueOf(s,"highValue",i)??t.resolveColumnNeedsValueOf(s,"lowValue",i),{values:p,needsValueOf:g}=(0,n.QP0)(e,r,d),{xValues:m,domain:y}=(0,n.g3H)(e,p,c),f=u?l:(0,n.X_t)(l),x=u?h:(0,n.X_t)(h);return(0,n.EXR)(y,m,f,x,{smallestKeyInterval:i.reduced?.smallestKeyInterval,targetRange:a,xNeedsValueOf:g,yNeedsValueOf:u,existingFilters:o})}(i.scale.type,e,t,this,s,a),computeFull:s=>function(e,t,i,s,a){const o=t.resolveKeysById(s,"xValue",i),r=t.resolveColumnById(s,"highValue",i,"mixed-numeric"),l=t.resolveColumnById(s,"lowValue",i,"mixed-numeric"),h=t.getDomain(s,"xValue","key",i),c=t.resolveColumnNeedsValueOf(s,"xValue",i),d=t.resolveColumnNeedsValueOf(s,"highValue",i)??t.resolveColumnNeedsValueOf(s,"lowValue",i),{values:u,needsValueOf:p}=(0,n.QP0)(e,o,c),{xValues:g,domain:m}=(0,n.g3H)(e,u,h),y=d?r:(0,n.X_t)(r),f=d?l:(0,n.X_t)(l);return a?(0,n.fq3)(m,g,y,f,{smallestKeyInterval:i.reduced?.smallestKeyInterval,xNeedsValueOf:p,yNeedsValueOf:d,existingFilters:a}):Xr(g,y,f,m[0],m[1],i.reduced?.smallestKeyInterval,p,d)}(i.scale.type,e,t,this,s),targetRange:s});const a=this.aggregationManager.filters;a&&a.length>0&&n.Xjz.record(`${this.type}:aggregation`,a.map((e=>e.maxRange)))}estimateTargetRange(){const e=this.axes[n.tv$.X];if(!e)return-1;const[t,i]=e.scale.range;return Math.abs(i-t)}createBucketLookupFeature(){return new s.n1.BucketLookupManager({series:this,getXAxis:()=>this.axes[n.tv$.X],getDataModel:()=>this.dataModel,getProcessedData:()=>this.processedData,aggregationManager:this.aggregationManager,dataSelectionService:this.ctx.dataSelectionService,domainKey:"key"})}getSeriesDomain(e){const{processedData:t,dataModel:i}=this;if(!t||!i)return{domain:[]};if(e!==this.getBarDirection()){const{def:e}=i.resolveProcessedDataDefById(this,"xValue"),n=i.getDomain(this,"xValue","key",t);return"key"===e.type&&"category"===e.valueType?n:{domain:this.padBandExtent(n.domain)}}const n=this.domainForClippedRange(e,["highValue","lowValue"],"xValue");return{domain:ol(n)}}getSeriesRange(e,t){const[i,s]=this.domainForVisibleRange(n.tv$.Y,["highValue","lowValue"],"xValue",t);return[(0,n.Roz)(i),(0,n.Roz)(s)]}getZoomRangeFittingItems(e,t,i){return this.zoomFittingVisibleItems("xValue",["highValue","lowValue"],e,t,i)}getVisibleItems(e,t,i){return this.countVisibleItems("xValue",["highValue","lowValue"],e,t,i)}buildDatumContext(e,t){const{dataModel:i,processedData:n}=this;if(!i||!n)return;const s=n.dataSources.get(this.id)?.data??[];if(0===s.length)return;const a=e.scale,o=t.scale,r=yl.is(a),[l,h]=a.range,c=Math.abs(h-l);this.aggregationManager.ensureLevelForRange(c);const d=this.aggregationManager.getFilterForRange(c);this.ensureBucketLookupFeature()?.setActiveFilter(n,d);const u=null==d,p=null!=this.contextNodeData?.nodeData&&(null!=n.changeDescription||!fl(n)||null!=d),{groupOffset:g,barOffset:m,barWidth:y}=this.getBarDimensions();return{rawData:s,xValues:i.resolveKeysById(this,"xValue",n),openValues:i.resolveColumnById(this,"openValue",n,"mixed-numeric"),closeValues:i.resolveColumnById(this,"closeValue",n,"mixed-numeric"),highValues:i.resolveColumnById(this,"highValue",n,"mixed-numeric"),lowValues:i.resolveColumnById(this,"lowValue",n,"mixed-numeric"),xScale:a,yScale:o,xAxis:e,yAxis:t,groupOffset:g,barOffset:m,barWidth:y,applyWidthOffset:r,crisp:u,xKey:this.properties.xKey,openKey:this.properties.openKey,closeKey:this.properties.closeKey,highKey:this.properties.highKey,lowKey:this.properties.lowKey,dataAggregationFilter:d,range:c,nodeDatumStateScratch:{datum:void 0,xValue:void 0,openValue:0,closeValue:0,highValue:0,lowValue:0,isRising:!0,itemType:"up"},canIncrementallyUpdate:p,nodeIndex:0,nodeData:p?this.contextNodeData.nodeData:[]}}prepareOhlcNodeDatumState(e,t){const i=e.xValues[t];if(void 0===i&&!this.properties.allowNullKeys)return;const n=e.openValues[t],s=e.closeValues[t],a=e.highValues[t],o=e.lowValues[t],r=null!=a&&a>=n&&a>=s;if(!(null!=o&&o<=n&&o<=s))return void this.ctx.logger.warnOnce(`invalid low value for key [${e.lowKey}] in data element, low value cannot be higher than datum open or close values`);if(!r)return void this.ctx.logger.warnOnce(`invalid high value for key [${e.highKey}] in data element, high value cannot be lower than datum open or close values.`);const l=e.rawData[t],h=s>n,c=h?"up":"down",d=e.nodeDatumStateScratch;return d.datum=l,d.xValue=i,d.openValue=n,d.closeValue=s,d.highValue=a,d.lowValue=o,d.isRising=h,d.itemType=c,d}createSkeletonNodeDatum(e,t,i,n,s,a){const o=n+(e.applyWidthOffset?s/2:0),r=e.yScale.convert(t.openValue),l=e.yScale.convert(t.closeValue),h=e.yScale.convert(t.highValue),c=e.yScale.convert(t.lowValue),d=Math.min(h,c),u=Math.max(h,c)-d;return{series:this,itemType:t.itemType,datum:t.datum,datumIndex:i,xKey:e.xKey,xValue:t.xValue,openValue:t.openValue,closeValue:t.closeValue,highValue:t.highValue,lowValue:t.lowValue,midPoint:{x:o,y:d+u/2},aggregatedValue:t.closeValue,isRising:t.isRising,centerX:o,width:s,y:d,height:u,yOpen:r,yClose:l,crisp:a}}updateNodeDatum(e,t,i,n,s,a,o){const r=t,l=s+(e.applyWidthOffset?a/2:0),h=e.yScale.convert(i.openValue),c=e.yScale.convert(i.closeValue),d=e.yScale.convert(i.highValue),u=e.yScale.convert(i.lowValue),p=Math.min(d,u),g=Math.max(d,u)-p;r.datum=i.datum,r.datumIndex=n,r.itemType=i.itemType,r.xValue=i.xValue,r.openValue=i.openValue,r.closeValue=i.closeValue,r.highValue=i.highValue,r.lowValue=i.lowValue,r.aggregatedValue=i.closeValue,r.isRising=i.isRising,r.centerX=l,r.width=a,r.y=p,r.height=g,r.yOpen=h,r.yClose=c,r.crisp=o;const m=r.midPoint;m.x=l,m.y=p+g/2}
1upsertNodeDatum(e,t,i,n,s){const a=this.prepareOhlcNodeDatumState(e,t);if(!a)return;if(e.canIncrementallyUpdate&&e.nodeIndex<e.nodeData.length)this.updateNodeDatum(e,e.nodeData[e.nodeIndex],a,t,i,n,s);else{const o=this.createSkeletonNodeDatum(e,a,t,i,n,s);e.nodeData.push(o)}e.nodeIndex++}createNodeData(){const{visible:e}=this,t=this.getCategoryAxis(),i=this.getValueAxis();if(!t||!i)return;const n=this.buildDatumContext(t,i),s={itemId:this.properties.xKey,nodeData:n?.nodeData??[],labelData:[],scales:this.calculateScaling(),groupScale:this.getScaling(this.ctx.seriesStateManager.getGroupScale(this)),visible:this.visible,styles:xl(this.getItemStyle.bind(this),"up","down")};if(!e||!n)return s;const a=e=>{const t=n.xScale.convert(n.xValues[e]);return Number.isFinite(t)?t+n.groupOffset+(n.applyWidthOffset?n.barOffset:0):Number.NaN};if(null==n.dataAggregationFilter){const e=this.processedData.invalidData?.get(this.id);let[t,i]=ml(1,n.rawData.length,n.xAxis.range,(e=>{const t=n.applyWidthOffset?0:-n.barWidth/2,i=a(e)+t;return[i,i+n.barWidth]}));this.processedData.input.count<1e3&&(t=0,i=this.processedData.input.count);for(let s=t;s<i;s+=1){if(!0===e?.[s])continue;const t=a(s);this.upsertNodeDatum(n,s,t,n.barWidth,n.crisp)}n.canIncrementallyUpdate&&n.nodeIndex<n.nodeData.length&&(n.nodeData.length=n.nodeIndex)}else{const{maxRange:e,indexData:t,midpointIndices:i}=n.dataAggregationFilter,[s,o]=ml(1,e,n.xAxis.range,(e=>{const s=t[e*sl+nl],o=i[e];if(-1===o)return;const r=n.applyWidthOffset?0:-n.barWidth/2;return[a(o)+r,a(s)+r+n.barWidth]}));for(let e=s;e<o;e+=1){const s=e*sl,o=t[s+el],r=t[s+nl],l=t[s+tl],h=t[s+il],c=i[e];if(-1===c)continue;const d=this.prepareOhlcNodeDatumState(n,c);if(!d)continue;d.openValue=n.openValues[o],d.closeValue=n.closeValues[r],d.highValue=n.highValues[l],d.lowValue=n.lowValues[h],d.isRising=d.closeValue>d.openValue,d.itemType=d.isRising?"up":"down";const u=a(c),p=Math.abs(a(r)-a(o))+n.barWidth;if(n.canIncrementallyUpdate&&n.nodeIndex<n.nodeData.length)this.updateNodeDatum(n,n.nodeData[n.nodeIndex],d,c,u,p,!1);else{const e=this.createSkeletonNodeDatum(n,d,c,u,p,!1);n.nodeData.push(e)}n.nodeIndex++}n.canIncrementallyUpdate&&n.nodeIndex<n.nodeData.length&&(n.nodeData.length=n.nodeIndex)}return s}isVertical(){return!0}isLabelEnabled(){return!1}resetDatumAnimation(e){!function(e){for(const t of e){const e=t.nodes();t.batchedUpdate((function(){for(const t of e){const e=t.datum;null!=e&&t.setStaticProperties(e.centerX,e.width,e.y,e.height,e.yOpen,e.yClose,e.crisp)}t.cleanup()}))}}([e.datumSelection])}updateDatumSelection(e){const t=e.nodeData??[];return fl(this.processedData)?e.datumSelection.update(t,void 0,(e=>ll(e.xValue))):e.datumSelection.update(t)}updateLabelNodes(e){}updateLabelSelection(e){const{labelData:t,labelSelection:i}=e;return i.update(t)}getItemStyle(e,t,i,s="up"){const{properties:a,dataModel:o,processedData:r}=this,{itemStyler:l}=a,h=this.getHighlightStyle(t,e,i),c=this.getSelectionStyle(e);let d=(0,n.HFk)(c,h,a.getStyle(s));if(l&&null!=o&&null!=r&&null!=e){const i=o.resolveKeysById(this,"xValue",r)[e],a=this.cachedDatumCallback(ll(ll(i),t?"highlight":"node"),(()=>{const i=this.makeItemStylerParams(s,e,t,d);return this.ctx.optionsGraphService.resolvePartial(["series",`${this.declarationOrder}`,"item",s],this.callWithContext(l,i))}));a&&(d=(0,n.HFk)(a,d))}return d}makeItemStylerParams(e,t,i,n){const{id:s,properties:a,processedData:o}=this,{xKey:r,openKey:l,closeKey:h,highKey:c,lowKey:d}=a,u=o.dataSources.get(s)?.data[t],p=this.ctx.highlightManager?.getActiveHighlight(),g={seriesId:s,datum:u,itemType:e,xKey:r,openKey:l,closeKey:h,highKey:c,lowKey:d,highlightState:this.getHighlightStateString(p,i,t),selectionState:this.getSelectionStateString(t),candidateState:this.getCandidateStateString(t),...n};return"fill"in g&&"fill"in n&&(g.fill=this.filterItemStylerFillParams(n.fill)??n.fill),g}getTooltipContent(e){const{id:t,dataModel:i,processedData:n,properties:a}=this,{xKey:o,xName:r,yName:l,openKey:h,openName:c,highKey:d,highName:u,lowKey:p,lowName:g,closeKey:m,closeName:y,legendItemName:f,tooltip:x}=a,b=this.getCategoryAxis(),v=this.getValueAxis();if(!(i&&n&&b&&v))return;
1const S=n.dataSources.get(this.id)?.data[e],M=i.resolveKeysById(this,"xValue",n)[e],k=i.resolveColumnById(this,"openValue",n,"mixed-numeric")[e],D=i.resolveColumnById(this,"highValue",n,"mixed-numeric")[e],w=i.resolveColumnById(this,"lowValue",n,"mixed-numeric")[e],I=i.resolveColumnById(this,"closeValue",n,"mixed-numeric")[e],A=this.properties.allowNullKeys??!1;if(void 0===M&&!A)return;const C=I>=k?"up":"down",N=this.properties.item[C],L=this.getItemStyle(e,!1),P={fill:N.fill??N.stroke,fillOpacity:N.fillOpacity??N.strokeOpacity??1,stroke:N.stroke,strokeWidth:N.strokeWidth??1,strokeOpacity:N.strokeOpacity??1,lineDash:N.lineDash??[0],lineDashOffset:N.lineDashOffset??0};return this.formatTooltipWithContext(x,{heading:this.getAxisValueText(b,"tooltip",M,S,o,f),title:f,symbol:{marker:P},data:[{label:c,fallbackLabel:h,value:this.getAxisValueText(v,"tooltip",k,S,h,f),missing:s.n1.isTooltipValueMissing(k)},{label:u,fallbackLabel:d,value:this.getAxisValueText(v,"tooltip",D,S,d,f),missing:s.n1.isTooltipValueMissing(D)},{label:g,fallbackLabel:p,value:this.getAxisValueText(v,"tooltip",w,S,p,f),missing:s.n1.isTooltipValueMissing(w)},{label:y,fallbackLabel:m,value:this.getAxisValueText(v,"tooltip",I,S,m,f),missing:s.n1.isTooltipValueMissing(I)}]},{seriesId:t,datum:S,title:l,itemType:C,xKey:o,xName:r,yName:l,openKey:h,openName:c,highKey:d,highName:u,lowKey:p,lowName:g,closeKey:m,closeName:y,...L})}computeFocusBounds(e){const t=this.getNodeData()?.at(e.datumIndex);if(null==t)return;const{centerX:i,y:n,width:s,height:a}=t;return gl(this,{x:i-s/2,y:n,width:s,height:a})}},{ExtendedPath2D:vl,BBox:Sl}=s.n1,Ml=(()=>{var e=class extends Qr{constructor(){super(...arguments),this.wickPath=new vl,this.wickStroke=void 0,this.wickStrokeWidth=void 0,this.wickStrokeOpacity=void 0,this.wickStrokeAlignment=0}setWickProperties(e,t,i,n,s){this.__wickStroke=e,this.__wickStrokeWidth=t,this.__wickStrokeOpacity=i,this.wickLineDash=n,this.__wickLineDashOffset=s,this.dirtyPath=!0,this.markDirty()}computeDefaultGradientFillBBox(){const{__width:e,__centerX:t,__yOpen:i,__yClose:n}=this,s=Math.min(i,n),a=Math.max(i,n),o=t-e/2;return new Sl(o,s,t+e/2-o,a-s)}updatePath(){const{path:e,stroke:t,strokeWidth:i,strokeOpacity:n,lineDash:s,lineDashOffset:a,__wickStroke:o,__wickStrokeWidth:r,__wickStrokeOpacity:l,wickLineDash:h,__wickLineDashOffset:c}=this,{centerX:d,x0:u,x1:p,y0:g,y1:m,yOpen:y,yClose:f}=this.alignedCoordinates(),x=this.layerManager?.canvas.pixelRatio??1,b=this.__wickStrokeAlignment>0?x/this.__wickStrokeAlignment/2%1:0;this.path.clear(),this.wickPath.clear();const v=null!=o&&o!==t||null!=r&&r!==i||null!=l&&l!==n||null!=h&&h!==s||null!=c&&c!==a?this.wickPath:e;if(Math.abs(p-u)<=3)return v.moveTo(d-b,g),void v.lineTo(d-b,m);const S=Math.min(y,f),M=Math.max(y,f),k=i/2;v.moveTo(d-b,g),v.lineTo(d-b,S+k),v.moveTo(d-b,m),v.lineTo(d-b,M-k);const D=M-S-2*k;if(D>0)e.rect(u+k,S+k,p-u-2*k,D);else{const t=(S+M)/2;e.moveTo(u,t),e.lineTo(p,t)}}drawPath(e,t){super.drawPath(e,t);const{wickPath:i}=this;if(i.isEmpty())return;const{stroke:n,strokeWidth:s,strokeOpacity:a,lineDash:o,lineDashOffset:r,__wickStroke:l=n,__wickStrokeWidth:h=s,__wickStrokeOpacity:c=a,wickLineDash:d=o,__wickLineDashOffset:u=r}=this;0!==h&&(e.globalAlpha*=c,"string"==typeof l&&(e.strokeStyle=l),e.lineWidth=h,null!=d&&e.setLineDash([...d]),e.lineDashOffset=u,e.stroke(i.getPath2D()))}};return l([(0,n.M7D)()],e.prototype,"wickStroke",2),l([(0,n.M7D)()],e.prototype,"wickStrokeWidth",2),l([(0,n.M7D)()],e.prototype,"wickStrokeOpacity",2),l([(0,n.Haz)()],e.prototype,"wickLineDash",2),l([(0,n.M7D)()],e.prototype,"wickLineDashOffset",2),l([(0,n.M7D)()],e.prototype,"wickStrokeAlignment",2),e})(),{AbstractBarSeriesProperties:kl,makeSeriesTooltip:Dl}=s.n1,wl=(()=>{var e=class extends n.XPE{constructor(){super(...arguments),this.stroke="#333",this.strokeWidth=1,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0}};return l([n.mAP],e.prototype,"stroke",2),l([n.mAP],e.prototype,"strokeWidth",2),l([n.mAP],e.prototype,"strokeOpacity",2),l([n.mAP],e.prototype,"lineDash",2),l([n.mAP],e.prototype,"lineDashOffset",2),e})(),Il=(()=>{var e=class extends n.XPE{constructor(){super(...arguments),this.up=new wl,this.down=new wl}};return l([n.mAP],e.prototype,"up",2),l([n.mAP],e.prototype,"down",2),e})(),Al=(()=>{var e=class extends kl{};return l([n.mAP],e.prototype,"xKey",2),l([n.mAP],e.prototype,"openKey",2),l([n.mAP],e.prototype,"closeKey",2),l([n.mAP],e.prototype,"highKey",2),l([n.mAP],e.prototype,"lowKey",2),l([n.mAP],e.prototype,"xName",2),l([n.mAP],e.prototype,"yName",2),l([n.mAP],e.prototype,"openName",2),l([n.mAP],e.prototype,"closeName",2),l([n.mAP],e.prototype,"highName",2),l([n.mAP],e.prototype,"lowName",2),e})(),Cl=(()=>{var e=class extends Al{constructor(){super(...arguments),this.tooltip=Dl(),this.item=new Il}getStyle(e){const{strokeWidth:t,strokeOpacity:i,stroke:n,lineDash:s,lineDashOffset:a}=this.item[e];return{stroke:n,strokeWidth:t,strokeOpacity:i,lineDash:s,lineDashOffset:a,opacity:1}}};return l([n.mAP],e.prototype,"tooltip",2),l([n.mAP],e.prototype,"item",2),l([n.mAP],e.prototype,"itemStyler",2),e})(),{makeSeriesTooltip:Nl}=s.n1,Ll=(()=>{var e=class extends n.XPE{};return l([n.mAP],e.prototype,"stroke",2),l([n.mAP],e.prototype,"strokeWidth",2),l([n.mAP],e.prototype,"strokeOpacity",2),l([n.mAP],e.prototype,"lineDash",2),l([n.mAP],e.prototype,"lineDashOffset",2),e})(),Pl=(()=>{var e=class extends n.XPE{constructor(){super(...arguments),this.fill="#c16068",this.fillOpacity=1,this.stroke="#333",this.strokeWidth=1,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.cornerRadius=0,this.wick=new Ll}};return l([n.mAP],e.prototype,"fill",2),l([n.mAP],e.prototype,"fillOpacity",2),l([n.mAP],e.prototype,"stroke",2),l([n.mAP],e.prototype,"strokeWidth",2),l([n.mAP],e.prototype,"strokeOpacity",2),l([n.mAP],e.prototype,"lineDash",2),l([n.mAP],e.prototype,"lineDashOffset",2),l([n.mAP],e.prototype,"cornerRadius",2),l([n.mAP],e.prototype,"wick",2),e})(),Tl=(()=>{var e=class extends n.XPE{constructor(){super(...arguments),this.up=new Pl,this.down=new Pl}};return l([n.mAP],e.prototype,"up",2),l([n.mAP],e.prototype,"down",2),e})(),Ol=(()=>{var e=class extends Al{constructor(){super(...arguments),this.item=new Tl,this.tooltip=Nl()}getStyle(e){const{fill:t,fillOpacity:i,strokeWidth:n,strokeOpacity:s,stroke:a,lineDash:o,lineDashOffset:r,cornerRadius:l,wick:h}=this.item[e];return{fill:t,fillOpacity:i,stroke:a,strokeWidth:n,strokeOpacity:s,lineDash:o,lineDashOffset:r,cornerRadius:l,opacity:1,wick:h}}};return l([n.mAP],e.prototype,"item",2),l([n.mAP],e.prototype,"tooltip",2),l([n.mAP],e.prototype,"itemStyler",2),e})(),Rl=(()=>{var e=class extends bl{constructor(){super(...arguments),this.properties=new Ol}nodeFactory(){const e=new Ml;return e.lineCap="butt",e}updateDatumStyles({datumSelection:e,isHighlight:t}){e.each(((e,i)=>{i.style=this.getItemStyle(i.datumIndex,t,void 0,i.itemType)}))}updateDatumNodes({datumSelection:e,isHighlight:t}){const{contextNodeData:i,properties:n}=this;if(!i)return;const s=this.ctx.highlightManager.getActiveHighlight(),{up:a,down:o}=n.item,r=this.getShapeFillBBox(),l=this;e.each((function(e,n){const{centerX:h,width:c,y:d,height:u,yOpen:p,yClose:g,crisp:m}=n,y=n.isRising?a:o,f=l.getHighlightState(s,t,n.datumIndex),x=n.style??i.styles[n.itemType][f];e.setStaticProperties(h,c,d,u,p,g,m),e.setStyleProperties(x,r);const b=x?.wick;e.setWickProperties(b?.stroke,b?.strokeWidth,b?.strokeOpacity,b?.lineDash,b?.lineDashOffset),e.wickStrokeAlignment=y.wick.strokeWidth??y.strokeWidth}))}legendItemSymbol(){const{up:e,down:t}=this.properties.item,i={type:"gradient",gradient:"linear",rotation:90,colorStops:[...(0,n.MBc)(e.fill)?e.fill.colorStops.map((e=>"string"==typeof e?e:{color:e.color,stop:null==e.stop?void 0:.5*e.stop})):[{color:(0,n.EDy)(e.fill)||(0,n.BF9)(e.fill)?e.stroke:e.fill,stop:0},{color:(0,n.EDy)(e.fill)||(0,n.BF9)(e.fill)?e.stroke:e.fill,stop:.5}],...(0,n.MBc)(t.fill)?t.fill.colorStops.map((e=>"string"==typeof e?e:{color:e.color,stop:null==e.stop?void 0:.5*e.stop})):[{color:(0,n.EDy)(t.fill)||(0,n.BF9)(t.fill)?t.stroke:t.fill,stop:.5}]],reverse:!1},s={type:"gradient",gradient:"linear",rotation:90,colorStops:[{color:e.stroke,stop:0},{color:e.stroke,stop:.5},{color:t.stroke,stop:.5}],reverse:!1};return{marker:{fill:i,fillOpacity:e.fillOpacity,stroke:s,strokeWidth:e.strokeWidth??1,strokeOpacity:e.strokeOpacity??1,lineDash:e.lineDash,lineDashOffset:e.lineDashOffset}}}getLegendData(e){const{id:t,data:i,visible:n,ctx:{legendManager:s}}=this,{xKey:a,yName:o,showInLegend:r,legendItemName:l}=this.properties;
1return i?.data.length&&a&&"category"===e?[{legendType:"category",id:t,itemId:t,seriesId:t,enabled:n&&(s?.getItemEnabled({seriesId:t,itemId:t})??!0),label:{text:l??o??t},symbol:this.legendItemSymbol(),legendItemName:l,hideInLegend:!r}]:[]}hasItemStylers(){return this.properties.selection.enabled||null!=this.properties.itemStyler}};return e.className="CandleStickSeries",e.type="candlestick",e})(),{candlestickSeriesThemeableOptionsDef:El}=s.n1,zl=(()=>({...n.XxK,...El,type:(0,n.mw3)((0,n.dYl)("candlestick")),xKey:(0,n.mw3)(n.YjP),openKey:(0,n.mw3)(n.YjP),highKey:(0,n.mw3)(n.YjP),lowKey:(0,n.mw3)(n.YjP),closeKey:(0,n.mw3)(n.YjP),xName:n.YjP,yName:n.YjP,openName:n.YjP,highName:n.YjP,lowName:n.YjP,closeName:n.YjP,xKeyAxis:n.YjP,yKeyAxis:n.YjP}))();function Bl(e){return{fill:{$applySwitch:[{$path:"type"},{$if:[{$eq:[{$palette:"type"},"user-indexed"]},"up"===e?"transparent":{$palette:"fill"},{$palette:`${e}.fill`}]},["gradient",(0,n.Rs9)(e)],["image",n.pwE],["pattern",(0,n.$8e)(e)]]},stroke:{$if:[{$eq:[{$palette:"type"},"user-indexed"]},{$palette:"stroke"},{$palette:`${e}.stroke`}]}}}zl.pickOutsideVisibleMinorAxis=(0,n._Le)(n.zMY),zl.focusPriority=(0,n._Le)(n.aig);var Fl=(()=>({series:{item:{up:Bl("up"),down:Bl("down")},tooltip:{range:{$path:["/tooltip/range","nearest"]}},highlight:n.fil,selection:n.zg6},animation:{enabled:!1},axes:{[n.uCf.NUMBER]:{crosshair:{snap:!1}},[n.uCf.ORDINAL_TIME]:{groupPaddingInner:0,crosshair:{enabled:!0}}}}))(),{predictCartesianFinancialAxis:Vl}=s.n1,$l={type:"series",name:"candlestick",chartType:"cartesian",enterprise:!0,groupable:!1,version:s.xv,dependencies:[s.bI],options:zl,matchingKeys:["xKey","lowKey","highKey","openKey","closeKey","normalizedTo"],predictAxis:Vl,defaultAxes:{y:{type:n.uCf.NUMBER,position:n.v9C.LEFT},x:{type:n.uCf.ORDINAL_TIME,position:n.v9C.BOTTOM}},axisKeys:{[n.tv$.X]:"xKeyAxis",[n.tv$.Y]:"yKeyAxis"},themeTemplate:Fl,create:e=>new Rl(e)};function Hl(e,t,i,s,{padding:a},o){const{spacing:r=0}=t,l=2*a,h=2*a+r,c=function(e,t){const{fontSize:i}=e,{fontSize:s}=t,a=(0,n.bJZ)(e.minimumFontSize,i),o=(0,n.bJZ)(t.minimumFontSize,s),r=i-a,l=s-o;let h=e.fontSize,c=t.fontSize;const d=[{labelFontSize:i,secondaryLabelFontSize:s}];for(;h>a||c>o;)(r>0?(h-a)/r:-1)>(l>0?(c-o)/l:-1)?h=Math.max(a,h-1):c=Math.max(o,c-1),d.push({labelFontSize:h,secondaryLabelFontSize:c});return d.reverse(),d}(t,s),d=c[0],u=d.labelFontSize+d.secondaryLabelFontSize;if(u>o(u+h,!1).height-h)return;const p={fontFamily:t.fontFamily,fontStyle:t.fontStyle,fontWeight:t.fontWeight},g={fontFamily:s.fontFamily,fontStyle:s.fontStyle,fontWeight:s.fontWeight};let m,y;return(0,n.bCV)(c.length,(a=>{const{labelFontSize:d,secondaryLabelFontSize:u}=c[a],f=0===a,x={...p,fontSize:d},b={...g,fontSize:u},v=(0,n.K$y)(x).lineHeight(),S=(0,n.K$y)(b).lineHeight(),M=o(v+S+h,f),k=M.width-l,D=M.height-h;if(v+S>D)return;if(m?.fontSize!==d&&(m=Ul(t,e,k,D,x,t.wrapping,f?t.overflowStrategy:"hide")),null==m||m.width>k||m.height>D)return;if(y?.fontSize!==u&&(y=Ul(s,i,k,D,b,s.wrapping,f?s.overflowStrategy:"hide")),null==y)return;const w=m.height+y.height;return y.width>k||w>D?void 0:{width:Math.max(m.width,y.width),height:w+r,meta:M.meta,label:m,secondaryLabel:y}}))}function jl(e,t,{padding:i},s){const a=2*i,o=(0,n.bJZ)(t.minimumFontSize,t.fontSize),r={fontFamily:t.fontFamily,fontStyle:t.fontStyle,fontWeight:t.fontWeight};return(0,n.lIG)(o,t.fontSize,((i,o)=>{const l={...r,fontSize:i},h=(0,n.K$y)(l),c=t.lineHeight??h.lineHeight(),d=s(c+a,o),u=d.width-a,p=d.height-a;if(c>p||u<0)return;const g=(0,n.MTZ)(e,{maxWidth:u,maxHeight:p,font:l,textWrap:t.wrapping,overflow:(o?t.overflowStrategy:null)??"hide"});if(!g.length)return;const{width:m,height:y}=h.measureLines(g);return[{width:m,height:y,text:g.join("\n"),fontSize:i,lineHeight:c},d.meta]}))}function Wl(e,t,i,s){return(0,n.cyL)(e)?function(e,t,{padding:i},s){const a=2*i,o=_l(t),r=(0,n.K$y)(o),l=t.lineHeight??r.lineHeight(),h=s((0,n.wEO)(e,o).height+a,!0),c=h.width-a,d=h.height-a;if(c<=0||d<=0)return;const u=(0,n.kNh)(e,{maxWidth:c,maxHeight:d,font:o,textWrap:t.wrapping,overflow:t.overflowStrategy??"hide"});if(!u.length)return;const{width:p,height:g}=(0,n.wEO)(u,o);return[{width:p,height:g,text:u,fontSize:o.fontSize,lineHeight:l},h.meta]}(e,t,i,s):jl(String(e),t,i,s)}function _l(e){return{fontFamily:e.fontFamily,fontStyle:e.fontStyle,fontWeight:e.fontWeight,fontSize:e.fontSize}}function Gl(e,t,i,n){return()=>({width:e,height:t+2*i,meta:n})}function Kl(e,t){return(0,n.cyL)(e)?(0,n.wEO)(e,t).height:(0,n.K$y)(t).lineHeight()}function Yl(e,t,i,s,a,o){const r=t.enabled?e:void 0,l=s.enabled?i:void 0;let h;const c=(0,n.cyL)(r),d=(0,n.cyL)(l);let u,p;if(null!=r&&null!=l&&(h=c||d?function(e,t,i,n,s,a){const{padding:o}=s,{spacing:r=0}=t,l=2*o,h=2*o+r,c=_l(t),d=_l(n),u=Kl(e,c),p=Kl(i,d),g=a(u+p+h,!0),m=g.width-l,y=g.height-h;if(m<=0||y<=0)return;const f=e=>({width:e.width,height:e.height,meta:g.meta,label:e,secondaryLabel:void 0}),x=Math.min(u,Math.max(0,y-p)),b=x>0?x:y,v=Wl(e,t,s,Gl(g.width,b,o,g.meta));if(null==v)return;const[S]=v,M=y-S.height;if(M<=0)return f(S);const k=Wl(i,n,s,Gl(g.width,M,o,g.meta));if(null==k)return f(S);const[D]=k;return{width:Math.max(S.width,D.width),height:S.height+D.height+r,meta:g.meta,label:S,secondaryLabel:D}}(r,t,l,s,a,o):Hl(String(r),t,String(l),s,a,o)),null==h&&null!=r&&(u=Wl(r,t,a,o)),null!=u){const[e,t]=u;h={width:e.width,height:e.height,meta:t,label:e,secondaryLabel:void 0}}if(null==h&&null==r&&null!=l&&(p=Wl(l,s,a,o)),null!=p){const[e,t]=p;h={width:e.width,height:e.height,meta:t,label:void 0,secondaryLabel:e}}return h}function Ul(e,t,i,s,a,o,r){const l=(0,n.MTZ)(t,{maxWidth:i,maxHeight:s,font:a,textWrap:o,overflow:r});if(!l.length)return;const h=(0,n.K$y)(a),c=e.lineHeight??h.lineHeight(),{width:d}=h.measureLines(l);return{width:d,lineHeight:c,text:l.join("\n"),height:l.length*c,fontSize:a.fontSize}}var Xl=(()=>{var e=class extends s.n1.Label{constructor(){super(...arguments),this.wrapping="on-space",this.overflowStrategy="ellipsis"}};return l([n.mAP],e.prototype,"wrapping",2),l([n.mAP],e.prototype,"overflowStrategy",2),l([n.mAP],e.prototype,"lineHeight",2),l([n.mAP],e.prototype,"minimumFontSize",2),e})(),Zl=(()=>{var e=class extends Xl{constructor(){super(...arguments),this.spacing=0}};return l([n.mAP],e.prototype,"spacing",2),e})(),ql=class extends Xl{},{CartesianSeriesProperties:Ql,ColorScaleProperties:Jl,makeSeriesTooltip:eh}=s.n1,th=(()=>{var e=class extends Zl{constructor(){super(...arguments),this.textAlign="center",this.verticalAlign="middle"}};return l([n.mAP],e.prototype,"textAlign",2),l([n.mAP],e.prototype,"verticalAlign",2),e})(),ih=(()=>{var e=class extends Ql{constructor(){super(...arguments),this.colorScale=new Jl,this.stroke="black",this.strokeOpacity=1,this.strokeWidth=0,this.itemPadding=0,this.cornerRadius=0,this.label=new th,this.tooltip=eh()}};return l([n.mAP],e.prototype,"title",2),l([n.mAP],e.prototype,"xKey",2),l([n.mAP],e.prototype,"yKey",2),l([n.mAP],e.prototype,"colorKey",2),l([n.mAP],e.prototype,"xName",2),l([n.mAP],e.prototype,"yName",2),l([n.mAP],e.prototype,"colorName",2),l([n.mAP],e.prototype,"colorScale",2),l([n.mAP],e.prototype,"stroke",2),l([n.mAP],e.prototype,"strokeOpacity",2),l([n.mAP],e.prototype,"strokeWidth",2),l([n.mAP,(0,n.s8C)("label","textAlign")],e.prototype,"textAlign",2),l([n.mAP,(0,n.s8C)("label","verticalAlign")],e.prototype,"verticalAlign",2),l([n.mAP],e.prototype,"itemPadding",2),l([n.mAP],e.prototype,"cornerRadius",2),l([n.mAP],e.prototype,"itemStyler",2),l([n.mAP],e.prototype,"label",2),l([n.mAP],e.prototype,"tooltip",2),e}
1)(),{SeriesNodePickMode:nh,computeBarFocusBounds:sh,buildColorCategoryLegendData:ah,buildGradientLegendDatum:oh,colorScaleLegendFormatterContext:rh,configureColorScale:lh,getMissCount:hh,valueProperty:ch,DEFAULT_CARTESIAN_DIRECTION_KEYS:dh,DEFAULT_CARTESIAN_DIRECTION_NAMES:uh,createDatumId:ph,ColorScale:gh,Rect:mh,PointerEvents:yh,addHitTestersToQuadtree:fh,findQuadtreeMatch:xh,getLabelStyles:bh,updateLabelNode:vh,upsertNodeDatum:Sh}=s.n1,Mh={left:-.5,center:0,right:.5},kh={top:-.5,middle:0,bottom:.5},Dh=["left","center","right","start","end"],wh=["top","middle","bottom"],Ih=(()=>{var e=class extends s.n1.CartesianSeries{constructor(e){super({moduleCtx:e,propertyKeys:{...dh,color:["colorKey"]},propertyNames:{...uh,color:["colorName"]},categoryKey:void 0,pickModes:[nh.NEAREST_NODE,nh.EXACT_SHAPE_MATCH],pathsPerSeries:[]}),this.properties=new ih,this.colorScale=new gh}createNodeParams(e){return{...super.createNodeParams(e),xKey:this.properties.xKey,yKey:this.properties.yKey,colorKey:this.properties.colorKey}}async processData(e){const t=this.axes[n.tv$.X],i=this.axes[n.tv$.Y];if(!t||!i)return;const{xKey:s,yKey:a,colorKey:o}=this.properties,r=this.axes[n.tv$.X]?.scale,l=this.axes[n.tv$.Y]?.scale,{xScaleType:h,yScaleType:c}=this.getScaleInformation({xScale:r,yScale:l}),d=this.colorScale.type,u=this.properties.allowNullKeys??!1,{dataModel:p,processedData:g}=await this.requestDataModel(e,this.data,{props:[ch(s,h,{id:"xValue",allowNullKey:u}),ch(a,c,{id:"yValue",allowNullKey:u}),...o?[ch(o,d,{id:"colorValue",invalidValue:void 0})]:[]]});if(this.isColorScaleValid()){const e=p.resolveProcessedDataIndexById(this,"colorValue"),t=g.domain.values[e].filter((e=>null!=e)),i=(0,n.Xxv)(t);if(null!=i){const e=this.properties.colorScale;if(i[0]===i[1]&&e.fills.length>0){const t=Math.floor(e.fills.length/2),n=e.fills[t];lh(this.colorScale,{fills:[n,n],domain:e.domain,mode:e.mode},i,this.ctx.logger)}else lh(this.colorScale,e,i,this.ctx.logger)}}}isColorScaleValid(){const{colorKey:e}=this.properties;if(!e)return!1;const{dataModel:t,processedData:i}=this;if(!t||!i)return!1;const n=t.resolveProcessedDataIndexById(this,"colorValue"),s=i.input.count,a=hh(this,i.defs.values[n].missing),o=t.resolveProcessedDataIndexById(this,"colorValue"),r=i.domain.values[o].filter((e=>null!=e)).length;return!(0===s||s===a||0===r)}xCoordinateRange(e,t){const i=this.axes[n.tv$.X].scale,s=t*(i.bandwidth??0)/2,a=i.convert(e)+s;return[a,a+t*(i.bandwidth??10)]}yCoordinateRange(e,t){const i=this.axes[n.tv$.Y].scale,s=t*(i.bandwidth??0)/2,a=i.convert(e[0])+s;return[a,a+t*(i.bandwidth??10)]}getSeriesDomain(e){const{dataModel:t,processedData:i}=this;if(!t||!i)return{domain:[]};if(e===n.tv$.X){return{domain:t.getDomain(this,"xValue","value",i).domain}}return{domain:t.getDomain(this,"yValue","value",i).domain}}getSeriesRange(){return[Number.NaN,Number.NaN]}validateCreateNodeDataPreconditions(){const e=super.validateCreateNodeDataPreconditions();if(!e)return;const{xAxis:t,yAxis:i}=e,s=["category","grouped-category"];if(s.includes(t.type)&&s.includes(i.type))return e;this.ctx.logger.warnOnce(`Heatmap series expected axes to have ${(0,n.lp6)(s,"or",JSON.stringify)} type, but received "${t.type}" and "${i.type}" instead.`)}populateNodeData(e){for(const[t,i]of e.rawData.entries()){const n=Sh(e,{datumIndex:t,datum:i},((e,t)=>this.createNodeDatum(e,t.datumIndex,t.datum)),((e,t,i)=>this.updateNodeDatum(e,t,i.datumIndex,i.datum)));if(n){const s=this.createLabelDatum(e,t,i,n);s&&e.labels.push(s)}}}initializeResult(e){return{itemId:this.properties.yKey??this.id,nodeData:e.nodes,labelData:e.labels,scales:this.calculateScaling(),visible:this.visible}}createNodeDatumContext(e,t){const{dataModel:i,processedData:s,contextNodeData:a}=this;if(!i||!s)return;const{xKey:o,xName:r,yKey:l,yName:h,colorKey:c,colorName:d,itemPadding:u}=this.properties,{textAlign:p,verticalAlign:g}=this.properties.label,m=e.scale,y=t.scale,f=i.resolveColumnById(this,"xValue",s,"object"),x=i.resolveColumnById(this,"yValue",s,"object"),b=c?i.resolveColumnById(this,"colorValue",s,"number"):void 0,v=c?i.getDomain(this,"colorValue","value",s).domain:[],S=m.bandwidth??10,M=y.bandwidth??10,k=s.dataSources.get(this.id
1)?.data??[],D=null!=a?.nodeData&&null!=s.changeDescription;return{xAxis:e,yAxis:t,xScale:m,yScale:y,rawData:k,xValues:f,xKey:o,yKey:l,xName:r,yName:h,animationEnabled:!this.ctx.animationManager.isSkipped(),canIncrementallyUpdate:D,nodes:D?a.nodeData:[],nodeIndex:0,xOffset:(m.bandwidth??0)/2,yOffset:(y.bandwidth??0)/2,width:S,height:M,textAlignFactor:Mh[(0,n.vDS)(p,this.ctx.domManager.isRtl)],verticalAlignFactor:kh[g],yValues:x,colorKey:c,colorName:d,colorValues:b,colorDomain:v,itemPadding:u,labels:[],labelIndex:0,itemStyleContext:this.createItemStyleContext()}}createItemStyleContext(){const{stroke:e,strokeWidth:t,strokeOpacity:i}=this.properties;return{colorScaleValid:this.isColorScaleValid(),baseStyle:{fillOpacity:1,stroke:e,strokeWidth:t,strokeOpacity:i,opacity:1}}}createSkeletonNodeDatum(e,t,i){const{xKey:n,yKey:s,width:a,height:o,colorValues:r}=e,l=e.xValues[t],h=e.yValues[t],c=r?.[t];return{series:this,datumIndex:t,yKey:s,xKey:n,xValue:l,yValue:h,colorValue:c,datum:i,point:{x:0,y:0,size:0},width:a,height:o,midPoint:{x:0,y:0},missing:null!=r&&null==c,style:{}}}updateNodeDatum(e,t,i,n){const{xScale:s,yScale:a,xOffset:o,yOffset:r,width:l,height:h,xKey:c,yKey:d,colorValues:u}=e,p=t,g=e.xValues[i],m=e.yValues[i],y=s.convert(g)+o,f=a.convert(m)+r;if(!Number.isFinite(y)||!Number.isFinite(f))return;
1const x=u?.[i];p.datumIndex=i,p.datum=n,p.yKey=d,p.xKey=c,p.xValue=g,p.yValue=m,p.colorValue=x,p.width=l,p.height=h,p.missing=null!=u&&null==x;const b=p.point;b.x=y,b.y=f,b.size=0,p.midPoint.x=y,p.midPoint.y=f,p.style=this.getItemStyle({datumIndex:i,datum:n,colorValue:x},!1,void 0,e.itemStyleContext)}createNodeDatum(e,t,i){const{xScale:n,yScale:s,xOffset:a,yOffset:o}=e,r=e.xValues[t],l=e.yValues[t],h=n.convert(r)+a,c=s.convert(l)+o;if(!Number.isFinite(h)||!Number.isFinite(c))return;const d=this.createSkeletonNodeDatum(e,t,i);return this.updateNodeDatum(e,d,t,i),d}createLabelDatum(e,t,i,n){const{label:s}=this.properties,{width:a,height:o,textAlignFactor:r,verticalAlignFactor:l,itemPadding:h,colorKey:c,colorName:d,colorDomain:u,xKey:p,yKey:g,xName:m,yName:y}=e,f=e.colorValues?.[t],x=Yl(s.enabled&&null!=f?this.getLabelText(f,i,c,"color",u,s,{value:f,datum:i,colorKey:c,colorName:d,xKey:p,yKey:g,xName:m,yName:y}):void 0,this.properties.label,void 0,this.properties.label,{padding:h},(()=>({width:a,height:o,meta:null})));if(null==x?.label)return;const{text:b,fontSize:v,lineHeight:S,height:M}=x.label,{fontStyle:k,fontFamily:D,fontWeight:w,color:I,textAlign:A,verticalAlign:C}=this.properties.label,N=n.point.x,L=n.point.y-.5*(x.height-M),P=a-2*h,T=o-2*h;return{anchorX:N,anchorY:L,xSpan:P,ySpan:T,series:this,datum:i,datumIndex:t,text:b,fontSize:v,lineHeight:S,fontStyle:k,fontFamily:D,fontWeight:w,color:I,textAlign:A,textBaseline:C,x:N+r*P,y:L+l*T,style:n.style}}nodeFactory(){return new mh}update(e){return this.ctx.animationManager.skipCurrentBatch(),super.update(e)}updateDatumSelection(e){const{nodeData:t,datumSelection:i}=e,n=t??[];return i.update(n)}getItemStyle({datumIndex:e,datum:t,colorValue:i},s,a,o=this.createItemStyleContext()){const{properties:r}=this,{itemStyler:l,colorKey:h}=r,{missingDataFill:c}=r.colorScale,{colorScaleValid:d,baseStyle:u}=o,p=this.getHighlightStyle(s,e,a),g=this.getSelectionStyle(e);let m;m=d&&null!=i?this.colorScale.convert(i):null!=h&&null!=c?c:"transparent";const y=(0,n.HFk)(g,p,{fill:m},u);let f;return null!=l&&null!=e&&(f=this.cachedDatumCallback(ph(e,s?"highlight":"node"),(()=>{const i=this.makeItemStylerParams(t,e,s,y);return this.ctx.optionsGraphService.resolvePartial(["series",`${this.declarationOrder}`],this.callWithContext(l,i))}))),f?(0,n.HFk)(f,y):y}makeItemStylerParams(e,t,i,n){const{id:s,properties:a}=this,{xKey:o,yKey:r,colorKey:l}=a,h=this.ctx.highlightManager?.getActiveHighlight(),c=this.getHighlightStateString(h,i,t),d=this.getSelectionStateString(t),u=this.getCandidateStateString(t),p=this.filterItemStylerFillParams(n.fill)??n.fill;return{seriesId:s,datum:e,xKey:o,yKey:r,colorKey:l,highlightState:c,selectionState:d,candidateState:u,...n,fill:p}}updateDatumStyles({datumSelection:e,isHighlight:t}){const i=this.ctx.highlightManager?.getActiveHighlight(),n=this.createItemStyleContext();e.each(((e,s)=>{const a=this.getHighlightState(i,t,s.datumIndex);s.style=this.getItemStyle(s,t,a,n)}))}updateDatumNodes({datumSelection:e}){const t=this.axes[n.tv$.X],[i,s]=t?.visibleRange??[],a=!(0!==i||1!==s);e.each(((e,t)=>{const{point:i,width:n,height:s,style:o}=t;e.setStyleProperties(o),e.crisp=a,e.cornerRadius=this.properties.cornerRadius,e.x=i.x-n/2,e.y=i.y-s/2,e.width=n,e.height=s}))}updateLabelSelection(e){const{labelData:t,labelSelection:i}=e,{enabled:n}=this.properties.label,s=n?t:[];return i.update(s)}updateLabelNodes(e){const{isHighlight:t=!1}=e,i=this.ctx.highlightManager?.getActiveHighlight(),n=null!=this.properties.label.itemStyler;e.labelSelection.each(((e,s)=>{e.pointerEvents=yh.None,e.text=s.text,e.fillOpacity=this.getHighlightStyle(t,s.datumIndex)?.opacity??1,n&&this.anchorStyledLabel(s,t,i),vh(this,e,this.properties,this.properties.label,s,{isHighlight:t,activeHighlight:i})}))}anchorStyledLabel(e,t,i){const s={...bh(this,e,this.properties,this.properties.label,t,i)},a=Dh.find((e=>e===s.textAlign)),o=wh.find((e=>e===s.verticalAlign));if(null!=a||null!=o){if(null!=a){e.textAlign=a;const t=Mh[(0,n.vDS)(a,this.ctx.domManager.isRtl)];e.x=e.anchorX+t*e.xSpan}null!=o&&(e.textBaseline=o,e.y=e.anchorY+kh[o]*e.ySpan)}}getTooltipContent(e){const{id:t,dataModel:i,processedData:s,axes:a,properties:o,colorScale:r,ctx:l}=this,{formatManager:h}=l,{xKey:c,xName:d,yKey:u,yName:p,colorKey:g,colorName:m,title:y,legendItemName:f,tooltip:x}=o,b=a[n.tv$.X],v=a[n.tv$.Y];if(!(i&&s&&b&&v))return;
1const S=s.dataSources.get(this.id)?.data[e],M=i.resolveColumnById(this,"xValue",s,"object")[e],k=i.resolveColumnById(this,"yValue",s,"object")[e],D=null==g?void 0:i.resolveColumnById(this,"colorValue",s,"number")[e],w=this.properties.allowNullKeys??!1;if(void 0===M&&!w)return;if(null!=g&&null==D)return;const I=[];let A;if(null==D)A=o.colorScale.fills[0]?.color??"black";else{A=r.convert(D);const e=i.getDomain(this,"colorValue","value",s).domain,a=h.format(this.callWithContext.bind(this),{type:"number",value:D,datum:S,seriesId:t,legendItemName:f,key:g,source:"tooltip",property:"color",domain:e,boundSeries:this.getFormatterContext("color"),fractionDigits:void 0,visibleDomain:void 0}),l=(0,n.zP6)(r,o.colorScale.fills,D,n.Fl2);I.push({label:m,fallbackLabel:g,value:a??l??(0,n.Fl2)(D)})}I.push({label:d,fallbackLabel:c,value:this.getAxisValueText(b,"tooltip",M,S,c,f)},{label:p,fallbackLabel:u,value:this.getAxisValueText(v,"tooltip",k,S,u,f)});const C=this.getItemStyle({datumIndex:e,datum:S,colorValue:D},!1);null!=C.fill&&(A=C.fill);const N=null==A?void 0:{marker:{shape:"square",fill:A,fillOpacity:1,stroke:void 0,strokeWidth:0,strokeOpacity:1,lineDash:[0],lineDashOffset:0}};return this.formatTooltipWithContext(x,{title:y??f,symbol:N,data:I},{seriesId:t,datum:S,title:y,xKey:c,xName:d,yKey:u,yName:p,colorKey:g,colorName:m,...C})}getLegendData(e){if(!this.isColorScaleValid()||!this.dataModel)return[];const{colorScale:t}=this.properties;return"category"===e&&"discrete"===t.mode&&t.fills.length>0?ah(this.colorScale,t.fills,this.id,this.visible,rh(this)):"gradient"===e?[oh(this.colorScale,t.fills,this.id,this.visible,this.getFormatterContext("color"))]:[]}isLabelEnabled(){return this.properties.label.enabled&&Boolean(this.properties.colorKey)}getBandScalePadding(){return{inner:0,outer:0}}computeFocusBounds({datumIndex:e}){const t=this.contextNodeData?.nodeData[e];if(void 0===t)return;const{width:i,height:n,midPoint:s}=t,a={x:s.x-i/2,y:s.y-n/2,width:i,height:n};return sh(this,a)}initQuadTree(e){fh(e,this.datumNodesIter(),this.ctx.logger)}pickNodesExactShape(e){const t=xh(this,e);return null!=t&&t.distance<=0?[t]:[]}pickNodeClosestDatum(e){return xh(this,e)}hasItemStylers(){return this.properties.selection.enabled||null!=this.properties.itemStyler||null!=this.properties.label.itemStyler||this.isColorScaleValid()}};return e.className="HeatmapSeries",e.type="heatmap",e})(),{heatmapSeriesThemeableOptionsDef:Ah}=s.n1,Ch=(()=>({...(0,n.FFB)(Ah,["showInLegend"]),...(0,n.FFB)(n.XxK,["showInLegend"]),type:(0,n.mw3)((0,n.dYl)("heatmap")),xKey:(0,n.mw3)(n.YjP),yKey:(0,n.mw3)(n.YjP),xKeyAxis:n.YjP,yKeyAxis:n.YjP,colorKey:n.YjP,xName:n.YjP,yName:n.YjP,colorName:n.YjP,colorScale:n.pRw}))(),Nh={axes:{"grouped-category":{paddingInner:0,groupPaddingInner:0}},series:{stroke:{$if:[{$eq:[{$palette:"type"},"inbuilt"]},{$ref:"chartBackgroundColor"},{$path:["/0",{$palette:"stroke"},{$palette:"strokes"}]}]},strokeWidth:{$isUserOption:["./stroke",2,void 0]},label:{...n.mgV,enabled:!1,color:{$ref:"textColor"},fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},wrapping:"on-space",overflowStrategy:"ellipsis"},itemPadding:3,colorScale:{fills:{$map:[{color:{$value:"$1"}},{$if:[{$eq:[{$palette:"type"},"inbuilt"]},{$palette:"divergingColors"},n.Mg2]}]}},highlight:{enabled:{$path:["/highlight/enabled",!0]},unhighlightedItem:{opacity:.6}},selection:n.zg6},legend:{enabled:{$eq:[{$path:"../series/0/colorScale/mode"},"discrete"]}},gradientLegend:{enabled:{$not:{$eq:[{$path:"../series/0/colorScale/mode"},"discrete"]}}}},Lh={type:"series",name:"heatmap",chartType:"cartesian",enterprise:!0,version:s.xv,dependencies:[s.bI],options:Ch,defaultAxes:{y:{type:n.uCf.CATEGORY,position:n.v9C.LEFT},x:{type:n.uCf.CATEGORY,position:n.v9C.BOTTOM}},axisKeys:{[n.tv$.X]:"xKeyAxis",[n.tv$.Y]:"yKeyAxis"},themeTemplate:Nh,create:e=>new Ih(e)},Ph=(()=>{var e=class extends bl{constructor(){super(...arguments),this.properties=new Cl}nodeFactory(){const e=new Jr;return e.lineCap="square",e}updateDatumStyles({datumSelection:e,isHighlight:t}){e.each(((e,i)=>{i.style=this.getItemStyle(i.datumIndex,t,void 0,i.itemType)}))}updateDatumNodes({datumSelection:e,isHighlight:t}){const{contextNodeData:i,properties:n}=this;if(!i)return;const s=this.ctx.highlightManager.getActiveHighlight(),{up:a,down:o}=n.item,r=this;e.each((function(e,n){const{centerX:l,width:h,y:c,height:d,yOpen:u,yClose:p,crisp:g}=n,m=n.isRising?a:o;e.setStaticProperties(l,h,c,d,u,p,g);const y=n.style??i.styles[n.itemType][r.getHighlightState(s,t,n.datumIndex)];e.setStyleProperties(y),e.strokeAlignment=m.strokeWidth}))}getLegendData(e){const{id:t,data:i,ctx:{legendManager:n},visible:s}=this,{xKey:a,yName:o,item:{up:r,down:l},showInLegend:h,legendItemName:c}=this.properties;if(!i?.data.length||!a||"category"!==e)return[];const d={type:"gradient",gradient:"linear",colorSpace:"rgb",colorStops:[{color:r.stroke,stop:0},{color:r.stroke,stop:.5},{color:l.stroke,stop:.5}],rotation:90};
1return[{legendType:"category",id:t,itemId:t,seriesId:t,enabled:s&&(n?.getItemEnabled({seriesId:t,itemId:t})??!0),label:{text:c??o??t},symbol:{marker:{fill:d,fillOpacity:r.strokeOpacity,stroke:void 0,strokeWidth:0,strokeOpacity:1,lineDash:[0],lineDashOffset:0}},legendItemName:c,hideInLegend:!h}]}hasItemStylers(){return this.properties.selection.enabled||null!=this.properties.itemStyler}};return e.className="ohlc",e.type="ohlc",e})(),{ohlcSeriesThemeableOptionsDef:Th}=s.n1,Oh=(()=>({...n.XxK,...Th,type:(0,n.mw3)((0,n.dYl)("ohlc")),xKey:(0,n.mw3)(n.YjP),openKey:(0,n.mw3)(n.YjP),highKey:(0,n.mw3)(n.YjP),lowKey:(0,n.mw3)(n.YjP),closeKey:(0,n.mw3)(n.YjP),xKeyAxis:n.YjP,yKeyAxis:n.YjP,xName:n.YjP,yName:n.YjP,openName:n.YjP,highName:n.YjP,lowName:n.YjP,closeName:n.YjP}))();Oh.pickOutsideVisibleMinorAxis=(0,n._Le)(n.zMY),Oh.focusPriority=(0,n._Le)(n.aig);var{predictCartesianFinancialAxis:Rh}=s.n1,Eh={animation:{enabled:!1},series:{item:{up:{stroke:{$if:[{$eq:[{$palette:"type"},"user-indexed"]},{$palette:"stroke"},{$palette:"up.stroke"}]}},down:{stroke:{$if:[{$eq:[{$palette:"type"},"user-indexed"]},{$palette:"stroke"},{$palette:"down.stroke"}]}}},tooltip:{range:{$path:["/tooltip/range","nearest"]}},highlight:n.fil,selection:n.zg6},axes:{[n.uCf.NUMBER]:{crosshair:{snap:!1}},[n.uCf.ORDINAL_TIME]:{groupPaddingInner:0,crosshair:{enabled:!0}}}},zh={type:"series",name:"ohlc",chartType:"cartesian",enterprise:!0,version:s.xv,dependencies:[s.bI],options:Oh,matchingKeys:["xKey","lowKey","highKey","openKey","closeKey","normalizedTo"],predictAxis:Rh,defaultAxes:{y:{type:n.uCf.NUMBER,position:n.v9C.LEFT},x:{type:n.uCf.ORDINAL_TIME,position:n.v9C.BOTTOM}},axisKeys:{[n.tv$.X]:"xKeyAxis",[n.tv$.Y]:"yKeyAxis"},themeTemplate:Eh,create:e=>new Ph(e)};function Bh(e,t,i,s,a,o,r,l){return(0,n.fq3)([s,a],e,t,i,{smallestKeyInterval:o,xNeedsValueOf:r,yNeedsValueOf:l})}var Fh=(0,n.XB6)(Bh);function Vh({span:e},t){switch(e.type){case"linear":case"step":case"multi-line":{const i=(t-e.x0)/(e.x1-e.x0);return e.y0+i*(e.y1-e.y0)}case"cubic":{const{cp0x:i,cp0y:n,cp1x:s,cp1y:a,cp2x:o,cp2y:r,cp3x:l,cp3y:h}=e;let c=.5;const d=1e-6;for(let e=0;e<10;e++){const e=1-c,n=e*e*e*i+3*e*e*c*s+3*e*c*c*o+c*c*c*l-t;if(Math.abs(n)<d)break;const a=3*e*e*(s-i)+6*e*c*(o-s)+3*c*c*(l-o);if(Math.abs(a)<1e-12)break;c-=n/a,c=Math.max(0,Math.min(1,c))}const u=1-c;return u*u*u*n+3*u*u*c*a+3*u*c*c*r+c*c*c*h}}}function $h(e,t,i=0){for(let s=i;s<e.length;s++){const i=e[s],[a,o]=(0,n.gUy)(i.span);if(t>=a.x&&t<=o.x)return{span:i,index:s};if(t<a.x)break}return{span:null,index:i}}function Hh(e,t,i,n,s){const a=$h(e,i,s),o=$h(t,i,s);if(!a.span||!o.span)return{intersection:null,spanIndex:a.index,isInverted:n};const r=Vh(a.span,i),l=r>Vh(o.span,i);return{intersection:n===l?null:{x:i,y:r},spanIndex:a.index,isInverted:l}}var{CartesianSeriesProperties:jh,SeriesMarker:Wh,makeSeriesTooltip:_h,DropShadow:Gh,Label:Kh,LabelPlacementStyle:Yh}=s.n1,Uh=(()=>{var e=class extends Kh{constructor(){super(...arguments),this.placement="outside",this.spacing=0,this.insideStyle=new Yh,this.outsideStyle=new Yh}};return l([n.mAP],e.prototype,"placement",2),l([n.mAP],e.prototype,"spacing",2),l([n.mAP],e.prototype,"insideStyle",2),l([n.mAP],e.prototype,"outsideStyle",2),e})(),Xh=(()=>{var e=class{constructor(){this.enabled=!1,this.fillOpacity=1}};return l([n.mAP],e.prototype,"enabled",2),l([n.mAP],e.prototype,"fill",2),l([n.mAP],e.prototype,"fillOpacity",2),e})(),Zh=(()=>{var e=class extends n.XPE{constructor(){super(...arguments),this.stroke="#99CCFF",this.strokeWidth=1,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.marker=new Wh}};return l([n.mAP],e.prototype,"stroke",2),l([n.mAP],e.prototype,"strokeWidth",2),l([n.mAP],e.prototype,"strokeOpacity",2),l([n.mAP],e.prototype,"lineDash",2),l([n.mAP],e.prototype,"lineDashOffset",2),l([n.mAP],e.prototype,"marker",2),e})(),qh=(()=>{var e=class extends n.XPE{constructor(){super(...arguments),this.low=new Zh,this.high=new Zh}};return l([n.mAP],e.prototype,"low",2),l([n.mAP],e.prototype,"high",2),e})(),Qh=(()=>{var e=class extends n.XPE{};return l([n.mAP],e.prototype,"enabled",2),l([n.mAP],e.prototype,"shape",2),l([n.mAP],e.prototype,"size",2),l([n.mAP],e.prototype,"fill",2),l([n.mAP],e.prototype,"fillOpacity",2),l([n.mAP],e.prototype,"stroke",2),l([n.mAP],e.prototype,"strokeWidth",2),l([n.mAP],e.prototype,"strokeOpacity",2),l([n.mAP],e.prototype,"lineDash",2),l([n.mAP],e.prototype,"lineDashOffset",2),l([n.mAP],e.prototype,"itemStyler",2),e})(),Jh=(()=>{var e=class extends jh{constructor(){super(...arguments),this.fill="#99CCFF",this.fillOpacity=1,this.stroke="#99CCFF",this.strokeWidth=1,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.interpolation=new n._eL,this.item=new qh,this.invertedStyle=new Xh,this.shadow=(new Gh).set({enabled:!1}),this.marker=new Qh,this.label=new Uh,this.tooltip=_h(),this.connectMissingData=!1}};return l([n.mAP],e.prototype,"xKey",2),l([n.mAP],e.prototype,"yLowKey",2),l([n.mAP],e.prototype,"yHighKey",2),l([n.mAP],e.prototype,"xName",2),l([n.mAP],e.prototype,"yName",2),l([n.mAP],e.prototype,"yLowName",2),l([n.mAP],e.prototype,"yHighName",2),l([n.mAP],e.prototype,"fill",2),l([n.mAP],e.prototype,"fillOpacity",2),l([n.mAP],e.prototype,"stroke",2),l([n.mAP],e.prototype,"strokeWidth",2),l([n.mAP],e.prototype,"strokeOpacity",2),l([n.mAP],e.prototype,"lineDash",2),l([n.mAP],e.prototype,"lineDashOffset",2),l([n.mAP],e.prototype,"interpolation",2),l([n.mAP],e.prototype,"styler",2),l([n.mAP],e.prototype,"item",2),l([n.mAP],e.prototype,"invertedStyle",2),l([n.mAP],e.prototype,"shadow",2),l([n.mAP],e.prototype,"marker",2),l([n.mAP],e.prototype,"label",2),l([n.mAP],e.prototype,"tooltip",2),l([n.mAP],e.prototype,"connectMissingData",2),e})(),{CollapseMode:ec,pairUpSpans:tc,prepareAreaFillAnimationFns:ic,plotInterpolatedLinePathStroke:nc,prepareLinePathPropertyAnimation:sc}=s.n1;function ac(e,t,i){if("category"===e.scales.x?.type!==("category"===t.scales.x?.type)||!(0,n.z1w)(e.scales.x)||!(0,n.z1w)(t.scales.x))return;let s="updated";t.visible&&!e.visible?s="removed":!t.visible&&e.visible&&(s="added");const a=tc({scales:e.scales,data:e.fillData.spans},{scales:t.scales,data:t.fillData.spans},ec.Split);if(null==a)return;const o=tc({scales:e.scales,data:e.fillData.phantomSpans},{scales:t.scales,data:t.fillData.phantomSpans},ec.Split);if(null==o)return;const r=tc({scales:e.scales,data:e.highStrokeData.spans},{scales:t.scales,data:t.highStrokeData.spans},ec.Split);if(null==r)return;const l=tc({scales:e.scales,data:e.lowStrokeData.spans},{scales:t.scales,data:t.lowStrokeData.spans},ec.Split);if(null==l)return;const h="fade",c=ic(s,a,o,h),d=function(e,t,i,n){return{status:e,path:{addPhaseFn:(e,n)=>{nc(e,n,t.added),nc(e,n,i.added)},updatePhaseFn:(e,n)=>{nc(e,n,t.moved),nc(e,n,i.moved)},removePhaseFn:(e,n)=>{nc(e,n,t.removed),nc(e,n,i.removed)}},pathProperties:sc(e,n)}}(s,r,l,h);return{status:s,fill:c,stroke:d,hasMotion:(i?.changed??!0)||!(0,n.wo0)(e.scales.x,t.scales.x)||!(0,n.wo0)(e.scales.y,t.scales.y)||"updated"!==s}}var oc=n.IXP,rc=n.BNK,lc=n.jBM,hc=n.kmN,{valueProperty:cc,keyProperty:dc,updateLabelNode:uc,createCandidateStyleResolver:pc,expandPlacementLabelBoxExtent:gc,placedLabelTextOffset:mc,pickPlacementStyle:yc,fixNumericExtent:fc,buildResetPathFn:xc,resetLabelFn:bc,resetMarkerFn:vc,resetMarkerPositionFn:Sc,pathSwipeInAnimation:Mc,resetMotion:kc,markerSwipeScaleInAnimation:Dc,maxMarkerStrokePickInflation:wc,seriesLabelFadeInAnimation:Ic,animationValidation:Ac,diff:Cc,updateClipPath:Nc,computeMarkerFocusBounds:Lc,plotAreaPathFill:Pc,plotLinePathStroke:Tc,interpolatePoints:Oc,pathFadeInAnimation:Rc,markerFadeInAnimation:Ec,fromToMotion:zc,pathMotion:Bc,PointerEvents:Fc,Marker:Vc,BBox:$c,processedDataIsAnimatable:Hc,cartesianMarkerDrawMode:jc,getMarkerStyles:Wc,calculateSegments:_c,toHighlightString:Gc,toSelectionString:Kc,HighlightState:Yc,AggregationManager:Uc,resetMarkerSelectionsDirect:Xc,createDatumId:Zc,visibleRangeIndices:qc}=s.n1;function Qc(e,t){return"outside"===e==("high"===t)?"top":"bottom"}
1function Jc(e,t){return"top"===e==("high"===t)?"outside":"inside"}var ed=(e,t)=>{const i=Jc(e,t.valueSide);return{style:i,reported:i}},td=(()=>{var e=class e extends s.n1.CartesianSeries{constructor(e){super({moduleCtx:e,pathsPerSeries:["fill","lowStroke","highStroke"],pickModes:[s.n1.SeriesNodePickMode.AXIS_ALIGNED],propertyKeys:{[n.tv$.X]:["xKey"],[n.tv$.Y]:["yLowKey","yHighKey"]},propertyNames:{[n.tv$.X]:["xName"],[n.tv$.Y]:["yLowName","yHighName","yName"]},categoryKey:"xValue",animationResetFns:{path:xc({getVisible:()=>this.visible,getOpacity:()=>this.getOpacity()}),label:bc,datum:(e,t)=>({...vc(e),...Sc(e,t)})},clipFocusBox:!1,usesPlacedLabels:!0}),this.properties=new Jh,this.aggregationManager=new Uc,this.hideWithSize0=!1,this.markerNodesPickable=!0,this.placedLabelData=[]}createNodeParams(e){return{...super.createNodeParams(e),xKey:this.properties.xKey,yLowKey:this.properties.yLowKey,yHighKey:this.properties.yHighKey}}hasPickableNodeShapes(){return this.markerNodesPickable}renderToOffscreenCanvas(){return(this.contextNodeData?.nodeData?.length??0)>0&&"cutout"===this.getDrawingMode(!1)||super.renderToOffscreenCanvas()}async processData(e){const{xKey:t,yLowKey:i,yHighKey:s}=this.properties,a=this.axes[n.tv$.X]?.scale,o=this.axes[n.tv$.Y]?.scale,{xScaleType:r,yScaleType:l}=this.getScaleInformation({xScale:a,yScale:o}),h=[],c=!this.ctx.animationManager.isSkipped();this.needsDataModelDiff()&&this.processedData&&h.push(Cc(this.id,this.processedData)),c&&h.push(Ac());const d=this.properties.allowNullKeys??!1,{dataModel:u,processedData:p}=await this.requestDataModel(e,this.data,{props:[dc(t,r,{id:"xValue",allowNullKey:d}),cc(i,l,{id:"yLowValue",invalidValue:void 0}),cc(s,l,{id:"yHighValue",invalidValue:void 0}),...h]});this.aggregateData(u,p),this.animationState.transition("updateData")}aggregateData(e,t){if(this.aggregationManager.markStale(t.input.count),"ungrouped"!==t.type)return;if(Hc(t))return;const i=this.axes[n.tv$.X];if(null==i)return;const s=this.estimateTargetRange();this.aggregationManager.aggregate({computePartial:a=>function(e,t,i,s,a,o){const r=t.resolveKeysById(s,"xValue",i),l=t.resolveColumnById(s,"yHighValue",i,"mixed-numeric"),h=t.resolveColumnById(s,"yLowValue",i,"mixed-numeric"),c=t.getDomain(s,"xValue","key",i),d=t.resolveColumnNeedsValueOf(s,"xValue",i),u=t.resolveColumnNeedsValueOf(s,"yHighValue",i)??t.resolveColumnNeedsValueOf(s,"yLowValue",i),{values:p,needsValueOf:g}=(0,n.QP0)(e,r,d),{xValues:m,domain:y}=(0,n.g3H)(e,p,c),f=u?l:(0,n.X_t)(l),x=u?h:(0,n.X_t)(h);return(0,n.EXR)(y,m,f,x,{smallestKeyInterval:i.reduced?.smallestKeyInterval,targetRange:a,xNeedsValueOf:g,yNeedsValueOf:u,existingFilters:o})}(i.scale.type,e,t,this,s,a),computeFull:s=>function(e,t,i,s,a){const o=t.resolveKeysById(s,"xValue",i),r=t.resolveColumnById(s,"yHighValue",i,"mixed-numeric"),l=t.resolveColumnById(s,"yLowValue",i,"mixed-numeric"),h=t.getDomain(s,"xValue","key",i),c=t.resolveColumnNeedsValueOf(s,"xValue",i),d=t.resolveColumnNeedsValueOf(s,"yHighValue",i)??t.resolveColumnNeedsValueOf(s,"yLowValue",i),{values:u,needsValueOf:p}=(0,n.QP0)(e,o,c),{xValues:g,domain:m}=(0,n.g3H)(e,u,h),y=d?r:(0,n.X_t)(r),f=d?l:(0,n.X_t)(l);return a?(0,n.fq3)(m,g,y,f,{smallestKeyInterval:i.reduced?.smallestKeyInterval,xNeedsValueOf:p,yNeedsValueOf:d,existingFilters:a}):Fh(g,y,f,m[0],m[1],i.reduced?.smallestKeyInterval,p,d)}(i.scale.type,e,t,this,s),targetRange:s});const a=this.aggregationManager.filters;a&&a.length>0&&n.Xjz.record(`${this.type}:aggregation`,a.map((e=>e.maxRange)))}createBucketLookupFeature(){return new s.n1.BucketLookupManager({series:this,getXAxis:()=>this.axes[n.tv$.X],getDataModel:()=>this.dataModel,getProcessedData:()=>this.processedData,aggregationManager:this.aggregationManager,dataSelectionService:this.ctx.dataSelectionService,domainKey:"key",canonicalExtremaSlots:[n.BNK,n.jBM]})}estimateTargetRange(){const e=this.axes[n.tv$.X];if(e?.scale?.range){const[t,i]=e.scale.range;return Math.abs(i-t)}return this.ctx.scene?.canvas?.width??800}createNodeDatumContext(e,t){const{dataModel:i,processedData:s}=this;if(!i||!s)return;
1const a=s.dataSources.get(this.id)?.data??[],o=e.scale,r=t.scale,l=e.range,[h,c]=o.range,d=Math.abs(c-h);this.aggregationManager.ensureLevelForRange(d);const u=this.aggregationManager.getFilterForRange(d);this.ensureBucketLookupFeature()?.setActiveFilter(s,u);const p=this.contextNodeData?.nodeData,g=!this.ctx.animationManager.isSkipped(),m=null!=p&&(null!=s.changeDescription||!Hc(s)||null!=u),{item:y,label:f}=this.properties,x=(0,n.$rL)(f.placement),b=x.length>0?x:["outside"],v=e=>{const{marker:t}=y[e];return t.enabled?t.size:0};return{xAxis:e,yAxis:t,rawData:a,xValues:i.resolveKeysById(this,"xValue",s),yHighValues:i.resolveColumnById(this,"yHighValue",s,"mixed-numeric"),yLowValues:i.resolveColumnById(this,"yLowValue",s,"mixed-numeric"),xScale:o,yScale:r,xAxisRange:l,xOffset:(o.bandwidth??0)/2,dataAggregationFilter:u,range:d,labelsEnabled:f.enabled,labelFit:(0,n.A_g)(f,!f.collision.alwaysShow),labelStyled:null!=f.itemStyler,labelPadding:gc(f),labelTextMeasurer:(0,n.K$y)(f),labelPlacements:{low:b.map((e=>Qc(e,"low"))),high:b.map((e=>Qc(e,"high")))},labelMarkerSize:{low:v("low"),high:v("high")},labelAnchor:{low:Vc.anchor(y.low.marker.shape),high:Vc.anchor(y.high.marker.shape)},animationEnabled:g,canIncrementallyUpdate:m,xKey:this.properties.xKey,yLowKey:this.properties.yLowKey,yHighKey:this.properties.yHighKey,item:this.properties.item,yDomain:this.getSeriesDomain(n.tv$.Y).domain,connectMissingData:this.properties.connectMissingData,interpolation:this.properties.interpolation,nodes:m?p:[],labelData:[],spanPoints:[],nodeIndex:0}}xCoordinateRange(e){const t=this.axes[n.tv$.X].scale.convert(e);return[t,t]}yCoordinateRange(e){const t=this.axes[n.tv$.Y].scale.convert(e[0]);return[t,t]}getSeriesDomain(e){const{processedData:t,dataModel:i}=this;if(!t||!i)return{domain:[]};const{domain:{keys:[s]}}=t;if(e===n.tv$.X){const e=i.resolveProcessedDataDefById(this,"xValue");if("key"===e?.def.type&&"category"===e.def.valueType){return{domain:s,sortMetadata:i.getKeySortMetadata(this,"xValue",t)}}return{domain:fc((0,n.Xxv)(s))}}{const e=this.domainForClippedRange(n.tv$.Y,["yHighValue","yLowValue"],"xValue"),t=(0,n.uYy)(e);return{domain:fc(t)}}}getSeriesRange(e,t){const[i,s]=this.domainForVisibleRange(n.tv$.Y,["yHighValue","yLowValue"],"xValue",t);return[(0,n.Roz)(i),(0,n.Roz)(s)]}handleDatumPoint(e,t,i,s,a){if(t.xValue=e.xValues[i],void 0===t.xValue&&!this.properties.allowNullKeys)return;t.datum=e.rawData[i],t.yHighValue=s??e.yHighValues[i],t.yLowValue=a??e.yLowValues[i];const o=e.spanPoints.at(-1);if((0,n.QQF)(t.yHighValue)&&(0,n.QQF)(t.yLowValue)){if(t.inverted=t.yLowValue>t.yHighValue,t.x=e.xScale.convert(t.xValue)+e.xOffset,!Number.isFinite(t.x))return;t.yHighCoordinate=e.yScale.convert(t.yHighValue),t.yLowCoordinate=e.yScale.convert(t.yLowValue),this.upsertMarkerDatum(e,t,i,"high",t.yHighValue,t.yHighCoordinate),this.upsertMarkerDatum(e,t,i,"low",t.yLowValue,t.yLowCoordinate);const n={high:{point:{x:t.x,y:t.yHighCoordinate},xDatum:t.xValue,yDatum:t.yHighValue},low:{point:{x:t.x,y:t.yLowCoordinate},xDatum:t.xValue,yDatum:t.yLowValue}};Array.isArray(o)?o.push(n):(null==o||(o.skip+=1),e.spanPoints.push([n]))}else e.connectMissingData||(Array.isArray(o)||null==o?e.spanPoints.push({skip:0}):o.skip+=1)}pushGapMarker(e){const t=e.spanPoints.at(-1);Array.isArray(t)||null==t?e.spanPoints.push({skip:0}):t.skip+=1}hasInvalidDatumsInRange(e,t,i,s){for(let a=i;a<=s;a++)if(!(0,n.QQF)(e[a])||!(0,n.QQF)(t[a]))return!0;return!1}upsertMarkerDatum(e,t,i,n,s,a){const{size:o}=e.item[n].marker;if(e.canIncrementallyUpdate&&e.nodeIndex<e.nodes.length){const s=e.nodes[e.nodeIndex];s.index=i,s.itemType=n,s.datum=t.datum,s.datumIndex=i,s.midPoint={x:t.x,y:a},s.yHighValue=t.yHighValue,s.yLowValue=t.yLowValue,s.xValue=t.xValue,s.point={x:t.x,y:a,size:o}}else e.nodes.push({index:i,series:this,itemType:n,datum:t.datum,datumIndex:i,midPoint:{x:t.x,y:a},yHighValue:t.yHighValue,yLowValue:t.yLowValue,xValue:t.xValue,xKey:e.xKey,yLowKey:e.yLowKey,yHighKey:e.yHighKey,point:{x:t.x,y:a,size:o},enabled:!0});e.nodeIndex++,e.labelsEnabled&&e.labelData.push(this.createLabelData(e,{datumIndex:i,point:{x:t.x,y:a},value:s,itemType:n,inverted:t.inverted,datum:t.datum}))}populateNodeData(e){const{processedData:t}=this;if(!t)return;const i={datum:void 0,xValue:void 0,yHighValue:0,yLowValue:0,x:0,yHighCoordinate:0,yLowCoordinate:0,inverted:!1},s=t=>e.xScale.convert(e.xValues[t])+e.xOffset;if(t.input.count<1e3||null==e.dataAggregationFilter){let[n,a]=qc(1,e.xValues.length,e.xAxisRange,(e=>{const t=s(e);return[t,t]}));t.input.count<1e3&&(n=0,a=t.input.count),n=Math.max(n-1,0),a=Math.min(a+1,e.xValues.length);for(let t=n;t<a;t+=1)this.handleDatumPoint(e,i,t)}else{const{maxRange:t,indexData:a,midpointIndices:o}=e.dataAggregationFilter,[r,l]=qc(1,t,e.xAxisRange,(e=>{const t=o[e];if(t!==n.IXQ)return[s(t),s(t)]}));let h=-1;for(let t=r;t<l;t+=1){if(o[t]===n.IXQ)continue;const s=t*hc,r=a[s+oc],l=a[s+rc],c=a[s+lc];l!==n.IXQ&&c!==n.IXQ?(!e.connectMissingData&&this.hasInvalidDatumsInRange(e.yHighValues,e.yLowValues,h+1,r)&&this.pushGapMarker(e),this.handleDatumPoint(e,i,l,e.yHighValues[l],e.yLowValues[c]),h=r):(e.connectMissingData||this.pushGapMarker(e),h=r)}}}finalizeNodeData(e){e.canIncrementallyUpdate&&e.nodeIndex<e.nodes.length&&(e.nodes.length=e.n
1odeIndex)}initializeResult(e){return{itemId:`${e.yLowKey}-${e.yHighKey}`,labelData:e.labelData,nodeData:e.nodes,fillData:{itemType:"high",spans:[],phantomSpans:[]},highStrokeData:{itemType:"high",spans:[]},lowStrokeData:{itemType:"low",spans:[]},scales:this.calculateScaling(),visible:this.visible,styles:{low:this.getLowOrHighMarkerStyles("low"),high:this.getLowOrHighMarkerStyles("high")},segments:void 0,intersectionSegments:void 0}}assembleResult(e,t){const i=this.axes[n.tv$.X],s=this.axes[n.tv$.Y];if(!i||!s||!this.chart?.seriesRect)return t;const a=e.spanPoints.flatMap((t=>{if(!Array.isArray(t))return[];const i=t.map((e=>e.high));return Oc(i,e.interpolation)})),o=e.spanPoints.flatMap((t=>{if(!Array.isArray(t))return[];const i=t.map((e=>e.low));return Oc(i,e.interpolation)})),r=_c(this.properties.segmentation,i,s,this.chart.seriesRect,this.ctx.scene,!1);let l;if(this.properties.invertedStyle.enabled){const t=e.yHighValues[0]<e.yLowValues[0],i=function(e,t,i,n,s=!1){if(0===e.length||0===t.length)return[];const a=[];let o=s,r=0;for(let s=i;s<=n;s+=.5){const i=Hh(e,t,s,o,r);i.intersection&&a.push(i.intersection.x),r=i.spanIndex,o=i.isInverted}return a}(a,o,e.xScale.range[0],e.xScale.range[1],t);l=function(e,t,i,n,s={}){const a=Math.max(t.x,i.width-(t.x+t.width)),o=Math.max(t.y,i.height-(t.y+t.height)),r=[],l=(e,i)=>({x0:e,y0:-o,x1:i,y1:t.height+o});n&&r.push({clipRect:l(-a,e[0]??t.width+a),...s});for(let i=n?1:0;i<e.length;i+=2)r.push({clipRect:l(e[i],e[i+1]??t.width+a),...s});return r}(i,this.chart.seriesRect,this.ctx.scene,t,this.properties.invertedStyle)}return t.fillData={itemType:"high",spans:a,phantomSpans:o},t.highStrokeData={itemType:"high",spans:a},t.lowStrokeData={itemType:"low",spans:o},t.segments=r,t.intersectionSegments=l,t}getLowOrHighMarkerStyles(e){const{fill:t,fillOpacity:i,item:n}=this.properties,s=n[e],{stroke:a,strokeWidth:o,strokeOpacity:r}=s,l={fill:t,fillOpacity:i,stroke:a,strokeWidth:o,strokeOpacity:r};return Wc(this,s,s.marker,l)}createLabelData(e,{datumIndex:t,point:i,value:s,itemType:a,inverted:o,datum:r}){const{xKey:l,yLowKey:h,yHighKey:c,xName:d,yName:u,yLowName:p,yHighName:g,legendItemName:m,label:y}=this.properties;let f=a;o&&(f="low"===a?"high":"low");const x=e.labelMarkerSize[a],b=this.getLabelText(s,r,"high"===a?c:h,"y",e.yDomain,y,{value:s,datum:r,itemType:a,xKey:l,yLowKey:h,yHighKey:c,xName:d,yLowName:p,yHighName:g,yName:u,legendItemName:m}),v=(0,n.Wkl)(b,y,e);return{x:i.x,y:i.y,point:{x:i.x,y:i.y,size:x},label:v,fit:(0,n.lIw)(b,y,e),text:v.text,anchor:e.labelAnchor[a],placements:e.labelPlacements[f],placement:void 0,gap:x>0?x/2:n.Olx,valueSide:f,series:this,itemType:a,datum:r,datumIndex:t,textAlign:"center",textBaseline:"top",rotation:0}}isPathOrSelectionDirty(){const{low:e,high:t}=this.properties.item;return e.marker.isDirty()||t.marker.isDirty()}strokewidthChange(){const e=e=>{const t=this.properties.item[e].strokeWidth??0,i=this.properties.highlight.highlightedSeries.item?.[e]?.strokeWidth??t,n=this.properties.highlight.highlightedItem.item?.[e]?.strokeWidth??t;return t>n||i>n};return e("low")||e("high")}updatePathNodes(e){const{visible:t}=e,[i,s,a]=e.paths,o=this.contextNodeData?.segments,r=this.ctx.highlightManager?.getActiveHighlight(),l=this.getHighlightState(r,!1),h=this.getHighlightStyle(),c=this.getSelectionStyle(),d=this.getStyle(l),{item:u,stroke:p,strokeWidth:g,strokeOpacity:m,fill:y,fillOpacity:f,opacity:x}=(0,n.HFk)(c,h,d);s.setProperties({datum:o,segments:o,fill:void 0,lineCap:"round",lineJoin:"round",pointerEvents:Fc.None,stroke:p??u.low.stroke,strokeWidth:g??u.low.strokeWidth,strokeOpacity:m??u.low.strokeOpacity,lineDash:u.low.lineDash,lineDashOffset:u.low.lineDashOffset,opacity:x,visible:t}),a.setProperties({segments:o,fill:void 0,lineCap:"round",lineJoin:"round",pointerEvents:Fc.None,stroke:p??u.high.stroke,strokeWidth:g??u.high.strokeWidth,strokeOpacity:m??u.high.strokeOpacity,lineDash:u.high.lineDash,lineDashOffset:u.high.lineDashOffset,opacity:x,visible:t});const b=this.getShapeFillBBox();i.setFillProperties(y,b),i.setStyleProperties({stroke:void 0,fill:y,fillOpacity:f,opacity:x},b);const v=this.contextNodeData?.intersectionSegments??o;i.setProperties({segments:v,pointerEvents:Fc.None,lineJoin:"round",fillShadow:this.properties.shadow,opacity:x,visible:t}),i.datum=v,Nc(this,i),Nc(this,s),Nc(this,a)}updatePaths(e){this.updateAreaPaths(e.paths,e.contextData)}updateAreaPaths(e,t){for(const i of e)i.visible=t.visible;if(t.visible)this.updateFillPath(e,t),this.updateStrokePath(e,t);else for(const t of e)t.path.clear(),t.markDirty("RangeArea")}updateFillPath(e,t){const[i]=e;i.path.clear(),Pc(i,t.fillData),i.markDirty("RangeArea")}updateStrokePath(e,t){const[,i,n]=e;i.path.clear(),n.path.clear(),Tc(i,t.lowStrokeData.spans),Tc(n,t.highStrokeData.spans),i.markDirty("RangeArea"),n.markDirty("RangeArea")}resetDatumAnimation(e){Xc([e.datumSelection])}updateDatumSelection(e){const{nodeData:t,datumSelection:i}=e,{processedData:n,axes:s,properties:a}
1=this,o=a.styler?this.getStylerMarkerOptions().item:a.item,{low:r,high:l}=o,h=jc(a,void 0,n,s,{enabled:r.marker.enabled||l.marker.enabled},void 0,this.chart?.isMiniChart);let c;if(this.hideWithSize0=h.hideWithSize0,this.markerNodesPickable=h.needsNodeData&&!h.hideWithSize0&&r.marker.enabled&&l.marker.enabled,(a.item.low.marker.isDirty()||a.item.high.marker.isDirty())&&(i.clear(),i.cleanup()),h.needsNodeData)if(h.hideWithSize0||r.marker.enabled&&l.marker.enabled)c=t;else{c=[];for(const e of t)o[e.itemType].marker.enabled&&c.push(e)}else c=[];return Hc(this.processedData)?i.update(c,void 0,(e=>Zc(e.xValue,e.itemType))):i.update(c)}updateDatumStyles({datumSelection:t,isHighlight:i}){const{hideWithSize0:n}=this,a={hideWithSize0:n,isHighlight:i};null!=this.properties.marker.itemStyler?this.runMarkerStylePass(t,i,a,{compute:e.computeStylerStyle,apply:e.applyStylerDatum}):this.runMarkerStylePass(t,i,a,{keyExtra:e.keyByItemType,compute:e.computeNoStylerMarkerStyle,apply:s.n1.Series.assignCachedStyle})}updateDatumNodes(e){const{contextNodeData:t,hideWithSize0:i}=this;if(!t)return;const{datumSelection:n,isHighlight:s}=e,a=this.getShapeFillBBox(),o=this.ctx.highlightManager.getActiveHighlight(),r=this.getDrawingMode(s,e.drawingMode),l=Math.max(wc(t.styles.low),wc(t.styles.high));n.each(((e,n)=>{const{itemType:h}=n,c=n.style??t.styles[h][this.getHighlightState(o,s,n.datumIndex)];this.applyMarkerStyle(c,e,n.point,a,{hideWithSize0:i,pickInflation:l}),e.drawingMode=r})),s||(this.properties.item.low.marker.markClean(),this.properties.item.high.marker.markClean())}updateLabelSelection(e){const{labelData:t,labelSelection:i}=e;return i.update(t,(e=>{e.pointerEvents=Fc.None}))}makeLabelStylerParams(){const{xKey:e,xName:t,yName:i,yLowKey:n,yLowName:s,yHighKey:a,yHighName:o,legendItemName:r}=this.properties;return{xKey:e,xName:t??e,yName:i,yLowKey:n,yLowName:s??n,yHighKey:a,yHighName:o??a,legendItemName:r}}getLabelCandidateStyler(){return pc(this,this.properties.label,this.makeLabelStylerParams(),ed)}updateLabelNodes(e){const t=this.makeLabelStylerParams(),i=this.ctx.highlightManager?.getActiveHighlight(),{isHighlight:n=!1,labelSelection:s}=e,{label:a}=this.properties;s.each(((e,s)=>{e.fillOpacity=this.getHighlightStyle(n,s.datumIndex).opacity??1;const o=Jc(s.placement,s.valueSide);uc(this,e,t,a,s,{isHighlight:n,activeHighlight:i},void 0,yc(a,o),{placement:o})}))}getLabelData(){return this.isLabelEnabled()?this.contextNodeData?.labelData??[]:[]}getLabelDefaults(){const{label:e}=this.properties;return(0,n.wSY)(e.collision,void 0,e.spacing)}updatePlacedLabelData(e){this.placedLabelData=e,this.labelSelection=this.updateLabelSelection({labelData:e.map(this.placedLabelMapper()),labelSelection:this.labelSelection}),this.updateLabelNodes({labelSelection:this.labelSelection}),this.updateHighlightLabelSelection()}placedLabelMapper(){const{label:e}=this.properties,t=mc(e,yc(e,"inside")),i=mc(e,yc(e,"outside")),n=this.getLabelCandidateStyler();return function(e){const{datum:s}=e,a=e.placement??s.placement,o="inside"===Jc(a,s.valueSide),r=n?.(s,a,void 0),l=r?.boxPadding.top??(o?t:i).y;return{...s,x:e.x+e.width/2,y:e.y+l,placement:a,text:e.text}}}getHighlightLabelData(e,t){const i=this.placedLabelData.filter((e=>e.datum.datumIndex===t.datumIndex)).map(this.placedLabelMapper());return 0===i.length?void 0:i}getHighlightData(e,t){const i=e.filter((e=>e.datum===t.datum)).map((e=>({...e})));return i.length>0?i:void 0}getStyle(e){return this.getStylerCouple(e)[0]}getStylerMarkerOptions(){return this.getStylerCouple(void 0)[1]}getStylerCouple(e){const{fill:t,fillOpacity:i,item:n,styler:s}=this.properties,a=this.getDataSelectionState(void 0),o=this.getDataCandidacyState(void 0);let r={};if(s){const t=this.makeStylerParams(e,a,o);r=this.ctx.optionsGraphService.resolvePartial(["series",`${this.declarationOrder}`],this.cachedCallWithContext(s,t)??{},{pick:!1})??{}}const l={item:{low:{marker:{enabled:!1}},high:{marker:{enabled:!1}}}},h=e=>{const i=r.item?.[e],{lineDash:s,lineDashOffset:a,marker:o,stroke:h,strokeOpacity:c,strokeWidth:d}=n[e];return l.item[e].marker.enabled=i?.marker?.enabled??o.enabled,{marker:{fill:i?.marker?.fill??o.fill??t,fillOpacity:i?.marker?.fillOpacity??o.fillOpacity,shape:i?.marker?.shape??o.shape,size:i?.marker?.size??o.size,lineDash:i?.marker?.lineDash??o.lineDash,lineDashOffset:i?.marker?.lineDashOffset??o.lineDashOffset,stroke:i?.marker?.stroke??o.stroke??h,strokeOpacity:i?.marker?.strokeOpacity??o.strokeOpacity,strokeWidth:i?.marker?.strokeWidth??o.strokeWidth},lineDash:i?.lineDash??s,lineDashOffset:i?.lineDashOffset??a,stroke:i?.stroke??h,strokeOpacity:i?.strokeOpacity??c,strokeWidth:i?.strokeWidth??d}
1};return[{fill:r.fill??t,fillOpacity:r.fillOpacity??i,opacity:1,topLevel:{lineDash:this.properties.lineDash,lineDashOffset:this.properties.lineDashOffset,marker:this.properties.marker,stroke:this.properties.stroke,strokeOpacity:this.properties.strokeOpacity,strokeWidth:this.properties.strokeWidth},item:{low:h("low"),high:h("high")}},l]}makeStylerParams(e,t,i){const{id:n}=this,{fill:s,fillOpacity:a,item:o,xKey:r,yHighKey:l,yLowKey:h}=this.properties,c=Gc(e??Yc.None),d=Kc(t),u=Kc(i),p=e=>{const{lineDash:t,lineDashOffset:i,marker:n,stroke:a,strokeOpacity:r,strokeWidth:l}=o[e];return{marker:{fill:n.fill??s,fillOpacity:n.fillOpacity,size:n.size,shape:n.shape,stroke:n.stroke??a,strokeOpacity:n.strokeOpacity,strokeWidth:n.strokeWidth,lineDash:n.lineDash,lineDashOffset:n.lineDashOffset},lineDash:t,lineDashOffset:i,stroke:a,strokeOpacity:r,strokeWidth:l}};return{item:{low:p("low"),high:p("high")},fill:s,fillOpacity:a,highlightState:c,selectionState:d,candidateState:u,seriesId:n,xKey:r,yLowKey:h,yHighKey:l}}makeItemStylerParams(e){const{xKey:t,yLowKey:i,yHighKey:n}=this.properties;return{xKey:t,yLowKey:i,yHighKey:n,itemType:e}}getTooltipContent(e,t){const i=t?.itemType??"high",{id:a,dataModel:o,processedData:r,axes:l,properties:h}=this,{xName:c,yName:d,yLowKey:u,yLowName:p,xKey:g,yHighKey:m,yHighName:y,tooltip:f,legendItemName:x}=h,b=l[n.tv$.X],v=l[n.tv$.Y];if(!(o&&r&&b&&v))return;const S=r.dataSources.get(this.id)?.data[e],M=o.resolveKeysById(this,"xValue",r)[e],k=o.resolveColumnById(this,"yHighValue",r,"mixed-numeric")[e],D=o.resolveColumnById(this,"yLowValue",r,"mixed-numeric")[e],w=this.properties.allowNullKeys??!1;if(void 0===M&&!w)return;const I=this.getStyle(void 0),A=this.makeItemStylerParams(i),C=this.getMarkerStyle(this.properties.item[i].marker,{datumIndex:e,datum:S},A,{isHighlight:!1,resolveMarkerSubPath:["item",i,"marker"]},I.item[i].marker),N=`${this.getAxisValueText(v,"tooltip",D,S,u,x)} - ${this.getAxisValueText(v,"tooltip",k,S,m,x)}`;return this.formatTooltipWithContext(f,{heading:this.getAxisValueText(b,"tooltip",M,S,g,x),symbol:this.legendItemSymbol(),data:[{label:d,fallbackLabel:`${p??u} - ${y??m}`,value:N,missing:s.n1.isTooltipValueMissing(k)&&s.n1.isTooltipValueMissing(D)}]},{seriesId:a,datum:S,title:d,itemType:i,xName:c,yName:d,yLowKey:u,yLowName:p,xKey:g,yHighKey:m,yHighName:y,legendItemName:x,...C})}legendItemSymbol(){const{fill:e,topLevel:t}=this.getStyle(void 0),{stroke:i,strokeWidth:n,strokeOpacity:s,lineDash:a,marker:o}=t;return{marker:{shape:o.shape,fill:o.fill??e,stroke:o.stroke??i,fillOpacity:o.fillOpacity,strokeOpacity:o.strokeOpacity,strokeWidth:o.strokeWidth,lineDash:o.lineDash,lineDashOffset:o.lineDashOffset},line:{enabled:!0,stroke:i,strokeOpacity:s,strokeWidth:n,lineDash:a}}}getLegendData(e){if("category"!==e)return[];const{id:t,visible:i}=this,{yLowKey:n,yHighKey:s,yName:a,yLowName:o,yHighName:r,legendItemName:l,showInLegend:h}=this.properties;return[{legendType:"category",id:t,itemId:`${n}-${s}`,seriesId:t,enabled:i,label:{text:`${l??a??`${o??n} - ${r??s}`}`},symbol:this.legendItemSymbol(),legendItemName:l,hideInLegend:!h}]}isLabelEnabled(){return this.properties.label.enabled}nodeFactory(){return new Vc}animateEmptyUpdateReady(e){const{datumSelection:t,labelSelection:i,contextData:n,paths:s}=e,{animationManager:a}=this.ctx;this.updateAreaPaths(s,n),Mc(this,a,...s),kc([t],Sc),Dc(this,a,{...this.getAnimationDrawingModes(),phase:"initial"},t),Ic(this,"labels",a,i,this.highlightLabelSelection)}animateReadyResize(e){const{contextData:t,paths:i}=e;this.updateAreaPaths(i,t),super.animateReadyResize(e)}animateWaitingUpdateReady(e){const{animationManager:t}=this.ctx,{datumSelection:i,labelSelection:n,contextData:s,paths:a,previousContextData:o}=e,[r,l,h]=a;if(null==r&&null==l&&null==h)return;this.resetDatumAnimation(e),this.resetLabelAnimation(e);const c=()=>{this.resetPathAnimation(e),this.updateAreaPaths(a,s)};if(null==s||null==o)return c(),Ec(this,t,"added",this.getAnimationDrawingModes(),i),Rc(this,"fill_path_properties",t,"add",r),Rc(this,"low_stroke_path_properties",t,"add",l),Rc(this,"high_stroke_path_properties",t,"add",h),void Ic(this,"labels",t,n,this.highlightLabelSelection);const d=ac(s,o,this.processedData?.reduced?.diff?.[this.id]);if(void 0===d)return t.skipCurrentBatch(),void c();"no-op"!==d.status&&(zc(this.id,"fill_path_properties",t,[r],d.fill.pathProperties),zc(this.id,"low_stroke_path_properties",t,[l],d.stroke.pathProperties),zc(this.id,"high_stroke_path_properties",t,[h],d.stroke.pathProperties),"added"===d.status?this.updateAreaPaths(a,s):"removed"===d.status?this.updateAreaPaths(a,o):(Bc(this.id,"fill_path_update",t,[r],d.fill.path),Bc(this.id,"low_stroke_path_update",t,[l],d.stroke.path),Bc(this.id,"high_stroke_path_update",t,[h],d.stroke.path)),d.hasMotion&&(Ec(this,t,void 0,this.getAnimationDrawingModes(),i),Ic(this,"labels",t,n,this.highlightLabelSelection)),this.ctx.animationManager.animate({id:this.id,groupId:"reset_after_animation",phase:"trailing",from:{},to:{},onComplete:()=>this.updateAreaPaths(a,s)}))}getFormattedMarkerStyle(e){const t=this.getStyle(void 0),i=this.makeItemStylerParams(e.itemType);return this.getMarkerStyle(this.properties.item[e.itemType].marker,e,i,{isHighlight:!0,resolveMarkerSubPath:["item",e.itemType,"marker"]},void 0,t)}getMarkerStyle(e,t,i,n,s,a){return e.itemStyler=this.properties.marker.itemStyler,super.getMarkerStyle(e,t,i,n,s,a)}computeFocusBounds(e){const t=Lc(this,e),i=Lc(this,{...e,datumIndex:e.datumIndex+1});if(t&&i)return $c.merge([t,i])}isDatumEnabled(e,t){return t%2==0&&super.isDatumEnabled(e,t)}hasItemStylers(){return this.properties.selection.enabled||null!=this.properties.styler||null!=this.properties.marker.itemStyler||null!=this.properties.label.itemStyler}};return e.className="RangeAreaSeries",e.type="range-area",e.keyByItemType=e=>e.itemType,e.computeNoStylerMarkerStyle=(e,t,i,n,s)=>{const a=e.getStyle(i),{fill:o,fillOpacity:r,item:l}=a,{stroke:h,strokeWidth:c,strokeOpacity:d}=l[s.itemType],u=e.properties.item[s.itemType].marker;return e.getMarkerStyle(u,s,void 0,{isHighlight:t.isHighlight,highlightState:i,selectionState:n,resolveMarkerSubPath:["item",s.itemType,"marker"],hideWithSize0:t.hideWithSize0},a.item[s.itemType].marker,{fill:o,fillOpacity:r,stroke:h,strokeWidth:c,strokeOpacity:d})},e.computeStylerStyle=(e,t,i)=>e.getStyle(i),e.applyStylerDatum=(e,t,i,n,s,a)=>{const{fill:o,fillOpacity:r,item:l}=a,{stroke:h,strokeWidth:c,strokeOpacity:d}=l[i.itemType],u=e.properties.item[i.itemType].marker,p=e.makeItemStylerParams(i.itemType);i.style=e.getMarkerStyle(u,i,p,{isHighlight:t.isHighlight,highlightState:n,selectionState:s,resolveMarkerSubPath:["item",i.itemType,"marker"],hideWithSize0:t.hideWithSize0},a.item[i.itemType].marker,{fill:o,fillOpacity:r,stroke:h,strokeWidth:c,strokeOpacity:d})},e})(),{rangeAreaSeriesThemeableOptionsDef:id}=s.n1,nd=(()=>({...n.XxK,...id,type:(0,n.mw3)((0,n.dYl)("range-area")),xKey:(0,n.mw3)(n.YjP),yLowKey:(0,n.mw3)(n.YjP),yHighKey:(0,n.mw3)(n.YjP),xKeyAxis:n.YjP,yKeyAxis:n.YjP,xName:n.YjP,yName:n.YjP,yLowName:n.YjP,yHighName:n.YjP,legendItemName:n.YjP,segmentation:n.i_e,invertedStyle:{enabled:n.zMY,...n.Fup}}))();nd.pickOutsideVisibleMinorAxis=(0,n._Le)(n.zMY),nd.focusPriority=(0,n._Le)(n.aig);var sd={lineDash:{$path:"/series/$index/lineDash"},lineDashOffset:{$path:"/series/$index/lineDashOffset"},stroke:{$path:["/series/$index/stroke",{$palette:"stroke"}]},strokeOpacity:{$path:"/series/$index/strokeOpacity"},strokeWidth:{$path:["/series/$index/strokeWidth",1]},marker:{enabled:{$path:"/series/$index/marker/enabled"},fill:{$isUserOption:["/series/$index/marker/fill",{$if:[{$or:[{$isGradient:{$path:"/series/$index/marker/fill"}},{$isImage:{$path:"/series/$index/marker/fill"}},{$isPattern:{$path:"/series/$index/marker/fill"}}]},{$merge:[{$path:"/series/$index/marker/fill"},{$applySwitch:[{$path:"type"},void 0,["gradient",n.pRl],["image",n.pwE],["pattern",n.eu4]]}]},{$isUserOption:["/series/$index/marker/fill",{$path:"/series/$index/marker/fill"},{$palette:"fill"}]}]},{$applySwitch:[{$path:"type"},{$palette:"fill"},["gradient",n.pRl],["image",n.pwE],["pattern",n.eu4]]}]},fillOpacity:{$path:"/series/$index/marker/fillOpacity"},lineDash:{$path:"/series/$index/marker/lineDash"},lineDashOffset:{$path:"/series/$index/marker/lineDashOffset"},shape:{$path:"/series/$index/marker/shape"},size:{$path:["/series/$index/marker/size",6]},stroke:{$path:["/series/$index/marker/stroke",{$palette:"stroke"}]},strokeOpacity:{$path:"/series/$index/marker/strokeOpacity"},strokeWidth:{$path:["/series/$index/marker/strokeWidth",2]}}},ad=(()=>({series:{fill:{$applySwitch:[{$path:"type"},{$palette:"fill"},["gradient",n.Euh],["pattern",n.eu4]]},fillOpacity:.7,stroke:{$palette:"stroke"},strokeWidth:1,marker:{enabled:!1,fill:{$applySwitch:[{$path:"type"},{$palette:"fill"},["gradient",n.pRl],["image",n.pwE],["pattern",n.eu4]]},shape:"circle",stroke:{$palette:"stroke"},size:6,strokeWidth:2}
1,nodeClickRange:{$if:[{$path:"/selection/enabled"},10,"nearest"]},item:{low:sd,high:sd},label:{...n.VTt,...n.F$C,enabled:!1,placement:"outside",fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},spacing:10,padding:10,collision:{alwaysShow:n.O2O},insideStyle:(0,n.KVS)("textColor"),outsideStyle:(0,n.KVS)("textColor")},interpolation:{type:"linear"},tooltip:{range:{$path:["/tooltip/range","nearest"]}},highlight:n.U3R,selection:n.zg6,segmentation:n.IgM,invertedStyle:{enabled:!1,fill:{$applySwitch:[{$path:"type"},{$palette:"fill"},["gradient",n.Euh],["image",n.pwE],["pattern",n.eu4]]},fillOpacity:{$path:"../fillOpacity"}}},axes:{[n.uCf.NUMBER]:{crosshair:{enabled:!0}}}}))(),{predictCartesianNonPrimitiveAxis:od}=s.n1,rd={type:"series",name:"range-area",chartType:"cartesian",enterprise:!0,version:s.xv,dependencies:[s.bI],options:nd,matchingKeys:["xKey","yLowKey","yHighKey","normalizedTo"],predictAxis:od,defaultAxes:{y:{type:n.uCf.NUMBER,position:n.v9C.LEFT},x:{type:n.uCf.CATEGORY,position:n.v9C.BOTTOM}},axisKeys:{[n.tv$.X]:"xKeyAxis",[n.tv$.Y]:"yKeyAxis"},themeTemplate:ad,create:e=>new td(e)};function ld(e,t,i,s,a,o,r,l){return(0,n.fq3)([s,a],e,t,i,{smallestKeyInterval:o,xNeedsValueOf:r,yNeedsValueOf:l})}var hd=(0,n.XB6)(ld);var{AbstractBarSeriesProperties:cd,makeSeriesTooltip:dd,DropShadow:ud,Label:pd,LabelPlacementStyle:gd}=s.n1,md=(()=>{var e=class extends pd{constructor(){super(...arguments),this.placement="inside",this.spacing=0,this.insideStyle=new gd,this.outsideStyle=new gd}};return l([n.mAP],e.prototype,"placement",2),l([n.mAP],e.prototype,"spacing",2),l([n.mAP],e.prototype,"insideStyle",2),l([n.mAP],e.prototype,"outsideStyle",2),e})(),yd=(()=>{var e=class extends cd{constructor(){super(...arguments),this.fill="#99CCFF",this.fillOpacity=1,this.stroke="#99CCFF",this.strokeWidth=1,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.cornerRadius=0,this.shadow=(new ud).set({enabled:!1}),this.label=new md,this.tooltip=dd()}};return l([n.mAP],e.prototype,"xKey",2),l([n.mAP],e.prototype,"yLowKey",2),l([n.mAP],e.prototype,"yHighKey",2),l([n.mAP],e.prototype,"xName",2),l([n.mAP],e.prototype,"yName",2),l([n.mAP],e.prototype,"yLowName",2),l([n.mAP],e.prototype,"yHighName",2),l([n.mAP],e.prototype,"fill",2),l([n.mAP],e.prototype,"fillOpacity",2),l([n.mAP],e.prototype,"stroke",2),l([n.mAP],e.prototype,"strokeWidth",2),l([n.mAP],e.prototype,"strokeOpacity",2),l([n.mAP],e.prototype,"lineDash",2),l([n.mAP],e.prototype,"lineDashOffset",2),l([n.mAP],e.prototype,"cornerRadius",2),l([n.mAP],e.prototype,"styler",2),l([n.mAP],e.prototype,"itemStyler",2),l([n.mAP],e.prototype,"shadow",2),l([n.mAP],e.prototype,"label",2),l([n.mAP],e.prototype,"tooltip",2),e})(),{barLabelObstaclesFor:fd,barLabelDataContext:xd,SeriesNodePickMode:bd,valueProperty:vd,keyProperty:Sd,checkCrisp:Md,fitLabelToContainerAutoSize:kd,buildBarLabelCandidates:Dd,createBarCandidateStyleResolver:wd,createBarPositionedCandidateResolver:Id,styledBarLabelBox:Ad,toResolvedPlacement:Cd,updateLabelNode:Nd,pickPlacementStyle:Ld,expandPlacementLabelBoxExtent:Pd,resolvePlacementLabelBoxExtent:Td,SMALLEST_KEY_INTERVAL:Od,LARGEST_KEY_INTERVAL:Rd,diff:Ed,prepareBarAnimationFunctions:zd,midpointStartingBarPosition:Bd,resetBarSelectionsFn:Fd,resetBarSelectionsDirect:Vd,fixNumericExtent:$d,seriesLabelFadeInAnimation:Hd,resetLabelFn:jd,animationValidation:Wd,computeBarFocusBounds:_d,visibleRangeIndices:Gd,createDatumId:Kd,Rect:Yd,PointerEvents:Ud,motion:Xd,processedDataIsAnimatable:Zd,getItemStyles:qd,calculateSegments:Qd,toHighlightString:Jd,toSelectionString:eu,HighlightState:tu,AggregationManager:iu,upsertNodeDatum:nu}=s.n1;function su(e,t){const[i]=t;e.x=i.anchor.x,e.y=i.anchor.y,e.textAlign=i.anchor.textAlign,e.textBaseline=i.anchor.textBaseline,e.region=i.region,e.offsetX=0,e.offsetY=0,e.placement=i.placement,e.candidates=t}var au=(()=>{var e=class extends s.n1.AbstractBarSeries{constructor(e){super({moduleCtx:e,pickModes:[bd.AXIS_ALIGNED,bd.EXACT_SHAPE_MATCH],propertyKeys:{x:["xKey"],y:["yLowKey","yHighKey"]},propertyNames:{x:["xName"],y:["yLowName","yHighName","yName"]},categoryKey:"xValue",datumSelectionGarbageCollection:!1,animationResetFns:{datum:Fd,label:jd}}),this.properties=new yd,this.aggregationManager=new iu}createNodeParams(e){return{...super.createNodeParams(e),xKey:this.properties.xKey,yLowKey:this.properties.yLowKey,yHighKey:this.properties.yHighKey}}async processData(e){const{xKey:t,yLowKey:i,yHighKey:n}=this.properties,s=this.getCategoryAxis()?.scale,a=this.getValueAxis()?.scale,{isContinuousX:o,xScaleType:r,yScaleType:l}=this.getScaleInformation({xScale:s,yScale:a}),h=[];this.needsDataModelDiff()&&this.processedData&&h.push(Ed(this.id,this.processedData)),this.ctx.animationManager.isSkipped()||h.push(Wd());const c=this.visible?{}:{forceValue:Number.NaN},d=this.properties.allowNullKeys??!1,{dataModel:u,processedData:p}=await this.requestDataModel(e,this.data,{props:[Sd(t,r,{id:"xValue",allowNullKey:d}),vd(i,l,{id:"yLowValue",invalidValue:null,...c}),vd(n,l,{id:"yHighValue",invalidValue:null,...c}),...o?[Od,Rd]:[],...h],groupByKeys:!1});this.smallestDataInterval=p.reduced?.smallestKeyInterval,this.largestDataInterval=p.reduced?.largestKeyInterval,this.aggregateData(u,p),this.animationState.transition("updateData")}aggregateData(e,t){if(this.aggregationManager.markStale(t.input.count),"ungrouped"!==t.type)return;if(Zd(t))return;const i=this.axes[n.tv$.X];if(null==i)return;const s=this.estimateTargetRange();this.aggregationManager.aggregate({computePartial:a=>function(e,t,i,s,a,o){const r=t.resolveKeysById(s,"xValue",i),l=t.resolve
1ColumnById(s,"yHighValue",i,"mixed-numeric"),h=t.resolveColumnById(s,"yLowValue",i,"mixed-numeric"),c=t.getDomain(s,"xValue","key",i),d=t.resolveColumnNeedsValueOf(s,"xValue",i),u=t.resolveColumnNeedsValueOf(s,"yHighValue",i)??t.resolveColumnNeedsValueOf(s,"yLowValue",i),{values:p,needsValueOf:g}=(0,n.QP0)(e,r,d),{xValues:m,domain:y}=(0,n.g3H)(e,p,c),f=u?l:(0,n.X_t)(l),x=u?h:(0,n.X_t)(h);return(0,n.EXR)(y,m,f,x,{smallestKeyInterval:i.reduced?.smallestKeyInterval,targetRange:a,xNeedsValueOf:g,yNeedsValueOf:u,existingFilters:o})}(i.scale.type,e,t,this,s,a),computeFull:s=>function(e,t,i,s,a){const o=t.resolveKeysById(s,"xValue",i),r=t.resolveColumnById(s,"yHighValue",i,"mixed-numeric"),l=t.resolveColumnById(s,"yLowValue",i,"mixed-numeric"),h=t.getDomain(s,"xValue","key",i),c=t.resolveColumnNeedsValueOf(s,"xValue",i),d=t.resolveColumnNeedsValueOf(s,"yHighValue",i)??t.resolveColumnNeedsValueOf(s,"yLowValue",i),{values:u,needsValueOf:p}=(0,n.QP0)(e,o,c),{xValues:g,domain:m}=(0,n.g3H)(e,u,h),y=d?r:(0,n.X_t)(r),f=d?l:(0,n.X_t)(l);return a?(0,n.fq3)(m,g,y,f,{smallestKeyInterval:i.reduced?.smallestKeyInterval,xNeedsValueOf:p,yNeedsValueOf:d,existingFilters:a}):hd(g,y,f,m[0],m[1],i.reduced?.smallestKeyInterval,p,d)}(i.scale.type,e,t,this,s),targetRange:s});const a=this.aggregationManager.filters;a&&a.length>0&&n.Xjz.record(`${this.type}:aggregation`,a.map((e=>e.maxRange)))}createBucketLookupFeature(){return new s.n1.BucketLookupManager({series:this,getXAxis:()=>this.axes[n.tv$.X],getDataModel:()=>this.dataModel,getProcessedData:()=>this.processedData,aggregationManager:this.aggregationManager,dataSelectionService:this.ctx.dataSelectionService,domainKey:"key"})}estimateTargetRange(){const e=this.axes[n.tv$.X];if(null==e?.scale)return 0;const[t,i]=e.scale.range;return Math.abs(i-t)}getSeriesDomain(e){const{processedData:t,dataModel:i}=this;if(!t||!i)return{domain:[]};const{keys:[s]}=t.domain;if(e===this.getCategoryDirection()){const e=i.resolveProcessedDataDefById(this,"xValue");if("key"===e?.def.type&&"category"===e?.def.valueType){return{domain:s,sortMetadata:i.getKeySortMetadata(this,"xValue",t)}}return{domain:this.padBandExtent(s)}}{const t=this.domainForClippedRange(e,["yHighValue","yLowValue"],"xValue"),i=(0,n.uYy)(t);return{domain:$d(i)}}}getSeriesRange(e,t){const[i,s]=this.domainForVisibleRange(n.tv$.Y,["yHighValue","yLowValue"],"xValue",t);return[(0,n.Roz)(i),(0,n.Roz)(s)]}createNodeDatumContext(e,t){const{dataModel:i,processedData:s}=this;if(!i||!s)return;const a=s.dataSources?.get(this.id)?.data;if(null==a)return;const o=e.scale,r=t.scale,l=this.getBarDirection()===n.tv$.X,h=Md(e?.scale,e?.visibleRange,this.smallestDataInterval,this.largestDataInterval),[c,d]=o.range,u=Math.abs(d-c);this.aggregationManager.ensureLevelForRange(u);const p=this.aggregationManager.getFilterForRange(u);this.ensureBucketLookupFeature()?.setActiveFilter(s,p);const g=!this.ctx.animationManager.isSkipped(),m=null!=this.contextNodeData?.nodeData&&(null!=s.changeDescription||!Zd(s)||null!=p),{groupOffset:y,barOffset:f,barWidth:x}=this.getBarDimensions(),b=(0,n.$rL)(this.properties.label.placement)[0],v=this.properties.label,S="outside"===b?v.outsideStyle:v.insideStyle,M=Td(v,S),k="outside"===b,D=k?1:-1,[w,I]=l?["right","left"]:["top","bottom"],A=k?w:I,C=k?I:w,N=(0,n.qlQ)((0,n.$rL)(this.properties.label.orientation)[0]),L=(0,n.A_g)(v,!v.collision.alwaysShow);return{xAxis:e,yAxis:t,rawData:a,xValues:i.resolveKeysById(this,"xValue",s),yLowValues:i.resolveColumnById(this,"yLowValue",s,"mixed-numeric"),yHighValues:i.resolveColumnById(this,"yHighValue",s,"mixed-numeric"),xScale:o,yScale:r,groupOffset:y,barOffset:f,barWidth:x,barAlongX:l,yReversed:t.isReversed(),crisp:h,dataAggregationFilter:p,animationEnabled:g,xKey:this.properties.xKey,yLowKey:this.properties.yLowKey,yHighKey:this.properties.yHighKey,labelEnabled:this.properties.label.enabled,labelPlacement:b,labelRotation:N,labelResolvesOrientation:(0,n.fjG)(this.properties.label.orientation),labelRoutesThroughEngine:(0,n.hqp)(this.properties.label.orientation,this.properties.label.placement,this.properties.label.collision.alwaysShow,L),labelFit:L,yLowPadding:(v.spacing+M[A])*D,yHighPadding:(v.spacing+M[C])*D,labelSpacing:v.spacing,labelSign:D,labelBoxPadding:M,yLowFacing:A,yHighFacing:C,canIncrementallyUpdate:m,nodes:m?this.contextNodeData.nodeData:[],nodeIndex:0}}prepareNodeDatumState(e,t,i){const s=e.rawData[i],a=e.xValues[i];if(void 0===a&&!this.properties.allowNullKeys)return;const o=e.yLowValues[i],r=e.yHighValues[i];if(!(0,n.QQF)(o)||!(0,n.QQF)(r))return;const[l,h]=o<r?[o,r]:[r,o];return t.datum=s,t.xValue=a,t.yLowValue=l,t.yHighValue=h,t.rawLowValue=o,t.rawHighValue=r,t}createSkeletonNodeDatum(e,t){const i=t.nodeDatumScratch;return{index:t.groupedDataIndex,series:this,datum:i.datum,datumIndex:t.datumIndex,xValue:i.xValue,yLowValue:0,yHighValue:0,yLowKey:e.yLowKey,yHighKey:e.yHighKey,xKey:e.xKey,x:0,y:0,width:0,height:0,midPoint:{x:0,y:0},crisp:t.crisp,labels:[]}}createNodeDatum(e,t,i,n){const s=this.prepareNodeDatumState(e,t.nodeDatumScratch,t.datumIndex);if(!s)return;const a=this.createSkeletonNodeDatum(e,t);return this.updateNodeDatum(e,a,t,n,s),a}updateNodeDatum(e,t,i,n,s){if(s??(s=this.prepareNodeDatumState(e,i.nodeDatumScratch,i.datumIndex)),!s)return;const a=t;a.index=i.groupedDataIndex,a.datum=s.datum,a.datumIndex=i.datumIndex,a.xValue=s.xValue,a.yLowValue=s.rawLowValue,a.yHighValue=s.rawHighValue,a.crisp=i.crisp;const o=Math.round(e.yScale.convert(i.yHigh)),r=Math.round(e.yScale.convert(i.yLow)),l=Math.max(n,Math.abs(r-o)),h={x:e.barAlongX?Math.min(o,r):i.x,y:e.barAlongX?i.x:Math.min(o,r),width:e.barAlongX?l:i.width,height:e.barAlongX?i.width:l};a.x=h.x,a.y=h.y,a.width=h.width,a.height=h.height;const c=a.midPoint;c.x=h.x+h.width/2,c.y=h.y+h.height/2;const d=a.clipBBox;d&&(d.x=h.x,d.y=h.y,d.width=h.width,d.height=h.height);const u=i.labelParamsScratch;u.labels=a.labels,u.datumIndex=i.datumIndex,u.rectX=h.x,u.rectY=h.y,u.rectWidth=h.width,u.rectHeight=h.height,u.yLowValue=s.yLowValue,u.yHighValue=s.yHighValue,u.datum=s.datum,this.updateLabelData(e,u)}createNodeDataWithAggregation(e,t,i,s,a,o){const{maxRange:r,indexData:l,midpointIndices:h}=o,[c,d]=Gd(1,r,e.xAxis.range,(i=>{const s=i*n.kmN,a=l[s+n.IXP],o=h[i];if(-1!==o)return[t(o),t(a)+e.barWidth]}));for(let o=c;o<d;o+=1){const r=o*n.kmN,c=l[r+n.qbB],d=l[r+n.IXP],u=l[r+n.jBM],p=l[r+n.BNK],g=h[o];if(-1===g)continue;(void 0!==e.xValues[g]||this.properties.allowNullKeys)&&(i.datumIndex=g,i.groupedDataIndex=0,i.x=t(g),i.width=Math.abs(t(c)-t(d))+e.barWidth,i.yLow=e.yLowValues[u],i.yHigh=e.yHighValues[p],i.crisp=e.crisp,nu(e,i,((e,t)=>this.createNodeDatum(e,t,s,a)),((e,t,i)=>this.updateNodeDatum(e,t,i,a))))}}createNodeDataSimple(e,t,i,n,s,a){const o=a.invalidData?.get(this.id
1);let[r,l]=this.visibleRangeIndices("xValue",e.xAxis.range);a.input.count<1e3&&(r=0,l=a.input.count);for(let a=r;a<l;a+=1)!0!==o?.[a]&&(i.datumIndex=a,i.groupedDataIndex=0,i.x=t(a),i.width=e.barWidth,i.yLow=e.yLowValues[a],i.yHigh=e.yHighValues[a],i.crisp=e.crisp,nu(e,i,((e,t)=>this.createNodeDatum(e,t,n,s)),((e,t,i)=>this.updateNodeDatum(e,t,i,s))))}createNodeDataGrouped(e,t,i,n,s){const a=this.processedData;for(const{datumIndex:o,groupIndex:r}of this.dataModel.forEachGroupDatum(this,a))i.datumIndex=o,i.groupedDataIndex=r,i.x=t(o),i.width=e.barWidth,i.yLow=e.yLowValues[o],i.yHigh=e.yHighValues[o],i.crisp=e.crisp,nu(e,i,((e,t)=>this.createNodeDatum(e,t,n,s)),((e,t,i)=>this.updateNodeDatum(e,t,i,s)))}populateNodeData(e){const{processedData:t}=this;if(!t)return;const{yLowKey:i,yHighKey:n,strokeWidth:s}=this.properties,a=`${i}-${n}`,o=t=>{const i=e.xScale.convert(e.xValues[t]);return Number.isFinite(i)?i+e.groupOffset+e.barOffset:Number.NaN},r={nodeDatumScratch:{datum:void 0,xValue:void 0,yLowValue:0,yHighValue:0,rawLowValue:0,rawHighValue:0},labelParamsScratch:{labels:[],datumIndex:0,rectX:0,rectY:0,rectWidth:0,rectHeight:0,yLowValue:0,yHighValue:0,datum:void 0},datumIndex:0,groupedDataIndex:0,x:0,width:0,yLow:0,yHigh:0,crisp:!1};null!=e.dataAggregationFilter?this.createNodeDataWithAggregation(e,o,r,a,s,e.dataAggregationFilter):"ungrouped"===t.type?this.createNodeDataSimple(e,o,r,a,s,t):this.createNodeDataGrouped(e,o,r,a,s)}finalizeNodeData(e){e.canIncrementallyUpdate&&e.nodeIndex<e.nodes.length&&(e.nodes.length=e.nodeIndex)}initializeResult(e){const{yLowKey:t,yHighKey:i}=this.properties,n=`${t}-${i}`,s=this.getCategoryAxis(),a=this.getValueAxis(),o=s&&a&&this.chart?.seriesRect?Qd(this.properties.segmentation,s,a,this.chart.seriesRect,this.ctx.scene):void 0;return{itemId:n,nodeData:e.nodes,labelData:[],scales:this.calculateScaling(),groupScale:this.getScaling(this.ctx.seriesStateManager.getGroupScale(this)),visible:this.visible,styles:qd(this.getItemStyle.bind(this)),segments:o}}assembleResult(e,t){for(const i of e.nodes)t.labelData.push(...i.labels);return t}updateLabelData(e,t){const i=t.labels;if(!e.labelEnabled)return void(i.length>0&&(i.length=0));const{xKey:s,yLowKey:a,yHighKey:o,xName:r,yLowName:l,yHighName:h,yName:c,legendItemName:d,label:u}=this.properties,p=e.barAlongX,g=e.labelPlacement,m=e.labelRotation,y=t.rectX,f=t.rectY,x=t.rectWidth,b=t.re
1ctHeight,v={x:y,y:f,width:x,height:b},S="inside"===g&&(null!=e.labelFit||e.labelResolvesOrientation)?(0,n.gEE)(v,u.spacing,u.spacing,!p):void 0,M=(0,n.$rL)(u.placement).every((e=>"inside"===e)),k=S&&M?(0,n.bRJ)(S,Pd(u)):void 0,D=e.labelResolvesOrientation?S:void 0,w=t.datum,I=t.yLowValue,A=t.yHighValue,C=t.datumIndex,N={datum:w,xKey:s,yLowKey:a,yHighKey:o,xName:r,yLowName:l,yHighName:h,yName:c,legendItemName:d},L=this.getSeriesDomain(n.tv$.Y).domain,P=t=>e.labelRoutesThroughEngine?{text:t,fontSize:void 0}:kd(t,e.labelFit,u,k),{text:T,fontSize:O}=P(this.getLabelText(I,w,a,"y",L,u,{itemType:"low",value:I,...N})),{text:R,fontSize:E}=P(this.getLabelText(A,w,o,"y",L,u,{itemType:"high",value:A,...N}));let z=e.yLowPadding,B=e.yHighPadding,F=0;if(0!==m){const t=(0,n.kzl)(T,(0,n.lad)(u,O)),i=(0,n.kzl)(R,(0,n.lad)(u,E)),{labelSpacing:s,labelSign:a,labelBoxPadding:o,yLowFacing:r,yHighFacing:l}=e;z=(s+(0,n.jH0)(r,m,t.width,t.height,o))*a,B=(s+(0,n.jH0)(l,m,i.width,i.height,o))*a;const h=(0,n.baU)(m,o);F=p?h.y:h.x}const V=y+(p?-z:x/2-F),$=f+(p?b/2-F:b+z);let H,j;
1H="outside"===g?p?"right":"center":p?"left":"center",j="outside"===g?p?"middle":"top":p?"middle":"bottom";const W=y+(p?x+B:x/2-F),_=f+(p?b/2-F:-B);let G,K;if(G="outside"===g?p?"left":"center":p?"right":"center",K="outside"===g?p?"middle":"bottom":p?"middle":"top",i.length>0&&"low"===i[0].itemType){const e=i[0];e.datumIndex=C,e.x=V,e.y=$,e.textAlign=H,e.textBaseline=j,e.rotation=m,e.region=D,e.offsetX=0,e.offsetY=0,e.text=T,e.fittedFontSize=O,e.datum=w}else i[0]={datumIndex:C,x:V,y:$,textAlign:H,textBaseline:j,rotation:m,region:D,offsetX:0,offsetY:0,text:T,fittedFontSize:O,itemType:"low",datum:w,series:this};if(i.length>1&&"high"===i[1].itemType){const e=i[1];e.datumIndex=C,e.x=W,e.y=_,e.textAlign=G,e.textBaseline=K,e.rotation=m,e.region=D,e.offsetX=0,e.offsetY=0,e.text=R,e.fittedFontSize=E,e.datum=w}else i[1]={datumIndex:C,x:W,y:_,textAlign:G,textBaseline:K,rotation:m,region:D,offsetX:0,offsetY:0,text:R,fittedFontSize:E,itemType:"high",datum:w,series:this};i.length=2;const Y=i[0],U=i[1];e.yReversed&&([Y.x,U.x]=[U.x,Y.x],[Y.y,U.y]=[U.y,Y.y],[Y.textAlign,U.textAlign]=[U.textAlign,Y.textAlign],[Y.textBaseline,U.textBaseline]=[U.textBaseline,Y.textBaseline]);const X={x:y,y:f,width:x,height:b};Y.ownBox=X,U.ownBox=X;const Z=g??"inside";if((0,n.Yfy)(u.orientation,u.placement,u.collision.alwaysShow,e.labelFit)){const t=(0,n.$rL)(u.placement);0===t.length&&t.push("inside");const i=(0,n.$rL)(u.orientation);0===i.length&&i.push("horizontal");const s=this.resolveLabelPlotRegion(u.collision),a=(a,o)=>{const r=(0,n.kzl)(a,u);return Dd({isUpward:!e.yReversed,isVertical:!p,placements:t.map((e=>`${e}-${o}`)),orientations:i,spacing:u.spacing,label:u,textWidth:r.width,textHeight:r.height,rect:X,plotRegion:s,fitted:null!=e.labelFit,text:a})};su(Y,a(T,"start")),su(U,a(R,"end"))}else Y.candidates=void 0,U.candidates=void 0,Y.placement=`${Z}-start`,U.placement=`${Z}-end`;Y.hidden=!1,U.hidden=!1}nodeFactory(){return new Yd}getStyle(e,t,i,n){const{cornerRadius:s,fill:a,fillOpacity:o,lineDash:r,lineDashOffset:l,stroke:h,strokeOpacity:c,strokeWidth:d,styler:u}=this.properties;let p={};if(!e&&u){const e=this.makeStylerParams(t,i,n);p=this.ctx.optionsGraphService.resolvePartial(["series",`${this.declarationOrder}`],this.cachedCallWithContext(u,e)??{},{pick:!1})??{}}return{cornerRadius:p.cornerRadius??s,fill:p.fill??a,fillOpacity:p.fillOpacity??o,lineDash:p.lineDash??r,lineDashOffset:p.lineDashOffset??l,opacity:1,stroke:p.stroke??h,strokeOpacity:p.strokeOpacity??c,strokeWidth:p.strokeWidth??d}
1}makeStylerParams(e,t,i){const{id:n}=this,{cornerRadius:s,fill:a,fillOpacity:o,lineDash:r,lineDashOffset:l,stroke:h,strokeOpacity:c,strokeWidth:d,xKey:u,yLowKey:p,yHighKey:g}=this.properties;return{cornerRadius:s,fill:a,fillOpacity:o,highlightState:Jd(e??tu.None),selectionState:eu(t),candidateState:eu(i),lineDash:r,lineDashOffset:l,seriesId:n,stroke:h,strokeOpacity:c,strokeWidth:d,xKey:u,yLowKey:p,yHighKey:g}}updateDatumSelection(e){const{nodeData:t,datumSelection:i}=e,n=t??[];return Zd(this.processedData)?i.update(n,void 0,(e=>this.getDatumId(e))):i.update(n)}getItemStyle(e,t,i,s,a){const{properties:o,dataModel:r,processedData:l}=this,{itemStyler:h}=o,c=this.getHighlightStyle(t,e,i),d=this.getSelectionStyle(e,s,a);let u=(0,n.HFk)(d,c,this.getStyle(void 0===e,i,s,a));if(h&&null!=r&&null!=l&&null!=e){const i=r.resolveKeysById(this,"xValue",l)[e],s=this.cachedDatumCallback(Kd(this.getDatumId({xValue:i}),t?"highlight":"node"),(()=>{const i=this.makeItemStylerParams(e,t,u);return this.ctx.optionsGraphService.resolvePartial(["series",`${this.declarationOrder}`],this.callWithContext(h,i))}));s&&(u=(0,n.HFk)(s,u))}return u}makeItemStylerParams(e,t,i){const{id:n,properties:s,processedData:a}=this,{xKey:o,yHighKey:r,yLowKey:l}=s,h=a.dataSources.get(n)?.data[e],c=this.ctx.highlightManager?.getActiveHighlight(),d=this.getHighlightStateString(c,t,e),u=this.getSelectionStateString(e),p=this.getCandidateStateString(e),g=this.filterItemStylerFillParams(i.fill)??i.fill;return{seriesId:n,datum:h,xKey:o,yHighKey:r,yLowKey:l,highlightState:d,selectionState:u,candidateState:p,...i,fill:g}}updateDatumStyles(e){const t=this.ctx.highlightManager.getActiveHighlight();e.datumSelection.each(((i,n)=>{if(!e.datumSelection.isGarbage(i)){const i=this.getHighlightState(t,e.isHighlight,n.datumIndex),s=this.getDataSelectionState(n.datumIndex),a=this.getDataCandidacyState(n.datumIndex);n.style=this.getItemStyle(n.datumIndex,e.isHighlight,i,s,a)}}))}updateDatumNodes({datumSelection:e,isHighlight:t}){const{contextNodeData:i}=this;if(!i)return;const s=this.ctx.highlightManager.getActiveHighlight(),a=this.getCategoryDirection()===n.tv$.X,o=this.getCategoryCrispDirection(),r=this.getShapeFillBBox(),l=this;e.each((function(e,n){const h=n.style??i.styles[l.getHighlightState(s,t,n.datumIndex)];e.setStyleProperties(h,r),e.setStaticProperties("overlay",h.cornerRadius??0,h.cornerRadius??0,h.cornerRadius??0,h.cornerRadius??0,a?n.width>0:n.height>0,n.crisp,void 0),e.crispCentreDirection=o}))}getLabelObstacles(){return fd(this.properties.label,this.contextNodeData?.nodeData,this.contextNodeData?.labelData,this.isLabelEnabled()&&!this.usesPlacedLabels,(e=>e))}getLabelData(){if(!this.usesPlacedLabels||!this.properties.label.enabled)return[];const{label:e}=this.properties,{alwaysShow:t,collideWith:i,threshold:s,measureBox:a,fitFor:o}=xd(e),r=null==e.itemStyler?void 0:wd(this,e,this.makeLabelStylerParams()),l=(0,n.$rL)(e.orientation)[0]??"horizontal",h=[];for(const c of this.contextNodeData?.labelData??[]){if(""===c.text){h.push(...(0,n.AEW)([c],(()=>({label:c,config:e,collideWith:i,threshold:s}))));continue}const d=o(c.text);if(null==c.candidates){const t=Ad(r,c,c.placement??"inside-"+("low"===c.itemType?"start":"end"),l,c.text);if(!0===t?.hidden)continue;h.push(...(0,n.AEW)([c],(()=>({label:c,config:e,size:t?.size??a(c.text),collideWith:i,threshold:s,fit:null==d||null==t?d:{...d,font:t.font,boxPadding:t.boxPadding}}))))}else{const e=a(c.text),o=c.ownBox??{x:c.x,y:c.y,width:0,height:0};h.push((0,n.Nv9)(c.text,e.width,e.height,c.candidates,c,o,t,i,s,!0,d,c))}}return h}getLabelCandidateResolver(){const e=this.makeLabelStylerParams();return Id(this,this.properties.label,(()=>e))}updatePlacedLabelData(e){(0,n.she)(e),(0,n.HkM)(this.contextNodeData?.labelData,e,(e=>e)),this.refreshPlacedLabelNodes()}resolveUsesPlacedLabels(){return(0,n.qpr)(this.properties.label)}updateLabelSelection(e){const t=this.properties.label.enabled?e.labelData:[];return e.labelSelection.update(t,(e=>{e.pointerEvents=Ud.None}))}makeLabelStylerParams(){const{xKey:e,xName:t,yName:i,yLowKey:n,yLowName:s,yHighKey:a,yHighName:o,legendItemName:r}=this.properties;return{xKey:e,xName:t??e,yName:i,yLowKey:n,yLowName:s??n,yHighKey:a,yHighName:o??a,legendItemName:r}}updateLabelNodes(e){const{isHighlight:t=!1}=e,i=this.makeLabelStylerParams(),s=this.ctx.highlightManager?.getActiveHighlight(),{label:a}=this.properties;e.labelSelection.each(((e,o)=>{if(o.hidden)return void(e.visible=!1);e.fillOpacity=this.getHighlightStyle(t,o?.datumIndex).opacity??1;const r=Ld(a,null==o.placement?void 0:Cd(o.placement));Nd(this,e,i,a,o,{isHighlight:t,activeHighlight:s},void 0,r,{placement:o.placement,orientation:(0,n.afe)(o.rotation)})}))}getHighlightLabelData(e,t){return t.labels?.length?t.labels:super.getHighlightLabelData(e,t)}getTooltipContent(e){const{id:t,dataModel:i,processedData:n,properties:a}=this,{xKey:o,xName:r,yName:l,yLowKey:h,yHighKey:c,yLowName:d,yHighName:u,tooltip:p,legendItemName:g}=a,m=this.getCategoryAxis(),y=this.getValueAxis();if(!(i&&n&&m&&y))return;
1const f=n.dataSources.get(this.id)?.data[e],x=i.resolveKeysById(this,"xValue",n)[e],b=i.resolveColumnById(this,"yHighValue",n,"mixed-numeric")[e],v=i.resolveColumnById(this,"yLowValue",n,"mixed-numeric")[e],S=this.properties.allowNullKeys??!1;if(void 0===x&&!S)return;const M=this.getItemStyle(e,!1,void 0,void 0,void 0),k=`${this.getAxisValueText(y,"tooltip",v,f,h,g)} - ${this.getAxisValueText(y,"tooltip",b,f,c,g)}`;return this.formatTooltipWithContext(p,{heading:this.getAxisValueText(m,"tooltip",x,f,o,g),symbol:this.legendItemSymbol(),data:[{label:l,fallbackLabel:`${d??h} - ${u??c}`,value:k,missing:s.n1.isTooltipValueMissing(b)&&s.n1.isTooltipValueMissing(v)}]},{seriesId:t,datum:f,title:l,xKey:o,xName:r,yName:l,yLowKey:h,yHighKey:c,yLowName:d,yHighName:u,legendItemName:g,...M})}legendItemSymbol(){const{fill:e,stroke:t,strokeWidth:i,fillOpacity:n,strokeOpacity:s,lineDash:a,lineDashOffset:o}=this.getStyle(!1,tu.None,void 0,void 0);return{marker:{fill:e,stroke:t,fillOpacity:n,strokeOpacity:s,strokeWidth:i,lineDash:a,lineDashOffset:o}}}getLegendData(e){if("category"!==e)return[];const{id:t,visible:i}=this,{yName:n,yLowName:s,yHighName:a,yLowKey:o,yHighKey:r,legendItemName:l,showInLegend:h}=this.properties;return[{legendType:"category",id:t,itemId:`${o}-${r}`,seriesId:t,enabled:i,label:{text:`${l??n??`${s??o} - ${a??r}`}`},symbol:this.legendItemSymbol(),legendItemName:l,hideInLegend:!h}]}resetDatumAnimation(e){Vd([e.datumSelection])}animateEmptyUpdateReady({datumSelection:e,labelSelection:t}){const i=zd(Bd(this.isVertical(),"normal"),"unknown");Xd.fromToMotion(this.id,"datums",this.ctx.animationManager,[e],i),Hd(this,"labels",this.ctx.animationManager,t,this.highlightLabelSelection)}animateWaitingUpdateReady(e){const{datumSelection:t,labelSelection:i,contextData:a,previousContextData:o}=e,r=s.n1.calculateDataDiff(this.id,t,this.getDatumId.bind(this),a,o,this.processedData,this.processedDataUpdated);this.ctx.animationManager.stopByAnimationGroupId(this.id);const l=null==o?"fade":"normal",h=zd(Bd(this.isVertical(),l),"added");Xd.fromToMotion(this.id,"datums",this.ctx.animationManager,[t],h,(e=>this.getDatumId(e.unsafeDatum)),r),!r?.changed&&(0,n.wo0)(a.groupScale,o?.groupScale)||Hd(this,"labels",this.ctx.animationManager,i,this.highlightLabelSelection)}getDatumId(e){return`${e.xValue}`}isLabelEnabled(){return this.properties.label.enabled}computeFocusBounds({datumIndex:e}){return _d(this,this.contextNodeData?.nodeData[e])}hasItemStylers(){return this.properties.selection.enabled||null!=this.properties.styler||null!=this.properties.itemStyler||null!=this.properties.label.itemStyler}};return e.className="RangeBarSeries",e.type="range-bar",e})(),{rangeBarSeriesThemeableOptionsDef:ou}=s.n1,ru=(()=>({...n.XxK,...ou,type:(0,n.mw3)((0,n.dYl)("range-bar")),xKey:(0,n.mw3)(n.YjP),yLowKey:(0,n.mw3)(n.YjP),yHighKey:(0,n.mw3)(n.YjP),xKeyAxis:n.YjP,yKeyAxis:n.YjP,xName:n.YjP,yName:n.YjP,yLowName:n.YjP,yHighName:n.YjP,legendItemName:n.YjP,segmentation:n.i_e,width:n.MX6,widthRatio:n.CGN}))();ru.pickOutsideVisibleMinorAxis=(0,n._Le)(n.zMY),ru.focusPriority=(0,n._Le)(n.aig);var lu=(()=>({series:{direction:"vertical",fill:{$applySwitch:[{$path:"type"},{$palette:"fill"},["gradient",n.Euh],["image",n.pwE],["pattern",n.eu4]]},stroke:{$palette:"stroke"},strokeWidth:{$isUserOption:["./stroke",2,0]},label:{...n.VTt,...n.F$C,enabled:!1,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},spacing:6,padding:6,collision:{threshold:4,alwaysShow:n.O2O,...(0,n.fs4)({collideWith:{seriesItems:!0}})},insideStyle:(0,n.KVS)("chartBackgroundColor"),outsideStyle:(0,n.KVS)("textColor"),placement:"inside"},highlight:n.fil,selection:n.zg6,segmentation:n.IgM},axes:{[n.uCf.NUMBER]:{crosshair:{enabled:!0}}}}))(),{predictCartesianNonPrimitiveAxis:hu}=s.n1,cu={type:"series",name:"range-bar",chartType:"cartesian",enterprise:!0,groupable:!0,version:s.xv,dependencies:[s.bI],options:ru,matchingKeys:["xKey","yLowKey","yHighKey","normalizedTo"],predictAxis:hu,defaultAxes:n.QTQ,axisKeys:{[n.tv$.X]:"xKeyAxis",[n.tv$.Y]:"yKeyAxis"},axisKeysFlipped:{[n.tv$.X]:"yKeyAxis",[n.tv$.Y]:"xKeyAxis"},themeTemplate:lu,create:e=>new au(e)},{AbstractBarSeriesProperties:du,makeSeriesTooltip:uu,DropShadow:pu,Label:gu,LabelPlacementStyle:mu}=s.n1,yu=(()=>{var e=class extends n.XPE{};return l([n.mAP],e.prototype,"totalType",2),l([n.mAP],e.prototype,"index",2),l([n.mAP],e.prototype,"axisLabel",2),l([n.mAP],e.prototype,"itemId",2),e})(),fu=(()=>{var e=class extends n.XPE{};return l([n.mAP],e.prototype,"renderer",2),e})(),xu=(()=>{var e=class extends gu{constructor(){super(...arguments),this.placement="outside-end",this.spacing=0,this.insideStyle=new mu,this.outsideStyle=new mu}};return l([n.mAP],e.prototype,"placement",2),l([n.mAP],e.prototype,"spacing",2),l([n.mAP],e.prototype,"insideStyle",2),l([n.mAP],e.prototype,"outsideStyle",2),e})(),bu=(()=>{var e=class extends n.XPE{constructor(){super(...arguments),this.fill="#c16068",this.stroke="#c16068",this.fillOpacity=1,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.strokeWidth=1,this.cornerRadius=0,this.shadow=(new pu).set({enabled:!1}),this.label=new xu,this.tooltip=new fu}};return l([n.mAP],e.prototype,"name",2),l([n.mAP],e.prototype,"fill",2),l([n.mAP],e.prototype,"stroke",2),l([n.mAP],e.prototype,"fillOpacity",2),l([n.mAP],e.prototype,"strokeOpacity",2),l([n.mAP],e.prototype,"lineDash",2),l([n.mAP],e.prototype,"lineDashOffset",2),l([n.mAP],e.prototype,"strokeWidth",2),l([n.mAP],e.prototype,"cornerRadius",2),l([n.mAP],e.prototype,"itemStyler",2),l([n.mAP],e.prototype,"shadow",2),l([n.mAP],e.prototype,"label",2),l([n.mAP],e.prototype,"tooltip",2),e})(),vu=(()=>{var e=class extends n.XPE{constructor(){super(...arguments),this.enabled=!0,this.stroke="black",this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.strokeWidth=2}};return l([n.mAP],e.prototype,"enabled",2),l([n.mAP],e.prototype,"stroke",2),l([n.mAP],e.prototype,"strokeOpacity",2),l([n.mAP],e.prototype,"lineDash",2),l([n.mAP],e.prototype,"lineDashOffset",2),l([n.mAP],e.prototype,"strokeWidth",2),e})(),Su=(()=>{var e=class extends n.XPE{constructor(){super(...arguments),this.positive=new bu,this.negative=new bu,this.total=new bu}};return l([n.mAP],e.prototype,"positive",2),l([n.mAP],e.prototype,"negative",2),l([n.mAP],e.prototype,"total",2),e})(),Mu=(()=>{var e=class extends du{constructor(){super(...arguments),this.item=new Su,this.totals=new n.F_c(yu),this.line=new vu,this.tooltip=uu()}getStyle(e){const{fillOpacity:t,strokeWidth:i,strokeOpacity:n,fill:s,stroke:a,lineDash:o,lineDashOffset:r,cornerRadius:l}=this.item["subtotal"===e?"total":e];return{fill:s,fillOpacity:t,stroke:a,strokeWidth:i,strokeOpacity:n,lineDash:o,lineDashOffset:r,cornerRadius:l,opacity:1}}};return l([n.mAP],e.prototype,"xKey",2),l([n.mAP],e.prototype,"yKey",2),l([n.mAP],e.prototype,"xName",2),l([n.mAP],e.prototype,"yName",2),l([n.mAP],e.prototype,"item",2),l([n.mAP],e.prototype,"totals",2),l([n.mAP],e.prototype,"line",2),l([n.mAP],e.prototype,"tooltip",2),e})(),{adjustLabelPlacement:ku,buildBarLabelCandidates:Du,createBarCandidateStyleResolver:wu,createBarPositionedCandidateResolver:Iu,styledBarLabelBox:Au,toResolvedPlacement:Cu,insideBarLabelBounds:Nu,resolvePlacementLabelBoxExtent:Lu,fitLabelToContainerAutoSize:Pu,SeriesNodePickMode:Tu,fixNumericExtent:Ou,valueProperty:Ru,keyProperty:Eu,accumulativeValueProperty:zu,trailingAccumulatedValueProperty:Bu,createDatumId:Fu,checkCrisp:Vu,updateLabelNode:$u,pickPlacementStyle:Hu,expandPlacementLabelBoxExtent:ju,prepareBarAnimationFunctions:Wu,collapsedStartingBarPosition:_u,resetBarSelectionsDirect:Gu,resetBarSelectionsFn:Ku,seriesLabelFadeInAnimation:Yu,resetLabelFn:Uu,animationValidation:Xu,DEFAULT_CARTESIAN_DIRECTION_KEY
1S:Zu,DEFAULT_CARTESIAN_DIRECTION_NAMES:qu,computeBarFocusBounds:Qu,BandScale:Ju,Rect:ep,motion:tp,getItemId:ip,getItemStylesPerItemId:np,DataSet:sp,processedDataIsAnimatable:ap,upsertNodeDatum:op}=s.n1,rp=(()=>{var e=class extends s.n1.AbstractBarSeries{constructor(e){super({moduleCtx:e,propertyKeys:Zu,propertyNames:qu,categoryKey:void 0,pickModes:[Tu.NEAREST_NODE,Tu.EXACT_SHAPE_MATCH],pathsPerSeries:["connector"],pathsZIndexSubOrderOffset:[-1,-1],animationResetFns:{datum:Ku,label:Uu}}),this.properties=new Mu,this.seriesItemTypes=new Set(["positive","negative","total"])}createNodeParams(e){return{...super.createNodeParams(e),xKey:this.properties.xKey,yKey:this.properties.yKey,itemType:e.itemType}}async processData(e){const{xKey:t,yKey:i,totals:a}=this.properties,{data:o}=this;if(!this.visible)return;const r={missingValue:void 0,invalidValue:void 0},l=[],h=a.reduce(((e,t)=>{const i=e.get(t.index);return i?i.push(t):e.set(t.index,[t]),e}),new Map);for(const[e,i]of o?.data.entries()??[]){l.push(i);const n=h.get(e);if(n)for(const e of n){const{axisLabel:i,itemId:n}=e,s=null==n?i:{id:n,toString:()=>i};l.push({...e.toJson(),[t]:s})}}const c=[];this.ctx.animationManager.isSkipped()||c.push(Xu());const d=this.getCategoryAxis()?.scale,u=this.getValueAxis()?.scale,{isContinuousX:p,xScaleType:g,yScaleType:m}=this.getScaleInformation({xScale:d,yScale:u}),y=this.properties.allowNullKeys??!1,{processedData:f}=await this.requestDataModel(e,sp.wrap(l,this.ctx.logger),{props:[Eu(t,g,{id:"xValue",allowNullKey:y}),zu(i,m,{...r,id:"yCurrent"}),zu(i,m,{...r,missingValue:0,id:"yCurrentTotal"}),zu(i,m,{...r,id:"yCurrentPositive",validation:e=>(0,n.QQF)(e)&&Number(e)>=0}),zu(i,m,{...r,id:"yCurrentNegative",validation:e=>(0,n.QQF)(e)&&Number(e)>=0}),Bu(i,m,{...r,id:"yPrevious"}),Ru(i,m,{id:"yRaw"}),Ru("totalType","category",{id:"totalTypeValue",missingValue:void 0,validation:e=>"total"===e||"subtotal"===e}),...p?[s.n1.SMALLEST_KEY_INTERVAL,s.n1.LARGEST_KEY_INTERVAL]:[],...c]});this.smallestDataInterval=f.reduced?.smallestKeyInterval,this.largestDataInterval=f.reduced?.largestKeyInterval,this.updateSeriesItemTypes(),this.animationState.transition("updateData")}getSeriesDomain(e){const{processedData:t,dataModel:i}=this;if(!t||!i)return{domain:[]};const{keys:[s],values:a}=t.domain;if(e===this.getCategoryDirection()){const a=i.resolveProcessedDataDefById(this,"xValue");if("key"===a?.def.type&&"category"===a?.def.valueType){return{domain:s,sortMetadata:i.getKeySortMetadata(this,"xValue",t)}}const o=e===n.tv$.Y,r=this.getCategoryAxis().isReversed();return{domain:this.padBandExtent(s,r!==o)}}{const e=a[i.resolveProcessedDataIndexById(this,"yCurrent")],t=[(0,n.Wwf)((0,n.s1j)(e[0]),e[0]),(0,n.cGV)((0,n.s1j)(e[1]),e[1])];return{domain:Ou(t)}}}getSeriesRange(){return[Number.NaN,Number.NaN]}populateNodeData(e){let t=0;const i={datumIndex:0,itemId:void 0,datum:void 0,xDatum:void 0,value:void 0,cumulativeValue:void 0,trailingValue:void 0,datumType:void 0};for(const[n,s]of e.rawData.entries()){const a=e.totalTypeValues[n],o=this.isSubtotal(a),r=this.isTotal(a),l=r||o,h=e.xValues[n];if(void 0===h&&!this.properties.allowNullKeys)continue;const c=e.yRawValues[n],{cumulativeValue:d,trailingValue:u}=this.computeWaterfallValues(e,n,r,o,t);l&&(t=d??0);const p=this.computeDisplayValue(r,o,c,d,u),g=l?s?.itemId??String(h):void 0;i.datumIndex=n,i.itemId=g,i.datum=l?void 0:s,i.xDatum=h,i.value=p,i.cumulativeValue=d,i.trailingValue=u,i.datumType=a;const m=op(e,i,((e,t)=>this.createNodeDatum(e,t)),((e,t,i)=>this.updateNodeDatum(e,t,i)));if(m){const t=this.createPointDatum(e,m,d,u,l);e.pointData.push(t)}}}finalizeNodeData(e){e.nodeIndex<e.nodes.length&&(e.nodes.length=e.nodeIndex)}initializeResult(e){return{itemId:this.properties.yKey,nodeData:e.nodes,labelData:e.nodes,pointData:[],scales:this.calculateScaling(),groupScale:this.getScaling(this.ctx.seriesStateManager.getGroupScale(this)),visible:this.visible,styles:np(this.getItemStyle.bind(this),"total","subtotal","positive","negative")}}assembleResult(e,t){const i=this.properties.line.enabled;return null!=e.yCurrValues&&i&&(t.pointData=e.pointData),t}createNodeDatumContext(e,t){const{dataModel:i,processedData:s}=this;if(!i||"ungrouped"!==s?.type)return;const a=this.getCategoryAxis(),o=this.getValueAxis();if(!a||!o)return;const r=e.scale,l=t.scale,h=i.resolveKeysById(this,"xValue",s),c=i.resolveColumnById(this,"yRaw",s,"mixed-numeric"),d=i.resolveColumnById(this,"totalTypeValue",s,"object"),u=i.resolveColumnById(this,"yCurrent",s,"mixed-numeric"),p=i.resolveColumnById(this,"yPrevious",s,"mixed-numeric"),g=i.resolveColumnById(this,"yCurrentTotal",s,"mixed-numeric"),m=s.dataSources.get(this.id
1)?.data??[],{xKey:y,yKey:f,xName:x,yName:b,line:v}=this.properties,{contextNodeData:S}=this,M=!this.ctx.animationManager.isSkipped(),k=null!=S?.nodeData&&null!=s.changeDescription,{barWidth:D,groupOffset:w,barOffset:I}=this.getBarDimensions();return{xAxis:e,yAxis:t,xScale:r,yScale:l,categoryAxis:a,valueAxis:o,barAlongX:this.getBarDirection()===n.tv$.X,barWidth:D,groupOffset:w,barOffset:I,categoryIsBand:Ju.is(a.scale),categoryAxisReversed:a.isReversed(),valueAxisReversed:o.isReversed(),crisp:Vu(a.scale,a.visibleRange,this.smallestDataInterval,this.largestDataInterval),animationEnabled:M,xKey:y,yKey:f,xName:x,yName:b,lineStrokeWidth:v.strokeWidth,yDomain:this.getSeriesDomain(n.tv$.Y).domain,xValues:h,rawData:m,yRawValues:c,totalTypeValues:d,yCurrValues:u,yPrevValues:p,yCurrTotalValues:g,canIncrementallyUpdate:k,nodes:k?S.nodeData:[],nodeIndex:0,pointData:[]}}computeWaterfallValues(e,t,i,n,s){return i||n?{cumulativeValue:e.yCurrTotalValues[t],trailingValue:n?s:0}:{cumulativeValue:e.yCurrValues[t],trailingValue:e.yPrevValues[t]}}computeDisplayValue(e,t,i,s,a){return e?s:t?(0,n.Vz0)(s??0,a??0):i}createSkeletonNodeDatum(e,t){const{xKey:i,yKey:n,crisp:s}=e,{datumIndex:a,itemId:o,datum:r,xDatum:l,value:h,cumulativeValue:c,datumType:d}=t,u=(h??0)>=0,p=this.getSeriesItemType(u,d);return{index:a,series:this,itemId:o,itemType:p,datum:r,datumIndex:a,cumulativeValue:Number(c??0),cumulativeValueExact:c??0,totalValue:this.getTotalValue(p,h),xValue:l,yValue:h,yKey:n,xKey:i,x:0,y:0,width:0,height:0,midPoint:{x:0,y:0},crisp:s,label:{text:"",x:0,y:0,textAlign:"center",textBaseline:"middle",rotation:0,offsetX:0,offsetY:0}}}updateNodeDatum(e,t,i){const{xScale:s,yScale:a,barAlongX:o,barWidth:r,groupOffset:l,barOffset:h,categoryIsBand:c,valueAxisReversed:d,xKey:u,yKey:p,xName:g,yName:m,yDomain:y,crisp:f}=e,{datumIndex:x,itemId:b,datum:v,xDatum:S,value:M,cumulativeValue:k,trailingValue:D,datumType:w}=i,I=t,A=s.convert(S);if(!Number.isFinite(A))return;const C=c?A+l+h:Math.round(A),N=(M??0)>=0,L=this.getSeriesItemType(N,w),{strokeWidth:P,label:T}=this.getItemConfig(L),O=Math.round(a.convert(k)),R=Math.round(a.convert(D)),E=N?O:R,z=N?R:O,B=Math.max(P,Math.abs(z-E)),F=o?Math.min(E,z):C,V=o?C:Math.min(E,z),$=o?B:r,H=o?r:B;if(I.index=x,I.itemId=b,I.itemType=L,I.datum=v,I.datumIndex=x,I.cumulativeValue=Number(k??0),I.cumulativeValueExact=k??0,I.totalValue=this.getTotalValue(L,M),I.xValue=S,I.yValue=M,I.x=F,I.y=V,I.width=$,I.height=H,I.crisp=f,I.midPoint?(I.midPoint.x=F+$/2,I.midPoint.y=V+H/2):I.midPoint={x:F+$/2,y:V+H/2},T.enabled){const e=this.getLabelText(M,v,p,"y",y,T,{itemType:L,itemId:ip(t,this.data?.dataIdKey),value:M,totalValue:I.totalValue,datum:v,xKey:u,yKey:p,xName:g,yName:m}),i=T.collision.alwaysShow,s=(0,n.A_g)(T,!i),a=(0,n.hqp)(T.orientation,T.placement,i,s),r=(0,n.Yfy)(T.orientation,T.placement,i,s),l=(0,n.$rL)(T.placement)[0],h=null==l||l.startsWith("inside")?T.insideStyle:T.outsideStyle,c=Lu(T,h),f={x:F,y:V,width:$,height:H},x=(M??-1)>=0!==d,b=(0,n.fjG)(T.orientation),S=(0,n.qlQ)((0,n.YGA)(T.orientation)),k=(0,n.$rL)(T.placement).every((e=>e.startsWith("inside")))&&(null!=s||b)?Nu(f,l??"inside-center",x,!o,T.spacing,ju(T)):void 0,{text:D,fontSize:w}=a?{text:e,fontSize:void 0}:Pu(e,s,T,k?.container);if(r){const e=(0,n.kzl)(D,T),t=(0,n.$rL)(T.placement);0===t.length&&t.push("inside-center");const i=(0,n.$rL)(T.orientation);0===i.length&&i.push("horizontal");const a=this.resolveLabelPlotRegion(T.collision),r=Du({isUpward:x,isVertical:!o,placements:t,orientations:i,spacing:T.spacing,label:T,textWidth:e.width,textHeight:e.height,rect:f,plotRegion:a,fitted:null!=s,text:D}),{anchor:l,region:h,placement:c}=r[0];I.label.text=D,I.label.x=l.x,I.label.y=l.y,I.label.textAlign=l.textAlign,I.label.textBaseline=l.textBaseline,I.label.rotation=S,I.label.regi
1on=h,I.label.offsetX=0,I.label.offsetY=0,I.label.placement=c,I.label.candidates=r,I.label.hidden=!1,I.label.fittedFontSize=void 0}else{const{width:e,height:t}=0===S?{width:0,height:0}:(0,n.kzl)(D,(0,n.lad)(T,w)),i=ku({isUpward:x,isVertical:!o,placement:l,spacing:T.spacing,boxPadding:c,rect:f,rotation:S,labelWidth:e,labelHeight:t});I.label.text=D,I.label.x=i.x,I.label.y=i.y,I.label.textAlign=i.textAlign,I.label.textBaseline=i.textBaseline,I.label.rotation=S,I.label.region=b?k?.region:void 0,I.label.offsetX=0,I.label.offsetY=0,I.label.placement=l??"inside-center",I.label.candidates=void 0,I.label.hidden=!1,I.label.fittedFontSize=w}}else I.label.text="",I.label.candidates=void 0,I.label.hidden=!1,I.label.fittedFontSize=void 0}createNodeDatum(e,t){const i=this.createSkeletonNodeDatum(e,t);return this.updateNodeDatum(e,i,t),i}createPointDatum(e,t,i,n,s){const{yScale:a,barAlongX:o,categoryAxisReversed:r,lineStrokeWidth:l}=e,h=Math.round(a.convert(i)),c=Math.round(a.convert(n)),d=s?h:c,u=Math.floor(l)%2/2,p=r?h:d,g=r?d:h,m={x:t.x,y:t.y,width:t.width,height:t.height};let y,f;return o?(y={x:p+u,y:m.y},f={x:g+u,y:m.y+m.height}):(y={x:m.x,y:p+u},f={x:m.x+m.width,y:g+u}),{x:r?f.x:y.x,y:r?f.y:y.y,x2:r?y.x:f.x,y2:r?y.y:f.y,size:0}}updateSeriesItemTypes(){const{dataModel:e,seriesItemTypes:t,processedData:i}=this;if(!e||!i)return;t.clear();const n=e.resolveProcessedDataIndexById(this,"yCurrentPositive"),s=e.resolveProcessedDataIndexById(this,"yCurrentNegative"),a=e.resolveProcessedDataIndexById(this,"totalTypeValue"),o=i.domain.values[n]??[],r=i.domain.values[s]??[];o.length>0&&t.add("positive"),r.length>0&&t.add("negative");const l=i?.domain.values[a];if(l)for(const e of l)"total"!==e&&"subtotal"!==e||t.add("total")}isSubtotal(e){return"subtotal"===e}isTotal(e){return"total"===e}getTotalValue(e,t){if(null!=t)return this.isTotal(e)||this.isSubtotal(e)?t:void 0}nodeFactory(){return new ep}getSeriesItemType(e,t){return t??(e?"positive":"negative")}getItemConfig(e){switch(e){case"positive":return this.properties.item.positive;case"negative":return this.properties.item.negative;case"subtotal":case"total":return this.properties.item.total}}updateDatumSelection(e){const{nodeData:t,datumSelection:i}=e,n=t??[];return ap(this.processedData)?i.update(n,void 0,(e=>Fu(e.datumIndex))):i.update(n)}getItemStyle(e,t,i,s="total",a){const{properties:o}=this,{datumIndex:r=0,datum:l,totalValue:h}=e??{},c="subtotal"===s?"total":s,d=o.item[c],u=this.getHighlightStyle(t,r,i),p=a??this.getDataSelectionState(r),g=this.getSelectionStyle(r,p),m=(0,n.HFk)(g,u,o.getStyle(s)),{itemStyler:y}=d;let f=m;if(null!=y&&null!=e){const i=ip(e,this.data?.dataIdKey),a=this.cachedDatumCallback(Fu(r,t?"highlight":"node"),(()=>{const e=this.makeItemStylerParams(s,r,l,i,h,t,f);return this.ctx.optionsGraphService.resolvePartial(["series",`${this.declarationOrder}`,"item",c],this.callWithContext(y,e))}));a&&(f=(0,n.HFk)(a,f))}return f}makeItemStylerParams(e,t,i,n,s,a,o){const{id:r,properties:l}=this,{xKey:h,yKey:c}=l,d=this.ctx.highlightManager?.getActiveHighlight(),u=this.getHighlightStateString(d,a,t),p=this.getSelectionStateString(t),g=this.getCandidateStateString(t),m=this.filterItemStylerFillParams(o.fill)??o.fill;return{seriesId:r,itemType:e,itemId:n,totalValue:s,datum:i,xKey:h,yKey:c,highlightState:u,selectionState:p,candidateState:g,...o,fill:m}}updateDatumStyles({datumSelection:e,isHighlight:t}){const{positive:i,negative:n,total:s}=this.properties.item,a=null!=i.itemStyler||null!=n.itemStyler||null!=s.itemStyler,o=this.ctx.highlightManager.getActiveHighlight();if(a)e.each(((e,i)=>{i.style=this.getItemStyle(i,t,void 0,i.itemType)}));else{const i=new Map,n=this;e.each((function(e,s){const a=n.getHighlightState(o,t,s.datumIndex),r=n.getDataSelectionState(s.datumIndex),l=`${s.itemType}:${a}:${r??"-"}`;let h=i.get(l);void 0===h&&(h=n.getItemStyle(void 0,t,a,s.itemType,r),i.set(l,h)),s.style=h}))}}updateDatumNodes({datumSelection:e,isHighlight:t}){const{contextNodeData:i}=this;if(!i)return;const s=this.ctx.highlightManager.getActiveHighlight(),a=this.getCategoryDirection()===n.tv$.X,o=this.getCategoryCrispDirection(),r=this.getShapeFillBBox();e.each(((e,n)=>{const l=n.style??i.styles[n.itemType][this.getHighlightState(s,t,n.datumIndex)];e.setStyleProperties(l,r),e.cornerRadius=l.cornerRadius??0,e.visible=a?n.width>0:n.height>0,e.crisp=n.crisp,e.crispCentreDirection=o}))}getLabelObstacles(){return(0,n.Amh)(this.contextNodeData?.nodeData,this.contextNodeData?.labelData,this.isLabelEnabled()&&!this.usesPlacedLabels,(e=>{const{label:t}=this.getItemConfig(e.itemType);return{label:e.label,config:(0,n.lad)(t,e.label?.fittedFontSize),box:ju(t)}}))}getLabelData(){if(!this.usesPlacedLabels)return[];const e=[];for(const t of this.contextNodeData?.labelData??[]){const i=t.label;if(null==i||""===i.text)continue;const s=this.getItemConfig(t.itemType).label,a=s.collision.resolveCollideWith(),o=s.collision.threshold??0,r=ju(s),{width:l,height:h}=(0,n.kzl)(i.text,s),c={width:l+r.left+r.right,height:h+r.top+r.bottom},d=(0,n.MPT)(s,r,!s.collision.alwaysShow)(i.text);if(null==i.candidates){const r=Au(null==s.itemStyler?void 0:wu(this,s,this.makeLabelStylerParams(t,t.totalValue),this.labelPath(t.itemType)),t,i.placement??"inside-center",(0,n.YGA)(s.orientation)??"horizontal",i.text);if(!0===r?.hidden)continue;e.push(...(0,n.AEW)([t],(()=>({label:i,config:s,size:r?.size??c,collideWith:a,threshold:o,fit:null==d||null==r?d:{...d,font:r.font,boxPadding:r.boxPadding}}))))}else{const r={x:t.x,y:t.y,width:t.width,height:t.height};e.push((0,n.Nv9)(i.text,c.width,c.height,i.candidates,i,r,s.collision.alwaysShow,a,o,!1,d,t))}}return e}getLabelCandidateResolver(){const{positive:e,negative:t,total:i}=this.properties.item;if(null==e.label.itemStyler&&null==t.label.itemStyler&&null==i.label.itemStyler)return;const n=e=>{const t=e;return this.makeLabelStylerParams(t,t.totalValue)},s=new Map;return(e,t)=>{const i=e.styleDatum;if(null==i)return t;let a=s.get(i.itemType);return void 0===a&&(a=Iu(this,this.getItemConfig(i.itemType).label,n,this.labelPath(i.itemType))??null,s.set(i.itemType,a)),a?.(e,t)??t}}updatePlacedLabelData(e){(0,n.she)(e),(0,n.HkM)(this.contextNodeData?.labelData,e,(e=>e.label)),this.refreshPlacedLabelNodes()}resolveUsesPlacedLabels(){const{positive:e,negative:t,total:i}=this.properties.item;return[e,t,i].some((e=>(0,n.qpr)(e.label)))}updateLabelSelection(e){const{labelData:t,labelSelection:i}=e;if(0===t.length)return i.update([]);const n=t.filter((e=>{const{label:t}=this.getItemConfig(e.itemType);return t.enabled}));return i.update(n)}makeLabelStylerParams(e,t){return{itemType:e.itemType,itemId:ip(e,this.data?.dataIdKey),totalValue:t,xKey:this.properties.xKey,xName:this.properties.xName,yKey:this.properties.yKey,yName:this.properties.yName}}labelPath(e){const t="subtotal"===e?"total":e;return["series",`${this.declarationOrder}`,"item",t,"label"]}updateLabelNodes({labelSelection:e,isHighlight:t}){const i=this.ctx.highlightManager?.getActiveHighlight();e.each(((e,s)=>{if(s.label.hidden)return void(e.visible=!1);const a=this.getHighlightStyle(t,s.datumIndex)?.opacity??1;e.visible=!0,e.fillOpacity=a;const o=this.getItemConfig(s.itemType).label,r=Hu(o,null==s.label.placement?void 0:Cu(s.label.placement));$u(this,e,this.makeLabelStylerParams(s,s.totalValue),o,s.label,{isHighlight:t,activeHighlight:i},this.labelPath(s.itemType),r,{placement:s.label.placement,orientation:(0,n.afe)(s.label.rotation??0)})}))}getTooltipContent(e){const{id:t,dataModel:i,processedData:a,properties:o}=this,{xKey:r,xName:l,yKey:h,yName:c,tooltip:d,legendItemName:u}=o,p=this.getCategoryAxis(),g=this.getValueAxis();if(!(i&&a&&p&&g))return;const m=i.resolveKeysById(this,"xValue",a)[e],y=i.resolveColumnById(this,"yRaw",a,"mixed-numeric")[e],f=i.resolveColumnById(this,"yCurrentTotal",a,"mixed-numeric"),x=i.resolveColumnById(this,"totalTypeValue",a,"object"),b=this.properties.allowNullKeys??!1;if(void 0===m&&!b)return;
1const v=x[e],S=this.isTotal(v)||this.isSubtotal(v)?void 0:a.dataSources.get(this.id)?.data[e],M=(y??0)>=0,k=this.getSeriesItemType(M,v);let D;if(this.isTotal(v))D=f[e];else if(this.isSubtotal(v)){D=f[e];for(let t=e-1;t>=0;t-=1)if(this.isSubtotal(x[t])){D=(0,n.Vz0)(D,f[t]);break}}else D=y;const w=this.contextNodeData?.nodeData?.[e],I=this.getItemStyle(w,!1,void 0,w?.itemType);let A=d;const C=this.getItemConfig(k).tooltip?.renderer;return null!=C&&(A=s.n1.makeSeriesTooltip(),A.renderer=C),this.formatTooltipWithContext(A,{heading:this.getAxisValueText(p,"tooltip",m,S,r,u),symbol:this.legendItemSymbol(k),data:[{label:c,fallbackLabel:h,value:this.getAxisValueText(g,"tooltip",D,S,h,u),missing:s.n1.isTooltipValueMissing(D)}]},{seriesId:t,datum:S,title:c,itemType:k,totalValue:w?.totalValue,itemId:w?ip(w,this.data?.dataIdKey):e,xKey:r,xName:l,yKey:h,yName:c,...I})}legendItemSymbol(e){const{fill:t,stroke:i,fillOpacity:n,strokeOpacity:s,strokeWidth:a,lineDash:o,lineDashOffset:r}=this.getItemConfig(e);return{marker:{fill:t,stroke:i,fillOpacity:n,strokeOpacity:s,strokeWidth:a,lineDash:o,lineDashOffset:r}}}getLegendData(e){if("category"!==e)return[];const{id:t,seriesItemTypes:i}=this,n=[],{showInLegend:s}=this.properties;for(const e of i){const{name:i}=this.getItemConfig(e);n.push({legendType:"category",id:t,itemId:Fu(e),seriesId:t,enabled:!0,label:{text:i??(a=e,a.charAt(0).toUpperCase()+a.substring(1))},symbol:this.legendItemSymbol(e),hideInLegend:!s,isFixed:!0})}var a;return n}toggleSeriesItem(){}resetDatumAnimation(e){Gu([e.datumSelection])}animateEmptyUpdateReady(e){const{datumSelection:t,labelSelection:i,contextData:n}=e,s=Wu(_u(this.isVertical(),this.axes,"normal"),"unknown");tp.fromToMotion(this.id,"datums",this.ctx.animationManager,[t],s),Yu(this,"labels",this.ctx.animationManager,i);const{pointData:a}=n;a&&(this.isVertical()?this.animateConnectorLinesVertical(e):this.animateConnectorLinesHorizontal(e))}animateConnectorLinesHorizontal(e){const{pointData:t=[]}=e.contextData,[i]=e.paths,{path:s}=i;this.updateLineNode(i);const a=this.getValueAxis(),o=a?.isReversed(),r=o?(e,t)=>e<t:(e,t)=>e>t,l=a?.scale.convert(0),h=t.reduce(((e,t)=>(r(t.x,e)&&(e=t.x),e)),o?1/0:0),c=(e,t,i,n,s)=>(e-t)/(i-t)*(s-n)+n;this.ctx.animationManager.animate({id:`${this.id}_connectors`,groupId:this.id,phase:"initial",from:l,to:h,ease:n.vTE,collapsable:!1,onUpdate(e){s.clear(!0);for(const[i,n]of t.entries()){const t=c(e,l,h,l,n.x),a=c(e,l,h,l,n.x2);0!==i&&s.lineTo(t,n.y),s.moveTo(a,n.y2)}i.checkPathDirty()},onStop:()=>this.resetConnectorLinesPath(e)})}animateConnectorLinesVertical(e){const{pointData:t=[]}=e.contextData,[i]=e.paths,{path:s}=i;this.updateLineNode(i);const a=this.getValueAxis(),o=a?.isReversed(),r=o?(e,t)=>e>t:(e,t)=>e<t,l=a?.scale.convert(0),h=t.reduce(((e,t)=>(r(t.y,e)&&(e=t.y),e)),o?0:1/0),c=(e,t,i,n,s)=>(e-t)/(i-t)*(s-n)+n;this.ctx.animationManager.animate({id:`${this.id}_connectors`,groupId:this.id,phase:"initial",from:l,to:h,ease:n.vTE,collapsable:!1,onUpdate(e){s.clear(!0);for(const[i,n]of t.entries()){const t=c(e,l,h,l,n.y),a=c(e,l,h,l,n.y2);0!==i&&s.lineTo(n.x,t),s.moveTo(n.x2,a)}i.checkPathDirty()},onStop:()=>this.resetConnectorLinesPath(e)})}animateReadyResize(e){super.animateReadyResize(e),this.resetConnectorLinesPath(e)}updatePaths(e){this.resetConnectorLinesPath({contextData:e.contextData,paths:e.paths})}resetConnectorLinesPath({contextData:e,paths:t}){if(0===t.length)return;const[i]=t;this.updateLineNode(i);const{path:n}=i;n.clear(!0);const{pointData:s}=e;if(s){for(const[e,t]of s.entries())0!==e&&n.lineTo(t.x,t.y),n.moveTo(t.x2,t.y2);i.checkPathDirty()}}updateLineNode(e){const{stroke:t,strokeWidth:i,strokeOpacity:n,lineDash:a,lineDashOffset:o}=this.properties.line;e.setProperties({fill:void 0,stroke:t,strokeWidth:i,strokeOpacity:n,lineDash:a,lineDashOffset:o,lineJoin:"round",pointerEvents:s.n1.PointerEvents.None})}isLabelEnabled(){const{positive:e,negative:t,total:i}=this.properties.item;return e.label.enabled||t.label.enabled||i.label.enabled}computeFocusBounds({datumIndex:e}){return Qu(this,this.contextNodeData?.nodeData[e])}hasItemStylers(){const{positive:e,negative:t,total:i}=this.properties.item;return this.properties.selection.enabled||null!=e.itemStyler||null!=e.label.itemStyler||null!=t.itemStyler||null!=t.label.itemStyler||null!=i.itemStyler||null!=i.label.itemStyler}};return e.className="WaterfallSeries",e.type="waterfall",e})(),{waterfallSeriesThemeableOptionsDef:lp}=s.n1,hp=(()=>({...lp,...n.XxK,type:(0,n.mw3)((0,n.dYl)("waterfall")),xKey:(0,n.mw3)(n.YjP),yKey:(0,n.mw3)(n.YjP),xKeyAxis:n.YjP,yKeyAxis:n.YjP,xName:n.YjP,yName:n.YjP,totals:(0,n.J$N)({totalType:(0,n.mw3)((0,n.KCZ)("total","subtotal")),index:(0,n.mw3)(n.LyW),axisLabel:(0,n.mw3)(n.YjP),itemId:n.YjP},"a total definition options array"),width:n.MX6}))();function cp(e,t){return{fill:{$applySwitch:[{$path:"type"},{$if:[{$eq:[{$palette:"type"},"user-indexed"]},{$path:[`/${t}`,{$palette:"fill"},{$palette:"fills"}]},{$palette:`${e}.fill`}]},["gradient",(0,n.Rs9)(e)],["image",n.pwE],["pattern",(0,n.$8e)(e)]]},stroke:{$palette:`${e}.stroke`},strokeWidth:{$isUserOption:["./stroke",2,0]},label:{...n.VTt,...n.F$C,enabled:!1,fontStyle:void 0,fontWeight:{$ref:"fontWeight"},fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},spacing:6,padding:6,collision:{threshold:4,alwaysShow:n.O2O,...(0,n.fs4)({collideWith:{seriesItems:!0}})}
1,insideStyle:(0,n.KVS)("chartBackgroundColor"),outsideStyle:(0,n.KVS)("textColor"),formatter:void 0,placement:"outside-end"}}}var dp=(()=>({series:{item:{positive:cp("altUp",0),negative:cp("altDown",1),total:cp("neutral",2)},line:{stroke:{$palette:"neutral.stroke"},strokeOpacity:1,lineDash:[0],lineDashOffset:0,strokeWidth:2},highlight:n.CFZ},legend:{enabled:!0,toggleSeries:!1}}))(),up={type:"series",name:"waterfall",chartType:"cartesian",enterprise:!0,solo:!0,version:s.xv,dependencies:[s.bI],options:hp,defaultAxes:n.QTQ,axisKeys:{[n.tv$.X]:"xKeyAxis",[n.tv$.Y]:"yKeyAxis"},axisKeysFlipped:{[n.tv$.X]:"yKeyAxis",[n.tv$.Y]:"xKeyAxis"},themeTemplate:dp,create:e=>new rp(e)},pp={width:n.LyW,height:n.LyW,grip:n.zMY,fill:n.yWT,stroke:n.yWT,strokeWidth:n.LyW,cornerRadius:n.LyW},gp=["cursor","highlightStyle","listeners","nodeClickRange","showInLegend","showInMiniChart","tooltip","visible","xName","yName"],mp=[...gp,"errorBar","label","legendItemName"],yp=[...gp,"direction","legendItemName","minName","q1Name","medianName","q3Name","maxName"],fp=[...gp,"title","label","labelKey","labelName","sizeName"],xp=[...gp,"title","label","colorName","textAlign","verticalAlign","itemPadding"],bp=[...gp,"label"],vp=[...gp,"errorBar","title","label"],Sp=[...gp,"label","yLowName","yHighName"],Mp=[...gp,"direction","label","yLowName","yHighName"],kp=[...gp,"errorBar","title","label","labelKey","labelName"],Dp=[...gp,"direction"],wp=(()=>
1({enabled:n.zMY,height:n.LyW,spacing:n.LyW,cornerRadius:n.aig,mask:{fill:n.yWT,fillOpacity:n.CGN,stroke:n.yWT,strokeWidth:n.LyW},minHandle:pp,maxHandle:pp,miniChart:{enabled:n.zMY,padding:n.Msk,label:{enabled:n.zMY,avoidCollisions:n.zMY,spacing:n.LyW,format:n.Hg5,formatter:(0,n.R3$)(n.JwX),interval:{minSpacing:n.LyW,maxSpacing:n.LyW,values:n.YOg,step:n.aig},...n.LVV},series:(0,n.J$N)((0,n.ist)({area:(0,n.FFB)(s.JC.options,[...gp,"type"]),bar:(0,n.FFB)(s.Di.options,[...mp,"type"]),"box-plot":(0,n.FFB)(Yr.options,[...yp,"type"]),bubble:(0,n.FFB)(s.SF.options,[...fp,"type"]),candlestick:(0,n.FFB)($l.options,[...gp,"type"]),heatmap:(0,n.FFB)(Lh.options,[...xp,"type"]),histogram:(0,n.FFB)(s.m.options,[...bp,"type"]),line:(0,n.FFB)(s.GT.options,[...vp,"type"]),ohlc:(0,n.FFB)(zh.options,[...gp,"type"]),"range-area":(0,n.FFB)(rd.options,[...Sp,"type"]),"range-bar":(0,n.FFB)(cu.options,[...Mp,"type"]),scatter:(0,n.FFB)(s.e8.options,[...kp,"type"]),waterfall:(0,n.FFB)(up.options,[...Dp,"type"])},"miniChart series options"))}}))(),Ip=["area","bar","bubble","candlestick","heatmap","histogram","line","ohlc","range-area","range-bar","scatter","waterfall"],Ap=["itemStyler","simpleItemStyler","direction","fill","fillGradientDefaults","fillPatternDefaults","fillImageDefaults","fillOpacity","shadow","focusPriority","highlight","lineDash","lineDashOffset","strokeWidth"];function Cp(e,t){return{$merge:[{$switch:[t,{},[["area","line","range-area"],{marker:{enabled:{$isUserOption:["/series/$index/marker/enabled",{$path:["/series/$index/marker/enabled",!1]},!1]}}}]]},{$omit:[{$switch:[t,gp,["bar",mp],["box-plot",yp],["bubble",fp],["heatmap",xp],["histogram",bp],["line",[...vp,...Ap]],["range-area",Sp],["range-bar",Mp],["scatter",kp],["waterfall",Dp]]},e]}]}}var Np=(()=>({enabled:!1,height:{$if:[{$path:"./miniChart/enabled"},40,18]},spacing:10,cornerRadius:4,mask:{fill:{$ref:"foregroundColor"},fillOpacity:.1,stroke:{$ref:"borderColor"},strokeWidth:1},minHandle:{fill:{$ref:"chartBackgroundColor"},stroke:{$ref:"borderColor"},strokeWidth:1,width:12,height:24,cornerRadius:4},maxHandle:{fill:{$ref:"chartBackgroundColor"},stroke:{$ref:"borderColor"},strokeWidth:1,width:12,height:24,cornerRadius:4},miniChart:{enabled:!1,label:{color:{$ref:"textColor"},fontSize:{$rem:n.q8q.SMALLER},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},spacing:5},padding:{$applyPadding:0},series:{$apply:[Cp({$path:"/series/$index"},{$path:["/navigator/miniChart/series/$index/type",{$path:["type",{$path:"/series/$index/type"}]}]}),{$if:[{$or:Ip.map((e=>({$eq:[{$path:"/series/0/type"},e]})))},{$map:[Cp({$value:"$1"},{$path:"/series/$index/type"}),{$path:"/series"}]},void 0]}]}}}))(),Lp={type:"plugin",name:"navigator",chartType:"cartesian",enterprise:!0,version:s.xv,options:wp,themeTemplate:Np,create:e=>new cr(e),register:e=>{e.has("zoomManager")||e.service("zoomManager",(e=>new s.n1.ZoomManager(e)))}},Pp=class{constructor(){this.isFirstWheelEvent=!0,this.debouncedWheelReset=(0,n.sg1)((()=>{this.isFirstWheelEvent=!0,this.wasFirstWheelEventZoomCapped=void 0}),100)}onWheel(e,t){if(!1===e.sourceEvent.cancelable)return;const i=t();if("abort"===i)return;const n="capped"===i;null!=this.firstWheelEventDirection&&this.firstWheelEventDirection!==e.deltaY<0&&(this.isFirstWheelEvent=!0),this.isFirstWheelEvent?(this.wasFirstWheelEventZoomCapped=n,this.firstWheelEventDirection=e.deltaY<0,n||e.sourceEvent.preventDefault()):!1===this.wasFirstWheelEventZoomCapped&&e.sourceEvent.preventDefault(),this.isFirstWheelEvent=!1,this.debouncedWheelReset()}},Tp=["zoom","scrollbar"],Op=class extends n.UbG{constructor(e){super(),this.ctx=e,this.wheelSequencer=new Pp,this.cleanup.register(e.eventsHub.on("axis-interaction:mouseenter",(e=>this.onAxisMouseEnter(e))),e.eventsHub.on("axis-interaction:mouseleave",(e=>this.onAxisMouseLeave(e))),e.eventsHub.on("axis-interaction:drag-start",(e=>this.onAxisDragStart(e))),e.eventsHub.on("axis-interaction:drag-move",(e=>this.onAxisDragMove(e))),e.eventsHub.on("axis-interaction:drag-end",(e=>this.onAxisDragEnd(e))),e.eventsHub.on("axis-interaction:dblclick",(e=>this.onAxisDoubleClick(e))),e.eventsHub.on("axis-interaction:wheel",(e=>this.onAxisWheel(e))),e.eventsHub.on("scrollbar:wheel",(e=>this.onScrollbarWheel(e))),e.widgets.seriesWidget.addListener("wheel",(e=>
1this.onSeriesAreaWheel(e))))}onAxisMouseEnter(e){this.processEvent("axis-mouseenter",e)}onAxisMouseLeave(e){this.processEvent("axis-mouseleave",e)}onAxisDragStart(e){this.processEvent("axis-drag-start",e)}onAxisDragMove(e){this.processEvent("axis-drag-move",e)}onAxisDragEnd(e){this.processEvent("axis-drag-end",e)}onAxisDoubleClick(e){this.processEvent("axis-dblclick",e)}onSeriesAreaWheel(e){this.wheelSequencer.onWheel(e,(()=>this.handleWheelSequencer("wheel",{event:e})))}onAxisWheel({event:e,direction:t}){this.wheelSequencer.onWheel(e,(()=>this.handleWheelSequencer("axis-wheel",{event:e,direction:t})))}onScrollbarWheel({event:e,orientation:t}){this.wheelSequencer.onWheel(e,(()=>this.handleWheelSequencer("scrollbar-wheel",{event:e,direction:"horizontal"===t?n.tv$.X:n.tv$.Y})))}handleWheelSequencer(e,t){let i=!1,n="abort";for(const s of Tp){const a={...t,abort(){n="abort"},capped(){n="capped"},uncapped(){n="uncapped"},stopProcessing(){i=!0}};if(this.ctx.eventsHub.emit(`zoom-interaction:${s}:${e}`,a),i)return n}return"abort"}processEvent(e,t){let i=!1;for(const n of Tp){const s={...t,stopProcessing(){i=!0}};if(this.ctx.eventsHub.emit(`zoom-interaction:${n}:${e}`,s),i)return}}},Rp={type:"plugin",name:"zoom-base",version:s.xv,dependencies:[K],create:e=>new Op(e)},Ep=n.Oxg-n.eKe,zp=(e,t=n.eKe,i=n.Oxg)=>(0,n.qE8)(t,e,i);function Bp(e){return e.x.max-e.x.min}function Fp(e){return e.y.max-e.y.min}function Vp(e,t){return(0,n.YXt)(e.min,t.min)&&(0,n.YXt)(e.max,t.max)}function $p(e,t){return Vp(e.x,t.x)&&Vp(e.y,t.y)}function Hp(e){return $p(e,(0,n.af4)())}function jp(e,t,i){if(!e)return{x:0,y:0};const n=zp(t-e.x,0,e.x+e.width),s=zp(i-e.y,0,e.y+e.height),a=1/e.width*n,o=1-1/e.height*s;return{x:zp(a),y:zp(o)}}function Wp(e,t,i){return{x:{min:e.x.min+t,max:e.x.max+t},y:{min:e.y.min+i,max:e.y.max+i}}}function _p(e,t,i){return{x:{min:e.x.min,max:e.x.min+Bp(e)*t},y:{min:e.y.min,max:e.y.min+Fp(e)*i}}}function Gp(e,t,i){const n=Bp(e),s=Fp(e),a=e.x.min+n/2,o=e.y.min+s/2;return{x:{min:a-n*t/2,max:a+n*t/2},y:{min:o-s*i/2,max:o+s*i/2}}}function Kp(e,t,i,n){const{min:s,max:a}=t,o=s+(a-s)/2,r=e.max-e.min;switch(i){case"start":return{min:s,max:t.min+r};case"end":return{min:t.max-r,max:a};case"middle":return{min:o-r/2,max:o+r/2};case"pointer":return function(e,t,i){const n=e.max-e.min,s=t.max-t.min,a=i*(1-(s-n)),o=i-a,r=e.min+o,l=e.max+o;return{min:r,max:l}}(e,t,n??o);default:return{min:s,max:a}}}function Yp(e){return{x:Up(e.x),y:Up(e.y)}}function Up(e){const t=e.max-e.min;let i=e.max>n.Oxg?n.Oxg-t:e.min,s=e.min<n.eKe?t:e.max;return i=Math.max(n.eKe,i),s=Math.min(n.Oxg,s),{min:i,max:s}}var Xp={x:{min:n.eKe,max:n.Oxg},y:{min:n.eKe,max:n.Oxg}};function Zp(e){const t=(0,n.af4)(e.chartState.getValue("zoom")),i=(0,n.af4)(e.chartState.getValue("initialZoom")??Xp);return null!=(0,n.G4M)(t,i)}var qp=class{update(e,t,i,n,s){const a=e.deltaX*t*200,o="zoom"===i?0:e.deltaY*t*200;return this.translateZooms(n,s,a,o)}translateZooms(e,t,i,s){const a={},o=jp(e,e.x+Math.abs(i),e.y+e.height-Math.abs(s)),r=i<0?-o.x:o.x,l=s<0?o.y:-o.y;for(const[e,i]of(0,n.jOZ)(t)){if(!i)continue;const{direction:t,min:s,max:o}=i;let h=(0,n.af4)({[i.direction]:{min:s,max:o}});h=Yp(Wp(h,r*Bp(h),l*Fp(h))),a[e]={direction:t,min:h[i.direction].min,max:h[i.direction].max}}return a}},{SliderWidget:Qp}=s.n1,Jp="scrollbar-drag-cursor",eg=class{constructor(e){this.applyStep=e}start(e){this.setTarget(e),this.run(400)}updateTarget(e){this.setTarget(e),this.isActive()||this.run(400)}stop(e=!0){this.clearTimer(),e&&(this.target=void 0)}setTarget(e){this.target=(0,n.qE8)(0,e,1)}run(e){if(null==this.target)return void this.stop();this.applyStep(this.target)?this.stop():this.schedule(e)}schedule(e){this.isActive()||(this.timer=setTimeout((()=>{this.timer=void 0,this.run(50)}),e))}clearTimer(){null!=this.timer&&(clearTimeout(this.timer),this.timer=void 0)}isActive(){return null!=this.timer}},tg=class{constructor(){this.min=0,this.span=1,this.thumbSpan=1}update(e,t,i=this.thumbSpan){const s=(0,n.qE8)(0,t-e,1);this.span=s,this.thumbSpan=(0,n.qE8)(0,i,1),this.min=this.clampMin(e,s)}clampMin(e,t=this.span){return(0,n.qE8)(0,e,1-t)}getThumbBounds(e=this.min,t=this.thumbSpan){const i=this.clampMin(e,t);return{start:i,end:i+t}}isWithinThumb(e){const{start:t,end:i}=this.getThumbBounds();return e>=t&&e<=i}getJumpRange(e){if(!this.canScroll())return;let t=this.clampMin(e-this.thumbSpan/2,this.thumbSpan);return t=this.clampMin(t),{min:t,max:t+this.span}}getStepRange(e){if(!this.canScroll())return;const t=(0,n.qE8)(0,e,1),{start:i,end:s}=this.getThumbBounds();if(t>=i&&t<=s)return;const a=t<i,o=a?i-t:t-s,r=Math.min(this.span,o),l=this.clampMin(this.min+(a?-r:r));return{min:l,max:l+this.span}}canScroll(){return this.span>0&&this.span<1}},ig=class{constructor(e,t,i,n){this.ctx=e,this.orientation=t,this.onChange=i,this.onHoverChange=n,this.dragStartRatio=0,this.interactionMode="none",this.state=new tg,this.repeater=new eg((e=>this.applyStepToward(e))),this.container=e.proxyInteractionService.createProxyContainer({type:"group",domManagerId:`scrollbar-${t}`,classList:["ag-charts-proxy-scrollbar",`ag-charts-proxy-scrollbar-${t}`],ariaLabel:void 0,role:"presentation"});const s="horizontal"===t?"ariaLabelScrollbarHorizontal":"ariaLabelScrollbarVertical";this.slider=e.proxyInteractionService.createProxyElement({type:"slider",domIndex:0,tabIndex:0,ariaLabel:{id:s},role:"slider",parent:this.container,classList:["ag-charts-proxy-scrollbar-slider"]});const a=this.slider.getElement();a.ariaValueMin="0",a.ariaValueMax="100",this.slider.step=Qp.STEP_HUNDRETH,this.slider.keyboardStep=Qp.STEP_ONE,this.slider.orientation=t,this.slider.setPreventsDefault(!1),this.slider.addListener("change",(()=>this.onSliderChange())),this.slider.addListener("keydown",(e=>this.onSliderKeyDown(e))),this.slider.addListener("drag-start",(e=>this.onDragStart(e))),this.slider.addListener("drag-move",(e=>this.onDragMove(e))),this.slider.addListener("drag-end",(e=>this.onDragEnd(e))),this.slider.addListener("mouseenter",(e=>this.handleHoverEvent(e))),this.slider.addListener("mousemove",(e=>this.handleHoverEvent(e))),this.slider.addListener("mouseleave",(()=>this.onMouseLeave())),this.slider.addListener("wheel",(i=>e.eventsHub.emit("scrollbar:wheel",{event:i,orientation:t}))),this.thumbFocus=e.proxyInteractionService.createProxyElement({type:"region",parent:this.container,classList:["ag-charts-proxy-scrollbar-thumb-focus"],role:"presentation"}),this.thumbFocus.setAriaHidden(!0),this.thumbFocus.setPointerEvents("none")}destroy(){this.interactionBounds=void 0,this.ctx.domManager.unlockCursor(Jp),this.ctx.interactionManager.popState(s.n1.InteractionState.ZoomDrag),this.repeater.stop(),this.container.destroy()}updateBounds(e){this.interactionBounds=void 0,this.container.setBounds(e),this.slider.setBounds({x:0,y:0,width:e.width,height:e.height})}updateVisibility(e){this.container.setHidden(!e)}updateMinMax(e,t,i=this.state.thumbSpan,n){this.state.update(e,t,i);const s=this.ctx.localeManager.t("ariaValuePanRange",{min:Math.round(100*e)/100,max:Math.round(100*t)/100});this.slider.getElement().ariaValueText=s;
1(!n?.skipSliderUpdate||Math.abs(this.slider.getValueRatio()-e)>1e-9)&&this.slider.setValueRatio(e,{ariaValueText:s})}updateThumbBounds(e,t,i){const n=Math.max(0,i??0);this.thumbFocus.getElement().style.borderRadius=`${n}px`,this.thumbFocus.setBounds({x:e.x-t.x,y:e.y-t.y,width:e.width,height:e.height})}update(e,t,i){this.onChange(e,t),this.updateMinMax(e,t,void 0,i)}onSliderChange(){const e=this.state.clampMin(this.slider.getValueRatio()),t=e+this.state.span;this.update(e,t,{skipSliderUpdate:!0})}onSliderKeyDown(e){const{code:t}=e.sourceEvent,i="vertical"===this.orientation,n=i&&"ArrowUp"===t||!i&&"ArrowLeft"===t,s=i&&"ArrowDown"===t||!i&&"ArrowRight"===t;if(!n&&!s)return;e.sourceEvent.preventDefault();const a=this.slider.getElement();a.step=this.slider.keyboardStep?.attributeValue??"1",n?a.stepDown():s&&a.stepUp(),this.onSliderChange()}onDragMove(e){if(e.sourceEvent.preventDefault(),"drag"===this.interactionMode){const{isHorizontal:t,size:i,start:n}=this.getInteractionBounds()??{};if(null==n||null==i)return;const s=(t?e.originDeltaX:e.originDeltaY)/i,a=this.state.clampMin(this.dragStartRatio+s),o=a+this.state.span;return void this.update(a,o)}if("step"!==this.interactionMode)return;const t=this.getPointerInfo(e);if(null==t||!Number.isFinite(t.ratio))return;const{ratio:i,inCrossBounds:n}=t;n?this.repeater.updateTarget(i):this.repeater.stop()}onDragEnd(e){e.sourceEvent.preventDefault(),this.ctx.domManager.unlockCursor(Jp),this.ctx.interactionManager.popState(s.n1.InteractionState.ZoomDrag),this.interactionBounds=void 0,this.setInteraction("none"),this.onHoverChange(!1)}onDragStart(e){e.sourceEvent.preventDefault(),this.interactionBounds=void 0;const t=this.getClickInfo(e);if(t?.inBounds)return this.ctx.domManager.lockCursor(Jp,"default"),this.ctx.interactionManager.pushState(s.n1.InteractionState.ZoomDrag),t.inThumb?(this.dragStartRatio=this.slider.getValueRatio(),void this.setInteraction("drag")):e.sourceEvent.shiftKey?(this.jumpTo(t.ratio),void this.setInteraction("none")):void this.beginStepRepeat(t.ratio)}onMouseLeave(){this.onHoverChange(!1)}getClickInfo(e){const t=this.getPointerRatio(e);if(null==t)return;return t>=0&&t<=1?{ratio:t,inBounds:!0,inThumb:this.isWithinThumb(t)}:{ratio:0,inBounds:!1,inThumb:!1}}getPointerRatio(e){return this.getPointerInfo(e)?.ratio}getPointerInfo(e){if("keyboard"===e.device)return;const{isHorizontal:t,size:i,start:n,crossStart:s,crossSize:a}=this.getInteractionBounds(),o=t?e.clientX:e.clientY,r=t?e.clientY:e.clientX;return{ratio:(o-n)/i,inCrossBounds:r>=s&&r<=s+a}}jumpTo(e){const t=this.state.getJumpRange(e);t&&this.update(t.min,t.max)}applyStepToward(e){const t=this.state.getStepRange(e);return!t||(this.update(t.min,t.max),!1)}beginStepRepeat(e){this.setInteraction("step"),this.repeater.start(e)}setInteraction(e){this.interactionMode=e,"step"!==e&&this.repeater.stop()}getInteractionBounds(){if(this.interactionBounds)return this.interactionBounds;const{width:e,height:t,left:i,top:n}=this.container.getBoundingClientRect(),s="horizontal"===this.orientation,a=s?e:t,o=s?i:n,r=s?n:i,l=s?t:e;return this.interactionBounds={isHorizontal:s,size:a,start:o,crossStart:r,crossSize:l},this.interactionBounds}isWithinThumb(e){return this.state.isWithinThumb(e)}handleHoverEvent(e){if("drag"===this.interactionMode)return;const t=this.getPointerInfo(e);if(!t)return void this.onHoverChange(!1);const i=this.isWithinThumb(t.ratio);this.onHoverChange(i)}},{BBox:ng,Group:sg,Rect:ag,LayoutElement:og,InteractionState:rg}=s.n1,lg=class extends n.UbG{constructor(e){super(),this.ctx=e,this.scrollPanner=new qp,this.state={horizontal:this.createOrientationState("horizontal"),vertical:this.createOrientationState("vertical")},this.cleanup.register(e.scene.attachNode(this.state.horizontal.group),e.scene.attachNode(this.state.vertical.group),e.layoutManager.registerElement(og.Scrollbar,(e=>this.onLayoutStart(e))),e.eventsHub.on("layout:complete",(e=>this.onLayoutComplete(e))),e.eventsHub.on("zoom:change-complete",(()=>this.updateThumbs())),e.eventsHub.on("zoom-interaction:scrollbar:wheel",(e=>this.onWheel(e))),e.eventsHub.on("zoom-interaction:scrollbar:axis-wheel",(e=>this.onAxisWheel(e))),e.eventsHub.on("zoom-interaction:scrollbar:scrollbar-wheel",(e=>
1this.onScrollbarWheel(e))))}get opts(){return this.ctx.chartState.getValue("options","scrollbar")}get enabled(){return this.opts.enabled}createOrientationState(e){const t=new sg({name:`scrollbar-${e}`,zIndex:n.Dcv.NAVIGATOR}),i=new ag,s=new ag;t.append(i),t.append(s);const a=new ig(this.ctx,e,((t,i)=>this.handleUserChange(e,t,i)),(t=>this.handleHoverChange(e,t))),o=this.resolveProperties(e);return{orientation:e,group:t,track:i,thumb:s,dom:a,properties:o,position:this.getDefaultPosition(e),positionHasAxis:!1,hovered:!1}}resolveProperties(e){return"horizontal"===e?this.opts.horizontal:this.opts.vertical}getDefaultPosition(e){return"horizontal"===e?"bottom":"left"}resolveAxis(e,t){const i="horizontal"===e?n.tv$.X:n.tv$.Y,s=this.ctx.axisManager.getAxisContext(i);if(0===s.length)return{position:this.getDefaultPosition(e),positionHasAxis:!1};if(null==t){const t=s[0];return{axis:t,position:t.position??this.getDefaultPosition(e),positionHasAxis:!0}}const a=s.find((e=>e.position===t));return a?{axis:a,position:t,positionHasAxis:!0}:{axis:s[0],position:t,positionHasAxis:!1}}onLayoutStart({scrollbars:e,layoutBox:t}){for(const i of["horizontal","vertical"]){const s=this.state[i],a=this.resolveProperties(i),{min:o,max:r}=this.getZoomRange(s.orientation),l=(0,n.qE8)(0,r-o,1),{axis:{axisId:h}={},position:c,positionHasAxis:d}=this.resolveAxis(i,a.position);s.properties=a,s.axisId=h,s.position=c,s.positionHasAxis=d;const u=this.updateVisibility(s,l);if(!u||null==h)continue;const{thickness:p,spacing:g,placement:m,tickSpacing:y}=a;d?e[h]={enabled:u,thickness:p,spacing:g,tickSpacing:y,placement:m}:t.shrink(g+p,c),this.updateStyles(s)}}onLayoutComplete(e){const t=this.opts;this.ctx.eventsHub.emit("axis-interaction:update",{source:"scrollbar",enabled:t.enabled,enableDoubleClick:!1,enableDragging:!1,enableScrolling:t.enableAxisScrolling,enableContextMenu:!1}),this.seriesRect=e.series.rect;for(const t of["horizontal","vertical"]){const i=this.state[t],{properties:{enabled:n,visible:s}}=i;if(!n||"never"===s)continue;const a=this.getLayoutRect(i,t,e);i.layoutRect=a,a&&(this.updateTrack(i,a),this.updateThumb(i,a))}}getLayoutRect(e,t,i){const{properties:{thickness:n,spacing:s},position:a,positionHasAxis:o}=e,r=e.axisId?i.axes[e.axisId]:void 0;if(!r)return;const{x:l,y:h,width:c,height:d}=i.series.rect,u="horizontal"===t;if(!o){if(u){return new ng(l,"bottom"===a?h+d+s:h-s-n,c,n)}return new ng("right"===a?l+c+s:l-s-n,h,n,d)}const{scrollbar:p,translation:g}=r;if(!p?.enabled)return;const m=u?g.y+p.offset:g.x+p.offset;return u?new ng(l,m,c,n):new ng(m,h,n,d)}updateStyles({track:e,thumb:t,properties:i,hovered:n}){const s=i.track,a=i.thumb;e.setStyleProperties(s),e.cornerRadius=i.track.cornerRadius,e.opacity=i.track.opacity,t.setStyleProperties(a),t.cornerRadius=i.thumb.cornerRadius,t.opacity=i.thumb.opacity;const o=a.hoverStyle;t.fill=n?o?.fill??a.fill:a.fill,t.stroke=n?o?.stroke??a.stroke:a.stroke}updateTrack(e,t){e.track.x=t.x,e.track.y=t.y,e.track.width=t.width,e.track.height=t.height,e.dom.updateBounds(t)}updateThumb(e,t){const{min:i,max:s}=this.getZoomRange(e.orientation),a=(0,n.qE8)(0,s-i,1);if(!this.updateVisibility(e,a)||t.width<=0||t.height<=0)return;const o=e.properties.thumb.minSize;let r;if("horizontal"===e.orientation){const s=Math.min(Math.max(o,t.width*a),t.width),l=(0,n.qE8)(t.x,t.x+t.width*i,t.x+t.width-s);e.thumb.x=l,e.thumb.y=t.y,e.thumb.width=s,e.thumb.height=t.height,r=(0,n.qE8)(0,s/t.width,1)}else{const s=Math.min(Math.max(o,t.height*a),t.height),l=(0,n.qE8)(t.y,t.y+t.height*i,t.y+t.height-s);e.thumb.x=t.x,e.thumb.y=l,e.thumb.width=t.width,e.thumb.height=s,r=(0,n.qE8)(0,s/t.height,1)}e.dom.updateThumbBounds(e.thumb,t,e.properties.thumb.cornerRadius),e.dom.updateMinMax(i,s,r)}updateThumbs(){if(this.seriesRect)for(const e of["horizontal","vertical"]){const t=this.state[e],i=t.layoutRect;if(!i||!t.properties.enabled||"never"===t.properties.visible)continue;const n="horizontal"===e?new ng(this.seriesRect.x,i.y,this.seriesRect.width,t.properties.thickness):new ng(i.x,this.seriesRect.y,t.properties.thickness,this.seriesRect.height);this.updateThumb(t,n)}}updateVisibility(e,t){const i=e.properties.enabled&&null!=e.axisId&&"never"!==e.properties.visible&&("always"===e.properties.visible||t<1);return e.group.visible=i,e.track.visible=i,e.thumb.visible=i,e.dom.updateVisibility(i),i}getZoomRange(e){const t=this.ctx.chartState.getValue("zoom"),i="horizontal"===e,n=i?t?.x:t?.y;return i||null==n?{min:n?.min??0,max:n?.max??1}:{min:1-(n.max??1),max:1-(n.min??0)}}handleUserChange(e,t,i){if(!this.ctx.interactionManager.isState(rg.ZoomDraggable))return;const n="horizontal"===e;n||([t,i]=[1-i,1-t]);const s=n?{x:{min:t,max:i}}:{y:{min:t,max:i}};this.ctx.zoomManager?.updateZoom({source:"user-interaction",sourceDetail
1:"scrollbar"},s)}handleHoverChange(e,t){const i=this.state[e],s=t&&i.group.visible;i.hovered!==s&&(i.hovered=s,this.updateStyles(i),this.ctx.eventsHub.emit("chart:request-update",{type:n.GvF.SCENE_RENDER}))}onWheel(e){if(this.opts.enableSeriesAreaScrolling)return this.handleWheel(e)}onAxisWheel(e){if(this.opts.enableAxisScrolling)return this.handleWheel(e)}onScrollbarWheel(e){return this.handleWheel(e)}handleWheel(e){const{seriesRect:t,ctx:i}=this,s=i.zoomManager,{event:a}=e,o=Math.abs(a.deltaX)>Math.abs(a.deltaY),r=this.opts.horizontal.enabled,l=this.opts.vertical.enabled;if(o&&!r)return;if(!o&&!l)return;e.stopProcessing();const h=o?n.tv$.X:n.tv$.Y,c=s.getPrimaryAxisId(h);if(!t||!c)return void e.abort();const d=this.scrollPanner.update(a,.1,"pan",t,s.getAxisZooms())[c],u=s.getAxisZoom(c);if((0,n.YXt)(d.min,u.min)&&(0,n.YXt)(d.max,u.max))return void e.capped();const p={[h]:{min:d.min,max:d.max}};s.updateZoom({source:"user-interaction",sourceDetail:"scrollbar"},p);const g=this.getZoom();a.deltaY>0&&g.y.min===n.eKe||a.deltaY<0&&g.y.max===n.Oxg?e.capped():e.uncapped()}getZoom(){return(0,n.af4)(this.ctx.chartState.getValue("zoom"))}destroy(){super.destroy(),this.state.horizontal.dom.destroy(),this.state.vertical.dom.destroy()}},hg={...n.Fup,...n.AFh,...n.mLn,cornerRadius:n.LyW,opacity:n.CGN},cg={...hg,minSize:n.LyW,hoverStyle:{fill:n.Fup.fill,stroke:n.AFh.stroke}},dg=(()=>({enabled:n.zMY,thickness:n.LyW,spacing:n.LyW,tickSpacing:n.LyW,visible:(0,n.KCZ)("auto","always","never"),placement:(0,n.KCZ)("outer","inner"),track:hg,thumb:cg}))(),ug=(()=>({...dg,position:(0,n.KCZ)("top","bottom")}))(),pg=(()=>({...dg,position:(0,n.KCZ)("left","right")}))(),gg=(()=>({enabled:n.zMY,enableAxisScrolling:n.zMY,enableSeriesAreaScrolling:n.zMY,thickness:n.LyW,spacing:n.LyW,tickSpacing:n.LyW,visible:(0,n.KCZ)("auto","always","never"),placement:(0,n.KCZ)("outer","inner"),track:hg,thumb:cg,horizontal:ug,vertical:pg}))(),mg={enabled:{$path:"../enabled"},thickness:{$path:"../thickness"},spacing:{$path:"../spacing"},tickSpacing:{$path:"../tickSpacing"},placement:{$path:"../placement"},visible:{$path:"../visible"},track:{fill:{$path:"../../track/fill"},stroke:{$path:"../../track/stroke"},fillOpacity:{$path:"../../track/fillOpacity"},strokeWidth:{$path:"../../track/strokeWidth"},lineDash:{$path:"../../track/lineDash"},lineDashOffset:{$path:"../../track/lineDashOffset"},opacity:{$path:"../../track/opacity"},cornerRadius:{$path:"../../track/cornerRadius"}},thumb:{fill:{$path:"../../thumb/fill"},stroke:{$path:"../../thumb/stroke"},fillOpacity:{$path:"../../thumb/fillOpacity"},strokeWidth:{$path:"../../thumb/strokeWidth"},lineDash:{$path:"../../thumb/lineDash"},lineDashOffset:{$path:"../../thumb/lineDashOffset"},opacity:{$path:"../../thumb/opacity"},cornerRadius:{$path:"../../thumb/cornerRadius"},minSize:{$path:"../../thumb/minSize"},hoverStyle:{fill:{$path:"../../../thumb/hoverStyle/fill"},stroke:{$path:"../../../thumb/hoverStyle/stroke"}}}},yg={enabled:!1,enableAxisScrolling:!1,enableSeriesAreaScrolling:!0,thickness:12,spacing:16,tickSpacing:0,placement:"outer",visible:"auto",track:{fill:{$foregroundBackgroundMix:.03},stroke:{$foregroundBackgroundMix:.177},strokeWidth:1,lineDash:[0],lineDashOffset:0,opacity:1,cornerRadius:6},thumb:{fill:{$foregroundBackgroundMix:.125},stroke:{$foregroundBackgroundMix:.364},strokeWidth:1,lineDash:[0],lineDashOffset:0,opacity:1,cornerRadius:6,minSize:20,hoverStyle:{fill:{$mix:[{$path:"../fill"},{$ref:"foregroundColor"},.075]},stroke:{$mix:[{$path:"../stroke"},{$ref:"foregroundColor"},.075]}}},vertical:mg,horizontal:mg},fg={type:"plugin",name:"scrollbar",chartType:"cartesian",enterprise:!0,version:s.xv,dependencies:[Rp],options:gg,themeTemplate:yg,create:e=>new lg(e),register:e=>{e.has("zoomManager")||e.service("zoomManager",(e=>new s.n1.ZoomManager(e)))}},{userInteraction:xg,LayoutElement:bg,Toolbar:vg}=s.n1,Sg="toolbarRangeSelectRange",Mg={fill:"black",fillOpacity:1,stroke:"black",textColor:"black"},kg={cornerRadius:0,fill:"black",fillOpacity:1,fontSize:12,fontFamily:"sans-serif",fontWeight:"normal",stroke:"black",strokeWidth:1,textColor:"black",padding:0,active:{...Mg},disabled:{...Mg},hover:{...Mg}};function Dg(e){return{...kg,...e}}var wg=class extends n.UbG{constructor(e){super(),this.ctx=e,this.dropdownLabel=Sg,this.cleanup.register(e.layoutManager.registerElement(bg.ToolbarBottom,this.onLayoutStart.bind(this)),e.eventsHub.on("layout:complete",this.onLayoutComplete.bind(this)),e.widgets.chartWidget.addListener("click",this.onChartWidgetClick.bind(this)),e.eventsHub.on("zoom:change-complete",this.onZoomChanged.bind(this)),e.eventsHub.on("font:load",(()=>this.invalidateToolbarHeightCache())),e.eventsHub.on("theme:params-change",(()=>this.invalidateToolbarHeightCache())),e.chartState.observe((e=>{(e("options","ranges.enabled")??!1)||(this.isDropdown=void 0)})),this.teardown.bind(this))}get opts(){return this.ctx.chartState.getValue("options","ranges")}setup(){null==this.container&&(this.container=this.ctx.domManager.addChild("canvas-overlay","range-buttons"),this.container.role="presentation",this.buttonsToolbar=ne
1w vg(this.ctx,"ariaLabelRangesToolbar","horizontal"),this.buttonsToolbar.addClass("ag-charts-range-buttons","ag-charts-range-buttons--buttons"),this.container.append(this.buttonsToolbar.getElement()),this.dropdownToolbar=new vg(this.ctx,"ariaLabelRangesToolbar","horizontal"),this.dropdownToolbar.addClass("ag-charts-range-buttons","ag-charts-range-buttons--dropdown"),this.container.append(this.dropdownToolbar.getElement()),this.dropdownMenu=new s.n1.Menu(this.ctx,"ranges-dropdown"),this.cleanup.register(this.buttonsToolbar.addToolbarListener("button-pressed",this.onButtonPress.bind(this)),this.dropdownToolbar.addToolbarListener("button-pressed",this.onButtonPress.bind(this))))}teardown(){this.buttonsToolbar?.getElement().remove(),this.buttonsToolbar?.destroy(),this.dropdownToolbar?.getElement().remove(),this.dropdownToolbar?.destroy()}onLayoutStart({layoutBox:e}){const t=this.opts,{enabled:i,position:n,spacing:s}=t,a=t.dropdown.visible;if(!i)return this.buttonsToolbar?.setHidden(!0),void this.dropdownToolbar?.setHidden(!0);this.setup();const{buttonsToolbar:o,dropdownToolbar:r}=this;if(!o||!r)return;o.updateButtons(t.buttons),r.updateButtons([this.getDropdownButtonOptions(this.dropdownLabel)]),this.updateCSSVariables(),"always"===a?this.swapDropdownIn():this.swapDropdownOut();const l=this.getToolbarHeight(t,this.isDropdown?r:o),h={x:e.x,y:e.y};"top"===n||"top-left"===n||"top-right"===n?e.shrink({top:l+s}):(h.y=e.y+e.height-l,e.shrink({bottom:l+s})),o.setBounds(h),r.setBounds(h)}invalidateToolbarHeightCache(){this.cachedToolbarHeight=void 0}getToolbarHeight(e,t){if(void 0!==this.cachedToolbarHeight&&this.cachedToolbarHeightOpts===e&&this.cachedToolbarHeightIsDropdown===this.isDropdown&&this.cachedToolbarHeightLabel===this.dropdownLabel)return this.cachedToolbarHeight;const{height:i}=t.getBounds();return 0===i||(this.cachedToolbarHeight=i,this.cachedToolbarHeightOpts=e,this.cachedToolbarHeightIsDropdown=this.isDropdown,this.cachedToolbarHeightLabel=this.dropdownLabel),i}onLayoutComplete({series:{rect:e},layoutBox:t}){const{buttonsToolbar:i,ctx:n,dropdownMenu:s,dropdownToolbar:a}=this,o=this.opts;if(!(o.enabled&&i&&a&&s))return;const r=o.dropdown.visible,l=o.buttons;let h;if("auto"===r&&(h=i.getBounds(),h.width>e.width?this.swapDropdownIn():this.swapDropdownOut()),this.isDropdown)h=a.getBounds(),this.dropdownMinWidth??(this.dropdownMinWidth=h.width),h.width=Math.max(h.width,this.dropdownMinWidth),h=this.updateToolbarBounds(a,e,t,h);else{h=this.updateToolbarBounds(i,e,t,h);let n=0;for(const e of l)i.toggleButtonEnabledByIndex(n,this.getButtonEnabled(e)),n++}const c={x:n.domManager.isRtl?h.x+h.width:h.x,y:h.y+h.height+1},d={x:h.x+h.width,y:h.y-1};s.setAnchor(c,d)}onChartWidgetClick(){this.dropdownMenu?.hide()}updateToolbarBounds(e,t,i,s){const a=this.opts.position,o=s??e.getBounds();return"top-right"===a||"bottom-right"===a?o.x=i.x+i.width-o.width:"top"!==a&&"bottom"!==a||(o.x=i.x+i.width/2-o.width/2),o.x=(0,n.qE8)(t.x,o.x,t.x+t.width-o.width),e.setBounds({x:o.x,y:o.y,width:o.width}),o}updateCSSVariables(){const e=this.opts,t=e.gap;t>0?this.buttonsToolbar?.addClass("ag-charts-range-buttons--gapped"):this.buttonsToolbar?.removeClass("ag-charts-range-buttons--gapped");const i=["paddingTop","paddingRight","paddingBottom","paddingLeft","strokeWidth"],n=Dg(e.button),s=Dg(e.dropdown),a=e.minSize??0;this.ctx.domManager.setModuleCSSVariables("ranges",void 0,void 0,{gap:t,minSize:a},["gap","minSize"]),this.ctx.domManager.setModuleCSSVariables("ranges","button",void 0,this.getComponentVariables(n),i),this.ctx.domManager.setModuleCSSVariables("ranges","button","active",this.getComponentStateVariables(n,"active"),i),this.ctx.domManager.setModuleCSSVariables("ranges","button","disabled",this.getComponentStateVariables(n,"disabled"),i),this.ctx.domManager.setModuleCSSVariables("ranges","button","hover",this.getComponentStateVariables(n,"hover"),i),this.ctx.domManager.setModuleCSSVariables("ranges","dropdown",void 0,this.getComponentVariables(s),i),this.ctx.domManager.setModuleCSSVariables("ranges","dropdown","active",this.getComponentStateVariables(s,"active"),i),this.ctx.domManager.setModuleCSSVariables("ranges","dropdown","disabled",this.getComponentStateVariables(s,"disabled"),i),this.ctx.domManager.setModuleCSSVariables("ranges","dropdown","hover",this.getComponentStateVariables(s,"hover"),i)}getComponentVariables(e){const t=e.padding,i="number"==typeof t?{top:t,right:t,bottom:t,left:t}:{top:t.top??0,right:t.right??0,bottom:t.bottom??0,left:t.left??0};return{cornerRadius:e.cornerRadius,fill:this.getComponentFill(e.fill,e.fillOpacity),fontSize:e.fontSize,fontFamily:e.fontFamily,fontWeight:e.fontWeight,stroke:e.stroke,strokeWidth:e.strokeWidth,textColor:e.textColor,paddingTop:i.top,paddingRight:i.right,paddingBottom:i.bottom,paddingLeft:i.left}}getComponentStateVariables(e,t){const i=e[t];return{fill:this.getComponentFill(i.fill,i.fillOpacity),fillOpacity:i.fillOpacity,stroke:i.stroke,textColor:i.textColor}}getComponentFill(e,t){if(t>=1)return e;const i=n.Q1f.fromString(e);return new n.Q1f(i.r,i.g,i.b,t).toString()}onZoomChanged(){this.buttonsToolbar?.clearActiveButton(),this.isDropdown&&this.resetDropdownButton()}onButtonPress({button:{index:e}}){this.isDropdown?this.showDropdownMenu():this.updateZoomWithButtonIndex(e)}swapDropdownIn(){this.isDropdown||(this.isDropdown=!0,this.buttonsToolbar?.setHidden(!0),this.dropdownToolbar?.setHidden(!1))}swapDropdownOut(){!1!==this.isDropdown&&(this.isDropdown=!1,this.buttonsToolbar?.setHidden(!1),this.dropdownToolbar?.setHidden(!0),this.buttonsToolbar?.clearActiveButton(),this.dropdownMenu?.hide())}resetDropdownButton(){this.dropdownToolbar?.updateButtonByIndex(0,this.getDropdownButtonOptions(Sg))}getDropdownButtonOptions(e){return this.dropdownLabel=e,{label:e,value:1/0,icon:"chevron-filled-down",iconPosition:"after"}}showDropdownMenu(){const e=this.dropdownToolbar?.getButtonWidget(0);if(!this.dropdownToolbar||!this.dropdownMenu||!e)return;this.dropdownToolbar.toggleActiveButtonByIndex(0);const t=this.opts.buttons.map(((e,t)=>({ariaLabel:e.ariaLabel,enabled:this.getButtonEnabled(e),label:e.label??`${t}`,value:`${t}`,icon:e.icon})));this.dropdownMenu.show(e,{class:"ag-charts-range-buttons-menu",items:t,minWidth:this.dropdownMinWidth,onPress:e=>{const t=Number(e.value);this.updateZoomWithButtonIndex(t),this.dropdownToolbar?.updateButtonByIndex(0,this.getDropdownButtonOptions(e.label??Sg))},onHide:()=>{this.dropdownToolbar?.clearActiveButton()}})}updateZoomWithButtonIndex(e){const t=this.ctx.zoomManager;if(!t)return;const i=this.opts.buttons.at(e);if(!i)return;const{value:s}=i,a=xg(`zoom-range-button-${e}`),o=this.getUpdateWithFn(s);
1!1===o.valid||null==o.fn?t.resetZoom(a):t.updateWith(a,n.tv$.X,o.fn),this.buttonsToolbar?.toggleActiveButtonByIndex(e)}getUpdateWithFn(e){if(null==e)return{valid:!0};if("number"==typeof e)return{fn:({end:t})=>[Number(t)-e,void 0],valid:!0};if(Array.isArray(e))return{fn:()=>e,valid:!0};if("function"==typeof e){const t=this.ctx.chartState.getValue("options","context");return{fn:i=>e({...i,context:t}),valid:!0}}if((0,n.bnk)(e)||(0,n.H2A)(e)){const[,t]=this.ctx.axisManager.getAxisContext(n.tv$.X).at(0)?.scale.getDomainMinMax()??[];if((0,n.vdg)(t)){const i=(0,n.DjU)(e,t);return{fn:({start:e})=>[i??e,void 0],valid:!0}}return{valid:!1}}return{valid:!0}}getButtonEnabled(e){const t=this.opts.enableOutOfRange,i=this.ctx.zoomManager;let s=e.enabled??t;if(null==e.enabled&&!1===t){const t=this.getUpdateWithFn(e.value);if(!1===t.valid)return!1;s=null==t.fn||null==i||i.isValidUpdateWith(n.tv$.X,t.fn,"range-check")}return s}},Ig={...n.qDt,stroke:n.AFh.stroke,textColor:n.yWT},Ag={...n.qDt,...n.AFh,...n.LVV,textColor:n.yWT,cornerRadius:n.LyW,padding:n.Msk,active:Ig,disabled:Ig,hover:Ig},Cg=(()=>({...Ag,visible:(0,n.KCZ)("auto","always","never")}))(),Ng={...Ag},Lg=(()=>({enabled:n.zMY,enableOutOfRange:n.zMY,position:(0,n.KCZ)("top-left","top","top-right","bottom-left","bottom","bottom-right"),button:Ng,dropdown:Cg,gap:n.LyW,spacing:n.LyW,...Ag,buttons:(0,n.J$N)({...n.Kj1,enabled:n.zMY,value:(0,n.or)(n.aig,(0,n.Uo6)((0,n.jk9)((0,n.or)(n.aig,n.p6U)),(0,n.O9d)(2,2)),n.f$c,n.fyz,n.E2r)},"range button options array")}))();Lg.minSize=(0,n._Le)(n.LyW);var Pg=864e5,Tg=30*Pg,Og=365*Pg,Rg={cornerRadius:{$ref:"borderRadius"},fill:{$ref:"chromeBackgroundColor"},fillOpacity:1,fontSize:{$rem:[n.q8q.SMALL,"chromeFontSize"]},fontFamily:{$ref:"chromeFontFamily"},fontWeight:{$ref:"chromeFontWeight"},padding:{$shallow:{top:6,right:9,bottom:6,left:9}},stroke:{$if:[{$isType:[{$ref:"buttonBorder"},"boolean"]},{$ref:"borderColor"},{$ref:"buttonBorder.color"}]},strokeWidth:{$if:[{$isType:[{$ref:"buttonBorder"},"boolean"]},{$if:[{$ref:"buttonBorder"},1,0]},{$ref:"buttonBorder.width"}]},textColor:{$ref:"chromeTextColor"}},Eg={fill:{$path:"../fill"},fillOpacity:{$path:"../fillOpacity"},stroke:{$path:"../stroke"},textColor:{$path:"../textColor"}},zg={...Eg,cornerRadius:{$path:"../cornerRadius"},fill:{$path:"../fill"},fillOpacity:{$path:"../fillOpacity"},fontSize:{$path:"../fontSize"},fontFamily:{$path:"../fontFamily"},fontWeight:{$path:"../fontWeight"},padding:{$path:"../padding"},stroke:{$path:"../stroke"},strokeWidth:{$path:"../strokeWidth"},textColor:{$path:"../textColor"}},Bg=e=>({fill:{$path:`../../${e}/fill`},fillOpacity:{$path:`../../${e}/fillOpacity`},stroke:{$path:`../../${e}/stroke`},strokeWidth:{$path:`../../${e}/strokeWidth`},textColor:{$path:`../../${e}/textColor`}}),Fg=(()=>({enabled:!1,enableOutOfRange:!1,position:"top-right",gap:0,spacing:10,...Rg,active:{...Eg,fill:{$ref:"focusColor"},stroke:{$ref:"accentColor"},textColor:{$ref:"accentColor"}},disabled:{...Eg,fill:{$mix:[{$ref:"chromeBackgroundColor"},{$ref:"foregroundColor"},.06]},textColor:{$mix:[{$ref:"chromeBackgroundColor"},{$ref:"chromeTextColor"},.5]}},hover:{...Eg,fill:{$ref:"focusColor"}},button:{active:{...Bg("active")},disabled:{...Bg("disabled")},hover:{...Bg("hover")},...zg},dropdown:{visible:"auto",active:{...Bg("active")},disabled:{...Bg("disabled")},hover:{...Bg("hover")},...zg},buttons:{$shallowSimple:[{label:"toolbarRange1Month",ariaLabel:"toolbarRange1MonthAria",value:Tg},{label:"toolbarRange3Months",ariaLabel:"toolbarRange3MonthsAria",value:3*Tg},{label:"toolbarRange6Months",ariaLabel:"toolbarRange6MonthsAria",value:6*Tg},{label:"toolbarRangeYearToDate",ariaLabel:"toolbarRangeYearToDateAria",value:({end:e})=>[new Date(`${new Date(e).getFullYear()}-01-01`).getTime(),void 0]},{label:"toolbarRange1Year",ariaLabel:"toolbarRange1YearAria",value:Og},{label:"toolbarRangeAll",ariaLabel:"toolbarRangeAllAria",value:()=>[void 0,void 0]}]},...(0,n.fs4)({minSize:0})}))(),Vg={type:"plugin",name:"ranges",chartType:"cartesian",enterprise:!0,version:s.xv,options:Lg,themeTemplate:Fg,create:e=>new wg(e)};var $g=class{constructor(){this.added=new Set,this.removed=new Set,this.memory=new Map}difference(e,t){const i=[];for(const n of e)if(!t.has(n)){const e=this.memory.get(n);e&&i.push(e)}return i}remember(e,t,i){const n=`${e}|${i}`;return this.memory.has(n)||this.memory.set(n,function(e,t,i){return{seriesId:e,itemId:t.getItemIdFromIndex(i),datum:t.getDatumAt(i)}}(e,t,i)),n}markAdded(e,t,i){const n=this.remember(e,t,i);this.added.add(n)}markRemoved(e,t,i){const n=this.remember(e,t,i);this.removed.add(n)}toAdded(){return this.difference(this.added,this.removed)}toRemoved(){return this.difference(this.removed,this.added)}},Hg="#2196f3",jg=[4,4],Wg=class{constructor(e){this.count=0,this.selection=new Uint8Array(e)}select(e){const t=1-this.selection[e];return this.count+=t,this.selection[e]=1,t}deselect(e){const t=-this.selection[e];return this.count+=t,this.selection[e]=0,t}toggle(e){const t=1-2*this.selection[e];return this.count+=t,this.selection[e]^=1,t}isSelected(e){return 1===this.selection[e]}isNotSelected(){return 0===this.count}isAllSelected(){return this.count===this.selection.length}selectRange(e,t){if(e>t)return 0;let i;return i=this.isAllSelected()?0:this.isNotSelected()?t-e:t-e-this.countRange(e,t),this.count+=i,this.selection.fill(1,e,t),i}deselectRange(e,t){if(e>t)return 0;let i;return i=this.isNotSelected()?0:this.isAllSelected()?-(t-e):-this.countRange(e,t),this.count+=i,this.selection.fill(0,e,t),i}countRange(e,t){let i=0;for(let n=e;n<t;n++)i+=this.selection[n];return i}clear(){this.count=0,this.selection.fill(0)}applyDataChange(e){this.selection=e.applyToTypedArray(this.selection),this.count=this.countRange(0,this.selection.length)}getLength(){return this.selection.length}getSelectedCount(){return this.count}getSelection(){return this.selection}},{SelectionState:_g}=s.n1,Gg=e=>new Wg(e),Kg=e=>new n.ys5(e);function Yg(e,t,i,n){let s=e.get(t);return s||(s=n(i.size()),e.set(t,s)),s}var Ug=class extends n.UbG{constructor(e){super(),this.ctx=e,this.moduleEnabled=!1,this.totalSelectedCount=0,this.totalCandidacyCount=0,this.candidacyInProgress=!1,this.candidacyUnion=!1,this.selections=new Map,this.candidacy=new Map,this.cleanup.register((()=>this.clearSelection()),(()=>this.clearCandidacy()),e?.eventsHub.on("data:load",(()=>this.recountTotalSelections())),e?.eventsHub.on("data:update",(()=>this.recountTotalSelections())),e?.chartState.observe((e=>this.onObservation(e))))}onObservation(e){e("options","series"),this.recountTotalSelections()}recountTotalSelections(){const e=new Set(this.ctx?.chartService.series.map((e=>e.id))),t=Array.from(this.selections.keys());for(const i of t)e.has(i)||this.selections.delete(i);let i=0;for(const[e,t]of this.selections)i+=t.getSelectedCount();this.totalSelectedCount=i}isSeriesSelectionEnabled(e){return this.isEnabled()&&void 0!==this.ctx&&e.isSelectionEnabled()}isEnabled(){return this.moduleEnabled}setEnabled(e){this.moduleEnabled=e,e||this.clearCandidacy()}clearSelection(){for(const[e,t]of this.selections)t.clear();this.totalSelectedCount=0}clearCandidacy(){this.candidacy.clear(),this.totalCandidacyCount=0,this.candidacyInProgress=!1}enableSelection(e,t){return Yg(this.selections,e,t,Gg)}enableCandidacy(e,t){return Yg(this.candidacy,e,t,Kg)}*iterateDataSetSelections(){if(void 0===this.ctx)return;const e={};for(const t of this.ctx.chartService.series){const i=t.id,n=t.data,s=this.selections.get(t.id);void 0!==n&&void 0!==s&&(e.seriesId=i,e.dataSet=n,e.selection=s,yield e)}}transferDataSet(e,t){if(this.candidacy.clear(),0===this.selections.size)return;const i=t.getIdArray();if(!i){if(t.data.length===e.data.length)for(const[e,t]of this.selections)this.selections.set(e,t);else this.selections.clear();return}if(!e.dataIdKey||e.dataIdKey!==t.dataIdKey)return void this.selections.clear();const n=e.getIdToIndexMap(),s=this.selections;this.selections=new Map;for(const[t,a]of s){const s=a.getSelection(),o=new Set;for(let e=0;e<s.length;e++){const t=i[e];s[e]&&null!=t&&o.add(t)}if(0===o.size)continue;const r=this.enableSelection(t,e);for(const e of o){const t=n.get(e);null!=t&&r.select(t)}}}onDataChange(e){if(this.candidacy.clear(),this.selections.size>0)for(const t of this.selections.values())t.applyDataChange(e);this.recountTotalSelections()}getDataSetSelection(e){return this.selections?.get(e.id)}getDataSelectionState(e,t){if(!this.isSeriesSelectionEnabled(e))return;if(0===this.totalSelectedCount)return _g.None;const i=this.getDataSetSelection(e);if("number"==typeof t){const n=e.ensureBucketLookupFeature()?.isBucketSelected(t);return n??i?.isSelected(t)??!1?_g.Item:_g.OtherItem}return _g.OtherSeries}getDataCandidateState(e,t){if(!this.candidacyInProgress||!this.isSeriesSelectionEnabled(e))return;if(this.candidacyUnion){if(this.getDataSelectionState(e,t)===_g.Item)return _g.Item}if(0===this.totalCandidacyCount)return _g.None;const i=this.candidacy.get(e.id);return"number"==typeof t?1===i?.getBit(t)?_g.Item:_g.OtherItem:_g.OtherSeries}};function Xg(e,t){return e>t&&([e,t]=[t,e]),[e,t-e]}function Zg(e,t,i){const[n,a]=Xg(t.currentX,i.currentX),[o,r]=Xg(t.currentY,i.currentY),l=new s.n1.BBox(n,o,a,r);return s.n1.Transformable.toCanvas(e,l)}function qg(e){return e.sourceEvent.ctrlKey||e.sourceEvent.metaKey}function Qg(e,t,i,n){const s=t.data;if(!s||!t.isDatumSelectable(n))return;const a=i.enableSelection(t.id,s),o=a.isSelected(n);void 0===e.items||o||e.items.markAdded(t.id,s,n),e.countDelta+=a.select(n)}function Jg(e,t,i,n,s){const a=t.data;if(!a)return;const o=i.enableSelection(t.id,a);e.countDelta+=o.selectRange(n,s)}function em(e,t){if(void 0!==e.items)for(const{dataSet:i,seriesId:n,selection:s}of t.iterateDataSetSelections()){const t=s.getLength();for(let a=0;a<t;a++)s.isSelected(a)&&e.items.markRemoved(n,i,a)}t.clearSelection()}function tm(e){return"object"==typeof e&&null!==e&&"seriesId"in e&&"itemId"in e&&"string"==typeof e.seriesId&&("number"==typeof e.itemId||"string"==typeof e.itemId)}var im=class{constructor(){this.intervals=[]}add(e,t){if(e>t)return;const i=this.intervals;if(0===i.length)return void i.push({start:e,end:t});const n=i.at(-1);if(t+1<n.start)return void i.push({start:e,end:t});if(e<=n.end+1)return n.start=Math.min(n.start,e),void(n.end=Math.max(n.end,t));let s=e,a=t,o=i.length;for(let e=i.length-1;e>=0;e--){const t=i[e];if(t.end+1<s){o=e+1;break}a+1<t.start||(s=Math.min(s,t.start),a=Math.max(a,t.end),o=e)}i.splice(o,i.length-o,{start:s,end:a})}has(e){for(let t=this.intervals.length-1;t>=0;t--){const i=this.intervals[t];if(i.start<=e&&i.end>=e)return!0}return!1}*values(){yield*this.intervals}clear(){this.intervals.length=0}};function nm(e){return new Set(e)}var sm=nm(["histogram","waterfall","funnel","cone-funnel"]),am=nm(["map-line","map-line-background","map-marker","map-shape","map-shape-background","nightingale","radar-area","radar-line","radial-column"]);var om=class extends n.UbG{constructor(e){super(),this.ctx=e,this.service=function(e){if(e&&e instanceof Ug)return e;throw new Error("FATAL ERROR - cannot upcast DataSelectionService")}(e.dataSelectionService),this.dragRect=new s.n1.Rect,this.dragRect.fill=Hg,this.dragRect.fillOpacity=.2,this.dragRect.stroke="#3b82f6",this.dragRect.strokeWidth=2,this.dragRect.strokeOpacity=1,this.dragRect.lineDash=jg,this.dragRect.visible=!1,e.chartService.selectionRoot.appendChild(this.dragRect),this.cleanup.register((()=>this.dragRect.remove()),e.chartState.observe((e=>{const t=e("options","selection")??{},i=e("options","series")??[];this.service.setEnabled(!0===t.enabled||i.some((e=>!0===e.selection?.enabled||!0===e.tile?.selection?.enabled)))})),e.eventsHub.on("series-area:click",(e=>this.onSeriesAreaClick(e))),e.widgets.seriesDragInterpreter?.events.on("drag-start",(e=>this.onSeriesAreaDragStart(e))),e.widgets.seriesDragInterpreter?.events.on("drag-move",(e=>this.onSeriesAreaDragMove(e))),e.widgets.seriesDragInterpreter?.events.on("drag-end",(e=>this.onSeriesAreaDragEnd(e))),e.widgets.seriesWidget.addListener("keydown",(e=>this.onKeyDown(e))),e.widgets.seriesWidget.addListener("keyup",(e=>this.onKeyUp(e))))}get opts(){return this.ctx.chartState.getValue("options","selection")}enabled(){return this.service.isEnabled()}supportsSelection(){const e=this.ctx.chartService.series.at(0)?.type;return!sm.has(e)}supportsSelectionDrag(){if(!this.supportsSelection())return!1;const e=this.ctx.chartService.series.at(0)?.type;return!am.has(e)}getSelection(){return this.enabled()&&this.supportsSelection()?function*(){for(const e of this.service.iterateDataSetSelections())for(let t=0;t<e.selection.getLength();t++)if(e.selection.isSelected(t)){const i=e.dataSet.getItemIdFromIndex(t),n=e.dataSet.getDatumAt(t),s=e.seriesId;yield{seriesId:s,itemId:i,datum:n}}}.bind(this)():[]}setSelection(e){if(!this.enabled()||!this.supportsSelection())return;const{chartService:t}=this.ctx,i=this.allocSelectionChanges();if(em(i,this.service),"object"==typeof(s=e)&&null!==s&&Symbol.iterator in s&&"function"==typeof s[Symbol.iterator]){var s;for(const t of e){if(!tm(t)){this.ctx.logger.warn("Skipping invalid AgSelectionItemIds object: ",t);continue}const e=this.ctx.chartService.series.find((e=>e.id==t.seriesId));if(void 0===e){this.ctx.logger.warn("Skipping seriesId (series not found)",t.seriesId);continue}const n=e.data;if(void 0===n){this.ctx.logger.warn("Skipping seriesId (data not found):",t.seriesId);continue}const s=n.getIndexFromItemId(t.itemId);void 0!==s?Qg(i,e,this.service,s):this.ctx.logger.warn("Skipping itemId (datum not found):",t.itemId)}this.dispatchExternalSelectionChange("api-call",i),this.dispatchInternalSelectionChange(t.series,i),this.redraw(n.GvF.PERFORM_LAYOUT)}else this.ctx.logger.warn("Selection items is not iterable")}clearSelection(){if(!this.enabled()||!this.supportsSelection())return;const{chartService:e}=this.ctx,t=this.allocSelectionChanges();em(t,this.service),this.dispatchExternalSelectionChange("api-call",t),this.dispatchInternalSelectionChange(e.series,t),this.redraw(n.GvF.PERFORM_LAYOUT)}onSeriesAreaClick(e){if(!this.supportsSelection())return;const{enableClick:t,enableClickAwayToClear:i,clickMode:s}=this.opts;if(!this.enabled()||!t)return;const{type:a,clickedNode:o,target:r}=e;if("click"!==a)return;if(void 0!==o&&!o.series.firesUserClickListeners(r))return;const l=qg(e),h=void 0===o||!o.series.isSelectionEnabled();if(h&&(l||!i))return;const c=this.allocSelectionChanges();let d;if(h)em(c,this.service),d=this.ctx.chartService.series;else{const{series:e,datumIndex:t}=o;"multiple"===s||l?(!function(e,t,i,n){const s=t.data;if(!s||!t.isDatumSelectable(n))return;const a=i.enableSelection(t.id,s),o=a.isSelected(n);void 0!==e?.items&&(o?e.items.markRemoved(t.id,s,n):e.items.markAdded(t.id,s,n)
1),e.countDelta+=a.toggle(n)}(c,e,this.service,t),d=[e]):(em(c,this.service),Qg(c,e,this.service,t),d=this.ctx.chartService.series)}try{this.dispatchExternalSelectionChange("user-interaction",c)}finally{this.dispatchInternalSelectionChange(d,c),this.redraw(n.GvF.FULL)}}onSeriesAreaDragStart(e){if(!this.supportsSelectionDrag())return;const{enableDrag:t}=this.opts;this.enabled()&&t&&!this.hasUnknownModifier(e)&&(this.dragStartEvent=e,this.dragRect.x=e.currentX,this.dragRect.y=e.currentY,this.dragRect.width=0,this.dragRect.height=0,this.dragRect.visible=!0,e.sourceEvent.preventDefault())}onSeriesAreaDragMove(e){var t;if(!this.supportsSelectionDrag())return;const{enableDrag:i}=this.opts,{dragStartEvent:s}=this;if(!this.enabled()||!i||!s)return void(this.dragRect.visible=!1);const{seriesRoot:a,seriesRect:o}=this.ctx.chartService,r=Zg(a,s,e).clip(o);this.service.totalCandidacyCount=0,(t=this.service).candidacyInProgress||(t.candidacyInProgress=r.width>0||r.height>0),this.service.candidacyUnion=qg(e);for(const e of this.iterateSelectableSeries()){const t=e.data;if(!t)continue;const i=this.service.enableCandidacy(e.id,t);i.clear();for(const{datumIndex:t}of e.pickNodesInBBox(r))e.isDatumSelectable(t)&&(i.setBit(t),this.service.totalCandidacyCount++)}this.dragRect.x=r.x,this.dragRect.y=r.y,this.dragRect.width=r.width,this.dragRect.height=r.height,this.redraw(n.GvF.FULL),e.sourceEvent.preventDefault()}onSeriesAreaDragEnd(e){if(!this.supportsSelectionDrag())return;const{enableDrag:t}=this.opts,{dragStartEvent:i,service:n}=this;if(n.totalCandidacyCount=0,n.candidacyUnion=qg(e),!this.enabled()||!t||!i)return void(this.dragRect.visible=!1);const s=this.allocSelectionChanges(),a=!qg(e),o=new Set(a?this.ctx.chartService.series:void 0);a&&em(s,this.service);const r=Zg(this.ctx.chartService.seriesRoot,i,e),l=new im;for(const e of this.iterateSelectableSeries()){let t=!1;l.clear();const i=e.ensureBucketLookupFeature(),a=i?.getRangeReader();for(const o of e.pickNodesInBBox(r)){const r=o.datumIndex,h=i?.getIndexSet(r);if(a){const e=a(r);if(e&&!l.has(r)){const[i,n]=e;t=!0,l.add(i,n)}}else if(void 0===h)t=!0,Qg(s,e,n,r);else for(const i of h)t=!0,Qg(s,e,n,i)}for(const t of l.values())Jg(s,e,n,t.start,t.end+1);t&&o.add(e)}try{this.dispatchExternalSelectionChange("user-interaction",s)}finally{this.dispatchInternalSelectionChange(o,s),this.endDrag()}}refreshCandidacyUnion(e){const t=this.service.candidacyUnion,i=qg(e);t!==i&&(this.service.candidacyUnion=i,this.redraw(n.GvF.FULL))}onKeyDown(e){if(!this.enabled())return;this.refreshCandidacyUnion(e);const{code:t}=e.sourceEvent;"Escape"===t&&this.endDrag()}onKeyUp(e){this.enabled()&&this.refreshCandidacyUnion(e)}endDrag(){this.service.clearCandidacy(),this.dragStartEvent=void 0,this.dragRect.visible=!1,this.redraw(n.GvF.FULL)}redraw(e){this.ctx.eventsHub.emit("chart:request-update",{type:e,opts:{skipAnimations:!0}})}dispatchInternalSelectionChange(e,t){this.service.totalSelectedCount+=t.countDelta;for(const t of e)t.events.emit("data-selection-change",null)}dispatchExternalSelectionChange(e,t){if(void 0===t.items)return;const i=t.items.toAdded(),n=t.items.toRemoved();if(0===i.length&&0===n.length)return;let s=!1;this.ctx.chartService.callListener({type:"selectionChange",source:e,get defaultPrevented(){return s},preventDefault(){s=!0},added:i,removed:n}),s&&(!function(e,t){const i=new Map;for(const{seriesId:e,dataSet:n,selection:s}of t.iterateDataSetSelections())i.set(e,{dataSet:n,selection:s});for(const t of e.items.toAdded()){const e=i.get(t.seriesId);if(void 0===e)return;const n=e.dataSet.getIndexFromItemId(t.itemId);void 0!==n&&e.selection.deselect(n)}for(const t of e.items.toRemoved()){const e=i.get(t.seriesId);if(void 0===e)continue;const n=e.dataSet.getIndexFromItemId(t.itemId);void 0!==n&&e.selection.select(n)}}(t,this.service),this.service.totalSelectedCount-=t.countDelta)}allocSelectionChanges(){return null==this.ctx.chartService.listeners.selectionChange?{countDelta:0}:{countDelta:0,items:new $g}}hasUnknownModifier(e){return e.sourceEvent.altKey||e.sourceEvent.shiftKey}*iterateSelectableSeries(){for(const e of this.ctx.chartService.series)e.isSelectionEnabled()&&(yield e)}},rm=(()=>({type:"plugin",name:"selection",enterprise:!0,version:s.xv,depen
1dencies:[],options:{enabled:n.zMY,enableClick:n.zMY,enableDrag:n.zMY,enableClickAwayToClear:n.zMY,clickMode:(0,n.$_4)()("single","multiple"),containment:n.t5w},themeTemplate:{enabled:!1,enableClick:!0,enableDrag:!1,enableClickAwayToClear:!0,clickMode:"single",containment:"any"},create:e=>new om(e),register:e=>{e.has("dataSelectionService")||e.service("dataSelectionService",(e=>new Ug(e)))}}))(),{LayoutElement:lm,Group:hm,Rect:cm,Text:dm}=s.n1,um={ohlc:62,candlestick:62,"hollow-candlestick":62,line:96,"step-line":96,hlc:184,"high-low":800},pm={up:"positive",down:"negative"},gm={hlc:"altNeutral"},mm=class extends n.UbG{constructor(e){super(),this.ctx=e,this.id="status-bar",this.layer=new hm({name:"StatusBar",zIndex:n.Dcv.STATUS_BAR}),this.labelGroup=this.layer.appendChild(new s.n1.TranslatableGroup),this.backgroundNode=this.labelGroup.appendChild(new cm),this.labels=[{label:"O",configuration:2,title:this.labelGroup.appendChild(new dm),value:this.labelGroup.appendChild(new dm),id:"openValue",key:"openKey",domain:void 0,formatter:new Intl.NumberFormat("en-US",{minimumFractionDigits:2,maximumFractionDigits:2})},{label:"H",configuration:16,title:this.labelGroup.appendChild(new dm),value:this.labelGroup.appendChild(new dm),id:"highValue",key:"highKey",domain:void 0,formatter:new Intl.NumberFormat("en-US",{minimumFractionDigits:2,maximumFractionDigits:2})},{label:"H",configuration:256,title:this.labelGroup.appendChild(new dm),value:this.labelGroup.appendChild(new dm),style:"neutral",id:"highValue",key:"highKey",domain:void 0,formatter:new Intl.NumberFormat("en-US",{minimumFractionDigits:2,maximumFractionDigits:2})},{label:"L",configuration:8,title:this.labelGroup.appendChild(new dm),value:this.labelGroup.appendChild(new dm),id:"lowValue",key:"lowKey",domain:void 0,formatter:new Intl.NumberFormat("en-US",{minimumFractionDigits:2,maximumFractionDigits:2})},{label:"L",configuration:512,title:this.labelGroup.appendChild(new dm),value:this.labelGroup.appendChild(new dm),style:"neutral",id:"lowValue",key:"lowKey",domain:void 0,formatter:new Intl.NumberFormat("en-US",{minimumFractionDigits:2,maximumFractionDigits:2})},{label:"C",configuration:4,title:this.labelGroup.appendChild(new dm),value:this.labelGroup.appendChild(new dm),id:"closeValue",key:"closeKey",domain:void 0,formatter:new Intl.NumberFormat("en-US",{minimumFractionDigits:2,maximumFractionDigits:2})},{label:"C",configuration:128,title:this.labelGroup.appendChild(new dm),value:this.labelGroup.appendChild(new dm),id:"closeValue",key:"closeKey",style:"neutral",domain:void 0,formatter:new Intl.NumberFormat("en-US",{minimumFractionDigits:2,maximumFractionDigits:2})},{label:"",configuration:64,title:this.labelGroup.appendChild(new dm),value:this.labelGroup.appendChild(new dm),style:"neutral",id:"closeValue",key:"closeKey",domain:void 0,formatter:new Intl.NumberFormat("en-US",{notation:"compact",minimumFractionDigits:2,maximumFractionDigits:2})},{label:"Vol",configuration:32,title:this.labelGroup.appendChild(new dm),value:this.labelGroup.appendChild(new dm),id:"volumeValue",key:"volumeKey",domain:void 0,formatter:new Intl.NumberFormat("en-US",{notation:"compact",minimumFractionDigits:2,maximumFractionDigits:2})}],this.labelGroup.visible=!1,this.cleanup.register(e.scene.attachNode(this.layer),e.layoutManager.registerElement(lm.Overlay,(e=>this.startPerformLayout(e))),e.eventsHub.on("layout:complete",(e=>this.onLayoutComplete(e))),e.chartState.observe((e=>{const t=e("highlight");this.updateHighlight(t)})),e.eventsHub.on("data:update",(e=>{this.chartData=e})))}get opts(){return this.ctx.chartState.getValue("options","statusBar")}updateDomainsFromSeries(){const e=this.opts;if(!e?.enabled)return;const t=this.ctx.chartService.series;if(0===t.length)return;let i,s;for(const e of t){const t=e.getDomain(n.tv$.Y),a=t?.domain;!Array.isArray(a)||a.length<2||("bar"===e.type?s=[a[0],a.at(-1)]:i=[a[0],a.at(-1)])}for(const t of this.labels){null!=e[t.key]?t.domain="volumeKey"===t.key?s:i:t.domain=void 0}}startPerformLayout({layoutBox:e}){this.labelGroup.translationX=0,this.labelGroup.translationY=0;const t=this.opts;if(!t?.enabled)return void(this.labelGroup.visible=!1);this.updateDomainsFromSeries();this.labelGroup.translationY=e.y+0;const i=Math.max(t.title.fontSize,t.positive.fontSize,t.negative.fontSize),s=(0,n.VKS)(i),a=um[this.getChartType()]??0;let o,r=0,l="alphabetic";if("block"===t.layoutStyle)e.shrink(0+s+8,"top"),o=i+(s-i)/2;else{const{title:e}=this.ctx.chartService;if(l="top",o=0+e.padding,e.enabled){const t=e.node.getBBox();r=t.x+t.width+12}else r=e.padding}for(const{label:e,configuration:i,title:s,value:h,domain:c,formatter:d}of this.labels){if(null==c||!(a&i)){s.visible=!1,h.visible=!1;continue}const u=(0,n.K$y)(t.positive),p=(0,n.K$y)(t.negative),g=Math.max(u.textWidth(d.format(c[0])),u.textWidth(d.format(c[1])),p.textWidth(d.format(c[0])),p.textWidth(d.format(c[1])));s.visible=!0,h.visible=!0;const m=(0,n.K$y)(t.title).measureLines(e);s.setFont(t.title),s.fill=t.title.color,s.text=e,s.textAlign="left",s.textBaseline=l,s.y=o,s.x=r,r+=m.width+4,h.textAlign="left",h.textBaseline=l,h.y=o,h.x=r,r+=g+12}this.backgroundNode.x=0,this.backgroundNode.y=0,this.backgroundNode.width=r-12,this.backgroundNode.height=s+0+8,this.backgroundNode.fill=t.background.fill,this.backgroundNode.fillOpacity=t.background.fillOpacity}onLayoutComplete(e){this.labelGroup.translationX=e.series.rect.x,this.updateHighlight(this.ctx.chartState.getValue("highlight"))}updateHighlight(e){const t=this.opts;if(!t.enabled)return;const i=e?.datum??this.chartData?.data?.at(-1);if(null==i)return void(this.labelGroup.visible=!1);this.labelGroup.visible=!0;const s=e?.itemId;let a=null==s?void 0:pm[s];null==a&&null!=t.openKey&&null!=t.closeKey&&(a=i[t.openKey]<i[t.closeKey]?"positive":"negative");for(const{domain:e,value:s,key:o,formatter:r,style:l}of this.labels){if(null==e)continue;let h=l??a??"neutral";"neutral"===h&&(h=gm[this.getChartType()]??h);
1const c=t[o],d=null==c?void 0:i?.[c];s.setFont(t[h]),s.fill=t[h].color,s.text=(0,n.zZm)(d)?r.format(d):""}}getChartType(){let e=this.ctx.chartService.publicApi?.getOptions()?.chartType;return null!=e&&null!=um[e]||(e="candlestick"),e}},ym={type:"plugin",name:"statusBar",chartType:"cartesian",enterprise:!0,version:s.xv,themeTemplate:{enabled:!1,layoutStyle:n.ILz,title:{color:{$ref:"textColor"},fontFamily:{$ref:"fontFamily"},fontSize:{$ref:"fontSize"},fontWeight:{$ref:"fontWeight"}},positive:{color:{$palette:"up.stroke"},fontFamily:{$ref:"fontFamily"},fontSize:{$ref:"fontSize"},fontWeight:{$ref:"fontWeight"}},negative:{color:{$palette:"down.stroke"},fontFamily:{$ref:"fontFamily"},fontSize:{$ref:"fontSize"},fontWeight:{$ref:"fontWeight"}},neutral:{color:{$palette:"neutral.stroke"},fontFamily:{$ref:"fontFamily"},fontSize:{$ref:"fontSize"},fontWeight:{$ref:"fontWeight"}},background:{fill:{$ref:"chartBackgroundColor"},fillOpacity:.5},altNeutral:{color:"gray",fontFamily:{$ref:"fontFamily"},fontSize:{$ref:"fontSize"},fontWeight:{$ref:"fontWeight"}}},create:e=>new mm(e)},{CartesianAxis:fm,ContinuousScale:xm,TimeScale:bm,UnitTimeScale:vm,TooltipManager:Sm}=s.n1,Mm=n.yar.create("sync");function km(e,t,i){const n=e.getKeys(t),s=e.getKeys(i);return e.shouldFlipXY?.()?[s,n]:[n,s]}function Dm(e="x"){switch(e){case"x":return[n.tv$.X];case"y":return[n.tv$.Y];case"xy":return[n.tv$.X,n.tv$.Y]}}var wm=class extends n.UbG{constructor(e){let t,i,s,a,o;super(),this.moduleContext=e,this.domainSync=new n.iNx,this.disabledByValidation=!1,this.cleanup.register(e.chartState.observe((e=>{const n=e("options","sync"),r=!this.disabledByValidation&&(n?.enabled??!1),l=n?.groupId,h=n?.axes??"x",c=n?.nodeInteraction??!0,d=n?.zoom??!0;if(r!==t)return this.onEnabledChange(),t=r,i=l,s=h,a=c,void(o=d);l!==i&&(this.onGroupIdChange(l,i),i=l),h!==s&&(this.onAxesChange(),s=h),c!==a&&(this.onNodeInteractionChange(),a=c),d!==o&&(this.onZoomChange(),o=d)})))}get opts(){return this.moduleContext.chartState.getValue("options","sync")}get enabled(){return!this.disabledByValidation&&this.opts.enabled}get groupId(){return this.opts.groupId}get axes(){return this.opts.axes}get nodeInteraction(){return this.opts.nodeInteraction}get zoom(){return this.opts.zoom}updateSiblings(e){const{syncManager:t}=this.moduleContext;for(const i of t.getGroupSiblings(e??this.groupId))Mm("ChartSync.updateSiblings()",i.id,i),this.updateChart(i)}updateChart(e,t=n.GvF.PROCESS_DOMAIN){Mm("ChartSync.updateChart()",e.id,n.GvF[t],e),t===n.GvF.PROCESS_DOMAIN?e.ctx.eventsHub.emit("chart:request-update",{type:t,opts:{forceNodeDataRefresh:!0}}):e.ctx.eventsHub.emit("chart:request-update",{type:t})}enabledZoomSync(){const{eventsHub:e}=this.moduleContext;this.disableZoomSync?.(),this.disableZoomSync=e.on("zoom:change-complete",(e=>this.onZoom(e)))}onZoom(e){const{syncManager:t}=this.moduleContext;for(const i of t.getGroupSiblings(this.groupId)){const t=i.modulesManager.getModule("sync");if(!t?.zoom)continue;const n=i.modulesManager.getModule("zoom");if(!n)continue;const s=this.prepareZoomUpdate();"sync"!==e.source&&(Mm("ChartsSyncManager.enabledZoomSync()",i.id,s),n.updateSyncZoom(s))}}enabledNodeInteractionSync(){this.disableNodeInteractionSync?.();const e=this.moduleContext.eventsHub.on("highlight:change",this.onHighlightChange.bind(this)),t=this.moduleContext.eventsHub.on("active:load-memento",this.onActiveLoadMemento.bind(this));this.disableNodeInteractionSync=()=>{e(),t()}}onHighlightChange(e){const{syncManager:t}=this.moduleContext;if(e.callerId.endsWith("-sync"))return;Mm("ChartSync.onHighlightChange()",e);const i=e.currentHighlight?.series,s=this.opts,[a]=Dm(s.axes),o=a===n.tv$.X?n.tv$.Y:n.tv$.X,[r,l]=i?km(i,a,o):[],h=go(e.currentHighlight);let c=r?.[0]?h?.[r[0]]:void 0,d=!1;if((0,n.$PY)(c)&&(d=!0,c=c.getTime()),!e.currentHighlight?.datum){for(const e of t.getGroupSiblings(s.groupId)){const t=e.modulesManager.getModule("sync");t?.nodeInteraction&&(e.ctx.highlightManager.updateHighlight(`${e.id}-sync`,void 0,!0),e.ctx.tooltipManager.removeTooltip(`${e.id}-sync`,void 0,!0))}return}const u="multi-series"===t.getGroupSyncMode(s.groupId);this.findMatchingHighlightNodes(a,o,u?l:[],d,c,e)}onActiveLoadMemento(e){const{activeItem:t,chartId:i}=e;if(void 0===t){this.moduleContext.highlightManager.updateHighlight(`${i}-sync`,void 0,!1),this.moduleContext.tooltipManager.removeTooltip(`${i}-sync`,void 0,!1);for(const e of this.moduleContext.syncManager.getGroupSiblings(this.groupId))e.onSyncActiveClear()}}
1findMatchingHighlightNodes(e,t,i,s,a,o){const{syncManager:r}=this.moduleContext;Mm("ChartSync.findMatchingHighlightNodes()",{mainDirection:e,secondaryKeys:i});for(const l of r.getGroupSiblings(this.groupId)){const r=l.modulesManager.getModule("sync");if(!r?.nodeInteraction)continue;let h=!1;for(const o of l.axes){if(!fm.is(o)||o.direction!==e)continue;const r=l.series.filter((n=>{if(!n.visible)return!1;if(i.length>0){const[,s]=km(n,e,t);return i.every((e=>s.includes(e)))}return!0})).map(this.findMatchingNodes(o,e,s,a)).filter(n.O9V);if(1===r.length&&r[0]?.nodeDatum!==l.ctx.highlightManager.getActiveHighlight()){this.dispatchHighlightUpdate(l,r[0].nodeDatum),h=!0;break}}h||(Mm("ChartSync.findMatchingHighlightNodes() - no matching nodes",l.id,o),this.dispatchHighlightUpdate(l))}}findMatchingNodes(e,t,i,s){return a=>{if(a.getKeyAxis(e.direction)!==e.id)return;const o=a.contextNodeData?.nodeData??[];if(!o?.length)return;const r=o[0],l=`${t}Key`;if(!(0,n.efk)(r,l))return;const h=r[l],c=o.find((e=>{const t=e.datum[h];return i?t.getTime()===s:t===s}));return c?{series:a,nodeDatum:c}:null}}dispatchHighlightUpdate(e,t){Mm("ChartSync.dispatchHighlightUpdate()",e.id,t);const i=null==t;e.ctx.highlightManager.updateHighlight(`${e.id}-sync`,t,i);const s=t?.series.tooltipEnabled??e.tooltip.enabled;if(t&&s){const i=e.seriesAreaBoundingBox,n=i.x+(t.midPoint?.x??t.point?.x??0),s=i.y+(t.midPoint?.y??t.point?.y??0),a=Sm.makeTooltipMeta({type:"pointermove",canvasX:n,canvasY:s},t.series,t,void 0);e.ctx.tooltipManager.updateTooltip(`${e.id}-sync`,a,e.getTooltipContent(t.series,t.datumIndex,t,"tooltip"))}else e.ctx.tooltipManager.removeTooltip(`${e.id}-sync`,void 0,!0);this.updateChart(e,n.GvF.SERIES_UPDATE)}async getSyncedDomain(e){const t=this.opts,i=t.axes;if(!fm.is(e)||"xy"!==i&&i!==e.direction)return;const{groupState:n,directionDomains:s,idDomains:a,positionDomains:o}=this.updateDomainState(e);this.validateAxis(e,n),await this.waitForDomainsToBeReady();const r=t.domainMode??"id";return"position"===r?this.calculateDerivedDomain(e,o):"direction"===r?this.calculateDerivedDomain(e,s):this.calculateDerivedDomain(e,a)}updateDomainState(e){var t,i,n,s,a;const{syncManager:o}=this.moduleContext,r=this.opts.groupId,l=o.getChart().id,h=e.id,c=o.getGroupState(r);if(!c)throw new Error("AG Charts - no GroupState for groupId: "+r);const d=c.domains??(c.domains={}),u=d[t=e.direction]??(d[t]={derived:[],sources:{},dirty:!0});((i=u.sources)[l]??(i[l]={}))[h]=e.dataDomain.domain,u.dirty=!0;const p=c.domainsById??(c.domainsById={}),g=p[h]??(p[h]={derived:[],sources:{},dirty:!0});((n=g.sources)[l]??(n[l]={}))[h]=e.dataDomain.domain,g.dirty=!0;const m=c.domainsByPosition??(c.domainsByPosition={}),y=m[s=e.position]??(m[s]={derived:[],sources:{},dirty:!0});return((a=y.sources)[l]??(a[l]={}))[h]=e.dataDomain.domain,y.dirty=!0,{groupState:c,directionDomains:u,idDomains:g,positionDomains:y}}validateAxis(e,t){const i=this.opts,n="multi-series"===this.moduleContext.syncManager.getGroupSyncMode(i.groupId);Dm(i.axes).includes(e.direction)&&(n?this.validateMultiSeries(e,t):this.validateSingleSeries(e,t))}validateMultiSeries(e,t){const{min:i,max:n,nice:s,reverse:a}=e,o=new Set(e.boundSeries.flatMap((t=>t.getKeys(e.direction))));for(const e of t.members){const{axes:t,modulesManager:r}=e,l=r.getModule("sync"),h=Dm(l?.axes),c=t.filter((e=>h.includes(e.direction))).filter((e=>e.boundSeries.some((t=>t.getKeys(e.direction).some((e=>o.has(e)))))));if(0===c.length)continue;const[d]=c;if(d.min!==i||d.max!==n||d.nice!==s||d.reverse!==a)return this.moduleContext.logger.warnOnce("To allow synchronization, ensure that all synchronized axes with matching keys have matching min, max, nice, and reverse properties."),void this.disableSelf()}}validateSingleSeries(e,t){const i=t.members,[{axes:s}]=i,{direction:a,min:o,max:r,nice:l,reverse:h}=e;for(const e of s)if(a===e.direction&&(l!==e.nice||h!==e.reverse||o!==e.min&&((0,n.BfI)(o)||(0,n.BfI)(e.min))||r!==e.max&&((0,n.BfI)(r)||(0,n.BfI)(e.max))))return this.moduleContext.logger.warnOnce("To allow synchronization, ensure that all charts have matching min, max, nice, and reverse properties on the synchronized axes."),void this.disableSelf()}disableSelf(){this.disabledByValidation||(this.disabledByValidation=!0,this.onEnabledChange())}calculateDerivedDomain(e,t){if(!t.dirty)return t.derived;let i=t.derived;const s=Object.values(t.sources).map((e=>Object.values(e)));let a;var o,r,l;return a=xm.is(e.scale)?s.flat(2):s.flat().toSorted(((e,t)=>e.length>t.length?-1:1)).flat(),t.derived=(0,n.AmM)(a),xm.is(e.scale)&&(i=(0,n.uYy)(i),t.derived=(0,n.uYy)(t.derived)),t.dirty=!1,o=e.scale,r=i,l=t.derived,(bm.is(o)||vm.is(o)?(0,n.r1i)(r.map((e=>e?.valueOf())),l.map((e=>e?.valueOf()))):(0,n.r1i)(r,l))||(Mm(e.id,"updated",{before:i,after:t.derived}),this.updateSiblings()),t.derived}removeAxis(e){const t=this.opts,i=t.axes;if(!fm.is(e)||"xy"!==i&&i!==e.direction)return;const{syncManager:n}=this.moduleContext,s=n.getGroupState(t.groupId),a=n.getChart().id,o=e.id;delete s?.domains?.[e.direction]?.sources?.[a]?.[o],delete s?.domainsByPosition?.[e.position]?.sources?.[a]?.[o],delete s?.domainsById?.[o]?.sources?.[a]?.[o]}async waitForDomainsToBeReady(){const{syncManager:e}=this.moduleContext,t=this.opts.groupId;let i=0;for(;e.getGroupMembers(t).some((e=>"init"===e.syncStatus));)Mm("ChartSync.waitForDomainsToBeReady() - waiting for all domains to be calculated",t),await this.domainSync.waitForCompletion(),i++;i>0&&Mm("ChartSync.waitForDomainsToBeReady() - waited for",i,"iterations"),this.domainSync.notify()}prepareZoomUpdate(){const e={...this.moduleContext.chartState.getValue("zoom")},t=this.opts.axes;return"x"===t?delete e?.y:"y"===t&&delete e?.x,(0,n.af4)(e)}onEnabledChange(){const{syncManager:e,highlightManager:t}=this.moduleContext,i=this.opts;!this.disabledByValidation&&i.enabled?(e.subscribe(i.groupId),t.unhighlightDelay=0):(e.unsubscribe(i.groupId),t.unhighlightDelay=100),this.updateSiblings(),this.onNodeInteractionChange(),this.onZoomChange()}onGroupIdChange(e,t){if(!this.enabled||e===t)return;const{syncManager:i}=this.moduleContext;i.unsubscribe(t),i.subscribe(e),this.updateSiblings(t),this.updateSiblings(e)}onAxesChange(){if(!this.enabled)return;const{syncManager:e}=this.moduleContext;this.updateChart(e.getChart())}onNodeInteractionChange(){const e=this.opts;!this.disabledByValidation&&e.enabled&&e.nodeInteraction?this.enabledNodeInteractionSync():this.disableNodeInteractionSync?.()}onZoomChange(){const e=this.opts;!this.disabledByValidation&&e.enabled&&e.zoom?this.enabledZoomSync():this.disableZoomSync?.()}destroy(){const{syncManager:e}=this.moduleContext;e.unsubscribe(this.groupId),this.updateSiblings(),this.disableZoomSync?.(),super.destroy()}},Im=(()=>({type:"plugin",name:"sync",chartType:"cartesian",enterprise:!0,version:s.xv,options:{enabled:n.zMY,groupId:n.YjP,axes:(0,n.KCZ)("x","y","xy"),nodeInteraction:n.zMY,zoom:n.zMY},themeTemplate:{enabled:!1,axes:"x",nodeInteraction:!0,zoom:!0},create:e=>new wm(e)}))(),Am=(()=>{var e=class extends s.n1.Rect{constructor(){super(),this.fill=Hg,this.fillOpacity=.2,this.zIndex=n.Dcv.ZOOM_SELECTION}updateValid(){this.fill=Hg}updateInvalid(){this.fill="#8a8a8a"}};return e.className="ZoomRect",e})(),Cm=class{constructor(e){this.ctx=e,this.manuallyAdjusted=!1,e.cleanup.register(e.eventsHub.on("zoom:save-memento",(e=>this.onSaveMemento(e))),e.eventsHub.on("zoom:load-memento",(e=>this.onLoadMemento(e))),e.eventsHub.on("zoom:change-request",(e=>this.onChangeRequest(e))))}get zoomManager(){return this.ctx.zoomManager}get autoScalingOpts(){return this.ctx.opts.autoScaling}get enabled(){return this.ctx.opts.enabled&&this.autoScalingOpts.enabled&&!this.manuallyAdjusted}onManualAdjustment(e){e===n.tv$.Y&&(this.manuallyAdjusted=!0)}onChangeRequest(e){const t=this.hasYAxisChange(e);if("scrollbar"===e.sourceDetail&&t&&(this.manuallyAdjusted=!0),e.isReset&&t&&(this.manuallyAdjusted=!1),this.enabled){const t=this.autoScaleYZoom(e.state);t&&e.constrainChanges(t)}}hasYAxisChange(e){for(const t of e.changedAxes)if(e.state[t]?.direction===n.tv$.Y)return!0;return!1}onSaveMemento(e){e.memento.autoScaledAxes=this.enabled?["y"]:void 0}onLoadMemento(e){const{zoom:t,memento:i,navigatorModule:s,zoomModule:a}=e;if(!s||a){let e=i?.autoScaledAxes?.includes("y");if(i?.rangeY)e??(e=!1),t.y=this.zoomManager.rangeToRatioDirection(n.tv$.Y,i.rangeY)??{min:0,max:1};else if(i?.ratioY)e??(e=!1),t.y={min:i.ratioY.start??0,max:i.ratioY.end??1};else{e??(e=!0);const i=e?this.getAutoScaleYZoom(t.x):void 0;t.y=i??{min:0,max:1}}null!=e&&(this.manuallyAdjusted=!e)}}getAutoScaleYZoom(e){if(!this.enabled)return;const{padding:t}=this.autoScalingOpts;let i;return i=this.ctx.opts.enableIndependentAxes?this.primaryAxisZoom(n.tv$.Y,e,{padding:t}):this.combinedAxisZoom(n.tv$.Y,e,{padding:t}),0===e.min&&1===e.max?null==i?void 0:{min:0,max:1}:i}autoScaleYZoom(e){const t={...this.ctx.chartState.getValue("zoom")};if(e){const i=this.zoomManager.getAxisZooms();for(const s of[n.tv$.X,n.tv$.Y])for(const a of(0,n.vIl)(e))if(i[a]?.direction===s){t[s]=e[a];break}}if(null==t.x)return;const i=this.getAutoScaleYZoom(t.x);return null==i||(0,n.DH9)(t.y,i)?void 0:this.zoomManager.toCoreZoomState({x:t.x,y:i})}zoomBounds(e,t,i,s){const a=e.scale,o=a.range;a.range=[0,1];const r=t.scale,l=r.range;r.range=[0,1];let h=1,c=!1,d=0,u=!1;for(const e of t.boundSeries){if(!e.visible)continue;const{connectsToYAxis:t}=e,s=e.getRange(n.tv$.Y,[i.min,i.max]);for(const e of s){const i=r.convert(e);Number.isFinite(i)&&(i<h&&(h=i,c=!t||e<0),i>d&&(d=i,u=!t||e>0))}}if((0,n.BfI)(t.options?.min)&&(h=0),(0,n.BfI)(t.options?.max)&&(d=1),a.range=o,r.range=l,h>=d)return;const p=(c?s:0)+(u?s:0),g=Math.min((d-h)*(1+p),1);
1if(!(g<=0)){if(c&&u){const e=(d+h)/2;h=e-g/2,d=e+g/2}else!c&&u?d=h+g:c&&!u&&(h=d-g);return h<0?(d+=-h,h=0):d>1&&(h-=d-1,d=1),{min:h,max:d}}}primaryAxisZoom(e,t,{padding:i=0}={}){const s=e===n.tv$.X?n.tv$.Y:n.tv$.X,a=this.zoomManager.getPrimaryAxis(s),o=this.zoomManager.getPrimaryAxis(e);if(null!=a&&null!=o)return this.zoomBounds(a,o,t,i)}combinedAxisZoom(e,t,{padding:i=0}={}){const s=this.zoomManager.getAxes(),a=e===n.tv$.X?n.tv$.Y:n.tv$.X,o=new Map;for(const e of s)if(e.direction===a)for(const t of e.boundSeries)o.set(t,e);let r=1,l=0;for(const n of s)if(n.direction===e)for(const e of n.boundSeries){const s=o.get(e);if(null==s)continue;const a=this.zoomBounds(s,n,t,i);if(null==a)return;r=Math.min(r,a.min),l=Math.max(l,a.max)}const h=1e-6;if(r<h&&(r=0),l>.999999&&(l=1),!(r>l))return{min:r,max:l}}},Nm=class{update(e,t,i,s,a,o){return this.oldZoom??(this.oldZoom=(0,n.af4)(t===n.tv$.X?{...a,x:o}:{...a,y:o})),this.updateCoords(e.currentX,e.currentY),this.updateZoom(t,i,s)}stop(){this.coords=void 0,this.oldZoom=void 0}updateCoords(e,t){this.coords?(this.coords.x2=e,this.coords.y2=t):this.coords={x1:e,y1:t,x2:e,y2:t}}updateZoom(e,t,i){const{coords:s,oldZoom:a}=this;let o=(0,n.af4)(a);if(!s||!a)return e===n.tv$.X?o.x:o.y;const r=jp(i,s.x1,s.y1),l=jp(i,s.x2,s.y2);if(e===n.tv$.X){const e=(l.x-r.x)*Bp(a);return o.x.max+=e,o.x=Kp(o.x,a.x,t,r.x),o=Yp(o),o.x}const h=(l.y-r.y)*Fp(a);return o.y.max-=h,o.y=Kp(o.y,a.y,t,r.y),o=Yp(o),o.y}},{userInteraction:Lm}=s.n1,Pm=class{constructor(e,t,i,n,s,a,o,r){this.eventsHub=e,this.contextMenuRegistry=t,this.chartState=i,this.zoomManager=n,this.getModuleProperties=s,this.getRect=a,this.updateZoom=o,this.isZoomValid=r}registerActions(e){const{contextMenuRegistry:t}=this;if(!t)return;const i=e?"show":"hide";if(t.toggle("zoom-to-cursor",i),t.toggle("pan-to-cursor",i),t.toggle("reset-zoom",i),!e)return;t.builtins.items["zoom-to-cursor"].action=this.onZoomToHere.bind(this),t.builtins.items["pan-to-cursor"].action=this.onPanToHere.bind(this),t.builtins.items["reset-zoom"].action=this.onResetZoom.bind(this);const s=e=>{const t=this.getRect();if(!t)return!0;const i=jp(t,e.canvasX,e.canvasY);return null!=this.iterateFindNextZoomAtPoint(i)},a=()=>!Hp((0,n.af4)(this.chartState.getValue("zoom"))),o=this.eventsHub.on("context-menu:setup",(e=>{t.builtins.items["zoom-to-cursor"].enabled=s(e),t.builtins.items["pan-to-cursor"].enabled=a(),t.builtins.items["reset-zoom"].enabled=Zp({chartState:this.chartState})}));return()=>{o(),t.toggle("zoom-to-cursor","hide"),t.toggle("pan-to-cursor","hide"),t.toggle("reset-zoom","hide")}}computeOrigin(e){const t=this.getRect(),{enabled:i}=this.getModuleProperties();if(!(i&&t&&e?.target&&e instanceof MouseEvent))return;return jp({x:0,y:0,width:t.width,height:t.height},e.offsetX,e.offsetY)}onZoomToHere({event:e}){const t=this.computeOrigin(e);if(!t)return;const i=this.iterateFindNextZoomAtPoint(t);null!=i&&this.updateZoom(Lm("contextmenu-zoom-to-cursor"),i)}onPanToHere({event:e}){const t=this.computeOrigin(e);if(!t)return;const i=(0,n.af4)(this.chartState.getValue("zoom")),s=Bp(i),a=Fp(i),o=t.x*s,r=t.y*a,l=Ep/2;let h={x:{min:t.x-l,max:t.x+l},y:{min:t.y-l,max:t.y+l}};h=Gp(h,s,a),h=Wp(h,i.x.min-t.x+o,i.y.min-t.y+r),this.updateZoom(Lm("contextmenu-pan-to-cursor"),Yp(h))}onResetZoom(e){this.zoomManager.resetZoom(Lm("contextmenu-reset"))}iterateFindNextZoomAtPoint(e){const{scrollingStep:t}=this.getModuleProperties();for(let i=t;i<=1-t;i+=t){const t=this.getNextZoomAtPoint(e,i);if(this.isZoomValid(t))return t}}getNextZoomAtPoint(e,t){const{isScalingX:i,isScalingY:s}=this.getModuleProperties(),a=(0,n.af4)(this.chartState.getValue("zoom")),o=e.x*Bp(a),r=e.y*Fp(a),l=Ep/2;let h={x:{min:e.x-l,max:e.x+l},y:{min:e.y-l,max:e.y+l}};return h=Gp(h,i?Bp(a)*t:Ep,s?Fp(a)*t:Ep),h=Wp(h,a.x.min-e.x+o,a.y.min-e.y+r),Yp(h)}},{userInteraction:Tm}=s.n1;function Om(e,t,i){const{domainMin:n,domainMax:s}=t,a=s-n;return{axisId:e,visibleMin:n+a*i.min,visibleMax:n+a*i.max}}function Rm(e,t){const{domainMin:i,domainMax:s}=e,{visibleMin:a,visibleMax:o}=t,r=s-i;return{direction:"x",min:(0,n.qE8)(0,(a-i)/r,1),max:(0,n.qE8)(0,(o-i)/r,1)}}var Em=class{constructor(e){this.ctx=e;const{eventsHub:t,cleanup:i}=e,n=()=>{t.off("layout:complete",n),i.register(t.on("data:load",(e=>this.onDataLoad(e))),t.on("data:update",(e=>
1this.onDataUpdate(e))))};i.register(t.on("layout:complete",n),t.on("zoom:change-request",(e=>this.onZoomChangeRequest(e))))}onDataLoad(e){this.performUpdateStrategy()}onDataUpdate(e){this.performUpdateStrategy()}onZoomChangeRequest(e){"internal-requiredWidth"===e.sourceDetail&&(this.desiredChanges=void 0);const t=this.popDesiredChanges();t&&(e.constrainChanges(t),this.ctx.onConstrainChanges(e))}computeDomainMinMax(e){const t=this.ctx.axisManager.getAxisIdContext(e);if(!t?.continuous||0===t.scale.domain.length)return;const[i,s]=t.scale.getDomainMinMax();let a;if((0,n.zZm)(i)&&(0,n.zZm)(s))a={domainMin:(0,n.Roz)(i),domainMax:(0,n.Roz)(s)};else{if(!(i instanceof Date&&s instanceof Date))return void this.ctx.logger.error(`Unexpected range types: start (${typeof i}), end (${typeof s})`);a={domainMin:i.getTime(),domainMax:s.getTime()}}const o=a.domainMax-a.domainMin;return Number.isFinite(o)&&0!==o?a:void 0}popDesiredChanges(){const{desiredChanges:e}=this;if(e)switch(this.desiredChanges=void 0,e.type){case"domain":{const t={};for(const i of e.domains){const e=this.computeDomainMinMax(i.axisId);e&&(t[i.axisId]=Rm(e,i))}return t}case"stickToEnd":{const{axisId:t,difference:i}=e,n=this.computeDomainMinMax(t);if(n){const e={axisId:t,visibleMin:n.domainMax-i,visibleMax:n.domainMax};return{[t]:Rm(n,e)}}break}default:return(e=>e)(e)}}performUpdateStrategy(){const e=(0,n.af4)(this.ctx.chartState.getValue("zoom"));if(function(e){return 0===e.x.min&&1===e.x.max&&0===e.y.min&&1===e.y.max}(e))return;if(function(e,t){return e.stickToEnd&&1===t.x.max}(this.ctx.opts,e))return this.performStickToEnd();const{strategy:t}=this.ctx.opts;switch(t){case"reset":return this.ctx.zoomManager.resetZoom(Tm("onDataChange-reset"));case"preserveRatios":return;case"preserveDomain":return this.performPreserveDomain();default:return(e=>e)(t)}}performPreserveDomain(){this.desiredChanges={type:"domain",domains:[]};const e=this.ctx.zoomManager.getAxes().filter((e=>e.direction===n.tv$.X));for(const{id:t}of e){const e=this.ctx.zoomManager.getAxisZoom(t);if(0===e.min&&1===e.max)continue;const i=this.computeDomainMinMax(t);if(i){const n=Om(t,i,e);this.desiredChanges.domains.push(n)}}}performStickToEnd(){const e=this.ctx.zoomManager.getPrimaryAxisId(n.tv$.X);if(!e)return;const t=this.computeDomainMinMax(e);if(!t)return;const i=this.ctx.zoomManager.getAxisZoom(e),{visibleMin:s,visibleMax:a}=Om(e,t,i),o=a-s;this.desiredChanges={type:"stickToEnd",axisId:e,difference:o}}},zm={off:1,short:.01,long:.002},Bm=class{constructor(e){this.ctx=e,this.deceleration=1,this.zoomCoordsHistoryIndex=0,this.coordsHistory=[]}get decelerationValue(){const{deceleration:e}=this;return Math.max("number"==typeof e?e:zm[e]??1,1e-4)}addListener(e,t){return this.onUpdate=t,()=>{this.onUpdate=void 0}}stopInteractions(){null!=this.inertiaHandle&&(this.ctx.agDocument.cancelAnimationFrame(this.inertiaHandle),this.inertiaHandle=void 0)}update(e){this.updateCoords(e.currentX,e.currentY);const{x1:t=0,y1:i=0,x2:n=0,y2:s=0}=this.coords??{};this.onUpdate?.({type:"update",deltaX:this.isPanningX()?t-n:0,deltaY:this.isPanningY()?i-s:0})}start(e){this.direction=e,this.coordsMonitorTimeout=setInterval(this.recordCurrentZoomCoords.bind(this),16)}stop(){const{coordsHistory:e}=this;let t=0,i=0,n=0;if(e.length>0){const s=this.zoomCoordsHistoryIndex%16;let a=s-1;a<0&&(a=e.length-1);let o=s;o>=e.length&&(o=0);const r=e[a],l=e[o];t=this.isPanningX()?r.x-l.x:0,i=this.isPanningY()?r.y-l.y:0,n=r.t-l.t}if(this.coords=void 0,this.direction=void 0,clearInterval(this.coordsMonitorTimeout),this.coordsMonitorTimeout=void 0,this.zoomCoordsHistoryIndex=0,this.coordsHistory.length=0,n>0&&this.decelerationValue<1){const e=t/n,s=i/n,a=Math.hypot(e,s),o=Math.atan2(s,e),r=performance.now();this.inertiaHandle=this.ctx.agDocument.requestAnimationFrame((e=>{this.animateInertia(e,e,r,a,o)}))}}recordCurrentZoomCoords(){const{coords:e,coordsHistory:t,zoomCoordsHistoryIndex:i}=this;if(!e)return;const{x2:n,y2:s}=e,a=Date.now();t[i%16]={x:n,y:s,t:a},this.zoomCoordsHistoryIndex+=1}animateInertia(e,t,i,n,s){const a=1-this.decelerationValue,o=-n/Math.log(a),r=n*(a**(t-i)-1)/Math.log(a),l=n*(a**(e-i)-1)/Math.log(a);this.onUpdate?.({type:"update",deltaX:this.isPanningX()?-Math.cos(s)*(l-r):0,deltaY:this.isPanningY()?-Math.sin(s)*(l-r):0}),l>=o-1||(this.inertiaHandle=this.ctx.agDocument.requestAnimationFrame((t=>{this.animateInertia(t,e,i,n,s)})))}updateCoords(e,t){this.coords?this.coords={x1:this.coords.x2,y1:this.coords.y2,x2:e,y2:t}:this.coords={x1:e,y1:t,x2:e,y2:t}}isPanningX(){return null==this.direction||this.direction===n.tv$.X}isPanningY(){return null==this.direction||this.direction===n.tv$.Y}translateZooms(e,t,i,s){const a=jp(e,e.x+Math.abs(i),e.y+e.height-Math.abs(s)),o=Math.sign(i)*a.x,r=-Math.sign(s)*a.y,l={};for(const[e,i]of(0,n.jOZ)(t)){if(null==i)continue;if(i.min===n.eKe&&i.max===n.Oxg)continue;const{direction:t}=i;let s=(0,n.af4)({[t]:i});s=Yp(Wp(s,o*Bp(s),r*Fp(s)));const{min:a,max:h}=s[t];l[e]={direction:t,min:a,max:h}}return l}},Fm=class{updateAxes(e,t,i,s){const a={}
1,{anchorPointX:o,anchorPointY:r,isScalingX:l,isScalingY:h,scrollingStep:c}=t,d=jp(i,e.currentX,e.currentY);for(const[t,i]of(0,n.jOZ)(s)){if(null==i)continue;const{direction:s,min:u,max:p}=i;let g={min:u,max:p};const m=c*e.deltaY*(p-u);if(s===n.tv$.X&&l)g.max+=m,g=Kp(g,i,o,d.x);else{if(s!==n.tv$.Y||!h)continue;g.max+=m,g=Kp(g,i,r,d.y)}if(g.max<g.min)continue;const y=Up(g);a[t]={direction:s,min:y.min,max:y.max}}return a}update(e,t,i,s){const{anchorPointX:a,anchorPointY:o,isScalingX:r,isScalingY:l,scrollingStep:h}=t,c=jp(i,e.currentX+i.x,e.currentY+i.y),d=e.deltaY;let u=(0,n.af4)(s);if(u.x.max+=r?h*d*Bp(s):0,u.y.max+=l?h*d*Fp(s):0,!(u.x.max<u.x.min||u.y.max<u.y.min))return r&&(u.x=Kp(u.x,s.x,a,c.x)),l&&(u.y=Kp(u.y,s.y,o,c.y)),u=Yp(u),u}updateDelta(e,t,i){const{anchorPointX:s,anchorPointY:a,isScalingX:o,isScalingY:r,scrollingStep:l}=t;let h=(0,n.af4)(i);return h.x.max+=o?l*-e*Bp(i):0,h.y.max+=r?l*-e*Fp(i):0,o&&(h.x=Kp(h.x,i.x,s)),r&&(h.y=Kp(h.y,i.y,a)),h=Yp(h),h}},Vm=class{constructor(e,t,i){this.rect=e,this.getZoom=t,this.isZoomValid=i,this.rect.visible=!1}update(e,t,i){const{canvasX:s,canvasY:a}=(0,n.LYQ)(e,i);this.rect.visible=!0,this.updateCoords(s,a,t,i),this.updateRect(i)}stop(e,t,i){let s=(0,n.af4)();if(!e||!t)return s;this.coords&&(s=this.createZoomFromCoords(t,i));return s=Yp(function(e,t,i){return{x:{min:e.x.min*t,max:e.x.max*t},y:{min:e.y.min*i,max:e.y.max*i}}}(s,t.width/e.width,t.height/e.height)),this.reset(),this.isZoomValid(s)?s:void 0}reset(){this.coords=void 0,this.rect.visible=!1}didUpdate(){return this.rect.visible&&this.rect.width>0&&this.rect.height>0}updateCoords(e,t,i,n){if(!this.coords)return void(this.coords={x1:e,y1:t,x2:e,y2:t});const{coords:s}=this;if(s.x2=e,s.y2=t,!n)return;const{isScalingX:a,isScalingY:o,keepAspectRatio:r}=i,l=this.getNormalisedDimensions();if(r&&a&&o){const e=n.width/n.height;s.y2<s.y1?s.y2=Math.min(s.y1-l.width/e,s.y1):s.y2=Math.max(s.y1+l.width/e,s.y1)}a||(s.x1=n.x,s.x2=n.x+n.width),o||(s.y1=n.y,s.y2=n.y+n.height)}updateRect(e){if(!e)return;const{rect:t}=this,i=this.getNormalisedDimensions(),{width:n,height:s}=i;let{x:a,y:o}=i;a=Math.max(a,e.x),a-=Math.max(0,a+n-(e.x+e.width)),o=Math.max(o,e.y),o-=Math.max(0,o+s-(e.y+e.height)),t.x=a,t.y=o,t.width=n,t.height=s;const r=this.createZoomFromCoords(e,this.getZoom());this.isZoomValid(r)?t.updateValid():t.updateInvalid()}createZoomFromCoords(e,t){const i=(0,n.af4)(t),s=this.getNormalisedDimensions(),a=jp(e,s.x,s.y+s.height);let o=_p(i,s.width/e.width,s.height/e.height);return o=Wp(o,a.x*Bp(i),a.y*Fp(i)),o=Yp(o),o}getNormalisedDimensions(){const{x1:e=0,y1:t=0,x2:i=0,y2:n=0}=this.coords??{};return{x:Math.min(e,i),y:Math.min(t,n),width:e<=i?i-e:e-i,height:t<=n?n-t:t-n}}},{userInteraction:$m,NativeWidget:Hm,Toolbar:jm}=s.n1,Wm=(()=>{var e=class extends Ii{};return l([n.mAP],e.prototype,"value",2),l([n.mAP],e.prototype,"section",2),e})(),_m=(()=>{var e=class extends n.XPE{constructor(e,t,i,s,a,o){super(),this.ctx=e,this.getModuleProperties=t,this.updateZoom=i,this.updateAxisZoom=s,this.resetZoom=a,this.isZoomValid=o,this.enabled=!1,this.buttons=new n.F_c(Wm),this.visible="hover",this.verticalSpacing=10,this.detectionRange=38,this.cleanup=new n._uV,this.toggleButtonsDebounced=(0,n.sg1)(this.toggleButtons.bind(this),300,{leading:!0,trailing:!0}),this.container=new Hm((0,n.na4)("div")),this.container.addClass("ag-charts-zoom-buttons"),e.domManager.addChild("canvas-overlay","zoom-buttons",this.container.getElement()),this.toolbar=new jm(e,"ariaLabelZoomToolbar","horizontal"),this.container.addChild(this.toolbar),this.toolbar.getElement().style.transform="translateY(54px)",this.toolbar.setHidden(!this.enabled),this.toggleVisibility("always"===this.visible),this.cleanup.register(this.toolbar.addToolbarListener("button-pressed",this.onButtonPress.bind(this)),this.toolbar.addToolbarListener("button-focused",this.onButtonFocus.bind(this)),e.widgets.containerWidget.addListener("mousemove",this.onHover.bind(this)),e.widgets.containerWidget.addListener("mouseleave",this.onLeave.bind(this)),e.eventsHub.on("layout:complete",this.onLayoutComplete.bind(this)),this.teardown.bind(this))}destroy(){this.cleanup.flush()}toggleVisibleZoomed(e){"zoomed"===this.visible&&this.toggleVisibility(!e)}teardown(){this.ctx.domManager.removeChild("canvas-overlay","zoom-buttons"),this.container.destroy()}onLayoutComplete(e){if(!this.enabled)return;const{buttons:t,container:i}=this,{rect:n}=e.series;for(const e of t)if(null==e.tooltip&&null==e.label){const t={"pan-end":"toolbarZoomPanEnd","pan-left":"toolbarZoomPanLeft","pan-right":"toolbarZoomPanRight","pan-start":"toolbarZoomPanStart","zoom-in":"toolbarZoomZoomIn","zoom-out":"toolbarZoomZoomOut",reset:"toolbarZoomReset"};e.tooltip=t[e.value]}this.toolbar.updateButtons(t),this.toggleButtonsDebounced(),this.cachedButtonCount!==t.length&&(this.cachedButtonCount=t.length,this.cachedContainerHeight=void 0,this.container.getElement().style.height="",this.lastBottomY=void 0);const s=this.getContainerHeight(),a=n.y+n.height-s;this.lastBottomY!==a&&(this.lastBottomY=a,i.setBounds({y:a}))}getContainerHeight(){if(void 0!==this.cachedContainerHeight)return this.cachedContainerHeight;const e=this.container.getBounds().height;return 0===e||(this.cachedContainerHeight=e,this.container.getElement().style.height=`${e}px`),e}onHover(e){if(!this.enabled||"hover"!==this.visible||this.toolbar.isHidden())return;const{container:t,detectionRange:i,ctx:{scene:n}}=this,{currentY:s,sourceEvent:{target:a}}=e,o=t.getElement(),r=s>o.offsetTop-i&&s<n.canvas.element.offsetHeight||a===o;this.toggleVisibility(r)}onLeave(){"hover"===this.visible&&this.toggleVisibility(!1)}toggleVisibility(e,t=!1){const{toolbar:i,verticalSpacing:n}=this;i.toggleClass("ag-charts-zoom-buttons__toolbar--hidden",!e);const s=i.getElement();s.style.transitionDuration=t?"0s":"",s.style.transform=e?"translateY(0)":`translateY(${this.getContainerHeight()+n}px)`}toggleButtons(){const e=(0,n.af4)(this.ctx.chartState.getValue("zoom"));if(!this.previousZoom||!$p(this.previousZoom,e)){this.previousZoom=e;for(const[t,i]of this.buttons.entries()){let s=!0;switch(i?.value){case"pan-start":case"pan-left":s=e.x.min>n.eKe;break;case"pan-end":case"pan-right":s=e.x.max<n.Oxg;break;case"zoom-out":s=!Hp(e);break;case"zoom-in":s=this.isZoomValid(this.getNextZoomStateUnified("zoom-in",e,this.getModuleProperties()));break;case"reset":s=Zp(this.ctx)}this.toolbar.toggleButtonEnabledByIndex(t,s)}}}onButtonPress({button:e}){if(!this.enabled||this.toolbar.isHidden())return;const t=this.getModuleProperties();if(t.independentAxes&&"reset"!==e.value){const i=this.ctx.zoomManager.getAxisZooms();for(const[s,a]of(0,n.jOZ)(i)){if(null==a)continue;const{direction:i,min:n,max:o}=a;this.onButtonPressAxis(e,t,s,i,{min:n,max:o})}}else this.onButtonPressUnified(e,t)}onButtonFocus(e){this.toggleVisibility(!0,!0)}onButtonPressAxis(e,t,i,s,a){const{isScalingX:o,isScalingY:r,scrollingStep:l}=t;let h={...a};const c=a.max-a.min;switch(e.value){case"pan-start":h.max=c,h.min=0;break;case"pan-end":h.min=h.max-c,h.max=n.Oxg;break;case"pan-left":h.min-=c*l,h.max-=c*l;break;case"pan-right":h.min+=c*l,h.max+=c*l;break;case"zoom-in":case"zoom-out":{const i=s===n.tv$.X,c=i&&o||!i&&r;let d="zoom-in"===e.value?1-l:1+l;c||(d=1);const u=i?this.getAnchorPointX(t):this.getAnchorPointY(t);
1h.max=h.min+(h.max-h.min)*d,h=Kp(h,a,u);break}}this.updateAxisZoom($m(`zoom-button-${e.value}`),i,s,Up(h))}onButtonPressUnified(e,t){const{scrollingStep:i}=t,s=(0,n.af4)(this.ctx.chartState.getValue("zoom"));let a=(0,n.af4)(s);switch(e.value){case"reset":return void this.resetZoom("zoom-button-reset");case"pan-start":a.x.max=Bp(a),a.x.min=0;break;case"pan-end":a.x.min=n.Oxg-Bp(a),a.x.max=n.Oxg;break;case"pan-left":a=Wp(a,-Bp(a)*i,0);break;case"pan-right":a=Wp(a,Bp(a)*i,0);break;case"zoom-in":case"zoom-out":a=this.getNextZoomStateUnified(e.value,s,t)}this.updateZoom($m(`zoom-button-${e.value}`),Yp(a))}getNextZoomStateUnified(e,t,i){const{isScalingX:n,isScalingY:s,scrollingStep:a}=i,o="zoom-in"===e?1-a:1+a,r=_p(t,n?o:1,s?o:1);return r.x=Kp(r.x,t.x,this.getAnchorPointX(i)),r.y=Kp(r.y,t.y,this.getAnchorPointY(i)),r}getAnchorPointX(e){const t=this.anchorPointX??e.anchorPointX;return"pointer"===t?"end":t}getAnchorPointY(e){const t=this.anchorPointY??e.anchorPointY;return"pointer"===t?"middle":t}};return l([n.mAP,(0,n.mBh)({changeValue(e){this.toolbar?.setHidden(!e)}})],e.prototype,"enabled",2),l([n.mAP],e.prototype,"buttons",2),l([n.mAP,(0,n.mBh)({changeValue(e,t){if(null==t)return;const i="always"===e,n="zoomed"===e&&null!=this.previousZoom&&!Hp(this.previousZoom);this.toggleVisibility(i||n)}})],e.prototype,"visible",2),l([n.mAP],e.prototype,"anchorPointX",2),l([n.mAP],e.prototype,"anchorPointY",2),e})(),Gm=1e6;function Km({min:e,max:t},i,n,s){return 0===s?0:Gm*((i-n)/s*(t-e)+e)}function Ym(e,t,i,n){0===t&&(t=30),0===n&&(n=30);return!(e+t<i-n||i+n<e-t)}var Um=class{constructor(){this.touchStart={origins:[{identifier:0,normalX:Number.NaN,normalY:Number.NaN},{identifier:0,normalX:Number.NaN,normalY:Number.NaN}]},this.initialZoom={x:{min:0,max:1},y:{min:0,max:1}},this.previous={a1:Number.NaN,a2:Number.NaN,b1:Number.NaN,b2:Number.NaN}}start(e,t,i){if(2!==e.sourceEvent.targetTouches.length)return!1;e.sourceEvent.preventDefault();const n=Array.from(e.sourceEvent.targetTouches),{x:s,y:a,width:o,height:r}=t.getBoundingClientRect();this.initialZoom.x.min=i.x?.min??0,this.initialZoom.x.max=i.x?.max??1,this.initialZoom.y.min=i.y?.min??0,this.initialZoom.y.max=i.y?.max??1;for(const e of this.touchStart.origins)e.identifier=0;this.previous.a1=Number.NaN,this.previous.a2=Number.NaN,this.previous.b1=Number.NaN,this.previous.b2=Number.NaN;for(const e of[0,1]){const t=n[e].clientX,i=a+r-n[e].clientY;this.touchStart.origins[e].identifier=n[e].identifier,this.touchStart.origins[e].normalX=Km(this.initialZoom.x,t,s,o),this.touchStart.origins[e].normalY=Km(this.initialZoom.y,i,a,r)}const[l,h]=n,[c,d]=this.touchStart.origins,u=Ym(l.clientX,l.radiusX,h.clientX,h.radiusX);return Ym(l.clientY,l.radiusY,h.clientY,h.radiusY)&&(c.normalY=d.normalY=(c.normalY+d.normalY)/2),u&&(c.normalX=d.normalX=(c.normalX+d.normalX)/2),!0}update(e,t){e.sourceEvent.preventDefault();const i=Array.from(e.sourceEvent.targetTouches),{x:n,y:s,width:a,height:o}=t.getBoundingClientRect(),{origins:r}=this.touchStart,l=[0,1].map((e=>i.find((t=>t.identifier===r[e].identifier)))),h=r[0].normalX,c=r[1].normalX,d=l[0].clientX,u=l[1].clientX,p=r[0].normalY,g=r[1].normalY,m=s+o-l[0].clientY,y=s+o-l[1].clientY;return this.twitchTolerantZoomPan4(h,c,d,u,p,g,m,y,n,s,a,o)}end(e){const t=Array.from(e.sourceEvent.targetTouches).map((e=>e.identifier));return!t.includes(this.touchStart.origins[0].identifier)||!t.includes(this.touchStart.origins[1].identifier)}twitchTolerantZoomPan4(e,t,i,n,s,a,o,r,l,h,c,d){const{initialZoom:u,previous:p}=this;return{x:Xm(e,t,i,n,p,"a1","a2",l,c,u.x),y:Xm(s,a,o,r,p,"b1","b2",h,d,u.y)}}};function Xm(e,t,i,n,s,a,o,r,l,h){if(e==t){const t=(e-(Km(h,i,r,l)+Km(h,n,r,l))/2)/Gm;return{min:h.min+t,max:h.max+t}}{const h=s[a],c=s[o];return Math.abs(i-h)+Math.abs(n-c)<=1?(i=h,n=c):(s[a]=i,s[o]=n),function(e,t,i,n,s,a){[e,t]=[Math.min(e,t),Math.max(e,t)],[i,n]=[Math.min(i,n),Math.max(i,n)];const o=Gm*(n-s)/a,r=(i-s)/(n-s),l=(e-r*t)/(Gm-Gm*(i-s)/a+r*(o-Gm));return{min:l,max:(t+(o-Gm)*l)/o}}(e,t,i,n,r,l)}}var{userInteraction:Zm,InteractionState:qm}=s.n1,Qm=e=>(0,n.GBz)(e,10),Jm="zoom-cursor",ey="zoom-drag-cursor",ty="zoom-tooltip",iy={enabled:!1},ny=class extends n.UbG{constructor(e){super(),this.ctx=e,this.axisDragger=new Nm,this.panner=new Bm(this.ctx),this.scroller=new Fm,this.scrollPanner=new qp,this.twoFingers=new Um,this.dragState=0,this.isState=e=>this.ctx.interactionManager.isState(e),this.destroyContextMenuActions=void 0,this.previousZoomValid=!0,this.previousAxisZoomValid={[n.tv$.X]:!0,[n.tv$.Y]:!0};const t=this;this.buttons=new _m(e,this.getModuleProperties.bind(this),this.updateZoom.bind(this),this.updateAxisZoom.bind(this),this.resetZoom.bind(this),this.isZoomValid.bind(this));const i=new Am;this.selector=new Vm(i,this.getZoom.bind(this),this.isZoomValid.bind(this)),this.contextMenu=new Pm(e.eventsHub,e.contextMenuRegistry,e.chartState,e.zoomManager,this.getModuleProperties.bind(this),(()=>this.paddedRect),this.updateZoom.bind(this),this.isZoomValid.bind(this));let s;new Em({chartState:e.chartState,eventsHub:e.eventsHub,zoomManager:e.zoomManager,axisManager:e.axisManager,logger:e.logger,cleanup:this.cleanup,onConstrainChanges:e=>{if(this.opts.minVisibleItems>0){const t=e.stateAsDefinedZoom();e.constrainZoom(this.constrainZoom(t))}},get opts(){return t.opts.onDataChange}}),e.widgets.seriesDragInterpreter&&this.cleanup.register(e.widgets.seriesWidget.addListener("drag-start",(()=>this.draggedAxisId=this.hoveredAxisId)),e.widgets.seriesDragInterpreter.events.on("dblclick",(e=>this.onSeriesAreaDoubleClick(e))),e.widgets.seriesDragInterpreter.events.on("drag-start",(e=>this.onSeriesAreaDragStart(e))),e.widgets.seriesDragInterpreter.events.on("drag-move",(e=>this.onSeriesAreaDragMove(e))),e.widgets.seriesDragInterpreter.events.on("drag-end",(()=>this.onSeriesAreaDragEnd()))),this.cleanup.register(e.scene.attachNode(i),e.eventsHub.on("series:keynav-zoom",(e=>this.onNavZoom(e))),e.eventsHub.on("series:keynav-panx",(e=>this.onNavPanX(e))),e.eventsHub.on("zoom-interaction:zoom:wheel",(e=>this.onWheel(e))),e.eventsHub.on("zoom-interaction:zoom:axis-mouseenter",(e=>this.onAxisMouseEnter(e))),e.eventsHub.on("zoom-interaction:zoom:axis-mouseleave",(()=>this.onAxisMouseLeave())),e.eventsHub.on("zoom-interaction:zoom:axis-drag-start",(e=>this.onAxisDragStart(e.direction))),e.eventsHub.on("zoom-interaction:zoom:axis-drag-move",(e=>this.onAxisDragMove(e.axisId,e.direction,e.event))),e.eventsHub.on("zoom-interaction:zoom:axis-drag-end",(()=>this.onAxisDragEnd())),e.eventsHub.on("zoom-interaction:zoom:axis-dblclick",(e=>this.onAxisDoubleClick(e.axisId))),e.eventsHub.on("zoom-interaction:zoom:axis-wheel",(e=>this.onAxisWheel(e))),e.widgets.seriesWidget.addListener("touchstart",((e,t)=>
1this.onTouchStart(e,t))),e.widgets.seriesWidget.addListener("touchmove",((e,t)=>this.onTouchMove(e,t))),e.widgets.seriesWidget.addListener("touchend",(e=>this.onTouchEnd(e))),e.widgets.seriesWidget.addListener("touchcancel",(e=>this.onTouchEnd(e))),e.eventsHub.on("update:process-data",(e=>this.onProcessData(e))),e.eventsHub.on("layout:complete",(e=>this.onLayoutComplete(e))),e.eventsHub.on("zoom:change-request",(e=>this.onZoomChangeRequested(e))),e.eventsHub.on("zoom:pan-start",(e=>this.onZoomPanStart(e))),this.panner.addListener("update",(e=>this.onPanUpdate(e))),(()=>this.teardown())),this.autoScaler=new Cm({zoomManager:e.zoomManager,eventsHub:e.eventsHub,chartState:e.chartState,cleanup:this.cleanup,opts:{get enabled(){return t.opts.enabled},get enableIndependentAxes(){return t.opts.enableIndependentAxes},get autoScaling(){return t.opts.autoScaling}}}),this.cleanup.register(e.chartState.observe((t=>{const i=t("options","zoom");null!=i&&(e.zoomManager.setIndependentAxes(Boolean(i.enableIndependentAxes)),this.panner.deceleration=i.deceleration,i.buttons&&this.buttons.set(i.buttons),s!==i.enabled&&(s=i.enabled,this.onEnabledChange(i.enabled)),this.refreshTouchAction())})),e.eventsHub.on("zoom:change-complete",(()=>this.refreshTouchAction())),(()=>e.widgets.seriesWidget.setTouchAction(void 0)))}get opts(){return this.ctx.chartState.getValue("options","zoom")??iy}get selectionOpts(){return this.ctx.chartState.getValue("options","selection")}get enabled(){return this.opts.enabled}refreshTouchAction(){const{enabled:e,enablePanning:t,enableTwoFingerZoom:i}=this.opts;let n;e&&(t||i)&&(n=Hp(this.getZoom())?"pan-y":"none"),this.prevTouchAction!==n&&(this.prevTouchAction=n,this.ctx.widgets.seriesWidget.setTouchAction(n))}teardown(){this.ctx.zoomManager.setZoomModuleEnabled(!1),this.ctx.domManager.unlockCursor(ey),this.buttons.destroy(),this.destroyContextMenuActions?.()}onEnabledChange(e){this.ctx.zoomManager.setZoomModuleEnabled(e),this.destroyContextMenuActions?.(),this.destroyContextMenuActions=this.contextMenu.registerActions(e)}isIgnoredTouch(e){if("touch"!==e?.device)return!1;if("drag"!==this.ctx.chartState.getValue("options","touch").dragAction)return!0;const{enableSelecting:t,enablePanning:i}=this.opts;return!t&&(!i||Hp(this.getZoom()))}onSeriesAreaDoubleClick(e){const{enabled:t,enableDoubleClickToReset:i}=this.opts;t&&i&&!e?.preventZoomDblClick&&this.isState(qm.ZoomClickable)&&this.resetZoom("zoom-seriesarea-dblclick")}onSeriesAreaDragStart(e){const{enabled:t,enablePanning:i,enableSelecting:n}=this.opts,{ctx:{domManager:s},ctx:a}=this,o=a.zoomManager;if(!t||!this.isState(qm.ZoomDraggable)||0!==this.dragState||this.isIgnoredTouch(e))return;if(this.panner.stopInteractions(),this.draggedAxisId)return;let r=0;const l=this.selectionOpts,h=!(!l?.enabled||!l?.enableDrag),c=this.isPanningKeyPressed(e.sourceEvent);!i||(n||h)&&!c?n&&!c&&(h||(r=3)):(s.lockCursor(ey,"grabbing"),r=2,this.panner.start()),0!==(this.dragState=r)&&o.fireZoomPanStartEvent("zoom")}onSeriesAreaDragMove(e){const{enabled:t}=this.opts,{dragState:i,paddedRect:a,panner:o,selector:r,ctx:{interactionManager:l,tooltipManager:h,eventsHub:c}}=this;if(!this.draggedAxisId&&t&&a&&this.isState(qm.ZoomDraggable)&&!this.isIgnoredTouch(e)){switch(l.pushState(s.n1.InteractionState.ZoomDrag),"touch"===e.device&&e.sourceEvent.preventDefault(),i){case 2:o.update(e);break;case 3:r.update(e,this.getModuleProperties(),a);break;case 0:return}l.isState(s.n1.InteractionState.Frozen)||h.updateTooltip(ty),c.emit("chart:request-update",{type:n.GvF.PERFORM_LAYOUT,opts:{skipAnimations:!0}})}}onSeriesAreaDragEnd(){this.ctx.interactionManager.popState(s.n1.InteractionState.ZoomDrag),this.ctx.domManager.unlockCursor(ey),!this.draggedAxisId&&this.opts.enabled&&0!==this.dragState&&(this.handleRegularDragEnd(),this.resetDragState())}handleRegularDragEnd(){const{panner:e,selector:t}=this;switch(this.dragState){case 2:e.stop();break;case 3:if(t.didUpdate()){const e=t.stop(this.seriesRect,this.paddedRect,this.getZoom());e?this.updateZoom(Zm("zoom-seriesarea-selector"),e):this.ctx.eventsHub.emit("chart:request-update",{type:n.GvF.SCENE_RENDER})}}}resetDragState(){this.dragState=0,this.ctx.domManager.updateCursor(Jm),this.ctx.tooltipManager.removeTooltip(ty)}onAxisMouseEnter(e){this.hoveredAxisId=e.axisId,this.hoveredAxisDirection=e.direction,this.updateAxisCursor(e.direction,e)}updateAxisCursor(e,t){const{anchorPointX:i,anchorPointY:s,axisDraggingMode:a,enabled:o,enableAxisDragging:r}=this.opts;if(!o||!r)return void this.ctx.domManager.updateCursor(Jm);const l=this.getZoom();let h,c=!1;
1if(e===n.tv$.X){if(h="ew-resize",c=!(0,n.YXt)(Bp(l),Ep),!c){const e=_p(l,.999,1);e.x=Kp(e.x,l.x,i),c=this.isZoomValid(e,{includeYVisibleRange:!0})}}else if(h="ns-resize",c=!(0,n.YXt)(Fp(l),Ep),!c){const e=_p(l,1,.999);e.y=Kp(e.y,l.y,s),c=this.isZoomValid(e,{includeYVisibleRange:!0})}"pan"===a&&(h="grab"),c?(t?.stopProcessing(),this.ctx.domManager.updateCursor(Jm,h)):this.ctx.domManager.updateCursor(Jm)}onAxisMouseLeave(){this.hoveredAxisId=void 0,this.hoveredAxisDirection=void 0,this.ctx.domManager.updateCursor(Jm);const{enabled:e,enableAxisDragging:t}=this.opts}onAxisDoubleClick(e){const{enabled:t,enableDoubleClickToReset:i}=this.opts,{ctx:s}=this,a=s.zoomManager;t&&i&&this.isState(qm.ZoomClickable)&&(this.previousAxisZoomValid={[n.tv$.X]:!0,[n.tv$.Y]:!0},a.resetAxisZoom({source:"user-interaction",sourceDetail:"zoom-axis-dblclick"},e))}onAxisDragStart(e){const{axisDraggingMode:t,enabled:i,enableAxisDragging:s}=this.opts,{panner:a,ctx:o}=this,r=o.zoomManager;if(i&&s)if(a.stopInteractions(),"pan"===t)this.ctx.domManager.lockCursor(ey,"grabbing"),this.dragState=2,this.panner.start(e),r.fireZoomPanStartEvent("zoom");else{const t=e===n.tv$.X?"ew-resize":"ns-resize";this.ctx.domManager.lockCursor(ey,t),this.dragState=1}}onAxisDragMove(e,t,i){const{anchorPointX:a,anchorPointY:o,enabled:r,enableAxisDragging:l}=this.opts,{axisDragger:h,dragState:c,seriesRect:d,shouldFlipXY:u,ctx:{interactionManager:p,tooltipManager:g,eventsHub:m}}=this;if(!r||!l||!d)return;p.pushState(s.n1.InteractionState.ZoomDrag),"touch"===i.device&&i.sourceEvent.preventDefault();const y=this.getZoom();if(2===c)this.panner.update(i);else{let s=t===n.tv$.X?a:o;u&&(s=t===n.tv$.X?o:a);const r=this.ctx.zoomManager.getAxisZoom(e),l=h.update(i,t,s,d,y,r);this.autoScaler.onManualAdjustment(t),this.updateAxisZoom(Zm("zoom-axis-drag"),e,t,l,{directional:!0})}g.updateTooltip(ty),m.emit("chart:request-update",{type:n.GvF.PERFORM_LAYOUT,opts:{skipAnimations:!0}})}onAxisDragEnd(){const{axisDraggingMode:e,enabled:t,enableAxisDragging:i}=this.opts,{axisDragger:n,dragState:a,ctx:{domManager:o,interactionManager:r,tooltipManager:l}}=this;r.popState(s.n1.InteractionState.ZoomDrag),o.unlockCursor(ey),t&&i&&0!==a&&(this.dragState=0,"pan"===e&&this.panner.stop(),n.stop(),null!=this.hoveredAxisId&&null!=this.hoveredAxisDirection?this.updateAxisCursor(this.hoveredAxisDirection):o.updateCursor(Jm),l.removeTooltip(ty))}onNavZoom(e){const{enabled:t,enableScrolling:i}=this.opts,{scroller:n}=this;this.ctx.interactionManager.isState(s.n1.InteractionState.Focusable)&&t&&i&&(e.widgetEvent.sourceEvent.preventDefault(),this.updateZoom(Zm(`keyboard(${e.delta})`),n.updateDelta(e.delta,this.getModuleProperties(),this.getZoom())))}onNavPanX(e){const{enabled:t}=this.opts;if(!this.ctx.interactionManager.isState(s.n1.InteractionState.Focusable)||!t)return;e.widgetEvent.sourceEvent.preventDefault();const i=e.reverse?{[-1]:1,1:-1,home:"end",end:"home"}[e.delta]:e.delta,n=this.getZoom(),a=Bp(n);if("home"===i)n.x.min=0,n.x.max=a;else if("end"===i)n.x.min=1-a,n.x.max=1;else{const e=i*a;n.x.min+=e,n.x.max+=e,n.x=Up(n.x)}this.updateZoom(Zm(`keyboard-page(${e.delta})`),n)}onWheel(e){const{enabled:t,enablePanning:i,enableScrolling:n,scrollingMode:s}=this.opts,{paddedRect:a}=this;if(!(t&&n&&a&&this.isState(qm.ZoomWheelable)))return;e.stopProcessing();const{deltaX:o,deltaY:r}=e.event,l=null!=o&&null!=r&&Math.abs(o)>Math.abs(r);i&&("pan"===s||l)?this.onWheelPanning(e):this.onWheelScrolling(e)}onWheelPanning(e){const{scrollingStep:t,scrollingMode:i="zoom"}=this.opts,{scrollPanner:s,seriesRect:a,ctx:o}=this,r=o.zoomManager;if(!a)return void e.abort();const{event:l}=e,h=this.getZoom(),c=l.deltaY>0&&h.y.min===n.eKe||l.deltaY<0&&h.y.max===n.Oxg,d=s.update(l,t,i,a,r.getAxisZooms());this.updateChanges(Zm("zoom-seriesarea-wheel"),d),c?e.capped():e.uncapped()}onWheelScrolling(e){const t=this.getZoom(),i=e.event.deltaY>0&&Hp(t);this.handleWheelScrolling(e,i)}onAxisWheel(e){const{enabled:t,enableAxisScrolling:i}=this.opts;if(!t||!i)return;e.stopProcessing();const{event:s,direction:a}=e;if(a!==n.tv$.X&&a!==n.tv$.Y)return;const o=a===n.tv$.X,r=!o,l=this.getModuleProperties({isScalingX:o,isScalingY:r}),h=this.getZoom(),c=s.deltaY>0&&h[a].min===n.eKe&&h[a].max===n.Oxg;this.autoScaler.onManualAdjustment(a),this.handleWheelScrolling(e,c,l)}handleWheelScrolling(e,t,i=this.getModuleProperties()){const{scroller:s,seriesRect:a,ctx:o}=this,r=o.zoomManager;if(!a)return void e.abort();const{event:l}=e;let h=!0;const c=Zm("zoom-axis-wheel");if(!0===this.opts.enableIndependentAxes){const e=s.updateAxes(l,i,a,r.getAxisZooms());for(const[t,{direction:i,min:s,max:a}]of(0,n.jOZ)(e)){const e=i===n.tv$.X?this.constrainZoom({x:{min:s,max:a},y:{min:n.Oxg,max:n.Oxg}}).x:{min:s,max:a};h&&(h=this.updateAxisZoom(c,t,i,e))}}else{const e=s.update(l,i,a,this.getZoom());if(null==e)return"abort";h=this.updateUnifiedZoom(c,e,{directional:!0})}t||l.deltaY<0&&!h?e.capped():e.uncapped()}onTouchStart(e,t){this.opts.enableTwoFingerZoom&&0===this.dragState&&this.twoFingers.start(e,t,this.getZoom())&&(this.dragState=4)}onTouchMove(e,t){if(!this.opts.enableTwoFingerZoom||4!==this.dragState)return;const i=this.twoFingers.update(e,t);this.updateZoom(Zm("zoom-seriesarea-twofingers"),Yp(i))}onTouchEnd(e){this.opts.enableTwoFingerZoom&&4===this.dragState&&(e.sourceEvent.preventDefault(),this.twoFingers.end(e)&&(this.dragState=0))}onProcessData(e){this.shouldFlipXY=e.series.shouldFlipXY}onLayoutComplete(e){const{enabled:t,enableDoubleClickToReset:i,enableAxisDragging:n,enableAxisScrolling:s}=this.opts;this.ctx.eventsHub.emit("axis-interaction:update",{source:"zoom",enabled:t,enableDoubleClick:i,enableDragging:n,enableScrolling:s,enableContextMenu:!1}),t&&(this.seriesRect=e.series.rect,this.paddedRect=e.series.paddedRect)}onZoomChangeRequested(e){"zoom-seriesarea-panner"!==e.sourceDetail&&this.panner.stopInteractions();const t=this.getZoom();this.buttons.toggleVisibleZoomed(Hp(t))}onZoomPanStart(e){"zoom"===e.callerId&&this.panner.stopInteractions()}onPanUpdate(e){const{panner:t,seriesRect:i,ctx:{tooltipManager:n,interactionManager:a},ctx:o}=this,r=o.zoomManager;if(!i)return;const l=t.translateZooms(i,r.getAxisZooms(),e.deltaX,e.deltaY);this.updateChanges(Zm("zoom-seriesarea-panner"),l),a.isState(s.n1.InteractionState.Frozen)||n.updateTooltip(ty)}isPanningKeyPressed(e){switch(this.opts.panKey){case"alt":return e.altKey;case"ctrl":return e.ctrlKey;case"shift":return e.shiftKey;case"meta":return e.metaKey}}isScalingX(e){return"xy"===e||(this.shouldFlipXY?"y"===e:"x"===e)}isScalingY(e){return"xy"===e||(this.shouldFlipXY?"x"===e:"y"===e)}constrainZoom(e){return this.ctx.zoomManager.constrainZoomToItemCount(e,this.opts.minVisibleItems,this.autoScaler.enabled)}isZoomValid(e,t){const{minVisibleItems:i}=this.opts,{ctx:n}=this,s=n.zoomManager;if(0===i)return this.previousZoomValid=!0,!0;const a=this.getZoom(),o=Qm(Bp(e))<Qm(Bp(a)),r=Qm(Fp(e))<Qm(Fp(a)
1);if(!o&&!r)return this.previousZoomValid=!0,!0;if(!this.previousZoomValid&&t?.directional)return!1;const l=t?.includeYVisibleRange??!1,h=this.autoScaler.enabled,c=s.isVisibleItemsCountAtLeast(e,i,{includeYVisibleRange:l,autoScaleYAxis:h});return this.previousZoomValid=!t?.directional||c,c}isAxisZoomValid(e,t,i){const{minVisibleItems:n}=this.opts,{ctx:s}=this,a=s.zoomManager,o=this.getZoom(),r=t.max-t.min,l=o[e].max-o[e].min,h={...o,[e]:t};if(r>=l)return this.previousAxisZoomValid[e]=!0,!0;if(!this.previousAxisZoomValid[e]&&i?.directional)return!1;const c={includeYVisibleRange:!1,autoScaleYAxis:this.autoScaler.enabled},d=a.isVisibleItemsCountAtLeast(h,n,c);return this.previousAxisZoomValid[e]=!i?.directional||d,d}resetZoom(e){this.previousZoomValid=!0,this.previousAxisZoomValid={[n.tv$.X]:!0,[n.tv$.Y]:!0},this.ctx.zoomManager.resetZoom({source:"user-interaction",sourceDetail:e})}updateSyncZoom(e){this.updateZoom({source:"sync",sourceDetail:"internal-updateSyncZoom"},e)}updateChanges(e,t){const i=(0,n.M7G)(t)??{},s=this.getZoom();this.updateZoom(e,{x:i.x??s.x,y:i.y??s.y})}updateZoom(e,t){this.opts.enableIndependentAxes?this.updatePrimaryAxisZooms(e,t):this.updateUnifiedZoom(e,t)}updateUnifiedZoom(e,t,i){return t=this.constrainZoom(t),this.isZoomValid(t,i)?(this.ctx.zoomManager.updateZoom(e,t),!0):(this.ctx.eventsHub.emit("chart:request-update",{type:n.GvF.SCENE_RENDER,opts:{skipAnimations:!0}}),!1)}updatePrimaryAxisZooms(e,t){this.updatePrimaryAxisZoom(e,t,n.tv$.X),this.updatePrimaryAxisZoom(e,t,n.tv$.Y)}updatePrimaryAxisZoom(e,t,i){const n=this.ctx.zoomManager.getPrimaryAxisId(i);null!=n&&this.updateAxisZoom(e,n,i,t[i])}updateAxisZoom(e,t,i,n,s){const{enableIndependentAxes:a}=this.opts,{ctx:o}=this,r=o.zoomManager;if(!n)return!1;const l=this.getZoom();if(!0!==a)return l[i]=n,this.updateUnifiedZoom(e,l,s);if(!this.isAxisZoomValid(i,n,s))return!1;const{source:h,sourceDetail:c}=e;return r.updateChanges({source:h,sourceDetail:c,changes:{[t]:n},isReset:!1}),!0}getZoom(){return(0,n.af4)(this.ctx.chartState.getValue("zoom"))}getModuleProperties(e){const{anchorPointX:t,anchorPointY:i,axes:n,enabled:s,enableIndependentAxes:a,keepAspectRatio:o,scrollingStep:r}=this.opts;return{anchorPointX:e?.anchorPointX??(this.shouldFlipXY?i:t),anchorPointY:e?.anchorPointY??(this.shouldFlipXY?t:i),enabled:e?.enabled??s,independentAxes:e?.independentAxes??!0===a,isScalingX:e?.isScalingX??this.isScalingX(n),isScalingY:e?.isScalingY??this.isScalingY(n),keepAspectRatio:e?.keepAspectRatio??o??!1,scrollingStep:e?.scrollingStep??r}}},sy=(0,n.KCZ)("pointer","start","middle","end"),ay=(()=>{var e={type:"plugin",name:"zoom",enterprise:!0,version:s.xv,dependencies:[Rp],options:{enabled:n.zMY,enableAxisDragging:n.zMY,enableAxisScrolling:n.zMY,enableDoubleClickToReset:n.zMY,enablePanning:n.zMY,enableScrolling:n.zMY,enableSelecting:n.zMY,enableTwoFingerZoom:n.zMY,keepAspectRatio:n.zMY,anchorPointX:sy,anchorPointY:sy,axisDraggingMode:(0,n.KCZ)("pan","zoom"),axes:(0,n.KCZ)("x","y","xy"),deceleration:(0,n.or)((0,n.KCZ)("off","short","long"),n.CGN),minVisibleItems:n.LyW,panKey:(0,n.KCZ)("alt","ctrl","meta","shift"),scrollingMode:(0,n.KCZ)("pan","zoom"),scrollingStep:n.CGN,autoScaling:{enabled:n.zMY,padding:n.CGN},onDataChange:{strategy:(0,n.$_4)()("reset","preserveDomain","preserveRatios"),stickToEnd:n.zMY},buttons:{enabled:n.zMY,buttons:(0,n.J$N)({...n.Kj1,value:(0,n.KCZ)("reset","zoom-in","zoom-out","pan-left","pan-right","pan-start","pan-end"),section:n.YjP},"zoom button options array"),visible:(0,n.KCZ)("always","zoomed","hover")}},themeTemplate:{enabled:!1,enableAxisDragging:!0,enableAxisScrolling:!0,enableDoubleClickToReset:!0,enablePanning:!0,enableScrolling:!0,enableSelecting:!1,enableTwoFingerZoom:!0,deceleration:"short",minVisibleItems:2,panKey:"alt",scrollingStep:.1,autoScaling:{enabled:{$and:[{$eq:[{$path:"../axes"},"x"]},{$not:{$eq:[{$path:"/series/0/direction"},"horizontal"]}}]},padding:.05},onDataChange:{strategy:"preserveDomain",stickToEnd:!1},anchorPointX:"end",anchorPointY:"middle",axes:"x",buttons:{enabled:{$path:"../enabled"},visible:"hover",buttons:{$shallowSimple:[{icon:"zoom-out",value:"zoom-out",section:"scale"},{icon:"zoom-in",value:"zoom-in",section:"scale"},{icon:"pan-left",value:"pan-left",section:"pan"},{icon:"pan-right",value:"pan-right",section:"pan"},{icon:"reset",value:"reset",section:"reset"}]}}},create:e=>new ny(e),register:e=>{e.has("zoomManager")||e.service("zoomManager",(e=>new s.n1.ZoomManager(e)))}};return e.options.enableIndependentAxes=(0,n._Le)(n.zMY),e.options.buttons.anchorPointX=(0,n._Le)(sy),e.options.buttons.anchorPointY=(0,n._Le)(sy),e})();function oy(e,t,i){return(0,n.cVk)(e.chartService,t,i)}var{LinearScale:ry,BBox:ly,TranslatableGroup:hy,Selection:cy,Text:dy,createAxisLabelFormatterCache:u
1y,formatAxisLabelValue:py}=s.n1,gy=(()=>{var e=class e{constructor(e){this.ctx=e,this.id=(0,n.sX_)(this),this.axisGroup=new hy({name:`${this.id}-AxisTicks`,zIndex:n.Dcv.AXIS}),this.labelSelection=cy.select(this.axisGroup,dy),this.scale=new ry,this.formatterCache=uy(),this.placement="bottom",this.translationX=0,this.translationY=0,this.mirrored=!1,this.parallel=!1,this.boundSeries=[],this.padding=0,this.scale.logger=e.logger}get horizontal(){return this.placement.startsWith("top")||this.placement.startsWith("bottom")}attachAxis(e){e.appendChild(this.axisGroup)}detach(){this.labelSelection.clear(),this.axisGroup.remove()}applyOffset(e,t){this.translationX+=e,this.translationY+=t,this.axisGroup.translationX+=e,this.axisGroup.translationY+=t}calculateLayout(){const{placement:e,translationX:t,translationY:i,horizontal:n,labelOptions:s}=this;let a,o;switch(e){case"top":case"top-right":case"top-left":case"bottom":case"bottom-right":case"bottom-left":a="top",o="center",this.mirrored=!1,this.parallel=!0;break;case"right":case"right-top":case"right-bottom":case"left":case"left-top":case"left-bottom":a="middle",o="left",this.mirrored=!0,this.parallel=!1}const r=[],l=this.generateTicks(),{ticks:h}=l;return this.labelSelection.update(h,void 0,(e=>e.tickId)),this.axisGroup.setProperties({translationX:t,translationY:i}),this.labelSelection.each(((e,t)=>{null!=s&&(e.fontFamily=s.fontFamily,e.fontSize=s.fontSize,e.fontStyle=s.fontStyle,e.fontWeight=s.fontWeight,e.fill=s.color),e.textBaseline=a,e.textAlign=o,e.text=t.tickLabel,e.x=n?t.translation:0,e.y=n?0:t.translation,r.push(e.getBBox())})),r.length>0?ly.merge(r).translate(t,i):void 0}tickFormatter(e,t,i,n){const{ctx:s}=this,{formatManager:a}=s,{boundSeries:o}=this;return(t,i)=>{const r={type:"number",value:t,datum:void 0,seriesId:void 0,legendItemName:void 0,key:void 0,source:"gradient-legend",property:"color",domain:e,boundSeries:o,fractionDigits:n,visibleDomain:void 0};return py(this.labelOptions,this.formatterCache,((e,t)=>oy(s,e,t)),r,i)??a.format(((e,t)=>oy(s,e,t)),r)??a.defaultFormat(r)}}inRange(e,t=.001){const[i,s]=(0,n.uYy)(this.scale.range);return e>=i-t&&e<=s+t}generateTicks(){if(this.namedLabels?.length)return this.generateNamedTicks(this.namedLabels);const{minSpacing:t,maxSpacing:i,step:s}=this.intervalOptions??{},{maxTickCount:a,minTickCount:o,tickCount:r}=(0,n.NKs)((0,n.DuJ)(this.scale.range),1,t,i,e.DefaultTickCount,e.DefaultMinSpacing),l=this.getTicksData({nice:[!0,!0],interval:s,tickCount:r,minTickCount:o,maxTickCount:a});return this.applyCollisionAvoidance(l.ticks),l}generateNamedTicks(e){const[t,i]=this.scale.range,{domain:s}=this.scale,a=s[0]>s[1],o=(0,n.Iig)(),r=e.map((({position:e,label:n})=>{const s=t+(a?1-e:e)*(i-t);return{tick:e,tickId:o(n),tickLabel:n,translation:s}}));return this.applyCollisionAvoidance(r),{rawTicks:r.map((e=>e.tick)),fractionDigits:0,ticks:r}}applyCollisionAvoidance(e){if("bottom"!==this.placement&&"top"!==this.placement)return;const{labelOptions:t}=this;if(null==t)return;const i=(0,n.K$y)(t),{domain:s}=this.scale,a=s[0]>s[1]?-1:1;let o=-1/0*a;const r=e.map((e=>{if(Math.sign(e.translation-o)!==a)return!1;const{width:s}=(0,n.cyL)(e.tickLabel)?(0,n.wEO)(e.tickLabel,t):i.measureLines((0,n.i$)(e.tickLabel));return o=e.translation+s*a,!0}));for(let t=e.length-1;t>=0;t--)r[t]||e.splice(t,1)}getTicksData(e){const t=[],i=e.nice?this.scale.niceDomain(e):this.scale.domain,s=this.scale.ticks(e,i)?.ticks??[],a=s.map(Number),o=a.reduce(((e,t)=>Math.max(e,(0,n.o3B)(t))),0),r=(0,n.Iig)(),l=this.tickFormatter(i.map(Number),a,!1,o);for(let e=0;e<s.length;e++){const i=s[e],a=this.scale.convert(i);if(!this.inRange(a))continue;const o=l(i,e);if(null==o||""===o)continue;const h=r((0,n.boc)(o));t.push({tick:i,tickId:h,tickLabel:o,translation:a})}return{rawTicks:s,fractionDigits:o,ticks:t}}};return e.className="AxisTicks",e.DefaultTickCount=5,e.DefaultMinSpacing=10,e})(),{LayoutElement:my,Group:yy,Rect:fy,Marker:xy,TranslatableGroup:by,Selection:vy,BBox:Sy}=s.n1,My=class extends n.UbG{constructor(e){super(),this.ctx=e,this.id=(0,n.sX_)(this),this.legendGroup=new by({name:"legend",zIndex:n.Dcv.LEGEND}),this.containerNode=this.legendGroup.appendChild(new fy({name:"legend-container"})),this.gradientRectSelection=vy.select(this.legendGroup,fy),this.arrowSelection=vy.select(this.legendGroup,(()=>new xy({shape:"triangle"}))),this.ticksGroupSelection=vy.select(this.legendGroup,(()=>new yy({name:"legend-axis-group"}))),this.axisTicks=[],this.enabledData=[],this.data=[],this.cleanup.register(e.chartState.observe((e=>{const t=e("highlight");this.enabled&&this.updateArrows(t)})),e.layoutManager.registerElement(my.Legend,(e=>this.onStartLayout(e))),e.eventsHub.on("highlight:change",(t=>{t.highlightSuppressed&&e.eventsHub.emit("chart:request-update",{type:n.GvF.SCENE_RENDER})})),(()=>this.legendGroup.remove()))}get opts(){return this.ctx.chartState.getValue("options","gradientLegend")}get enabled(){return this.opts.enabled}isVertical(){const{placement:e}
1=(0,n.Zz1)(this.opts.position);return e.startsWith("right")||e.startsWith("left")}attachLegend(e){e.appendChild(this.legendGroup)}onStartLayout({layoutBox:e}){const t=this.data.filter((e=>e.enabled&&"gradient"===e.legendType));if(this.enabledData=t.filter(((e,t)=>0===t||!0===e.showSeparately)),!this.enabled||0===this.enabledData.length)return void(this.legendGroup.visible=!1);this.gradientRectSelection.update(this.enabledData),this.arrowSelection.update(this.enabledData),this.ticksGroupSelection.update(this.enabledData,(e=>{const t=new gy(this.ctx);t.attachAxis(e),this.axisTicks.push(t)})),this.axisTicks.length=this.enabledData.length;const i=this.isVertical(),{strokeWidth:n,padding:s}=this.getContainerStyles(),a=[];let o=0;for(let t=0;t<this.enabledData.length;t++){const n=this.enabledData[t],s=this.gradientRectSelection.at(t),r=this.axisTicks[t],l=this.updateGradientRect(s,e,n.colorStops),h=this.updateAxis(r,n,l)??new Sy(0,0,0,0),c=Sy.merge([l,h]),d=i?0:o,u=i?o:0;s.x+=d,s.y+=u,r.applyOffset(d,u),a.push(c.translate(d,u)),o+=(i?c.height:c.width)+16}const r=Sy.merge(a);r.grow(s).grow(n);const{left:l,top:h}=this.getMeasurements(e,r);this.updateContainer(r),this.updateArrows(this.ctx.chartState.getValue("highlight")),this.legendGroup.visible=!0,this.legendGroup.translationX=l,this.legendGroup.translationY=h}updateGradientRect(e,t,i){const{thickness:n,preferredLength:s}=this.opts.gradient,a=new Sy(0,0,0,0);let o;return this.isVertical()?(o=0,a.width=n,a.height=Math.min(t.height,s)):(o=90,a.width=Math.min(t.width,s),a.height=n),e.x=a.x,e.y=a.y,e.width=a.width,e.height=a.height,e.fill={type:"gradient",gradient:"linear",colorSpace:"oklch",colorStops:i,rotation:o},a}updateAxis(e,t,i){const s=this.opts,a=s.scale,o=a.padding,r=s.gradient.thickness;e.labelOptions=a.label,e.intervalOptions=a.interval,e.padding=o;const{placement:l}=(0,n.Zz1)(s.position),h=l.startsWith("right")||l.startsWith("left"),c=s.reverseOrder!==h;e.placement=l,e.boundSeries=t.series;const d=r+o;e.translationX=h?d:i.x,e.translationY=h?i.y:d,e.namedLabels=t.namedLabels;const[u,p]=t.axisDomain;return e.scale.domain=c?[p,u]:[u,p],e.scale.range=h?[i.x,i.height]:[i.y,i.width],e.calculateLayout()}updateContainer(e){const t=this.getContainerStyles();this.containerNode.setStyleProperties(t),this.containerNode.cornerRadius=t.cornerRadius,this.containerNode.x=e.x,this.containerNode.y=e.y,this.containerNode.width=e.width,this.containerNode.height=e.height}updateArrows(e){const t=e?.series?.id;for(let i=0;i<this.enabledData.length;i++){const n=this.arrowSelection.at(i),s=this.axisTicks[i],a=this.gradientRectSelection.at(i),o=this.enabledData[i],[r,l]=o.axisDomain;if(null==e?.colorValue||null!=t&&o.seriesId!==t||e.colorValue<r||e.colorValue>l){n.visible=!1;continue}const{scale:h,labelOptions:c}=s,d=c?.fontSize??0,u=h.convert(e.colorValue);let{x:p,y:g}=a,m=Math.PI;this.isVertical()?(p-=d/2,g+=u,m/=2):(p+=u,g-=d/2),n.visible=!0,n.fill=c?.color,n.rotation=m,n.size=d,n.translationX=p,n.translationY=g}}getMeasurements(e,t){const i=this.opts,s=i.spacing;let{x:a,y:o}=e;const{width:r,height:l}=t,{placement:h,floating:c,xOffset:d,yOffset:u}=(0,n.Zz1)(i.position),p=this.getContainerStyles();switch(a+=p.strokeWidth+p.padding.left,o+=p.strokeWidth+p.padding.top,h){case"left":o+=e.height/2-l/2;break;case"right":a+=e.width-r,o+=e.height/2-l/2;break;case"top":a+=e.width/2-r/2;break;case"bottom":a+=e.width/2-r/2,o+=e.height-l;break;case"right-top":case"top-right":a+=e.width-r;break;case"right-bottom":case"bottom-right":a+=e.width-r,o+=e.height-l;break;case"left-bottom":case"bottom-left":o+=e.height-l}if(!c)switch(h){case"left":case"left-top":case"left-bottom":e.shrink(r+s,"left");break;case"right":case"right-top":case"right-bottom":e.shrink(r+s,"right");break;case"top":case"top-left":case"top-right":e.shrink(l+s,"top");break;case"bottom":case"bottom-left":case"bottom-right":e.shrink(l+s,"bottom")}return a+=d,o+=u,{top:o,left:a}}getContainerStyles(){const e=this.opts,{enabled:t,strokeOpacity:i,strokeWidth:n}=e.border,s=e.border.stroke,a=e.cornerRadius,o=e.fill,r=e.fillOpacity,l=e.padding,h="number"==typeof l;return{cornerRadius:a,fill:o,fillOpacity:r,padding:{top:h?l:l.top??0,right:h?l:l.right??0,bottom:h?l:l.bottom??0,left:h?l:l.left??0},stroke:s,strokeOpacity:i,strokeWidth:t?n:0}}},ky={type:"plugin",name:"gradientLegend",enterprise:!0,version:s.xv,options:n.enB,themeTemplate:{...n._n,enabled:!1,position:"bottom",spacing:20,scale:{padding:13,label:{color:{$ref:"textColor"},fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},minSpacing:5},interval:{minSpacing:15}},gradient:{preferredLength:100,thickness:16},reverseOrder:!1,fill:{$applySwitch:[{$path:"type"}
1,{$ref:"chartBackgroundColour"},["gradient",n.Xaq],["pattern",n.Tmp],["image",n.Wx1]]}},create:e=>{const t=new My(e);return t.attachLegend(e.scene),t}},{DataSet:Dy}=s.n1;function wy(e,t,i){if("object"==typeof t&&null!=t){const s=t[i];s instanceof Array&&(0,n.nVd)(e,s)}}var Iy=class extends Dy{constructor(e,t,i,n){super(e,n,t),this.childrenKey=i}getDfsOrdering(){if(void 0!==this.dfsOrdering)return this.dfsOrdering;this.dfsOrdering={groupLookup:[],datumLookup:[]};const e=[];for(let t=0;t<this.data.length;t++){let i=this.data[t];for(;void 0!==i;)this.dfsOrdering.datumLookup.push(i),this.dfsOrdering.groupLookup.push(t),wy(e,i,this.childrenKey),i=e.pop()}return this.dfsOrdering}getGroupNumber(e){const t=this.getIdToIndexMap().get(e);if(void 0!==t)return this.getDfsOrdering().groupLookup[t]}isLeaf(e){const t=this.getDatumAt(e);if(t&&"object"==typeof t){const e=t[this.childrenKey];return void 0===e||0===e.length}return!1}size(){return this.getDfsOrdering().datumLookup.length}getDatumAt(e){return this.getDfsOrdering().datumLookup[e]}commitPendingTransactions(e){const t=e?[...this.getDfsOrdering().datumLookup]:void 0;return!!super.commitPendingTransactions(void 0)&&(this.dataIdKey&&this.removeNestedDuplicatesFromRoot(),this.dfsOrdering=void 0,this.idToIndexCache=void 0,this.idArrayCache=void 0,void 0!==t&&e.onDataChange(this.buildDfsChangeDescription(t)),!0)}buildDfsChangeDescription(e){const t=this.size(),i=null==this.dataIdKey?void 0:this.getIdToIndexMap(),n=this.buildDfsRefIndex(),a=new Set,o=[];for(let t=0;t<e.length;t++){const s=e[t],r=this.getIdValue(s),l=null==r?n.get(s):i?.get(r);void 0===l?a.add(t):o.push(l)}for(let t=1;t<o.length;t++)if(o[t]<=o[t-1]){o.length=0,a.clear();for(let t=0;t<e.length;t++)a.add(t);break}const r=this.buildDfsIndexMap(e.length,t,a,o);return new s.n1.DataChangeDescription(r,{prependValues:[],appendValues:[],insertionValues:[]})}buildDfsRefIndex(){const e=this.getDfsOrdering().datumLookup,t=new Map;for(let i=0;i<e.length;i++)t.has(e[i])||t.set(e[i],i);return t}buildDfsIndexMap(e,t,i,n){const s=n.length>0,a=s?n[0]:0,o=n.at(-1)??-1,r=s?t-1-o:t,l=[];a>0&&l.push({index:0,deleteCount:0,insertCount:a});for(let e=0;e+1<n.length;e++){const t=n[e+1]-n[e]-1;t>0&&l.push({index:n[e]+1,deleteCount:0,insertCount:t})}return r>0&&l.push({index:t-r,deleteCount:0,insertCount:r}),{originalLength:e,finalLength:t,spliceOps:l,removedIndices:i,updatedIndices:new Set,totalPrependCount:a,totalAppendCount:r}}removeNestedDuplicatesFromRoot(){const e=new Set;for(const t of this.data)this.collectNestedIds(t,e);if(0===e.size)return;let t=0;for(;t<this.data.length;){const i=this.getIdValue(this.data[t]);void 0!==i&&e.has(i)?this.data.splice(t,1):t++}}collectNestedIds(e,t){const i=e?.[this.childrenKey];if(Array.isArray(i))for(const e of i){const i=this.getIdValue(e);void 0!==i&&t.add(i),this.collectNestedIds(e,t)}}getIdToIndexMap(){if(void 0===this.idToIndexCache){this.idToIndexCache=new Map;const e=this.getDfsOrdering().datumLookup;let t=0;for(let i=0;i<e.length;i++){const n=this.getIdValue(e[i]),s=n??i;this.idToIndexCache.set(s,i),void 0!==n&&t++}void 0!==this.dataIdKey&&0===t&&this.data.length>0&&this.logger.warnOnce(`dataIdKey '${this.dataIdKey}' was not found on any data item.`)}return this.idToIndexCache}collectUpdatedOriginalIndicesById(e,t){for(const[i,n]of e){const s=this.getGroupNumber(i);if(void 0!==s&&!t.removedOriginalIndices.has(s)){const a=this.data[s];this.getIdValue(a)===i?(t.updatedOriginalIndices.add(s),t.pendingReplacements??(t.pendingReplacements=new Map),t.pendingReplacements.set(i,n)):this.replaceNestedItem(a,i,n)&&t.updatedOriginalIndices.add(s),e.delete(i)}}}applyRemovalsById(e,t){const i=new Set;for(const t of e){const e=this.getIdValue(t);void 0===e?this.logger.warnOnce(`applyTransaction() remove item is missing '${this.dataIdKey}' field; ignoring.`):i.add(e)}if(0!==i.size&&(this.removeFromGroupsByIdForHierarchy(t.prependsList,i),i.size>0&&this.removeFromGroupsByIdForHierarchy(t.insertionsList,i),t.trackedInsertions.length>0&&this.removeFromTrackedInsertionsById(e,t),i.size>0&&this.removeFromGroupsByIdForHierarchy(t.appendsList,i),i.size>0))for(const e of i){const n=this.getGroupNumber(e);if(void 0!==n){const s=this.data[n];this.getIdValue(s)===e?(t.removedOriginalIndices.add(n),t.virtualLength--):this.removeNestedItem(s,e)&&t.updatedOriginalIndices.add(n),i.delete(e)}}}replaceNestedItem(e,t,i){const n=e?.[this.childrenKey];if(!Array.isArray(n))return!1;for(let e=0;e<n.length;e++){if(this.getIdValue(n[e])===t)return n[e]=i,!0;if(this.replaceNestedItem(n[e],t,i))return!0}return!1}removeNestedItem(e,t){const i=e?.[this.childrenKey];if(!Array.isArray(i))return!1;for(let e=0;e<i.length;e++){if(this.getIdValue(i[e])===t)return i.splice(e,1),!0;if(this.removeNestedItem(i[e],t))return!0}return!1}removeFromGroupsByIdForHierarchy(e,t){for(const i of e){let e=0;for(;e<i.length&&t.size>0;){const n=this.getIdValue(i[e]);void 0!==n&&t.has(n)?(t.delete(n),i.splice(e,1)):e++}if(0===t.size)break}}},{Chart:Ay}=s.n1,Cy=(()=>{var e=class extends Ay{constructor(e,t){super(e,t),this.xAxis={id:(0,n.sX_)(s.n1.Axis),direction:n.tv$.X},this.yAxis={id:(0,n.sX_)(s.n1.Axis),direction:n.tv$.Y},this.standaloneZoomRegistered=!1,this.ctx.zoomManager&&(this.ctx.zoomManager.panToBBoxScalingMode=s.n1.PanToBBoxScalingModeEnum.WhenViewportTooSmallScaleXYProportionally)}toAgCoordinates(e){}getChartType(){return"standalone"}updateData(){super.updateData(),this.refreshStandaloneZoomRegistration()}refreshStandaloneZoomRegistration(){const{zoomManager:e}=this.ctx;if(!e)return;const t=this.series.some((e=>e.supportsStandaloneZoom));t!==this.standaloneZoomRegistered&&(e.setAxes(t?[this.xAxis,this.yAxis]:[]),this.standaloneZoomRegistered=t)}createDataSet(e){for(const t of this.series)if("childrenKey"in t.properties&&"string"==typeof t.properties.childrenKey){const i=this.ctx.chartState.getValue("options","dataIdKey"),n=new Iy(e,i,t.properties.childrenKey,this.ctx.logger);return this.data&&this.ctx.dataSelectionService?.transferDataSet(n,this.data),n}return super.createDataSet(e)}performLayout(e){const{seriesRoot:t,annotationRoot:i}=this,n=e.layoutBox.clone().shrink(this.seriesArea.getPadding());this.seriesRect=n,this.animationRect=n;for(const e of[t,i])e.translationX=Math.floor(n.x),e.translationY=Math.floor(n.y);const s=this.series.some((e=>e.alwaysClip))?e.layoutBox:void 0;t.setClipRect(s),i.setClipRect(s),t.visible=this.series[0].visible,this.ctx.layoutManager.emitLayoutComplete(e,{series:{visible:!0,rect:n,paddedRect:e.layoutBox},layoutBox:e.layoutBox})}getAriaLabel(){const e=this.series[0]?.type;if(null==e)return"";const t=this.getCaptionText();switch(e){case"radial-gauge":case"linear-gauge":{const e=[];0!==t.length&&e.push(t);for(const t of this.series)e.push(t.getCaptionText());return this.ctx.localeManager.t("ariaAnnounceGaugeChart",{caption:e.join(". ")})}case"treemap":case"sunburst":return this.ctx.localeManager.t("ariaAnnounceHierarchyChart",{caption:t});default:return this.ctx.localeManager.t("ariaAnnounceStandaloneChart",{caption:t})}}};return e.className="StandaloneChart",e.type="standalone",e})(),{standaloneChartOptionsDefs:Ny,commonChartThemeTemplate:Ly}=s.n1,Py={type:"chart",name:"standalone",enterprise:!0,version:s.xv,options:Ny,themeTemplate:Ly,create:(e,t)=>
1new Cy(e,t)};function Ty(e){return-(e+1)}function Oy(e){return-(e+1)}function Ry(e){return Oy(e)+1}function Ey(e,t,i,n){i||(t=function(e,t){const i=new Set;for(const t of e)zy(e,t,i,[]);0!==i.size&&t.warnOnce("Some links formed circular references. These will be removed from the output.");return 0===i.size?e:e.filter((e=>!i.has(e)))}(t,n));const s=new Map;for(const t of e)s.set(t.id,{datum:t,linksBefore:[],linksAfter:[],maxPathLengthBefore:-1,maxPathLengthAfter:-1});let a=0;for(const[e,i]of s.entries())a=Math.max(a,By(s,t,i,e,-1,[])+By(s,t,i,e,1,[])+1);return{links:t,nodeGraph:s,maxPathLength:a}}function zy(e,t,i,n){const s=n.indexOf(t);if(-1!==s){for(let e=s;e<n.length;e+=1)i.add(n[e]);return}n.push(t);const{toNode:a}=t;for(const t of e)t.fromNode===a&&zy(e,t,i,n);n.pop()}function By(e,t,i,n,s,a){if(a.includes(n))return 1/0;let o=-1===s?i.maxPathLengthBefore:i.maxPathLengthAfter;if(-1===o){o=0;const r=-1===s?i.linksBefore:i.linksAfter;for(const i of t){const{fromNode:l,toNode:h}=i,c=-1===s?h.id:l.id,d=-1===s?l.id:h.id,u=n===c?e.get(d):void 0;null!=u&&(r.push({node:u,link:i}),a?.push(n),o=Math.max(o,By(e,t,u,d,s,a)+1),a?.pop())}-1===s?i.maxPathLengthBefore=o:i.maxPathLengthAfter=o}return o}var{findNodeDatumInArray:Fy,keyProperty:Vy,valueProperty:$y,DataController:Hy,DataSet:jy,Group:Wy,HighlightState:_y,Selection:Gy,Series:Ky,TransformableText:Yy}=s.n1,Uy=class extends Ky{constructor(){super(...arguments),this.nodeCount=0,this.linkCount=0,this.linksDataModel=void 0,this.linksProcessedData=void 0,this.nodesDataModel=void 0,this.nodesProcessedData=void 0,this.processedNodes=new Map,this.linkGroup=this.contentGroup.appendChild(new Wy({name:"linkGroup"})),this.nodeGroup=this.contentGroup.appendChild(new Wy({name:"nodeGroup"})),this.focusLinkGroup=this.highlightGroup.appendChild(new Wy({name:"linkGroup"})),this.focusNodeGroup=this.highlightGroup.appendChild(new Wy({name:"nodeGroup"})),this.highlightLinkGroup=this.highlightGroup.appendChild(new Wy({name:"linkGroup"})),this.labelSelection=Gy.select(this.labelGroup,Yy),this.linkSelection=Gy.selectNoInference(this.linkGroup,(()=>this.linkFactory())),this.nodeSelection=Gy.selectNoInference(this.nodeGroup,(()=>this.nodeFactory())),this.focusLinkSelection=Gy.selectNoInference(this.focusLinkGroup,(()=>this.linkFactory())),this.focusNodeSelection=Gy.selectNoInference(this.focusNodeGroup,(()=>this.nodeFactory())),this.highlightLinkSelection=Gy.selectNoInference(this.highlightLinkGroup,(()=>this.linkFactory())),this.highlightNodeSelection=Gy.selectNoInference(this.highlightNodeGroup,(()=>this.nodeFactory()))}createNodeParams(e){const t=this.contextNodeData?.nodeData.find((t=>t.type===e.type&&t.datumIndex===e.datumIndex));return{...super.createNodeParams(e),size:t?.size,label:1===t?.type?t?.label:void 0}}get nodes(){return this.properties.nodes}async processData(e){const{data:t,nodes:i}=this;if(null==t)return;const{fromKey:n,toKey:s,sizeKey:a,idKey:o,labelKey:r}=this.properties,l=new Hy("standalone",e.suppressFieldDotNotation,this.ctx.eventsHub,this.ctx.logger),h=null==i?null:l.request(this.id,jy.wrap(i,this.ctx.logger)??jy.empty(this.ctx.logger),{props:[Vy(o,void 0,{id:"idValue",includeProperty:!1}),...null==r?[]:[$y(r,void 0,{id:"labelValue",includeProperty:!1})]],groupByKeys:!0}),c=e.request(this.id,t,{props:[$y(n,void 0,{id:"fromValue",includeProperty:!1}),$y(s,void 0,{id:"toValue",includeProperty:!1}),...null==a?[]:[$y(a,void 0,{id:"sizeValue",includeProperty:!1,missingValue:0})]],groupByKeys:!1});null!=i&&l.execute(void 0,void 0);const[d,u]=await Promise.all([h??Promise.resolve(null),c]);this.nodesDataModel=d?.dataModel,this.nodesProcessedData=d?.processedData,this.linksDataModel=u?.dataModel,this.linksProcessedData=u?.processedData;const p=new Map;if(null==d){const e=u.dataModel.resolveColumnById(this,"fromValue",u.processedData,"object"),t=u.dataModel.resolveColumnById(this,"toValue",u.processedData,"object"),i=e=>{const t=Ty(p.size),i=e;return{series:this,itemId:this.toFlowNodeItemId({},t,{dataIdKey:void 0,nodeName:e}),datum:{},datumIndex:t,type:1,linksBefore:[],linksAfter:[],id:e,size:0,label:i,style:this.getNodeStyle({datumIndex:t,datum:{},size:0,label:i},t,!1)}}
1,n=u.processedData.dataSources.get(this.id)?.data;if(n)for(const[s]of n.entries()){const n=e[s],a=t[s];null!=n&&null!=a&&(p.has(n)||p.set(n,i(n)),p.has(a)||p.set(a,i(a)))}}else{const e=d.dataModel.resolveColumnById(this,"idValue",d.processedData,"string"),t=null==r?void 0:d.dataModel.resolveColumnById(this,"labelValue",d.processedData,"object"),i=this.data?.dataIdKey,n=d.processedData.dataSources.get(this.id)?.data;if(n)for(const[s,a]of n.entries()){const n=e[s],o=t?.[s],r=Ty(s);p.set(n,{series:this,itemId:this.toFlowNodeItemId(a,r,{dataIdKey:i,nodeName:n}),datum:a,datumIndex:r,type:1,linksBefore:[],linksAfter:[],id:n,size:0,label:o,style:this.getNodeStyle({datumIndex:r,datum:a,size:0,label:o},r,!1)})}}this.processedNodes=p}callGetItemId(e){const{getItemId:t}=this.properties;return null==t?void 0:this.cachedCallWithContext(t,e)}findNodeDatum(e){return Fy(e,this.contextNodeData?.nodeData,this.data?.dataIdKey)}getNodeGraph(e,t,{includeCircularReferences:i}){const{linksDataModel:n,linksProcessedData:s}=this;if(null==n||null==s){const{links:e,nodeGraph:t,maxPathLength:n}=Ey((new Map).values(),[],i,this.ctx.logger);return this.nodeCount=0,this.linkCount=0,{nodeGraph:t,links:e,maxPathLength:n}}const{sizeKey:a}=this.properties,o=n.resolveColumnById(this,"fromValue",s,"string"),r=n.resolveColumnById(this,"toValue",s,"string"),l=null==a?void 0:n.resolveColumnById(this,"sizeValue",s,"number"),h=new Map;for(const t of this.processedNodes.values()){const i=e(t);h.set(t.id,i)}const c=[],d=this.data?.dataIdKey,u=s.dataSources.get(this.id)?.data;if(u)for(const[e,i]of u.entries()){const n=o[e],s=r[e],a=null==l?1:Number(l[e]),u=h.get(n),p=h.get(s);if(a<=0||null==u||null==p)continue;const g=e,m=t({series:this,itemId:this.toFlowLinkItemId(i,g,{dataIdKey:d}),datum:i,datumIndex:g,type:0,fromNode:u,toNode:p,size:a,style:this.getLinkStyle(i,g,u.datumIndex,!1)});c.push(m)}const{links:p,nodeGraph:g,maxPathLength:m}=Ey(h.values(),c,i,this.ctx.logger);for(const e of g.values())e.datum.linksBefore=e.linksBefore.map((e=>e.link)),e.datum.linksAfter=e.linksAfter.map((e=>e.link));return this.nodeCount=g.size,this.linkCount=p.length,{nodeGraph:g,links:p,maxPathLength:m}}updateSelections(){this.nodeDataRefresh&&(this.contextNodeData=this.createNodeData(),this.nodeDataRefresh=!1)}update(e){const{seriesRect:t}=e,i={seriesRectWidth:t?.width??0,seriesRectHeight:t?.height??0};this._nodeDataDependencies?.seriesRectWidth===i.seriesRectWidth&&this._nodeDataDependencies.seriesRectHeight===i.seriesRectHeight||(this._nodeDataDependencies=i),this.updateSelections();const n=this.contextNodeData?.nodeData??[],s=this.contextNodeData?.labelData??[],a=this.getHighlightedDatum();this.contentGroup.visible=this.visible;const o=null==a?_y.None:_y.OtherItem;let r,l,h,c;this.contentGroup.opacity=this.properties.highlight.getStyle(o).opacity??1,this.labelSelection=this.updateLabelSelection({labelData:s,labelSelection:this.labelSelection}),this.updateLabelNodes({labelSelection:this.labelSelection}),this.linkSelection=this.updateLinkSelection({nodeData:n.filter((e=>0===e.type)),datumSelection:this.linkSelection}),this.updateLinkNodes({datumSelection:this.linkSelection,isHighlight:!1}),this.nodeSelection=this.updateNodeSelection({nodeData:n.filter((e=>1===e.type)),datumSelection:this.nodeSelection}),this.updateNodeNodes({datumSelection:this.nodeSelection,isHighlight:!1}),1===a?.type?(r=n.filter((e=>0===e.type&&(e.toNode===a||e.fromNode===a))),l=r.map((e=>e.fromNode===a?e.toNode:e.fromNode)),l.push(a),h=[],c=[a]):0===a?.type?(r=[a],l=[a.fromNode,a.toNode],h=[a],c=[]):(r=[],l=[],h=[],c=[]),this.focusLinkSelection=this.updateLinkSelection({nodeData:r,datumSelection:this.focusLinkSelection}),this.updateLinkNodes({datumSelection:this.focusLinkSelection,isHighlight:!1}),this.focusNodeSelection=this.updateNodeSelection({nodeData:l,datumSelection:this.focusNodeSelection}),this.updateNodeNodes({datumSelection:this.focusNodeSelection,isHighlight:!1}),this.highlightLinkSelection=this.updateLinkSelection({nodeData:h,datumSelection:this.highlightLinkSelection}),this.updateLinkNodes({datumSelection:this.highlightLinkSelection,isHighlight:!0}),this.highlightNodeSelection=this.updateNodeSelection({nodeData:c,datumSelection:this.highlightNodeSelection}),this.updateNodeNodes({datumSelection:this.highlightNodeSelection,isHighlight:!0})}getHighlightedDatum(){let e=this.ctx.highlightManager?.getActiveHighlight();if(e?.series===this&&null==e.type){const{itemId:t}=e,i=this.contextNodeData?.nodeData??[];e=null==t?void 0:i.find((e=>1===e.type&&e.id===t))}else e?.series!==this&&(e=void 0);return e}isLabelHighlighted(e,t){return null!=t&&(1===t.type?t===e:0===t.type&&(t.fromNode===e||t.toNode===e))}resetAnimation(e){}dataCount(){return Number.NaN}getSeriesDomain(e){return{domain:[]}}getSeriesRange(e,t){return[Number.NaN,Number.NaN]}legendItemSymbol(e,t,i={}){const{fills:n,strokes:s}=this.properties,{fill:a=n[t%n.length],fillOpacity:o=1,stroke:r=s[t%s.length],strokeWidth:l=0,strokeOpacity:h=1,lineDash:c=[0],lineDashOffset:d=0}=i;return{marker:{fill:a,fillOpacity:o,stroke:r,strokeWidth:l,strokeOpacity:h,lineDash:c,lineDashOffset:d}}}getLegendData(e){if("category"!==e)return[];const{showInLegend:t}=this.properties;return Array.from(this.processedNodes.values(),(({id:e,label:i},n)=>({legendType:"category",id:this.id,itemId:e,seriesId:this.id,enabled:!0,label:{text:i??e},symbol:this.legendItemSymbol(1,Ty(n)),hideInLegend:!t,isFixed:!0})))}pickNodeClosestDatum({x:e,y:t}){let i,n,s=1/0;return this.linkSelection.each(((a,o)=>{const r=a.distanceSquared(e,t);r<s&&(s=r,i=o,n=a)})),this.nodeSelection.each(((a,o)=>{const r=a.distanceSquared(e,t);r<s&&(s=r,i=o,n=a)})),null==i||null==n?void 0:{datum:i,distance:Math.sqrt(s),target:n}}getDatumAriaMeta(e,t){return 0===e.type?{text:this.ctx.localeManager.t("ariaAnnounceFlowProportionLink",{index:(i=e.datumIndex,i+1),count:this.linkCount,from:e.fromNode.id,to:e.toNode.id,size:e.size,sizeName:this.properties.sizeName??this.properties.sizeKey})}:1===e.type?{text:this.ctx.localeManager.t("ariaAnnounceFlowProportionNode",{index:Ry(e.datumIndex),count:this.nodeCount,description:t})}:void 0;var i}pickFocus(e){const{datumIndexDelta:t,otherIndexDelta:i}=e,n=this.contextNodeData?.nodeData[e.datumIndex-e.datumIndexDelta];let s=n;if(0!==i)return;if(0===n?.type){const e=Array.from(this.linkSelection,(e=>e.datum)),i=e.indexOf(n)+t;if(i>=0&&i<e.length)s=e[i];else if(i>0)s=e.at(-1);else{const e=Array.from(this.nodeSelection,(e=>e.datum));s=e.at(-1)}}else if(1===n?.type){const e=Array.from(this.nodeSelection,(e=>e.datum)),i=e.indexOf(n)+t;if(i>=0&&i<e.length)s=e[i];else if(i<0)s=e[0];else{const e=Array.from(this.linkSelection,(e=>e.datum));s=e[0]}}if(null==s)return;const a=1===s.type?Array.from(this.nodeSelection).find((e=>e.datum===s)):Array.from(this.linkSelection).find((e=>e.datum===s));if(null==a)return;const o=this.computeFocusBounds(a.node);return null!=o?{datum:a.datum,datumIndex:this.contextNodeData?.nodeData.indexOf(a.datum)??0,otherIndex:0,bounds:o,clipFocusBox:!0}:void 0}readUserDatum(e){return function(e){return e>=0}
1(e)?this.linksProcessedData?.dataSources.get(this.id)?.data[e]:function(e){return e<0}(e)?this.nodesProcessedData?.dataSources.get(this.id)?.data[Oy(e)]:void 0}getTooltipContent(e){const{id:t,properties:i,ctx:{formatManager:n}}=this,{fromKey:s,toKey:a,sizeKey:o,sizeName:r,tooltip:l}=i,h=this.contextNodeData?.nodeData.find((t=>t.datumIndex===e));if(null==h)return;const c=0===h.type?h.fromNode.datumIndex:h.datumIndex,d=0===h.type?`${h.fromNode.label} - ${h.toNode.label}`:h.label,u=this.readUserDatum(e),p=h.size;let g;g=0===h.type?this.getLinkStyle(u,h.datumIndex,c,!1):this.getNodeStyle(h,c,!1);const m=[];if(null!=o){const e=n.format(this.callWithContext.bind(this),{type:"number",value:p,datum:u,seriesId:t,legendItemName:void 0,key:o,source:"tooltip",property:"size",domain:[],boundSeries:this.getFormatterContext("size"),fractionDigits:void 0,visibleDomain:void 0});m.push({label:r,fallbackLabel:o,value:e??String(p)})}return this.formatTooltipWithContext(l,{title:d,symbol:this.legendItemSymbol(h.type,c,g),data:m},{context:void 0,seriesId:t,datum:u,title:d,fromKey:s,toKey:a,sizeKey:o,sizeName:r,size:p,...g})}getCategoryValue(e){}datumIndexForCategoryValue(e){}readDataIdKey(e,t){return null==t.dataIdKey?void 0:e?.[t.dataIdKey]}toFlowNodeItemId(e,t,i){const{nodeName:n}=i,s=this.readDataIdKey(e,i),a=Oy(t);return this.callGetItemId({nodeName:n,index:a,datum:e})??(null==s?n:String(s))}toFlowLinkItemId(e,t,i){const n=this.readDataIdKey(e,i);return null==n?`link-${t}`:String(n)}},{Path:Xy}=s.n1;function Zy({radius:e,startAngle:t,endAngle:i,tension:n}){const s=e*Math.cos(t),a=e*Math.sin(t),o=e*Math.cos(i),r=e*Math.sin(i);return{x:[s,s*n,o*n,o],y:[a,a*n,r*n,r]}}var qy=(()=>{var e=class extends Xy{constructor(){super(...arguments),this.centerX=0,this.centerY=0,this.radius=0,this.startAngle1=0,this.endAngle1=0,this.startAngle2=0,this.endAngle2=0,this.tension=1,this.edge1=void 0,this.edge2=void 0}tensionedCurveTo(e,t,i,n,s,a,o,r){const{path:l,tension:h}=this,c=1-h;l.cubicCurveTo((i-e)*c+e,(n-t)*c+t,(s-o)*c+o,(a-r)*c+r,o,r)}traceEnd(e,t,i){const{path:n,centerX:s,centerY:a,radius:o}=this;if(null==i||i.cornerRadius<=0)return void n.arc(s,a,o,t,e,!0);const{innerRadius:r,cornerRadius:l,startCentreAngle:h,endCentreAngle:c,cornerSweep:d}=i,u=r+l,p=1e-6;if(t>c+p){const o=s+u*Math.cos(c),r=a+u*Math.sin(c),h=i.endAngle+.5*Math.PI,g=i.endAngle+Math.PI-d,m=t>=i.endAngle-p?h:this.cornerArcAngle(t,o,r,l,h,g,h),y=e<=c+p?g:this.cornerArcAngle(e,o,r,l,h,g,g);y>m&&n.arc(o,r,l,m,y)}const g=Math.min(t,c),m=Math.max(e,h);if(g>m+p&&n.arc(s,a,r,g,m,!0),e<h-p){const o=s+u*Math.cos(h),r=a+u*Math.sin(h),c=i.startAngle+Math.PI+d,g=i.startAngle+1.5*Math.PI,m=t>=h-p?c:this.cornerArcAngle(t,o,r,l,c,g,c),y=e<=i.startAngle+p?g:this.cornerArcAngle(e,o,r,l,c,g,g);y>m&&n.arc(o,r,l,m,y)}n.lineTo(s+o*Math.cos(e),a+o*Math.sin(e))}cornerArcAngle(e,t,i,s,a,o,r){const l=function(e,t,i,n,s,a){const o=Math.cos(a),r=Math.sin(a),l=i-e,h=n-t,c=l*r-h*o,d=s*s-c*c;if(d<=0)return;const u=l*o+h*r-Math.sqrt(d);return u<=0?void 0:Math.atan2(t+u*r-n,e+u*o-i)}(this.centerX,this.centerY,t,i,s,e);return null==l?r:function(e,t,i){const s=t+(0,n.YcT)(e-t);return Math.min(Math.max(s,t),i)}(l,a,o)}updatePath(){const{path:e,centerX:t,centerY:i,radius:n}=this;let{startAngle1:s,endAngle1:a,startAngle2:o,endAngle2:r,edge1:l,edge2:h}=this;s>o&&([s,o]=[o,s],[a,r]=[r,a],[l,h]=[h,l]),e.clear();const c=t+n*Math.cos(s),d=i+n*Math.sin(s);e.moveTo(c,d),this.tensionedCurveTo(c,d,t,i,t,i,t+n*Math.cos(r),i+n*Math.sin(r)),this.traceEnd(o,r,h),this.tensionedCurveTo(t+n*Math.cos(o),i+n*Math.sin(o),t,i,t,i,t+n*Math.cos(a),i+n*Math.sin(a)),this.traceEnd(s,a,l),e.closePath()}};return l([(0,n.k8u)()],e.prototype,"centerX",2),l([(0,n.k8u)()],e.prototype,"centerY",2),l([(0,n.k8u)()],e.prototype,"radius",2),l([(0,n.k8u)()],e.prototype,"startAngle1",2),l([(0,n.k8u)()],e.prototype,"endAngle1",2),l([(0,n.k8u)()],e.prototype,"startAngle2",2),l([(0,n.k8u)()],e.prototype,"endAngle2",2),l([(0,n.k8u)()],e.prototype,"tension",2),l([(0,n.Tou)({equals:n.DH9})],e.prototype,"edge1",2),l([(0,n.Tou)({equals:n.DH9})],e.prototype,"edge2",2),e})(),{FillGradientDefaults:Qy,FillPatternDefaults:Jy,FillImageDefaults:ef,makeSeriesTooltip:tf,SeriesProperties:nf,Label:sf}=s.n1,af=(()=>{var e=class extends sf{constructor(){super(...arguments),this.spacing=1,this.maxWidth=1}};return l([n.mAP],e.prototype,"spacing",2),l([n.mAP],e.prototype,"maxWidth",2),e})(),of=(()=>{var e=class extends n.XPE{constructor(){super(...arguments),this.fill=void 0,this.fillOpacity=1,this.stroke=void 0,this.strokeOpacity=1,this.strokeWidth=1,this.lineDash=[0],this.lineDashOffset=0,this.tension=0}getStyle(e,t,i){const{fillOpacity:n,strokeWidth:s,strokeOpacity:a,lineDash:o,lineDashOffset:r,tension:l}=this;return{fill:this.fill??e[i%e.length],fillOpacity:n,stroke:this.stroke??t[i%e.length],strokeWidth:s,strokeOpacity:a,lineDash:o,lineDashOffset:r,tension:l}}};return l([n.mAP],e.prototype,"fill",2),l([n.mAP],e.prototype,"fillOpacity",2),l([n.mAP],e.prototype,"stroke",2),l([n.mAP],e.prototype,"strokeOpacity",2),l([n.mAP],e.prototype,"strokeWidth",2),l([n.mAP],e.prototype,"lineDash",2),l([n.mAP],e.prototype,"lineDashOffset",2),l([n.mAP],e.prototype,"tension",2),l([n.mAP],e.prototype,"itemStyler",2),e})(),rf=(()=>{var e=class extends n.XPE{constructor(){super(...arguments),this.spacing=1,this.width=1,this.fill=void 0,this.fillOpacity=1,this.stroke=void 0,this.strokeOpacity=1,this.strokeWidth=1,this.lineDash=[0],this.lineDashOffset=0,this.cornerRadius=0}getStyle(e,t,i){const{fillOpacity:n,strokeWidth:s,strokeOpacity:a,lineDash:o,lineDashOffset:r,cornerRadius:l}=this;return{fill:this.fill??e[i%e.length],fillOpacity:n,stroke:this.stroke??t[i%e.length],strokeWidth:s,strokeOpacity:a,lineDash:o,lineDashOffset:r,cornerRadius:l}}};return l([n.mAP],e.prototype,"spacing",2),l([n.mAP],e.prototype,"width",2),l([n.mAP],e.prototype,"fill",2),l([n.mAP],e.prototype,"fillOpacity",2),l([n.mAP],e.prototype,"stroke",2),l([n.mAP],e.prototype,"strokeOpacity",2),l([n.mAP],e.prototype,"strokeWidth",2),l([n.mAP],e.prototype,"lineDash",2),l([n.mAP],e.prototype,"lineDashOffset",2),l([n.mAP],e.prototype,"cornerRadius",2),l([n.mAP],e.prototype,"itemStyler",2),e})(),lf=(()=>{var e=class extends nf{constructor(){super(...arguments),this.idKey="",this.idName=void 0,this.labelKey=void 0,this.labelName=void 0,this.sizeKey=void 0,this.sizeName=void 0,this.nodes=void 0,this.getItemId=void 0,this.fillGradientDefaults=new Qy,this.fillPatternDefaults=new Jy,this.fillImageDefaults=new ef,this.fills=[],this.strokes=[],this.label=new af,this.link=new of,this.node=new rf,this.tooltip=tf()}};return l([n.mAP],e.prototype,"fromKey",2),l([n.mAP],e.prototype,"toKey",2),l([n.mAP],e.prototype,"idKey",2),l([n.mAP],e.prototype,"idName",2),l([n.mAP],e.prototype,"labelKey",2),l([n.mAP],e.prototype,"labelName",2),l([n.mAP],e.prototype,"sizeKey",2),l([n.mAP],e.prototype,"sizeName",2),l([n.mAP],e.prototype,"nodes",2),l([n.mAP],e.prototype,"getItemId",2),l([n.mAP],e.prototype,"fillGradientDefaults",2),l([n.mAP],e.prototype,"fillPatternDefaults",2),l([n.mAP],e.prototype,"fillImageDefaults",2),l([n.mAP],e.prototype,"fills",2),l([n.mAP],e.prototype,"strokes",2),l([n.mAP],e.prototype,"label",2),l([n.mAP],e.prototype,"link",2),l([n.mAP],e.prototype,"node",2),l([n.mAP],e.prototype,"tooltip",2),e})(),{SeriesNodePickMode:hf,createDatumId:cf,Sector:df,getShapeStyle:uf,getLabelStyles:pf,BBox:gf}=s.n1,mf=e=>e.startAngle+(0,n.s57)(e.startAngle,e.endAngle)/2,yf=(()=>{var e=class extends Uy{constructor(e){super({moduleCtx:e,pickModes:[hf.NEAREST_NODE,hf.EXACT_SHAPE_MATCH]}),this.properties=new lf}isLabelEnabled(){return(null!=this.properties.labelKey||null==this.nodes)&&this.properties.label.enabled}linkFactory(){return new qy}nodeFactory(){return new df}createNodeData(){const{id:e,_nodeDataDependencies:{seriesRectWidth:t,seriesRectHeight:i}={seriesRectWidth:0,seriesRectHeight:0},properties:s}=this,{fromKey:a,toKey:o,sizeKey:r,labelKey:l,label:{spacing:h,maxWidth:c,fontSize:d},node:{width:u,spacing:p}}=s,g=t/2,m=i/2;let y=[];const{nodeGraph:f,links:x}=this.getNodeGraph((e=>({...e,centerX:g,centerY:m,innerRadius:Number.NaN,outerRadius:Number.NaN,startAngle:Number.NaN,endAngle:Number.NaN})),(e=>({...e,centerX:g,centerY:m,radius:Number.NaN,startAngle1:Number.NaN,endAngle1:Number.NaN,startAngle2:Number.NaN,endAngle2:Number.NaN})),{includeCircularReferences:!0}),b=(0,n.A_g)(s.label,!1);let v=0;for(const[e,{datum:t,linksBefore:i,linksAfter:h}]of f.entries()){const c=i.reduce(((e,{link:t})=>e+t.size),0)+h.reduce(((e,{link:t})=>e+t.size),0);if(0===c)f.delete(e);else{const{label:e}=s;t.size=c,v+=t.size;let i=e.enabled?this.getLabelText(t.label,t.datum,l,"label",[],e,{datum:t.datum,value:t.label,fromKey:a,toKey:o,sizeKey:r,size:t.size}):void 0;null!=i&&(i=(0,n.HRu)(i,b,e)),t.label=(0,n.boc)(i)}}let S=0;if(this.isLabelEnabled()){const e=(0,n.K$y)(this.properties.label);let t=0;for(const{datum:i}of f.values()){const{id:s,label:a}=i;if(null==a)continue;const o=(0,n.C1g)(a,{maxWidth:c,font:this.properties.label,textWrap:"never"}),{width:r}=e.measureLines(o);t=Math.max(r,t),y.push({id:s,text:o,centerX:g,centerY:m,angle:Number.NaN,radius:Number.NaN,size:i.size,datumIndex:i.datumIndex,nodeDatum:i})}S=t+h}const M=f.size;let k=Math.min(t,i)/2-u-S,D=p/k;if(0!==S&&(M*D>=1.5*Math.PI||k<=0)&&(y=[],k=Math.min(t,i)/2-u,D=p/k),M*D>=2*Math.PI||k<=0)return void this.ctx.logger.warnOnce("There was insufficient space to display the Chord Series.");const w=k,I=k+u,A=Math.max((2*Math.PI-M*D)/v,0);let C=0;for(const{datum:e}of f.values()){e.innerRadius=w,e.outerRadius=I,e.startAngle=C,e.endAngle=C+e.size*A,C=e.endAngle+D;const t=(e.innerRadius+e.outerRadius)/2,i=mf(e);e.midPoint={x:e.centerX+t*Math.cos(i),y:e.centerY+t*Math.sin(i)}}const N=[];for(const{datum:e,linksBefore:t,linksAfter:i}of f.values()){const s=mf(e),a=[...t.map((e=>({link:e.link,distance:(0,n.s57)(mf(e.node.datum),s),after:!1}))),...i.map((e=>({link:e.link,distance:(0,n.s57)(mf(e.node.datum),s),after:!0})))];let o=e.startAngle;
1for(const{link:e,after:t}of a.toSorted(((e,t)=>e.distance-t.distance))){const i=e.size*A;t?(e.startAngle1=o,e.endAngle1=o+i):(e.startAngle2=o,e.endAngle2=o+i),o+=e.size*A}N.push(e)}const{tension:L}=this.properties.link;for(const e of x){e.radius=k;const t=Zy({radius:k,startAngle:e.startAngle1,endAngle:e.endAngle2,tension:L}),i=Zy({radius:k,startAngle:e.startAngle2,endAngle:e.endAngle1,tension:L}),s=(0,n.z90)(...t.x,.5),a=(0,n.z90)(...t.y,.5),o=(0,n.z90)(...i.x,.5),r=(0,n.z90)(...i.y,.5);e.midPoint={x:e.centerX+(s+o)/2,y:e.centerY+(a+r)/2},N.push(e)}for(const e of y){const t=f.get(e.id)?.datum;null!=t&&(e.radius=I+h,e.angle=(0,n.YcT)(t.startAngle+(0,n.s57)(t.startAngle,t.endAngle)/2),e.datumIndex=t.datumIndex,e.nodeDatum=t)}y.sort(((e,t)=>e.angle-t.angle));let P=1/0,T=-1/0;return y=y.filter((e=>{const t=(0,n.VKS)(d),i=Math.atan2(t/2,e.radius),s=e.angle-i,a=e.angle+i;return!(0,n.tF8)(P,s,a)&&(!(0,n.tF8)(T,s,a)&&(P=Math.min(s,P),T=Math.max(a,T),!0))})),{itemId:e,nodeData:N,labelData:y}}updateLabelSelection(e){const t=this.isLabelEnabled()?e.labelData:[];return e.labelSelection.update(t)}updateLabelNodes(e){const t={toKey:this.properties.toKey,fromKey:this.properties.fromKey,sizeKey:this.properties.sizeKey,size:Number.NaN},i=this.getHighlightedDatum();e.labelSelection.each(((e,n)=>{const{size:s,text:a,centerX:o,centerY:r,radius:l,angle:h,datumIndex:c,nodeDatum:d}=n;t.size=s;const u=this.isLabelHighlighted(d,i),p=this.getHighlightStyle(u,c),g=pf(this,void 0,t,this.properties.label,u,i);if(!g.enabled)return void(e.visible=!1);const{fontStyle:m,fontWeight:y,fontSize:f,fontFamily:x,color:b}=g;e.visible=!0,e.translationX=o+l*Math.cos(h),e.translationY=r+l*Math.sin(h),e.text=a,e.fill=b,e.fontStyle=m,e.fontWeight=y,e.fontSize=f,e.fontFamily=x,e.textBaseline="middle",Math.cos(h)>=0?(e.textAlign="left",e.rotation=h):(e.textAlign="right",e.rotation=h-Math.PI);const v=p.opacity??1;e.opacity=v,e.fillOpacity=v,e.setBoxing(g)}))}updateNodeSelection(e){return e.datumSelection.update(e.nodeData,void 0,(e=>cf(e.type,e.id)))}getNodeStyle(e,t,i){const{properties:s}=this,{fills:a,strokes:o,fillGradientDefaults:r,fillPatternDefaults:l,fillImageDefaults:h}=s,{itemStyler:c}=s.node,d=Oy(t),u=this.getHighlightStyle(i,e.datumIndex),p=this.getSelectionStyle(e.datumIndex),g=(0,n.HFk)(p,u,s.node.getStyle(a,o,d));let m=uf(g,r,l,h);if(null!=c&&null!=e.datumIndex){const t=this.cachedDatumCallback(cf(e.datumIndex,"node",i?"highlight":"node"),(()=>{const t=this.makeItemStylerParams(e,i,m);return this.ctx.optionsGraphService.resolvePartial(["series",`${this.declarationOrder}`],this.callWithContext(c,t))}));t&&(m=uf((0,n.HFk)(t,m),r,l,h))}return m.opacity=1,m}makeItemStylerParams({datum:e,datumIndex:t,size:i=0,label:n},s,a){const{id:o}=this,{fromKey:r,toKey:l,sizeKey:h}=this.properties,c=this.ctx.highlightManager?.getActiveHighlight(),d=this.getHighlightStateString(c,s,t),u=this.getSelectionStateString(t),p=this.getCandidateStateString(t),g=this.filterItemStylerFillParams(a.fill)??a.fill;return{seriesId:o,datum:e,highlightState:d,selectionState:u,candidateState:p,...a,size:i,label:n,fill:g,fromKey:r,toKey:l,sizeKey:h}}updateNodeNodes(e){const{datumSelection:t,isHighlight:i}=e,n=this.getShapeFillBBox();t.each(((e,t)=>{const{datumIndex:s}=t,a=this.getNodeStyle(t,s,i);e.setStyleProperties(a,n),e.centerX=t.centerX,e.centerY=t.centerY,e.innerRadius=t.innerRadius,e.outerRadius=t.outerRadius,e.startAngle=t.startAngle,e.endAngle=t.endAngle,e.inset=e.strokeWidth/2,e.cornerRadius=a.cornerRadius}))}updateLinkSelection(e){return e.datumSelection.update(e.nodeData,void 0,(e=>cf(e.type,e.datumIndex,e.fromNode.id,e.toNode.id)))}getLinkStyle(e,t,i,s){const{id:a,properties:o}=this,{fills:r,strokes:l,fillGradientDefaults:h,fillPatternDefaults:c,fillImageDefaults:d}=o,{itemStyler:u}=o.link,p=Oy(i),g=this.getHighlightStyle(s,t),m=this.getSelectionStyle(t),y=(0,n.HFk)(m,g,o.link.getStyle(r,l,p));let f=uf(y,h,c,d);if(null!=u&&null!=t){const o=this.ctx.highlightManager?.getActiveHighlight(),r=this.cachedDatumCallback(cf(t,"link",s?"highlight":"node"),(()=>{const t=this.getHighlightStateString(o,s,i);return this.ctx.optionsGraphService.resolvePartial(["series",`${this.declarationOrder}`],this.callWithContext(u,{seriesId:a,datum:e,highlightState:t,...f}))}));r&&(f=uf((0,n.HFk)(r,f),h,c,d))}return f.opacity=1,f}nodeEdge(e,t){const{strokeWidth:i}=this.properties.node,n=i/2,s=e.innerRadius>0?e.innerRadius+n:0,a=Math.max(e.outerRadius-n,0);if(t<=0||s<=0)return;const o=e.endAngle-e.startAngle-2*n/s,r=o>0?2*s*Math.sin(o/2):0,l=Math.floor(Math.max(0,Math.min(t,r/2,(a-s)/2)));if(l<=0)return;const h=s+l,c=Math.asin(l/h),d=n/h;return{innerRadius:s,cornerRadius:l,startAngle:e.startAngle,endAngle:e.endAngle,startCentreAngle:e.startAngle+d+c,endCentreAngle:e.endAngle-d-c,cornerSweep:c}}updateLinkNodes(e){const{datumSelection:t,isHighlight:i}=e,n=this.getShapeFillBBox(),s=new Map,a=e=>{if(!s.has(e)){const{cornerRadius:t}=this.getNodeStyle(e,e.datumIndex,!1);s.set(e,this.nodeEdge(e,t))}return s.get(e)};t.each(((e,t)=>{const s=this.getLinkStyle(t.datum,t.datumIndex,t.fromNode.datumIndex,i);e.centerX=t.centerX,e.centerY=t.centerY,e.radius=t.radius,e.startAngle1=t.startAngle1,e.endAngle1=t.endAngle1,e.startAngle2=t.startAngle2,e.endAngle2=t.endAngle2,e.edge1=a(t.fromNode),e.edge2=a(t.toNode),e.tension=s.tension,e.setStyleProperties(s,n)}))}getShapeFillBBox(){const e=this._nodeDataDependencies?.seriesRectWidth??0,t=this._nodeDataDependencies?.seriesRectHeight??0,i=Math.min(e,t),n=new gf((e-i)/2,(t-i)/2,e,t);return{series:n,axis:n}}computeFocusBounds(e){return e}hasItemStylers(){return this.properties.selection.enabled||null!=this.properties.node.itemStyler||null!=this.properties.link.itemStyler||null!=this.properties.label.itemStyler}};return e.className="ChordSeries",e.type="chord",e})(),{chordSeriesThemeableOptionsDef:ff}=s.n1,xf=(()=>({...ff,...n.XxK,type:(0,n.mw3)((0,n.dYl)("chord")),fromKey:(0,n.mw3)(n.YjP),toKey:(0,n.mw3)(n.YjP),sizeKey:n.YjP,sizeName:n.YjP,getItemId:(0,n.R3$)(n.YjP)}))();xf.fillGradientDefaults=(0,n._Le)(n.wiP),xf.fillPatternDefaults=(0,n._Le)(n.GYY),xf.fillImageDefaults=(0,n._Le)(n.Zdq);var bf=(()=>({type:"series",name:"chord",chartType:"standalone",enterprise:!0,solo:!0,version:s.xv,depen
vendor: 8,913 bytes, line 1
1dencies:[Py],options:xf,themeTemplate:{series:{fills:{$palette:"fills"},strokes:{$palette:"strokes"},highlight:n.CFZ,label:{...n.mgV,enabled:!0,fontFamily:{$ref:"fontFamily"},fontSize:{$ref:"fontSize"},fontWeight:{$ref:"fontWeight"},color:{$ref:"textColor"},spacing:5,maxWidth:100},node:{spacing:8,width:10,strokeWidth:{$isUserOption:["./stroke",2,0]}},link:{fillOpacity:.5,strokeWidth:{$isUserOption:["./stroke",2,0]},tension:.4},...(0,n.fs4)({selection:n.zg6,fillGradientDefaults:n.Euh,fillPatternDefaults:n.eu4,fillImageDefaults:n.pwE})},legend:{enabled:!1,toggleSeries:!1}},create:e=>new yf(e)}))(),vf={$eq:[{$path:["/series/0/direction",void 0]},"horizontal"]},Sf={$eq:[{$path:["/enableRtl",!1]},!0]},Mf={$clone:{$omit:[["placement","spacing"],{$path:"/series/0/stageLabel"}]}},kf={y:{type:{$if:[vf,n.uCf.NUMBER,n.uCf.CATEGORY]},position:{$if:[vf,n.v9C.LEFT,{$if:[{$eq:[{$path:["/series/0/stageLabel/placement",void 0]},"after"]},{$if:[Sf,n.v9C.LEFT,n.v9C.RIGHT]},{$if:[Sf,n.v9C.RIGHT,n.v9C.LEFT]}]}]},label:{$if:[vf,void 0,Mf]}},x:{type:{$if:[vf,n.uCf.CATEGORY,n.uCf.NUMBER]},position:{$if:[vf,{$if:[{$eq:[{$path:["/series/0/stageLabel/placement",void 0]},"before"]},n.v9C.TOP,n.v9C.BOTTOM]},n.v9C.BOTTOM]},label:{$if:[vf,Mf,void 0]}}},Df=(()=>({series:{direction:"vertical",strokeWidth:{$isUserOption:["./strokes/0",2,0]},spacingRatio:.25,fills:{$applyCycle:[{$size:{$path:["./data",{$path:"/data"}]}},[{$path:["/0",void 0,{$palette:"fills"}]}],{$applySwitch:[{$path:["/type",void 0,{$value:"$1"}]},{$value:"$1"},["gradient",n.dHK],["pattern",n.JyQ],["image",n.pwE]]}]},strokes:{$applyCycle:[{$size:{$path:["./data",{$path:"/data"}]}},[{$path:["/0",void 0,{$palette:"strokes"}]}]]},label:{...n.VTt,...n.F$C,enabled:!0,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},padding:8,spacing:8,collision:{threshold:4,alwaysShow:n.O2O,...(0,n.fs4)({collideWith:{seriesItems:!0}})},insideStyle:(0,n.KVS)("chartBackgroundColor"),outsideStyle:(0,n.KVS)("textColor"),placement:"inside-center"},dropOff:{enabled:!0,fillOpacity:.2,strokeWidth:{$isUserOption:["./stroke",2,0]}},shadow:{enabled:!1,color:n.KU9,xOffset:3,yOffset:3,blur:5},highlight:{enabled:{$path:["/highlight/enabled",!0]},unhighlightedItem:{opacity:.6}}},axes:{[n.uCf.NUMBER]:{nice:!1,gridLine:{enabled:!1},crosshair:{enabled:!1},label:{enabled:!1}},[n.uCf.CATEGORY]:{line:{enabled:!1}}}}))(),{BBox:wf,Path:If}=s.n1,Af=1e-6;function Cf([e,t],[i,n]){return Math.abs(e-i)<=Af&&Math.abs(t-n)<=Af}var Nf=Math.PI/2,Lf=Math.PI/4;function Pf(e,t,i,n,s,a){const o=e*i+t*n,r=-(e*s+t*a);return Math.min(Math.max(Math.atan2(o,r),Lf),Nf)}var Tf=(()=>{var e=class extends If{constructor(){super(...arguments),this.x0=0,this.y0=0,this.x1=0,this.y1=0,this.x2=0,this.y2=0,this.x3=0,this.y3=0,this.startCornerRadius=0,this.endCornerRadius=0,this.capsAlongX=!1}get midPoint(){const{x0:e,y0:t,x1:i,y1:n,x2:s,y2:a,x3:o,y3:r}=this;return{x:(e+i+s+o)/4,y:(t+n+a+r)/4}}distanceSquared(e,t){if(this.containsPoint(e,t))return 0;const{x0:i,y0:s,x1:a,y1:o,x2:r,y2:l,x3:h,y3:c}=this;return Math.min((0,n.h6n)(e,t,i,s,a,o,1/0),(0,n.h6n)(e,t,a,o,r,l,1/0),(0,n.h6n)(e,t,r,l,h,c,1/0),(0,n.h6n)(e,t,h,c,i,s,1/0))}computeBBox(){const{x0:e,y0:t,x1:i,y1:n,x2:s,y2:a,x3:o,y3:r,capsAlongX:l}=this;let h=Math.min(e,i,s,o),c=Math.max(e,i,s,o)-h,d=Math.min(t,n,a,r),u=Math.max(t,n,a,r)-d;const p=Math.max(this.startCornerRadius,this.endCornerRadius);return l?(d-=p,u+=2*p):(h-=p,c+=2*p),new wf(h,d,c,u)}updatePath(){this.path.clear(),this.startCornerRadius>0||this.endCornerRadius>0?this.traceRoundedPath():this.traceQuadPath(),this.path.closePath()}traceRoundedPath(){const{path:e}=this,t=this.caps();let i=!1;for(const[n,s]of t.entries()){const{fromX:a,fromY:o,toX:r,toY:l,flankX:h,flankY:c}=s,d=Math.hypot(r-a,l-o),u=Math.min(s.radius,d/2);if(u<=0){i?e.lineTo(a,o):(e.moveTo(a,o),i=!0),e.lineTo(r,l);continue}const p=(r-a)/d,g=(l-o)/d,m=p*c-g*h<0,y=m?-1:1,f=Math.atan2(-c,-h),x=Math.atan2(-g,-p),b=t[(n+t.length-1)%t.length],v=t[(n+1)%t.length],S=x+y*Pf(b.toX-a,b.toY-o,p,g,h,c),M=f+y*(Nf-Pf(v.fromX-r,v.fromY-l,-p,-g,h,c)),k=a+(p+h)*u,D=o+(g+c)*u,w=k+Math.cos(S)*u,I=D+Math.sin(S)*u;i?e.lineTo(w,I):(e.moveTo(w,I),i=!0),e.arc(k,D,u,S,f,m),e.lineTo(r-p*u,l-g*u),e.arc(r+(h-p)*u,l+(c-g)*u,u,f,M,m)}}caps(){const{x0:e,y0:t,x1:i,y1:n,x2:s,y2:a,x3:o,y3:r,startCornerRadius:l,endCornerRadius:h,capsAlongX:c}=this;if(c){const c=t<=a?-1:1;return[{fromX:e,fromY:t,toX:i,toY:n,radius:l,flankX:0,flankY:c},{fromX:s,fromY:a,toX:o,toY:r,radius:h,flankX:0,flankY:-c}]}const d=i>=e?1:-1;return[{fromX:i,fromY:n,toX:s,toY:a,radius:h,flankX:d,flankY:0},{fromX:o,fromY:r,toX:e,toY:t,radius:l,flankX:-d,flankY:0}]}traceQuadPath(){const{path:e,x0:t,y0:i,x1:n,y1:s,x2:a,y2:o,x3:r,y3:l}=this,h=[[t,i],[n,s],[a,o],[r,l]];let c,d;for(const t of h){if(null!=c&&Cf(c,t)||null!=d&&Cf(d,t))continue;const[i,n]=t;null==c?e.moveTo(i,n):e.lineTo(i,n),c??(c=t),d=t}}};return l([(0,n.k8u)()],e.prototype,"x0",2),l([(0,n.k8u)()],e.prototype,"y0",2),l([(0,n.k8u)()],e.prototype,"x1",2),l([(0,n.k8u)()],e.prototype,"y1",2),l([(0,n.k8u)()],e.prototype,"x2",2),l([(0,n.k8u)()],e.prototype,"y2",2),l([(0,n.k8u)()],e.prototype,"x3",2),l([(0,n.k8u)()],e.prototype,"y3",2),l([(0,n.k8u)()],e.prototype,"startCornerRadius",2),l([(0,n.k8u)()],e.prototype,"endCornerRadius",2),l([(0,n.k8u)()],e.prototype,"capsAlongX",2),e})(),{NODE_UPDATE_STATE_TO_PHASE_MAPPING:Of}=s.n1;function Rf(e,t,i,n){const{x0:s,y0:a,x1:o,y1:r,x2:l,y2:h,x3:c,y3:d,opacity:u}=e;return i?{x0:(s+c)/2,y0:(a+d)/2,x1:(o+l)/2,y1:(r+h)/2,x2:(o+l)/2,y2:(r+h)/2,x3:(s+c)/2,y3:(a+d)/2,opacity:u}:{x0:(s+o)/2,y0:(a+r)/2,x1:(s+o)/2,y1:(a+r)/2,x2:(l+c)/2,y2:(h+d)/2,x3:(l+c)/2,y3:(h+d)/2,opacity:u}}function Ef(e,t){const{x0:i,y0:n,x1:s,y1:a,x2:o,y2:r,x3:l,y3:h,opacity:c}=t;return{x0:i,y0:n,x1:s,y1:a,x2:o,y2:r,x3:l,y3:h,opacity:c}}var{barLabelObstaclesFor:zf,barLabelDataContext:Bf,SeriesNodePickMode:Ff,valueProperty:Vf,keyProperty:$f,updateLabelNode:Hf,buildBarLabelCandidates:jf,createBarCandidateStyleResolver:Wf,createBarPositionedCandidateResolver:_f,resolveBarLabelCandidate:Gf,expandPlacementLabelBoxExtent:Kf,fitLabelToContainerAutoSize:Yf,SMALLEST_KEY_INTERVAL:Uf,LARGEST_KEY_INTERVAL:Xf,diff:Zf,fixNumericExtent:qf,seriesLabelFadeInAnimation:Qf,resetMotion:Jf,resetLabelFn:ex,animationValidation:tx,computeBarFocusBounds:ix,Group:nx,Selection:sx,PointerEvents:ax,motion:ox,checkCrisp:rx,createDatumId:lx,getItemId:hx}=s.n1;function cx(e,{width:t,height:i}){return e<=0?0:Math.min(e,t/2,i/2)}var dx=class extends s.n1.AbstractBarSeries{constructor({moduleCtx:e,animationResetFns:t}){super({moduleCtx:e,pickModes:[Ff.AXIS_ALIGNED,Ff.EXACT_SHAPE_MATCH],propertyKeys:{x:["stageKey"],y:["valueKey"]},propertyNames:{x:[],y:[]},categoryKey:"xValue",datumSelectionGarbageCollection:!1,animationResetFns:{datum:t.datum,label:ex}}),this.connectorNodeGroup=this.contentGroup.appendChild(new nx({name:`${this.id}-series-connectorNodes`,zIndex:n.qw7.BACKGROUND})),this.connectorSelection=sx.select(this.connectorNodeGroup,(()=>this.connectionFactory())),this.connectorNodeGroup.pointerEvents=ax.None}createNodeParams(e){return{...super.createNodeParams(e),xKey:this.properties.stageKey,yKey:this.properties.valueKey}}get pickModeAxis(){return"main-category"}setZIndex(e){return super.setZIndex(e),this.connectorNodeGroup.zIndex=[n.qw7.BACKGROUND,e],!0}isVertical(){return!super.isVertical()}connectorCornerRadius(){return 0}connectionFactory(){return new Tf}getKeyAxis(e){return e===n.tv$.X?this.properties.xKeyAxis:e===n.tv$.Y?this.properties.yKeyAxis:void 0}async processData(e){const{stageKey:t,valueKey:i}=this.properties,{visible:n,id:s}=this,a=this.getCategoryAxis()?.scale,o=this.getValueAxis()?.scale,{isContinuousX:r,xScaleType:l,yScaleType:h}=this.getScaleInformation({xScale:a,yScale:o}),c=[];this.needsDataModelDiff()&&this.processedData&&c.push(Zf(this.id,this.processedData)),this.ctx.animationManager.isSkipped()||c.push(tx());const d=this.visible?{}:{forceValue:0},u=this.properties.allowNullKeys??!1,{processedData:p}=await this.requestDataModel(e,this.data,{props:[$f(t,l,{id:"xValue",allowNullKey:u}),Vf(i,h,{id:"yValue",...d,validation:(e,t,i)=>n&&(this.ctx.legendManager?.getItemEnabled({seriesId:s,itemId:i})??!0),invalidValue:0}),...r?[Uf,Xf]:[],...c],groupByKeys:!1});this.smallestDataInterval=p.reduced?.smallestKeyInterval,this.largestDataInterval=p.reduced?.largestKeyInterval,this.animationState.transition("updateData")}getSeriesDomain(e){const{processedData:t,dataModel:i,id:s,ctx:{legendManager:a}}=this;if(!t||!i)return{domain:[]};const{keys:[o]}=t.domain;if(e===this.getCategoryDirection()){const e=i.resolveProcessedDataDefById(this,"xValue");if("key"===e?.def.type&&"category"===e?.def.valueType){if(!this.hasData)return{domain:[]};return{domain:o.filter(((e,t)=>a?.getItemEnabled({seriesId:s,itemId:t})??!0)),sortMetadata:i.getKeySortMetadata(this,"xValue",t)}}return{domain:this.padBandExtent(o)}}
1{const t=this.domainForClippedRange(e,["yValue"],"xValue");let i=-1/0;for(const e of t)i=(0,n.cGV)(i,e);return{domain:qf([-i,i])}}}getSeriesRange(e,t){return[Number.NaN,Number.NaN]}createNodeData(){const{hasData:e,data:t,dataModel:i,processedData:s,id:a,ctx:{legendManager:o}}=this,r=this.getCategoryAxis(),l=this.getValueAxis();if(!(e&&t&&r&&l&&i&&"ungrouped"===s?.type))return;const h=r.scale,c=l.scale,d=this.getBarDirection()===n.tv$.X,{stageKey:u,valueKey:p}=this.properties,g=`${p}`,m={itemId:g,nodeData:[],labelData:[],connectorData:[],scales:this.calculateScaling(),groupScale:this.getScaling(this.ctx.seriesStateManager.getGroupScale(this)),visible:this.visible},y=this.visible;if(!y)return m;const f=i.resolveKeysById(this,"xValue",s),x=i.resolveColumnById(this,"yValue",s,"mixed-numeric"),{groupOffset:b,barOffset:v,barWidth:S}=this.getBarDimensions(),M=rx(r?.scale,r?.visibleRange,this.smallestDataInterval,this.largestDataInterval),k=this.createLabelContext(d);let D;const w=s.dataSources.get(this.id)?.data??[];for(const[e,t]of w.entries()){const i=y&&(o?.getItemEnabled({seriesId:a,itemId:e})??!0),n=f[e];if(void 0===n&&!this.properties.allowNullKeys)continue;const s=h.convert(n);if(!Number.isFinite(s))continue;const r=s+b+v,l=x[e],w=Math.round(c.convert(-l)),I=Math.round(c.convert(l)),A=this.getItemStyle({datum:t,datumIndex:e},!1),C=Math.max(A.strokeWidth??0,Math.abs(I-w)),N={x:d?Math.min(I,w):r,y:d?r:Math.min(I,w),width:d?C:S,height:d?S:C},L={x:N.x+N.width/2,y:N.y+N.height/2},P=this.createFunnelLabelDatum({labelContext:k,datumIndex:e,rect:N,yDatum:l,datum:t,visible:i}),T={index:e,series:this,datum:t,datumIndex:e,xValue:n,yValue:l,xKey:u,yKey:p,x:N.x,y:N.y,width:N.width,height:N.height,midPoint:L,crisp:M,label:P,visible:i};if(m.nodeData.push(T),null!=P&&m.labelData.push(P),null!=D){const e=D.rect,t=D.nodeDatum,i=D.datumIndex,n=cx(this.connectorCornerRadius(),e),s=cx(this.connectorCornerRadius(),N);d?m.connectorData.push({datum:t,datumIndex:i,x0:e.x,y0:e.y+e.height,x1:e.x+e.width,y1:e.y+e.height,x2:N.x+N.width,y2:N.y,x3:N.x,y3:N.y,opacity:1,startCornerRadius:n,endCornerRadius:s}):m.connectorData.push({datum:t,datumIndex:i,x0:e.x+e.width,y0:e.y,x1:N.x,y1:N.y,x2:N.x,y2:N.y+N.height,x3:e.x+e.width,y3:e.y+e.height,opacity:1,startCornerRadius:n,endCornerRadius:s})}i&&(D={itemId:g,rect:N,nodeDatum:T,datumIndex:e})}return m}resolveItemId(e,t){return hx({series:this,datum:e,datumIndex:t},this.data?.dataIdKey)}labelPlacementStyle(e){}labelStylerParams(){return{stageKey:this.properties.stageKey,valueKey:this.properties.valueKey}}createLabelContext(e){const{label:t}=this.properties,{placements:i,reportedPlacements:s,axes:a,insideCrossRegion:o}=this.resolveLabelPlacements(e),r=Kf(t),l=(0,n.A_g)(t,!t.collision.alwaysShow);return{placements:i,reportedPlacements:s,axes:a,insideCrossRegion:o,routesThroughEngine:(0,n.hqp)(void 0,t.placement,t.collision.alwaysShow,l),plotRegion:this.resolveLabelPlotRegion(t.collision),labelFit:l,boxPadding:r,yDomain:this.getSeriesDomain(n.tv$.Y).domain}}createFunnelLabelDatum({labelContext:e,datumIndex:t,rect:i,yDatum:s,datum:a,visible:o}){const{stageKey:r,valueKey:l,label:h}=this.properties;if(!h.enabled)return;const c=this.getLabelText(s,a,l,"y",e.yDomain,h,{itemId:this.resolveItemId(a,t),value:s,datum:a,stageKey:r,valueKey:l}),d={x:0,y:0,rotation:0,offsetX:0,offsetY:0,textAlign:"center",textBaseline:"middle",text:c,ownBox:i,hidden:!1,datum:a,datumIndex:t,series:this,visible:o},u=(0,n.kzl)(c,h),p=e.placements.flatMap(((t,n)=>jf({...e.axes[n],placements:[t],reportedPlacements:[e.reportedPlacements[n]],orientations:["horizontal"],spacing:h.spacing,label:h,textWidth:u.width,textHeight:u.height,rect:i,insideCrossRegion:e.insideCrossRegion,hideable:!h.collision.alwaysShow,plotRegion:e.plotRegion,fitted:null!=e.labelFit,text:c}))),[g]=p,m=null==g||e.routesThroughEngine?g:Gf(g,d,Wf(this,h,this.labelStylerParams(),void 0,(()=>g.placement)));if(null!=m&&(d.x=m.anchor.x,d.y=m.anchor.y,d.textAlign=m.anchor.textAlign,d.textBaseline=m.anchor.textBaseline,d.region=m.region,d.placement=m.placement),e.routesThroughEngine)d.candidates=p;else{const t=Yf(c,e.labelFit,h,m?.fitTo?.container);d.fittedText=t.text,d.fittedFontSize=t.fontSize}return d}updateNodes(e,t){super.updateNodes(e,t);const{connectorSelection:i}=this,n=this.contextNodeData?.connectorData??[];this.connectorSelection=this.updateConnectorSelection({connectorSelection:i,connectorData:n}),this.updateConnectorNodes({connectorSelection:i})}updateDatumSelection(e){const{nodeData:t,datumSelection:i}=e,n=t??[];return i.update(n,void 0,(e=>this.getDatumId(e)))}updateConnectorSelection(e){const{connectorData:t,connectorSelection:i}=e;return i.update(this.connectorEnabled()?t:[],void 0,(e=>this.getDatumId(e.datum)))}updateConnectorNodes(e){const t=this.getShapeFillBBox(),i=this.getBarDirection()===n.tv$.X;e.connectorSelection.each(((e,n)=>{const{fill:s,fillOpacity:a,stroke:o,strokeOpacity:r,strokeWidth:l,lineDash:h,lineDashOffset:c}=this.connectorStyle(n.datumIndex);e.setProperties(Ef(0,n)),e.capsAlongX=i,e.startCornerRadius=n.startCornerRadius,e.endCornerRadius=n.endCornerRadius,e.setStyleProperties({fill:s,stroke:o,fillOpacity:a,strokeOpacity:r,strokeWidth:l,lineDash:h,lineDashOffset:c},t)}))}updateLabelSelection(e){const t=this.properties.label.enabled?e.labelData:[];return e.labelSelection.update(t,(e=>{e.pointerEvents=ax.None}))}updateLabelNodes(e){const t=this.labelStylerParams(),i=this.ctx.highlightManager?.getActiveHighlight(),{isHighlight:n=!1,labelSelection:s}=e;s.each(((e,s)=>{if(s.hidden)return void(e.visible=!1);const a=this.getHighlightStyle(n,s.datumIndex);e.visible=s.visible||n,e.fillOpacity=a.opacity??1,e.opacity=a.opacity??1,Hf(this,e,t,this.properties.label,s,{isHighlight:n,activeHighlight:i},void 0,this.labelPlacementStyle(s.placement),{placement:s.placement,orientation:"horizontal"})}))}getLabelObstacles(){return zf(this.properties.label,this.contextNodeData?.nodeData,this.contextNodeData?.labelData,this.isLabelEnabled()&&!this.usesPlacedLabels,(e=>e))}getLabelData(){const{label:e}=this.properties;if(!this.usesPlacedLabels||!e.enabled)return[];const{alwaysShow:t,collideWith:i,threshold:s,measureBox:a,fitFor:o}=Bf(e),r=[];for(const e of this.contextNodeData?.labelData??[]){if(""===e.text||null==e.candidates)continue;const l=a(e.text);r.push((0,n.Nv9)(e.text,l.width,l.height,e.candidates,e,e.ownBox??{x:e.x,y:e.y,width:0,height:0},t,i,s,!0,o(e.text),e))}return r}getLabelCandidateResolver(){const e=this.labelStylerParams();return _f(this,this.properties.label,(()=>e))}updatePlacedLabelData(e){(0,n.she)(e),(0,n.HkM)(this.contextNodeData?.labelData,e,(e=>e)),this.refreshPlacedLabelNodes()}resolveUsesPlacedLabels(){return(0,n.qpr)(this.properties.label)}getHighlightLabelData(e,t){if(t.label)return[t.label]}getTooltipContent(e){const{id:t,dataModel:i,processedData:n,properties:s}=this,{stageKey:a,valueKey:o,tooltip:r,legendItemName:l}=s,h=this.getCategoryAxis(),c=this.getValueAxis();if(!(i&&n&&h&&c))return;
1const d=n.dataSources.get(this.id)?.data[e],u=i.resolveKeysById(this,"xValue",n)[e],p=i.resolveColumnById(this,"yValue",n,"mixed-numeric")[e],g=this.properties.allowNullKeys??!1;return void 0!==u||g?this.formatTooltipWithContext(r,{symbol:this.legendItemSymbol(e),data:[{label:this.getAxisValueText(h,"tooltip",u,d,a,l),value:this.getAxisValueText(c,"tooltip",p,d,o,l)}]},{seriesId:t,datum:d,title:a,stageKey:a,valueKey:o,...this.tooltipStyle(d,e)}):void 0}resetAllAnimation(e){super.resetAllAnimation(e),Jf([this.connectorSelection],Ef)}animateEmptyUpdateReady({labelSelection:e}){const{connectorSelection:t}=this,i=function(e,t){const i=e=>null==e;return{fromFn:(n,s,a)=>{let o;"updated"===a&&i(s)?a="removed":"updated"===a&&i(n.unsafePreviousDatum)&&(a="added"),o="added"===a&&null==n.previousDatum&&"fade"===t?{...Ef(0,s),opacity:0}:"unknown"===a||"added"===a?Rf(s,n.unsafePreviousDatum,e):{x0:n.x0,y0:n.y0,x1:n.x1,y1:n.y1,x2:n.x2,y2:n.y2,x3:n.x3,y3:n.y3,opacity:n.opacity};const r=Of[a];return{...o,phase:r}},toFn:(n,s,a)=>{let o;return o="removed"===a&&null==n.datum&&"fade"===t?{...Ef(0,s),opacity:0}:"removed"===a||i(s)?Rf(s,n.unsafePreviousDatum,e):Ef(0,s),o}}}(this.isVertical(),"normal");ox.fromToMotion(this.id,"connectors",this.ctx.animationManager,[t],i),Qf(this,"labels",this.ctx.animationManager,e)}animateWaitingUpdateReady(e){const{labelSelection:t}=e;this.ctx.animationManager.stopByAnimationGroupId(this.id),Qf(this,"labels",this.ctx.animationManager,t)}getDatumId(e){return lx(e.xValue)}isLabelEnabled(){return this.properties.label.enabled}computeFocusBounds({datumIndex:e}){return ix(this,this.contextNodeData?.nodeData[e])}legendItemSymbol(e){const{strokeWidth:t,fillOpacity:i,strokeOpacity:n,lineDash:s,lineDashOffset:a,fill:o,stroke:r}=this.properties.getStyle(e);return{marker:{fill:o,fillOpacity:i,stroke:r,strokeWidth:t,strokeOpacity:n,lineDash:s,lineDashOffset:a}}}getLegendData(e){const{id:t,processedData:i,dataModel:n,ctx:{legendManager:s},visible:a}=this;if(!n||!i||"category"!==e)return[];const{showInLegend:o}=this.properties,r=n.resolveKeysById(this,"xValue",i);return(i.dataSources.get(this.id)?.data??[]).map(((e,i)=>{const n=r[i],l=this.properties.allowNullKeys??!1;if(null!=n||l)return{legendType:"category",id:t,datum:e,itemId:i,seriesId:t,enabled:a&&(s?.getItemEnabled({seriesId:t,itemId:i})??!0),label:{text:String(n)},symbol:this.legendItemSymbol(i),skipAnimations:!0,hideInLegend:!o}})).filter((e=>null!=e))}hasItemStylers(){return this.properties.selection.enabled||null!=this.properties.itemStyler||null!=this.properties.label.itemStyler}},ux={"inside-center":"inside-center","inside-start":"inside-start","inside-end":"inside-end","inside-before":"inside-start","inside-after":"inside-end","outside-start":"outside-start","outside-end":"outside-end","outside-before":"outside-start","outside-after":"outside-end"},px={"inside-before":"inside-after","inside-after":"inside-before","outside-before":"outside-after","outside-after":"outside-before"};var gx={"middle-before":"inside-start","middle-center":"inside-center","middle-after":"inside-end","start-before":"beside-before-start","start-center":"beside-before-center","start-after":"beside-before-end","end-before":"beside-after-start","end-center":"beside-after-center","end-after":"beside-after-end"},mx={before:"start-center",middle:"middle-center",after:"end-center"},yx={"start-before":"end-before","start-center":"end-center","start-after":"end-after","middle-before":"middle-before","middle-center":"middle-center","middle-after":"middle-after","end-before":"start-before","end-center":"start-center","end-after":"start-after"},fx={"start-before":"start-after","start-after":"start-before","start-center":"start-center","middle-before":"middle-after","middle-after":"middle-before","middle-center":"middle-center","end-before":"end-after","end-after":"end-before","end-center":"end-center"};function xx(e,t){return{isVertical:e,isUpward:e===t}}function bx(e){return{isVertical:!e,isUpward:e}}function vx(e){return{isVertical:!e,isUpward:e}}function Sx(e,t,i){return e.map((e=>function(e){return e in px}(e)?i:t))}
1function Mx(e,t){const{x:i,y:n,top:s,right:a,bottom:o,left:r}=e;return t?{spanLo:i-s/2,spanHi:i+s/2,extentLo:r,extentHi:a,crossCentre:n,vertical:!1}:{spanLo:n-r/2,spanHi:n+r/2,extentLo:s,extentHi:o,crossCentre:i,vertical:!0}}function kx(e){return e.startsWith("inside")?"inside":"outside"}function Dx(e,t){const i=Array.from(new Set(e));return i.length>0?i:[t]}function wx(e,t,i,s){const a=i&&s?px:void 0;return Dx((0,n.$rL)(e).map((e=>a?.[e]??e)),t)}var{Label:Ix,LabelPlacementStyle:Ax,AbstractBarSeriesProperties:Cx,makeSeriesTooltip:Nx,SeriesLabelProperties:Lx}=s.n1,Px=(()=>{var e=class extends Ix{constructor(){super(...arguments),this.spacing=0,this.insideStyle=new Ax,this.outsideStyle=new Ax}};return l([n.mAP],e.prototype,"placement",2),l([n.mAP],e.prototype,"spacing",2),e})(),Tx=(()=>{var e=class extends Lx{};return l([n.mAP],e.prototype,"placement",2),e})(),Ox=(()=>{var e=class extends Cx{constructor(){super(...arguments),this.fills=[],this.fillOpacity=1,this.strokes=[],this.strokeWidth=1,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.label=new Px,this.stageLabel=new Tx,this.tooltip=Nx()}getStyle(e){const{fills:t,strokes:i,fillOpacity:n,strokeWidth:s,strokeOpacity:a,lineDash:o,lineDashOffset:r}=this;return{fill:t[e],fillOpacity:n,stroke:i[e],strokeWidth:s,strokeOpacity:a,lineDash:o,lineDashOffset:r,opacity:1}}};return l([n.mAP],e.prototype,"stageKey",2),l([n.mAP],e.prototype,"valueKey",2),l([n.mAP],e.prototype,"fills",2),l([n.mAP],e.prototype,"fillOpacity",2),l([n.mAP],e.prototype,"strokes",2),l([n.mAP],e.prototype,"strokeWidth",2),l([n.mAP],e.prototype,"strokeOpacity",2),l([n.mAP],e.prototype,"lineDash",2),l([n.mAP],e.prototype,"lineDashOffset",2),l([n.mAP],e.prototype,"label",2),l([n.mAP],e.prototype,"stageLabel",2),l([n.mAP],e.prototype,"tooltip",2),e})();function Rx(e,{x:t,y:i,width:n,height:s,opacity:a}){return{x1:t,y1:i,x2:t+n,y2:i+s,opacity:a??1}}var{Line:Ex,resetMotion:zx}=s.n1,Bx=(()=>{var e=class extends dx{constructor(e){super({moduleCtx:e,animationResetFns:{datum:Rx}}),this.properties=new Ox}animateWaitingUpdateReady(e){super.animateWaitingUpdateReady(e),zx([e.datumSelection],Rx)}get hasData(){const{id:e,ctx:{legendManager:t}}=this,i=this.data?.data.reduce(((i,n,s)=>i+(t?.getItemEnabled({seriesId:e,itemId:s})??1?1:0)),0);return null!=i&&i>1}getBandScalePadding(){return{inner:1,outer:0}}connectorEnabled(){return!0}getItemStyle({datumIndex:e},t){return this.properties.getStyle(e)}connectorStyle(e){return this.properties.getStyle(e)}nodeFactory(){return new Ex}defaultLabelPlacement(){return"start-center"}resolveLabelPlacements(e){const t=function(e,t,i,s){let a;return s&&(a=i?fx:yx),Dx((0,n.$rL)(e).map((e=>{const t=mx[e]??e;return a?.[t]??t})),t)}(this.properties.label.placement,this.defaultLabelPlacement(),e,this.ctx.domManager.isRtl),i=bx(e);return{placements:t.map((e=>gx[e])),reportedPlacements:t,axes:t.map((()=>i)),insideCrossRegion:this.getSeriesPlotRegion()}}updateDatumNodes(e){const t=this.getHighlightStyle(e.isHighlight);e.datumSelection.each(((e,i)=>{e.setProperties(Rx(0,i)),e.stroke=t?.stroke,e.strokeWidth=t?.strokeWidth??0,e.strokeOpacity=t?.strokeOpacity??1,e.lineDash=t?.lineDash,e.lineDashOffset=t?.lineDashOffset??0,e.opacity=t?.opacity??1}))}tooltipStyle(e,t){const{fill:i,stroke:n,fillOpacity:s,strokeOpacity:a,strokeWidth:o,lineDash:r,lineDashOffset:l}=this.properties.getStyle(t);return{fill:i,fillOpacity:s,stroke:n,strokeOpacity:a,strokeWidth:o,lineDash:r,lineDashOffset:l}}hasItemStylers(){return this.properties.selection.enabled||null!=this.properties.label.itemStyler}};return e.className="ConeFunnelSeries",e.type="cone-funnel",e})(),{coneFunnelSeriesThemeableOptionsDef:Fx}=s.n1,Vx=(()=>({...(0,n.FFB)(n.XxK,["showInLegend"]),...Fx,type:(0,n.mw3)((0,n.dYl)("cone-funnel")),stageKey:(0,n.mw3)(n.YjP),valueKey:(0,n.mw3)(n.YjP)}))(),$x={series:{direction:"vertical",fills:{$applyCycle:[{$size:{$path:["./data",{$path:"/data"}]}},{$if:[{$eq:[{$palette:"type"},"inbuilt"]},{$palette:"secondSequentialColors"},n.Hsq]},{$applySwitch:[{$path:["/type",void 0,{$value:"$1"}]},{$value:"$1"},["gradient",n.dHK],["pattern",n.JyQ],["image",n.pwE]]}]},strokes:{$applyCycle:[{$size:{$path:["./data",{$path:"/data"}]}},{$if:[{$eq:[{$palette:"type"},"inbuilt"]},{$palette:"secondSequentialColors"},{$palette:"strokes"}]}]},strokeWidth:{$isUserOption:["./strokes/0",2,0]},label:{...n.mgV,...n.F$C,enabled:!0,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"textColor"},collision:{threshold:4,alwaysShow:n.O2O},placement:"start-center",spacing:4},tooltip:{range:{$path:["/tooltip/range","nearest"]}},highlight:{enabled:{$path:["/highlight/enabled",!0]},highlightedItem:{stroke:"rgba(0, 0, 0, 0.4)",strokeWidth:2}}},seriesArea:{padding:{top:20,bottom:20}},axes:{[n.uCf.NUMBER]:{nice:!1,gridLine:{enabled:!1},crosshair:{enabled:!1},label:{enabled:!1}},[n.uCf.CATEGORY]:{line:{enabled:!1}}}},Hx={type:"series",name:"cone-funnel",chartType:"cartesian",enterprise:!0,solo:!0,version:s.xv,depen
1dencies:[s.bI],options:Vx,defaultAxes:kf,themeTemplate:$x,create:e=>new Bx(e)},{Label:jx,LabelPlacementStyle:Wx,DropShadow:_x,AbstractBarSeriesProperties:Gx,makeSeriesTooltip:Kx,SeriesLabelProperties:Yx}=s.n1,Ux=(()=>{var e=class extends jx{constructor(){super(...arguments),this.placement="inside-center",this.spacing=0,this.insideStyle=new Wx,this.outsideStyle=new Wx}};return l([n.mAP],e.prototype,"placement",2),l([n.mAP],e.prototype,"spacing",2),l([n.mAP],e.prototype,"insideStyle",2),l([n.mAP],e.prototype,"outsideStyle",2),e})(),Xx=(()=>{var e=class extends Yx{};return l([n.mAP],e.prototype,"placement",2),e})(),Zx=(()=>{var e=class extends n.XPE{constructor(){super(...arguments),this.enabled=!0,this.fill=void 0,this.fillOpacity=1,this.strokeWidth=1,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0}getStyle(){const{fill:e,stroke:t,fillOpacity:i,strokeWidth:n,strokeOpacity:s,lineDash:a,lineDashOffset:o}=this;return{fill:e,fillOpacity:i,stroke:t,strokeWidth:n,strokeOpacity:s,lineDash:a,lineDashOffset:o,opacity:1}}};return l([n.mAP],e.prototype,"enabled",2),l([n.mAP],e.prototype,"fill",2),l([n.mAP],e.prototype,"fillOpacity",2),l([n.mAP],e.prototype,"stroke",2),l([n.mAP],e.prototype,"strokeWidth",2),l([n.mAP],e.prototype,"strokeOpacity",2),l([n.mAP],e.prototype,"lineDash",2),l([n.mAP],e.prototype,"lineDashOffset",2),e})(),qx=(()=>{var e=class extends Gx{constructor(){super(...arguments),this.fills=[],this.fillOpacity=1,this.strokes=[],this.strokeWidth=1,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.spacingRatio=0,this.cornerRadius=0,this.dropOff=new Zx,this.shadow=(new _x).set({enabled:!1}),this.label=new Ux,this.stageLabel=new Xx,this.tooltip=Kx()}getStyle(e){const{fills:t,strokes:i,fillOpacity:n,strokeWidth:s,strokeOpacity:a,lineDash:o,lineDashOffset:r}=this;return{fill:t[e],fillOpacity:n,stroke:i[e],strokeWidth:s,strokeOpacity:a,lineDash:o,lineDashOffset:r,opacity:1}}};return l([n.mAP],e.prototype,"stageKey",2),l([n.mAP],e.prototype,"valueKey",2),l([n.mAP],e.prototype,"fills",2),l([n.mAP],e.prototype,"fillOpacity",2),l([n.mAP],e.prototype,"strokes",2),l([n.mAP],e.prototype,"strokeWidth",2),l([n.mAP],e.prototype,"strokeOpacity",2),l([n.mAP],e.prototype,"lineDash",2),l([n.mAP],e.prototype,"lineDashOffset",2),l([n.mAP],e.prototype,"spacingRatio",2),l([n.mAP],e.prototype,"cornerRadius",2),l([n.mAP],e.prototype,"itemStyler",2),l([n.mAP],e.prototype,"dropOff",2),l([n.mAP],e.prototype,"shadow",2),l([n.mAP],e.prototype,"label",2),l([n.mAP],e.prototype,"stageLabel",2),l([n.mAP],e.prototype,"tooltip",2),e})(),{resetBarSelectionsFn:Qx,prepareBarAnimationFunctions:Jx,midpointStartingBarPosition:eb,createDatumId:tb,pickPlacementStyle:ib,Rect:nb,motion:sb}=s.n1,ab=(()=>{var e=class extends dx{constructor(e){super({moduleCtx:e,animationResetFns:{datum:Qx}}),this.properties=new qx}getBandScalePadding(){return{inner:this.properties.spacingRatio,outer:0}}connectorEnabled(){return this.properties.dropOff.enabled}connectorCornerRadius(){return this.properties.cornerRadius}connectorStyle(e){return(0,n.HFk)(this.properties.dropOff.getStyle(),this.properties.getStyle(e))}nodeFactory(){return new nb}defaultLabelPlacement(){return"inside-center"}resolveLabelPlacements(e){const t=wx(this.properties.label.placement,this.defaultLabelPlacement(),e,this.ctx.domManager.isRtl);return{placements:t.map((e=>ux[e])),reportedPlacements:t,axes:Sx(t,xx(e,!0===this.getCategoryAxis()?.isReversed()),bx(e))}}labelPlacementStyle(e){const{label:t}=this.properties;return null==e?void 0:ib(t,kx(e))}getItemStyle({datum:e,datumIndex:t},i){const{id:s,properties:a}=this,{stageKey:o,valueKey:r,itemStyler:l}=a,h=this.getHighlightStyle(i,t),c=this.getSelectionStyle(t);let d=(0,n.HFk)(c,h,a.getStyle(t));if(null!=l){const a=this.ctx.highlightManager?.getActiveHighlight(),h=this.cachedDatumCallback(tb(t,i?"highlight":"node"),(()=>{const n=this.getHighlightStateString(a,i,t);return this.ctx.optionsGraphService.resolvePartial(["series",`${this.declarationOrder}`],this.callWithContext(l,{seriesId:s,datum:e,highlightState:n,stageKey:o,valueKey:r,...d}))}));
1h&&(d=(0,n.HFk)(h,d))}return d}updateDatumNodes({datumSelection:e,isHighlight:t}){const{contextNodeData:i}=this;if(!i)return;const{shadow:s,cornerRadius:a}=this.properties,o=this.getCategoryDirection()===n.tv$.X,r=this.getCategoryCrispDirection(),l=this.getShapeFillBBox();e.each(((e,i)=>{const n=this.getItemStyle(i,t);e.setStyleProperties(n,l),e.visible=o?i.width>0:i.height>0,e.crisp=i.crisp,e.crispCentreDirection=r,e.fillShadow=s,e.cornerRadius=a}))}tooltipStyle(e,t){return this.getItemStyle({datum:e,datumIndex:t},!1)}animateEmptyUpdateReady(e){super.animateEmptyUpdateReady(e);const{datumSelection:t}=e,i=this.isVertical(),n=Jx(eb(i,"normal"),"unknown");sb.fromToMotion(this.id,"datums",this.ctx.animationManager,[t],n)}animateWaitingUpdateReady(e){super.animateWaitingUpdateReady(e);const{datumSelection:t}=e,{processedData:i}=this,n=i?.reduced?.diff?.[this.id],s=Jx(eb(this.isVertical(),"fade"),"added");sb.fromToMotion(this.id,"datums",this.ctx.animationManager,[t],s,(e=>e.unsafeDatum.xValue),n)}hasItemStylers(){return this.properties.selection.enabled||null!=this.properties.itemStyler||null!=this.properties.label.itemStyler}};return e.className="FunnelSeries",e.type="funnel",e})(),{funnelSeriesThemeableOptionsDef:ob}=s.n1,rb=(()=>({...ob,...(0,n.FFB)(n.XxK,["showInLegend"]),type:(0,n.mw3)((0,n.dYl)("funnel")),stageKey:(0,n.mw3)(n.YjP),valueKey:(0,n.mw3)(n.YjP)}))(),lb={type:"series",name:"funnel",chartType:"cartesian",enterprise:!0,solo:!0,version:s.xv,dependencies:[s.bI],options:rb,defaultAxes:kf,themeTemplate:Df,create:e=>new ab(e)};function hb(e){const{enabled:t,mode:i,showArrow:n,range:s,position:a,pagination:o,delay:r,wrapping:l,interaction:h,renderer:c,...d}=e,u={enabled:t,showArrow:n,range:s,position:a,interaction:h,renderer:c,...d};return{chartTooltipOptions:{mode:i,pagination:o,delay:r,wrapping:l,...d},seriesTooltipOptions:u}}function cb(e,t){if(null==t)return e;const{targets:i,...s}=t;return null!=(e=(0,n.HFk)(e,s)).targets&&null!=i&&(e.type,e.targets=(0,n.qNV)(e.targets,i)),e}var db=new Set(["value","targets"]);function ub(e){const t={...e},i={};for(const e of db)e in t&&(i[e]=t[e],delete t[e]);return Object.keys(i).length>0&&(t.series=[i]),t}function pb(e,t){switch(e.type){case"radial-gauge":return function(e){const{animation:t,background:i,container:n,contextMenu:s,context:a,footnote:o,foreground:r,height:l,listeners:h,locale:c,minHeight:d,minWidth:u,overrideDevicePixelRatio:p,padding:g,subtitle:m,theme:y,title:f,width:x,type:b,cursor:v,nodeClickRange:S,tooltip:M,value:k,scale:D={},startAngle:w,endAngle:I,highlight:A,segmentation:C,bar:N,needle:L,targets:P,outerRadius:T,innerRadius:O,outerRadiusRatio:R,innerRadiusRatio:E,cornerRadius:z,cornerMode:B,label:F,secondaryLabel:V,spacing:$,withinStudio:H,...j}=e,W=null!=M,_=M??{},{chartTooltipOptions:G,seriesTooltipOptions:K}=hb(_),Y={...j,type:b,cursor:v,context:a,nodeClickRange:S,value:k,scale:D,startAngle:w,endAngle:I,highlight:A,segmentation:C,bar:N,targets:P,outerRadius:T,innerRadius:O,outerRadiusRatio:R,innerRadiusRatio:E,cornerRadius:z,cornerMode:B,label:F,secondaryLabel:V,spacing:$};return W&&(Y.tooltip=K),null!=L&&(Y.needle={enabled:!0,...L}),{animation:t,background:i,container:n,contextMenu:s,context:a,footnote:o,foreground:r,height:l,listeners:h,locale:c,minHeight:d,minWidth:u,overrideDevicePixelRatio:p,padding:g,subtitle:m,theme:y,title:f,width:x,...W?{tooltip:G}:{},series:[Y]}}(cb(e,t));case"linear-gauge":return function(e){const{animation:t,background:i,container:n,contextMenu:s,context:a,footnote:o,foreground:r,height:l,listeners:h,locale:c,minHeight:d,minWidth:u,overrideDevicePixelRatio:p,padding:g,subtitle:m,theme:y,title:f,width:x,type:b,cursor:v,nodeClickRange:S,tooltip:M,value:k,scale:D={},direction:w="vertical",thickness:I,highlight:A,segmentation:C,bar:N,targets:L,cornerRadius:P,cornerMode:T,label:O,withinStudio:R,...E}=e,z=null!=M,B=M??{},{chartTooltipOptions:F,seriesTooltipOptions:V}=hb(B),$={...E,type:b,cursor:v,nodeClickRange:S,value:k,scale:D,direction:w,thickness:I,highlight:A,segmentation:C,bar:N,targets:L,cornerRadius:P,cornerMode:T,label:O};return z&&($.tooltip=V),{animation:t,background:i,container:n,contextMenu:s,context:a,footnote:o,foreground:r,height:l,listeners:h,locale:c,minHeight:d,minWidth:u,overrideDevicePixelRatio:p,padding:g,subtitle:m,theme:y,title:f,width:x,...z?{tooltip:F}:{},series:[$]}}(cb(e,t));default:return{series:[]}}}var gb={theme:n.swK,container:n.swK,animation:n.swK,background:n.swK,contextMenu:n.swK,context:()=>!0,listeners:n.swK,locale:n.swK,width:n.swK,height:n.swK,minWidth:n.swK,minHeight:n.swK,title:n.swK,subtitle:n.swK,footnote:n.swK,padding:n.swK,tooltip:{...n.cUy,...n.Qi6.tooltip}};gb.overrideDevicePixelRatio=(0,n._Le)(n.LyW),gb.foreground=(0,n._Le)(n.swK),gb.withinStudio=(0,n._Le)(n.zMY);var mb=(()=>({type:"preset",name:"gauge-preset",enterprise:!0,version:s.xv,depen
1dencies:[Py],options:(0,n.ist)({"linear-gauge":{...(0,n.FFB)(n.BbD,["type"]),...gb},"radial-gauge":{...(0,n.FFB)(n.bfJ,["type"]),...gb}},"gauge options"),create:pb,fastUpdateKeys:db,processFastUpdate:ub}))(),yb=class{*[Symbol.iterator](){const{node:e,datum:t}=this;e&&t&&(yield{node:e,datum:t})}nodes(){return this.node?[this.node]:[]}update(e,t,i,n){const s=e.nodes();if(0===s.length)this.node?.remove(),this.node=void 0;else{void 0===this.node&&(this.node=new i,this.node.fillOpacity=0,this.node.strokeOpacity=0,t.appendChild(this.node));const e=s[0],a=s.toReversed().find((e=>{const t=e.datum?.datum;if(null!=t&&"object"==typeof t){const e=t,{value:i,segmentStart:n}=e;if("number"==typeof i&&"number"==typeof n)return i>n}return!1}))??s.at(-1);this.node.datum=this.datum=e.datum,n(this.node,e,a)}}};function fb(e,t){if(0===t){return{value:e.properties.value,text:e.properties.label.text,fallbackLabel:e.ctx.localeManager.t("ariaLabelGaugeValue")}}{const{value:i,text:n}=e.properties.targets.at(t-1)??{};return{value:i,text:n,fallbackLabel:e.ctx.localeManager.t("ariaLabelGaugeTarget")}}}var xb={fromFn:()=>({opacity:0,phase:"initial"}),toFn:()=>({opacity:1})};function bb(e,t){if(null==e)return"";if("bigint"==typeof e)return e.toLocaleString();const i=Number(t.min),n=Number(t.max),s=0===i?0:Math.ceil(Math.log10(Math.abs(i))),a=0===n?0:Math.ceil(Math.log10(Math.abs(n))),o=Math.max(2-Math.max(s,a),0);return e.toFixed(o)}function vb(e,t,i,s){if(null!=i.text)return i.text;const a="bigint"==typeof i.value?i.value:s??i.value;let o;return null!=i?.formatter&&(o=oy(t,i.formatter,{seriesId:e,datum:void 0,value:a})),null==o||(0,n.cyL)(o)?o:String(o)}var{Marker:Sb}=s.n1;function Mb({path:e,x:t,y:i,size:n}){e.moveTo(t,i-n/2),e.lineTo(t,i+n/2)}var kb=class extends Sb{distanceSquaredLocal(e,t){if(this.shape!==Mb)return super.distanceSquaredLocal(e,t);const i=this.size/2,s=t-(0,n.qE8)(-i,t,i),a=this.strokeWidth/2;return Math.max(e*e+s*s-a*a,0)}};function Db(e,t){const i=(0,n.nlf)(e.datumUnion.nodes(),e.targetSelection.nodes());return e.pickNodeNearestDistantObject(t,i)}function wb(e,t){const i=[{data:e.contextNodeData?.nodeData,selection:e.datumUnion},{data:e.contextNodeData?.targetData,selection:e.targetSelection}].filter((e=>e.data&&e.data.length>0)),s=(0,n.qE8)(0,t.otherIndex+t.otherIndexDelta,i.length-1);if(0===i.length)return;const{data:a,selection:o}=i[s];if(null==a||0===a.length)return;const r=s!==t.otherIndex-t.otherIndexDelta?0:(0,n.qE8)(0,t.datumIndex,a.length-1),l=a[r];for(const e of o)if(e.datum===l){return{bounds:e.node,clipFocusBox:!0,datum:l,datumIndex:r,otherIndex:s}}}function Ib(e,t){const i=e.data?.dataIdKey;return s.n1.findNodeDatumInArray(t,e.contextNodeData?.nodeData,i)??s.n1.findNodeDatumInArray(t,e.contextNodeData?.targetData,i)}var Ab=(()=>{var e=class extends n.XPE{getSegments(e,t,i){const{values:n,step:s,count:a}=this,o=e.domainMin??Number.NaN,r=e.domainMax??Number.NaN,l=Number(o),h=Number(r);let c;if(null!=n){const e=n.filter((e=>e>o&&e<r)).sort(((e,t)=>Number(e)-Number(t)));c=[o,...e,r]}else if(null!=s){const e=Number(s),t=[];for(let i=l;i<h;i+=e)t.push(i);t.push(r),c=t}else if(null==a){const t=e.ticks({nice:[!0,!0],interval:void 0,tickCount:void 0,minTickCount:0,maxTickCount:1/0})?.ticks?.filter((e=>e>o&&e<r));c=null==t?void 0:[o,...t,r]}else{const e=a+1;c=Array.from({length:e+1},((t,i)=>i/e*(h-l)+l))}return null!=c&&c.length>t&&(i.warnOnce("the configured segmentation results in more than 1 item per pixel, ignoring. Supply a segmentation configuration that results in larger segments or omit this configuration"),c=void 0),c??(c=[o,r]),c}};return l([n.mAP],e.prototype,"values",2),l([n.mAP],e.prototype,"step",2),l([n.mAP],e.prototype,"count",2),e})(),Cb=(()=>{var e=class extends n.XPE{constructor(){super(...arguments),this.enabled=!1,this.interval=new Ab,this.spacing=0}};return l([n.mAP],e.prototype,"enabled",2),l([n.mAP],e.prototype,"interval",2),l([n.mAP],e.prototype,"spacing",2),e})(),{makeSeriesTooltip:Nb,SeriesProperties:Lb,Label:Pb,SeriesLabelProperties:Tb,getColorStops:Ob}=s.n1,Rb=(()=>{var e=class extends Pb{};return l([n.mAP],e.prototype,"spacing",2),e})(),Eb=(()=>{var e=class extends n.XPE{constructor(){super(...arguments),this.value=0,this.label=new Rb}getStyle(e){const{fill:t=e.fill??"black",fillOpacity:i=e.fillOpacity??1,stroke:n=e.stroke??"black",strokeWidth:s=e.strokeWidth??0,strokeOpacity:a=e.strokeOpacity??1,lineDash:o=e.lineDash??[0],lineDashOffset:r=e.lineDashOffset??0}=this;return{fill:t,fillOpacity:i,stroke:n,strokeWidth:s,strokeOpacity:a,lineDash:o,lineDashOffset:r}}};return l([n.mAP],e.prototype,"text",2),l([n.mAP],e.prototype,"value",2),l([n.mAP],e.prototype,"shape",2),l([n.mAP],e.prototype,"placement",2),l([n.mAP],e.prototype,"spacing",2),l([n.mAP],e.prototype,"size",2),l([n.mAP],e.prototype,"rotation",2),l([n.mAP],e.prototype,"fill",2),l([n.mAP],e.prototype,"fillOpacity",2),l([n.mAP],e.prototype,"stroke",2),l([n.mAP],e.prototype,"strokeWidth",2),l([n.mAP],e.prototype,"strokeOpacity",2),l([n.mAP],e.prototype,"lineDash",2),l([n.mAP],e.prototype,"lineDashOffset",2),l([n.mAP],e.prototype,"label",2),e})(),zb=(()=>{var e=class extends n.XPE{constructor(){super(...arguments),this.enabled=!0,this.thicknessRatio=1,this.fills=new n.F_c(s.n1.StopProperties),this.fillMode="continuous",this.fillOpacity=1,this.stroke="black",this.strokeWidth=0,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0}getStyle(e,t,i){const{fill:n,fills:s,fillMode:a,fillOpacity:o,stroke:r,strokeWidth:l,strokeOpacity:h,lineDash:c,lineDashOffset:d}=this;return{fill:n??jb(s,a,e,i,t),fillOpacity:o,stroke:r,strokeWidth:l,strokeOpacity:h,lineDash:c,lineDashOffset:d}}};return l([n.mAP],e.prototype,"enabled",2),l([n.mAP],e.prototype,"thickness",2),l([n.mAP],e.prototype,"thicknessRatio",2),l([n.mAP],e.prototype,"fills",2),l([n.mAP],e.prototype,"fillMode",2),l([n.mAP],e.prototype,"fill",2),l([n.mAP],e.prototype,"fillOpacity",2),l([n.mAP],e.prototype,"stroke",2),l([n.mAP],e.prototype,"strokeWidth",2),l([n.mAP],e.prototype,"strokeOpacity",2),l([n.mAP],e.prototype,"lineDash",2),l([n.mAP],e.prototype,"lineDashOffset",2),e})(),Bb=(()=>{var e=class extends n.XPE{constructor(){super(...arguments),this.values=void 0,this.step=void 0,this.minSpacing=0,this.maxSpacing=1e3}};return l([n.mAP],e.prototype,"values",2),l([n.mAP],e.prototype,"step",2),l([n.mAP],e.prototype,"minSpacing",2),l([n.mAP],e.prototype,"maxSpacing",2),e})(),Fb=(()=>{var e=class extends Tb{constructor(){super(...arguments),this.placement=void 0}};return l([n.mAP],e.prototype,"placement",2),e})(),Vb=(()=>{var e=class extends n.XPE{constructor(){super(...arguments),this.min=0,this.max=1,this.fills=new n.F_c(s.n1.StopProperties),this.fillMode="continuous",this.fillOpacity=1,this.stroke="black",this.strokeWidth=0,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.defaultFill="black",this.interval=new Bb,this.label=new Fb}getStyle(e,t,i,n){const{fill:s,fills:a,defaultFill:o,fillMode:r,fillOpacity:l,stroke:h,strokeWidth:c,strokeOpacity:d,lineDash:u,lineDashOffset:p}=this;return{fill:s??(e&&0===a.length?o:void 0)??jb(a,r,t,n,i),fillOpacity:l,stroke:h,strokeWidth:c,strokeOpacity:d,lineDash:u,lineDashOffset:p}}};return l([n.mAP],e.prototype,"min",2),l([n.mAP],e.prototype,"max",2),l([n.mAP],e.prototype,"fills",2),l([n.mAP],e.prototype,"fillMode",2),l([n.mAP],e.prototype,"fill",2),l([n.mAP],e.prototype,"fillOpacity",2),l([n.mAP],e.prototype,"stroke",2),l([n.mAP],e.prototype,"strokeWidth",2),l([n.mAP],e.prototype,"strokeOpacity",2),l([n.mAP],e.prototype,"lineDash",2),l([n.mAP],e.prototype,"lineDashOffset",2),l([n.mAP],e.prototype,"defaultFill",2),l([n.mAP],e.prototype,"interval",2),l([n.mAP],e.prototype,"label",2),e})(),$b=(()=>{var e=class extends Zl{constructor(){super(...arguments),this.placement="inside-center",this.avoidCollisions=!0}};return l([n.mAP],e.prototype,"text",2),l([n.mAP],e.prototype,"placement",2),l([n.mAP],e.prototype,"avoidCollisions",2),e})(),Hb=(()=>{var e=class extends Lb{constructor(){super(...arguments),this.value=0,this.segmentation=new Cb,this.defaultColorRange=[],this.targets=new n.F_c(Eb),this.defaultTarget=new Eb,this.defaultScale=new Vb,this.direction="vertical",this.thickness=1,this.cornerRadius=0,this.cornerMode="container",this.margin=0,this.scale=new Vb,this.bar=new zb,this.label=new $b,this.tooltip=Nb()}};return l([n.mAP],e.prototype,"value",2),l([n.mAP],e.prototype,"segmentation",2),l([n.mAP],e.prototype,"defaultColorRange",2),l([n.mAP],e.prototype,"targets",2),l([n.mAP],e.prototype,"defaultTarget",2),l([n.mAP],e.prototype,"defaultScale",2),l([n.mAP],e.prototype,"direction",2),l([n.mAP],e.prototype,"thickness",2),l([n.mAP],e.prototype,"cornerRadius",2),l([n.mAP],e.prototype,"cornerMode",2),l([n.mAP],e.prototype,"margin",2),l([n.mAP],e.prototype,"scale",2),l([n.mAP],e.prototype,"bar",2),l([n.mAP],e.prototype,"label",2),l([n.mAP],e.prototype,"tooltip",2),e})();function jb(e,t,i,n,s){return{type:"gradient",gradient:"linear",colorSpace:"oklch",colorStops:Ob(e,i,n.domain.map(Number),t),rotation:s?90:0,bounds:"series"}}var{BBox:Wb}=s.n1;function _b(e){const{x0:t,y0:i,x1:n,y1:s,horizontalInset:a,verticalInset:o}=e;return{x:Math.min(t,n)+a,y:Math.min(i,s)+o,width:Math.max(Math.abs(n-t)-2*a,0),height:Math.max(Math.abs(s-i)-2*o,0)}}function Gb(e){const{clipX0:t,clipX1:i,clipY0:n,clipY1:s}=e;return null!=t&&null!=i||null!=n&&null!=s}function Kb(e,t){const i=e?"initial":"update";return{node:{fromFn(n,s){const a=n.previousDatum;
1let{x0:o,y0:r,x1:l,y1:h,clipX0:c,clipY0:d,clipX1:u,clipY1:p}=a??s;const{horizontalInset:g,verticalInset:m}=s,y=null!=a&&Gb(a),f=Gb(s);return y&&f||(!y&&f?(({x0:o,y0:r,x1:l,y1:h,clipX0:c,clipY0:d,clipX1:u,clipY1:p}=s),e&&(t?u=s.clipX0:p=s.clipY0)):y&&!f?(({x0:o,y0:r,x1:l,y1:h}=s),c=void 0,d=void 0,u=void 0,p=void 0):e&&(t?l=o:h=r)),{x0:o,y0:r,x1:l,y1:h,clipX0:c,clipY0:d,clipX1:u,clipY1:p,horizontalInset:g,verticalInset:m,phase:i}},toFn(e,t){const{x0:i,y0:n,x1:s,y1:a,clipX0:o,clipY0:r,clipX1:l,clipY1:h,horizontalInset:c,verticalInset:d}=t;return{x0:i,y0:n,x1:s,y1:a,clipX0:o,clipY0:r,clipX1:l,clipY1:h,horizontalInset:c,verticalInset:d}},applyFn(e,t){e.setProperties(Yb(e,t))}}}}function Yb(e,t){const{x:i,y:n,width:s,height:a}=_b(t),o=function(e){if(!Gb(e))return;const{x0:t,y0:i,x1:n,y1:s}=e,{x:a,y:o,width:r,height:l}=_b(e);let{clipX0:h,clipX1:c,clipY0:d,clipY1:u}=e;null!=h&&null!=c||(h=t,c=n),null!=d&&null!=u||(d=i,u=s);const p=Math.min(h,c),g=Math.min(d,u),m=Math.abs(c-h),y=Math.abs(u-d);return h=Math.max(a,p),d=Math.max(o,g),c=Math.min(a+r,p+m),u=Math.min(o+l,g+y),new Wb(Math.min(h,c),Math.min(d,u),Math.abs(c-h),Math.abs(u-d))}(t),r=function(e,t){if(null==t)return!0;const i=_b(e),n=1e-6,s=i.x+n,a=i.y+n,o=i.x+i.width-n,r=i.y+i.height-n,l=t.x,h=t.x+t.width,c=t.y,d=t.y+t.height;return Math.max(s,l)<=Math.min(o,h)&&Math.max(a,c)<=Math.min(r,d)}(t,o);return{x:i,y:n,width:s,height:a,clipBBox:o,visible:r}}var Ub={Before:"right",Center:"center",After:"left"},Xb={Before:"top",Center:"middle",After:"bottom"},Zb={Before:-1,Center:-.5,After:0},qb={Before:0,Center:-.5,After:-1};var{fromToMotion:Qb,resetMotion:Jb,SeriesNodePickMode:ev,createDatumId:tv,BBox:iv,Group:nv,PointerEvents:sv,Selection:av,Rect:ov,Text:rv,TransformableText:lv,LinearScale:hv,generateTicks:cv,NiceMode:dv}=s.n1,uv={before:180,middle:0,after:0},pv={before:90,middle:0,after:-90},gv=(()=>{var e=class extends s.n1.Series{constructor(e){super({moduleCtx:e,pickModes:[ev.EXACT_SHAPE_MATCH,ev.NEAREST_NODE]}),this.properties=new Hb,this.seriesRect=iv.NaN,this.gaugeRect=iv.NaN,this.scale=new hv,this.originX=0,this.originY=0,this.scaleGroup=this.contentGroup.appendChild(new nv({name:"scaleGroup"})),this.itemGroup=this.contentGroup.appendChild(new nv({name:"itemGroup"})),this.itemTargetGroup=this.contentGroup.appendChild(new nv({name:"itemTargetGroup"})),this.itemTargetLabelGroup=this.contentGroup.appendChild(new nv({name:"itemTargetLabelGroup"})),this.itemLabelGroup=this.contentGroup.appendChild(new nv({name:"itemLabelGroup"})),this.highlightTargetGroup=this.highlightGroup.appendChild(new nv({name:"itemTargetLabelGroup"})),this.tickGroup=this.contentGroup.appendChild(new nv({name:"tickGroup"})),this.scaleSelection=av.select(this.scaleGroup,(()=>this.nodeFactory())),this.datumSelection=av.select(this.itemGroup,(()=>this.nodeFactory())),this.targetSelection=av.select(this.itemTargetGroup,(()=>this.markerFactory())),this.targetLabelSelection=av.select(this.itemTargetLabelGroup,rv),this.labelSelection=av.select(this.itemLabelGroup,rv),this.highlightTargetSelection=av.select(this.highlightTargetGroup,(()=>this.markerFactory())),this.tickSelection=av.select(this.tickGroup,lv),this.datumUnion=new yb,this.animationState=new n.Z37("empty",{empty:{update:{target:"ready",action:()=>this.animateEmptyUpdateReady()},reset:"empty",skip:"ready"},ready:{updateData:"waiting",clear:"clearing",resize:()=>this.animateReadyResize(),reset:"empty",skip:"ready"},waiting:{update:{target:"ready",action:()=>this.animateWaitingUpdateReady()},reset:"empty",skip:"ready"},clearing:{update:{target:"empty"},reset:"empty",skip:"ready"}}),this.scaleGroup.pointerEvents=sv.None,this.tickGroup.pointerEvents=sv.None}get range(){return this.horizontal?[0,this.gaugeRect.width]:[0,this.gaugeRect.height]}get horizontal(){return"horizontal"===this.properties.direction}get hasData(){return!0}nodeFactory(){const e=new ov;return e.crisp=!0,e}markerFactory(){return new kb}processData(){this.nodeDataRefresh=!0,this.animationState.transition("updateData")}formatLabel(e){return bb(e,this.properties.scale)}getShapeFillBBox(){const{properties:e,originX:t,originY:i,horizontal:s,scale:a}=this,{thickness:o}=e,r=(0,n.DuJ)(a.range),l=new iv(t,i,s?r:o,s?o:r);return{axis:l,series:l}}getTargets(){const{properties:e}=this,t=e.defaultTarget;return Array.from(e.targets).map((e=>{const{text:i=t.text,value:n=t.value??0,shape:s=t.shape??"triangle",rotation:a=t.rotation??0,placement:o=t.placement??"middle",spacing:r=t.spacing??0,size:l=t.size??0}=e,{enabled:h=t.label.enabled,color:c=t.label.color??"black",fontStyle:d=t.label.fontStyle??"normal",fontWeight:u=t.label.fontWeight??"normal",fontSize:p=t.label.fontSize,fontFamily:g=t.label.fontFamily,spacing:m=t.label.spacing??0}=e.label;return{text:i,value:n,shape:s,placement:o,spacing:r,size:l,rotation:a,label:{enabled:h,color:c,fontStyle:d,fontWeight:u,fontSize:p,fontFamily:g,spacing:m},style:e.getStyle(t)}}))}getTargetPoint(e){const{properties:t,originX:i,originY:n,horizontal:s,scale:a,gaugeRect:o}=this,{thickness:r}=t,{value:l,placement:h,spacing:c,size:d}=e,u=a.convert(l);let p;switch(h){case"before":p=-(c+d/2);break;case"after":p=r+c+d/2;break;default:p=r/2}return{x:i+o.x+(s?u:p),y:n+o.y+(s?p:u)}}getTargetLabel(e){const{size:t,placement:i,label:n}=e,{spacing:s,color:a,fontStyle:o,fontWeight:r,fontSize:l,fontFamily:h}=n,c=t/2+s;let d,u,p=0,g=0;return this.horizontal?(d="center","after"===i?(u="top",g=c):(u="bottom",g=-c)):(u="middle","before"===i?(d="right",p=-c):(d="left",p=c)),{offsetX:p,offsetY:g,fill:a,textAlign:d,textBaseline:u,fontStyle:o,fontWeight:r,fontSize:l,fontFamily:h,lineHeight:void 0}}labelDatum(e,t){const{placement:i,avoidCollisions:n,spacing:s,text:a,color:o,fontSize:r,minimumFontSize:l,fontStyle:h,fontWeight:c,fontFamily:d,lineHeight:u,wrapping:p,overflowStrategy:g,formatter:m=e=>this.formatLabel(e.value)}=e;return{series:this,datum:void 0,datumIndex:0,placement:i,avoidCollisions:n,spacing:s,text:a,value:t,fill:o,fontSize:r,minimumFontSize:l,fontStyle:h,fontWeight:c,fontFamily:d,lineHeight:u,wrapping:p,overflowStrategy:g,formatter:m}}verticalLabelInset(){const{label:e}=this.properties,t=(0,n.K$y)(e),i=e.text?.split("\n"),s=(e.lineHeight??t.lineHeight())*(i?.length??1);return e.spacing+s}horizontalLabelInset(){const{scale:e,properties:t}=this,{scale:i,label:s}=t,a=s.text?.split("\n"),o=(0,n.K$y)(s),r=i.interval.values??e.ticks({nice:[!1,!1],interval:i.interval.step,minTickCount:0,maxTickCount:6,tickCount:5},[i.min,i.max])?.ticks??[],l=(a??r?.map((e=>vb(this.id,this.ctx,this.labelDatum(s,e))??""))).reduce(((e,t)=>{const{width:i}=(0,n.cyL)(t)?(0,n.wEO)(t,s):o.measureLines((0,n.i$)(t));return Math.max(e,i)}),0);return s.spacing+l}tickFormatter(e,t){const{format:i,formatter:s}=this.properties.scale.label;let a;return null!=i&&(a=(0,n.Vr1)(t,"string"==typeof i?i:void 0)),(t,i)=>{let n;
1return s&&(n??(n=oy(this.ctx,s,{type:"number",value:t,index:i,domain:e,boundSeries:void 0}))),n??(n=a?.(t)),n??this.formatLabel(t)}}createNodeData(){const{id:e,properties:t,horizontal:i,scale:s,seriesRect:a}=this,{value:o,segmentation:r,thickness:l,cornerRadius:h,cornerMode:c,bar:d,scale:u,label:p,defaultColorRange:g,defaultScale:m}=t;let y,f,x,b,v,S;s.domain=[u.min,u.max],s.range=i?[0,a.width]:[a.height,0],i?(f=1,y=Math.PI/-2):"before"===u.label.placement?(f=1,y=0):(f=-1,y=0),i?(x=0,b=a.width,v=(a.height-l)/2,S=v+l,"outside-start"===p.placement?x+=this.horizontalLabelInset():"outside-end"===p.placement&&(b-=this.horizontalLabelInset())):(x=(a.width-l)/2,b=x+l,S=0,v=a.height,"outside-start"===p.placement?v-=this.verticalLabelInset():"outside-end"===p.placement&&(S+=this.verticalLabelInset())),this.gaugeRect=new iv(Math.min(x,b),Math.min(v,S),Math.abs(b-x),Math.abs(S-v));s.domain=[u.min,u.max],s.range=i?[x,b]:[v,S];const M=(0,n.HFk)(u.label,m.label),{tickData:{ticks:k}}=cv({scale:s,label:M,parallel:i,interval:u.interval,tickFormatter:(e,t)=>this.tickFormatter(e,t),domain:[u.min,u.max],range:this.range,reverse:!1,primaryTickCount:void 0,defaultTickMinSpacing:0,visibleRange:[0,1],niceMode:[dv.Off,dv.Off],labelOffset:0,axisRotation:y,sideFlag:f}),D=this.getTargets(),w=[],I=[],A=[],C=[],[N,L]=s.range,P=Math.abs(L-N),T=i?s.convert(o):b,O=i?S:s.convert(o),R=r.enabled?r.spacing/2:0,E=i?R:0,z=i?0:R,B=Math.min(d.thickness??Math.round(d.thicknessRatio*l),l),F=-(l-B)/2,V=i?0:F,$=i?F:0,H="item"===c,j=Math.ceil(P);let W=r.enabled?r.interval.getSegments(s,j,this.ctx.logger):void 0;const _=d.getStyle(g,i,s),G=u.getStyle(d.enabled,g,i,s);if(null==W&&H){const e={value:o,segmentStart:Number(s.domainMin),segmentEnd:Number(s.domainMax)};if(d.enabled){const t=1*Math.min(h,B/2,P/2),n=i?t:0,s=i?0:t;w.push({series:this,itemId:"value",datum:e,datumIndex:0,type:0,x0:0+x-n-V,y0:0+v-s-$,x1:0+T+n+V,y1:0+O+s+$,clipX0:void 0,clipY0:void 0,clipX1:void 0,clipY1:void 0,topLeftCornerRadius:h,topRightCornerRadius:h,bottomRightCornerRadius:h,bottomLeftCornerRadius:h,horizontalInset:E,verticalInset:z,style:_})}const t=1*Math.min(h,l/2,P/2),n=i?t:0,a=i?0:t;C.push({series:this,itemId:"scale",datum:e,datumIndex:0,type:0,x0:0+x-n,y0:0+v-a,x1:0+b+n,y1:0+S+a,clipX0:void 0,clipY0:void 0,clipX1:void 0,clipY1:void 0,topLeftCornerRadius:h,topRightCornerRadius:h,bottomRightCornerRadius:h,bottomLeftCornerRadius:h,horizontalInset:E,verticalInset:z,style:G})}else{W??(W=s.domain);const e=0+x-V,t=0+v-$,n=0+T+V,a=0+O+$;for(let r=0;r<W.length-1;r+=1){const l=W[r+0],c=W[r+1],u={value:o,segmentStart:l,segmentEnd:c},p=0===r,g=r===W.length-2,m=s.convert(l),y=s.convert(c),f=H||p?h:0,M=H||g?h:0,k=i?f:M,D=M,I=i?M:f,A=f;d.enabled&&w.push({series:this,itemId:`value-${r}`,datum:u,datumIndex:0,type:0,x0:0+(i?m:x),y0:0+(i?v:m),x1:0+(i?y:b),y1:0+(i?S:y),clipX0:e,clipY0:t,clipX1:n,clipY1:a,topLeftCornerRadius:k,topRightCornerRadius:D,bottomRightCornerRadius:I,bottomLeftCornerRadius:A,horizontalInset:E,verticalInset:z,style:_}),C.push({series:this,itemId:`scale-${r}`,datum:u,datumIndex:0,type:0,x0:0+(i?m:x),y0:0+(i?v:m),x1:0+(i?y:b),y1:0+(i?S:y),clipX0:void 0,clipY0:void 0,clipX1:void 0,clipY1:void 0,topLeftCornerRadius:k,topRightCornerRadius:D,bottomRightCornerRadius:I,bottomLeftCornerRadius:A,horizontalInset:E,verticalInset:z,style:G})}}for(const e of[C,w])for(const t of e){const e=t.clipX0??t.x0,i=t.clipX1??t.x1,n=t.clipY0??t.y0,s=t.clipY1??t.y1;t.midPoint={x:(e+i)/2,y:(n+s)/2}}p.enabled&&A.push(this.labelDatum(p,o));const K=i?uv:pv;for(let e=0;e<D.length;e+=1){const t=D[e],{value:i,text:s,shape:a,size:o,style:r}=t,l=this.getTargetPoint(t),h=(0,n.ehJ)(t.rotation+K[t.placement]);I.push({series:this,itemId:`target-${e}`,midPoint:l,datum:{value:i},datumIndex:e+1,type:1,value:i,text:s,x:l.x,y:l.y,shape:a,size:o,rotation:h,label:this.getTargetLabel(t),style:r})}return{itemId:e,nodeData:w,tickData:k,targetData:I,labelData:A,scaleData:C}}findNodeDatum(e){return Ib(this,e)}updateSelections(e){(this.nodeDataRefresh||e)&&(this.contextNodeData=this.createNodeData(),this.nodeDataRefresh=!1)}highlightDatum(e){if(e?.series===this&&1===e.type)return e}update({seriesRect:e}){const{datumSelection:t,labelSelection:i,targetSelection:n,targetLabelSelection:s,scaleSelection:a,highlightTargetSelection:o,tickSelection:r}=this;this.seriesRect=e??iv.NaN;const l=this.checkResize(e);this.updateSelections(l),this.contentGroup.visible=this.visible,this.contentGroup.opacity=this.getOpacity();const h=this.contextNodeData?.nodeData??[],c=this.contextNodeData?.labelData??[],d=this.contextNodeData?.targetData??[],u=this.contextNodeData?.scaleData??[],p=this.contextNodeData?.tickData??[],g=this.highlightDatum(this.ctx.highlightManager.getActiveHighlight());this.scaleSelection=this.updateScaleSelection({scaleData:u,scaleSelection:a}),this.updateScaleNodes({scaleSelection:a}),this.targetSelection=this.updateTargetSelection({targetData:d,targetSelection:n}),this.updateTargetNodes({targetSelection:n,isHighlight:!1}),this.targetLabelSelection=this.updateTargetLabelSelection({targetData:d,targetLabelSelection:s}),this.updateTargetLabelNodes({targetLabelSelection:s}),this.datumSelection=this.updateDatumSelection({nodeData:h,datumSelection:t}),this.updateDatumNodes({datumSelection:t}),this.labelSelection=this.updateLabelSelection({labelData:c,labelSelection:i}),this.updateLabelNodes({labelSelection:i}),this.highlightTargetSelection=this.updateTargetSelection({targetData:null==g?[]:[g],targetSelection:o}),this.updateTargetNodes({targetSelection:o,isHighlight:!0}),this.tickSelection=this.updateTickSelection({tickData:p,tickSelection:r}),this.updateTickNodes({tickSelection:r}),l&&this.animationState.transition("resize"),this.animationState.transition("update")}updateDatumSelection(e){return e.datumSelection.update(e.nodeData,void 0,(t=>tv(e.nodeData.length,t.itemId)))}updateDatumNodes(e){const{datumSelection:t}=e,{ctx:i}=this,n=i.animationManager.isSkipped(),a=this.getShapeFillBBox();t.each(((e,t)=>{const{topLeftCornerRadius:i,topRightCornerRadius:o,bottomRightCornerRadius:r,bottomLeftCornerRadius:l}=t;e.setStyleProperties(t.style,a),e.topLeftCornerRadius=i,e.topRightCornerRadius=o,e.bottomRightCornerRadius=r,e.bottomLeftCornerRadius=l,e.pointerEvents=this.properties.bar.enabled?s.n1.PointerEvents.All:s.n1.PointerEvents.None,(n||null==e.previousDatum)&&e.setProperties(Yb(0,t))}));const{horizontal:o}=this;this.datumUnion.update(t,this.itemGroup,s.n1.Rect,((e,t,i)=>{const n=Math.min(t.x,i.x),a=Math.max(t.x+t.width,i.x+i.width),r=Math.min(t.y,i.y),l=a-n,h=Math.max(t.y+t.height,i.y+i.height)-r;e.pointerEvents=s.n1.PointerEvents.None,e.x=n,e.y=r,e.width=l,e.height=h,e.topLeftCornerRadius=o?t.topLeftCornerRadius:i.topLeftCornerRadius,e.topRightCornerRadius=i.topRightCornerRadius,e.bottomRightCornerRadius=o?i.bottomRightCornerRadius:t.bottomRightCornerRadius,e.bottomLeftCornerRadius=t.bottomLeftCornerRadius;const c=t.clipBBox,d=i.clipBBox??c;e.clipBBox=c&&d?iv.merge([c,d]).intersection(o?new iv(n,-1/0,l,1/0):new iv(-1/0,r,1/0,h)):void 0}))}updateScaleSelection(e){return e.scaleSelection.update(e.scaleData,void 0,(t=>tv(e.scaleData.length,t.itemId)))}updateScaleNodes(e){const{scaleSelection:t}=e,i=this.getShapeFillBBox();t.each(((e,t)=>{const{topLeftCornerRadius:n,topRightCornerRadius:s,bottomRightCornerRadius:a,bottomLeftCornerRadius:o}=t;e.setStyleProperties(t.style,i),e.setProperties(Yb(0,t)),e.topLeftCornerRadius=n,e.topRightCornerRadius=s,e.bottomRightCornerRadius=a,e.bottomLeftCornerRadius=o,e.setProperties(Yb(0,t))}))}updateTargetSelection(e){return e.targetSelection.update(e.targetData,void 0,(e=>e.itemId))}updateTargetNodes(e){const{targetSelection:t,isHighlight:i}=e;t.each(((e,t)=>{const{x:n,y:s,shape:a,size:o,rotation:r}=t,l=this.getTargetStyle(i,t);e.setStyleProperties(l),e.size=o,e.shape="line"===a?Mb:a,e.translationX=n,e.translationY=s,e.rotation=r}))}getTargetStyle(e,{datumIndex:t,style:i}){const s=this.getHighlightStyle(e,t),a=this.getSelectionStyle(t);return(0,n.HFk)(a,s,{...i,opacity:1})}updateTargetLabelSelection(e){return e.targetLabelSelection.update(e.targetData)}updateTargetLabelNodes(e){const{targetLabelSelection:t}=e;t.each(((e,t)=>{const{x:i,y:n,text:s}=t,{offsetX:a,offsetY:o,fill:r,fontStyle:l,fontWeight:h,fontSize:c,fontFamily:d,textAlign:u,textBaseline:p}=t.label;e.visible=!0,e.x=i+a,e.y=n+o,e.text=s,e.fill=r,e.fontStyle=l,e.fontWeight=h,e.fontSize=c,e.fontFamily=d,e.textAlign=u,e.textBaseline=p}))}updateTickSelection(e){return e.tickSelection.update(e.tickData,void 0,(e=>e.tickId))}updateTickNodes(e){const{gaugeRect:t,properties:i}=this,s=i.defaultScale,{enabled:a,color:o=s.label.color,fontFamily:r=s.label.fontFamily,fontSize:l=s.label.fontSize,fontStyle:h,fontWeight:c=s.label.fontWeight,spacing:d}=i.scale.label;let{placement:u}=i.scale.label;const p=(0,n.ehJ)(i.scale.label.rotation??0);let g,m,y,f;this.horizontal?(u??(u="after"),g="center",m="before"===u?"bottom":"top",f=this.originY+t.y+("before"===u?-d:t.height+d)):(u??(u="before"),g="before"===u?"end":"start",m="middle",y=this.originX+t.x+("before"===u?-d:t.width+d)),e.tickSelection.each(((e,t)=>{if(!a)return void(e.visible=!1);const i=y??t.translation,n=f??t.translation;e.visible=!0,e.text=t.tickLabel,e.fill=o,e.fontFamily=r,e.fontSize=l,e.fontStyle=h,e.fontWeight=c,e.textBaseline=m,e.textAlign=g,e.x=i,e.y=n,e.rotationCenterX=i,e.rotationCenterY=n,e.rotation=p}))}updateLabelSelection(e){return e.labelSelection.update(e.labelData,void 0,(e=>"primary"))}updateLabelNodes(e){const{labelSelection:t}=e,i=this.ctx.animationManager.isSkipped();t.each(((e,t)=>{e.fill=t.fill,e.fontStyle=t.fontStyle,e.fontWeight=t.fontWeight,e.fontFamily=t.fontFamily})),(i||this.labelsHaveExplicitText())&&this.formatLabelText()}labelsHaveExplicitText(){for(const{datum:e}of this.labelSelection)if(null==e.text)return!1;return!0}formatLabelText(e){const{labelSelection:t,horizontal:i,scale:s,seriesRect:a,gaugeRect:o}=this,{x:r,y:l,width:h,height:c}=o,d=e?.label??this.properties.value;let u;if(i){const e=s.convert(d);
1u=new iv(r,l,e-r,c)}else{const e=s.convert(d);u=new iv(r,e,h,c-e)}const p={seriesRect:a,gaugeRect:o,barRect:u},{margin:g}=this.properties;!function(e,t,i,s,a,o){const{seriesRect:r,gaugeRect:l,barRect:h}=a,{padding:c,horizontal:d}=s;i.each(((i,s)=>{const a=vb(e.id,t,s,o?.label);let u,p,g;if("outside-start"===s.placement?d?(u=l.x,p=r.height):(u=r.width,p=r.height-(l.y+l.height)):"outside-end"===s.placement?d?(u=r.width-(l.x+l.width),p=r.height):(u=r.width,p=l.y):s.avoidCollisions&&(u=l.width,p=l.height),null==a)return;if(null!=u&&null!=p){const e=u,t=p,i=()=>({width:e,height:t,meta:null}),o=jl((0,n.boc)(a),s,{padding:c},i);g=o?.[0]}else{const e=(0,n.K$y)(s),{width:t,height:i}=(0,n.cyL)(a)?(0,n.wEO)(a,s):e.measureLines((0,n.i$)(a));g={text:a,fontSize:s.fontSize,lineHeight:s.lineHeight??e.lineHeight(),width:t,height:i}}if(null==g)return void(i.visible=!1);const m=d?l.x:l.y+l.height,y=d?l.x+l.width:l.y,f=d?h.x:h.y+h.height,x=d?h.x+h.width:h.y,b=s.spacing*(d?1:-1);let v,S,M,k;switch(s.placement){case"outside-start":v=-1/0,S=1/0,M=m-b,k="Before";break;case"outside-end":v=-1/0,S=1/0,M=y+b,k="After";break;case"inside-start":v=m,S=x,M=m+b,k="After";break;case"inside-end":v=x,S=y,M=y-b,k="Before";break;case"inside-center":v=m,S=y,M=(m+y)/2,k="Center";break;case"bar-inside":v=f,S=x,M=(f+x)/2,k="Center";break;case"bar-inside-end":v=f,S=x,M=x-b,k="Before";break;case"bar-outside-end":v=x,S=y,M=x+b,k="After";break;case"bar-end":v=-1/0,S=1/0,M=x,k="Center"}const D=d?M:l.x+l.width/2,w=d?l.y+l.height/2:M;let I,A;d?(I=D+Zb[k]*g.width,A=I+g.width):(I=w+qb[k]*g.height,A=I+g.height);const C=Math.min(I,A)>=Math.min(v,S)&&Math.max(I,A)<=Math.max(v,S);!s.avoidCollisions||C?(i.visible=!0,i.text=g.text,i.fontSize=g.fontSize,i.lineHeight=g.lineHeight,i.textAlign=d?Ub[k]:"center",i.textBaseline=d?"middle":Xb[k],i.x=D,i.y=w):i.visible=!1}))}(this,this.ctx,t,{padding:g,horizontal:i},p,e)}resetAllAnimation(){this.ctx.animationManager.stopByAnimationGroupId(this.id),Jb([this.datumSelection],Yb),this.formatLabelText()}
1resetAnimation(e){"initial"===e?this.animationState.transition("reset"):"ready"===e&&this.animationState.transition("skip")}animateLabelText(e={}){const{animationManager:t}=this.ctx;let i=0,s=0;if(this.labelSelection.each(((t,n)=>{t.opacity=1,i=t.previousDatum?.value??e.from??n.value,s=n.value})),this.labelsHaveExplicitText());else if(Number(i)===Number(s))this.formatLabelText({label:s});else{const a=`${this.id}_labels`;t.animate({id:a,groupId:"label",from:{label:Number(i)},to:{label:Number(s)},phase:e.phase??"update",ease:n.vTE,onUpdate:e=>this.formatLabelText(e),onStop:()=>this.formatLabelText({label:s})})}}animateEmptyUpdateReady(){const{animationManager:e}=this.ctx,{node:t}=Kb(!0,this.horizontal);Qb(this.id,"node",e,[this.datumSelection],t,(e=>e.unsafeDatum.itemId)),Qb(this.id,"label",e,[this.labelSelection],xb,(()=>"primary")),this.animateLabelText({from:0,phase:"initial"})}animateWaitingUpdateReady(){const{animationManager:e}=this.ctx,{node:t}=Kb(!1,this.horizontal);Qb(this.id,"node",e,[this.datumSelection],t,(e=>e.unsafeDatum.itemId)),this.animateLabelText()}animateReadyResize(){this.resetAllAnimation()}getSeriesDomain(){return{domain:[0,1]}}dataCount(){return Number.NaN}getSeriesRange(){return[Number.NaN,Number.NaN]}getLegendData(){return[]}getTooltipContent(e){const{id:t,properties:i}=this,{tooltip:n}=i;if(null==e)return;const{value:s,text:a,fallbackLabel:o}=fb(this,e);return null!=s?this.formatTooltipWithContext(n,{data:[{label:a,fallbackLabel:o,value:this.formatLabel(s)}]},{seriesId:t,title:void 0,datum:void 0,value:s}):void 0}pickNodeClosestDatum(e){return Db(this,e)}pickFocus(e){return wb(this,e)}getCaptionText(){return this.formatLabel(this.properties.value)}getCategoryValue(e){}datumIndexForCategoryValue(e){}hasItemStylers(){return this.properties.selection.enabled||null!=this.properties.label.itemStyler}};return e.className="LinearGaugeSeries",e.type="linear-gauge",e})(),mv=(()=>({minWidth:200,minHeight:200,tooltip:{enabled:!1},series:{thickness:50,scale:{stroke:{$path:["/2",n.HHJ,{$palette:"hierarchyColors"}]},strokeWidth:{$isUserOption:["./stroke",2,0]},label:{spacing:11},...(0,n.fs4)({defaultFill:{$path:["/1",{$palette:"fill"},{$palette:"hierarchyColors"}]}})},bar:{strokeWidth:{$isUserOption:["./stroke",2,0]}},segmentation:{enabled:!1,interval:{},spacing:1},label:{...n.mgV,enabled:!1,placement:"inside-start",fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},fontSize:{$rem:2},minimumFontSize:n.SG9.SMALL,spacing:18,color:{$ref:"chartBackgroundColor"}},tooltip:{range:{$path:["/tooltip/range",10]}},selection:n.zg6,...(0,n.fs4)({defaultColorRange:{$if:[{$eq:[{$palette:"type"},"inbuilt"]},{$interpolate:[{$palette:"secondDivergingColors"},5]},n.Mg2]},defaultTarget:{fill:{$ref:"foregroundColor"},stroke:{$ref:"foregroundColor"},size:10,shape:"triangle",placement:"after",spacing:5,label:{enabled:!0,fontWeight:{$ref:"fontWeight"},fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},color:{$ref:"textColor"},spacing:5}},defaultScale:{label:{fontWeight:{$ref:"fontWeight"},fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},color:{$ref:"textColor"}}},margin:4})}}))(),yv={type:"series",name:"linear-gauge",chartType:"standalone",enterprise:!0,dependencies:[mb],version:s.xv,options:n.BbD,themeTemplate:mv,create:e=>new gv(e)},{Chart:fv,MercatorScale:xv}=s.n1;function bv(e){return"map-shape"===e.type||"map-line"===e.type||"map-marker"===e.type||"map-shape-background"===e.type||"map-line-background"===e.type}var vv=(()=>{var e=class extends fv{constructor(e,t){super(e,t),this.xAxis={id:(0,n.sX_)(s.n1.Axis),direction:n.tv$.X},this.yAxis={id:(0,n.sX_)(s.n1.Axis),direction:n.tv$.Y},this.ctx.zoomManager&&(this.ctx.zoomManager.setAxes([this.xAxis,this.yAxis]),this.ctx.zoomManager.panToBBoxScalingMode=s.n1.PanToBBoxScalingModeEnum.WhenViewportTooSmallScaleXYProportionally)}toAgCoordinates(e){}getChartType(){return"topology"}updateData(){super.updateData();const e=this.getOptions();this.topology!==e.topology&&(this.topology=e.topology);const{topology:t}=this;for(const e of this.series)bv(e)&&e.setChartTopology(t)}performLayout(e){const{seriesRoot:t,annotationRoot:i}=this,n=e.layoutBox.clone().shrink(this.seriesArea.getPadding());this.seriesRect=n,this.animationRect=n;const s=this.series,a=s.reduce(((e,t)=>{if(!t.visible)return e;const i=t.topologyBounds;return null==i?e:null==e?i:e.merge(i)}),void 0);let o;if(null!=a){const{lon0:e,lat0:t,lon1:i,lat1:s}=a,r=[[e,t],[i,s]],l=xv.bounds(r),{width:h,height:c}=n,d=Math.min(h/l.width,c/l.height),u=l.width*d,p=l.height*d,g=(h-u)/2,m=(c-p)/2,y=g,f=m,x=g+u,b=m+p,v=this.ctx.chartState.getValue("zoom"),S=v?.x??{min:0,max:1},M=v?.y??{min:0,max:1},k=(x-y)/(S.max-S.min),D=y-k*S.min,w=(b-f)/(1-M.min-(1-M.max)),I=f-w*(1-M.max);o=new xv(r,[[D,I],[D+k,I+w]])}for(const e of s)e.scale=o;const r=this.series.some((e=>e.visible));t.visible=r;
1for(const e of[t,i])e.translationX=Math.floor(n.x),e.translationY=Math.floor(n.y),e.setClipRect(n.clone());this.ctx.layoutManager.emitLayoutComplete(e,{series:{visible:r,rect:n,paddedRect:e.layoutBox},layoutBox:e.layoutBox})}hasPgUpPgDownSupport(){return!1}};return e.className="TopologyChart",e.type="topology",l([n.mAP],e.prototype,"topology",2),e})(),{topologyChartOptionsDefs:Sv,commonChartThemeTemplate:Mv}=s.n1,kv={type:"chart",name:"topology",enterprise:!0,version:s.xv,options:Sv,themeTemplate:Mv,create:(e,t)=>new vv(e,t)},Dv=(()=>({zoom:{axes:"xy",anchorPointX:"pointer",anchorPointY:"pointer",buttons:{...(0,n.fs4)({anchorPointX:"middle",anchorPointY:"middle"})}},legend:{enabled:!1}}))();function wv(e){const t=(0,n.Go6)(e);return(0,n.mfG)(t,(e=>{"object"==typeof e&&"$palette"in e&&(e.$mapPalette=e.$palette,delete e.$palette)})),t}function Iv(e,t,i,n){const[s,a]=e,[o,r]=t,l=o-s,h=r-a,c=l*l+h*h;let d,u;if(Math.abs(c)<1e-9)d=s,u=a;else{let e=((i-s)*l+(n-a)*h)/c;e=Math.max(0,Math.min(1,e)),d=s+e*(o-s),u=a+e*(r-a)}const p=i-d,g=n-u;return p*p+g*g}function Av(e,t,i){let n=1/0,s=e.at(-1);for(const a of e)n=Math.min(n,Iv(s,a,t,i)),s=a;return Math.sqrt(n)}function Cv(e){let[t,i]=e[0],n=0;for(let s=1;s<e.length;s+=1){const[a,o]=e[s];n+=Math.hypot(a-t,o-i),t=a,i=o}return n}function Nv(e){if(0===e.length)return;const t=Cv(e)/2;let[i,n]=e[0],s=0;for(let a=1;a<e.length;a+=1){const[o,r]=e[a],l=Math.hypot(o-i,r-n),h=s+l;if(h>t){const e=(t-s)/l;return{point:[i+(o-i)*e,n+(r-n)*e],angle:Math.atan2(r-n,o-i)}}s=h,i=o,n=r}}var Lv=class e{constructor(e,t,i,n){this.lon0=e,this.lat0=t,this.lon1=i,this.lat1=n}extend(e,t,i,n){return this.lon0=Math.min(this.lon0,e),this.lat0=Math.min(this.lat0,t),this.lon1=Math.max(this.lon1,i),this.lat1=Math.max(this.lat1,n),this}merge(e){return this.extend(e.lon0,e.lat0,e.lon1,e.lat1)}static extend(t,i,n,s,a){return t?t.extend(i,n,s,a):new e(i,n,s,a)}};function Pv(e,t){for(const i of e){const[e,n]=i;t=Lv.extend(t,e,n,e,n)}return t}function Tv(e,t,i){let n=!1,s=1/0;for(const a of e){let e=a.at(-1),[o,r]=e;for(const l of a){const[a,h]=l;h>i!=r>i&&t<(o-a)*(i-h)/(r-h)+a&&(n=!n),s=Math.min(s,Iv(e,l,t,i)),e=l,o=a,r=h}}return(n?-1:1)*Math.sqrt(s)}var{Path:Ov,ExtendedPath2D:Rv,BBox:Ev}=s.n1,zv=(()=>{var e=class extends Ov{constructor(){super(...arguments),this.projectedGeometry=void 0,this.renderMode=3,this.strokePath=new Rv}computeBBox(){return(this.dirtyPath||this.isDirtyPath())&&(this.updatePath(),this.dirtyPath=!1),this.bbox?.clone()}updatePath(){const{projectedGeometry:e}=this;this.strokePath.clear(),this.path.clear(),this.bbox=null==e?void 0:this.drawGeometry(e,void 0)}drawPath(e,t){super.drawPath(e,t),this.renderStroke(e,this.strokePath.getPath2D())}containsPoint(e,t){const{projectedGeometry:i}=this;return null!=i&&(!!this.getBBox().containsPoint(e,t)&&this.geometryDistance(i,e,t)<=0)}distanceSquared(e,t){const{projectedGeometry:i}=this;if(null==i)return 1/0;const n=this.geometryDistance(i,e,t);return n>0?n*n:0}geometryDistance(e,t,i){const{renderMode:n,strokeWidth:s}=this,a=!!(1&n),o=!!(2&n),r=Math.max(s/2,1)+1;switch(e.type){case"GeometryCollection":return e.geometries.reduce(((e,n)=>Math.min(e,this.geometryDistance(n,t,i))),1/0);case"MultiPolygon":return a?e.coordinates.reduce(((e,n)=>Math.min(e,Math.max(Tv(n,t,i),0))),1/0):1/0;case"Polygon":return a?Math.max(Tv(e.coordinates,t,i),0):1/0;case"MultiLineString":return o?e.coordinates.reduce(((e,n)=>Math.min(e,Math.max(Av(n,t,i)-r,0))),1/0):1/0;case"LineString":return o?Math.max(Av(e.coordinates,t,i)-r,0):1/0;default:return 1/0}}shouldDrawPolygons(){return!!(1&this.renderMode)}shouldDrawLines(){return!!(2&this.renderMode)}drawGeometryCollection(e,t){for(const i of e)t=this.drawGeometry(i,t);return t}drawMultiPolygon(e,t){if(!this.shouldDrawPolygons())return t;for(const i of e)t=this.drawPolygon(this.path,i,t);return t}drawSinglePolygon(e,t){return this.shouldDrawPolygons()?this.drawPolygon(this.path,e,t):t}drawMultiLineString(e,t){if(!this.shouldDrawLines())return t;for(const i of e)t=this.drawLineString(this.strokePath,i,t,!1);return t}drawSingleLineString(e,t){return this.shouldDrawLines()?this.drawLineString(this.strokePath,e,t,!1):t}drawGeometry(e,t){switch(e.type){case"GeometryCollection":return this.drawGeometryCollection(e.geometries,t);case"MultiPolygon":return this.drawMultiPolygon(e.coordinates,t);case"Polygon":return this.drawSinglePolygon(e.coordinates,t);case"MultiLineString":return this.drawMultiLineString(e.coordinates,t);case"LineString":return this.drawSingleLineString(e.coordinates,t);case"Point":case"MultiPoint":return t}}drawPolygon(e,t,i){if(t.length<1)return i;i=this.drawLineString(e,t[0],i,!0);for(let i=1;i<t.length;i+=1){const n=t[i];this.drawLineString(e,n,void 0,!0)}return i}drawLineString(e,t,i,n){if(t.length<2)return i;const s=n?t.length-1:t.length;for(let n=0;n<s;n+=1){const[s,a]=t[n];if(0===n?e.moveTo(s,a):e.lineTo(s,a),null==i)i=new Ev(s,a,0,0);else{const{x:e,y:t}=i,n=e+i.width,o=t+i.height;i.x=Math.min(e,s),i.y=Math.min(t,a),i.width=Math.max(n,s)-i.x,i.height=Math.max(o,a)-i.y}}return n&&e.closePath(),i}};return l([(0,n.Tou)({equals:n.DH9})],e.prototype,"projectedGeometry",2),l([(0,n.k8u)()],e.prototype,"renderMode",2),e})();function Bv(e){const t=Pv(e[0],void 0);return null==t?0:Math.abs(t.lat1-t.lat0)*Math.abs(t.lon1-t.lon0)}function Fv(e,t){let i,n;for(const s of e){const e=t(s);null!=e&&((null==i||e>i)&&(i=e,n=s))}return n}function Vv(e,t){if(null!=e.bbox){const[i,n,s,a]=e.bbox;return t=Lv.extend(t,i,n,s,a)}switch(e.type){case"GeometryCollection":for(const i of e.geometries)t=Vv(i,t);break;case"MultiPolygon":for(const i of e.coordinates)i.length>0&&(t=Pv(i[0],t));break;
1case"Polygon":e.coordinates.length>0&&(t=Pv(e.coordinates[0],t));break;case"MultiLineString":for(const i of e.coordinates)t=Pv(i,t);break;case"LineString":t=Pv(e.coordinates,t);break;case"MultiPoint":for(const i of e.coordinates){const[e,n]=i;t=Lv.extend(t,e,n,e,n)}break;case"Point":{const[i,n]=e.coordinates;t=Lv.extend(t,i,n,i,n);break}}return t}function $v(e){switch(e.type){case"Polygon":return e.coordinates;case"MultiPolygon":return Fv(e.coordinates,Bv);case"GeometryCollection":return Fv(e.geometries.map($v).filter((e=>null!=e)),Bv);case"MultiLineString":case"LineString":case"MultiPoint":case"Point":return}}function Hv(e){switch(e.type){case"LineString":return e.coordinates;case"MultiLineString":return Fv(e.coordinates,Cv);case"GeometryCollection":return Fv(e.geometries.map(Hv).filter((e=>null!=e)),Cv);case"MultiPolygon":case"Polygon":case"MultiPoint":case"Point":return}}function jv(e,t){if(null==e)return!1;switch(e.type){case"GeometryCollection":return e.geometries.some((e=>jv(e,t)));case"MultiPolygon":case"Polygon":return!!(1&t);case"MultiLineString":case"LineString":return!!(2&t);case"MultiPoint":case"Point":return!!(4&t)}}function Wv(e,t){switch(e.type){case"GeometryCollection":return{type:"GeometryCollection",geometries:e.geometries.map((e=>Wv(e,t)))};case"Polygon":return{type:"Polygon",coordinates:Gv(e.coordinates,t)};case"MultiPolygon":return{type:"MultiPolygon",coordinates:_v(e.coordinates,t)};case"MultiLineString":return{type:"MultiLineString",coordinates:Gv(e.coordinates,t)};case"LineString":return{type:"LineString",coordinates:Kv(e.coordinates,t)};case"MultiPoint":return{type:"MultiPoint",coordinates:Kv(e.coordinates,t)};case"Point":return{type:"Point",coordinates:t.convert(e.coordinates)}}}function _v(e,t){return e.map((e=>Gv(e,t)))}function Gv(e,t){return e.map((e=>Kv(e,t)))}function Kv(e,t){return e.map((e=>t.convert(e)))}function Yv(e,t){const i=e.contextNodeData?.nodeData[t.datumIndex];if(void 0!==i)for(const t of e.datumSelection.nodes())if(t.datum===i)return t}s.n1.SeriesProperties;var Uv=class extends s.n1.DataModelSeries{constructor(e){super(e),this.cleanup.register(this.ctx.eventsHub.on("data:update",(()=>{})),this.ctx.eventsHub.on("legend:item-click",(e=>{this.onLegendItemClick(e)})),this.ctx.eventsHub.on("legend:item-double-click",(e=>{this.onLegendItemDoubleClick(e)})))}getSeriesDomain(){return{domain:[Number.NaN,Number.NaN]}}getSeriesRange(){return[Number.NaN,Number.NaN]}getHighlightedDatum(){if(!this.properties.highlight.enabled)return;let e=this.ctx.highlightManager?.getActiveHighlight();const{legendItemName:t}=this.properties,i=null!=t&&null==e?.datum&&t===e?.legendItemName;return null==e||(e.series===this||i)&&null!=e.datum||(e=void 0),e}isSeriesHighlighted(e){if(!this.properties.highlight.enabled)return!1;const{series:t,legendItemName:i}=e??{},{legendItemName:n}=this.properties;return t===this||null!=n&&n===i}},{ColorScaleProperties:Xv,SeriesProperties:Zv,makeSeriesTooltip:qv,Label:Qv}=s.n1,Jv=(()=>{var e=class extends Zv{constructor(){super(...arguments),this.topology=void 0,this.idKey="",this.topologyIdKey="name",this.idName=void 0,this.labelKey=void 0,this.labelName=void 0,this.colorScale=new Xv,this.minStrokeWidth=void 0,this.maxStrokeWidth=void 0,this.stroke="black",this.strokeOpacity=1,this.strokeWidth=0,this.lineDash=[0],this.lineDashOffset=0,this.label=new Qv,this.tooltip=qv()}getStyle(){const{stroke:e,strokeOpacity:t,strokeWidth:i,lineDash:n,lineDashOffset:s}=this;return{stroke:e,strokeOpacity:t,strokeWidth:i,lineDash:n,lineDashOffset:s,opacity:1}}};return l([n.mAP],e.prototype,"topology",2),l([n.mAP],e.prototype,"title",2),l([n.mAP],e.prototype,"legendItemName",2),l([n.mAP],e.prototype,"idKey",2),l([n.mAP],e.prototype,"topologyIdKey",2),l([n.mAP],e.prototype,"idName",2),l([n.mAP],e.prototype,"labelKey",2),l([n.mAP],e.prototype,"labelName",2),l([n.mAP],e.prototype,"sizeKey",2),l([n.mAP],e.prototype,"sizeName",2),l([n.mAP],e.prototype,"colorKey",2),l([n.mAP],e.prototype,"colorName",2),l([n.mAP],e.prototype,"sizeDomain",2),l([n.mAP],e.prototype,"colorScale",2),l([n.mAP],e.prototype,"minStrokeWidth",2),l([n.mAP],e.prototype,"maxStrokeWidth",2),l([n.mAP],e.prototype,"stroke",2),l([n.mAP],e.prototype,"strokeOpacity",2),l([n.mAP],e.prototype,"strokeWidth",2),l([n.mAP],e.prototype,"lineDash",2),l([n.mAP],e.prototype,"lineDashOffset",2),l([n.mAP],e.prototype,"itemStyler",2),l([n.mAP],e.prototype,"label",2),l([n.mAP],e.prototype,"tooltip",2),e})(),{getMissCount:eS,getLabelStyles:tS,expandLabelBoxExtent:iS,buildColorCategoryLegendData:nS,buildGradientLegendDatum:sS,colorScaleLegendFormatterContext:aS,configureColorScale:oS,createDatumId:rS,SeriesNodePickMode:lS,valueProperty:hS,ColorScale:cS,LinearScale:dS,Selection:uS,Text:pS,Transformable:gS}=s.n1,mS=(()=>{var e=class extends Uv{constructor(e){super({moduleCtx:e,categoryKey:void 0,propertyKeys:{size:["colorKey"],color:["colorKey"],label:["labelKey"]},propertyNames:{size:["sizeName"],color:["colorName"],label:["labelName"]},pickModes:[lS.EXACT_SHAPE_MATCH,lS.NEAREST_NODE],usesPlacedLabels:!0}),this.properties=new Jv,this._chartTopology=void 0,this.colorScale=new cS,this.sizeScale=new dS,this.datumSelection=uS.select(this.contentGroup,(()=>this.nodeFactory())),this.labelSelection=uS.select(this.labelGroup,pS),this.highlightDatumSelection=uS.select(this.highlightNodeGroup,(()=>this.nodeFactory())),this.highlightLabelSelection=uS.select(this.highlightLabelGroup,pS),this.placedLabelData=[],this._previousDatumMidPoint=void 0}getNodeData(){return this.contextNodeData?.nodeData}get topology(){return this.properties.topology??this._chartTopology}get hasData(){return super.hasData&&null!=this.topology}renderToOffscreenCanvas(){return!0}setZIndex(e){return super.setZIndex(e),this.contentGroup.zIndex=[1,e],this.highlightGroup.zIndex=[4,e],!0}setChartTopology(e){this._chartTopology=e,this.topology===e&&(this.nodeDataRefresh=!0)}isLabelEnabled(){return null!=this.properties.labelKey&&this.properties.label.enabled}nodeFactory(){const e=new zv;return e.renderMode=2,e.lineJoin="round",e.lineCap="round",e}async processData(e){if(null==this.data)return;const{data:t,topology:i,sizeScale:n,colorScale:s}=this,{topologyIdKey:a,idKey:o,sizeKey:r,colorKey:l,labelKey:h,sizeDomain:c}=this.properties,d=new Map;for(const e of i?.features.values()??[]){const t=e.properties?.[a];null!=t&&jv(e.geometry,2)&&d.set(t,e)}const u=this.sizeScale.type,p=this.colorScale.type,g=this.scale?.type,{dataModel:m,processedData:y}=await this.requestDataModel(e,t,{props:[hS(o,g,{id:"idValue",includeProperty:!1}),hS(o,g,{id:"featureValue",includeProperty:!1,processor:()=>e=>d.get(e)}),...null==h?[]:[hS(h,"category",{id:"labelValue"})],...null==r?[]:[hS(r,u,{id:"sizeValue"})],...null==l?[]:[hS(l,p,{id:"colorValue",invalidValue:void 0})]]}
1),f=m.resolveColumnById(this,"featureValue",y,"object");if(this.topologyBounds=f.reduce(((e,t)=>{const i=t?.geometry;return null==i?e:Vv(i,e)}),void 0),null!=r){const e=m.resolveProcessedDataIndexById(this,"sizeValue"),t=y.domain.values[e]??[];n.domain=c??t}if(this.isColorScaleValid()){const e=m.resolveProcessedDataIndexById(this,"colorValue"),t=y.domain.values[e];oS(s,this.properties.colorScale,t,this.ctx.logger)}null==i&&this.ctx.logger.warnOnce("no topology was provided for [MapLineSeries]; nothing will be rendered.")}isColorScaleValid(){const{colorKey:e}=this.properties;if(!e)return!1;const{dataModel:t,processedData:i}=this;if(!t||!i)return!1;const n=t.resolveProcessedDataIndexById(this,"colorValue"),s=i.input.count,a=eS(this,i.defs.values[n].missing);return!(0===s||s===a)}getLabelDatum(e,t,i,s,a,o,r,l){if(null==s||null==a||null==i)return;const h=Hv(a);if(null==h)return;const{idKey:c,idName:d,sizeKey:u,sizeName:p,colorKey:g,colorName:m,labelKey:y,labelName:f,label:x}=this.properties;if(null==y||!x.enabled||!l.enabled)return;const b=this.getLabelText(s,e,y,"label",[],x,{value:s,datum:e,idKey:c,idName:d,sizeKey:u,sizeName:p,colorKey:g,colorName:m,labelKey:y,labelName:f});if(null==b)return;const v=(0,n.HRu)(b,r,l),S=Nv(h);if(null==S)return;const[M,k]=S.point,D=o.measureLines(String(v)),w=iS(l);return{point:{x:M,y:k,size:0},label:{width:D.width+w.left+w.right,height:D.height+w.top+w.bottom,text:v},anchor:void 0,placement:void 0,datumIndex:t,idValue:i}}resolveColumn(e,t,i,n){if(null!=e&&null!=this.dataModel)return this.dataModel.resolveColumnById(this,t,i,n)}resolveLineDataColumns(e){const{sizeKey:t,colorKey:i,labelKey:n}=this.properties;return{idValues:this.dataModel.resolveColumnById(this,"idValue",e,"string"),featureValues:this.dataModel.resolveColumnById(this,"featureValue",e,"object"),labelValues:this.resolveColumn(n,"labelValue",e,"object"),sizeValues:this.resolveColumn(t,"sizeValue",e,"number"),colorValues:this.resolveColumn(i,"colorValue",e,"number")}}prepareProjectedLineGeometries(e,t,i){const n=new Map;for(const[s]of i.dataSources.get(this.id)?.data.entries()??[]){const i=e[s],a=t[s]?.geometry,o=null!=a&&null!=this.scale?Wv(a,this.scale):void 0;null!=i&&null!=o&&n.set(i,o)}return n}warnMissingGeometries(e){if(0===e.length)return;if(e.length>10){const t=e.length-10;e.length=10,e.push(`(+${t} more)`)}this.ctx.logger.warnOnce("some data items do not have matches in the provided topology",e)}createNodeData(){const{id:e,dataModel:t,processedData:i,sizeScale:s,properties:a}=this,{label:o,legendItemName:r}=a;if(null==t||null==i)return;if(!this.visible)return{itemId:e,nodeData:[],labelData:[]};const l=this.resolveLineDataColumns(i),h=a.minStrokeWidth??a.strokeWidth,c=a.maxStrokeWidth??a.strokeWidth;s.range=[h,Math.max(h,c)];const d=tS(this,void 0,a,o,!1,void 0),u=(0,n.K$y)(d),p=(0,n.A_g)(o,!o.collision.alwaysShow),g=this.prepareProjectedLineGeometries(l.idValues,l.featureValues,i),m=[],y=[],f=[],x=i.dataSources.get(this.id)?.data??[];for(const[e,t]of x.entries()){const i={idValue:l.idValues[e],colorValue:l.colorValues?.[e],sizeValue:l.sizeValues?.[e],labelValue:l.labelValues?.[e]},n=g.get(i.idValue);null==n&&f.push(i.idValue);const s=this.getLabelDatum(t,e,i.idValue,i.labelValue,n,u,p,d);null!=s&&y.push(s),m.push({series:this,datum:t,datumIndex:e,...i,projectedGeometry:n,legendItemName:r,style:this.getItemStyle({datumIndex:e,datum:t,colorValue:i.colorValue,sizeValue:i.sizeValue},!1)})}return this.warnMissingGeometries(f),{itemId:e,nodeData:m,labelData:y}}updateSelections(){this.nodeDataRefresh&&(this.contextNodeData=this.createNodeData(),this.nodeDataRefresh=!1)}update(){const{datumSelection:e,highlightDatumSelection:t}=this;this.updateSelections(),this.contentGroup.visible=this.visible,this.labelGroup.visible=this.visible;const i=this.ctx.chartService.highlight?.drawingMode??"overlay",n=this.getHighlightedDatum(),s=this.contextNodeData?.nodeData??[];this.datumSelection=this.updateDatumSelection({nodeData:s,datumSelection:e}),this.updateDatumStyles({datumSelection:e,isHighlight:!1}),this.updateDatumNodes({datumSelection:e,isHighlight:!1,drawingMode:"overlay"}),this.highlightDatumSelection=this.updateDatumSelection({nodeData:null==n?[]:[n],datumSelection:t}),this.updateDatumStyles({datumSelection:t,isHighlight:!0}),this.updateDatumNodes({datumSelection:t,isHighlight:!0,drawingMode:i}),this.updateLabelNodes({labelSelection:this.labelSelection,isHighlight:!1}),this.updateHighlightLabelSelection(n)}updateDatumSelection(e){return e.datumSelection.update(e.nodeData,void 0,(e=>rS(e.idValue)))}
1getItemStyle({datumIndex:e=0,datum:t,colorValue:i,sizeValue:s},a){const{properties:o,colorScale:r,sizeScale:l}=this,{colorKey:h,colorScale:c,itemStyler:d}=o,{missingDataFill:u}=c,p=o.getStyle();null!=i?p.stroke=this.isColorScaleValid()?r.convert(i):c.fills[0]?.color??o.stroke:null!=h&&null!=u&&(p.stroke=u);const g=this.getHighlightStyle(a,e),m=this.getSelectionStyle(e),y=(0,n.HFk)(m,g,p);let f;return null!=s&&(y.strokeWidth=l.convertClamped(s)),null!=d&&(f=this.cachedDatumCallback(rS(e,a?"highlight":"node"),(()=>{const i=this.makeItemStylerParams(t,e,a,y);return this.ctx.optionsGraphService.resolvePartial(["series",`${this.declarationOrder}`],this.callWithContext(d,i))}))),f?(0,n.HFk)(y,f):y}makeItemStylerParams(e,t,i,n){const{id:s}=this,{sizeKey:a,idKey:o,labelKey:r,colorKey:l}=this.properties,h=this.ctx.highlightManager?.getActiveHighlight();return{seriesId:s,sizeKey:a,idKey:o,labelKey:r,colorKey:l,datum:e,highlightState:this.getHighlightStateString(h,i,t),selectionState:this.getSelectionStateString(t),candidateState:this.getCandidateStateString(t),...n}}updateDatumStyles({datumSelection:e,isHighlight:t}){e.each(((e,i)=>{i.style=this.getItemStyle(i,t)}))}updateDatumNodes({datumSelection:e,drawingMode:t}){e.each(((e,i)=>{const{projectedGeometry:n,style:s}=i;if(null==n)return e.visible=!1,void(e.projectedGeometry=void 0);e.visible=!0,e.projectedGeometry=n,e.setProperties(s),e.drawingMode=t}))}updatePlacedLabelData(e){this.placedLabelData=e,this.labelSelection=this.labelSelection.update(e,(e=>{e.pointerEvents=s.n1.PointerEvents.None})),this.updateLabelNodes({labelSelection:this.labelSelection,isHighlight:!1}),this.updateHighlightLabelSelection()}updateLabelNodes({isHighlight:e,labelSelection:t}){const{properties:i}=this,n=this.getHighlightedDatum();t.each(((t,s)=>{const{x:a,y:o,width:r,height:l,text:h,datum:c}=s,d=tS(this,void 0,i,i.label,e,n);if(!d.enabled)return void(t.visible=!1);const{color:u,fontStyle:p,fontWeight:g,fontSize:m,fontFamily:y}=d;t.visible=!0,t.x=a+r/2,t.y=o+l/2,t.text=h,t.fill=u,t.fontStyle=p,t.fontWeight=g,t.fontSize=m,t.fontFamily=y,t.textAlign="center",t.textBaseline="middle";const f=c?.datumIndex;t.fillOpacity=this.getHighlightStyle(e,f).opacity??1,t.setBoxing(d)}))}updateHighlightLabelSelection(e=this.getHighlightedDatum()){const t=e?.idValue,i=null!=t&&this.isLabelEnabled()?this.placedLabelData.filter((e=>e.datum.idValue===t)):[];this.highlightLabelSelection=this.highlightLabelSelection.update(i),0===i.length&&this.highlightLabelSelection.cleanup(),this.updateLabelNodes({labelSelection:this.highlightLabelSelection,isHighlight:!0})}resetAnimation(){}getLabelData(){return this.isLabelEnabled()?this.contextNodeData?.labelData??[]:[]}getLabelDefaults(){return(0,n.wSY)(this.properties.label.collision)}pickNodeClosestDatum({x:e,y:t}){let i,n,s=1/0;return this.datumSelection.each(((a,o)=>{const r=a.distanceSquared(e,t);r<s&&(s=r,i=o,n=a)})),null==i||null==n?void 0:{datum:i,distance:Math.sqrt(s),target:n}}datumMidPoint(e){const{_previousDatumMidPoint:t}=this;if(t?.datum===e)return t.point;const i=e.projectedGeometry,n=null==i?void 0:Hv(i),s=null==n?void 0:Nv(n)?.point,a=null==s?void 0:{x:s[0],y:s[1]};return this._previousDatumMidPoint={datum:e,point:a},a}legendItemSymbol(e){const{dataModel:t,processedData:i,properties:n}=this,{colorKey:s,strokeWidth:a,strokeOpacity:o,lineDash:r}=n,{missingDataFill:l}=n.colorScale;let{stroke:h}=n;if(null!=e&&this.isColorScaleValid()){const n=t.resolveColumnById(this,"colorValue",i,"mixed-numeric")[e];null!=n?h=this.colorScale.convert(n):null!=s&&null!=l&&(h=l)}return{marker:{fill:void 0,fillOpacity:0,stroke:void 0,strokeWidth:0,strokeOpacity:0,lineDash:[0],lineDashOffset:0,enabled:!1},line:{enabled:!0,stroke:h,strokeWidth:a,strokeOpacity:o,lineDash:r}}}getLegendData(e){const{processedData:t,dataModel:i}=this;if(null==t||null==i)return[];const{id:n,visible:s}=this,{title:a,legendItemName:o,idKey:r,idName:l,colorKey:h,colorScale:c,showInLegend:d}=this.properties,u=c.fills.length>0;if("gradient"===e&&null!=h&&u)return[sS(this.colorScale,c.fills,n,s,this.getFormatterContext("color"))];if("category"===e){if("discrete"===c.mode&&u)return nS(this.colorScale,c.fills,n,s,aS(this));
1return[{legendType:"category",id:n,itemId:n,seriesId:n,enabled:s,label:{text:o??a??l??r},symbol:this.legendItemSymbol(),legendItemName:o,hideInLegend:!d}]}return[]}getTooltipContent(e){const{id:t,dataModel:i,processedData:s,properties:a,ctx:{formatManager:o}}=this,{idKey:r,idName:l,colorKey:h,colorName:c,sizeKey:d,sizeName:u,labelKey:p,labelName:g,title:m,legendItemName:y,tooltip:f}=a;if(!i||!s)return;const x=s.dataSources.get(this.id)?.data[e],b=i.resolveColumnById(this,"idValue",s,"string"),v=null==d?void 0:i.resolveColumnById(this,"sizeValue",s,"number")[e],S=null==h?void 0:i.resolveColumnById(this,"colorValue",s,"number")[e],M=[];if(this.isLabelEnabled()&&null!=p&&p!==r){const n=i.resolveColumnById(this,"labelValue",s,"object")[e],a=o.format(this.callWithContext.bind(this),{type:"category",value:n,datum:x,seriesId:t,legendItemName:y,key:p,source:"tooltip",property:"label",domain:[],boundSeries:this.getFormatterContext("label")});M.push({label:g,fallbackLabel:p,value:a??n})}if(null!=v&&null!=d){const e=i.getDomain(this,"sizeValue","value",s).domain,n=o.format(this.callWithContext.bind(this),{type:"number",value:v,datum:x,seriesId:t,legendItemName:y,key:d,source:"tooltip",property:"size",domain:e,boundSeries:this.getFormatterContext("size"),fractionDigits:void 0,visibleDomain:void 0});M.push({label:u,fallbackLabel:d,value:n??String(v)})}if(null!=S&&null!=h){const e=i.getDomain(this,"colorValue","value",s).domain,r=o.format(this.callWithContext.bind(this),{type:"number",value:S,datum:x,seriesId:t,legendItemName:y,key:h,source:"tooltip",property:"color",domain:e,boundSeries:this.getFormatterContext("color"),fractionDigits:void 0,visibleDomain:void 0}),l=(0,n.zP6)(this.colorScale,a.colorScale.fills,S,n.Fl2);M.push({label:c,fallbackLabel:h,value:r??l??String(S)})}const k=this.getItemStyle({datumIndex:e,datum:x,colorValue:S,sizeValue:v},!1);return this.formatTooltipWithContext(f,{heading:b[e],title:m??y,symbol:this.legendItemSymbol(e),data:M},{seriesId:t,datum:x,title:m,idKey:r,idName:l,colorKey:h,colorName:c,sizeKey:d,sizeName:u,labelKey:p,labelName:g,...k})}computeFocusBounds(e){const t=Yv(this,e);return t?gS.toCanvas(this.contentGroup,t.getBBox()):void 0}hasItemStylers(){return this.properties.selection.enabled||null!=this.properties.itemStyler||null!=this.properties.label.itemStyler}};return e.className="MapLineSeries",e.type="map-line",e})(),{mapLineSeriesThemeableOptionsDef:yS}=s.n1,fS=(()=>({...(0,n.FFB)(n.XxK,["highlightStyle","highlight"]),...yS,type:(0,n.mw3)((0,n.dYl)("map-l
1ine")),idKey:(0,n.mw3)(n.YjP),sizeKey:n.YjP,colorKey:n.YjP,labelKey:n.YjP,idName:n.YjP,sizeName:n.YjP,colorName:n.YjP,labelName:n.YjP,topology:n.eWm,topologyIdKey:n.YjP,legendItemName:n.YjP,title:n.YjP}))(),xS=(()=>({type:"series",name:"map-line",chartType:"topology",enterprise:!0,version:s.xv,dependencies:[kv],options:fS,themeTemplate:{...Dv,series:{stroke:wv(n.HHJ),colorScale:{fills:{$map:[{color:{$value:"$1"}},{$if:[{$eq:[{$mapPalette:"type"},"inbuilt"]},{$mapPalette:"divergingColors"},wv(n.Mg2)]}]}},strokeWidth:1,maxStrokeWidth:3,lineDash:[0],lineDashOffset:0,label:{...n.mgV,...n.F$C,enabled:!0,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"textColor"},collision:{alwaysShow:!1}},highlight:wv(n.fil),selection:n.zg6},tooltip:{range:"exact"}},create:e=>new mS(e)}))(),{SeriesProperties:bS,makeSeriesTooltip:vS}=s.n1,SS=(()=>{var e=class extends bS{constructor(){super(...arguments),this.topology=void 0,this.stroke="black",this.strokeOpacity=1,this.strokeWidth=0,this.lineDash=[0],this.lineDashOffset=0,this.tooltip=vS()}};return l([n.mAP],e.prototype,"topology",2),l([n.mAP],e.prototype,"stroke",2),l([n.mAP],e.prototype,"strokeOpacity",2),l([n.mAP],e.prototype,"strokeWidth",2),l([n.mAP],e.prototype,"lineDash",2),l([n.mAP],e.prototype,"lineDashOffset",2),l([n.mAP],e.prototype,"tooltip",2),e})(),{createDatumId:MS,Group:kS,Selection:DS,PointerEvents:wS}=s.n1,IS=(()=>{var e=class extends Uv{constructor(e){super({moduleCtx:e,categoryKey:void 0,pickModes:[]}),this.properties=new SS,this._chartTopology=void 0,this.itemGroup=this.contentGroup.appendChild(new kS({name:"itemGroup"})),this.datumSelection=DS.select(this.itemGroup,(()=>this.nodeFactory())),this.itemGroup.pointerEvents=wS.None}getNodeData(){return this.contextNodeData?.nodeData}get topology(){return this.properties.topology??this._chartTopology}get focusable(){return!1}setOptionsData(){}setChartData(){}get hasData(){return!1}renderToOffscreenCanvas(){return!0}setChartTopology(e){this._chartTopology=e,this.topology===e&&(this.nodeDataRefresh=!0)}setZIndex(e){return super.setZIndex(e),this.contentGroup.zIndex=[0,e,0],this.highlightGroup.zIndex=[0,e,1],!0}nodeFactory(){const e=new zv;return e.renderMode=2,e.lineJoin="round",e.lineCap="round",e.pointerEvents=wS.None,e}processData(){const{topology:e}=this;this.topologyBounds=e?.features.reduce(((e,t)=>{const i=t.geometry;return null==i?e:Vv(i,e)}),void 0),null==e&&this.ctx.logger.warnOnce("no topology was provided for [MapShapeBackgroundSeries]; nothing will be rendered.")}createNodeData(){const{id:e,topology:t,scale:i,properties:n}=this;if(null==t)return;const{stroke:s,strokeOpacity:a,lineDash:o,lineDashOffset:r,strokeWidth:l}=n,h=[];for(const[e,n]of t.features.entries()){const{geometry:t}=n,c=null!=t&&null!=i?Wv(t,i):void 0;null!=c&&h.push({series:this,datum:n,datumIndex:0,index:e,projectedGeometry:c,style:{stroke:s,strokeOpacity:a,lineDash:o,lineDashOffset:r,strokeWidth:l}})}return{itemId:e,nodeData:h,labelData:[]}}updateSelections(){this.nodeDataRefresh&&(this.contextNodeData=this.createNodeData(),this.nodeDataRefresh=!1)}update(){const{datumSelection:e}=this;this.updateSelections(),this.contentGroup.visible=this.visible,this.labelGroup.visible=this.visible;const{nodeData:t=[]}=this.contextNodeData??{};this.datumSelection=this.updateDatumSelection({nodeData:t,datumSelection:e}),this.updateDatumNodes({datumSelection:e})}updateDatumSelection(e){return e.datumSelection.update(e.nodeData,void 0,(e=>MS(e.index)))}updateDatumNodes(e){const{datumSelection:t}=e;t.each(((e,t)=>{const{projectedGeometry:i}=t;if(null==i)return e.visible=!1,void(e.projectedGeometry=void 0);e.visible=!0,e.projectedGeometry=i,e.setProperties(t.style)}))}resetAnimation(){}getLegendData(){return[]}getTooltipContent(e){}computeFocusBounds(e){}hasItemStylers(){return!1}};return e.className="MapLineBackgroundSeries",e.type="map-line-background",e})(),{mapLineBackgroundSeriesThemeableOptionsDef:AS}=s.n1,CS=(()=>
1({...AS,type:(0,n.mw3)((0,n.dYl)("map-line-background")),topology:n.eWm}))(),NS={type:"series",name:"map-line-background",chartType:"topology",enterprise:!0,version:s.xv,dependencies:[kv],options:CS,themeTemplate:{...Dv,series:{stroke:{$path:["/1",{$mapPalette:"stroke"},{$mapPalette:"secondHierarchyColors"}]},strokeWidth:1,lineDash:[0],lineDashOffset:0}},create:e=>new IS(e)};function LS(e,t,i){const s=Pv(e[0],void 0);if(null==s)return;const a=(s.lon0+s.lon1)/2,o=(s.lat0+s.lat1)/2,r=Math.abs(s.lon1-s.lon0),l=Math.abs(s.lat1-s.lat0),h=function(e){if(0===e.length)return;let t=0,i=0,n=0,[s,a]=e.at(-1);for(const[o,r]of e){const e=s*r-o*a;n+=e,t+=(s+o)*e,i+=(a+r)*e,s=o,a=r}return n*=3,[t/n,i/n]}(e[0]),[c,d]=h,u=-Tv(e,c,d);let p;const g=(e,t)=>e-.5*Math.max(t-u,0),m=(t,n,s)=>{const{distance:a,maxDistance:o}=i(e,t,n,s),r=Math.hypot(c-t,d-n),l=Math.min(Math.max(c,t-s/2),t+s/2),h=Math.min(Math.max(d,n-s/2),n+s/2),u=Math.hypot(c-l,d-h);return{distance:a,maxDistance:o,value:g(a,r),maxValue:g(o,u),x:t,y:n,stride:s}},y=(e,t,i,n)=>{const s=m(t,i,n);s.maxDistance>=0&&e.push(s)},f=Math.min(r,l)/2;let x={value:m(a,o,f),next:null};for(;null!=x;){const e=x.value,{distance:i,value:s,maxValue:a,x:o,y:r,stride:l}=e;if(x=x.next,i>0&&(null==p||s>p.value)&&(p=e),null!=p&&a-p.value<=t)continue;const h=l/2,c=[];y(c,o-h,r-h,h),y(c,o+h,r-h,h),y(c,o-h,r+h,h),y(c,o+h,r+h,h),c.sort(PS),x=(0,n.nXd)(x,c,PS)}if(null==p)return;const{distance:b,x:v,y:S}=p;return{x:v,y:S,distance:b}}var PS=(e,t)=>t.maxValue-e.maxValue;function TS(e,t){const i=LS(e,t,((e,t,i,n)=>{const s=-Tv(e,t,i);return{distance:s,maxDistance:s+n*Math.SQRT2}}));if(null==i)return;const{x:n,y:s}=i;return[n,s]}function OS(e,t){let i;switch(e.type){case"GeometryCollection":return e.geometries.flatMap((e=>OS(e,t)));case"MultiPoint":return e.coordinates;case"Point":return[e.coordinates];case"MultiPolygon":{const n=$v(e);i=null==n?void 0:TS(n,t);break}case"Polygon":{const n=e.coordinates;i=null==n?void 0:TS(n,t);break}case"MultiLineString":{const t=Hv(e);i=null==t?void 0:Nv(t)?.point;break}case"LineString":{const t=e.coordinates;i=Nv(t)?.point;break}}return null==i?[]:[i]}var{BBox:RS}=s.n1;function ES(e){if(!e)return;const{range:t}=e,i=t[0][0],n=t[0][1],s=t[1][0]-i,a=t[1][1]-n,o=new RS(i,n,s,a);return{series:o,axis:o}}var{ColorScaleProperties:zS,SeriesProperties:BS,makeSeriesTooltip:FS,PlacedSeriesLabel:VS}=s.n1,$S=(()=>{var e=class extends VS{constructor(){super(...arguments),this.placement="bottom"}};return l([n.mAP],e.prototype,"placement",2),e})(),HS=(()=>{var e=class extends BS{constructor(){super(...arguments),this.topology=void 0,this.idKey=void 0,this.topologyIdKey="name",this.idName=void 0,this.latitudeKey=void 0,this.latitudeName=void 0,this.longitudeKey=void 0,this.longitudeName=void 0,this.labelKey=void 0,this.labelName=void 0,this.colorScale=new zS,this.shape="circle",this.fill="black",this.fillOpacity=1,this.stroke="black",this.strokeWidth=1,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.label=new $S,this.tooltip=FS()}getStyle(){const{size:e,shape:t,fill:i,fillOpacity:n,stroke:s,strokeWidth:a,strokeOpacity:o,lineDash:r,lineDashOffset:l}=this;return{size:e,shape:t,fill:i,fillOpacity:n,opacity:1,stroke:s,strokeWidth:a,strokeOpacity:o,lineDash:r,lineDashOffset:l}}};return l([n.mAP],e.prototype,"topology",2),l([n.mAP],e.prototype,"title",2),l([n.mAP],e.prototype,"legendItemName",2),l([n.mAP],e.prototype,"idKey",2),l([n.mAP],e.prototype,"topologyIdKey",2),l([n.mAP],e.prototype,"idName",2),l([n.mAP],e.prototype,"latitudeKey",2),l([n.mAP],e.prototype,"latitudeName",2),l([n.mAP],e.prototype,"longitudeKey",2),l([n.mAP],e.prototype,"longitudeName",2),l([n.mAP],e.prototype,"labelKey",2),l([n.mAP],e.prototype,"labelName",2),l([n.mAP],e.prototype,"sizeKey",2),l([n.mAP],e.prototype,"sizeName",2),l([n.mAP],e.prototype,"colorKey",2),l([n.mAP],e.prototype,"colorName",2),l([n.mAP],e.prototype,"colorScale",2),l([n.mAP],e.prototype,"shape",2),l([n.mAP],e.prototype,"size",2),l([n.mAP],e.prototype,"minSize",2),l([n.mAP],e.prototype,"maxSize",2),l([n.mAP],e.prototype,"sizeDomain",2),l([n.mAP],e.prototype,"fill",2),l([n.mAP],e.prototype,"fillOpacity",2),l([n.mAP],e.prototype,"stroke",2),l([n.mAP],e.prototype,"strokeWidth",2),l([n.mAP],e.prototype,"strokeOpacity",2),l([n.mAP],e.prototype,"lineDash",2),l([n.mAP],e.prototype,"lineDashOffset",2),l([n.mAP],e.prototype,"itemStyler",2),l([n.mAP],e.prototype,"label",2),l([n.mAP],e.prototype,"tooltip",2),e})(),{fromToMotion:jS,getMissCount:WS,buildColorCategoryLegendData:_S,buildGradientLegendDatum:GS,colorScaleLegendFormatterContext:KS,configureColorScale:YS,createDatumId:US,SeriesNodePickMode:XS,valueProperty:ZS,computeMarkerFocusBounds:qS,ColorScale:QS,LinearScale:JS,Group:eM,Selection:tM,Text:iM,Marker:nM,getLabelStyles:sM,expandLabelBoxExtent:aM}=s.n1,oM=(()=>{var e=class extends Uv{constructor(e){super({moduleCtx:e,categoryKey:void 0,propertyKeys:{size:["colorKey"],color:["colorKey"],label:["labelKey"]},propertyNames:{size:["sizeName"],color:["colorName"],label:["labelName"]},pickModes:[XS.EXACT_SHAPE_MATCH,XS.NEAREST_NODE],usesPlacedLabels:!0}),this.properties=new HS,this._chartTopology=void 0,this.colorScale=new QS,this.sizeScale=new JS,this.markerGroup=this.contentGroup.appendChild(new eM({name:"markerGroup"})),this.labelSelection=tM.select(this.labelGroup,iM,!1),this.highlightLabelSelection=tM.select(this.highlightLabelGroup,iM,!1),this.markerSelection=tM.select(this.markerGroup,nM,!1),this.highlightMarkerSelection=tM.select(this.highlightNodeGroup,nM),this.placedLabelData=[],this.animationState=new n.Z37("empty",{empty:{update:{target:"ready",action:()=>this.animateMarkers()},reset:"empty",skip:"ready"},ready:{updateData:"waiting",clear:"clearing",resize:()=>this.resetAllAnimation(),reset:"empty",skip:"ready"},waiting:{update:{target:"ready",action:()=>this.animateMarkers()},resize:{target:"ready",action:()=>this.resetAllAnimation()},reset:"empty",skip:"ready"},clearing:{update:{target:"empty",action:()=>this.resetAllAnimation()},reset:"empty",skip:"ready"}},(()=>this.checkProcessedDataAnimatable()))}getNodeData(){return this.contextNodeData?.nodeData}get topology(){return this.properties.topology??this._chartTopology}get hasData(){const e=null!=this.properties.latitudeKey&&null!=this.properties.longitudeKey;return super.hasData&&(null!=this.topology||e)}renderToOffscreenCanvas(){return!0}setChartTopology(e){this._chartTopology=e,this.topology===e&&(this.nodeDataRefresh=!0)}setZIndex(e){return super.setZIndex(e),this.contentGroup.zIndex=[2,e],this.highlightGroup.zIndex=[3,e],!0}isLabelEnabled(){return null!=this.properties.labelKey&&this.properties.label.enabled}async processData(e){if(null==this.data)return;const{data:t,sizeScale:i,colorScale:n}=this,{topologyIdKey:s,idKey:a,latitudeKey:o,longitudeKey:r,sizeKey:l,colorKey:h,labelKey:c,sizeDomain:d}=this.properties,u=this.buildFeatureMap(s),p=this.sizeScale.type,g=this.colorScale.type,m=this.scale?.type,y=null!=o&&null!=r,{dataModel:f,processedData:x}=await this.requestDataModel(e,t,{props:[...null==a?[]:[ZS(a,m,{id:"idValue",includeProperty:!1}),ZS(a,m,{id:"featureValue",includeProperty:!1,processor:()=>e=>u.get(e)})],...y?[ZS(o,m,{id:"latValue"}),ZS(r,m,{id:"lonValue"})]:[],...c?[ZS(c,"category",{id:"labelValue"})]:[],...l?[ZS(l,p,{id:"sizeValue"})]:[],...h?[ZS(h,g,{id:"colorValue",invalidValue:void 0})]:[]]}
1),b=null==a?void 0:f.resolveColumnById(this,"featureValue",x,"object"),v=y?f.resolveColumnById(this,"latValue",x,"number"):void 0,S=y?f.resolveColumnById(this,"lonValue",x,"number"):void 0;if(this.topologyBounds=x.dataSources.get(this.id)?.data.reduce(((e,t,i)=>{const n=b?.[i],s=n?.geometry;if(null!=s&&(e=Vv(s,e)),null!=v&&null!=S){const t=S[i],n=v[i];e=Lv.extend(e,t,n,t,n)}return e}),void 0),null!=l){const e=f.resolveProcessedDataIndexById(this,"sizeValue"),t=x.domain.values[e]??[];i.domain=d??t}if(this.isColorScaleValid()){const e=f.resolveProcessedDataIndexById(this,"colorValue"),t=x.domain.values[e];YS(n,this.properties.colorScale,t,this.ctx.logger)}this.animationState.transition("updateData")}isColorScaleValid(){const{colorKey:e}=this.properties;if(!e)return!1;const{dataModel:t,processedData:i}=this;if(!t||!i)return!1;const n=t.resolveProcessedDataIndexById(this,"colorValue"),s=i.input.count,a=WS(this,i.defs.values[n].missing);return!(0===s||s===a)}getLabelDatum(e,t,i,s,a){if(null==t||!a.enabled)return;const{idKey:o,idName:r,latitudeKey:l,latitudeName:h,longitudeKey:c,longitudeName:d,sizeKey:u,sizeName:p,colorKey:g,colorName:m,labelKey:y,labelName:f,label:x,shape:b}=this.properties;if(null==y||!x.enabled)return;const{datum:v,datumIndex:S,index:M,idValue:k,lonValue:D,latValue:w,point:I}=e,A=(0,n.$rL)(x.placement)[0],C=this.getLabelText(t,v,y,"label",[],x,{value:t,datum:v,idKey:o,idName:r,latitudeKey:l,latitudeName:h,longitudeKey:c,longitudeName:d,sizeKey:u,sizeName:p,colorKey:g,colorName:m,labelKey:y,labelName:f});if(null==C)return;const N=(0,n.HRu)(C,s,a),L=i.measureLines(String(N)),P=aM(a),T=L.width+P.left+P.right,O=L.height+P.top+P.bottom,R=nM.anchor(b);return{point:{x:I.x,y:I.y,size:I.size},label:{width:T,height:O,text:N},anchor:R,placement:A,datumIndex:S,datumId:US(M,k,D,w)}}resolveColumn(e,t,i,n){if(null!=e&&null!=this.dataModel)return this.dataModel.resolveColumnById(this,t,i,n)}resolveDataColumns(e){const{idKey:t,latitudeKey:i,longitudeKey:n,sizeKey:s,colorKey:a,labelKey:o}=this.properties,r=null!=i&&null!=n;return{idValues:this.resolveColumn(t,"idValue",e,"string"),featureValues:this.resolveColumn(t,"featureValue",e,"object"),latValues:r?this.resolveColumn(i,"latValue",e,"number"):void 0,lonValues:r?this.resolveColumn(n,"lonValue",e,"number"):void 0,labelValues:this.resolveColumn(o,"labelValue",e,"object"),sizeValues:this.resolveColumn(s,"sizeValue",e,"number"),colorValues:this.resolveColumn(a,"colorValue",e,"number")}}prepareProjectedGeometries(e,t,i){if(null==e||null==t||null==this.scale)return;const n=new Map;for(const[s]of i.dataSources.get(this.id)?.data.entries()??[]){const i=e[s],a=t[s]?.geometry,o=null==a?void 0:Wv(a,this.scale);null!=i&&null!=o&&n.set(i,o)}return n}calculateMarkerSize(e){return null==e?this.properties.size:this.sizeScale.convertClamped(e)}buildNodeDatum(e,t,i,n,s){return{series:this,datum:e,datumIndex:t,index:i,...s,point:n,midPoint:{x:n.x,y:n.y},legendItemName:this.properties.legendItemName,style:this.getMarkerItemStyle({datumIndex:t,datum:e,colorValue:s.colorValue,sizeValue:s.sizeValue},!1)}}createNodeFromLatLon(e,t,i,n,s,a,o,r,l){if(null==this.scale)throw new Error("Scale is required for createNodeFromLatLon");const[h,c]=this.scale.convert([i,n]),d={x:h,y:c,size:a},u=this.buildNodeDatum(e,t,-1,d,s);return{node:u,label:this.getLabelDatum(u,s.labelValue,o,r,l)??void 0}}createNodesFromGeometry(e,t,i,n,s,a,o,r){const l=[],h=[];for(const[c,[d,u]]of OS(i,1).entries()){const i={x:d,y:u,size:s},p=this.buildNodeDatum(e,t,c,i,n);l.push(p);const g=this.getLabelDatum(p,n.labelValue,a,o,r);g&&h.push(g)}return{nodes:l,labels:h}}warnMissingGeometries(e){if(0===e.length)return;if(e.length>10){const t=e.length-10;e.length=10,e.push(`(+${t} more)`)}this.ctx.logger.warnOnce("some data items do not have matches in the provided topology",e)}buildFeatureMap(e){const t=new Map;for(const i of this.topology?.features.values()??[]){const n=i.properties?.[e];null!=n&&t.set(n,i)}return t}createNodeData(){const{id:e,dataModel:t,processedData:i,sizeScale:s,properties:a,scale:o}=this,{label:r}=a;if(null==t||null==i||null==o)return;if(!this.visible)return{itemId:e,nodeData:[],labelData:[]};const l=this.resolveDataColumns(i),h=a.minSize??a.size,c=a.maxSize??a.size;s.range=[h,Math.max(h,c)];const d=sM(this,void 0,a,r,!1,void 0),u=(0,n.K$y)(d),p=(0,n.A_g)(r,!r.collision.alwaysShow),g=this.prepareProjectedGeometries(l.idValues,l.featureValues,i),m=[],y=[],f=[],x=i.dataSources.get(this.id
1)?.data??[];for(const[e,t]of x.entries()){const i={idValue:l.idValues?.[e],lonValue:l.lonValues?.[e],latValue:l.latValues?.[e],colorValue:l.colorValues?.[e],sizeValue:l.sizeValues?.[e],labelValue:l.labelValues?.[e]},n=this.calculateMarkerSize(i.sizeValue),s=null==i.idValue?void 0:g?.get(i.idValue);if(null!=i.idValue&&null!=g&&null==s&&f.push(i.idValue),null!=i.lonValue&&null!=i.latValue){const s=this.createNodeFromLatLon(t,e,i.lonValue,i.latValue,i,n,u,p,d);m.push(s.node),s.label&&y.push(s.label)}else if(null!=s){const a=this.createNodesFromGeometry(t,e,s,i,n,u,p,d);m.push(...a.nodes),y.push(...a.labels)}}return this.warnMissingGeometries(f),{itemId:e,nodeData:m,labelData:y}}updateSelections(){this.nodeDataRefresh&&(this.contextNodeData=this.createNodeData(),this.nodeDataRefresh=!1)}checkScaleChange(){return this.previousScale!==this.scale&&(this.previousScale=this.scale,!0)}update({seriesRect:e}){const t=this.checkResize(e),i=this.checkScaleChange(),{markerSelection:n,highlightMarkerSelection:s}=this,a=this.ctx.chartService.highlight?.drawingMode??"overlay";this.updateSelections(),this.contentGroup.visible=this.visible,this.labelGroup.visible=this.visible;const o=this.getHighlightedDatum(),r=this.contextNodeData?.nodeData??[];this.markerSelection=this.updateMarkerSelection({markerData:r,markerSelection:n}),this.updateMarkerNodes({markerSelection:n,isHighlight:!1,highlightedDatum:o,drawingMode:"overlay"}),this.highlightMarkerSelection=this.updateMarkerSelection({markerData:null==o?[]:[o],markerSelection:s}),this.updateMarkerNodes({markerSelection:s,isHighlight:!0,highlightedDatum:o,drawingMode:a}),this.updateLabelNodes({labelSelection:this.labelSelection,isHighlight:!1}),this.updateHighlightLabelSelection(o),(i||t)&&this.animationState.transition("resize"),this.animationState.transition("update")}updatePlacedLabelData(e){this.placedLabelData=e,this.labelSelection=this.labelSelection.update(e,(e=>{e.pointerEvents=s.n1.PointerEvents.None})),this.updateLabelNodes({labelSelection:this.labelSelection,isHighlight:!1}),this.updateHighlightLabelSelection()}updateLabelNodes({isHighlight:e,labelSelection:t}){const{properties:i}=this,n=this.ctx.highlightManager?.getActiveHighlight();t.each(((t,s)=>{const{x:a,y:o,width:r,height:l,text:h,datum:c}=s,d=sM(this,void 0,i,i.label,e,n);if(!d.enabled)return void(t.visible=!1);const{color:u,fontStyle:p,fontWeight:g,fontSize:m,fontFamily:y}=d;t.visible=!0,t.x=a+r/2,t.y=o+l/2,t.text=h,t.fill=u,t.fontStyle=p,t.fontWeight=g,t.fontSize=m,t.fontFamily=y,t.textAlign="center",t.textBaseline="middle";const f=c?.datumIndex;t.fillOpacity=this.getHighlightStyle(e,f).opacity??1,t.setBoxing(d)}))}getHighlightedLabelId(e=this.getHighlightedDatum()){if(null!=e)return US(e.index,e.idValue,e.lonValue,e.latValue)}updateHighlightLabelSelection(e=this.getHighlightedDatum()){const t=this.getHighlightedLabelId(e),i=null!=t&&this.isLabelEnabled()?this.placedLabelData.filter((e=>e.datum.datumId===t)):[];if(this.highlightLabelSelection=this.highlightLabelSelection.update(i),0===i.length)return this.highlightLabelSelection.cleanup(),void(this.highlightLabelGroup.visible=!1);this.highlightLabelGroup.visible=!0,this.updateLabelNodes({labelSelection:this.highlightLabelSelection,isHighlight:!0})}updateMarkerSelection(e){const{markerData:t,markerSelection:i}=e;return i.update(t,void 0,(e=>US(e.index,e.idValue,e.lonValue,e.latValue)))}getMarkerItemStyle({datumIndex:e,datum:t,colorValue:i,sizeValue:s},a){const{properties:o,colorScale:r,sizeScale:l}=this,{colorKey:h,colorScale:c,itemStyler:d}=o,{missingDataFill:u}=c,p=this.getHighlightStyle(a,e),g=this.getSelectionStyle(e),m=(0,n.HFk)(g,p,o.getStyle());if(null!=i){const e=this.isColorScaleValid()?r.convert(i):c.fills[0]?.color;null!=e&&(m.fill=e)}else null!=h&&null!=u&&null==p?.fill&&(m.fill=u);null!=s&&(m.size=l.convertClamped(s));let y=m;if(null!=d&&null!=e){const i=this.cachedDatumCallback(US(e,a?"highlight":"node"),(()=>{const i=this.makeItemStylerParams(t,e,a,y);return this.ctx.optionsGraphService.resolvePartial(["series",`${this.declarationOrder}`],this.callWithContext(d,i))}));i&&(y=(0,n.HFk)(i,m))}return y}makeItemStylerParams(e,t,i,n){const{id:s}=this,{sizeKey:a,idKey:o,labelKey:r,colorKey:l,latitudeKey:h,longitudeKey:c}=this.properties,d=this.ctx.highlightManager?.getActiveHighlight(),u=this.getHighlightStateString(d,i,t),p=this.getSelectionStateString(t),g=this.getCandidateStateString(t),m=this.filterItemStylerFillParam
1s(n.fill)??n.fill;return{seriesId:s,datum:e,sizeKey:a,idKey:o,labelKey:r,colorKey:l,latitudeKey:h,longitudeKey:c,highlightState:u,selectionState:p,candidateState:g,...n,fill:m}}updateMarkerNodes(e){const{markerSelection:t,isHighlight:i,highlightedDatum:n,drawingMode:s}=e,a=ES(this.scale);t.each(((e,t)=>{const{datum:o,point:r}=t,l=this.getMarkerItemStyle(t,i);e.shape=l.shape,e.size=l.size,e.setStyleProperties(l,a),e.x=r.x,e.y=r.y,e.scalingCenterX=r.x,e.scalingCenterY=r.y,e.zIndex=i||null==n||o!==n.datum?0:1,e.drawingMode=s}))}isProcessedDataAnimatable(){return!0}resetAnimation(e){"initial"===e?this.animationState.transition("reset"):"ready"===e&&this.animationState.transition("skip")}resetAllAnimation(){this.ctx.animationManager.stopByAnimationGroupId(this.id),this.ctx.animationManager.skipCurrentBatch(),this.labelSelection.cleanup(),this.markerSelection.cleanup(),this.highlightMarkerSelection.cleanup(),this.highlightLabelSelection.cleanup(),this.highlightLabelGroup.visible=!1,this.placedLabelData=[]}animateMarkers(){const{animationManager:e}=this.ctx,t={fromFn:(e,t,i)=>"removed"===i?{scalingX:1,scalingY:1}:null==e.previousDatum?{scalingX:0,scalingY:0}:{scalingX:e.scalingX,scalingY:e.scalingY},toFn:(e,t,i)=>"removed"===i?{scalingX:0,scalingY:0}:{scalingX:1,scalingY:1}};jS(this.id,"markers",e,[this.markerSelection,this.highlightMarkerSelection],t)}getLabelData(){return this.isLabelEnabled()?this.contextNodeData?.labelData??[]:[]}getLabelDefaults(){const{label:e}=this.properties;return(0,n.wSY)(e.collision,(0,n.$rL)(e.placement),e.spacing)}pickNodeClosestDatum(e){const{x:t,y:i}=e;let n,s=1/0;for(const e of this.contextNodeData?.nodeData??[]){const{x:a,y:o,size:r}=e.point,l=Math.max(Math.abs(a-t)-r,0),h=Math.max(Math.abs(o-i)-r,0),c=l*l+h*h;c<s&&(s=c,n=e)}return null==n?void 0:{datum:n,distance:Math.sqrt(s),target:this.contentGroup}}legendItemSymbol(e){const{dataModel:t,processedData:i,properties:n}=this,{colorKey:s,shape:a,fillOpacity:o,stroke:r,strokeWidth:l,strokeOpacity:h,lineDash:c,lineDashOffset:d}=n,{missingDataFill:u}=n.colorScale;let{fill:p}=n;if(null!=e&&this.isColorScaleValid()){const n=t.resolveColumnById(this,"colorValue",i,"mixed-numeric")[e];null!=n?p=this.colorScale.convert(n):null!=s&&null!=u&&(p=u)}return{marker:{shape:a,fill:p,fillOpacity:o,stroke:r,strokeWidth:l,strokeOpacity:h,lineDash:c,lineDashOffset:d}}}getLegendData(e){const{processedData:t,dataModel:i}=this;if(null==t||null==i)return[];const{id:n,visible:s}=this,{title:a,legendItemName:o,idName:r,idKey:l,colorKey:h,colorScale:c,showInLegend:d}=this.properties,u=c.fills.length>0;if("gradient"===e&&null!=h&&u)return[GS(this.colorScale,c.fills,n,s,this.getFormatterContext("color"))];if("category"===e){if("discrete"===c.mode&&u)return _S(this.colorScale,c.fills,n,s,KS(this));return[{legendType:"category",id:n,itemId:n,seriesId:n,enabled:s,label:{text:o??a??r??l??n},symbol:this.legendItemSymbol(),legendItemName:o,hideInLegend:!d}]}return[]}getTooltipContent(e){const{id:t,dataModel:i,processedData:s,properties:a,ctx:{formatManager:o}}=this,{idKey:r,idName:l,latitudeKey:h,latitudeName:c,longitudeKey:d,longitudeName:u,colorKey:p,colorName:g,sizeKey:m,sizeName:y,labelKey:f,labelName:x,title:b,legendItemName:v,tooltip:S}=a;if(!i||!s)return;const M=s.dataSources.get(this.id)?.data[e],k=null==m?void 0:i.resolveColumnById(this,"sizeValue",s,"number")[e],D=null==p?void 0:i.resolveColumnById(this,"colorValue",s,"number")[e],w=[];if(this.isLabelEnabled()&&null!=f&&f!==r){const n=i.resolveColumnById(this,"labelValue",s,"object")[e],a=o.format(this.callWithContext.bind(this),{type:"category",value:n,datum:M,seriesId:t,legendItemName:v,key:f,source:"tooltip",property:"label",domain:[],boundSeries:this.getFormatterContext("label")});w.push({label:x,fallbackLabel:f,value:a??n})}if(null!=m&&null!=k){const e=i.getDomain(this,"sizeValue","value",s).domain,n=o.format(this.callWithContext.bind(this),{type:"number",value:k,datum:M,seriesId:t,legendItemName:v,key:m,source:"tooltip",property:"size",domain:e,boundSeries:this.getFormatterContext("size"),fractionDigits:void 0,visibleDomain:void 0});w.push({label:y,fallbackLabel:m,value:n??String(k)})}if(null!=p&&null!=D){const e=i.getDomain(this,"colorValue","value",s).domain,r=o.format(this.callWithContext.bind(this),{type:"number",value:D,datum:M,seriesId:t,legendItemName:v,key:p,source:"tooltip",property:"color",domain:e,boundSeries:this.getFormatterContext("color"),fractionDigits:void 0,visibleDomain:void 0}),l=(0,n.zP6)(this.colorScale,a.colorScale.fills,D,n.Fl2);w.push({label:g,fallbackLabel:p,value:r??l??String(D)})}let I;if(null!=r)I=i.resolveColumnById(this,"idValue",s,"string")[e];else if(null!=h&&null!=d){const t=i.resolveColumnById(this,"latValue",s,"number")[e],n=i.resolveColumnById(this,"lonValue",s,"number")[e];I=`${Math.abs(t).toFixed(4)}° ${t>=0?"N":"S"}, ${Math.abs(n).toFixed(4)}° ${n>=0?"W":"E"}`}const A=this.getMarkerItemStyle({datumIndex:e,datum:M,colorValue:D,sizeValue:k},!1);return this.formatTooltipWithContext(S,{heading:I,title:b??v,symbol:this.legendItemSymbol(e),data:w},{seriesId:t,datum:M,title:b,idKey:r,idName:l,latitudeKey:h,latitudeName:c,longitudeKey:d,longitudeName:u,colorKey:p,colorName:g,sizeKey:m,sizeName:y,labelKey:f,labelName:x,...A})}getFormattedMarkerStyle(e){const t=this.getMarkerItemStyle(e,!1);return{size:t.size,shape:t.shape}}computeFocusBounds(e){return qS(this,e)}hasItemStylers(){return this.properties.selection.enabled||null!=this.properties.itemStyler||null!=this.properties.label.itemStyler}};return e.className="MapMarkerSeries",e.type="map-marker",e})(),{mapMarkerSeriesThemeableOptionsDef:rM}=s.n1,lM=(()=>
1({...(0,n.FFB)(n.XxK,["highlightStyle","highlight"]),...rM,type:(0,n.mw3)((0,n.dYl)("map-marker")),idKey:n.YjP,latitudeKey:n.YjP,longitudeKey:n.YjP,sizeKey:n.YjP,colorKey:n.YjP,labelKey:n.YjP,idName:n.YjP,latitudeName:n.YjP,longitudeName:n.YjP,sizeName:n.YjP,colorName:n.YjP,labelName:n.YjP,topology:n.eWm,topologyIdKey:n.YjP,legendItemName:n.YjP,title:n.YjP}))(),hM=(()=>({type:"series",name:"map-marker",chartType:"topology",enterprise:!0,version:s.xv,dependencies:[kv],options:lM,themeTemplate:{...Dv,series:{shape:"circle",size:7,maxSize:30,fill:wv({$applySwitch:[{$path:"type"},{$mapPalette:"fill"},["gradient",n.pRl],["image",n.pwE],["pattern",n.eu4]]}),stroke:{$mapPalette:"stroke"},colorScale:{fills:{$map:[{color:{$value:"$1"}},{$if:[{$eq:[{$mapPalette:"type"},"inbuilt"]},{$mapPalette:"divergingColors"},wv(n.Mg2)]}]}},fillOpacity:.5,label:{...n.mgV,...n.F$C,enabled:!1,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"textColor"},collision:{alwaysShow:!1}},highlight:wv(n.fil),selection:n.zg6},tooltip:{range:"exact"}},create:e=>new oM(e),validate(e,t,i,s){const a=(0,n.tfT)(e,t,i,s),{cleared:o,invalid:r}=a;if(null==o?.idKey&&(null==o?.latitudeKey||null==o?.longitudeKey)){const e=e=>i?`${i}.${e}`:e,t=`Either \`${e("idKey")}\` or both \`${e("latitudeKey")}\` and \`${e("longitudeKey")}\` are required.`;r.push(new n.yI4("required",t,null,i))}return a}}))();function cM(e,{aspectRatio:t,precision:i}){const n=LS(e,i,((e,i,n,s)=>{const a=function(e,t,i,n){let s=!1,a=1/0;for(const o of e){let e=o.at(-1),[r,l]=e;for(const h of o){const[o,c]=h;c>i!=l>i&&t<(r-o)*(i-c)/(l-c)+o&&(s=!s);const d=dM(e,h,t,i,n);a=Math.min(a,d),e=h,r=o,l=c}}return(s?1:-1)*a}(e,i,n,t),o=a+2*s*t;return{distance:a*Math.SQRT2,maxDistance:o*Math.SQRT2}}));if(null==n)return;const{x:s,y:a,distance:o}=n;return{x:s,y:a,maxWidth:o/Math.SQRT2}}function dM(e,t,i,n,s){const[a,o]=e,[r,l]=t,h=1/s,c=r-a,d=l-o,[u,p]=o<=l?e:t,[g,m]=a<=r?e:t,[y,f]=o<=l?t:e,[x,b]=a<=r?t:e;let v=1/0;if(0===c)for(let e=0;e<=1;e+=1){const t=(0===e?h:-h)*(a-i)+n;if(t>=p&&t<=f){const e=2*Math.abs(n-t)*s;v=Math.min(v,e)}}else{const e=d/c;for(let t=0;t<=1;t+=1){const s=0===t?h:-h,r=(e*a-o-s*i+n)/(e-s);if(r>=g&&r<=x){const e=2*Math.abs(i-r);v=Math.min(v,e)}}}const S=s,M=Math.abs((u-i)/(p-n)),k=Math.abs((y-i)/(f-n));if(f<n&&k<S){const e=2*Math.abs(n-f)*s;v=Math.min(v,e)}else if(p>n&&M<S){const e=2*Math.abs(n-p)*s;v=Math.min(v,e)}const D=Math.abs((m-n)/(g-i)),w=Math.abs((b-n)/(x-i));if(x<i&&w<h){const e=2*Math.abs(i-x);v=Math.min(v,e)}else if(g>i&&D<h){const e=2*Math.abs(i-g);v=Math.min(v,e)}return v}function uM(e,t,i){i>=t&&(e.maxX=Math.min(e.maxX,i-t)),i<=t&&(e.minX=Math.max(e.minX,i-t))}function pM(e,t,i,n,s,a){const o=s-a/2,r=s+a/2,[l,h]=t,[c,d]=i,u=c-l,p=d-h,[g,m]=l<=c?t:i,[y,f]=l<=c?i:t;if(0!==u){const t=p/u;for(let i=0;i<=1;i+=1){const s=((0===i?o:r)-h)/t+l;s>=g&&s<=y&&uM(e,n,s)}}else Math.max(o,Math.min(h,d))<=Math.min(r,Math.max(h,d))&&uM(e,n,l);return y<n&&f>=o&&f<=r?uM(e,n,y):g>n&&m>=o&&m<=r&&uM(e,n,g),e}var{ColorScaleProperties:gM,SeriesProperties:mM,makeSeriesTooltip:yM}=s.n1,fM=(()=>{var e=class extends mM{constructor(){super(...arguments),this.topology=void 0,this.idKey="",this.idName=void 0,this.topologyIdKey="name",this.labelKey=void 0,this.labelName=void 0,this.colorScale=new gM,this.fill="black",this.fillOpacity=1,this.stroke="black",this.strokeOpacity=1,this.strokeWidth=0,this.lineDash=[0],this.lineDashOffset=0,this.padding=0,this.label=new ql,this.tooltip=yM()}getStyle(){const{fill:e,fillOpacity:t,stroke:i,strokeWidth:n,strokeOpacity:s,lineDash:a,lineDashOffset:o}=this;return{fill:e,fillOpacity:t,stroke:i,strokeWidth:n,strokeOpacity:s,lineDash:a,lineDashOffset:o,opacity:1}}};return l([n.mAP],e.prototype,"topology",2),l([n.mAP],e.prototype,"title",2),l([n.mAP],e.prototype,"legendItemName",2),l([n.mAP],e.prototype,"idKey",2),l([n.mAP],e.prototype,"idName",2),l([n.mAP],e.prototype,"topologyIdKey",2),l([n.mAP],e.prototype,"labelKey",2),l([n.mAP],e.prototype,"labelName",2),l([n.mAP],e.prototype,"colorKey",2),l([n.mAP],e.prototype,"colorName",2),l([n.mAP],e.prototype,"colorScale",2),l([n.mAP],e.prototype,"fill",2),l([n.mAP],e.prototype,"fillOpacity",2),l([n.mAP],e.prototype,"stroke",2),l([n.mAP],e.prototype,"strokeOpacity",2),l([n.mAP],e.prototype,"strokeWidth",2),l([n.mAP],e.prototype,"lineDash",2),l([n.mAP],e.prototype,"lineDashOffset",2),l([n.mAP],e.prototype,"padding",2),l([n.mAP],e.prototype,"itemStyler",2),l([n.mAP],e.prototype,"label",2),l([n.mAP],e.prototype,"tooltip",2),e})(),{getMissCount:xM,buildColorCategoryLegendData:bM,buildGradientLegendDatum:vM,colorScaleLegendFormatterContext:SM,configureColorScale:MM,createDatumId:kM,SeriesNodePickMode:DM,valueProperty:wM,ColorScale:IM,Group:AM,Selection:CM,Text:NM,PointerEvents:LM,getLabelStyles:PM}=s.n1,TM=s.n1.MercatorScale.fixedScale(),OM=(()=>{var e=class extends Uv{constructor(e){super({moduleCtx:e,categoryKey:void 0,propertyKeys:{color:["colorKey"],label:["labelKey"]},propertyNames:{color:["colorName"],label:["labelName"]},pickModes:[DM.EXACT_SHAPE_MATCH,DM.NEAREST_NODE]}),this.properties=new fM,this._chartTopology=void 0,this.colorScale=new IM,this.itemGroup=this.contentGroup.appendChild(new AM({name:"itemGroup"})),this.itemLabelGroup=this.contentGroup.appendChild(new AM({name:"itemLabelGroup"})),this.datumSelection=CM.select(this.itemGroup,(()=>this.nodeFactory())),this.labelSelection=CM.select(this.itemLabelGroup,NM),this.highlightDatumSelection=CM.select(this.highlightNodeGroup,(()=>this.nodeFactory())),this.highlightLabelSelection=CM.select(this.highlightLabelGroup,NM),this.previousLabelLayouts=void 0,this._previousDatumMidPoint=void 0,this.itemLabelGroup.pointerEvents=LM.None}
1getNodeData(){return this.contextNodeData?.nodeData}get topology(){return this.properties.topology??this._chartTopology}get hasData(){return super.hasData&&null!=this.topology}renderToOffscreenCanvas(){return!0}setChartTopology(e){this._chartTopology=e,this.topology===e&&(this.nodeDataRefresh=!0)}setZIndex(e){return super.setZIndex(e),this.contentGroup.zIndex=[1,e],this.highlightGroup.zIndex=[4,e],!0}isLabelEnabled(){return null!=this.properties.labelKey&&this.properties.label.enabled}nodeFactory(){const e=new zv;return e.renderMode=1,e.lineJoin="round",e}async processData(e){if(null==this.data)return;const{data:t,topology:i,colorScale:n}=this,{topologyIdKey:s,idKey:a,colorKey:o,labelKey:r}=this.properties,l=new Map;for(const e of i?.features.values()??[]){const t=e.properties?.[s];null!=t&&jv(e.geometry,1)&&l.set(t,e)}const h=this.colorScale.type,c=this.scale?.type,{dataModel:d,processedData:u}=await this.requestDataModel(e,t,{props:[wM(a,c,{id:"idValue",includeProperty:!1}),wM(a,c,{id:"featureValue",includeProperty:!1,processor:()=>e=>l.get(e)}),...r?[wM(r,"category",{id:"labelValue"})]:[],...o?[wM(o,h,{id:"colorValue",invalidValue:void 0})]:[]]}),p=d.resolveColumnById(this,"featureValue",u,"object");if(this.topologyBounds=p.reduce(((e,t)=>{const i=t?.geometry;return null==i?e:Vv(i,e)}),void 0),this.isColorScaleValid()){const e=d.resolveProcessedDataIndexById(this,"colorValue"),t=u.domain.values[e];MM(n,this.properties.colorScale,t,this.ctx.logger)}null==i&&this.ctx.logger.warnOnce("no topology was provided for [MapShapeSeries]; nothing will be rendered.")}isColorScaleValid(){const{colorKey:e}=this.properties;if(!e)return!1;const{dataModel:t,processedData:i}=this;if(!t||!i)return!1;const n=t.resolveProcessedDataIndexById(this,"colorValue"),s=i.input.count,a=xM(this,i.defs.values[n].missing);return!(0===s||s===a)}getLabelLayout(e,t,i,s,a){if(null==t||null==s)return;const{idKey:o,idName:r,colorKey:l,colorName:h,labelKey:c,labelName:d,padding:u,label:p}=this.properties;if(null==c||!p.enabled)return;const g=this.getLabelText(t,e,c,"label",[],p,{value:t,datum:e,idKey:o,idName:r,colorKey:l,colorName:h,labelKey:c,labelName:d});if(null==g)return;const m=(0,n.cyL)(g)?(0,n.wEO)(g,p):i.measureLines(String(g)),y=(m.width+2*u)/(m.height+2*u);if(a?.geometry===s&&a?.labelText===g&&a?.aspectRatio===y)return a;const f=$v(Wv(s,TM));if(null==f)return;const x=cM(f,{aspectRatio:y,precision:.001});if(null==x)return;const{x:b,y:v,maxWidth:S}=x;return{geometry:s,labelText:g,aspectRatio:y,x:b,y:v,maxWidth:S,fixedPolygon:f}}getLabelDatum(e,t,i,s){const{scale:a}=this;if(null==a)return;const{padding:o,label:r}=this.properties,{labelText:l,aspectRatio:h,x:c,y:d,maxWidth:u,fixedPolygon:p}=e,g={width:Math.ceil(u*t),height:Math.ceil(u*t/h),meta:c},m=jl((0,n.boc)(l),r,{padding:o},((e,i)=>{if(!i)return g;const n=function(e,t,i,n){const s={minX:-1/0,maxX:1/0};for(const a of e){let e=a.at(-1);for(const o of a)pM(s,e,o,t,i,n),e=o}const{minX:a,maxX:o}=s;return Number.isFinite(a)&&Number.isFinite(o)?{x:t+(a+o)/2,width:o-a}:{x:t,width:0}}(p,c,d,e/t);return{width:n.width*t,height:e,meta:n.x}}));if(null==m)return;const[{text:y,fontSize:f,lineHeight:x,width:b},v]=m,S=b<g.width?c:v,M=this.scale.convert(TM.invert([S,d]));return{x:M[0],y:M[1],text:y,fontSize:f,lineHeight:x,datumIndex:i,idValue:s,datumId:kM(s)}}resolveColumn(e,t,i,n){if(null!=e&&null!=this.dataModel)return this.dataModel.resolveColumnById(this,t,i,n)}resolveShapeDataColumns(e){const{colorKey:t,labelKey:i}=this.properties;return{idValues:this.dataModel.resolveColumnById(this,"idValue",e,"string"),featureValues:this.dataModel.resolveColumnById(this,"featureValue",e,"object"),labelValues:this.resolveColumn(i,"labelValue",e,"object"),colorValues:this.resolveColumn(t,"colorValue",e,"number")}}warnMissingGeometries(e){if(0===e.length)return;if(e.length>10){const t=e.length-10;e.length=10,e.push(`(+${t} more)`)}this.ctx.logger.warnOnce("some data items do not have matches in the provided topology",e)}createNodeData(){const{id:e,dataModel:t,processedData:i,properties:s,scale:a,previousLabelLayouts:o}=this,{label:r,legendItemName:l,colorKey:h}=s,{missingDataFill:c}=s.colorScale;if(null==t||null==i)return;if(!this.visible)return{itemId:e,nodeData:[],labelData:[]};const d=null==a?Number.NaN:(a.range[1][0]-a.range[0][0])/a.bounds.width,u=this.resolveShapeDataColumns(i),p=(0,n.K$y)(r),g=new Map;this.previousLabelLayouts=g;
1const m=[],y=[],f=[],x=i.dataSources.get(this.id)?.data??[];for(const[e,t]of x.entries()){const i={idValue:u.idValues[e],colorValue:u.colorValues?.[e],labelValue:u.labelValues?.[e]},n=u.featureValues[e]?.geometry??void 0;if(null==n&&f.push(i.idValue),null!=h&&null==i.colorValue&&null==c)continue;const s=this.getLabelLayout(t,i.labelValue,p,n,o?.get(i.idValue));null!=s&&g.set(i.idValue,s);const r=null!=s&&null!=a?this.getLabelDatum(s,d,e,i.idValue):void 0;null!=r&&y.push(r);const x=null!=n&&null!=a?Wv(n,a):void 0;m.push({series:this,datum:t,datumIndex:e,...i,projectedGeometry:x,legendItemName:l,style:this.getItemStyle({datum:t,datumIndex:e,colorValue:i.colorValue},!1)})}return this.warnMissingGeometries(f),{itemId:e,nodeData:m,labelData:y}}updateSelections(){this.nodeDataRefresh&&(this.contextNodeData=this.createNodeData(),this.nodeDataRefresh=!1)}update(){const{datumSelection:e,labelSelection:t,highlightDatumSelection:i}=this;this.updateSelections(),this.contentGroup.visible=this.visible,this.labelGroup.visible=this.visible;const n=this.ctx.chartService.highlight?.drawingMode??"overlay",s=this.getHighlightedDatum(),a=this.contextNodeData?.nodeData??[],o=this.contextNodeData?.labelData??[];this.datumSelection=this.updateDatumSelection({nodeData:a,datumSelection:e}),this.updateDatumStyles({datumSelection:e,isHighlight:!1}),this.updateDatumNodes({datumSelection:e,drawingMode:"overlay"}),this.labelSelection=this.updateLabelSelection({labelData:o,labelSelection:t});const r=this.getHighlightLabelData(o,s);this.highlightLabelSelection=this.updateLabelSelection({labelData:r,labelSelection:this.highlightLabelSelection}),this.updateLabelNodes({labelSelection:this.labelSelection,isHighlight:!1}),this.updateLabelNodes({labelSelection:this.highlightLabelSelection,isHighlight:!0}),this.highlightDatumSelection=this.updateDatumSelection({nodeData:null==s?[]:[s],datumSelection:i}),this.updateDatumStyles({datumSelection:i,isHighlight:!0}),this.updateDatumNodes({datumSelection:i,drawingMode:n})}getHighlightLabelData(e,t){if(0===e.length)return[];const i=kM(t?.idValue);return e.filter((e=>e.datumId===i&&e.datumIndex===t?.datumIndex))}updateDatumSelection(e){return e.datumSelection.update(e.nodeData,void 0,(e=>kM(e.idValue)))}getItemStyle({datumIndex:e,datum:t,colorValue:i},s){const{properties:a,colorScale:o}=this,{colorKey:r,colorScale:l,itemStyler:h}=a,{missingDataFill:c}=l,d=a.getStyle();if(null!=i){const e=this.isColorScaleValid()?o.convert(i):l.fills[0]?.color;null!=e&&(d.fill=e)}else null!=r&&null!=c&&(d.fill=c);const u=this.getHighlightStyle(s,e),p=this.getSelectionStyle(e);let g=(0,n.HFk)(p,u,d);if(null!=h&&null!=e){const i=this.cachedDatumCallback(kM(e,s?"highlight":"node"),(()=>{const i=this.makeItemStylerParams(t,e,s,g);return this.ctx.optionsGraphService.resolvePartial(["series",`${this.declarationOrder}`],this.callWithContext(h,i))}));i&&(g=(0,n.HFk)(i,g))}return g}makeItemStylerParams(e,t,i,n){const{id:s}=this,{idKey:a,labelKey:o,colorKey:r}=this.properties,l=this.ctx.highlightManager?.getActiveHighlight(),h=this.getHighlightStateString(l,i,t),c=this.getSelectionStateString(t),d=this.getCandidateStateString(t),u=this.filterItemStylerFillParams(n.fill)??n.fill;return{seriesId:s,datum:e,idKey:a,labelKey:o,colorKey:r,highlightState:h,selectionState:c,candidateState:d,...n,fill:u}}updateDatumStyles({datumSelection:e,isHighlight:t}){e.each(((e,i)=>{i.style=this.getItemStyle(i,t)}))}updateDatumNodes({datumSelection:e,drawingMode:t}){const i=ES(this.scale);e.each(((e,n)=>{const{projectedGeometry:a}=n;if(null==a)return e.visible=!1,void(e.projectedGeometry=void 0);e.visible=!0,e.projectedGeometry=a,e.setStyleProperties(n.style,i),e.drawingMode=t;const o=this.getDataSelectionState(n.datumIndex),r=!s.n1.isUnselected(o);e.zIndex=r?1:0}))}updateLabelSelection(e){const t=this.isLabelEnabled()?e.labelData:[];return e.labelSelection.update(t)}updateLabelNodes({isHighlight:e,labelSelection:t}){const{properties:i}=this,n=this.ctx.highlightManager?.getActiveHighlight();t.each(((t,s)=>{const{x:a,y:o,text:r,fontSize:l,lineHeight:h,datumIndex:c}=s,d=PM(this,void 0,i,i.label,e,n);if(!d.enabled)return void(t.visible=!1);const{color:u,fontStyle:p,fontWeight:g,fontFamily:m}=d;
1t.visible=!0,t.x=a,t.y=o,t.text=r,t.fill=u,t.fontStyle=p,t.fontWeight=g,t.fontSize=l,t.lineHeight=h,t.fontFamily=m,t.textAlign="center",t.textBaseline="middle",t.fillOpacity=this.getHighlightStyle(e,c).opacity??1,t.setBoxing(d)}))}resetAnimation(){}pickNodeClosestDatum({x:e,y:t}){let i,n,s=1/0;return this.datumSelection.each(((a,o)=>{const r=a.distanceSquared(e,t);r<s&&(s=r,i=o,n=a)})),null==i||null==n?void 0:{datum:i,distance:Math.sqrt(s),target:n}}datumMidPoint(e){const{_previousDatumMidPoint:t}=this;if(t?.datum===e)return t.point;const i=e.projectedGeometry,n=null==i?void 0:$v(i),s=null==n?void 0:TS(n,2),a=null==s?void 0:{x:s[0],y:s[1]};return this._previousDatumMidPoint={datum:e,point:a},a}legendItemSymbol(e){const{dataModel:t,processedData:i,properties:n}=this,{colorKey:s,fillOpacity:a,stroke:o,strokeWidth:r,strokeOpacity:l,lineDash:h,lineDashOffset:c}=n,{missingDataFill:d}=n.colorScale;let{fill:u}=n;if(null!=e&&this.isColorScaleValid()){const n=t.resolveColumnById(this,"colorValue",i,"mixed-numeric")[e];null!=n?u=this.colorScale.convert(n):null!=s&&null!=d&&(u=d)}return{marker:{fill:u,fillOpacity:a,stroke:o,strokeWidth:r,strokeOpacity:l,lineDash:h,lineDashOffset:c}}}getLegendData(e){const{processedData:t,dataModel:i}=this;if(null==t||null==i)return[];const{id:n,visible:s}=this,{title:a,legendItemName:o,idKey:r,idName:l,colorKey:h,colorScale:c,showInLegend:d}=this.properties,u=c.fills.length>0;if("gradient"===e&&null!=h&&u)return[vM(this.colorScale,c.fills,n,s,this.getFormatterContext("color"))];if("category"===e){if("discrete"===c.mode&&u)return bM(this.colorScale,c.fills,n,s,SM(this));return[{legendType:"category",id:n,itemId:n,seriesId:n,enabled:s,label:{text:o??a??l??r},symbol:this.legendItemSymbol(),legendItemName:o,hideInLegend:!d}]}return[]}getTooltipContent(e){const{id:t,dataModel:i,processedData:s,properties:a,ctx:{formatManager:o}}=this,{idKey:r,idName:l,colorKey:h,colorName:c,labelKey:d,labelName:u,legendItemName:p,title:g,tooltip:m}=a;if(!i||!s)return;const y=s.dataSources.get(this.id)?.data[e],f=i.resolveColumnById(this,"idValue",s,"string")[e],x=null==h?void 0:i.resolveColumnById(this,"colorValue",s,"number")[e];if(null!=h&&null==x)return;const b=[];if(this.isLabelEnabled()&&null!=d&&d!==r){const n=i.resolveColumnById(this,"labelValue",s,"object")[e],a=o.format(this.callWithContext.bind(this),{type:"category",value:n,datum:y,seriesId:t,legendItemName:p,key:d,source:"tooltip",property:"label",domain:[],boundSeries:this.getFormatterContext("label")});b.push({label:u,fallbackLabel:d,value:a??n})}if(null!=x){const e=i.getDomain(this,"colorValue","value",s).domain,r=o.format(this.callWithContext.bind(this),{type:"number",value:x,datum:y,seriesId:t,legendItemName:p,key:h,source:"tooltip",property:"color",domain:e,boundSeries:this.getFormatterContext("color"),fractionDigits:void 0,visibleDomain:void 0}),l=(0,n.zP6)(this.colorScale,a.colorScale.fills,x,n.Fl2);b.push({label:c,fallbackLabel:h,value:r??l??String(x)})}const v=this.getItemStyle({datum:y,datumIndex:e,colorValue:x},!1);return this.formatTooltipWithContext(m,{heading:f,title:g??p,symbol:this.legendItemSymbol(e),data:b},{seriesId:t,datum:y,title:g,idKey:r,idName:l,colorKey:h,colorName:c,labelKey:d,labelName:u,...v})}computeFocusBounds(e){return Yv(this,e)}hasItemStylers(){return this.properties.selection.enabled||null!=this.properties.itemStyler||null!=this.properties.label.itemStyler}};return e.className="MapShapeSeries",e.type="map-shape",e})(),{mapShapeSeriesThemeableOptionsDef:RM}=s.n1,EM=(()=>({...(0,n.FFB)(n.XxK,["highlightStyle","highlight"]),...RM,type:(0,n.mw3)((0,n.dYl)("map-shape")),idKey:(0,n.mw3)(n.YjP),colorKey:n.YjP,labelKey:n.YjP,idName:n.YjP,colorName:n.YjP,labelName:n.YjP,topology:n.eWm,topologyIdKey:n.YjP,legendItemName:n.YjP,title:n.YjP}))(),zM=(()=>({type:"series",name:"map-shape",chartType:"topology",enterprise:!0,version:s.xv,dependencies:[kv],options:EM,themeTemplate:{...Dv,series:{fill:wv({$applySwitch:[{$path:"type"},{$mapPalette:"fill"},["gradient",n.Euh],["image",n.pwE],["pattern",n.eu4]]}),stroke:{$ref:"chartBackgroundColor"},colorScale:{fills:{$map:[{color:{$value:"$1"}},{$if:[{$eq:[{$mapPalette:"type"},"inbuilt"]},{$mapPalette:"divergingColors"},wv(n.Mg2)]}]}},fillOpacity:1,strokeWidth:1,lineDash:[0],lineDashOffset:0,padding:2,label:{...n.mgV,enabled:!0,color:{$ref:"chartBackgroun
1dColor"},fontFamily:{$ref:"fontFamily"},fontSize:{$ref:"fontSize"},fontWeight:"bold",overflowStrategy:"hide"},highlight:wv(n.fil),selection:n.zg6},tooltip:{range:"exact"}},create:e=>new OM(e)}))(),{SeriesProperties:BM,makeSeriesTooltip:FM}=s.n1,VM=(()=>{var e=class extends BM{constructor(){super(...arguments),this.topology=void 0,this.fill="black",this.fillOpacity=1,this.stroke="black",this.strokeOpacity=1,this.strokeWidth=0,this.lineDash=[0],this.lineDashOffset=0,this.tooltip=FM()}};return l([n.mAP],e.prototype,"topology",2),l([n.mAP],e.prototype,"fill",2),l([n.mAP],e.prototype,"fillOpacity",2),l([n.mAP],e.prototype,"stroke",2),l([n.mAP],e.prototype,"strokeOpacity",2),l([n.mAP],e.prototype,"strokeWidth",2),l([n.mAP],e.prototype,"lineDash",2),l([n.mAP],e.prototype,"lineDashOffset",2),l([n.mAP],e.prototype,"tooltip",2),e})(),{createDatumId:$M,Selection:HM,Group:jM,PointerEvents:WM}=s.n1,_M=(()=>{var e=class extends Uv{constructor(e){super({moduleCtx:e,categoryKey:void 0,pickModes:[]}),this.properties=new VM,this._chartTopology=void 0,this.itemGroup=this.contentGroup.appendChild(new jM({name:"itemGroup"})),this.datumSelection=HM.select(this.itemGroup,(()=>this.nodeFactory())),this.itemGroup.pointerEvents=WM.None}get topology(){return this.properties.topology??this._chartTopology}get focusable(){return!1}setOptionsData(){}setChartData(){}getNodeData(){}get hasData(){return!1}renderToOffscreenCanvas(){return!0}setChartTopology(e){this._chartTopology=e,this.topology===e&&(this.nodeDataRefresh=!0)}setZIndex(e){return super.setZIndex(e),this.contentGroup.zIndex=[0,e,0],this.highlightGroup.zIndex=[0,e,1],!0}nodeFactory(){const e=new zv;return e.renderMode=1,e.lineJoin="round",e.pointerEvents=WM.None,e}processData(){const{topology:e}=this;this.topologyBounds=e?.features.reduce(((e,t)=>{const i=t.geometry;return null==i?e:Vv(i,e)}),void 0),null==e&&this.ctx.logger.warnOnce("no topology was provided for [MapShapeBackgroundSeries]; nothing will be rendered.")}createNodeData(){const{id:e,topology:t,scale:i,properties:n}=this;if(null==t)return;const{fill:s,fillOpacity:a,stroke:o,strokeWidth:r,strokeOpacity:l,lineDash:h,lineDashOffset:c}=n,d=[];for(const[e,n]of t.features.entries()){const{geometry:t}=n,u=null!=t&&null!=i?Wv(t,i):void 0;null!=u&&d.push({series:this,datum:n,datumIndex:0,index:e,projectedGeometry:u,style:{fill:s,fillOpacity:a,stroke:o,strokeWidth:r,strokeOpacity:l,lineDash:h,lineDashOffset:c}})}return{itemId:e,nodeData:d,labelData:[]}}updateSelections(){this.nodeDataRefresh&&(this.contextNodeData=this.createNodeData(),this.nodeDataRefresh=!1)}update(){const{datumSelection:e}=this;this.updateSelections(),this.contentGroup.visible=this.visible,this.labelGroup.visible=this.visible;const{nodeData:t=[]}=this.contextNodeData??{};this.datumSelection=this.updateDatumSelection({nodeData:t,datumSelection:e}),this.updateDatumNodes({datumSelection:e})}updateDatumSelection(e){return e.datumSelection.update(e.nodeData,void 0,(e=>$M(e.index)))}updateDatumNodes(e){const{datumSelection:t}=e;t.each(((e,t)=>{const{projectedGeometry:i}=t;if(null==i)return e.visible=!1,void(e.projectedGeometry=void 0);e.visible=!0,e.projectedGeometry=i,e.setProperties(t.style)}))}resetAnimation(){}getLegendData(){return[]}getTooltipContent(e){}pickFocus(){}computeFocusBounds(e){}hasItemStylers(){return!1}};return e.className="MapShapeBackgroundSeries",e.type="map-shape-background",e})(),{mapShapeBackgroundSeriesThemeableOptionsDef:GM}=s.n1,KM=(()=>({...GM,...n.XxK,type:(0,n.mw3)((0,n.dYl)("map-shape-background")),topology:n.eWm}))(),YM=(()=>({type:"series",name:"map-shape-background",chartType:"topology",enterprise:!0,version:s.xv,dependencies:[kv],options:KM,themeTemplate:{...Dv,series:{fill:wv({$applySwitch:[{$path:"type"},{$path:["/1",{$mapPalette:"fill"},{$mapPalette:"hierarchyColors"}]},["gradient",n.mPJ],["image",n.pwE],["pattern",n.yms]]}),stroke:{$ref:"chartBackgroundColor"},strokeWidth:1,...(0,n.fs4)({selection:n.zg6})}},create:e=>new _M(e)}))(),{createDatumId:UM,toHighlightString:XM,toSelectionString:ZM}=s.n1;function qM(e,t,i,n,a){const{styler:o}=e.properties;let r={};if(!t&&o){const t=function(e,t,i,n){const{id:a}=e,{angleKey:o,cornerRadius:r,fill:l,fillOpacity:h,lineDash:c,lineDashOffset:d,radiusKey:u,stackGroup:p,stroke:g,strokeOpacity:m,strokeWidth:y}=e.properties;return{angleKey:o,cornerRadius:r,fill:l,fillOpacity:h,highlightState:XM(t??s.n1.HighlightState.None),selectionState:ZM(i),candidateState:ZM(n),lineDash:c,lineDashOffset:d,radiusKey:u,seriesId:a,stackGroup:p,stroke:g,strokeOpacity:m,strokeWidth:y}}(e,i,n,a);r=e.ctx.optionsGraphService.resolvePartial(["series",`${e.declarationOrder}`],e.cachedCallWithContext(o,t)??{},{pick:!1})??{}}return{cornerRadius:r.cornerRadius??e.properties.cornerRadius,fill:r.fill??e.properties.fill,fillOpacity:r.fillOpacity??e.properties.fillOpacity,lineDash:r.lineDash??e.properties.lineDash,lineDashOffset:r.lineDashOffset??e.properties.lineDashOffset,stroke:r.stroke??e.properties.stroke,strokeOpacity:r.strokeOpacity??e.properties.strokeOpacity,strokeWidth:r.strokeWidth??e.properties.strokeWidth,op
1acity:1}}function QM(e,t,i,s,a,o){const{properties:r}=e,{itemStyler:l}=r,h=e.getHighlightStyle(i,t?.datumIndex,s),c=e.getSelectionStyle(t?.datumIndex,a,o);let d=(0,n.HFk)(c,h,qM(e,void 0===t,s,a,o));if(null!=l&&null!=t){const s=e.cachedDatumCallback(UM(e.getDatumId(t),i?"highlight":"node"),(()=>{const n=function(e,t,i,n){const{id:s,properties:a}=e,{angleKey:o,radiusKey:r}=a,l=e.ctx.highlightManager?.getActiveHighlight(),h=e.getHighlightStateString(l,i,t.datumIndex),c=e.getSelectionStateString(t.datumIndex),d=e.getCandidateStateString(t.datumIndex),u=e.filterItemStylerFillParams(n.fill)??n.fill;return{seriesId:s,datum:t.datum,highlightState:h,selectionState:c,candidateState:d,angleKey:o,radiusKey:r,...n,fill:u}}(e,t,i,d);return e.ctx.optionsGraphService.resolvePartial(["series",`${e.declarationOrder}`],e.callWithContext(l,n))}));s&&(d=(0,n.HFk)(s,d))}return d}var{DEFAULT_POLAR_DIRECTION_KEYS:JM,DEFAULT_POLAR_DIRECTION_NAMES:ek,PolarAxis:tk,diff:ik,fixNumericExtent:nk,groupAccumulativeValueProperty:sk,keyProperty:ak,normaliseGroupTo:ok,resetLabelFn:rk,seriesLabelFadeInAnimation:lk,seriesLabelFadeOutAnimation:hk,valueProperty:ck,animationValidation:dk,createDatumId:uk,SeriesNodePickMode:pk,CategoryScale:gk,motion:mk,updateLabelNode:yk,getItemStyles:fk}=s.n1,xk=class extends s.n1.PolarSeries{constructor(e,{animationResetFns:t}){super({moduleCtx:e,categoryKey:"angleValue",propertyKeys:JM,propertyNames:ek,canHaveAxes:!0,pickModes:[pk.NEAREST_NODE,pk.EXACT_SHAPE_MATCH],animationResetFns:{...t,label:rk}}),this.groupScale=new gk,this.circleCache={r:0,cx:0,cy:0}}createNodeParams(e){return{...super.createNodeParams(e),angleKey:this.properties.angleKey,radiusKey:this.properties.radiusKey}}getSeriesDomain(e){const{dataModel:t,processedData:i}=this;if(!i||!t)return{domain:[]};if(e===n.tv$.Angle)return t.getDomain(this,"angleValue","key",i);{const e=t.getDomain(this,"radiusValue-end","value",i).domain,s=[(0,n.Wwf)(e[0],(0,n.s1j)(e[0])),(0,n.cGV)(e[1],(0,n.s1j)(e[1]))];return{domain:nk(s)}}}async processData(e){const{angleKey:t,radiusKey:i,normalizedTo:s}=this.properties,a=!this.ctx.animationManager.isSkipped(),o=this.getStackId(),r=`${o}-trailing`,l=[];(0,n.O9V)(s)&&l.push(ok([o,r],Math.abs(s))),this.needsDataModelDiff()&&this.processedData&&l.push(ik(this.id,this.processedData)),a&&l.push(dk());const h=this.visible?{}:{forceValue:0},c=this.axes[n.tv$.Radius]?.scale.type,d=this.axes[n.tv$.Angle]?.scale.type,u=this.properties.allowNullKeys??!1;await this.requestDataModel(e,this.data,{props:[ak(t,d,{id:"angleValue",allowNullKey:u}),ck(i,c,{id:"radiusValue-raw",invalidValue:null,...h}),...sk(i,"normal",{id:"radiusValue-end",rangeId:"radiusValue-range",invalidValue:null,groupId:o,separateNegative:!0,...h},c),...sk(i,"trailing",{id:"radiusValue-start",invalidValue:null,groupId:r,separateNegative:!0,...h},c),...l],groupByKeys:!0,groupByData:!1}),this.animationState.transition("updateData")}didCircleChange(){const e=this.radius,t=this.centerX,i=this.centerY,n=this.circleCache;return(e!==n.r||t!==n.cx||i!==n.cy)&&(this.circleCache={r:e,cx:t,cy:i},!0)}isRadiusAxisReversed(){return this.axes[n.tv$.Radius]?.isReversed()}maybeRefreshNodeData(){(this.didCircleChange()||this.nodeDataRefresh)&&(this.contextNodeData=this.createNodeData(),this.nodeData=this.contextNodeData?.nodeData??[],this.nodeDataRefresh=!1)}getAxisInnerRadius(){const e=this.axes[n.tv$.Radius];return e instanceof tk?this.radius*e.innerRadiusRatio:0}createNodeData(){const{processedData:e,dataModel:t,groupScale:i}=this;if(!t||"grouped"!==e?.type)return;const s=this.axes[n.tv$.Angle],a=this.axes[n.tv$.Radius],o=s?.scale,r=a?.scale;if(!o||!r)return;const l=t.resolveKeysById(this,"angleValue",e),h=t.resolveColumnById(this,"radiusValue-start",e,"mixed-numeric"),c=t.resolveColumnById(this,"radiusValue-end",e,"mixed-numeric"),d=t.resolveColumnById(this,"radiusValue-raw",e,"mixed-numeric");let u=0,p=0;s instanceof z&&(u=s.options.groupPaddingInner,p=s.options.paddingInner);const g=(o.bandwidth??0)*(1-p),{index:m,visibleGroupCount:y}=this.ctx.seriesStateManager.getVisiblePeerGroupIndex(this);i.domain=Array.from({length:y}).map(((e,t)=>String(t))),i.range=[-g/2,g/2],i.paddingInner=y>1?u:0;const f=this.isRadiusAxisReversed(),x=this.getAxisInnerRadius(),b=this.radius,v=b+x,{angleKey:S,radiusKey:M,angleName:k,radiusName:D,legendItemName:w,label:I}=this.properties,A=this.getSeriesDomain(n.tv$.Radius).domain,C=(e,t,i,n)=>
1{const s=this.getLabelText(t,e,M,"radius",A,I,{value:t,datum:e,angleKey:S,radiusKey:M,angleName:k,radiusName:D,legendItemName:w});if(s)return{x:i,y:n,text:s,textAlign:"center",textBaseline:"middle"}},N=[],L=fk(((e,t,i)=>QM(this,e,t,i,void 0,void 0))),P={itemId:M,nodeData:N,labelData:N,styles:L};if(!this.visible)return P;const{dataSources:T}=e,O=T.get(this.id)?.data??[];for(const{datumIndex:s}of t.forEachGroupDatum(this,e)){const e=O[s],t=l[s];if(void 0===t&&!this.properties.allowNullKeys)return;const a=d[s],u=a>=0&&!Object.is(a,-0),p=h[s],g=c[s],y=u===f;if(void 0===p||void 0===g)return;let S,M,k;if(1===O.length)S=-.5*Math.PI,M=1.5*Math.PI,k=S;else{const e=o.convert(t);S=(0,n.YcT)(e+i.convert(String(m))),M=(0,n.YcT)(S+i.bandwidth),k=S+i.bandwidth/2}const D=v-r.convert(p),w=v-r.convert(g),I=(D+w)/2,A=Math.cos(k)*I,L=Math.sin(k)*I,P=this.properties.label.enabled?C(e,a,A,L):void 0,T=this.getColumnWidth(S,M);N.push({series:this,datum:e,datumIndex:s,point:{x:A,y:L,size:0},midPoint:{x:A,y:L},label:P,angleValue:t,radiusValue:a,negative:y,innerRadius:D,outerRadius:w,stackInnerRadius:D,stackOuterRadius:w,startAngle:S,endAngle:M,midAngle:k,axisInnerRadius:x,axisOuterRadius:b,columnWidth:T,index:s})}return{itemId:M,nodeData:N,labelData:N,styles:L}}getColumnWidth(e,t){return Number.NaN}update({seriesRect:e}){const t=this.checkResize(e);this.maybeRefreshNodeData(),this.contentGroup.translationX=this.centerX,this.contentGroup.translationY=this.centerY,this.highlightGroup.translationX=this.centerX,this.highlightGroup.translationY=this.centerY,this.labelGroup&&(this.labelGroup.translationX=this.centerX,this.labelGroup.translationY=this.centerY),this.updateSectorSelection(this.itemSelection,!1),this.updateSectorSelection(this.highlightSelection,!0),this.updateLabels(),t&&this.animationState.transition("resize"),this.animationState.transition("update")}updateSectorSelection(e,t){const{contextNodeData:i}=this;if(!i)return;const a=this.ctx.highlightManager.getActiveHighlight();let o=[];const r=this.ctx.highlightManager?.getActiveHighlight();t?r?.datum&&r.series===this&&o.push(r):o=this.nodeData;const l=this.isRadiusAxisReversed(),h=l?this.radius:this.getAxisInnerRadius(),c=l?this.getAxisInnerRadius():this.radius,d=this.getShapeFillBBox(),u=this.hasItemStylers(),p=u&&null==this.properties.itemStyler?new Map:void 0;e.update(o,void 0,(e=>this.getDatumId(e))).each(((e,o)=>{const{midPoint:l}=o,g=this.getDataSelectionState(o.datumIndex),m=this.getDataCandidacyState(o.datumIndex);if(u){const e=this.getHighlightState(r,t,o.datumIndex);if(null==p)o.style=QM(this,o,t,e,g,m);else{const i=`${e}:${g??"-"}:${m??"-"}`;let n=p.get(i);void 0===n&&(n=QM(this,o,t,e,g,m),p.set(i,n)),o.style=n}}const y=!s.n1.isUnselected(g);e.zIndex=y?1:0;const f=o.style??i.styles[this.getHighlightState(a,t,o.datumIndex)],x=f.fill,b=(0,n.MBc)(x)&&"item"===x.bounds?{centerX:l?.x??0,centerY:l?.y??0}:{centerX:0,centerY:0,innerRadius:h,outerRadius:c};this.updateItemPath(e,o,t),e.setStyleProperties(f,d,b),e.cornerRadius=f.cornerRadius??0,e.lineJoin="round"}))}updateLabels(){const e=this.ctx.highlightManager?.getActiveHighlight(),t=e?.series===this&&e?.datum?e:void 0,i=t?[t]:[];this.labelSelection.update(this.nodeData).each(((t,i)=>{yk(this,t,this.properties,this.properties.label,i.label,{isHighlight:!1,activeHighlight:e}),t.fillOpacity=this.getHighlightStyle(!1,i.datumIndex).opacity??1})),this.highlightLabelSelection.update(i,void 0,(e=>this.getDatumId(e))).each(((t,i)=>{yk(this,t,this.properties,this.properties.label,i.label,{isHighlight:!0,activeHighlight:e}),t.fillOpacity=this.getHighlightStyle(!0,i.datumIndex).opacity??1}))}animateEmptyUpdateReady(){const{labelSelection:e}=this,t=this.getColumnTransitionFunctions();mk.fromToMotion(this.id,"datums",this.ctx.animationManager,[this.itemSelection],t),lk(this,"labels",this.ctx.animationManager,e,this.highlightLabelSelection)}animateClearingUpdateEmpty(){const{itemSelection:e}=this,{animationManager:t}=this.ctx,i=this.getColumnTransitionFunctions();mk.fromToMotion(this.id,"datums",t,[e],i),hk(this,"labels",t,this.labelSelection,this.highlightLabelSelection)}getTooltipContent(e){const{id:t,dataModel:i,processedData:a,axes:o,properties:r}=this,{angleKey:l,angleName:h,radiusKey:c,radiusName:d,legendItemName:u,tooltip:p}=r,g=o[n.tv$.Angle],m=o[n.tv$.Radius],y=this.nodeData?.[e];if(!(i&&a&&g&&m&&y))return;
1const f=a.dataSources.get(this.id)?.data[e],x=i.resolveKeysById(this,"angleValue",a)[e],b=i.resolveColumnById(this,"radiusValue-raw",a,"mixed-numeric")[e];if(void 0===x&&!this.properties.allowNullKeys)return;const v=QM(this,y,!1,void 0,void 0,void 0);return this.formatTooltipWithContext(p,{heading:this.getAxisValueText(g,"tooltip",x,f,l,void 0),symbol:this.legendItemSymbol(),data:[{label:d,fallbackLabel:c,value:this.getAxisValueText(m,"tooltip",b,f,c,void 0),missing:s.n1.isTooltipValueMissing(b)}]},{seriesId:t,datum:f,title:h,angleKey:l,angleName:h,radiusKey:c,radiusName:d,legendItemName:u,...v})}pickNodeClosestDatum(e){return this.pickNodeNearestDistantObject(e,this.itemSelection.nodes())}pickNodesInBBoxPredicate(){return s.n1.pickSectorsInBBoxPredicate(this)}legendItemSymbol(){const{fill:e,stroke:t,fillOpacity:i,strokeOpacity:a,strokeWidth:o,lineDash:r,lineDashOffset:l}=qM(this,!1,s.n1.HighlightState.None,void 0,void 0),h={fill:e??"rgba(0, 0, 0, 0)",stroke:t??"rgba(0, 0, 0, 0)",fillOpacity:i,strokeOpacity:a,strokeWidth:o,lineDash:r,lineDashOffset:l};return(0,n.MBc)(h.fill)&&(h.fill={...h.fill,gradient:"linear",rotation:0,reverse:!1}),{marker:h}}getLegendData(e){if("category"!==e)return[];const{id:t,visible:i}=this,{radiusKey:n,radiusName:s,legendItemName:a,showInLegend:o}=this.properties;return[{legendType:"category",id:t,itemId:n,seriesId:t,enabled:i,label:{text:a??s??n},symbol:this.legendItemSymbol(),legendItemName:a,hideInLegend:!o}]}getDatumId(e){return uk(e.angleValue)}computeLabelsBBox(){return null}},{SeriesProperties:bk,makeSeriesTooltip:vk,Label:Sk}=s.n1,Mk=(()=>{var e=class extends bk{constructor(){super(...arguments),this.angleKeyAxis="angle",this.radiusKeyAxis="radius",this.fill="black",this.fillOpacity=1,this.stroke="black",this.strokeWidth=1,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.cornerRadius=0,this.rotation=0,this.label=new Sk,this.tooltip=vk()}getStyle(){const{fill:e,fillOpacity:t,stroke:i,strokeWidth:n,strokeOpacity:s,lineDash:a,lineDashOffset:o,cornerRadius:r}=this;return{fill:e,fillOpacity:t,stroke:i,strokeWidth:n,strokeOpacity:s,lineDash:a,lineDashOffset:o,cornerRadius:r,opacity:1}}};return l([n.mAP],e.prototype,"angleKey",2),l([n.mAP],e.prototype,"angleName",2),l([n.mAP],e.prototype,"radiusKey",2),l([n.mAP],e.prototype,"radiusName",2),l([n.mAP],e.prototype,"angleKeyAxis",2),l([n.mAP],e.prototype,"radiusKeyAxis",2),l([n.mAP],e.prototype,"legendItemName",2),l([n.mAP],e.prototype,"fill",2),l([n.mAP],e.prototype,"fillOpacity",2),l([n.mAP],e.prototype,"stroke",2),l([n.mAP],e.prototype,"strokeWidth",2),l([n.mAP],e.prototype,"strokeOpacity",2),l([n.mAP],e.prototype,"lineDash",2),l([n.mAP],e.prototype,"lineDashOffset",2),l([n.mAP],e.prototype,"cornerRadius",2),l([n.mAP],e.prototype,"styler",2),l([n.mAP],e.prototype,"itemStyler",2),l([n.mAP],e.prototype,"rotation",2),l([n.mAP],e.prototype,"stackGroup",2),l([n.mAP],e.prototype,"normalizedTo",2),l([n.mAP],e.prototype,"label",2),l([n.mAP],e.prototype,"tooltip",2),e})(),{motion:kk}=s.n1;function Dk(){const e={startAngle:new Map,endAngle:new Map},t=["startAngle","endAngle"],i=(t,i)=>({startAngle:e.startAngle.get(t)[i],endAngle:e.endAngle.get(t)[i]});return{calculate:(i,n,s)=>{for(const a of t){const t=e[a];let o=("removed"===s||"updated"===s?i:n)[a],r=("removed"===s?i:n)[a];Number.isNaN(r)&&(r=i.unsafePreviousDatum?.[a]??Number.NaN);const l=o-r;Math.abs(l)>Math.PI&&(o-=2*Math.sign(l)*Math.PI),t.set(n,{from:o,to:r})}},from:e=>i(e,"from"),to:e=>i(e,"to")}}function wk(e,t,i){if("updated"===i){if(null==e.previousDatum||Number.isNaN(e.unsafePreviousDatum.startAngle)||Number.isNaN(e.unsafePreviousDatum.endAngle))return"added";if(Number.isNaN(t.startAngle)||Number.isNaN(t.endAngle))return"removed"}return"added"===i&&null!=e.previousDatum?"updated":i}function Ik(e,{innerRadius:t,outerRadius:i,columnWidth:n,axisInnerRadius:s,axisOuterRadius:a,startAngle:o,endAngle:r}){return{innerRadius:t,outerRadius:i,columnWidth:n,axisInnerRadius:s,axisOuterRadius:a,startAngle:o,endAngle:r}}var{SectorBox:Ak,motion:Ck}=s.n1;function Nk(e){const{negative:t,innerRadius:i,outerRadius:n,stackInnerRadius:s,stackOuterRadius:a}=e;return{innerRadius:t?a:s,outerRadius:t?s:a,clipInnerRadius:t?n:i,clipOuterRadius:t?i:n}}function Lk(e,t){const{startAngle:i,endAngle:n}=t,{innerRadius:s,outerRadius:a,clipInnerRadius:o,clipOuterRadius:r}=Nk(t);return{innerRadius:s,outerRadius:a,startAngle:i,endAngle:n,clipSector:new Ak(i,n,o,r)}}var{Sector:Pk,SectorBox:Tk}=s.n1,Ok=(()=>{var e=class extends xk{constructor(e){super(e,{animationResetFns:{item:Lk}}),this.properties=new Mk}setZIndex(e){return super.setZIndex(e),this.contentGroup.zIndex=[0,n.$5h.FOREGROUND,e],this.highlightGroup.zIndex=[0,n.$5h.HIGHLIGHT,e],this.labelGroup.zIndex=[0,n.$5h.LABEL,e],!0}getStackId(){return`nightingale-stack-${this.seriesGrouping?.groupIndex??this.id}-yValues`}nodeFactory(){return new Pk}updateItemPath(e,t,i){const{negative:n}=t;if(e.centerX=0,e.centerY=0,e.startOuterCornerRadius=n?0:this.properties.cornerRadius,e.endOuterCornerRadius=n?0:this.properties.cornerRadius,e.startInnerCornerRadius=n?this.properties.cornerRadius:0,e.endInnerCornerRadius=n?this.properties.cornerRadius:0,i){const{startAngle:i,endAngle:n}=t,{innerRadius:s,outerRadius:a,clipInnerRadius:o,clipOuterRadius:r}=Nk(t);e.innerRadius=s,e.outerRadius=a,e.startAngle=i,e.endAngle=n,e.clipSector=new Tk(i,n,o,r)}}getColumnTransitionFunctions(){return function(e){const t=Dk();return{toFn:(i,n,s)=>{const{startAngle:a,endAngle:o}=t.to(n);let r,l,h;if("removed"===s)r=e,l=e,h=new Ak(a,o,r,l);else{let t,i;({innerRadius:r,outerRadius:l,clipInnerRadius:t,clipOuterRadius:i}=Nk(n)),Number.isNaN(r)&&(r=e),Number.isNaN(l)&&(l=e),Number.isNaN(t)&&(t=e),Number.isNaN(i)&&(i=e),h=new Ak(a,o,t,i
1)}return{innerRadius:r,outerRadius:l,startAngle:a,endAngle:o,clipSector:h}},fromFn:(i,n,s)=>{s=wk(i,n,s),t.calculate(i,n,s);const{startAngle:a,endAngle:o}=t.from(n);let r,l,h;return"removed"===s||"updated"===s?(r=i.innerRadius,l=i.outerRadius,h=i.clipSector):(r=e,l=e),h??(h=new Ak(a,o,r,l)),{innerRadius:r,outerRadius:l,startAngle:a,endAngle:o,clipSector:h,phase:Ck.NODE_UPDATE_STATE_TO_PHASE_MAPPING[s]}}}}(this.isRadiusAxisReversed()?this.radius:this.getAxisInnerRadius())}hasItemStylers(){return this.properties.selection.enabled||null!=this.properties.itemStyler||null!=this.properties.styler||null!=this.properties.label.itemStyler}};return e.className="NightingaleSeries",e.type="nightingale",e})(),{nightingaleSeriesThemeableOptionsDef:Rk}=s.n1,Ek=(()=>({...n.XxK,...Rk,type:(0,n.mw3)((0,n.dYl)("nightingale")),angleKey:(0,n.mw3)(n.YjP),radiusKey:(0,n.mw3)(n.YjP),angleName:n.YjP,radiusName:n.YjP,legendItemName:n.YjP,grouped:n.zMY,stacked:n.zMY,stackGroup:n.YjP,normalizedTo:n.aig}))();Ek.angleKeyAxis=(0,n._Le)(n.YjP),Ek.radiusKeyAxis=(0,n._Le)(n.YjP);var zk={series:{fill:{$applySwitch:[{$path:"type"},{$palette:"fill"},["gradient",n.cEq],["image",n.pwE],["pattern",n.eu4]]},stroke:{$if:[{$eq:[{$palette:"type"},"inbuilt"]},{$ref:"chartBackgroundColor"},{$palette:"stroke"}]},strokeWidth:1,label:{...n.mgV,enabled:!1,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"textColor"}},highlight:{...n.fil,bringToFront:!1},selection:n.zg6},axes:{[n.QYe.ANGLE_CATEGORY]:{shape:{$findFirstSiblingNotOperation:n.Xk0.CIRCLE},groupPaddingInner:0,paddingInner:0,label:{spacing:10}},[n.QYe.RADIUS_NUMBER]:{shape:{$findFirstSiblingNotOperation:n.Xk0.CIRCLE}}}},Bk={type:"series",name:"nightingale",chartType:"polar",enterprise:!0,stackable:!0,groupable:!0,stackedByDefault:!0,version:s.xv,dependencies:[s.T9],options:Ek,defaultAxes:{angle:{type:n.QYe.ANGLE_CATEGORY},radius:{type:n.QYe.RADIUS_NUMBER}},axisKeys:{[n.tv$.X]:"xKeyAxis",[n.tv$.Y]:"yKeyAxis"},themeTemplate:zk,create:e=>new Ok(e)},{SeriesProperties:Fk,makeSeriesTooltip:Vk,Label:$k,LabelPlacementStyle:Hk,DropShadow:jk}=s.n1,Wk=(()=>{var e=class extends $k{constructor(){super(...arguments),this.placement="inside-center",this.spacing=0,this.insideStyle=new Hk,this.outsideStyle=new Hk}};return l([n.mAP],e.prototype,"placement",2),l([n.mAP],e.prototype,"spacing",2),l([n.mAP],e.prototype,"insideStyle",2),l([n.mAP],e.prototype,"outsideStyle",2),e})(),_k=(()=>{var e=class extends $k{constructor(){super(...arguments),this.spacing=0}};return l([n.mAP],e.prototype,"spacing",2),l([n.mAP],e.prototype,"placement",2),e})(),Gk=(()=>{var e=class extends Fk{constructor(){super(...arguments),this.fills=[],this.fillOpacity=1,this.strokes=[],this.strokeWidth=1,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.direction="vertical",this.reverse=void 0,this.spacing=0,this.aspectRatio=void 0,this.shadow=(new jk).set({enabled:!1}),this.label=new Wk,this.stageLabel=new _k,this.tooltip=Vk()}getStyle(e=0){const{fills:t,strokes:i,fillOpacity:n,strokeWidth:s,strokeOpacity:a,lineDash:o,lineDashOffset:r}=this;return{fill:t[e%t.length],fillOpacity:n,stroke:i[e%i.length],strokeWidth:s,strokeOpacity:a,lineDash:o,lineDashOffset:r,opacity:1}}};return l([n.mAP],e.prototype,"stageKey",2),l([n.mAP],e.prototype,"valueKey",2),l([n.mAP],e.prototype,"fills",2),l([n.mAP],e.prototype,"fillOpacity",2),l([n.mAP],e.prototype,"strokes",2),l([n.mAP],e.prototype,"strokeWidth",2),l([n.mAP],e.prototype,"strokeOpacity",2),l([n.mAP],e.prototype,"lineDash",2),l([n.mAP],e.prototype,"lineDashOffset",2),l([n.mAP],e.prototype,"direction",2),l([n.mAP],e.prototype,"reverse",2),l([n.mAP],e.prototype,"spacing",2),l([n.mAP],e.prototype,"aspectRatio",2),l([n.mAP],e.prototype,"itemStyler",2),l([n.mAP],e.prototype,"shadow",2),l([n.mAP],e.prototype,"label",2),l([n.mAP],e.prototype,"stageLabel",2),l([n.mAP],e.prototype,"tooltip",2),e})();function Kk(e,{x:t,y:i,top:n,right:s,bottom:a,left:o}){e.x0=t-n/2,e.x1=t+n/2,e.x2=t+a/2,e.x3=t-a/2,e.y0=i-o/2,e.y1=i-s/2,e.y2=i+s/2,e.y3=i+o/2}var{barLabelDataContext:Yk,valueProperty:Uk,SeriesNodePickMode:Xk,createDatumId:Zk,BBox:qk,Group:Qk,Selection:Jk,Text:eD,PointerEvents:tD,fromToMotion:iD,seriesLabelFadeInAnimation:nD,getLabelStyles:sD,updateLabelNode:aD,buildBarLabelCandidates:oD,createBarCandidateStyleResolver:rD,createBarPositionedCandidateResolver:lD,resolveBarLabelCandidate:hD,expandLabelBoxExtent:cD,expandPlacementLabelBoxExtent:dD,fitLabelToContainerAutoSize:uD,pickPlacementStyle:pD}=s.n1,gD=(()=>{var e=class extends s.n1.DataModelSeries{constructor(e){super({moduleCtx:e,categoryKey:void 0,pickModes:[Xk.EXACT_SHAPE_MATCH,Xk.NEAREST_NODE]}),this.properties=new Gk,this.itemGroup=this.contentGroup.appendChild(new Qk({name:"itemGroup"})),this.itemLabelGroup=this.contentGroup.appendChild(new Qk({name:"itemLabelGroup"})),this.stageLabelGroup=this.contentGroup.appendChild(new Qk({name:"stageLabelGroup"})),this.datumSelection=Jk.select(this.itemGroup,(()=>this.nodeFactory())),this.labelSelection=Jk.select(this.itemLabelGroup,eD),this.stageLabelSelection=Jk.select(this.stageLabelGroup,eD),this.highlightLabelSelection=Jk.select(this.highlightLabelGroup,eD),this.highlightDatumSelection=Jk.select(this.highlightNodeGroup,(()=>this.nodeFactory())),this.animationState=new n.Z37("empty",{empty:{update:{target:"ready",action:()=>this.animateEmptyUpdateReady()},reset:"empty",skip:"ready"},ready:{clear:"empty",reset:"empty",skip:"ready"}},(()=>this.checkProcessedDataAnimatable())),this.itemLabelGroup.pointerEvents=tD.None,this.stageLabelGroup.pointerEvents=tD.None,this.cleanup.register(this.ctx.eventsHub.on("legend:item-click",(e=>this.onLegendItemClick(e))))}nodeFactory(){return new Tf}getNodeData(){return this.contextNodeData?.nodeData}
1resetAnimation(e){"initial"===e?this.animationState.transition("reset"):"ready"===e&&this.animationState.transition("skip")}async processData(e){if(null==this.data)return;const{id:t,visible:i,ctx:{legendManager:n}}=this,{stageKey:s,valueKey:a}=this.properties,o=this.visible?{}:{forceValue:0},r=this.properties.allowNullKeys??!1;await this.requestDataModel(e,this.data,{props:[Uk(s,"category",{id:"xValue",allowNullKey:r}),Uk(a,"number",{id:"yValue",...o,validation:(e,s,a)=>i&&(n?.getItemEnabled({seriesId:t,itemId:a})??!0),invalidValue:0})]})}createNodeData(){const{id:e,dataModel:t,processedData:i,properties:s,visible:a,ctx:{legendManager:o}}=this,{stageKey:r,valueKey:l,direction:h,reverse:c="horizontal"===h,spacing:d,aspectRatio:u,label:p,stageLabel:g}=s;if(null==t||null==i)return;const m="horizontal"===h,y=t.resolveColumnById(this,"xValue",i,"object"),f=t.resolveColumnById(this,"yValue",i,"mixed-numeric"),x=t.getDomain(this,"xValue","value",i).domain,b=t.getDomain(this,"yValue","value",i).domain,v=this.ctx.domManager.isRtl,S=(0,n.K$y)(g),M="after"===g.placement===v;let k,D;m?(k="center",D="before"===g.placement?"bottom":"top"):(k=M?"right":"left",D="middle");const w=g.enabled?[]:void 0;let I=0,A=0,C=0;const N=i.dataSources.get(this.id)?.data??[];for(const[t,i]of N.entries()){const s=y[t];if(void 0===s&&!this.properties.allowNullKeys)continue;const h=f[t],c=a&&(o?.getItemEnabled({seriesId:e,itemId:t})??!0);if(C+=(0,n.Roz)(h),null==w)continue;const d=this.getLabelText(s,i,r,"x",x,this.properties.stageLabel,{datum:i,value:h,stageKey:r,valueKey:l},this.properties.allowNullKeys??!1),{width:u,height:g}=(0,n.cyL)(d)?(0,n.wEO)(d,p):S.measureLines((0,n.i$)(d));I=Math.max(I,u),A=Math.max(A,g),w.push({x:Number.NaN,y:Number.NaN,text:d,textAlign:k,textBaseline:D,visible:c})}const L=this._nodeDataDependencies?.seriesRectWidth??0,P=this._nodeDataDependencies?.seriesRectHeight??0,T=d*(i.input.count-1);let O,R,E;if(m){const e=A+g.spacing;O=new qk(0,"before"===g.placement?e:0,L,P-e)}else{const e=I+g.spacing;O=new qk(M?e:0,0,L-e,P)}if(null!=u&&0!==u){const e="horizontal"===h?1/u:u,t=Math.min(O.width,O.height*e),i=t/e;O=new qk(O.x+(O.width-t)/2,O.y+(O.height-i)/2,t,i)}m?E="before"===g.placement?O.y-g.spacing:O.y+O.height+g.spacing:R=M?O.x-g.spacing:O.x+O.width+g.spacing;const z=O.width-(m?T:0),B=O.height-(m?0:T);if(z<0||B<0)return;const F=[],V=[],$=this.createLabelContext(m);let H=0,j=0;for(const[t,i]of N.entries()){const s=y[t];if(void 0===s&&!this.properties.allowNullKeys)continue;const h=f[t],u=a&&(o?.getItemEnabled({seriesId:e,itemId:t})??!0),g=H+(0,n.Roz)(h),x=(H+g)/(2*C),v=(g-H)/C,S=m?z*x+d*t:.5*z,M=m?.5*B:B*x+d*t,k=O.x+S,D=O.y+M;if(null!=w){const e=w[j++];e.x=R??k,e.y=E??D}let I,A,N,L;if(m){const e=z*v;I=e,N=e;const t=(S+e/2)*(B/O.width),i=(S-e/2)*(B/O.width);A=c?O.height-t:t,L=c?O.height-i:i}else{const e=B*v;A=e,L=e;const t=(M-e/2)*(z/O.height),i=(M+e/2)*(z/O.height);I=c?O.width-t:t,N=c?O.width-i:i}const P=this.getLabelText(h,i,l,"y",b,p,{datum:i,value:h,stageKey:r,valueKey:l}),T=this.createLabelDatum({labelContext:$,stage:{x:k,y:D,top:I,right:A,bottom:N,left:L},horizontal:m,text:P,datum:i,datumIndex:t,visible:u});V.push(T),F.push({series:this,datum:i,datumIndex:t,index:t,xValue:s,yValue:h,x:k,y:D,top:I,right:A,bottom:N,left:L,label:T,enabled:u,midPoint:{x:k,y:D},style:this.getItemStyle({datumIndex:t,datum:i},!1)}),H=g}return{itemId:e,nodeData:F,labelData:V,stageLabelData:w,bounds:O}}labelStylerParams(){const{stageKey:e,valueKey:t}=this.properties;return{stageKey:e,valueKey:t}}routesThroughEngine(){return(0,n.qpr)(this.properties.label)}createLabelContext(e){const{label:t}=this.properties,i=wx(t.placement,"inside-center",!e,this.ctx.domManager.isRtl);return{placements:i.map((e=>ux[e])),reportedPlacements:i,axes:Sx(i,vx(e),bx(!e)),routesThroughEngine:this.routesThroughEngine(),plotRegion:this.resolveLabelPlotRegion(t.collision),labelFit:(0,n.A_g)(t,!t.collision.alwaysShow)}}createLabelDatum({labelContext:e,stage:t,horizontal:i,text:s,datum:a,datumIndex:o,visible:r}){const{label:l}=this.properties,h=Mx(t,i),c=(0,n.Ocl)(h),d={x:t.x,y:t.y,rotation:0,offsetX:0,offsetY:0,textAlign:"center",textBaseline:"middle",text:s,ownBox:c,hidden:!1,datum:a,datumIndex:o,series:this,visible:r};if(!l.enabled)return d;const u=(0,n.kzl)(s,l),p=e=>h.vertical?e.height:e.width,g=(t,i)=>oD({...e.axes[t],placements:[e.placements[t]],reportedPlacements:[e.reportedPlacements[t]],orientations:["horizontal"],spacing:l.spacing,label:l,textWidth:u.width,textHeight:u.height,rect:i,hideable:!l.collision.alwaysShow,plotRegion:e.plotRegion,fitted:null!=e.labelFit,shapeAt:e=>(0,n.SXo)(h,h.vertical?e.y:e.x),text:s}),m=(t,i)=>{const s=g(t,c);if(0===s.length||!e.placements[t].startsWith("inside"))return s;const[a,o]=function(e,t,i){const n=e.vertical?t.y:t.x,s=e.vertical?t.textBaseline:t.textAlign;return"top"===s||"left"===s?[n,n+i]:"bottom"===s||"right"===s?[n-i,n]:[n-i/2,n+i/2]}(h,s[0].anchor,i);return g(t,(0,n.g0D)(h,a,o))},y=e.placements.flatMap(((e,t)=>m(t,p(u)))),[f]=y,x=null==f||e.routesThroughEngine?f:hD(f,d,rD(this,l,this.labelStylerParams(),void 0,(()=>f.placement)));if(null!=x&&(d.x=x.anchor.x,d.y=x.anchor.y,d.textAlign=x.anchor.textAlign,d.textBaseline=x.anchor.textBaseline,d.region=x.region,d.placement=x.placement),e.routesThroughEngine)d.candidates=y;else{const t=h.vertical?d.y:d.x,i=(0,n.SXo)(h,t);let a=uD(s,(0,n.eyx)(e.labelFit,i),l,x?.fitTo?.container);if(null!=e.labelFit&&null!=x){const t=p((0,n.kzl)(a.text,(0,n.lad)(l,a.fontSize)));if(t>p(u)){const i=m(0,t);
1a=uD(s,e.labelFit,l,i[0]?.fitTo?.container)}}d.fittedText=a.text,d.fittedFontSize=a.fontSize}return d}labelPlacementStyle(e){const{label:t}=this.properties;return null==e?void 0:pD(t,kx(e))}getLabelObstacles(){const{label:e,stageLabel:t,direction:i}=this.properties,s="horizontal"===i,a=dD(e),o=cD(t),r=[];for(const e of this.contextNodeData?.nodeData??[]){const t=Mx(e,s);r.push({kind:"custom",box:(0,n.Ocl)(t),overlaps:e=>(0,n.sbr)(t,e),category:"seriesItem"})}const l=(0,n.ZKh)(this.contextNodeData?.stageLabelData,(e=>({label:e.visible?{...e,rotation:0}:void 0,config:t,box:o}))),h=this.usesPlacedLabels||!e.enabled?void 0:(0,n.ZKh)(this.contextNodeData?.labelData,(t=>({label:t.visible?t:void 0,config:(0,n.lad)(e,t.fittedFontSize),box:a})));for(const e of[l,h])null!=e&&r.push(...e);return r.length>0?r:void 0}getLabelData(){const{label:e}=this.properties;if(!this.usesPlacedLabels||!e.enabled)return[];const{alwaysShow:t,collideWith:i,threshold:s,measureBox:a,fitFor:o}=Yk(e),r=[];for(const e of this.contextNodeData?.labelData??[]){if(""===e.text||null==e.candidates)continue;const l=a(e.text);r.push((0,n.Nv9)(e.text,l.width,l.height,e.candidates,e,e.ownBox??{x:e.x,y:e.y,width:0,height:0},t,i,s,!0,o(e.text),e))}return r}getLabelCandidateResolver(){const e=this.labelStylerParams();return lD(this,this.properties.label,(()=>e))}updatePlacedLabelData(e){(0,n.she)(e),(0,n.HkM)(this.contextNodeData?.labelData,e,(e=>e)),this.refreshPlacedLabelNodes()}refreshPlacedLabelNodes(){const e=this.ctx.highlightManager?.getActiveHighlight(),t=e?.series===this&&null!=e.datum?e:void 0;this.highlightLabelSelection=this.highlightLabelSelection.update(this.getHighlightLabelData([],t)??[]),this.itemLabelGroup.batchedUpdate((()=>{this.updateValueLabelNodes({labelSelection:this.labelSelection,isHighlight:!1})})),this.highlightLabelGroup.batchedUpdate((()=>{this.updateValueLabelNodes({labelSelection:this.highlightLabelSelection,isHighlight:!0})}))}updateSelections(){this.nodeDataRefresh&&(this.contextNodeData=this.createNodeData(),this.nodeDataRefresh=!1),this.usesPlacedLabels=this.routesThroughEngine()}update({seriesRect:e}){this.checkResize(e);const{datumSelection:t,labelSelection:i,stageLabelSelection:n,highlightDatumSelection:s,highlightLabelSelection:a}=this;this.updateSelections(),this.contentGroup.visible=this.visible,this.contentGroup.opacity=this.getOpacity();let o=this.ctx.highlightManager?.getActiveHighlight();null==o||o.series===this&&null!=o.datum||(o=void 0);const r=this.contextNodeData?.nodeData??[],l=this.contextNodeData?.labelData??[],h=this.contextNodeData?.stageLabelData??[];this.datumSelection=this.updateDatumSelection({nodeData:r,datumSelection:t}),this.updateDatumStyles({datumSelection:t,isHighlight:!1}),this.updateDatumNodes({datumSelection:t,isHighlight:!1}),this.labelSelection=this.updateLabelSelection({labelData:l,labelSelection:i}),this.updateValueLabelNodes({labelSelection:this.labelSelection,isHighlight:!1}),this.stageLabelSelection=this.updateStageLabelSelection({stageLabelData:h,stageLabelSelection:n}),this.updateStageLabelNodes({labelSelection:n,labelProperties:this.properties.stageLabel,checkActiveHighlight:!0});const c=this.getHighlightLabelData(l,o)??[];this.highlightLabelSelection=a.update(c),this.updateValueLabelNodes({labelSelection:this.highlightLabelSelection,isHighlight:!0}),this.highlightDatumSelection=this.updateDatumSelection({nodeData:null==o?[]:[o],datumSelection:s}),this.updateDatumStyles({datumSelection:s,isHighlight:!0}),this.updateDatumNodes({datumSelection:s,isHighlight:!0}),this.animationState.transition("update")}updateDatumSelection(e){return e.datumSelection.update(e.nodeData)}getItemStyle({datumIndex:e,datum:t},i){const{properties:s}=this,{itemStyler:a}=s,o=this.getHighlightStyle(i,e),r=this.getSelectionStyle(e);let l=(0,n.HFk)(r,o,s.getStyle(e));if(null!=a&&null!=e){const s=this.cachedDatumCallback(Zk(e,i?"highlight":"node"),(()=>{const n=this.makeItemStylerParams(t,e,i,l);return this.ctx.optionsGraphService.resolvePartial(["series",`${this.declarationOrder}`],this.callWithContext(a,n))}));s&&(l=(0,n.HFk)(s,l))}return l}makeItemStylerParams(e,t,i,n){const{id:s,properties:a}=this,{stageKey:o,valueKey:r}=a,l=this.ctx.highlightManager?.getActiveHighlight(),h=this.getHighlightStateString(l,i,t),c=this.getSelectionStateString(t),d=this.getCandidateStateString(t),u=this.filterItemStylerFillParam
1s(n.fill)??n.fill;return{seriesId:s,datum:e,stageKey:o,valueKey:r,highlightState:h,selectionState:c,candidateState:d,...n,fill:u}}updateDatumStyles({datumSelection:e,isHighlight:t}){e.each(((e,i)=>{i.style=this.getItemStyle(i,t)}))}updateDatumNodes({datumSelection:e}){const{properties:t}=this,{shadow:i}=t,n=this.contextNodeData?.bounds,s=n?{series:n,axis:n}:void 0;e.each(((e,t)=>{e.setStyleProperties(t.style,s),Kk(e,t),e.fillShadow=i}))}updateLabelSelection(e){return e.labelSelection.update(this.properties.label.enabled?e.labelData:[])}updateStageLabelSelection(e){return e.stageLabelSelection.update(e.stageLabelData)}updateValueLabelNodes(e){const{label:t}=this.properties,i=this.labelStylerParams(),n=this.ctx.highlightManager?.getActiveHighlight(),{labelSelection:s,isHighlight:a}=e;s.each(((e,s)=>{if(s.hidden)return void(e.visible=!1);const o=this.labelPlacementStyle(s.placement),r=(this.getHighlightStyle(a,s.datumIndex).opacity??1)*(o?.fillOpacity??t.fillOpacity??1);e.opacity=r,e.fillOpacity=r,aD(this,e,i,t,s,{isHighlight:a,activeHighlight:n},void 0,o,{placement:s.placement,orientation:"horizontal"}),s.visible||a||(e.visible=!1)}))}updateStageLabelNodes(e){const t=this.ctx.highlightManager?.getActiveHighlight(),{labelSelection:i,labelProperties:n,isHighlight:s=!1,checkActiveHighlight:a=!1}=e;i.each(((e,i,o)=>{const{visible:r,x:l,y:h,text:c,textAlign:d,textBaseline:u}=i,p=s||a&&t?.datumIndex===o,g=this.getHighlightStyle(p,o),m=sD(this,void 0,this.properties,n,p,t),{color:y,fontSize:f,fontStyle:x,fontWeight:b,fontFamily:v}=m;e.visible=r&&!0===m.enabled,e.x=l,e.y=h,e.text=c,e.fill=y,e.opacity=(g.opacity??1)*(m.fillOpacity??1),e.fillOpacity=(g.opacity??1)*(m.fillOpacity??1),e.fontStyle=x,e.fontWeight=b,e.fontSize=f,e.fontFamily=v,e.textAlign=d,e.textBaseline=u,e.setBoxing(m)}))}getHighlightLabelData(e,t){if(t?.label)return[{...t.label}]}computeFocusBounds(e){const t=this.getNodeData()?.[e.datumIndex];if(void 0!==t)for(const e of this.datumSelection)if(e.datum===t)return e.node}getTooltipContent(e){const{id:t,dataModel:i,processedData:s,properties:a}=this,{stageKey:o,valueKey:r,tooltip:l}=a;if(!i||!s)return;const h=s.dataSources.get(this.id)?.data[e],c=i.resolveColumnById(this,"xValue",s,"object")[e],d=i.resolveColumnById(this,"yValue",s,"mixed-numeric")[e],u=this.properties.allowNullKeys??!1;if(void 0===c&&!u)return;const p=this.getLabelText(c,h,o,"x",i.getDomain(this,"xValue","value",s).domain,this.properties.stageLabel,{datum:h,value:c,stageKey:o,valueKey:r}),g=this.getItemStyle({datumIndex:e,datum:h},!1);return this.formatTooltipWithContext(l,{symbol:this.legendItemSymbol(e),data:[{label:(0,n.boc)(p),value:(0,n.boc)(String(d))}]},{seriesId:t,datum:h,title:void 0,stageKey:o,valueKey:r,...g})}getSeriesDomain(){return{domain:[Number.NaN,Number.NaN]}}getSeriesRange(){return[Number.NaN,Number.NaN]}pickNodeClosestDatum({x:e,y:t}){let i,n,s=1/0;return this.datumSelection.each(((a,o)=>{const r=a.distanceSquared(e,t);r<s&&(s=r,i=o,n=a)})),null==i||null==n?void 0:{datum:i,distance:Math.sqrt(s),target:n}}legendItemSymbol(e){const{fills:t,strokes:i,strokeWidth:n,fillOpacity:s,strokeOpacity:a,lineDash:o,lineDashOffset:r}=this.properties;return{marker:{fill:t[e]??"black",fillOpacity:s,stroke:i[e]??"black",strokeWidth:n,strokeOpacity:a,lineDash:o,lineDashOffset:r}}}getLegendData(e){const{processedData:t,dataModel:i,id:n,ctx:{legendManager:s},visible:a}=this;if(!i||!t||"category"!==e)return[];const{showInLegend:o}=this.properties,r=i.resolveColumnById(this,"xValue",t,"object");return(t.dataSources.get(this.id)?.data??[]).map(((e,t)=>{const i=r[t],l=this.properties.allowNullKeys??!1;if(null!=i||l)return{legendType:"category",id:n,datum:e,itemId:t,seriesId:n,enabled:a&&(s?.getItemEnabled({seriesId:n,itemId:t})??!0),label:{text:String(i)},symbol:this.legendItemSymbol(t),hideInLegend:!o}})).filter((e=>null!=e))}animateReset(){this.ctx.animationManager.skipCurrentBatch(),this.ctx.animationManager.stopByAnimationGroupId(this.id)}animateEmptyUpdateReady(){const{datumSelection:e,labelSelection:t,properties:i}=this,n=(s=i.direction,{fromFn:(e,t)=>{const{x:i,y:n}=t;let{top:a,right:o,bottom:r,left:l}=t;return"vertical"===s?(a=0,r=0):(l=0,o=0),{x:i,y:n,top:a,right:o,bottom:r,left:l}},toFn:(e,t)=>
1{const{x:i,y:n,top:s,right:a,bottom:o,left:r}=t;return{x:i,y:n,top:s,right:a,bottom:o,left:r}},applyFn:Kk});var s;iD(this.id,"nodes",this.ctx.animationManager,[e],n),nD(this,"labels",this.ctx.animationManager,t)}hasItemStylers(){return this.properties.selection.enabled||null!=this.properties.itemStyler||null!=this.properties.label.itemStyler}};return e.className="PyramidSeries",e.type="pyramid",e})(),{pyramidSeriesThemeableOptionsDef:mD}=s.n1,yD=(()=>({...mD,...n.XxK,type:(0,n.mw3)((0,n.dYl)("pyramid")),stageKey:(0,n.mw3)(n.YjP),valueKey:(0,n.mw3)(n.YjP)}))(),fD=(()=>({series:{direction:"vertical",strokeWidth:{$isUserOption:["./strokes/0",2,0]},spacing:2,fills:{$applyCycle:[{$size:{$path:["./data",{$path:"/data"}]}},{$palette:"fills"},{$applySwitch:[{$path:["/type",void 0,{$value:"$1"}]},{$value:"$1"},["gradient",n.Euh],["pattern",n.eu4],["image",n.pwE]]}]},strokes:{$applyCycle:[{$size:{$path:["./data",{$path:"/data"}]}},{$palette:"strokes"}]},label:{...n.VTt,...n.F$C,enabled:!0,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},padding:8,spacing:8,collision:{threshold:4,alwaysShow:n.O2O,...(0,n.fs4)({collideWith:{seriesItems:!0}})},insideStyle:(0,n.KVS)("chartBackgroundColor"),outsideStyle:(0,n.KVS)("textColor"),placement:"inside-center"},stageLabel:{...n.mgV,enabled:!0,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"textColor"},spacing:12},shadow:{enabled:!1,color:n.KU9,xOffset:3,yOffset:3,blur:5},highlight:{enabled:{$path:["/highlight/enabled",!0]},unhighlightedItem:{opacity:.4}}}}))(),xD={type:"series",name:"pyramid",chartType:"standalone",enterprise:!0,solo:!0,version:s.xv,dependencies:[Py],options:yD,themeTemplate:fD,create:e=>new gD(e)},bD={series:{stroke:{$palette:"stroke"},label:{...n.mgV,enabled:!1,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"textColor"}},marker:{enabled:!0,fill:{$applySwitch:[{$path:"type"},{$palette:"fill"},["gradient",n.pRl],["image",n.pwE],["pattern",n.eu4]]},stroke:{$palette:"stroke"},fillOpacity:1,shape:"circle",size:6,strokeOpacity:1,strokeWidth:{$isUserOption:["./stroke",1,0]}},highlight:n.U3R,selection:n.zg6,tooltip:{range:{$path:["/tooltip/range","nearest"]}}},axes:{[n.QYe.ANGLE_CATEGORY]:{label:{spacing:10}}}},vD=(0,n.HFk)({series:{stroke:n.HHJ,strokeWidth:2}},bD),SD=(0,n.HFk)({series:{fill:{$applySwitch:[{$path:"type"},{$palette:"fill"},["gradient",n.Euh],["image",n.pwE],["pattern",n.eu4]]},fillOpacity:.8,strokeWidth:2,marker:{enabled:!1}}},bD),{Label:MD,SeriesMarker:kD,SeriesProperties:DD,makeSeriesTooltip:wD}=s.n1,ID=(()=>{var e=class extends DD{constructor(){super(...arguments),this.angleKeyAxis="angle",this.radiusKeyAxis="radius",this.stroke="black",this.strokeWidth=1,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.rotation=0,this.marker=new kD,this.label=new MD,this.tooltip=wD(),this.connectMissingData=!1}};return l([n.mAP],e.prototype,"angleKey",2),l([n.mAP],e.prototype,"radiusKey",2),l([n.mAP],e.prototype,"angleName",2),l([n.mAP],e.prototype,"radiusName",2),l([n.mAP],e.prototype,"angleKeyAxis",2),l([n.mAP],e.prototype,"radiusKeyAxis",2),l([n.mAP],e.prototype,"legendItemName",2),l([n.mAP],e.prototype,"stroke",2),l([n.mAP],e.prototype,"strokeWidth",2),l([n.mAP],e.prototype,"strokeOpacity",2),l([n.mAP],e.prototype,"lineDash",2),l([n.mAP],e.prototype,"lineDashOffset",2),l([n.mAP],e.prototype,"rotation",2),l([n.mAP],e.prototype,"styler",2),l([n.mAP],e.prototype,"marker",2),l([n.mAP],e.prototype,"label",2),l([n.mAP],e.prototype,"tooltip",2),l([n.mAP],e.prototype,"connectMissingData",2),e})();var{DEFAULT_POLAR_DIRECTION_KEYS:AD,DEFAULT_POLAR_DIRECTION_NAMES:CD,PolarAxis:ND,SeriesNodePickMode:LD,keyProperty:PD,valueProperty:TD,fixNumericExtent:OD,seriesLabelFadeInAnimation:RD,markerFadeInAnimation:ED,maxMarkerStrokePickInflation:zD,resetMarkerFn:BD,resetLabelFn:FD,animationValidation:VD,computeMarkerFocusBounds:$D,BBox:HD,Group:jD,Path:WD,Selection:_D,Text:GD,Marker:KD,updateLabelNode:YD,getMarkerStyles:UD}=s.n1,XD=(()=>{var e=class e extends s.n1.PolarSeries{constructor(e){super({moduleCtx:e,categoryKey:"angleValue",propertyKeys:AD,propertyNames:CD,pickModes:[LD.NEAREST_NODE,LD.EXACT_SHAPE_MATCH],canHaveAxes:!0,animationResetFns:{item:BD,label:FD},clipFocusBox:!1}),this.lineGroup=this.contentGroup.appendChild(new jD({name:"radar-line"})),this.lineSelection=_D.select(this.lineGroup,WD),this.resetInvalidToZero=!1,this.hideWithSize0=!1,this.markerNodesPickable=!0,this.circleCache={r:0,cx:0,cy:0},this.lineGroup.zIndex=0,this.itemGroup.zIndex=1}createNodeParams(e){return{...super.createNodeParams(e),angleKey:this.properties.angleKey,radiusKey:this.properties.radiusKey}}hasPickableNodeShapes(){return this.markerNodesPickable}renderToOffscreenCanvas(){return(this.nodeData?.length??0)>0&&"cutout"===this.getDrawingMode(!1)||super.renderToOffscreenCanvas()}nodeFactory(){return new KD}getSeriesDomain(e){const{dataModel:t,processedData:i}=this;if(!i||!t)return{domain:[]};if(e===n.tv$.Angle){return{domain:t.getDomain(this,"angleValue","key",i).domain,sortMetadata:t.getKeySortMetadata(this,"angleValue",i)}}
1{const e=t.getDomain(this,"radiusValue","value",i).domain,s=(0,n.Xxv)(0===e.length?e:[0].concat(e));return{domain:OD(s)}}}async processData(e){const{angleKey:t,radiusKey:i}=this.properties,s=[];this.ctx.animationManager.isSkipped()||s.push(VD());const a=this.axes[n.tv$.Radius]?.scale.type,o=this.axes[n.tv$.Angle]?.scale.type,r=this.properties.allowNullKeys??!1;await this.requestDataModel(e,this.data,{props:[PD(t,o,{id:"angleValue",allowNullKey:r}),TD(i,a,{id:"radiusValue",invalidValue:void 0}),...s]}),this.animationState.transition("updateData")}didCircleChange(){const e=this.radius,t=this.centerX,i=this.centerY,n=this.circleCache;return(e!==n.r||t!==n.cx||i!==n.cy)&&(this.circleCache={r:e,cx:t,cy:i},!0)}getAxisInnerRadius(){const e=this.axes[n.tv$.Radius];return e instanceof ND?this.radius*e.innerRadiusRatio:0}maybeRefreshNodeData(){(this.didCircleChange()||this.nodeDataRefresh)&&(this.contextNodeData=this.createNodeData(),this.nodeData=this.contextNodeData?.nodeData??[],this.nodeDataRefresh=!1)}createNodeData(){const{processedData:e,dataModel:t}=this;if(!e||!t)return;const{angleKey:i,radiusKey:s,angleName:a,radiusName:o,legendItemName:r,marker:l,label:h}=this.properties,c=this.axes[n.tv$.Angle]?.scale,d=this.axes[n.tv$.Radius]?.scale;if(!c||!d)return;const u=t.resolveKeysById(this,"angleValue",e),p=t.resolveColumnById(this,"radiusValue",e,"mixed-numeric"),g=this.getAxisInnerRadius(),m=this.getSeriesDomain(n.tv$.Radius).domain,y=e.dataSources.get(this.id)?.data??[],f=this.properties.allowNullKeys??!1,x=[],b=(0,n.A_g)(h,!1);for(let e=0;e<y.length;e++){const t=y[e],v=u[e];if(void 0===v&&!f)continue;const S=p[e],M=c.convert(v),k=this.radius+g-d.convert(S),D=Math.cos(M),w=Math.sin(M),I=D*k,A=w*k;let C;if(h.enabled){const e=this.getLabelText(S,t,s,"radius",m,h,{value:S,datum:t,angleKey:i,radiusKey:s,angleName:a,radiusName:o,legendItemName:r});if(e){let t="right";(0,n.YXt)(D,0)?t="center":D>0&&(t="left");let i="bottom";(0,n.YXt)(w,0)?i="middle":w>0&&(i="top"),C={x:I+D*l.size,y:A+w*l.size,text:(0,n.HRu)(e,b,h),textAlign:t,textBaseline:i}}}x.push({series:this,datum:t,datumIndex:e,index:e,point:{x:I,y:A,size:l.size},midPoint:{x:I,y:A},label:C,angleValue:v,radiusValue:S,missing:!(0,n.BfI)(M)||!(0,n.BfI)(k)})}return{itemId:s,nodeData:x,labelData:x,styles:UD(this,this.properties,l)}}update({seriesRect:e}){const t=this.checkResize(e),i=!this.ctx.animationManager.isSkipped(),{series:n}=this.ctx.highlightManager?.getActiveHighlight()??{};this.highlightGroup.visible=(i||this.visible)&&n===this,this.maybeRefreshNodeData(),this.contentGroup.translationX=this.centerX,this.contentGroup.translationY=this.centerY,this.highlightGroup.translationX=this.centerX,this.highlightGroup.translationY=this.centerY,this.labelGroup&&(this.labelGroup.translationX=this.centerX,this.labelGroup.translationY=this.centerY),this.updatePathSelections(),this.updateMarkerSelection(),this.updateHighlightSelection(),this.updatePathNodes(),this.hasItemStylers()&&(this.updateDatumStyles(this.itemSelection,!1),this.updateDatumStyles(this.highlightSelection,!0));const s=this.ctx.chartService.highlight?.drawingMode??"overlay";this.updateMarkers(this.itemSelection,!1,"overlay"),this.updateMarkers(this.highlightSelection,!0,s),this.updateLabels(),t&&this.animationState.transition("resize"),this.animationState.transition("update")}updatePathSelections(){const e=this.visible?[!0]:[];this.lineSelection.update(e)}updateMarkerSelection(){const{marker:e}=this.properties;e.isDirty()&&(this.itemSelection.clear(),this.itemSelection.cleanup(),this.itemSelection=_D.select(this.itemGroup,(()=>this.nodeFactory()),!1));const t=function(e){const t=null==e.properties.styler?e.properties.marker.enabled:e.getStyle(void 0).marker.enabled;return e.properties.selection.enabled?{needsNodeData:!0,hideWithSize0:!t}:{needsNodeData:t,hideWithSize0:!1}}(this);this.hideWithSize0=t.hideWithSize0,this.markerNodesPickable=t.needsNodeData&&!t.hideWithSize0;const i=t.needsNodeData?this.nodeData:[];this.itemSelection.update(i)}updateHighlightSelection(){const{marker:e,styler:t}=this.properties;e.isDirty()&&(this.highlightSelection.clear(),this.highlightSelection.cleanup(),this.highlightSelection=_D.select(this.highlightGroup,(()=>this.nodeFactory()),!1));const i=null==t?e.enabled:this.getStyle(void 0).marker.enabled,n=this.ctx.highlightManager?.getActiveHighlight(),s=this.visible&&e.shape&&i&&n?.datum?[{...n}]:[];this.highlightSelection.update(s)}
1getMarkerFill(e){return e?.fill??this.getStyle(void 0).marker.fill}getDatumStylerProperties(e){const{id:t,properties:i}=this,{angleKey:n,radiusKey:s}=i;return{seriesId:t,datum:e,angleKey:n,radiusKey:s}}updateDatumStyles(t,i){const{hideWithSize0:n}=this,{marker:a}=this.properties,{itemStyler:o}=a,r={marker:a,isHighlight:i,hideWithSize0:n};null!=o?this.runMarkerStylePass(t,i,r,{compute:e.computeStylerStyle,apply:e.applyStylerDatum}):this.runMarkerStylePass(t,i,r,{compute:e.computeNoStylerMarkerStyle,apply:s.n1.Series.assignCachedStyle})}updateMarkers(e,t,i){const n=this.getShapeFillBBox(),{contextNodeData:s,hideWithSize0:a}=this;if(!s)return;const o=this.ctx.highlightManager.getActiveHighlight();i=this.getDrawingMode(t,i);const r=zD(s.styles);e.each(((e,l)=>{const h=l.style??s.styles[this.getHighlightState(o,t,l.datumIndex)];this.applyMarkerStyle(h,e,l.point,n,{hideWithSize0:a,pickInflation:r}),e.drawingMode=i}))}updateLabels(){const{properties:e}=this,t=this.ctx.highlightManager?.getActiveHighlight(),i=t?.series===this&&t?.datum?[{...t}]:[];this.labelSelection.update(this.nodeData).each(((i,n)=>{const s=!1;i.fillOpacity=this.getHighlightStyle(s,n.datumIndex).opacity??1,YD(this,i,e,e.label,n.label,{isHighlight:s,activeHighlight:t})})),this.highlightLabelSelection.update(i).each(((i,n)=>{const s=!0;i.fillOpacity=this.getHighlightStyle(s,n.datumIndex).opacity??1,YD(this,i,e,e.label,n.label,{isHighlight:s,activeHighlight:t})}))}getTooltipContent(e){const{id:t,dataModel:i,processedData:a,axes:o,properties:r}=this,{angleKey:l,angleName:h,radiusKey:c,radiusName:d,legendItemName:u,tooltip:p,marker:g}=r,m=o[n.tv$.Angle],y=o[n.tv$.Radius];if(!(i&&a&&m&&y))return;const f=a.dataSources.get(this.id)?.data[e],x=i.resolveKeysById(this,"angleValue",a)[e],b=i.resolveColumnById(this,"radiusValue",a,"mixed-numeric")[e],v=this.properties.allowNullKeys??!1;if(void 0===x&&!v)return;const S=this.getMarkerStyle(g,{datum:f,datumIndex:e},this.getDatumStylerProperties(f),{isHighlight:!1});return this.formatTooltipWithContext(p,{heading:this.getAxisValueText(m,"tooltip",x,f,l,void 0,v),symbol:this.legendItemSymbol(),data:[{label:d,fallbackLabel:c,value:this.getAxisValueText(y,"tooltip",b,f,c,void 0),missing:s.n1.isTooltipValueMissing(b)}]}
1,{seriesId:t,datum:f,title:h,angleKey:l,radiusKey:c,angleName:h,radiusName:d,legendItemName:u,...S})}legendItemSymbol(){const{stroke:e,strokeWidth:t,strokeOpacity:i,lineDash:n,marker:s}=this.getStyle(void 0);return{marker:{shape:s.shape,enabled:s.enabled||t<=0,fill:this.getMarkerFill()??s.stroke??e??"rgba(0, 0, 0, 0)",stroke:s.stroke??e??"rgba(0, 0, 0, 0)",fillOpacity:s.fillOpacity,strokeOpacity:s.strokeOpacity,strokeWidth:s.strokeWidth,lineDash:s.lineDash,lineDashOffset:s.lineDashOffset},line:{enabled:!0,stroke:e,strokeOpacity:i,strokeWidth:t,lineDash:n}}}getLegendData(e){if("category"!==e)return[];const{id:t,ctx:{legendManager:i},visible:n}=this,{radiusKey:s,radiusName:a,legendItemName:o,showInLegend:r}=this.properties;return[{legendType:"category",id:t,itemId:s,seriesId:t,enabled:n&&(i?.getItemEnabled({seriesId:t,itemId:s})??!0),label:{text:o??a??s},symbol:this.legendItemSymbol(),legendItemName:o,hideInLegend:!r}]}pickNodeClosestDatum(e){const{nodeData:t,centerX:i,centerY:n}=this,{x:s,y:a}=e,o=this.radius;if(Math.hypot(s-i,a-n)>o+this.maxChartMarkerSize)return;let r,l=1/0;for(const s of t){const{point:{x:t=Number.NaN,y:a=Number.NaN}={}}=s;if(Number.isNaN(t)||Number.isNaN(a))continue;const o=Math.hypot(e.x-t-i,e.y-a-n);o<l&&(l=o,r=s)}if(r){return{datum:r,distance:Math.max(l-(r.point?.size??0)/2,0),target:this.contentGroup}}}computeLabelsBBox(){const{label:e}=this.properties;this.maybeRefreshNodeData();const t=[],i=new GD;for(const n of this.nodeData){if(!e.enabled||!n.label)continue;i.text=n.label.text,i.x=n.label.x,i.y=n.label.y,i.setFont(e),i.setAlign(n.label);const s=i.getBBox();t.push(s)}return 0===t.length?null:HD.merge(t)}getLineNode(){return this.lineSelection?.at(0)}beforePathAnimation(){this.updatePathNodes()}getPathNodesStyle(){const e=this.ctx.highlightManager?.getActiveHighlight(),t=this.getHighlightState(e),i=this.getHighlightStyle(void 0,void 0,t),s=this.getDataSelectionState(void 0),a=this.getSelectionStyle(void 0,s),o=this.getStyle(t);return(0,n.HFk)(a,i,o)}getLinePoints(){const{nodeData:e,resetInvalidToZero:t}=this,{connectMissingData:i}=this.properties;if(0===e.length)return[];const s=this.axes[n.tv$.Radius],a=this.axes[n.tv$.Angle],o=a?.isReversed(),r=s?.isReversed(),l=r&&!o?[...e].reverse():e,h=[];let c,d=!1;for(const[e,n]of l.entries()){let{x:s,y:a}=n.point;const o=Number.isNaN(s)||Number.isNaN(a);o||(c??(c=n)),o&&!i&&(s=0,a=0);const r=0===e||!t&&!i&&(o||d);h.push({x:s,y:a,moveTo:r}),d=o}return void 0!==c&&h.push({x:c.point.x,y:c.point.y,moveTo:!1}),h}animateSinglePath(e,t,i){const{path:s}=e;s.clear(!0);const a=this.getAxisInnerRadius(),o=this.axes[n.tv$.Radius],r=o?.isReversed(),l=r?this.radius+a-o?.scale.convert(0):a;for(const e of t){const{x:t,y:n,arc:a,radius:o=0,startAngle:r=0,endAngle:h=0,moveTo:c}=e,d=Math.atan2(n,t),u=l*Math.cos(d)*(1-i)+t*i,p=l*Math.sin(d)*(1-i)+n*i;a?s.arc(t,n,o,r,h):c?s.moveTo(u,p):s.lineTo(u,p)}e.checkPathDirty()}animatePaths(e){const t=this.getLinePoints(),i=this.getLineNode();i&&this.animateSinglePath(i,t,e)}animateEmptyUpdateReady(){const{itemSelection:e,labelSelection:t}=this,{animationManager:i}=this.ctx;this.beforePathAnimation(),i.animate({id:`${this.id}_'path`,groupId:this.id,from:0,to:1,phase:"initial",collapsable:!1,onUpdate:e=>this.animatePaths(e),onStop:()=>this.animatePaths(1)}),ED(this,i,"added",this.getAnimationDrawingModes(),e),RD(this,"labels",i,t,this.highlightLabelSelection)}animateWaitingUpdateReady(e){super.animateWaitingUpdateReady(e),this.resetPaths()}animateReadyResize(e){super.animateReadyResize(e),this.resetPaths()}resetPaths(){const e=this.getLineNode();if(e){const{path:t}=e,i=this.getLinePoints(),n=this.getStyle(void 0);e.fill=void 0,e.stroke=n.stroke,e.strokeWidth=n.strokeWidth,e.strokeOpacity=n.strokeOpacity,e.lineDash=n.lineDash,e.lineDashOffset=n.lineDashOffset,t.clear(!0);for(const{x:e,y:n,moveTo:s}of i)s?t.moveTo(e,n):t.lineTo(e,n);return e.checkPathDirty(),n}}getStylerResult(e,t,i,n){const{styler:s}=this.properties;if(s){const a=this.makeStylerParams(t,i,n),o=this.cachedCallWithContext(s,a)??{},r=this.ctx.optionsGraphService.resolvePartial(["series",`${this.declarationOrder}`],o,{pick:!1});r&&(e=r)}return e}getFormattedMarkerStyle(e){const{angleKey:t,radiusKey:i}=this.properties;return this.getMarkerStyle(this.properties.marker,e,{angleKey:t,radiusKey:i},{isHighlight:!0})}computeFocusBounds(e){return $D(this,e)}hasItemStylers(){return this.properties.selection.enabled||null!=this.properties.styler||null!=this.properties.marker.itemStyler||null!=this.properties.label.itemStyler}};return e.className="RadarSeries",e.computeNoStylerMarkerStyle=(e,t,i,n,s)=>{const a=e.getStyle(i),{stroke:o,strokeWidth:r,strokeOpacity:l}=a;return e.getMarkerStyle(t.marker,s,void 0,{isHighlight:t.isHighlight,highlightState:i,selectionState:n,hideWithSize0:t.hideWithSize0},a.marker,{stroke:o,strokeWidth:r,strokeOpacity:l})},e.computeStylerStyle=(e,t,i)=>e.getStyle(i),e.applyStylerDatum=(e,t,i,n,s,a)=>{const{stroke:o,strokeWidth:r,strokeOpacity:l}=a;i.style=e.getMarkerStyle(t.marker,i,e.getDatumStylerProperties(i.datum),{isHighlight:t.isHighlight,highlightState:n,selectionState:s,hideWithSize0:t.hideWithSize0},a.marker,{stroke:o,strokeWidth:r,strokeOpacity:l})},e})(),ZD=(()=>{var e=class extends ID{constructor(){super(...arguments),this.fill="black",this.fillOpacity=1}};return l([n.mAP],e.prototype,"fill",2),l([n.mAP],e.prototype,"fillOpacity",2),e}
1)(),{Group:qD,HighlightState:QD,Path:JD,PointerEvents:ew,Selection:tw,toHighlightString:iw,toSelectionString:nw}=s.n1,sw=(()=>{var e=class extends XD{constructor(e){super(e),this.properties=new ZD,this.areaGroup=this.contentGroup.appendChild(new qD({name:"radar-area"})),this.areaSelection=tw.select(this.areaGroup,JD),this.resetInvalidToZero=!0,this.areaGroup.zIndex=-1}updatePathSelections(){const e=this.visible?[!0]:[];this.areaSelection.update(e),super.updatePathSelections()}getAreaNode(){return this.areaSelection.at(0)}getMarkerFill(e){if(null!=e?.fill)return e.fill;const t=this.getStyle(void 0);return t.marker.fill??t.fill}updatePathNodes(){const e=this.getPathNodesStyle(),{fill:t,fillOpacity:i,strokeWidth:n,stroke:s,strokeOpacity:a,lineDash:o,lineDashOffset:r,opacity:l}=e,h=this.getLineNode();h&&h.setProperties({fill:void 0,lineJoin:"round",lineCap:"round",pointerEvents:ew.None,opacity:l,stroke:s,strokeWidth:n,strokeOpacity:a,lineDash:o,lineDashOffset:r});const c=this.getAreaNode();c&&(c.setStyleProperties({fill:t,fillOpacity:i,stroke:void 0}
1,this.getShapeFillBBox()),c.setProperties({lineJoin:"round",pointerEvents:ew.None,opacity:l}))}animatePaths(e){super.animatePaths(e);const t=this.getAreaNode();t&&this.animateSinglePath(t,this.getAreaPoints(),e)}getAreaPoints(){const e=this.getLinePoints(),t=e=>{const t=this.axes[e];return t instanceof s.n1.PolarAxis?t:void 0},i=t(n.tv$.Radius),a=t(n.tv$.Angle),o=i?.isReversed();if(!o)return e;const r=a?.getAxisLinePoints()?.points??[];return e.concat(...r)}resetPaths(){const e=super.resetPaths(),t=this.getAreaNode();if(t){const{path:i}=t,n=this.getAreaPoints(),s=e??this.getStyle(void 0),a=this.getShapeFillBBox();t.setStyleProperties({fill:s.fill,stroke:void 0,fillOpacity:s.fillOpacity,lineDash:s.lineDash,lineDashOffset:s.lineDashOffset},a),t.lineJoin=t.lineCap="round",i.clear(!0);for(const{x:e,y:t,moveTo:s,arc:a,radius:o=0,startAngle:r=0,endAngle:l=0}of n)a?i.arc(e,t,o,r,l):s?i.moveTo(e,t):i.lineTo(e,t);return i.closePath(),t.checkPathDirty(),s}}makeStylerParams(e,t,i){const{properties:n}=this,s=iw(e??QD.None),a=nw(t),o=nw(i);return{marker:{fill:n.marker.fill,fillOpacity:n.marker.fillOpacity,size:n.marker.size,shape:n.marker.shape,stroke:n.marker.stroke,strokeOpacity:n.marker.strokeOpacity,strokeWidth:n.marker.strokeWidth,lineDash:n.marker.lineDash,lineDashOffset:n.marker.lineDashOffset},highlightState:s,selectionState:a,candidateState:o,fill:n.fill,fillOpacity:n.fillOpacity,lineDash:n.lineDash,lineDashOffset:n.lineDashOffset,seriesId:this.id,stroke:n.stroke,strokeOpacity:n.strokeOpacity,strokeWidth:n.strokeWidth,angleKey:n.angleKey,radiusKey:n.radiusKey}}getStyle(e){const{marker:t,fill:i,fillOpacity:n,lineDash:s,lineDashOffset:a,stroke:o,strokeOpacity:r,strokeWidth:l}=this.properties,{size:h,shape:c,fill:d="transparent",fillOpacity:u}=t,p=this.getDataSelectionState(void 0),g=this.getDataCandidacyState(void 0),m=this.getStylerResult({},e,p,g);return m.marker??(m.marker={}),{fill:m.fill??i,fillOpacity:m.fillOpacity??n,lineDash:m.lineDash??s,lineDashOffset:m.lineDashOffset??a,stroke:m.stroke??o,strokeOpacity:m.strokeOpacity??r,strokeWidth:m.strokeWidth??l,marker:{enabled:m.marker.enabled??t.enabled,fill:m.marker.fill??d,fillOpacity:m.marker.fillOpacity??u,shape:m.marker.shape??c,size:m.marker.size??h,lineDash:m.marker.lineDash??t.lineDash??s,lineDashOffset:m.marker.lineDashOffset??t.lineDashOffset??a,stroke:m.marker.stroke??t.stroke??o,strokeOpacity:m.marker.strokeOpacity??t.strokeOpacity??r,strokeWidth:m.marker.strokeWidth??t.strokeWidth??l}}}};return e.className="RadarAreaSeries",e.type="radar-area",e})(),{radarAreaSeriesThemeableOptionsDef:aw}=s.n1,ow=(()=>({...n.XxK,...aw,type:(0,n.mw3)((0,n.dYl)("radar-area")),angleKey:(0,n.mw3)(n.YjP),radiusKey:(0,n.mw3)(n.YjP),angleName:n.YjP,radiusName:n.YjP,legendItemName:n.YjP}))();ow.angleKeyAxis=(0,n._Le)(n.YjP),ow.radiusKeyAxis=(0,n._Le)(n.YjP);var rw={type:"series",name:"radar-area",chartType:"polar",enterprise:!0,version:s.xv,dependencies:[s.T9],options:ow,defaultAxes:{angle:{type:n.QYe.ANGLE_CATEGORY},radius:{type:n.QYe.RADIUS_NUMBER}},axisKeys:{[n.tv$.Angle]:"angleKeyAxis",[n.tv$.Radius]:"radiusKeyAxis"},themeTemplate:SD,create:e=>new sw(e)},{HighlightState:lw,PointerEvents:hw,toHighlightString:cw,toSelectionString:dw}=s.n1,uw=(()=>{var e=class extends XD{constructor(){super(...arguments),this.properties=new ID}updatePathSelections(){this.lineSelection.update(this.visible?[!0]:[])}updatePathNodes(){const e=this.getLineNode();if(!e)return;const t=this.getPathNodesStyle(),{strokeWidth:i,stroke:n,strokeOpacity:s,lineDash:a,lineDashOffset:o,opacity:r}=t;e.setProperties({fill:void 0,lineJoin:"round",lineCap:"round",pointerEvents:hw.None,opacity:r,stroke:n,strokeWidth:i,strokeOpacity:s,lineDash:a,lineDashOffset:o})}makeStylerParams(e,t,i){const{properties:n}=this,s=cw(e??lw.None),a=dw(t),o=dw(i);return{marker:{fill:n.marker.fill,fillOpacity:n.marker.fillOpacity,size:n.marker.size,shape:n.marker.shape,stroke:n.marker.stroke,strokeOpacity:n.marker.strokeOpacity,strokeWidth:n.marker.strokeWidth,lineDash:n.marker.lineDash,lineDashOffset:n.marker.lineDashOffset},highlightState:s,selectionState:a,candidateState:o,lineDash:n.lineDash,lineDashOffset:n.lineDashOffset,seriesId:this.id,stroke:n.stroke,strokeOpacity:n.strokeOpacity,strokeWidth:n.strokeWidth,angleKey:n.angleKey,radiusKey:n.radiusKey}}getStyle(e){const{marker:t,lineDash:i,lineDashOffset:n,stroke:s,strokeOpacity:a,strokeWidth:o}=this.properties,{size:r,shape:l,fill:h="transparent",fillOpacity:c}=t,d=this.getDataSelectionState(void 0),u=this.getDataCandidacyState(void 0),p=this.getStylerResult({},e,d,u);return p.marker??(p.marker={}),{lineDash:p.lineDash??i,lineDashOffset:p.lineDashOffset??n,stroke:p.stroke??s,strokeOpacity:p.strokeOpacity??a,strokeWidth:p.strokeWidth??o,marker:{enabled:p.marker.enabled??t.enabled,fill:p.marker.fill??h,fillOpacity:p.marker.fillOpacity??c,shape:p.marker.shape??l,size:p.marker.size??r,lineDash:p.marker.lineDash??t.lineDash??i,lineDashOffset:p.marker.lineDashOffset??t.lineDashOffset??n,stroke:p.marker.stroke??t.stroke??s,strokeOpacity:p.marker.strokeOpacity??t.strokeOpacity??a,strokeWidth:p.marker.strokeWidth??t.strokeWidth??o}}}};return e.className="RadarLineSeries",e.type="radar-line",e})(),{radarLineSeriesThemeableOptionsDef:pw}=s.n1,gw=(()=>({...n.XxK,...pw,type:(0,n.mw3)((0,n.dYl)("radar-line")),angleKey:(0,n.mw3)(n.YjP),radiusKey:(0,n.mw3)(n.YjP),angleName:n.YjP,radiusName:n.YjP,legendItemName:n.YjP}))();gw.angleKeyAxis=(0,n._Le)(n.YjP),gw.radiusKeyAxis=(0,n._Le)(n.YjP);var mw={type:"series",name:"radar-line",chartType:"polar",enterprise:!0,version:s.xv,depen
1dencies:[s.T9],options:gw,defaultAxes:{angle:{type:n.QYe.ANGLE_CATEGORY},radius:{type:n.QYe.RADIUS_NUMBER}},axisKeys:{[n.tv$.Angle]:"angleKeyAxis",[n.tv$.Radius]:"radiusKeyAxis"},themeTemplate:vD,create:e=>new uw(e)},{SeriesProperties:yw,makeSeriesTooltip:fw,Label:xw}=s.n1,bw=(()=>{var e=class extends yw{constructor(){super(...arguments),this.angleKeyAxis="angle",this.radiusKeyAxis="radius",this.fill="black",this.fillOpacity=1,this.stroke="black",this.strokeWidth=1,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.cornerRadius=0,this.rotation=0,this.label=new xw,this.tooltip=fw()}getStyle(){const{fill:e,fillOpacity:t,stroke:i,strokeWidth:n,strokeOpacity:s,lineDash:a,lineDashOffset:o,cornerRadius:r}=this;return{fill:e,fillOpacity:t,stroke:i,strokeWidth:n,strokeOpacity:s,lineDash:a,lineDashOffset:o,cornerRadius:r,opacity:1}}};return l([n.mAP],e.prototype,"angleKey",2),l([n.mAP],e.prototype,"radiusKey",2),l([n.mAP],e.prototype,"angleName",2),l([n.mAP],e.prototype,"radiusName",2),l([n.mAP],e.prototype,"angleKeyAxis",2),l([n.mAP],e.prototype,"radiusKeyAxis",2),l([n.mAP],e.prototype,"legendItemName",2),l([n.mAP],e.prototype,"fill",2),l([n.mAP],e.prototype,"fillOpacity",2),l([n.mAP],e.prototype,"stroke",2),l([n.mAP],e.prototype,"strokeWidth",2),l([n.mAP],e.prototype,"strokeOpacity",2),l([n.mAP],e.prototype,"lineDash",2),l([n.mAP],e.prototype,"lineDashOffset",2),l([n.mAP],e.prototype,"cornerRadius",2),l([n.mAP],e.prototype,"styler",2),l([n.mAP],e.prototype,"itemStyler",2),l([n.mAP],e.prototype,"rotation",2),l([n.mAP],e.prototype,"stackGroup",2),l([n.mAP],e.prototype,"normalizedTo",2),l([n.mAP],e.prototype,"label",2),l([n.mAP],e.prototype,"tooltip",2),e})(),{SectorBox:vw,motion:Sw}=s.n1;function Mw(e){return{toFn:(t,i,n)=>{let s,a,o,r,l;return"removed"===n?(s=e,a=e,o=i.innerRadius,r=i.outerRadius,l=new vw(s,a,o,r)):(s=i.startAngle,a=i.endAngle,o=Number.isNaN(i.innerRadius)?t.innerRadius:i.innerRadius,r=Number.isNaN(i.outerRadius)?t.outerRadius:i.outerRadius,l=i.clipSector),{startAngle:s,endAngle:a,innerRadius:o,outerRadius:r,clipSector:l}},fromFn:(t,i,n)=>{let s,a,o,r,l;n=function(e,t,i){if("updated"===i){if(null==e.previousDatum||Number.isNaN(e.unsafePreviousDatum.innerRadius)||Number.isNaN(e.unsafePreviousDatum.outerRadius))return"added";if(Number.isNaN(t.innerRadius)||Number.isNaN(t.outerRadius))return"removed"}return"added"===i&&null!=e.previousDatum?"updated":i}(t,i,n),"removed"===n||"updated"===n?(s=t.startAngle,a=t.endAngle,o=t.innerRadius,r=t.outerRadius,l=t.clipSector):(s=e,a=e,o=i.innerRadius,r=i.outerRadius),l??(l=new vw(s,a,o,r));return{startAngle:s,endAngle:a,innerRadius:o,outerRadius:r,clipSector:l,phase:Sw.NODE_UPDATE_STATE_TO_PHASE_MAPPING[n]}}}}function kw(e,t){return{centerX:0,centerY:0,innerRadius:t.innerRadius,outerRadius:t.outerRadius,startAngle:t.startAngle,endAngle:t.endAngle,clipSector:t.clipSector}}var{DEFAULT_POLAR_DIRECTION_KEYS:Dw,DEFAULT_POLAR_DIRECTION_NAMES:ww,PolarAxis:Iw,diff:Aw,groupAccumulativeValueProperty:Cw,keyProperty:Nw,normaliseGroupTo:Lw,valueProperty:Pw,fixNumericExtent:Tw,resetLabelFn:Ow,seriesLabelFadeInAnimation:Rw,seriesLabelFadeOutAnimation:Ew,animationValidation:zw,createDatumId:Bw,CategoryScale:Fw,Sector:Vw,SectorBox:$w,motion:Hw,updateLabelNode:jw,getItemStyles:Ww}=s.n1,_w=(()=>{var e=class extends s.n1.PolarSeries{constructor(e){super({moduleCtx:e,categoryKey:"radiusValue",propertyKeys:Dw,propertyNames:ww,canHaveAxes:!0,animationResetFns:{item:kw,label:Ow}}),this.properties=new bw,this.groupScale=new Fw,this.circleCache={r:0,cx:0,cy:0}}createNodeParams(e){return{...super.createNodeParams(e),angleKey:this.properties.angleKey,radiusKey:this.properties.radiusKey}}nodeFactory(){return new Vw}getSeriesDomain(e){const{dataModel:t,processedData:i}=this;if(!i||!t)return{domain:[]};if(e===n.tv$.Angle){const e=t.getDomain(this,"angleValue-end","value",i).domain,s=[(0,n.Wwf)(e[0],(0,n.s1j)(e[0])),(0,n.cGV)(e[1],(0,n.s1j)(e[1]))];return{domain:Tw(s)}}return t.getDomain(this,"radiusValue","key",i)}async processData(e){const{angleKey:t,radiusKey:i,normalizedTo:s}=this.properties,a=!this.ctx.animationManager.isSkipped(),o=this.getStackId(),r=`${o}-trailing`,l=[];(0,n.O9V)(s)&&l.push(Lw([o,r],Math.abs(s))),this.needsDataModelDiff()&&this.processedData&&l.push(Aw(this.id,this.processedData)),a&&l.push(zw());const h=this.visible?{}:{forceValue:0},c=this.axes[n.tv$.Radius]?.scale.type,d=this.axes[n.tv$.Angle]?.scale.type,u=this.properties.allowNullKeys??!1;await this.requestDataModel(e,this.data,{props:[Nw(i,c,{id:"radiusValue",allowNullKey:u}
1),Pw(t,d,{id:"angleValue-raw",invalidValue:null,...h}),...Cw(t,"normal",{id:"angleValue-end",rangeId:"angleValue-range",invalidValue:null,groupId:o,separateNegative:!0,...h},d),...Cw(t,"trailing",{id:"angleValue-start",invalidValue:null,groupId:r,separateNegative:!0,...h},d),...l],groupByKeys:!0,groupByData:!1}),this.animationState.transition("updateData")}didCircleChange(){const e=this.radius,t=this.centerX,i=this.centerY,n=this.circleCache;return(e!==n.r||t!==n.cx||i!==n.cy)&&(this.circleCache={r:e,cx:t,cy:i},!0)}maybeRefreshNodeData(){(this.didCircleChange()||this.nodeDataRefresh)&&(this.contextNodeData=this.createNodeData(),this.nodeData=this.contextNodeData?.nodeData??[],this.nodeDataRefresh=!1)}getAxisInnerRadius(){const e=this.axes[n.tv$.Radius];return e instanceof Iw?this.radius*e.innerRadiusRatio:0}createNodeData(){const{processedData:e,dataModel:t}=this;if(!t||"grouped"!==e?.type)return;const i=this.axes[n.tv$.Angle],s=this.axes[n.tv$.Radius],a=i?.scale,o=s?.scale;if(!a||!o)return;const r=t.resolveKeysById(this,"radiusValue",e),l=t.resolveColumnById(this,"angleValue-start",e,"mixed-numeric"),h=t.resolveColumnById(this,"angleValue-end",e,"mixed-numeric"),c=t.resolveColumnById(this,"angleValue-raw",e,"mixed-numeric"),d=t.resolveProcessedDataIndexById(this,"angleValue-range");let u=0;s instanceof ye&&(u=s.options.groupPaddingInner);const{groupScale:p}=this,{index:g,visibleGroupCount:m}=this.ctx.seriesStateManager.getVisiblePeerGroupIndex(this);p.domain=Array.from({length:m}).map(((e,t)=>String(t))),p.range=[0,Math.abs(o.bandwidth??0)],p.paddingInner=m>1?u:0;const y=p.bandwidth>=1?p.bandwidth:p.rawBandwidth,f=i.isReversed(),x=s.isReversed(),b=x?this.radius:this.getAxisInnerRadius(),v=(x?this.getAxisInnerRadius():this.radius)+b,S=this.getSeriesDomain(n.tv$.Angle).domain,{angleKey:M,radiusKey:k,angleName:D,radiusName:w,legendItemName:I,label:A}=this.properties,C=(e,t,i,n)=>{const s=this.getLabelText(t,e,M,"angle",S,A,{value:t,datum:e,angleKey:M,radiusKey:k,angleName:D,radiusName:w,legendItemName:I});if(s)return{x:i,y:n,text:s,textAlign:"center",textBaseline:"middle"}},N=[],L=Ww(((e,t,i)=>QM(this,e,t,i,void 0,void 0))),P={itemId:k,nodeData:N,labelData:N,styles:L};if(!this.visible)return P;const{dataSources:T}=e,O=T.get(this.id)?.data??[];for(const{datumIndex:i,group:s}of t.forEachGroupDatum(this,e)){const e=O[i],t=r[i];if(void 0===t&&!this.properties.allowNullKeys)return;const u=c[i],m=l[i],x=h[i],b=u>=0&&!Object.is(u,-0),S=s.aggregation[d][b?1:0],M=b===f;let k=a.convert(m,{clamp:!0}),D=a.convert(x,{clamp:!0}),w=a.convert(0,{clamp:!0}),I=a.convert(S,{clamp:!0});M&&([w,I]=[I,w],[k,D]=[D,k]);const A=v-o.convert(t)+p.convert(String(g)),L=A+y,P=(A+L)/2,T=k+(0,n.s57)(k,D)/2,R=Math.cos(T)*P,E=Math.sin(T)*P,z=this.properties.label.enabled?C(e,u,R,E):void 0,B=new $w(k,D,A,L);N.push({series:this,datum:e,datumIndex:i,point:{x:R,y:E,size:0},midPoint:{x:R,y:E},label:z,angleValue:u,radiusValue:t,innerRadius:A,outerRadius:L,startAngle:w,endAngle:I,clipSector:B,reversed:M,index:i})}return P}update({seriesRect:e}){const t=this.checkResize(e);this.maybeRefreshNodeData(),this.contentGroup.translationX=this.centerX,this.contentGroup.translationY=this.centerY,this.highlightGroup.translationX=this.centerX,this.highlightGroup.translationY=this.centerY,this.labelGroup&&(this.labelGroup.translationX=this.centerX,this.labelGroup.translationY=this.centerY),this.updateSectorSelection(this.itemSelection,!1),this.updateSectorSelection(this.highlightSelection,!0),this.updateLabels(),t&&this.animationState.transition("resize"),this.animationState.transition("update")}updateSectorSelection(e,t){let i=[];const s=this.ctx.highlightManager?.getActiveHighlight();t?s?.datum&&s.series===this&&i.push(s):i=this.nodeData;const{contextNodeData:a}=this;if(!a)return;const o=this.ctx.highlightManager.getActiveHighlight(),r=this.getShapeFillBBox(),l=this.hasItemStylers(),h=l&&null==this.properties.itemStyler?new Map:void 0;e.update(i,void 0,(e=>this.getDatumId(e))).each(((e,i)=>{const c=go(i);if(null==c)return;if(l){const e=this.getHighlightState(s,t,i.datumIndex),n=this.getDataSelectionState(i.datumIndex),a=this.getDataCandidacyState(i.datumIndex);if(null==h)i.style=QM(this,i,t,e,n,a);else{const s=`${e}:${n??"-"}:${a??"-"}`;let o=h.get(s);void 0===o&&(o=QM(this,i,t,e,n,a),h.set(s,o)),i.style=o}}const d=i.style??a.styles[this.getHighlightState(o,t,i.datumIndex)],u=d.cornerRadius,p=d.fill,g=(0,n.MBc)(p)&&"item"!==p.bounds?{centerX:0,centerY:0}:void 0;e.setStyleProperties(d,r,g),e.lineJoin="round",e.inset=null==e.stroke?0:e.strokeWidth/2,e.
1startInnerCornerRadius=c.reversed?u:0,e.startOuterCornerRadius=c.reversed?u:0,e.endInnerCornerRadius=c.reversed?0:u,e.endOuterCornerRadius=c.reversed?0:u,t&&(e.startAngle=i.startAngle,e.endAngle=i.endAngle,e.clipSector=i.clipSector,e.innerRadius=i.innerRadius,e.outerRadius=i.outerRadius)}))}updateLabels(){const{properties:e}=this,t=this.ctx.highlightManager?.getActiveHighlight(),i=t?.series===this&&t?.datum?t:void 0,n=i?[i]:[];this.labelSelection.update(this.nodeData).each(((i,n)=>{const s=!1;jw(this,i,e,e.label,n.label,{isHighlight:s,activeHighlight:t}),i.fillOpacity=this.getHighlightStyle(s,n.datumIndex).opacity??1})),this.highlightLabelSelection.update(n,void 0,(e=>this.getDatumId(e))).each(((i,n)=>{const s=!0;jw(this,i,e,e.label,n.label,{isHighlight:s,activeHighlight:t}),i.fillOpacity=this.getHighlightStyle(s,n.datumIndex).opacity??1}))}getBarTransitionFunctions(){const e=this.axes[n.tv$.Angle]?.scale;let t=0;if(!e)return Mw(t);const i=Math.min(e.domain[0],e.domain[1]),s=Math.max(e.domain[0],e.domain[1]);return i<=0&&s>=0&&(t=e.convert(0)),Mw(t)}animateEmptyUpdateReady(){const{labelSelection:e}=this,t=this.getBarTransitionFunctions();Hw.fromToMotion(this.id,"datums",this.ctx.animationManager,[this.itemSelection],t),Rw(this,"labels",this.ctx.animationManager,e,this.highlightLabelSelection)}animateClearingUpdateEmpty(){const{itemSelection:e}=this,{animationManager:t}=this.ctx,i=this.getBarTransitionFunctions();Hw.fromToMotion(this.id,"datums",t,[e],i),Ew(this,"labels",t,this.labelSelection,this.highlightLabelSelection)}getTooltipContent(e){const{id:t,dataModel:i,processedData:a,axes:o,properties:r}=this,{angleKey:l,angleName:h,radiusKey:c,radiusName:d,legendItemName:u,tooltip:p}=r,g=o[n.tv$.Angle],m=o[n.tv$.Radius],y=this.nodeData?.[e];if(!(i&&a&&g&&m&&y))return;const f=a.dataSources.get(this.id)?.data[e],x=i.resolveKeysById(this,"radiusValue",a)[e],b=i.resolveColumnById(this,"angleValue-raw",a,"mixed-numeric")[e];if(void 0===x&&!this.properties.allowNullKeys)return;const v=QM(this,y,!1,void 0,void 0,void 0);return this.formatTooltipWithContext(p,{heading:this.getAxisValueText(m,"tooltip",x,f,c,void 0),symbol:this.legendItemSymbol(),data:[{label:h,fallbackLabel:l,value:this.getAxisValueText(g,"tooltip",b,f,l,void 0),missing:s.n1.isTooltipValueMissing(b)}]},{seriesId:t,datum:f,title:h,angleKey:l,angleName:h,radiusKey:c,radiusName:d,legendItemName:u,...v})}pickNodeClosestDatum(e){return this.pickNodeNearestDistantObject(e,this.itemSelection.nodes())}pickNodesInBBoxPredicate(){return s.n1.pickSectorsInBBoxPredicate(this)}legendItemSymbol(){const{fill:e,stroke:t,fillOpacity:i,strokeOpacity:a,strokeWidth:o,lineDash:r,lineDashOffset:l}=qM(this,!1,s.n1.HighlightState.None,void 0,void 0),h={fill:e??"rgba(0, 0, 0, 0)",stroke:t??"rgba(0, 0, 0, 0)",fillOpacity:i,strokeOpacity:a,strokeWidth:o,lineDash:r,lineDashOffset:l};return(0,n.MBc)(h.fill)&&(h.fill={...h.fill,gradient:"linear",rotation:0,reverse:!1}),{marker:h}}getLegendData(e){if("category"!==e)return[];const{id:t,visible:i}=this,{angleKey:n,angleName:s,legendItemName:a,showInLegend:o}=this.properties;return[{legendType:"category",id:t,itemId:n,seriesId:t,enabled:i,label:{text:a??s??n},symbol:this.legendItemSymbol(),legendItemName:a,hideInLegend:!o}]}getDatumId(e){return Bw(e.radiusValue)}computeLabelsBBox(){return null}getStackId(){return`radialBar-stack-${this.seriesGrouping?.groupIndex??this.id}-xValues`}hasItemStylers(){return this.properties.selection.enabled||null!=this.properties.itemStyler||null!=this.properties.styler||null!=this.properties.label.itemStyler}};return e.className="RadialBarSeries",e.type="radial-bar",e})(),{radialBarSeriesThemeableOptionsDef:Gw}=s.n1,Kw=(()=>({...n.XxK,...Gw,type:(0,n.mw3)((0,n.dYl)("radial-bar")),angleKey:(0,n.mw3)(n.YjP),radiusKey:(0,n.mw3)(n.YjP),angleName:n.YjP,radiusName:n.YjP,legendItemName:n.YjP,grouped:n.zMY,stacked:n.zMY,stackGroup:n.YjP,normalizedTo:n.aig}))();Kw.angleKeyAxis=(0,n._Le)(n.YjP),Kw.radiusKeyAxis=(0,n._Le)(n.YjP);var Yw={series:{fill:{$applySwitch:[{$path:"type"},{$palette:"fill"},["gradient",n.vr$],["image",n.pwE],["pattern",n.eu4]]},stroke:{$palette:"stroke"},strokeWidth:{$isUserOption:["./stroke",1,0]},label:{...n.mgV,enabled:!1,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"}
1,color:{$ref:"chartBackgroundColor"}},highlight:n.fil,selection:n.zg6},axes:{[n.QYe.RADIUS_CATEGORY]:{innerRadiusRatio:.2,groupPaddingInner:.2,paddingInner:.2,paddingOuter:.1}}},Uw={type:"series",name:"radial-bar",chartType:"polar",enterprise:!0,stackable:!0,groupable:!0,version:s.xv,dependencies:[s.T9],options:Kw,defaultAxes:{angle:{type:n.QYe.ANGLE_NUMBER},radius:{type:n.QYe.RADIUS_CATEGORY}},axisKeys:{[n.tv$.Angle]:"angleKeyAxis",[n.tv$.Radius]:"radiusKeyAxis"},themeTemplate:Yw,create:e=>new _w(e)},Xw=(()=>{var e=class extends Mk{};return l([n.mAP],e.prototype,"columnWidthRatio",2),l([n.mAP],e.prototype,"maxColumnWidthRatio",2),e})(),{PolarAxis:Zw,RadialColumnShape:qw,getRadialColumnWidth:Qw}=s.n1,Jw=(()=>{var e=class extends xk{constructor(e){super(e,{animationResetFns:{item:Ik}}),this.properties=new Xw}getStackId(){return`radarColumn-stack-${this.seriesGrouping?.groupIndex??this.id}-yValues`}nodeFactory(){return new qw}getColumnTransitionFunctions(){return function(e){const t=Dk();return{toFn:(i,n,s)=>{const{startAngle:a,endAngle:o}=t.to(n);let r,l,h,c,d;return"removed"===s?(r=i.innerRadius,l=i.innerRadius,h=i.columnWidth,c=i.axisInnerRadius,d=i.axisOuterRadius):(r=Number.isNaN(n.innerRadius)?e:n.innerRadius,l=Number.isNaN(n.outerRadius)?e:n.outerRadius,h=Number.isNaN(n.columnWidth)?i.columnWidth:n.columnWidth,c=n.axisInnerRadius,d=n.axisOuterRadius),{innerRadius:r,outerRadius:l,columnWidth:h,axisInnerRadius:c,axisOuterRadius:d,startAngle:a,endAngle:o}},fromFn:(i,n,s)=>{s=wk(i,n,s),t.calculate(i,n,s);const{startAngle:a,endAngle:o}=t.from(n);let r,l,h,c,d;return"removed"===s||"updated"===s?(r=i.innerRadius,l=i.outerRadius,h=i.columnWidth,c=i.axisInnerRadius,d=i.axisOuterRadius):(r=e,l=e,h=n.columnWidth,c=n.axisInnerRadius,d=n.axisOuterRadius),{innerRadius:r,outerRadius:l,columnWidth:h,axisInnerRadius:c,axisOuterRadius:d,startAngle:a,endAngle:o,phase:kk.NODE_UPDATE_STATE_TO_PHASE_MAPPING[s]}}}}(this.isRadiusAxisReversed()?this.radius:this.getAxisInnerRadius())}isRadiusAxisCircle(){const e=this.axes[n.tv$.Radius];return e instanceof Zw&&"circle"===e.shape}updateItemPath(e,t,i){e.isBeveled=this.isRadiusAxisCircle(),i&&(e.innerRadius=t.innerRadius,e.outerRadius=t.outerRadius,e.startAngle=t.startAngle,e.endAngle=t.endAngle,e.columnWidth=t.columnWidth,e.axisInnerRadius=t.axisInnerRadius,e.axisOuterRadius=t.axisOuterRadius)}getColumnWidth(e,t){const{columnWidthRatio:i=.5,maxColumnWidthRatio:n=.5}=this.properties;return Qw(e,t,this.radius,i,n)}hasItemStylers(){return this.properties.selection.enabled||null!=this.properties.itemStyler||null!=this.properties.styler||null!=this.properties.label.itemStyler}};return e.className="RadialColumnSeries",e.type="radial-column",e})(),{radialColumnSeriesThemeableOptionsDef:eI}=s.n1,tI=(()=>({...n.XxK,...eI,type:(0,n.mw3)((0,n.dYl)("radial-column")),angleKey:(0,n.mw3)(n.YjP),radiusKey:(0,n.mw3)(n.YjP),angleName:n.YjP,radiusName:n.YjP,legendItemName:n.YjP,grouped:n.zMY,stacked:n.zMY,stackGroup:n.YjP,normalizedTo:n.aig}))();tI.angleKeyAxis=(0,n._Le)(n.YjP),tI.radiusKeyAxis=(0,n._Le)(n.YjP);var iI={series:{fill:{$applySwitch:[{$path:"type"},{$palette:"fill"},["gradient",n.cEq],["image",n.pwE],["pattern",n.eu4]]},stroke:{$palette:"stroke"},columnWidthRatio:.5,maxColumnWidthRatio:.5,strokeWidth:{$isUserOption:["./stroke",1,0]},label:{...n.mgV,enabled:!1,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"textColor"}},highlight:n.fil,selection:n.zg6},axes:{[n.QYe.ANGLE_CATEGORY]:{shape:{$findFirstSiblingNotOperation:n.Xk0.CIRCLE},groupPaddingInner:0,paddingInner:0,label:{spacing:10}},[n.QYe.RADIUS_NUMBER]:{shape:{$findFirstSiblingNotOperation:n.Xk0.CIRCLE},innerRadiusRatio:.5}}},nI={type:"series",name:"radial-column",chartType:"polar",enterprise:!0,stackable:!0,groupable:!0,version:s.xv,dependencies:[s.T9],options:tI,defaultAxes:{angle:{type:n.QYe.ANGLE_CATEGORY},radius:{type:n.QYe.RADIUS_NUMBER}},axisKeys:{[n.tv$.Angle]:"angleKeyAxis",[n.tv$.Radius]:"radiusKeyAxis"},themeTemplate:iI,create:e=>new Jw(e)},{SvgPath:sI,Rotatable:aI,Translatable:oI,Scalable:rI}=s.n1,lI=(()=>{var e=class extends(aI(rI(oI(sI)))){constructor(){super(...arguments),this.scalingCenterX=.5,this.scalingCenterY=.5,this.rotationCenterX=.5,this.rotationCenterY=.5}};return e.defaultPathData="M0.50245 0.53745C0.481767 0.53745 0.465 0.520683 0.465 0.5C0.465 0.479317 0.481767 0.46255 0.50245 0.46255L1 0.500012L0.50245 0.53745Z",e})(),{getColorStops:hI}=s.n1,{makeSeriesTooltip:cI,SeriesProperties:dI,SeriesLabelProperties:uI,Label:pI}=s.n1,gI=(()=>{var e=class extends pI{};return l([n.mAP],e.prototype,"spacing",2),e})(),mI=(()=>{var e=class extends n.XPE{constructor(){super(...arguments),this.label=new gI}getStyle(){const{fill:e="black",fillOpacity:t=1,stroke:i="black",strokeWidth:n=0,strokeOpacity:s=1,lineDash:a=[0],lineDashOffset:o=0}=this;return{fill:e,fillOpacity:t,stroke:i,strokeWidth:n,strokeOpacity:s,lineDash:a,lineDashOffset:o}}};return l([n.mAP],e.prototype,"text",2),l([n.mAP],e.prototype,"value",2),l([n.mAP],e.prototype,"shape",2),l([n.mAP],e.prototype,"placement",2),l([n.mAP],e.prototype,"spacing",2),l([n.mAP],e.prototype,"size",2),l([n.mAP],e.prototype,"rotation",2),l([n.mAP],e.prototype,"fill",2),l([n.mAP],e.prototype,"fillOpacity",2),l([n.mAP],e.prototype,"stroke",2),l([n.mAP],e.prototype,"strokeWidth",2),l([n.mAP],e.prototype,"strokeOpacity",2),l([n.mAP],e.prototype,"lineDash",2),l([n.mAP],e.prototype,"lineDashOffset",2),l([n.mAP],e.prototype,"label",2),e})(),yI=(()=>{var e=class extends n.XPE{constructor(){super(...arguments),this.enabled=!0,this.fills=new n.F_c(s.n1.StopProperties),this.fillMode="continuous",this.fillOpacity=1,this.stroke="black",this.strokeWidth=0,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0}getStyle(e,t){const{enabled:i,fill:n,fills:s,fillMode:a,fillOpacity:o,stroke:r,strokeWidth:l,strokeOpacity:h,lineDash:c,lineDashOffset:d}=this;return{fill:i?n??DI(s,a,e,t):"none",fillOpacity:o,stroke:r,strokeWidth:l,strokeOpacity:h,lineDash:c,lineDashOffset:d}}};return l([n.mAP],e.prototype,"enabled",2),l([n.mAP],e.prototype,"fills",2),l([n.mAP],e.prototype,"fillMode",2),l([n.mAP],e.prototype,"fill",2),l([n.mAP],e.prototype,"fillOpacity",2),l([n.mAP],e.prototype,"stroke",2),l([n.mAP],e.prototype,"strokeWidth",2),l([n.mAP],e.prototype,"strokeOpacity",2),l([n.mAP],e.prototype,"lineDash",2),l([n.mAP],e.prototype,"lineDashOffset",2),e})(),fI=(()=>{var e=class extends n.XPE{constructor(){super(...arguments),this.values=void 0,this.step=void 0,this.minSpacing=0,this.maxSpacing=1e3}};return l([n.mAP],e.prototype,"values",2),l([n.mAP],e.prototype,"step",2),l([n.mAP],e.prototype,"minSpacing",2),l([n.mAP],e.prototype,"maxSpacing",2),e})(),xI=class extends uI{},bI=(()=>{var e=class extends n.XPE{constructor(){super(...arguments),this.min=0,this.max=1,this.fills=new n.F_c(s.n1.StopProperties),this.fillMode="continuous",this.fillOpacity=1,this.stroke="black",this.strokeWidth=0,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.defaultFill="black",this.interval=new fI,this.label=new xI}getStyle(e,t,i){const{fill:n,fills:s,defaultFill:a,fillMode:o,fillOpacity:r,stroke:l,strokeWidth:h,strokeOpacity:c,lineDash:d,lineDashOffset:u}=this;return{fill:n??(e&&0===s.length?a:void 0)??DI(s,o,t,i),fillOpacity:r,stroke:l,strokeWidth:h,strokeOpacity:c,lineDash:d,lineDashOffset:u}}};return l([n.mAP],e.prototype,"min",2),l([n.mAP],e.prototype,"max",2),l([n.mAP],e.prototype,"fills",2),l([n.mAP],e.prototype,"fillMode",2),l([n.mAP],e.prototype,"fill",2),l([n.mAP],e.prototype,"fillOpacity",2),l([n.mAP],e.prototype,"stroke",2),l([n.mAP],e.prototype,"strokeWidth",2),l([n.mAP],e.prototype,"strokeOpacity",2),l([n.mAP],e.prototype,"lineDash",2),l([n.mAP],e.prototype,"lineDashOffset",2),l([n.mAP],e.prototype,"defaultFill",2),l([n.mAP],e.prototype,"interval",2),l([n.mAP],e.prototype,"label",2),e})(),vI=(()=>{var e=class extends n.XPE{constructor(){super(...arguments),this.enabled=!0,this.spacing=0,this.fill="black",this.fillOpacity=1,this.stroke="black",this.strokeWidth=0,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0}};return l([n.mAP],e.prototype,"enabled",2),l([n.mAP],e.prototype,"radiusRatio",2),l([n.mAP],e.prototype,"spacing",2),l([n.mAP],e.prototype,"fill",2),l([n.mAP],e.prototype,"fillOpacity",2),l([n.mAP],e.prototype,"stroke",2),l([n.mAP],e.prototype,"strokeWidth",2),l([n.mAP],e.prototype,"strokeOpacity",2),l([n.mAP],e.prototype,"lineDash",2),l([n.mAP],e.prototype,"lineDashOffset",2),e})(),SI=(()=>{var e=class extends Zl{};return l([n.mAP],e.prototype,"text",2),e})(),MI=(()=>{var e=class extends ql{};return l([n.mAP],e.prototype,"text",2),e})(),kI=(()=>{var e=class extends dI{constructor(){super(...arguments),this.startAngle=0,this.endAngle=0,this.segmentation=new Cb,this.defaultColorRange=[],this.targets=new n.F_c(mI),this.defaultTarget=new mI,this.outerRadiusRatio=1,this.innerRadiusRatio=1,this.cornerRadius=0,this.cornerMode="container",this.spacing=0,this.scale=new bI,this.bar=new yI,this.needle=new vI,this.label=new SI,this.secondaryLabel=new MI,this.tooltip=cI()}};return l([n.mAP],e.prototype,"value",2),l([n.mAP],e.prototype,"startAngle",2),l([n.mAP],e.prototype,"endAngle",2),l([n.mAP],e.prototype,"segmentation",2),l([n.mAP],e.prototype,"defaultColorRange",2),l([n.mAP],e.prototype,"targets",2),l([n.mAP],e.prototype,"defaultTarget",2),l([n.mAP],e.prototype,"outerRadiusRatio",2),l([n.mAP],e.prototype,"innerRadiusRatio",2),l([n.mAP],e.prototype,"outerRadius",2),l([n.mAP],e.prototype,"innerRadius",2),l([n.mAP],e.prototype,"cornerRadius",2),l([n.mAP],e.prototype,"cornerMode",2),l([n.mAP],e.prototype,"spacing",2),l([n.mAP],e.prototype,"scale",2),l([n.mAP],e.prototype,"bar",2),l([n.mAP],e.prototype,"needle",2),l([n.mAP],e.prototype,"label",2),l([n.mAP],e.prototype,"secondaryLabel",2),l([n.mAP],e.prototype,"tooltip",2),e})();function DI(e,t,i,s){const{domain:a,range:o}=s,[r,l]=o,h=(0,n.YcT)((r+l)/2+Math.PI),c=(0,n.I5e)(l-r);
1return{type:"gradient",gradient:"conic",colorSpace:"oklch",colorStops:hI(e,i,a.map(Number),t).map((({color:e,stop:t})=>{t=Math.min(Math.max(t,0),1);return{stop:t=((t=(r+c*t-h)/(2*Math.PI))%1+1)%1,color:e}})),bounds:"series",rotation:(0,n.xWn)(h)+90}}var{SectorBox:wI}=s.n1;function II(e,t,i){return Math.max(e,i.startAngle)<=Math.min(t,i.endAngle)}function AI(e){return null!=e.clipStartAngle&&null!=e.clipEndAngle}function CI(e,t){const{clipStartAngle:i,clipEndAngle:n,innerRadius:s,outerRadius:a}=e;return new wI(i,t?i:n,s,a)}function NI(e,t){const i=e?"initial":"update";return{node:{fromFn(t,n){const s=t.previousDatum;let{startAngle:a,endAngle:o}=s??n;const r=null!=s&&AI(s)?CI(s,e):void 0,l=AI(n)?CI(n,e):void 0;let h;return null!=r&&null!=l?h=r:null==r&&null!=l?(h=l,a=n.startAngle,o=n.endAngle):null!=r&&null==l?(h=void 0,a=n.startAngle,o=n.endAngle):e&&(o=a),{startAngle:a,endAngle:o,clipSector:h,phase:i}},toFn(e,t){const{startAngle:i,endAngle:n}=t;let s;return AI(t)&&(s=CI(t,!1)),{startAngle:i,endAngle:n,clipSector:s}},applyFn(e,t){const{startAngle:i,endAngle:n}=t;let{clipSector:s}=t;null!=s&&(s=new wI(Math.max(i,s.startAngle),Math.min(n,s.endAngle),s.innerRadius,s.outerRadius));const a=null==s||II(i,n,s);e.startAngle=i,e.endAngle=n,e.clipSector=s,e.visible=a}},needle:{fromFn(n){let{angle:s}=n.previousDatum??n.datum;return e&&(s=t),{rotation:s,phase:i}},toFn(e,t){const{angle:i}=t;return{rotation:i}}}}}function LI(e,t){const{startAngle:i,endAngle:n}=t,s=function(e){const{startAngle:t,endAngle:i,clipStartAngle:n,clipEndAngle:s,innerRadius:a,outerRadius:o}=e;if(null!=n&&null!=s)return new wI(Math.max(n,t),Math.min(s,i),a,o)}(t);return{startAngle:i,endAngle:n,clipSector:s,visible:null==s||II(i,n,s)}}function PI(e,t){const{angle:i}=t;return{rotation:i}}var TI={top:0,middle:.5,bottom:1};var{fromToMotion:OI,resetMotion:RI,SeriesNodePickMode:EI,createDatumId:zI,sectorBox:BI,BBox:FI,Group:VI,PointerEvents:$I,Selection:HI,Sector:jI,SectorBox:WI,Transformable:_I,TransformableText:GI,Text:KI}=s.n1,YI={inside:90,middle:0,outside:-90},UI=[{textAlign:"left",textBaseline:"top"},{textAlign:"right",textBaseline:"top"},{textAlign:"right",textBaseline:"bottom"},{textAlign:"left",textBaseline:"bottom"}],XI=[{textAlign:"right",textBaseline:"bottom"},{textAlign:"left",textBaseline:"bottom"},{textAlign:"left",textBaseline:"top"},{textAlign:"right",textBaseline:"top"}],ZI=(()=>{var e=class extends s.n1.Series{constructor(e){super({moduleCtx:e,pickModes:[EI.EXACT_SHAPE_MATCH,EI.NEAREST_NODE]}),this.centerX=0,this.centerY=0,this.radius=0,this.textAlign="center",this.verticalAlign="middle",this.properties=new kI,this.scale=new V,this.scaleGroup=this.contentGroup.appendChild(new VI({name:"scaleGroup"})),this.itemGroup=this.contentGroup.appendChild(new VI({name:"itemGroup"})),this.itemNeedleGroup=this.contentGroup.appendChild(new VI({name:"itemNeedleGroup"})),this.itemTargetGroup=this.contentGroup.appendChild(new VI({name:"itemTargetGroup"})),this.itemTargetLabelGroup=this.contentGroup.appendChild(new VI({name:"itemTargetLabelGroup"})),this.itemLabelGroup=this.contentGroup.appendChild(new VI({name:"itemLabelGroup"})),this.highlightTargetGroup=this.highlightGroup.appendChild(new VI({name:"itemTargetLabelGroup"})),this.tickGroup=this.contentGroup.appendChild(new VI({name:"tickGroup"})),this.scaleSelection=HI.select(this.scaleGroup,(()=>this.nodeFactory())),this.datumSelection=HI.select(this.itemGroup,(()=>this.nodeFactory())),this.needleSelection=HI.selectNoInference(this.itemNeedleGroup,lI),this.targetSelection=HI.select(this.itemTargetGroup,(()=>this.markerFactory())),this.targetLabelSelection=HI.select(this.itemTargetLabelGroup,KI),this.labelSelection=HI.select(this.itemLabelGroup,KI),this.highlightTargetSelection=HI.select(this.highlightTargetGroup,(()=>this.markerFactory())),this.tickSelection=HI.select(this.tickGroup,s.n1.TransformableText),this.datumUnion=new yb,this.animationState=new n.Z37("empty",{empty:{update:{target:"ready",action:()=>this.animateEmptyUpdateReady()},reset:"empty",skip:"ready"},ready:{updateData:"waiting",clear:"clearing",resize:()=>this.animateReadyResize(),reset:"empty",skip:"ready"},waiting:{update:{target:"ready",action:()=>this.animateWaitingUpdateReady()},reset:"empty",skip:"ready"},clearing:{update:{target:"empty"},reset:"empty",skip:"ready"}}),this.scaleGroup.pointerEvents=$I.None,this.tickGroup.pointerEvents=$I.None,this.itemNeedleGroup.pointerEvents=$I.None,this.itemLabelGroup.pointerEvents=$I.None}get hasData(){return null!=this.properties.value}nodeFactory(){return new jI}markerFactory(){const e=new kb;return e.size=1,e}processData(){this.nodeDataRefresh=!0,this.animationState.transition("updateData")}formatLabel(e){const{min:t,max:i}=this.properties.scale;return bb(e,{min:t,max:i})}layoutScale(){const{scale:e,properties:t}=this,{seriesRectWidth:i,seriesRectHeight:s}=this.nodeDataDependencies,{scale:a,outerRadius:o}=this.properties,{min:r,max:l,label:h,interval:c}=a,d=(0,n.ehJ)(t.startAngle-90),u=(0,n.ehJ)(t.endAngle-90),p=(0,n.I5e)(u-d)>Math.PI,g=p||(0,n.tF8)(1.5*Math.PI,d,u),m=p||(0,n.tF8)(0*Math.PI,d,u),y=p||(0,n.tF8)(.5*Math.PI,d,u),f=p||(0,n.tF8)(1*Math.PI,d,u);let x,b;x=f&&!m?"right":!f&&m?"left":"center",b=g&&!y?"bottom":!g&&y?"top":"middle";const v=BI({startAngle:d,endAngle:u,innerRadius:0,outerRadius:.5}),S=2*-(v.x+v.width/2),M=2*-(v.y+v.height/2),k=Math.min(i/v.width,s/v.height);e.domain=[r,l],e.range=[d,u],e.arcLength=k/2;const{maxSpacing:D,minSpacing:w}=c,{arcLength:I}=e,A=D?Math.floor(I/D):1,C=w?Math.floor(I/w):1/0,N=Math.floor(4/Math.PI*Math.abs(e.range[0]-e.range[1])),L=Math.max(A,Math.min(C,N)),P=c.values??("bigint"==typeof r&&"bigint"==typeof l&&null==c.step?(0,n.ozM)(r,l,L):e.ticks({nice:[!1,!1],interval:c.step,minTickCount:A,maxTickCount:C,tickCount:L},[r,l])?.ticks)??[],T=(0,n.Vr1)(P,"string"==typeof h.format?h.format:void 0),O=[];for(const[e,t]of P.entries()){let i;h.formatter&&(i=oy(this.ctx,h.formatter,{type:"number",value:t,index:e,domain:[r,l],boundSeries:void 0})),i??(i=T?.(t)),null!=i&&O.push({index:e,value:t,text:i})}const R=.5*k,E=h.enabled&&null==o&&O.length>0?this.getTickLabelInset({tickData:O,radius:R,centerXOffset:S,centerYOffset:M,seriesRectWidth:i,seriesRectHeight:s,spacing:h.spacing,rotation:(0,n.ehJ)(h.rotation??0)}):0,z=Math.max(R-E,0),B=o??z;return this.centerX=i/2+S*B,this.centerY=s/2+M*B,this.radius=B,this.textAlign=x,this.verticalAlign=b,O}getShapeFillBBox(){const{centerX:e,centerY:t,radius:i}=this,n=new FI(e-i,t-i,2*i,2*i);return{series:n,axis:n}}getTargets(){const{properties:e}=this,t=e.defaultTarget;return e.targets.map((e=>{const{text:i=t.text,value:n=t.value??0,shape:s=t.shape??"triangle",rotation:a=t.rotation??0,placement:o=t.placement??"middle",spacing:r=t.spacing??0,size:l=t.size??0}=e,{enabled:h=t.label.enabled,color:c=t.label.color??"black",fontStyle:d=t.label.fontStyle??"normal",fontWeight:u=t.label.fontWeight??"normal",fontSize:p=t.label.fontSize,fontFamily:g=t.label.fontFamily,spacing:m=t.label.spacing??0}=e.label;return{text:i,value:n,shape:s,placement:o,spacing:r,size:l,rotation:a,label:{enabled:h,color:c,fontStyle:d,fontWeight:u,fontSize:p,fontFamily:g,spacing:m},style:e.getStyle()}}))}getTargetRadius(e){const{radius:t,properties:i}=this,{innerRadiusRatio:n,outerRadiusRatio:s}=i,{placement:a,spacing:o,size:r}=e,l=t*s,h=t*n;switch(a){case"inside":return Math.max(h-o-r/2,0);case"outside":return l+o+r/2;default:return(h+l)/2}}getTargetLabel(e){const{scale:t}=this,{value:i,size:s,placement:a,label:o}=e,{spacing:r,color:l,fontStyle:h,fontWeight:c,fontSize:d,fontFamily:u}=o,p=t.convert(i),g=Math.trunc((0,n.YcT)(p)/(Math.PI/2)),m=s/2+r;let y,f,x,b;switch(a){case"outside":({textAlign:y,textBaseline:f}=UI[g]),x=m*Math.cos(p),b=m*Math.sin(p);break;case"inside":({textAlign:y,textBaseline:f}=XI[g]),x=-m*Math.cos(p),b=-m*Math.sin(p);break;default:y="center",f="bottom",x=0,b=-m}return{offsetX:x,offsetY:b,fill:l,textAlign:y,textBaseline:f,fontStyle:h,fontWeight:c,fontSize:d,fontFamily:u,lineHeight:void 0}}createNodeData(){const e=this.layoutScale(),{id:t,scale:i,properties:s,radius:a,centerX:o,centerY:r}=this,{value:l,innerRadiusRatio:h,outerRadiusRatio:c,segmentation:d,cornerRadius:u,cornerMode:p,needle:g,bar:m,scale:y,label:f,secondaryLabel:x}=s,{outerRadius:b=a*c,innerRadius:v=a*h,defaultColorRange:S}=s,M=this.getTargets(),k=[],D=[],w=[],I=[],A=[],C="item"===p,N=i.convert(i.domain[0]),L=i.convert(l),P=Math.ceil((0,n.I5e)(L-N)*a);let T=d.enabled?d.interval.getSegments(i,P,this.ctx.logger):void 0;const O=m.getStyle(S,i),R=y.getStyle(m.enabled,S,i);if(null==T&&C){const e={value:l,segmentStart:Number(i.domainMin),segmentEnd:Number(i.domainMax)},t=Math.min(u,(b-v)/2)/((v+b)/2);k.push({series:this,itemId:"value",datum:e,datumIndex:0,type:0,centerX:o,centerY:r,outerRadius:b,innerRadius:v,startAngle:N-t,endAngle:L+t,clipStartAngle:void 0,clipEndAngle:void 0,startCornerRadius:u,endCornerRadius:u,style:O}),A.push({series:this,itemId:"scale",datum:e,datumIndex:0,type:0,centerX:o,centerY:r,outerRadius:b,innerRadius:v,startAngle:i.range[0]-t,endAngle:i.range[1]+t,clipStartAngle:void 0,clipEndAngle:void 0,startCornerRadius:u,endCornerRadius:u,style:R})}else{T??(T=i.domain);for(let e=0;e<T.length-1;e++){const t=T[e],n=T[e+1],s={value:l,segmentStart:t,segmentEnd:n},a=0===e,h=e===T.length-2,c=i.convert(t),d=i.convert(n);k.push({series:this,itemId:`value-${e}`,datum:s,datumIndex:0,type:0,centerX:o,centerY:r,outerRadius:b,innerRadius:v,startAngle:c,endAngle:d,clipStartAngle:N,clipEndAngle:L,startCornerRadius:C||a?u:0,endCornerRadius:C||h?u:0,style:O}),A.push({series:this,itemId:`scale-${e}`,datum:s,datumIndex:0,type:0,centerX:o,centerY:r,outerRadius:b,innerRadius:v,startAngle:c,endAngle:d,clipStartAngle:void 0,clipEndAngle:void 0,startCornerRadius:C||a?u:0,endCornerRadius:C||h?u:0,style:R})}}if(!g.enabled&&f.enabled){const{text:e,color:t,fontSize:i,minimumFontSize:n,fontStyle:s,fontWeight:a,fontFamily:h,lineHeight:c,formatter:d=e=>this.formatLabel(e.value)}=f;I.push({label:"primary",centerX:o,centerY:r,text:e,value:l,fill:t,fontSize:i,minimumFontSize:n,fontStyle:s,fontWeight:a,fontFamily:h,lineHeight:c,formatter:d})}if(!g.enabled&&x.enabled){const{text:e,color:t,fontSize:i,minimumFontSize:n,fontStyle:s,fontWeight:a,fontFamily:h,lineHeight:c,formatter:d}=x;I.push({label:"secondary",centerX:o,centerY:r,text:e,value:l,fill:t,fontSize:i,minimumFontSize:n,fontStyle:s,fontWeight:a,fontFamily:h,lineHeight:c,formatter:d})}if(g.enabled){let e=null==g.radiusRatio?v:a*g.radiusRatio;e=Math.max(e-g.spacing,0);const t=i.convert(l);w.push({centerX:o,centerY:r,radius:e,angle:t,series:this})}for(let e=0;e<M.length;e+=1){const t=M[e],{value:s,text:a,size:l,shape:h,style:c}=t,{domainMin:d,domainMax:u}=i;if(null==d||null==u||s<d||s>u)continue;const p=this.getTargetRadius(t),g=i.convert(s),m=(0,n.ehJ)(t.rotation+YI[t.placement]);D.push({series:this,itemId:`target-${e}`,midPoint:{x:p*Math.cos(g)+o,y:p*Math.sin(g)+r},datum:{value:s},datumIndex:e+1,type:1,value:s,text:a,centerX:o,centerY:r,shape:h,radius:p,angle:g,rotation:m,size:l,label:this.getTargetLabel(t),style:c}
1)}return{itemId:t,nodeData:k,needleData:w,targetData:D,labelData:I,scaleData:A,tickData:e}}findNodeDatum(e){return Ib(this,e)}updateSelections(e){(this.nodeDataRefresh||e)&&(this.contextNodeData=this.createNodeData(),this.nodeDataRefresh=!1)}highlightDatum(e){if(e?.series===this&&1===e.type)return e}update({seriesRect:e}){const{datumSelection:t,labelSelection:i,needleSelection:n,targetSelection:s,targetLabelSelection:a,scaleSelection:o,highlightTargetSelection:r,tickSelection:l}=this,h=this.checkResize(e);this.updateSelections(h),this.contentGroup.visible=this.visible,this.contentGroup.opacity=this.getOpacity();const c=this.contextNodeData?.nodeData??[],d=this.contextNodeData?.labelData??[],u=this.contextNodeData?.needleData??[],p=this.contextNodeData?.targetData??[],g=this.contextNodeData?.scaleData??[],m=this.contextNodeData?.tickData??[],y=this.highlightDatum(this.ctx.highlightManager.getActiveHighlight());this.scaleSelection=this.updateScaleSelection({scaleData:g,scaleSelection:o}),this.updateScaleNodes({scaleSelection:o}),this.needleSelection=this.updateNeedleSelection({needleData:u,needleSelection:n}),this.updateNeedleNodes({needleSelection:n}),this.targetSelection=this.updateTargetSelection({targetData:p,targetSelection:s}),this.updateTargetStyles({targetSelection:s,isHighlight:!1}),this.updateTargetNodes({targetSelection:s}),this.targetLabelSelection=this.updateTargetLabelSelection({targetData:p,targetLabelSelection:a}),this.updateTargetLabelNodes({targetLabelSelection:a}),this.datumSelection=this.updateDatumSelection({nodeData:c,datumSelection:t}),this.updateDatumNodes({datumSelection:t}),this.labelSelection=this.updateLabelSelection({labelData:d,labelSelection:i}),this.updateLabelNodes({labelSelection:i}),this.highlightTargetSelection=this.updateTargetSelection({targetData:null==y?[]:[y],targetSelection:r}),this.updateTargetStyles({targetSelection:r,isHighlight:!0}),this.updateTargetNodes({targetSelection:r}),this.tickSelection=this.updateTickSelection({tickData:m,tickSelection:l}),this.updateTickNodes({tickSelection:l}),h&&this.animationState.transition("resize"),this.animationState.transition("update")}updateDatumSelection(e){return e.datumSelection.update(e.nodeData,void 0,(t=>zI(e.nodeData.length,t.itemId)))}updateDatumNodes(e){const{datumSelection:t}=e,{ctx:i,properties:n}=this,{segmentation:a}=n,o=a.spacing??0,r=i.animationManager.isSkipped(),l=this.getShapeFillBBox();t.each(((e,t)=>{const{centerX:i,centerY:n,innerRadius:a,outerRadius:h,startCornerRadius:c,endCornerRadius:d}=t;e.centerX=i,e.centerY=n,e.innerRadius=a,e.outerRadius=h,e.pointerEvents=this.properties.bar.enabled?s.n1.PointerEvents.All:s.n1.PointerEvents.None,e.setStyleProperties(t.style,l),e.startOuterCornerRadius=c,e.startInnerCornerRadius=c,e.endOuterCornerRadius=d,e.endInnerCornerRadius=d,e.radialEdgeInset=(o+e.strokeWidth)/2,e.concentricEdgeInset=e.strokeWidth/2,t.midPoint=e.getBBox().computeCenter(),(r||null==e.previousDatum)&&e.setProperties(LI(0,t))})),this.datumUnion.update(t,this.itemGroup,s.n1.Sector,((e,t,i)=>{e.clipSector??(e.clipSector=new WI(Number.NaN,Number.NaN,Number.NaN,Number.NaN)),e.centerX=t.centerX,e.centerY=t.centerY,e.outerRadius=e.clipSector.outerRadius=t.outerRadius,e.innerRadius=e.clipSector.innerRadius=t.innerRadius,e.startAngle=e.clipSector.startAngle=t.startAngle,e.startInnerCornerRadius=t.startInnerCornerRadius,e.startOuterCornerRadius=t.startOuterCornerRadius,e.endAngle=i.endAngle,e.clipSector.endAngle=i.clipSector?.endAngle??i.endAngle,e.endInnerCornerRadius=i.endInnerCornerRadius,e.endOuterCornerRadius=i.endOuterCornerRadius,e.pointerEvents=s.n1.PointerEvents.None}))}updateScaleSelection(e){return e.scaleSelection.update(e.scaleData,void 0,(t=>zI(e.scaleData.length,t.itemId)))}updateScaleNodes(e){const{scaleSelection:t}=e,{segmentation:i}=this.properties,n=i.spacing??0,s=this.getShapeFillBBox();t.each(((e,t)=>{const{centerX:i,centerY:a,innerRadius:o,outerRadius:r,startCornerRadius:l,endCornerRadius:h}=t;e.centerX=i,e.centerY=a,e.innerRadius=o,e.outerRadius=r,e.setStyleProperties(t.style,s),e.startOuterCornerRadius=l,e.startInnerCornerRadius=l,e.endOuterCornerRadius=h,e.endInnerCornerRadius=h,e.radialEdgeInset=(n+e.strokeWidth)/2,e.concentricEdgeInset=e.strokeWidth/2,e.
1setProperties(LI(0,t))}))}updateNeedleSelection(e){return e.needleSelection.update(e.needleData,void 0,(()=>zI(0)))}updateNeedleNodes(e){const{needleSelection:t}=e,{fill:i,fillOpacity:n,stroke:s,strokeOpacity:a,strokeWidth:o,lineDash:r,lineDashOffset:l}=this.properties.needle,h=this.ctx.animationManager.isSkipped();t.each(((e,t)=>{const{centerX:c,centerY:d,radius:u}=t,p=2*u;e.d=lI.defaultPathData,e.setStyleProperties({fill:i,fillOpacity:n,stroke:s,strokeOpacity:a,strokeWidth:o/p,lineDash:r.map((e=>e/p)),lineDashOffset:l/p}),e.translationX=c,e.translationY=d,e.scalingX=p,e.scalingY=p,h&&e.setProperties(PI(0,t))}))}updateTargetSelection(e){return e.targetSelection.update(e.targetData,void 0,(e=>e.itemId))}updateTargetStyles({targetSelection:e,isHighlight:t}){e.each(((e,i)=>{i.style=this.getTargetStyle(t,i)}))}updateTargetNodes({targetSelection:e}){e.each(((e,t)=>{const{centerX:i,centerY:n,angle:s,radius:a,shape:o,size:r,rotation:l}=t;e.setStyleProperties(t.style),e.size=r,e.shape="line"===o?Mb:o,e.translationX=i+a*Math.cos(s),e.translationY=n+a*Math.sin(s),e.rotation=s+l}))}getTargetStyle(e,{datumIndex:t,style:i}){const s=this.getHighlightStyle(e,t),a=this.getSelectionStyle(t);return(0,n.HFk)(a,s,{...i,opacity:1})}updateTargetLabelSelection(e){return e.targetLabelSelection.update(e.targetData,void 0,(e=>e.itemId))}updateTargetLabelNodes(e){const{targetLabelSelection:t}=e;t.each(((e,t)=>{const{centerX:i,centerY:n,radius:s,angle:a,text:o}=t,{offsetX:r,offsetY:l,fill:h,fontStyle:c,fontWeight:d,fontSize:u,fontFamily:p,textAlign:g,textBaseline:m}=t.label;null!=o?(e.visible=!0,e.x=i+s*Math.cos(a)+r,e.y=n+s*Math.sin(a)+l,e.text=o,e.fill=h,e.fontStyle=c,e.fontWeight=d,e.fontSize=u,e.fontFamily=p,e.textAlign=g,e.textBaseline=m):e.visible=!1}))}updateLabelSelection(e){return e.labelSelection.update(e.labelData,void 0,(e=>e.label))}updateLabelNodes(e){const{labelSelection:t}=e,i=this.ctx.animationManager.isSkipped();t.each(((e,t)=>{e.fill=t.fill,e.fontStyle=t.fontStyle,e.fontWeight=t.fontWeight,e.fontFamily=t.fontFamily})),(i||this.labelsHaveExplicitText())&&this.formatLabelText()}updateTickSelection(e){return e.tickSelection.update(e.tickData,void 0,(e=>e.index))}updateTickNodes(e){const{scale:t,radius:i,centerX:s,centerY:a,properties:o}=this,{enabled:r,color:l,fontFamily:h,fontSize:c,fontStyle:d,fontWeight:u,spacing:p}=o.scale.label,g=(0,n.ehJ)(o.scale.label.rotation??0);e.tickSelection.each(((e,n)=>{if(!r)return void(e.visible=!1);e.visible=!0,e.text=n.text,e.fill=l,e.fontFamily=h,e.fontSize=c,e.fontStyle=d,e.fontWeight=u;const o=t.convert(n.value),{textAlign:m,textBaseline:y}=this.getTickLabelAlign(o),f=s+(i+p)*Math.cos(o),x=a+(i+p)*Math.sin(o);e.textAlign=m,e.textBaseline=y,e.x=f,e.y=x,e.rotationCenterX=f,e.rotationCenterY=x,e.rotation=g}))}getTickLabelAlign(e){const t=Math.cos(e),i=Math.sin(e);let s,a;const o=(0,n.YXt)(t,0),r=(0,n.YXt)(i,0);return s="right",o?s="center":t>0&&!o&&(s="left"),a="bottom",r?a="middle":i>0&&!r&&(a="top"),{textAlign:s,textBaseline:a}}getTickLabelInset(e){const{tickData:t,radius:i,centerXOffset:n,centerYOffset:s,seriesRectWidth:a,seriesRectHeight:o,spacing:r,rotation:l}=e,{label:h}=this.properties.scale,c=a/2+n*i,d=o/2+s*i,u=new GI;u.fontFamily=h.fontFamily,u.fontSize=h.fontSize,u.fontStyle=h.fontStyle,u.fontWeight=h.fontWeight,u.rotation=l;const p=1e-6;let g=0;for(const e of t){const t=this.scale.convert(e.value),h=Math.cos(t),m=Math.sin(t),y=c+(i+r)*h,f=d+(i+r)*m,{textAlign:x,textBaseline:b}=this.getTickLabelAlign(t);u.text=e.text,u.x=y,u.y=f,u.textAlign=x,u.textBaseline=b,u.rotationCenterX=y,u.rotationCenterY=f;const v=l?_I.toCanvas(u):u.getBBox();if(null==v)continue;const S=v.x,M=v.x+v.width,k=v.y,D=v.y+v.height,w=Math.max(0,-S),I=Math.max(0,M-a),A=Math.max(0,-k),C=Math.max(0,D-o),N=n+h;Math.abs(N)>p&&(I>0&&N>0?g=Math.max(g,I/N):w>0&&N<0&&(g=Math.max(g,w/-N)));const L=s+m;Math.abs(L)>p&&(C>0&&L>0?g=Math.max(g,C/L):A>0&&L<0&&(g=Math.max(g,A/-L)))}return g}labelsHaveExplicitText(){for(const{datum:e}of this.labelSelection)if(null==e.text)return!1;return!0}formatLabelText(e){const{labelSelection:t,radius:i,textAlign:s,verticalAlign:a}=this,{spacing:o,innerRadiusRatio:r}=this.properties;!function(e,t,i,s,a,o){const{padding:r,textAlign:l,verticalAlign:h}=s;let c,d;if(i.each(((e,t)=>{"primary"===t.label?c=t:"secondary"===t.label&&(d=t)})),null==c)return;const u=vb(e.id,t,c,o?.label);if(null==u)return;const p=null==d?void 0:vb(e.id,t,d,o?.secondaryLabel),g={padding:r},m="center"===l?2:1,y="middle"===h?2:1,f=e=>({width:Math.sqrt(Math.max(a**2-(e/y)**2,0))*m,height:Math.min(e,y*a),meta:null});let x,b,v;if(null!=d&&null!=p){const e=Hl((0,n.boc)(u),c,(0,n.boc)(p),d,g,f);x=e?.label,b=e?.secondaryLabel,v=e?.height??0}else{const e=jl((0,n.boc)(u),c,g,f);x=e?.[0],b=void 0,v=e?.[0].height??0}const S=v*TI[h];i.each(((e,t)=>{let i;if("primary"===t.label?i=x:"secondary"===t.label&&(i=b),null==i)return void(e.visible=!1);e.visible=!0,e.text=i.text,e.fontSize=i.fontSize,e.lineHeight=i.lineHeight,e.textAlign=l,e.textBaseline="middle";const n="primary"===t.label?i.height/2:v-i.height/2;e.y=t.centerY+n-S,e.x=t.centerX}))}(this,this.ctx,t,{padding:o,textAlign:s,verticalAlign:a},i*r,e)}resetAllAnimation(){this.ctx.animationManager.stopByAnimationGroupId(this.id),RI([this.datumSelection],LI),RI([this.needleSelection],PI),this.formatLabelText()}
1resetAnimation(e){"initial"===e?this.animationState.transition("reset"):"ready"===e&&this.animationState.transition("skip")}animateLabelText(e={}){const{animationManager:t}=this.ctx;let i,n,s,a;if(this.labelSelection.each(((t,o)=>{t.opacity=1,"primary"===o.label?(i=t.previousDatum?.value??e.from??o.value,n=o.value):"secondary"===o.label&&(s=t.previousDatum?.value??e.from??o.value,a=o.value)})),this.labelsHaveExplicitText());else if(null==n||null==a)this.formatLabelText();else if(Number(i)===Number(n)&&Number(s)===Number(a))this.formatLabelText({label:n,secondaryLabel:a});else{const o=`${this.id}_labels`;t.animate({id:o,groupId:"label",from:{label:Number(i),secondaryLabel:Number(s)},to:{label:Number(n),secondaryLabel:Number(a)},phase:e.phase??"update",onUpdate:e=>this.formatLabelText(e),onStop:()=>this.formatLabelText({label:n,secondaryLabel:a})})}}animateEmptyUpdateReady(){const{animationManager:e}=this.ctx,{node:t,needle:i}=NI(!0,this.scale.range[0]);OI(this.id,"node",e,[this.datumSelection],t,((e,t)=>t.itemId)),OI(this.id,"needle",e,[this.needleSelection],i,(()=>"needle")),OI(this.id,"label",e,[this.labelSelection],xb,(e=>e.unsafeDatum.label)),this.animateLabelText({from:this.properties.scale.min,phase:"initial"})}animateWaitingUpdateReady(){const{animationManager:e}=this.ctx,{node:t,needle:i}=NI(!1,this.scale.range[0]);OI(this.id,"node",e,[this.datumSelection],t,((e,t)=>t.itemId)),OI(this.id,"needle",e,[this.needleSelection],i,(()=>"needle")),this.animateLabelText()}animateReadyResize(){this.resetAllAnimation()}dataCount(){return Number.NaN}getSeriesDomain(){return{domain:[Number.NaN,Number.NaN]}}getSeriesRange(){return[Number.NaN,Number.NaN]}getLegendData(){return[]}getTooltipContent(e){const{id:t,properties:i}=this,{tooltip:n}=i,{value:s,text:a,fallbackLabel:o}=fb(this,e);if(null!=s)return this.formatTooltipWithContext(n,{data:[{label:a,fallbackLabel:o,value:this.formatLabel(s)}]},{seriesId:t,title:void 0,datum:void 0,value:s})}pickNodeClosestDatum(e){return Db(this,e)}pickFocus(e){return wb(this,e)}getCaptionText(){const{value:e}=this.properties,t=[];return t.push(this.formatLabel(e)),this.labelSelection.each(((e,i)=>{const s=vb(this.id,this.ctx,i);null!=s&&t.push((0,n.boc)(s))})),t.join(". ")}getCategoryValue(e){}datumIndexForCategoryValue(e){}hasItemStylers(){return this.properties.selection.enabled||null!=this.properties.label.itemStyler}};return e.className="RadialGaugeSeries",e.type="radial-gauge",e})(),qI=(()=>({type:"series",name:"radial-gauge",chartType:"standalone",enterprise:!0,dependencies:[mb],version:s.xv,options:n.bfJ,themeTemplate:{minWidth:200,minHeight:200,tooltip:{enabled:!1},series:{outerRadiusRatio:1,innerRadiusRatio:.8,startAngle:270,endAngle:450,scale:{stroke:{$path:["/2",n.HHJ,{$palette:"hierarchyColors"}]},strokeWidth:{$isUserOption:["./stroke",2,0]},label:{fontWeight:{$ref:"fontWeight"},fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},color:{$ref:"textColor"},spacing:12},...(0,n.fs4)({defaultFill:{$path:["/1",{$palette:"fill"},{$palette:"hierarchyColors"}]}})},bar:{strokeWidth:{$isUserOption:["./stroke",2,0]}},segmentation:{enabled:!1,interval:{},spacing:2},needle:{enabled:!1,fill:{$ref:"foregroundColor"},spacing:10},label:{...n.mgV,enabled:!0,fontWeight:{$ref:"fontWeight"},fontSize:56,minimumFontSize:18/56,fontFamily:{$ref:"fontFamily"},color:{$ref:"textColor"}},secondaryLabel:{...n.mgV,enabled:!0,fontWeight:{$ref:"fontWeight"},fontSize:{$rem:n.q8q.LARGE},minimumFontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},color:{$ref:"subtleTextColor"}},tooltip:{range:{$path:["/tooltip/range",10]}},selection:n.zg6,...(0,n.fs4)({defaultColorRange:{$if:[{$eq:[{$palette:"type"},"inbuilt"]},{$interpolate:[{$palette:"secondDivergingColors"},5]},n.Mg2]},defaultTarget:{fill:{$ref:"foregroundColor"},stroke:{$ref:"foregroundColor"},size:10,shape:"triangle",placement:"outside",spacing:5,label:{enabled:!0,fontWeight:{$ref:"fontWeight"},fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},color:{$ref:"textColor"},spacing:5}}})}},create:e=>new ZI(e)}))();function QI(e,t){e.fill=t.fill,e.fillOpacity=t.fillOpacity??1}function JI(e,t){e.lineDash=t.lineDash,e.lineDashOffset=t.lineDashOffset??0,e.stroke=t.stroke,e.strokeOpacity=t.strokeOpacity??1,e.strokeWidth=t.strokeWidth??0}function eA(e,t){e.fill=t.color,e.fontFamily=t.fontFamily,e.fontSize=t.fontSize,e.fontStyle=t.fontStyle,e.fontWeight=t.fontWeight,e.textAlign=t.textAlign,e.textBaseline="top"}function tA(e,t){const i=null!=t.stroke&&(t.strokeWidth??0)>0;e.setBoxing({fill:t.fill,fillOpacity:t.fillOpacity,cornerRadius:t.cornerRadius,padding:t.padding??0,border:i?{enabled:!0,stroke:t.stroke,strokeWidth:t.strokeWidth,strokeOpacity:t.strokeOpacity}:void 0})}var iA=class extends s.n1.TranslatableGroup{update(e){this.pathNode??(this.pathNode=this.appendChild(new s.n1.Path)),this.pathNode.visible=!1,this.pathNode.fill="transparent",JI(this.pathNode,e)}getPath(){return this.pathNode}},nA=class extends n.TS0{},sA=(()=>{var e=class extends s.n1.SeriesProperties{constructor(){super(...arguments),this.tooltip=s.n1.makeSeriesTooltip()}};return l([n.mAP],e.prototype,"tooltip",2),e})(),aA=(()=>{var e=class extends sA{constructor(){super(...arguments),this.direction="down"}};return l([n.mAP],e.prototype,"direction",2),l([n.mAP],e.prototype,"depthSpacing",2),l([n.mAP],e.prototype,"innerSpacing",2),l([n.mAP],e.prototype,"outerSpacing",2),l([n.mAP,(0,n.rtC)("depthSpacing")],e.prototype,"verticalSpacing",2),e})(),oA=1e-6;function rA(e,t,i){const s=Math.min(Math.max(t/2,i),.5);return(0,n.qE8)(s,e,1-s)}function lA(e,t,i){const n=rA(e,t,i);return{min:n-t/2,max:n+t/2}}function hA(e,t,i){return{x:(t-e.x)/e.width,y:1-(i-e.y)/e.height}}function cA(e,t,i){return e.max-e.min>i?(e.min+e.max)/2:e.min<t-i/2?e.min+i/2:e.max>t+i/2?e.max-i/2:t}function dA(e,t){return Math.abs((e.min+e.max)/2-t)<=oA}var uA=class extends s.n1.Series{constructor(e){super({moduleCtx:e,pickModes:[s.n1.SeriesNodePickMode.EXACT_SHAPE_MATCH],alwaysClip:!0,supportsStandaloneZoom:!0}),this.properties=new sA,this.viewportGroup=this.contentGroup.appendChild(new(s.n1.Scalable(s.n1.TranslatableGroup))({name:`${this.id}-viewport`})),this.dataNodeGroup=this.viewportGroup.appendChild(new s.n1.TranslatableGroup({name:`${this.id}-series-dataNodes`,zIndex:2})),this.linkGroup=this.viewportGroup.appendChild(new s.n1.TranslatableGroup({name:`${this.id}-series-links`,zIndex:1})),this.datumSelection=s.n1.Selection.selectNoInference(this.dataNodeGroup,(()=>this.nodeFactory())),this.linkSelection=s.n1.Selection.selectNoInference(this.linkGroup,(()=>this.linkFactory())),this.vertexNodeDatumIndices={},this.hasCentredContent=!1,this.graph=this.createNetworkGraph(),this.layout=this.createNetworkLayout(),this.cleanup.register(e.collapsedManager.setSeriesGetDatumCallback(this.id,this.getDatumById.bind(this)),e.chartState.observe((e=>
1this.activeItemObserver(e("activeItem")))),e.eventsHub.on("layout:complete",(e=>this.onLayoutComplete(e))),e.eventsHub.on("update:complete",(()=>this.onUpdateComplete())),e.eventsHub.on("active:load-memento",(e=>this.onActiveLoadMemento(e))),e.eventsHub.on("collapsed:restore",(e=>this.onCollapsedRestore(e))),e.eventsHub.on("series-area:click",(e=>this.onSeriesAreaClick(e))),e.eventsHub.on("series:keynav-expand",(e=>this.onSeriesAreaKeynavExpand(e))),e.eventsHub.on("series:keynav-collapse",(e=>this.onSeriesAreaKeynavCollapse(e))),e.eventsHub.on("zoom:change-request",(e=>this.onZoomChangeRequest(e))),e.eventsHub.on("zoom:change-complete",(e=>this.onZoomChangeComplete(e))))}dataCount(){return this.datumSelection.length}update(e){this.hasData?(this.contentGroup.visible=!0,this.updateSelections(),this.updateNodes(),this.applyViewportTransform()):this.contentGroup.visible=!1}mapFocusBBoxToPanTarget(e,t){return{x:t.x,y:2*e.y+e.height-t.y-t.height,width:t.width,height:t.height}}processPendingCollapse(){this.pendingCollapsedIds&&(this.ctx.collapsedManager.collapse(this.pendingCollapsedIds,this.id,"api-call"),this.pendingCollapsedIds=void 0)}expand(e,t){this.ctx.collapsedManager.expand(e,this.id,t)&&this.markNodeDataDirty()}makeLayoutUpdateOptions(){return{height:this.seriesRect?.height??0,width:this.seriesRect?.width??0,graph:this.graph,vertices:this.getRootVertices(),getDatumNodeBBox:this.getDatumNodeBBox.bind(this),getLinkInterpolation:this.getLinkInterpolation.bind(this),layoutDatumNode:this.layoutDatumNode.bind(this),layoutLinkNode:this.layoutLinkNode.bind(this),isVertexCollapsed:this.isVertexCollapsed.bind(this)}}measureDatumNode(e){return e.getBBox()}getNodeDatumIndex(e){return this.vertexNodeDatumIndices[this.graph.getVertexValue(e)]}setNodeDatumIndex(e,t){this.vertexNodeDatumIndices[e.value]=t}getDatumById(e){return this.datumSelection.at(this.vertexNodeDatumIndices[e])?.datum?.datum}linkFactory(){return new iA}updateSelections(){this.nodeDataRefresh&&(this.nodeDataRefresh=!1,this.vertexNodeDatumIndices={},this.contextNodeData=this.createNodeData(),this.contextNodeData&&(this.updateDatumSelection(this.contextNodeData.nodeData,this.datumSelection),this.updateLinkSelection(this.contextNodeData.linkData,this.linkSelection)))}updateLinkSelection(e,t){t.update(e)}updateNodes(){this.updateDatumNodes(this.datumSelection),this.updateLinkNodes(this.linkSelection),this.layout.update(this.makeLayoutUpdateOptions())}datumMidPoint(e){const{vertex:t}=e;if(null==t)return;const i=this.getNodeDatumIndex(t);if("number"!=typeof i)return;const n=this.datumSelection.at(i);if(!n)return;const a=s.n1.Transformable.toCanvas(n,this.measureDatumNode(n));return a.isFinite()?s.n1.Transformable.fromCanvasPoint(this.contentGroup,{canvasX:a.x+a.width/2,canvasY:a.y+a.height/2}):void 0}getDatumNodeBBox(e){const t=this.getNodeDatumIndex(e);if("number"!=typeof t)return;const i=this.datumSelection.at(t);return i?this.measureDatumNode(i):void 0}layoutDatumNode(e,t,i){const n=this.getNodeDatumIndex(e);if("number"!=typeof n)return;const s=this.datumSelection.at(n);return s?this.positionDatumNode(s,t,i):void 0}layoutLinkNode(e,t){const i=this.getNodeDatumIndex(e);if("number"!=typeof i)return;const n=this.linkSelection.at(i);if(!n)return;const s=n.getPath();s&&(t(s.path),s.visible=!0)}applyViewportTransform(){const e=this.getViewportScaling(),t=this.getViewportTranslation(e);this.viewportGroup.scalingX=e,this.viewportGroup.scalingY=e,this.viewportGroup.translationX=t.x,this.viewportGroup.translationY=t.y}centreItem(e){null!=e&&(this.pendingView={itemId:e,intent:"centre"})}revealItem(e){null!=e&&(this.pendingView={itemId:e,intent:"reveal",anchor:this.getViewportAnchor(e)})}getViewportAnchor(e){const t=this.getPaddedContentBounds(),i=this.graph.findVertexById(e);if(!t||!i)return;const s=this.getVertexRatioSpan(i,t);if(!s)return;const a=(0,n.af4)(this.ctx.chartState.getValue("zoom")),o=a.x.max-a.x.min,r=a.y.max-a.y.min;return o<=0||r<=0?void 0:{x:((s.x.min+s.x.max)/2-a.x.min)/o,y:((s.y.min+s.y.max)/2-a.y.min)/r}}getPendingVertex(){const{pendingView:e}=this;if(e)return this.graph.findVertexById(e.itemId)}getContentFitScale(){const{seriesRect:e}=this,t=this.layout.getContentBBox();if(!(!e||!t||t.width<=0||t.height<=0))return Math.min(e.width/t.width,e.height/t.height)}getMinScale(){const e=this.getContentFitScale();if(null!=e)return Math.min(e,1)}getPaddedContentBounds(){const{seriesRect:e}=this,t=this.layout.getContentBBox(),i=this.getMinScale();if(!e||!t||null==i||i<=0)return;const n=e.width/i/2,s=e.height/i/2,a=t.width+2*n,o=t.height+2*s;return{x:t.x-n,y:t.y-s,width:a,height:o,limitX:n/a,limitY:s/o}}getViewportScaling(){const e=this.getContentFit();if(!e)return 1;const t=(0,n.af4)(this.ctx.chartState.getValue("zoom"));return Math.min(e.x/(t.x.max-t.x.min),e.y/(t.y.max-t.y.min),1)}getViewportTranslation(e){const{seriesRect:t}=this,i=this.getPaddedContentBounds();if(!t||!i)return n.ZY9.from(0,0);const s=(0,n.af4)(this.ctx.chartState.getValue("zoom")),a=i.x+s.x.min*i.width,o=i.y+(1-s.y.max)*i.height,r=Math.max(0,t.width-(s.x.max-s.x.min)*i.width*e),l=Math.max(0,t.height-(s.y.max-s.y.min)*i.height*e);return n.ZY9.from(-a*e+r/2,-o*e+l/2)}getUpdatedZoom(){const e=this.getPaddedContentBounds();if(!e)return;const t=this.getHeldScale();if(!t)return;const i=this.getWindowSizesForScale(t.fit,t.constrained),n=null!=this.zoomedPaddedBounds&&Math.abs(t.constrained-t.requested)>oA,s=this.getHeldViewCentre(e),a=this.getRevealSpan(e);if(a){const t=this.getAnchoredCentre(a,i),o=t??s??this.getWindowCentre(),r=cA(a.x,o.x,i.x),l=cA(a.y,o.y,i.y),h={x:lA(r,i.x,e.limitX),y:lA(l,i.y,e.limitY)};return!t||!n&&dA(h.x,r)&&dA(h.y,l)?h:this.getFittedZoom(e)}const o=this.getPendingViewCentre(e),r=o??s;if(!r)return;const l={x:lA(r.x,i.x,e.limitX),y:lA(r.y,i.y,e.limitY)};return o||!n&&dA(l.x,r.x)&&dA(l.y,r.y)?l:this.getFittedZoom(e)}getFittedZoom(e){const t=this.getContentFit(),i=this.getMinScale();if(!t||null==i)return;const n=this.getWindowSizesForScale(t,i);return{x:lA(.5,n.x,e.limitX),y:lA(.5,n.y,e.limitY)}}getPendingViewCentre(e){if("reveal"===this.pendingView?.intent)return;const t=this.getPendingViewBounds();return t?hA(e,t.x+t.width/2,t.y+t.height/2):void 0}getRevealSpan(e){if("reveal"!==this.pendingView?.intent)return;const t=this.getPendingVertex();return t?this.getVertexRatioSpan(t,e):void 0}getVertexRatioSpan(e,t){const i=this.layout.getNodeBBox(e);if(!i)return;const n=hA(t,i.x,i.y+i.height),s=hA(t,i.x+i.width,i.y);return{x:{min:n.x,max:s.x},y:{min:n.y,max:s.y}}}getAnchoredCentre(e,t){const{anchor:i}=this.pendingView??{};if(i)return{x:(e.x.min+e.x.max)/2+t.x*(.5-i.x),y:(e.y.min+e.y.max)/2+t.y*(.5-i.y)}}getWindowCentre(){const e=(0,n.af4)(this.ctx.chartState.getValue("zoom"));return{x:(e.x.min+e.x.max)/2,y:(e.y.min+e.y.max)/2}}getHeldViewCentre(e){const t=this.zoomedPaddedBounds;if(!t||(i=t,s=e,Math.abs(i.x-s.x)<.5&&Math.abs(i.y-s.y)<.5&&Math.abs(i.width-s.width)<.5&&Math.abs(i.height-s.height)<.5))return;var i,s;const a=(0,n.af4)(this.ctx.chartState.getValue("zoom"));return hA(e,t.x+(a.x.min+a.x.max)/2*t.width,t.y+(1-(a.y.min+a.y.max)/2)*t.height)}getHeldScale(){const e=this.getContentFit();if(!e)return;const t=(0,n.af4)(this.ctx.chartState.getValue("zoom")),i=t.x.max-t.x.min,s=t.y.max-t.y.min;if(i<=0||s<=0)return;const a=this.zoomedPaddedBounds,o=(a?this.getBoundsFit(a):void 0)??e,r=Math.min(o.x/i,o.y/s);return{fit:e,requested:r,constrained:this.constrainScale(r)}}getPendingViewBounds(){const e=this.getPendingVertex();return e?this.layout.getNodeBBox(e):this.hasCentredContent?void 0:this.layout.getContentBBox()}
1activeItemObserver(e){e?.seriesId===this.id&&this.expandNetworkToItem(e.itemId,"api-call")}onCollapsedRestore({collapsed:e}){e&&0===this.graph.getVertexCount()&&(this.pendingCollapsedIds=e)}onLayoutComplete(e){this.seriesRect=e.series.rect}onUpdateComplete(){const e=this.getUpdatedZoom();e&&(this.getPendingVertex()&&(this.pendingView=void 0),this.hasCentredContent=!0,this.ctx.zoomManager?.updateZoom({source:"chart-update",sourceDetail:"internal-networkSeriesFocusChange"},e))}onActiveLoadMemento({activeItem:e}){e?.seriesId===this.id&&this.centreItem(e.itemId)}onSeriesAreaClick(e){const{type:t,clickedNode:i,target:n}=e;if("click"!==t||i?.series!==this||null==i.itemId||!this.hasBuiltinListener(n))return;(this.ctx.collapsedManager.isCollapsed(i.itemId)?this.expandItem(i.itemId,"user-interaction"):this.collapseItem(i.itemId,"user-interaction"))&&this.revealItem(i.itemId)}onSeriesAreaKeynavExpand(e){const{nodeDatum:t,widgetEvent:i}=e;null!=t.itemId&&t.series===this&&(i.sourceEvent.preventDefault(),this.expandItem(t.itemId,"user-interaction")&&this.revealItem(t.itemId),this.ctx.eventsHub.emit("chart:request-update",{type:n.GvF.PERFORM_LAYOUT}))}onSeriesAreaKeynavCollapse(e){const{nodeDatum:t,widgetEvent:i}=e;null!=t.itemId&&t.series===this&&(i.sourceEvent.preventDefault(),this.collapseItem(t.itemId,"user-interaction")&&this.revealItem(t.itemId),this.ctx.eventsHub.emit("chart:request-update",{type:n.GvF.PERFORM_LAYOUT}))}onZoomChangeRequest(e){e.isReset||this.constrainZoomWindow(e)}onZoomChangeComplete(e){"user-interaction"===e.source&&(this.pendingView=void 0,this.hasCentredContent=!0),this.zoomedPaddedBounds=this.getPaddedContentBounds(),this.applyViewportTransform(),this.ctx.eventsHub.emit("chart:request-update",{type:n.GvF.SCENE_RENDER})}getSharedScaleWindowSizes(e,t){const i=this.getContentFit();if(!i||e<=0||t<=0)return;const n=Math.min(i.x/e,i.y/t);return this.getWindowSizesForScale(i,this.constrainScale(n))}getWindowSizesForScale(e,t){return{x:Math.min(1,e.x/t),y:Math.min(1,e.y/t)}}constrainScale(e){const t=this.getMinScale();return null==t?e:Math.min(Math.max(e,t),1)}getStateWindowSizes(e){let t,i;for(const s of(0,n.vIl)(e)){const n=e[s];null!=n&&("x"===n.direction?t??(t=n.max-n.min):i??(i=n.max-n.min))}if(null!=t&&null!=i)return{x:t,y:i}}isZoomAtLimit(e,t,i){const n=this.getStateWindowSizes(e.oldState);if(!n)return!1;return(Math.abs(t.x-n.x)>oA||Math.abs(t.y-n.y)>oA)&&Math.abs(i.x-n.x)<oA&&Math.abs(i.y-n.y)<oA}restoreZoomWindow(e){const t={};for(const i of(0,n.vIl)(e.oldState)){const s=e.oldState[i];null!=s&&(t[i]={min:s.min,max:s.max,direction:"x"===s.direction?n.tv$.X:n.tv$.Y})}e.constrainChanges(t)}constrainZoomWindow(e){const t=this.getStateWindowSizes(e.state);if(!t)return;const i=this.getPaddedContentBounds();if(!i)return;const s=this.getSharedScaleWindowSizes(t.x,t.y);if(!s)return;if(this.isZoomAtLimit(e,t,s))return void this.restoreZoomWindow(e);const a={};let o=!1;for(const t of(0,n.vIl)(e.state)){const r=e.state[t];if(null==r)continue;const{min:l,max:h,direction:c}=r,d="x"===c,u=d?s.x:s.y,p=rA((l+h)/2,u,d?i.limitX:i.limitY),g=p-u/2,m=p+u/2;a[t]={min:g,max:m,direction:d?n.tv$.X:n.tv$.Y},o||(o=Math.abs(g-l)>oA||Math.abs(m-h)>oA)}o&&e.constrainChanges(a)}getContentFit(){const e=this.getPaddedContentBounds();if(e)return this.getBoundsFit(e)}getBoundsFit(e){const{seriesRect:t}=this;if(!(!t||e.width<=0||e.height<=0))return{x:t.width/e.width,y:t.height/e.height}}getCategoryValue(e){}datumIndexForCategoryValue(e){}getLegendData(e){return[]}resetAnimation(e){}getSeriesDomain(e){return{domain:[]}}getSeriesRange(e,t){return[Number.NaN,Number.NaN]}},pA=class{constructor(){this.maxRegularDimensionsCount=1e3}getContentBBox(){return this.contentBBox}clear(){this.regularBBox=void 0,this.contentBBox=void 0}calculateRegularDimensions(e){if(this.regularBBox)return;let t=0,i=0,n=0;for(const s of e.graph.vertices()){const a=e.getDatumNodeBBox(s);if(a&&(i=Math.max(i,a.height),n=Math.max(n,a.width),t++,t>=this.maxRegularDimensionsCount))break}n>0&&i>0&&(this.regularBBox=new s.n1.BBox(0,0,n,i))}},{BBox:gA}=s.n1,mA=class extends pA{update(e){this.calculateRegularDimensions(e),this.internalLayout=this.getInternalLayout(e),this.internalLayout.reset();const{containerBBox:t}=this.internalLayout.updateNodes(e,this.regularBBox);this.contentBBox=this.internalLayout.getContentBBox()??t}getNodeBBox(e){return this.internalLayout?.getNodeBBox(e)}initChildLayout(e,t){return this.internalLayout=this.getInternalLayout(t),this.internalLayout.contentBoundsAccumulator=e.contentBoundsAccumulator,this.internalLayout.n
1odeBBoxes=e.nodeBBoxes,this.internalLayout}},yA=class{constructor(){this.alignParentToChildren=!0,this.contentBoundsAccumulator={count:0,left:0,top:0,right:0,bottom:0},this.nodeBBoxes=new Map}getNodeBBox(e){return this.nodeBBoxes.get(e)}updateNodes(e,t,i=new gA(0,0,0,0)){const{getDatumNodeBBox:n,getLinkInterpolation:s,layoutDatumNode:a,layoutLinkNode:o,vertices:r}=e,l=[];let h=-1,c=!1;for(const d of r){h++;let u=n(d);if(!u&&e.hiddenOnCollapse)continue;if(u=t??u,!u)continue;this.addNodesGroupBBoxOuterSpacing(e,i,c);const p=this.getVisibleChildren(e,d),g=null==p?this:e.getLayout(d)?.initChildLayout(this,e)??this;let m=g.alignParentToChildren?void 0:this.getNodeLayoutBBox(e,u,i);const{descendentsContainerBBox:y,childrenBBoxes:f,mergedChildrenBBoxes:x,childrenCount:b}=this.updateChildren(e,p,g,i,m??u,t,c||0===h),v=b>0&&null!=x&&x.width>0;c=v,m??(m=this.getNodeLayoutBBox(e,u,i,x));const S=a(d,m,t);if(S&&this.nodeBBoxes.set(d,S),l.push({vertex:d,bbox:m}),this.accumulateContentBounds(S??m),y){const t=this.getNodesContainerBBox(e,i,y);i=gA.merge([i,t,m])}else i=gA.merge([i,m]);if(this.addNodesGroupBBoxInnerSpacing(e,i,r,h,v),f)for(const{vertex:t,bbox:i}of f){const n=s(d,t);o(t,(t=>g.drawLink(t,m,i,n,e)))}}return{containerBBox:i,childrenBBoxes:l}}reset(){this.contentBoundsAccumulator.count=0,this.nodeBBoxes.clear()}getContentBBox(){const e=this.contentBoundsAccumulator;if(0!==e.count)return new gA(e.left,e.top,e.right-e.left,e.bottom-e.top)}getVisibleChildren(e,t){const i=e.graph.neighboursWithEdgeValue(t,"child");if(i&&0!==i.length&&!e.isVertexCollapsed(t))return i}updateChildren(e,t,i,n,s,a,o){if(null==t)return{childrenCount:0};const r=i.getChildrenGroupBBox(e,s,n,o),{containerBBox:l,childrenBBoxes:h}=i.updateNodes({...e,vertices:t},a,r);return{descendentsContainerBBox:l,childrenBBoxes:h,mergedChildrenBBoxes:h.length>0?gA.merge(h.map((({bbox:e})=>e))):void 0,childrenCount:t.length}}accumulateContentBounds(e){const t=this.contentBoundsAccumulator;if(0===t.count)return t.left=e.x,t.top=e.y,t.right=e.x+e.width,t.bottom=e.y+e.height,void(t.count=1);e.x<t.left&&(t.left=e.x),e.y<t.top&&(t.top=e.y),e.x+e.width>t.right&&(t.right=e.x+e.width),e.y+e.height>t.bottom&&(t.bottom=e.y+e.height),t.count++}},fA=0*Math.PI,xA=.5*Math.PI,bA=1*Math.PI,vA=1.5*Math.PI,SA=bA,MA=vA,kA=fA,DA=xA;function wA(e,t,i,s,a){e.moveTo(t.x,t.y);for(let o=0;o<i.length;o++){const r=i[o],l=i[o-1]??t,h=i[o+1]??s,c=(0,n.qE8)(0,a[o],Math.min(Math.abs(l.x-h.x),Math.abs(l.y-h.y))/2);if(c<=0){e.lineTo(r.x,r.y);continue}switch(IA(l,r,h)){case"down-left":e.lineTo(r.x,r.y-c),e.arc(r.x-c,r.y-c,c,fA,xA,!1);break;case"down-right":e.lineTo(r.x,r.y-c),e.arc(r.x+c,r.y-c,c,SA,DA,!0);break;case"up-left":e.lineTo(r.x,r.y+c),e.arc(r.x-c,r.y+c,c,kA,MA,!0);break;case"up-right":e.lineTo(r.x,r.y+c),e.arc(r.x+c,r.y+c,c,bA,vA,!1);break;case"left-down":e.lineTo(r.x+c,r.y),e.arc(r.x+c,r.y+c,c,MA,SA,!0);break;case"left-up":e.lineTo(r.x+c,r.y),e.arc(r.x+c,r.y-c,c,xA,bA,!1);break;case"right-down":e.lineTo(r.x-c,r.y),e.arc(r.x-c,r.y+c,c,vA,fA,!1);break;case"right-up":e.lineTo(r.x-c,r.y),e.arc(r.x-c,r.y-c,c,DA,kA,!0);break;case"straight":e.lineTo(r.x,r.y)}}e.lineTo(s.x,s.y)}function IA(e,t,i){if(e.x===i.x||e.y===i.y)return"straight";return Math.abs(e.x-t.x)>=Math.abs(e.y-t.y)?t.x>e.x?i.y>t.y?"right-down":"right-up":i.y>t.y?"left-down":"left-up":i.x>t.x?t.y>e.y?"down-right":"up-right":t.y>e.y?"down-left":"up-left"}var{BBox:AA}=s.n1,CA=class extends mA{getInternalLayout(e){return this.direction!==e.direction||null==this.internalLayout?(this.direction=e.direction,"left"===e.direction||"right"===e.direction?new LA:new NA):this.internalLayout}},NA=class extends yA{constructor(){super(...arguments),this.alignParentToChildren=!1}addNodesGroupBBoxOuterSpacing(e,t,i){i&&("up"===e.direction&&(t.y-=e.outerSpacing),t.height+=e.outerSpacing)}addNodesGroupBBoxInnerSpacing(e,t,i,n,s){n<i.length-1&&!s&&("up"===e.direction&&(t.y-=e.innerSpacing),t.height+=e.innerSpacing)}getNodeLayoutBBox(e,t,i){const n="up"===e.direction?i.y-t.height:i.y+i.height;return new AA(i.x,n,t.width,t.height)}getChildrenGroupBBox(e,t){const i=e.depthSpacing+e.verticalSpacingExtra,n="up"===e.direction?t.y-i:t.y+t.height+i;return new AA(t.x+e.linkIndentation+e.nodeIndentation,n,0,0)}getNodesContainerBBox(e,t,i){return i}drawLink(e,t,i,s={type:"step"},a){const o=n.ZY9.from(t.x+t.width/2,"up"===a.direction?t.y-a.verticalSpacingExtra:t.y+t.height+a.verticalSpacingExtra),r=n.ZY9.from(i.x,i.y+i.height/2),l="up"===a.direction?-1:1,h=n.ZY9.from(o.x,o.y+l*a.depthSpacing/2),c=n.ZY9.from(t.x+a.linkIndentation,h.y),d=n.ZY9.from(t.x+a.linkIndentation,r.y),u=s.cornerRadius??0;e.clear(),wA(e,o,[h,c,d],r,[u,u,u,u])}},LA=class extends yA{constructor(){super(...arguments),this.alignParentToChildren=!1}addNodesGroupBBoxOuterSpacing(e,t,i){i&&("left"===e.direction&&(t.x-=e.outerSpacing),t.width+=e.outerSpacing)}addNodesGroupBBoxInnerSpacing(e,t,i,n,s){n<i.length-1&&!s&&("left"===e.direction&&(t.x-=e.innerSpacing),t.width+=e.innerSpacing)}getNodeLayoutBBox(e,t,i){const n="left"===e.direction?i.x-t.width:i.x+i.width;return new AA(n,i.y,t.width,t.height)}getChildrenGroupBBox(e,t){const i=e.depthSpacing+e.verticalSpacingExtra,n="left"===e.direction?t.x-i:t.x+t.width+i;return new AA(n,t.y+e.linkIndentation+e.nodeIndentation,0,0)}getNodesContainerBBox(e,t,i){return i}drawLink(e,t,i,s={type:"step"}
1,a){const o=n.ZY9.from("left"===a.direction?t.x-a.verticalSpacingExtra:t.x+t.width+a.verticalSpacingExtra,t.y+t.height/2),r=n.ZY9.from(i.x+i.width/2,i.y),l="left"===a.direction?-1:1,h=n.ZY9.from(o.x+l*a.depthSpacing/2,o.y),c=n.ZY9.from(h.x,t.y+a.linkIndentation),d=n.ZY9.from(r.x,t.y+a.linkIndentation),u=s.cornerRadius??0;e.clear(),wA(e,o,[h,c,d],r,[u,u,u,u])}},{BBox:PA}=s.n1,TA=class extends mA{getInternalLayout(e){return this.direction!==e.direction||null==this.internalLayout?(this.direction=e.direction,"left"===e.direction||"right"===e.direction?new RA:new OA):this.internalLayout}calculateRegularDimensions(e){if(!e.regularDimensions||null!=e.nodeWidth&&null!=e.nodeHeight)null!=e.nodeWidth&&null!=e.nodeHeight&&(this.regularBBox=new PA(0,0,e.nodeWidth,e.nodeHeight));else{if(super.calculateRegularDimensions(e),!this.regularBBox)return;null!=e.nodeWidth?this.regularBBox.width=e.nodeWidth:null!=e.nodeMaxWidth&&(this.regularBBox.width=Math.min(e.nodeMaxWidth,this.regularBBox.width)),null!=e.nodeHeight?this.regularBBox.height=e.nodeHeight:null!=e.nodeMaxHeight&&(this.regularBBox.height=Math.min(e.nodeMaxHeight,this.regularBBox.height))}}},OA=class extends yA{addNodesGroupBBoxOuterSpacing(e,t,i){i&&(t.width+=e.outerSpacing)}addNodesGroupBBoxInnerSpacing(e,t,i,n,s){n<i.length-1&&!s&&(t.width+=e.innerSpacing)}getNodeLayoutBBox(e,t,i,n){const s=n?n.x+n.width/2-t.width/2:i.x+i.width;return new PA(s,i.y,t.width,t.height)}getChildrenGroupBBox(e,t,i,n){let s=t.height+e.depthSpacing+e.verticalSpacingExtra;"up"===e.direction&&(s*=-1);const a=new PA(i.x,i.y+s,i.width,i.height);return n||(a.x+=e.outerSpacing-e.innerSpacing),a}getNodesContainerBBox(e,t,i){return new PA(i.x,"up"===e.direction?t.y:i.y,i.width,i.height)}drawLink(e,t,i,s={type:"step"},a){const o=n.ZY9.from(t.x+t.width/2,"up"===a.direction?t.y-a.verticalSpacingExtra:t.y+t.height+a.verticalSpacingExtra),r=n.ZY9.from(i.x+i.width/2,"up"===a.direction?i.y+i.height:i.y),l=(r.y-o.y)/2,h=n.ZY9.add(o,n.ZY9.from(0,l)),c=n.ZY9.sub(r,n.ZY9.from(0,l)),d=s.cornerRadius??0;e.clear(),wA(e,o,[h,c],r,[0,d,d])}},RA=class extends yA{addNodesGroupBBoxOuterSpacing(e,t,i){i&&(t.height+=e.outerSpacing)}addNodesGroupBBoxInnerSpacing(e,t,i,n,s){n<i.length-1&&!s&&(t.height+=e.innerSpacing)}getNodeLayoutBBox(e,t,i,n){const s=n?n.y+n.height/2-t.height/2:i.y+i.height;return new PA(i.x,s,t.width,t.height)}getNodesContainerBBox(e,t,i){return new PA("left"===e.direction?t.x:i.x,i.y,i.width,i.height)}getChildrenGroupBBox(e,t,i,n){let s=t.width+e.depthSpacing+e.verticalSpacingExtra;"left"===e.direction&&(s*=-1);const a=new PA(i.x+s,i.y,i.width,i.height);return n||(a.y+=e.outerSpacing-e.innerSpacing),a}drawLink(e,t,i,s={type:"step"},a){const o=n.ZY9.from("left"===a.direction?t.x-a.verticalSpacingExtra:t.x+t.width+a.verticalSpacingExtra,t.y+t.height/2),r=n.ZY9.from("left"===a.direction?i.x+i.width:i.x,i.y+i.height/2),l=(r.x-o.x)/2,h=n.ZY9.add(o,n.ZY9.from(l,0)),c=n.ZY9.sub(r,n.ZY9.from(l,0)),d=s.cornerRadius??0;e.clear(),wA(e,o,[h,c],r,[0,d,d])}},EA=class extends nA{constructor(e){super({cachedNeighboursEdge:"child",singleValueEdges:new Set(["datumIndex","parent","depth","image","title","subtitle","labels"])}),this.logger=e,this.verticesById={}}build(e,t,i,n,s,a,o){this.verticesById={};let r=0,l=!1;for(const t of e){const e=this.addVertex(t);null!=i[r]&&(l=!0,this.addEdge(e,this.addVertex(i[r]),"image")),null!=n[r]&&(l=!0,this.addEdge(e,this.addVertex(n[r]),"title")),null!=s[r]&&(l=!0,this.addEdge(e,this.addVertex(s[r]),"subtitle"));const o=a.map((e=>e?.[r]));l||(l=o.length>0&&o.some((e=>null!=e))),this.addEdge(e,this.addVertex(o),"labels"),this.addEdge(e,this.addVertex(r),"datumIndex"),this.verticesById[t]=e,r++}r=0;for(const i of t){const t=e[r],n=this.verticesById[t];if(null==n)return l;if(null==i){this.attachChild(o,n),r++;continue}const s=this.verticesById[i];if(!s)return this.logger.warnOnce(`Could not find parentId [${i}] on node [${t}], skipping.`),l;this.attachChild(s,n),r++}return l}computeDescendants(e){let t=e.length;for(const i of e){const e=this.neighboursWithEdgeValue(i,"child"),n=e?this.computeDescendants(e):0;
1t+=n,this.addEdge(i,this.addVertex(n),"descendants")}return t}findVertexById(e){return this.verticesById[e]}*vertices(){for(const e of Object.values(this.verticesById))yield e}attachChild(e,t){this.addEdge(e,t,"child"),this.addEdge(t,e,"parent")}};function zA(e,t,i){const s=Math.max(i-(t.padding.left+t.padding.right),1);return Number.isFinite(s)?(0,n.rHj)(e,{font:t,maxWidth:s,textWrap:t.wrapping,overflow:t.overflowStrategy}):e}var BA=class extends s.n1.Rect{constructor(){super(...arguments),this.exclusionCornerRadius=0,this.exclusionPath=new s.n1.ExtendedPath2D,this.exclusionPathKey=""}setStrokeExclusion(e,t){(null==e?null==this.exclusion:!0===this.exclusion?.equals(e)&&this.exclusionCornerRadius===t)||(this.exclusion=e,this.exclusionCornerRadius=t,this.markDirty())}renderStroke(e){const{exclusion:t}=this;null!=t?(e.save(),e.clip(this.getExclusionPath(t).getPath2D()),super.renderStroke(e),e.restore()):super.renderStroke(e)}getExclusionPath(e){const{x:t,y:i,width:n,height:s,strokeWidth:a,exclusionPath:o,exclusionCornerRadius:r}=this,l=[t,i,n,s,a,e.x,e.y,e.width,e.height,r].join();if(l===this.exclusionPathKey)return o;this.exclusionPathKey=l;const h=t-a,c=i-a,d=t+n+a,u=i+s+a;return o.clear(),o.moveTo(h,c),o.lineTo(h,u),o.lineTo(d,u),o.lineTo(d,c),o.closePath(),r>0?o.roundRect(e.x,e.y,e.width,e.height,r):o.rect(e.x,e.y,e.width,e.height),o}},FA=class extends s.n1.TranslatableGroup{constructor(){super(...arguments),this.shapeNode=this.appendChild(new BA({tag:0})),this.contentGroup=this.appendChild(new s.n1.Group),this.isRtl=!1}update(e,t,i,n,a,o,r){this.appliedStyles=n,this.isRtl=o;const l=function(e){const t=Number.isNaN(e.width)?e.maxWidth:e.width;if(!Number.isFinite(t))return 1/0;const i=!e.image.enabled||"left"!==e.image.position&&"right"!==e.image.position?0:e.image.width+e.image.spacing;return t-2*(e.padding.left+e.padding.right)-i}(n);this.updateShapeNode(n),this.updateImageNode(e.image,n),this.updateTitleNode(e.title,n,l),this.updateSubtitleNode(e.subtitle,n,l),this.updateLabelNodes(e.labels,n,l),this.updateExpanderNode(t,i,a,o,r,n),n.padding=this.getDirectionalPadding(n,r);let h=[],c=[];const d=[],u=[];this.imageNode&&"top"===n.image.position&&(this.imageNode.x=n.padding.left,d.push(this.imageNode),u.push(n.image.spacing)),this.titleNode&&(d.push(this.titleNode),u.push(n.title.spacing)),this.subtitleNode&&(d.push(this.subtitleNode),u.push(n.subtitle.spacing));let p=0;for(const e of this.labelNodes??[])e?(d.push(e),u.push(n.labels[p].spacing),p++):p++;this.imageNode&&"bottom"===n.image.position&&(this.imageNode.x=n.padding.left,d.push(this.imageNode),u.push(n.image.spacing)),this.imageNode&&"left"===n.image.position?(this.imageNode.y=n.padding.top,h=[this.imageNode,d],c=[n.image.spacing]):this.imageNode&&"right"===n.image.position?(this.imageNode.y=n.padding.top,h=[d,this.imageNode],c=[n.image.spacing]):h=[d],Ds(d,n.padding.top,u),ks(h,n.padding.left,c);const g=s.n1.Group.computeChildrenBBox(h.flat()).grow(n.padding);this.shapeNode.x=0,this.shapeNode.y=0,this.shapeNode.width=g.width,this.shapeNode.height=g.height,this.intrinsicCardSize={width:g.width,height:g.height}}updateBBox(e,t){if(this.shapeNode.width=e.width,this.shapeNode.height=e.height,this.expanderNode){const i=this.expanderNode.getBBox();switch(t){case"up":this.expanderNode.translationX=e.width/2-i.width/2,this.expanderNode.translationY=e.y-i.height/2;break;case"down":this.expanderNode.translationX=e.width/2-i.width/2,this.expanderNode.translationY=e.height-i.height/2;break;case"right":this.expanderNode.translationX=e.width-i.width/2,this.expanderNode.translationY=e.height/2-i.height/2;break;case"left":this.expanderNode.translationX=e.x-i.width/2,this.expanderNode.translationY=e.height/2-i.height/2}this.shapeNode.setStrokeExclusion(new s.n1.BBox(this.expanderNode.translationX,this.expanderNode.translationY,i.width,i.height),this.expanderNode.cornerRadius)}else this.shapeNode.setStrokeExclusion(void 0,0);const i=this.intrinsicCardSize,n=null!=i&&(i.width>e.width+.5||i.height>e.height+.5);this.contentGroup.setClipRectCanvasSpace(n?new s.n1.BBox(0,0,e.width,e.height):void 0)}realign(e){const t=this.appliedStyles;if(!t)return;const{imageNode:i,titleNode:s,subtitleNode:a,labelNodes:o}=this;let r=0;i&&("top"===t.image.position||"bottom"===t.image.position?i.x=e.width/2-i.width/2:r=i.width+(t.image.spacing??0),"right"===t.image.position&&(i.x=e.width-i.width-t.padding.right));
1const l="left"===t.image.position?t.padding.left+r:t.padding.left,h="right"===t.image.position?e.width-t.padding.right-r:e.width-t.padding.right,c=(e,t)=>{const i=(0,n.vDS)(t,this.isRtl);e.textAlign=i,function(e,t,i,n){const s=As(t,i,n);Cs(e,s);const a=e.getBBox(),o=As(a.x,a.x+a.width,n);o!==s&&Cs(e,Ls(e)+s-o)}(e,l,h,i)};s&&c(s,t.title.textAlign),a&&c(a,t.subtitle.textAlign);for(const[e,i]of t.labels.entries()){const t=o?.[e];t&&c(t,i.textAlign)}}getShapeBBox(){return new s.n1.BBox(0,0,this.shapeNode.width,this.shapeNode.height)}getFullBBox(){const e=this.getShapeBBox();return this.expanderNode?s.n1.BBox.merge([e,this.expanderNode.getBBox()]):e}updateShapeNode(e){this.shapeNode.cornerRadius=e.cornerRadius,QI(this.shapeNode,e),JI(this.shapeNode,e)}updateImageNode(e,t){if(null==e||!t.image.enabled)return this.imageNode?.remove(),void(this.imageNode=void 0);this.imageNode??(this.imageNode=this.contentGroup.appendChild(new s.n1.Rect)),this.imageNode.fill={type:"image",fit:"cover",url:e,width:t.image.width,height:t.image.height,backgroundFillOpacity:0},this.imageNode.width=t.image.width,this.imageNode.height=t.image.height,this.imageNode.cornerRadius=Math.min(t.image.cornerRadius,t.image.width/2,t.image.height/2)}updateTitleNode(e,t,i){if(null==e||!t.title.enabled)return this.titleNode?.remove(),void(this.titleNode=void 0);this.titleNode??(this.titleNode=this.contentGroup.appendChild(new s.n1.Text)),this.titleNode.text=zA(e,t.title,i),eA(this.titleNode,{...t.title,textAlign:"left"}),tA(this.titleNode,t.title)}updateSubtitleNode(e,t,i){if(null==e||!t.subtitle.enabled)return this.subtitleNode?.remove(),void(this.subtitleNode=void 0);this.subtitleNode??(this.subtitleNode=this.contentGroup.appendChild(new s.n1.Text)),this.subtitleNode.text=zA(e,t.subtitle,i),eA(this.subtitleNode,{...t.subtitle,textAlign:"left"}),tA(this.subtitleNode,t.subtitle)}updateLabelNodes(e,t,i){var n;if(null==e)return;this.labelNodes??(this.labelNodes=[]);let a=0;for(const o of e)null!=o&&t.labels[a].enabled?((n=this.labelNodes)[a]??(n[a]=this.contentGroup.appendChild(new s.n1.Text)),this.labelNodes[a].text=zA(o,t.labels[a],i),eA(this.labelNodes[a],{...t.labels[a],textAlign:"left"}),tA(this.labelNodes[a],t.labels[a]),a++):(this.labelNodes[a]?.remove(),this.labelNodes[a]=void 0,a++);for(let t=e.length;t<this.labelNodes.length;t++)this.labelNodes[t]?.remove();this.labelNodes.length=e.length}updateExpanderNode(e,t,i,n,s,a){if(0===t||!a.expander.enabled)return this.expanderNode?.remove(),void(this.expanderNode=void 0);this.expanderNode??(this.expanderNode=this.appendChild(new VA)),this.expanderNode.update(e,i,n,s,a)}getDirectionalPadding(e,t){if(!this.expanderNode)return e.padding;const i={...e.padding};switch(t){case"up":{const t=this.imageNode&&"top"===e.image.position?e.image.spacing:e.title.spacing;i.top=Math.max(e.padding.top,this.expanderNode.getBBox().height/2+t);break}case"down":{let t=this.subtitleNode?e.subtitle.spacing:e.title.spacing;this.imageNode&&"bottom"===e.image.position?t=e.image.spacing:this.labelNodes&&this.labelNodes.length>0&&(t=e.labels.at(-1)?.spacing??t),i.bottom=Math.max(e.padding.bottom,this.expanderNode.getBBox().height/2+t);break}case"left":{const t=this.imageNode&&"left"===e.image.position?e.image.spacing:e.title.spacing;i.left=Math.max(e.padding.left,this.expanderNode.getBBox().width/2+t);break}case"right":{const t=this.imageNode&&"right"===e.image.position?e.image.spacing:e.title.spacing;i.right=Math.max(e.padding.right,this.expanderNode.getBBox().width/2+t);break}}return i}},VA=class extends s.n1.TranslatableGroup{constructor(){super(...arguments),this.name="organization-node-expander"}get cornerRadius(){return this.shapeNode?.topLeftCornerRadius??0}update(e,t,i,n,a){this.shapeNode??(this.shapeNode=this.appendChild(new s.n1.Rect({tag:1}))),""==e?this.removeCountNode():this.updateCountNode(e,a),this.updateChevronNode(t,n,a);const o=this.layoutNodes(i,n,a);this.updateShapeNode(o,a)}updateCountNode(e,t){this.countNode??(this.countNode=this.appendChild(new s.n1.Text({tag:1}))),this.countNode.text=e,this.countNode.y=t.expander.padding.top,eA(this.countNode,t.expander.text)}
1removeCountNode(){this.countNode&&(this.countNode.remove(),this.countNode=void 0)}updateChevronNode(e,t,i){this.chevronNode??(this.chevronNode=this.appendChild(new $A({tag:1})));let n="down";switch(t){case"up":n=e?"up":"down";break;case"down":n=e?"down":"up";break;case"right":n=e?"right":"left";break;case"left":n=e?"left":"right"}this.chevronNode.update(i.expander.text.fontSize*(7/12),i.expander.text.fontSize*(3.5/12),n,i)}updateShapeNode(e,t){this.shapeNode&&(this.shapeNode.x=0,this.shapeNode.y=0,this.shapeNode.width=e.width,this.shapeNode.height=e.height,QI(this.shapeNode,t.expander),JI(this.shapeNode,t.expander),this.shapeNode.cornerRadius=t.expander.cornerRadius)}layoutNodes(e,t,i){const n={...i.expander.padding},a=[];if(this.countNode&&a.push(this.countNode),this.chevronNode&&a.push(this.chevronNode),(e&&("up"===t||"down"===t)||"left"===t)&&a.reverse(),ks(a,i.expander.padding.left,[i.expander.text.fontSize]),this.chevronNode){const e=this.countNode?this.countNode.getBBox().height:i.expander.text.fontSize,n="left"===t||"right"===t?this.chevronNode.getBBox().width:this.chevronNode.getBBox().height;this.chevronNode.translationY=i.expander.padding.top+(e-n)/2}const o=s.n1.Group.computeChildrenBBox(a).grow(n);return null==this.countNode&&(o.height=i.expander.padding.top+i.expander.padding.bottom+i.expander.text.fontSize),o}},$A=(()=>class extends(s.n1.Rotatable(s.n1.Translatable(s.n1.Path))){update(e,t,i,n){const{path:s}=this;switch(s.clear(),s.moveTo(0,0),s.lineTo(e/2,t),s.lineTo(e,0),this.rotationCenterX=e/2,this.rotationCenterY=t/2,this.stroke=n.expander.text.color,this.strokeWidth=1,this.fill="transparent",this.translationX="left"===i||"right"===i?n.expander.padding.left:0,this.translationY="up"===i||"down"===i?n.expander.padding.top:0,i){case"down":this.rotation=0;break;case"up":this.rotation=Math.PI;break;case"left":this.rotation=Math.PI/2;break;case"right":this.rotation=-Math.PI/2}}})(),HA=(()=>{var e=class extends aA{constructor(){super(...arguments),this.idKey="id",this.parentIdKey="parentId",this.direction="vertical",this.reverse=!1,this.expander=new jA,this.link=new KA,this.layout=new YA,this.node=new XA}};return l([n.mAP],e.prototype,"idKey",2),l([n.mAP],e.prototype,"parentIdKey",2),l([n.mAP],e.prototype,"direction",2),l([n.mAP],e.prototype,"reverse",2),l([n.mAP],e.prototype,"expander",2),l([n.mAP],e.prototype,"link",2),l([n.mAP],e.prototype,"layout",2),l([n.mAP],e.prototype,"node",2),e})(),jA=(()=>{var e=class extends n.XPE{constructor(){super(...arguments),this.cornerRadius=0,this.enabled=!0,this.fill="white",this.fillOpacity=1,this.hoverStyle=new _A,this.lineDash=[],this.padding=new n.Yqy(6),this.stroke="black",this.strokeOpacity=1,this.strokeWidth=1,this.text=new WA}};return l([n.mAP],e.prototype,"cornerRadius",2),l([n.mAP],e.prototype,"enabled",2),l([n.mAP],e.prototype,"fill",2),l([n.mAP],e.prototype,"fillOpacity",2),l([n.mAP],e.prototype,"hoverStyle",2),l([n.mAP],e.prototype,"itemStyler",2),l([n.mAP],e.prototype,"lineDash",2),l([n.mAP],e.prototype,"lineDashOffset",2),l([n.mAP],e.prototype,"padding",2),l([n.mAP],e.prototype,"stroke",2),l([n.mAP],e.prototype,"strokeOpacity",2),l([n.mAP],e.prototype,"strokeWidth",2),l([n.mAP],e.prototype,"text",2),e})(),WA=(()=>{var e=class extends n.XPE{constructor(){super(...arguments),this.color="black",this.fontSize=12,this.fontStyle="normal",this.textAlign="left"}};return l([n.mAP],e.prototype,"color",2),l([n.mAP],e.prototype,"fontFamily",2),l([n.mAP],e.prototype,"fontSize",2),l([n.mAP],e.prototype,"fontStyle",2),l([n.mAP],e.prototype,"fontWeight",2),l([n.mAP],e.prototype,"formatter",2),l([n.mAP],e.prototype,"showAllChildren",2),l([n.mAP],e.prototype,"showDirectChildren",2),l([n.mAP],e.prototype,"textAlign",2),e})(),_A=(()=>{var e=class extends n.XPE{constructor(){super(...arguments),this.text=new GA}};return l([n.mAP],e.prototype,"fill",2),l([n.mAP],e.prototype,"fillOpacity",2),l([n.mAP],e.prototype,"stroke",2),l([n.mAP],e.prototype,"strokeOpacity",2),l([n.mAP],e.prototype,"lineDash",2),l([n.mAP],e.prototype,"lineDashOffset",2),l([n.mAP],e.prototype,"text",2),e})(),GA=(()=>{var e=class extends n.XPE{};return l([n.mAP],e.prototype,"color",2),l([n.mAP],e.prototype,"fontWeight",2),e})(),KA=(()=>{var e=class extends n.XPE{constructor(){super(...arguments),this.interpolation=new UA,this.lineDash=[],this.stroke="black",this.strokeOpacity=1,this.strokeWidth=1}};return l([n.mAP],e.prototype,"itemStyler",2),l([n.mAP],e.prototype,"interpolation",2),l([n.mAP],e.prototype,"lineDash",2),l([n.mAP],e.prototype,"lineDashOffset",2),l([n.mAP],e.prototype,"stroke",2),l([n.mAP],e.prototype,"strokeOpacity",2),l([n.mAP],e.prototype,"strokeWidth",2),e})(),YA=(()=>{var e=class extends n.XPE{constructor(){super(...arguments),this.linkIndentation=26,this.nodeIndentation=26,this.stackFromDepth=4}};return l([n.mAP],e.prototype,"type",2),l([n.mAP],e.prototype,"linkIndentation",2),l([n.mAP],e.prototype,"nodeIndentation",2),l([n.mAP],e.prototype,"stackFromDepth",2),e})(),UA=(()=>{var e=class extends n.XPE{constructor(){super(...arguments),this.type="step",this.cornerRadius=0}};return l([n.mAP],e.prototype,"type",2),l([n.mAP],e.prototype,"cornerRadius",2),e})(),XA=(()=>{var e=class extends n.XPE{constructor(){super(...arguments),this.cornerRadius=0,this.fill="white",this.fillOpacity=1,this.image=new ZA,this.lineDash=[],this.padding=new n.Yqy(0),this.stroke="black",this.strokeOpacity=1,this.strokeWidth=1,this.title=new qA,this.subtitle=new qA,this.labels=new n.F_c(qA),this.clickToExpand=!0}};return l([n.mAP],e.prototype,"cornerRadius",2),l([n.mAP],e.prototype,"fill",2),l([n.mAP],e.prototype,"fillOpacity",2),l([n.mAP],e.prototype,"height",2),l([n.mAP],e.prototype,"image",2),l([n.mAP],e.prototype,"itemStyler",2),l([n.mAP],e.prototype,"lineDash",2),l([n.mAP],e.prototype,"lineDashOffset",2),l([n.mAP],e.prototype,"maxHeight",2),l([n.mAP],e.prototype,"maxWidth",2),l([n.mAP],e.prototype,"padding",2),l([n.mAP],e.prototype,"stroke",2),l([n.mAP],e.prototype,"strokeOpacity",2),l([n.mAP],e.prototype,"strokeWidth",2),l([n.mAP],e.prototype,"width",2),l([n.mAP],e.prototype,"title",2),l([n.mAP],e.prototype,"subtitle",2),l([n.mAP],e.prototype,"labels",2),l([n.mAP],e.prototype,"clickToExpand",2),e})(),ZA=(()=>{var e=class extends n.XPE{constructor(){super(...arguments),this.cornerRadius=0,this.enabled=!0,this.height=50,this.width=50,this.position="top",this.spacing=0}};return l([n.mAP],e.prototype,"cornerRadius",2),l([n.mAP],e.prototype,"enabled",2),l([n.mAP],e.prototype,"key",2),l([n.mAP],e.prototype,"height",2),l([n.mAP],e.prototype,"width",2),l([n.mAP],e.prototype,"position",2),l([n.mAP],e.prototype,"spacing",2),e})(),qA=(()=>{var e=class extends n.XPE{constructor(){super(...arguments),this.enabled=!0,this.color="black",this.fontSize=12,this.fontStyle="normal",this.spacing=0,this.textAlign="left",this.wrapping="on-space",this.overflowStrategy="ellipsis",this.fillOpacity=1,this.strokeWidth=0,this.strokeOpacity=1,this.cornerRadius=0,this.padding=new n.Yqy(0)}};return l([n.mAP],e.prototype,"enabled",2),l([n.mAP],e.prototype,"key",2),l([n.mAP],e.prototype,"color",2),l([n.mAP],e.prototype,"fontFamily",2),l([n.mAP],e.prototype,"fontSize",2),l([n.mAP],e.prototype,"fontStyle",2),l([n.mAP],e.prototype,"fontWeight",2),l([n.mAP],e.prototype,"formatter",2),l([n.mAP],e.prototype,"itemStyler",2),l([n.mAP],e.prototype,"spacing",2),l([n.mAP],e.prototype,"textAlign",2),l([n.mAP],e.prototype,"wrapping",2),l([n.mAP],e.prototype,"overflowStrategy",2),l([n.mAP],e.prototype,"fill",2),l([n.mAP],e.prototype,"fillOpacity",2),l([n.mAP],e.prototype,"stroke",2),l([n.mAP],e.prototype,"strokeWidth",2),l([n.mAP],e.prototype,"strokeOpacity",2),l([n.mAP],e.prototype,"cornerRadius",2),l([n.mAP],e.prototype,"padding",2),e})(),{keyProperty:QA,valueProperty:JA}=s.n1,eC="expander",tC=(()=>{var e=class extends uA{constructor(e){super(e),this.properties=new HA,this.hasAnyKeyedValue=!1,this.cleanup.register(e.eventsHub.on("highlight:change",(e=>this.onHighlightChange(e))))}createNetworkGraph(){return new EA(this.ctx.logger)}createNetworkLayout(){return new TA}
1getRootVertices(){return this.rootVertex?this.graph.neighboursWithEdgeValue(this.rootVertex,"child")??[]:[]}isVertexCollapsed(e){const t=e.value;return"string"==typeof t&&this.ctx.collapsedManager.isCollapsed(t)}getCollapsedState(e){return this.ctx.collapsedManager.isCollapsed(e)}async processData(e){this.hasAnyKeyedValue=!1;const{data:t}=this;if(null==t)return;this.layout.clear();const{idKey:i,parentIdKey:n,node:{image:{key:s},title:{key:a},subtitle:{key:o},labels:r}}=this.properties,l=[QA(i,void 0,{id:"idValue"}),JA(n,void 0,{id:"parentIdValue",allowNullKey:!0}),JA(s,void 0,{id:"imageValue",allowNullKey:!0,missingValue:void 0}),JA(a,void 0,{id:"titleValue",allowNullKey:!0,missingValue:void 0}),JA(o,void 0,{id:"subtitleValue",allowNullKey:!0,missingValue:void 0})];let h=0;for(const e of r)e.enabled&&l.push(JA(e.key,void 0,{id:`labelValue-${h}`,allowNullKey:!0,missingValue:void 0})),h++;const{dataModel:c,processedData:d}=await e.request(this.id,t,{props:l});this.dataModel=c,this.processedData=d,this.createGraphData(),this.processPendingCollapse()}get hasData(){return this.hasAnyKeyedValue}createNodeData(){const e=[],t=[];if(this.rootVertex){const i=this.graph.neighboursWithEdgeValue(this.rootVertex,"child");if(i)for(const n of i)t.push({from:this.rootVertex,to:n}),this.createNodeDataFromVertex(e,t,n,!1,1)}return{itemId:this.id,nodeData:e,linkData:t,labelData:[]}}nodeFactory(){return new FA}hasItemStylers(){const{expander:e,node:t,link:i,selection:n}=this.properties;return n.enabled||null!=e.itemStyler||null!=t.itemStyler||null!=i.itemStyler||null!=t.title.itemStyler||null!=t.subtitle.itemStyler||t.labels.some((e=>null!=e.itemStyler))}updateDatumSelection(e,t){t.update(e)}updateDatumNodes(e){const t=this.ctx.highlightManager.getActiveHighlight();e.each(((e,i)=>{const{collapsedByAncestor:n}=i;if(e.visible=!n,n)return;const s=this.graph.findNeighbourValue(i.vertex,"datumIndex"),a=this.graph.findNeighbourValue(i.vertex,"depth"),o=this.graph.findNeighbourValue(i.vertex,"descendants"),r=this.graph.neighboursWithEdgeValue(i.vertex,"child")?.length??0,l=t?.datumIndex===i.datumIndex,h=this.getHighlightState(t,l,i.datumIndex),c=o>0&&null!=i.itemId&&this.ctx.collapsedManager.isCollapsed(i.itemId),d={depth:a,allChildren:o,directChildren:r,isCollapsed:c},u=this.hoveredExpanderDatumIndex===s,p=this.getNodeStyle(s,l,h,d,u);e.opacity=this.getNodeOpacity(s,l,h);const g=this.resolveVertexFields(i.vertex),m=this.formatText(g.title,this.properties.node.title.formatter,s,d),y=this.formatText(g.subtitle,this.properties.node.subtitle.formatter,s,d),f=g.labels?.map(((e,t)=>this.formatText(e,this.properties.node.labels[t]?.formatter,s,d)));let x="";p.expander.text.showAllChildren&&p.expander.text.showDirectChildren?x=`${r} / ${o}`:p.expander.text.showAllChildren?x=`${o}`:p.expander.text.showDirectChildren&&(x=`${r}`);const b=this.formatText(x,this.properties.expander.text.formatter,s,d)??x;e.update({image:g.image,title:m,subtitle:y,labels:f},b,o,p,c,this.ctx.domManager.isRtl,this.getNetworkTreeLayoutDirection())}))}updateLinkNodes(e){e.each(((e,t)=>{const i=this.graph.findNeighbourValue(t.from,"datumIndex"),n=this.graph.findNeighbourValue(t.to,"datumIndex"),s=this.getNodeDatumIndex(t.from),a=null==s?void 0:this.contextNodeData?.nodeData[s].itemId,o=null==a||!this.ctx.collapsedManager.isCollapsed(a);if(e.visible=o,o){const t=this.getLinkStyle(i,n);e.update(t)}}))}positionDatumNode(e,t,i){e.translationX=t.x,e.translationY=t.y,i&&(e.updateBBox(i,this.getNetworkTreeLayoutDirection()),e.realign(i));const n=e.getFullBBox();return new s.n1.BBox(t.x+n.x,t.y+n.y,n.width,n.height)}getLinkInterpolation(e,t){const i=this.graph.findNeighbourValue(e,"datumIndex"),n=this.graph.findNeighbourValue(t,"datumIndex"),s=this.getLinkStyle(i,n);return{type:s.interpolation.type,cornerRadius:s.interpolation.cornerRadius}}expandNetworkToItem(e,t){const{dataModel:i,processedData:n}=this;if(!i||!n)return;const s=this.resolveItemId(e);if(null==s)return;let a=this.graph.findVertexById(s);if(!a)return;const o=[],r=i.resolveKeysById(this,"idValue",n);for(;null!=(a=this.graph.findNeighbour(a,"parent"));){const e=this.graph.findNeighbourValue(a,"datumIndex");if(null==e)break;o.push(r[e])}this.expand(o,t)}expandItem(e,t){const i=this.resolveItemId(e);if(null==i)return!1;const n=this.ctx.collapsedManager.expand([i],this.id,t);return n&&this.markNodeDataDirty(),n}collapseItem(e,t){const i=this.resolveItemId(e);if(null==i)return!1;const n=this.ctx.collapsedManager.collapseAppend([i],this.id,t);return n&&this.markNodeDataDirty(),n}isExpanderTarget(e){return 1===e?.tag}getHighlightPart(e){return this.isExpanderTarget(e)?eC:void 0}onHighlightChange(e){const{currentHighlight:t,currentHighlightPart:i}=e,n=t?.series===this&&i===eC&&"number"==typeof t.datumIndex?t.datumIndex:void 0;this.setHoveredExpanderDatumIndex(n)}setHoveredExpanderDatumIndex(e){this.hoveredExpanderDatumIndex!==e&&(this.hoveredExpanderDatumIndex=e,this.ctx.eventsHub.emit("chart:request-update",{type:n.GvF.SERIES_UPDATE}))}hasBuiltinListener(e){return this.isExpanderTarget(e)||this.properties.node.clickToExpand}firesUserClickListeners(e){return!this.isExpanderTarget(e)}pickFocus(e){const t=this.contextNodeData?.nodeData;if(!t?.length)return;const i=(0,n.qE8)(0,e.datumIndex-e.datumIndexDelta,t.length-1),a=t[i]?.vertex;if(!a)return;const o=this.resolveFocusVertex(a,e.datumIndexDelta,e.otherIndexDelta);if(!o)return;const r=this.getNodeDatumIndex(o);if(null==r)return;const l=this.datumSelection.at(r);if(!l)return;const h=s.n1.Transformable.toCanvas(l,l.getFullBBox());if(!h?.isFinite())return;const c=this.graph.findNeighbourValue(o,"depth"),d=l.datum;return d?{datum:d,datumIndex:r,otherIndex:c,bounds:h,clipFocusBox:!0}:void 0}getDatumAriaMeta(e,t){const{vertex:i}=e,n=this.graph.findNeighbourValue(i,"depth")??1,s=this.getSiblings(i),a=s.indexOf(i)+1,o=s.length,r=this.getChildren(i).length,l=this.composeDatumDescription(i);if(0===r)return{text:this.ctx.localeManager.t("ariaAnnounceOrgChartLeaf",{description:l,level:n,posInSet:a,setSize:o}),instructions:void 0};const h=i.value,c=this.ctx.collapsedManager.isCollapsed(h),d=this.ctx.localeManager.t(c?"ariaOrgChartCollapsed":"ariaOrgChartExpanded"),u=[this.ctx.localeManager.t(c?"ariaDescriptionExpandNode":"ariaDescriptionCollapseNode")];this.properties.node.clickToExpand&&u.push(this.ctx.localeManager.t("ariaDescriptionToggleNode"));const p=1===r?"ariaAnnounceOrgChartParentSingular":"ariaAnnounceOrgChartParent";return{text:this.ctx.localeManager.t(p,{description:l,level:n,posInSet:a,setSize:o,childCount:r,collapsedState:d}),instructions:u}}findNodeDatum(e){const t=this.resolveItemId(e);if(null==t)return;const i=this.graph.findVertexById(t);return i?this.createNodeDatumFromVertex(i,!1):void 0}getTooltipContent(e){const t=this.processedData?.dataSources.get(this.id
1)?.data?.[e];if(null==t)return;const i=this.getDatumByDatumIndex(e);return null!=i?this.formatTooltipWithContext(this.properties.tooltip,{heading:this.resolveVertexFields(i.vertex).title},{seriesId:this.id,datum:t}):void 0}measureDatumNode(e){return e.getShapeBBox()}pickNodesInBBoxPredicate(){const{containment:e}=this.properties.selection;return(t,i)=>{if(!(i instanceof FA))return!1;const a=s.n1.Transformable.toCanvas(i,i.getShapeBBox());return"all"===e?(0,n.JF9)(t,a.x,a.y,a.width,a.height):(0,n.$ZB)(t,a.x,a.y,a.width,a.height)}}makeLayoutUpdateOptions(){const{properties:{node:e,expander:t,innerSpacing:i,outerSpacing:n,depthSpacing:s,layout:a}}=this;return{...super.makeLayoutUpdateOptions(),nodeHeight:e.height,nodeWidth:e.width,nodeMaxHeight:e.maxHeight,nodeMaxWidth:e.maxWidth,regularDimensions:!0,hiddenOnCollapse:!0,direction:this.getNetworkTreeLayoutDirection(),depthSpacing:s??0,innerSpacing:i??0,outerSpacing:n??0,verticalSpacingExtra:t.enabled?(t.text.fontSize+t.padding.top+t.padding.bottom+t.strokeWidth)/2:0,linkIndentation:a.linkIndentation,nodeIndentation:a.nodeIndentation,stackFromDepth:a.stackFromDepth,getLayout:"stacked"===a.type?e=>{const t=this.graph.findNeighbourValue(e,"depth");if(!(null==t||t<a.stackFromDepth-1))return this.stackedLayout??(this.stackedLayout=new CA),this.stackedLayout}:()=>{}}}composeDatumDescription(e){const t=this.resolveVertexFields(e),i=[],s=(0,n.boc)(t.title).trim(),a=(0,n.boc)(t.subtitle).trim();s&&i.push(s),a&&i.push(a);for(const e of t.labels??[]){const t=(0,n.boc)(e).trim();t&&i.push(t)}return i.join(", ")}resolveFocusVertex(e,t,i){if(i>0){const t=e.value;return this.ctx.collapsedManager.isCollapsed(t)&&(this.expandItem(t,"user-interaction"),this.ctx.eventsHub.emit("chart:request-update",{type:n.GvF.PERFORM_LAYOUT})),this.getChildren(e)[0]}if(i<0){const t=this.graph.findNeighbour(e,"parent");if(!t)return;if(null==this.graph.findNeighbourValue(t,"datumIndex"))return;return t}if(0!==t){const i=this.getSiblings(e),s=i.indexOf(e);if(-1===s)return;return i[(0,n.qE8)(0,s+t,i.length-1)]}return e}getSiblings(e){const t=this.graph.findNeighbour(e,"parent");return t===this.rootVertex||null==t?this.getRootVertices():this.getChildren(t)}getChildren(e){return this.graph.neighboursWithEdgeValue(e,"child")??[]}createGraphData(){const{dataModel:e,processedData:t}=this;if(!e||!t)return;this.graph.clear(),this.rootVertex=this.graph.addVertex("root");const i=e.resolveKeysById(this,"idValue",t),n=e.resolveColumnById(this,"parentIdValue",t,"object"),s=e.resolveColumnById(this,"imageValue",t,"object"),a=e.resolveColumnById(this,"titleValue",t,"object"),o=e.resolveColumnById(this,"subtitleValue",t,"object"),r=[];for(let i=0;i<this.properties.node.labels.length;
1i++)r.push(this.properties.node.labels[i].enabled?e.resolveColumnById(this,`labelValue-${i}`,t,"object"):void 0);this.hasAnyKeyedValue=this.graph.build(i,n,s,a,o,r,this.rootVertex),this.hasAnyKeyedValue||this.ctx.logger.warnOnce(`No matches were found for [title.key], [subtitle.key], [image.key] or [labels[].key] or these properties were not supplied for [${this.id}].`),this.graph.computeDescendants(this.getRootVertices())}createNodeDataFromVertex(e,t,i,n,s){const a=e.length;this.setNodeDatumIndex(i,a),this.graph.addEdge(i,this.graph.addVertex(s),"depth");const o=this.createNodeDatumFromVertex(i,n);e.push(o);const r=this.graph.neighboursWithEdgeValue(i,"child");if(r){n||(n=this.ctx.collapsedManager.isCollapsed(i.value));for(const a of r){const o={from:i,to:a};t.push(o),this.createNodeDataFromVertex(e,t,a,n,s+1)}}}formatText(e,t,i,n){const{dataModel:s,processedData:a}=this;return t&&s&&a&&null!=i?this.callWithContext(t,this.makeNodeTextFormatterParams(s,a,i,n,e))??e:e}resolveVertexFields(e){return{image:this.graph.findNeighbourValue(e,"image"),title:this.graph.findNeighbourValue(e,"title"),subtitle:this.graph.findNeighbourValue(e,"subtitle"),labels:this.graph.findNeighbourValue(e,"labels")}}createNodeDatumFromVertex(e,t){const i=this.graph.findNeighbourValue(e,"datumIndex"),n=this.processedData?.dataSources.get(this.id)?.data?.[i];return{series:this,datum:n,itemId:e.value,datumIndex:i,vertex:e,collapsedByAncestor:t}}getLinkStyle(e,t){const{dataModel:i,processedData:a}=this,{itemStyler:o}=this.properties.link;let r=this.getLinkDefaultStyle();if(o&&i&&a&&null!=e&&null!=t){const l=this.cachedDatumCallback(s.n1.createDatumId(this.id,e,t,"link"),(()=>{const n=this.makeLinkItemStylerParams(i,a,e,t,r);return this.ctx.optionsGraphService.resolvePartial(["series",`${this.declarationOrder}`],this.callWithContext(o,n))}));l&&(r=(0,n.HFk)(l,r))}return r}getNodeStyle(e,t,i,a,o){const{dataModel:r,processedData:l}=this,{itemStyler:h}=this.properties.node,{itemStyler:c}=this.properties.node.title,{itemStyler:d}=this.properties.node.subtitle,{itemStyler:u}=this.properties.expander,p=this.getHighlightStyle(t,e,i),g=this.getSelectionStyle(e);let m=(0,n.HFk)(g,p,this.getNodeDefaultStyle(),{title:this.getNodeTextDefaultStyle(this.properties.node.title),subtitle:this.getNodeTextDefaultStyle(this.properties.node.subtitle),labels:this.properties.node.labels.map((e=>this.getNodeTextDefaultStyle(e))),expander:this.getExpanderDefaultStyle()});m=this.getNodeItemStylerStyle(h,m,r,l,e,i,a),m.title=this.getNodeTextItemStylerStyle(c,m.title,"title",r,l,e,i,a),m.subtitle=this.getNodeTextItemStylerStyle(d,m.subtitle,"subtitle",r,l,e,i,a),m.expander=this.getExpanderItemStylerStyle(u,m.expander,r,l,e,i,a),o&&(m.expander=this.applyExpanderHoverStyle(m.expander));let y=0;for(const{itemStyler:t}of this.properties.node.labels)m.labels[y]=this.getNodeTextItemStylerStyle(t,m.labels[y],s.n1.createDatumId("label",y),r,l,e,i,a),y++;return m}getNodeOpacity(e,t,i){return this.getSelectionStyle(e)?.opacity??this.getHighlightStyle(t,e,i).opacity??1}getNodeDefaultStyle(){const{cornerRadius:e,fill:t,fillOpacity:i,height:n,image:s,lineDash:a,lineDashOffset:o,maxHeight:r,maxWidth:l,padding:h,stroke:c,strokeOpacity:d,strokeWidth:u,width:p}=this.properties.node;return{cornerRadius:e,fill:t,fillOpacity:i,height:n??Number.NaN,image:{cornerRadius:s.cornerRadius,enabled:s.enabled,key:s.key,height:s.height,width:s.width,position:s.position,spacing:s.spacing},lineDash:a,lineDashOffset:o??0,maxHeight:r??1/0,maxWidth:l??1/0,padding:{top:h.top,right:h.right,bottom:h.bottom,left:h.left},stroke:c,strokeOpacity:d,strokeWidth:u,width:p??Number.NaN}}getExpanderDefaultStyle(){const{cornerRadius:e,enabled:t,fill:i,fillOpacity:n,lineDash:s,lineDashOffset:a,padding:o,stroke:r,strokeWidth:l,strokeOpacity:h,text:c}=this.properties.expander;return{cornerRadius:e,enabled:t,fill:i,fillOpacity:n,lineDash:s,lineDashOffset:a??0,padding:{top:o.top,right:o.right,bottom:o.bottom,left:o.left},stroke:r,strokeWidth:l,strokeOpacity:h,text:{color:c.color,fontFamily:c.fontFamily,fontSize:c.fontSize,fontStyle:c.fontStyle,fontWeight:c.fontWeight,showAllChildren:c.showAllChildren,showDirectChildren:c.showDirectChildren,textAlign:c.textAlign}}}applyExpanderHoverStyle(e){const{hoverStyle:t}=this.properties.expander;return{...e,fill:t.fill??e.fill,fillOpacity:t.fillOpacity??e.fillOpacity,lineDash:t.lineDash??e.lineDash,lineDashOffset:t.lineDashOffset??e.lineDashOffset,stroke:t.stroke??e.stroke,strokeOpacity:t.strokeOpacity??e.strokeOpacity,text:{...e.text,color:t.text.color??e.text.color,fontWeight:t.text.fontWeight??e.text.fontWeight}}}getLinkDefaultStyle(){const{interpolation:e,lineDash:t,lineDashOffset:i,stroke:n,strokeOpacity:s,strokeWidth:a}=this.properties.link;return{interpolation:e,lineDash:t,lineDashOffset:i??0,stroke:n,strokeOpacity:s,strokeWidth:a}}getNodeTextDefaultStyle(e){return{color:e.color,enabled:e.enabled,fontFamily:e.fontFamily,fontSize:e.fontSize,fontStyle:e.fontStyle,fontWeight:e.fontWeight,overflowStrategy:e.overflowStrategy,spacing:e.spacing,textAlign:e.textAlign,wrapping:e.wrapping,fill:e.fill,fillOpacity:e.fillOpacity,stroke:e.stroke,strokeWidth:e.strokeWidth,strokeOpacity:e.strokeOpacity,cornerRadius:e.cornerRadius,padding:{top:e.padding.top,right:e.padding.right,bottom:e.padding.bottom,left:e.padding.left}}}getNodeItemStylerStyle(e,t,i,a,o,r,l){if(!e||!i||!a||null==o)return t;const h=this.cachedDatumCallback(s.n1.createDatumId(this.id,o,"node",l.isCollapsed),(()=>{const n=this.makeNodeItemStylerParams(i,a,o,r,l,t);return this.ctx.optionsGraphService.resolvePartial(["series",`${this.declarationOrder}`],this.callWithContext(e,n))}));return h&&(t=(0,n.HFk)(h,t)),t}getExpanderItemStylerStyle(e,t,i,a,o,r,l){if(!e||!i||!a||null==o)return t;const h=this.cachedDatumCallback(s.n1.createDatumId(this.id,o,"expander",l.isCollapsed),(()=>{const n=this.makeExpanderItemStylerParams(i,a,o,r,l,t);return this.ctx.optionsGraphService.resolvePartial(["series",`${this.declarationOrder}`],this.callWithContext(e,n))}));return h&&(t=(0,n.HFk)(h,t)),t}getNodeTextItemStylerStyle(e,t,i,a,o,r,l,h){if(!e||!a||!o||null==r)return t;const c=this.cachedDatumCallback(s.n1.createDatumId(this.id,r,i,h.isCollapsed),(()=>{const i=this.makeNodeTextStylerParams(a,o,r,l,h,t);return this.ctx.optionsGraphService.resolvePartial(["series",`${this.declarationOrder}`],this.callWithContext(e,i))}));return c&&(t=(0,n.HFk)(c,t)),t}makeLinkItemStylerParams(e,t,i,n,s){const{id:a}=this,o=t.dataSources.get(a)?.data?.[i],r=t.dataSources.get(a)?.data?.[n];return{...s,fromDatum:o,toDatum:r,seriesId:a,selectionState:void 0,candidateState:void 0}}makeNodeItemStylerParams(e,t,i,n,a,o){const{id:r}=this,l=t.dataSources.get(r)?.data?.[i];return{...o,...a,datum:l,seriesId:r,highlightState:null==n?"none":s.n1.toHighlightString(n),selectionState:this.getSelectionStateString(i),candidateState:this.getCandidateStateString(i),width:Number.isNaN(o.width)?void 0:o.width,height:Number.isNaN(o.height)?void 0:o.height,maxWidth:Number.isFinite(o.maxWidth)?o.maxWidth:void 0,maxHeight:Number.isFinite(o.maxHeight)?o.maxHeight:void 0}}makeExpanderItemStylerParams(e,t,i,n,a,o){const{id:r}=this,l=t.dataSources.get(r)?.data?.[i];return{...o,...a,datum:l,seriesId:r,highlightState:null==n?"none":s.n1.toHighlightString(n),selectionState:this.getSelectionStateString(i),candidateState:this.getCandidateStateString(i)}}makeNodeTextStylerParams(e,t,i,n,a,o){const{id:r}=this,l=t.dataSources.get(r)?.data?.[i];return{...o,...a,datum:l,seriesId:r,highlightState:null==n?"none":s.n1.toHighlightString(n),selectionState:this.getSelectionStateString(i),candidateState:this.getCandidateStateString(i)}}makeNodeTextFormatterParams(e,t,i,n,s){const{id:a}=this,o=t.dataSources.get(a)?.data?.[i];return{...n,datum:o,seriesId:a,value:s}}resolveItemId(e){return null!=this.graph.findVertexById(e)?e:"number"==typeof e?this.datumSelection.at(e)?.datum?.itemId:e}getDatumByDatumIndex(e){const t=this.convertDatumIndexToNodeDatumIndex(e);if(null!=t)return this.datumSelection.at(t)?.datum}convertDatumIndexToNodeDatumIndex(e){const{dataModel:t,processedData:i}=this;if(!t||!i)return;const n=t.resolveKeysById(this,"idValue",i),s=this.graph.findVertexById(n[e]);if(!s)return;const a=this.getNodeDatumIndex(s);return null!=a?a:void 0}getNetworkTreeLayoutDirection(){const{direction:e,reverse:t}=this.properties;
1return t?"horizontal"===e?"left":"up":"horizontal"===e?"right":"down"}};return e.className="OrganizationSeries",e.type="organization",e})(),iC=(()=>({...n.Fup,...n.mLn,...n.AFh,cornerRadius:n.LyW,enabled:n.zMY,hoverStyle:{...n.qDt,stroke:n.AFh.stroke,strokeOpacity:n.AFh.strokeOpacity,...n.mLn,text:{color:n.LVV.color,fontWeight:n.LVV.fontWeight}},itemStyler:(0,n.YIG)({...n.Fup,...n.mLn,...n.AFh,cornerRadius:n.LyW,enabled:n.zMY,padding:n.Msk,text:{...n.LVV,showAllChildren:n.zMY,showDirectChildren:n.zMY,textAlign:n.JhA}}),padding:n.Msk,text:{...n.LVV,formatter:(0,n.R3$)(n.JwX),showAllChildren:n.zMY,showDirectChildren:n.zMY,textAlign:n.JhA}}))(),nC=(()=>({type:(0,n.mw3)((0,n.dYl)("step")),cornerRadius:n.LyW}))(),sC=(()=>({...n.mLn,...n.AFh,itemStyler:(0,n.YIG)({...n.mLn,...n.AFh,interpolation:nC}),interpolation:nC}))(),aC=(()=>({cornerRadius:n.LyW,enabled:n.zMY,key:n.YjP,height:n.MX6,width:n.MX6,position:(0,n.KCZ)("bottom","left","right","top"),spacing:n.LyW}))(),oC={...n.LVV,...n.qDt,...n.AFh,cornerRadius:n.LyW,padding:n.Msk,enabled:n.zMY,overflowStrategy:n.y7D,spacing:n.aig,textAlign:n.JhA,wrapping:n.IQA},rC=(()=>({...oC,formatter:(0,n.R3$)(n.JwX),itemStyler:(0,n.YIG)(oC),key:n.YjP}))(),lC=(()=>({...n.Fup,...n.mLn,...n.AFh,cornerRadius:n.LyW,height:n.aig,image:aC,itemStyler:(0,n.YIG)({...n.Fup,...n.mLn,...n.AFh,cornerRadius:n.LyW,height:n.aig,image:aC,maxHeight:n.aig,maxWidth:n.aig,padding:n.Msk,width:n.aig}),labels:(0,n.jk9)((0,n.fd6)(rC)),maxHeight:n.aig,maxWidth:n.aig,padding:n.Msk,title:rC,subtitle:rC,width:n.aig,clickToExpand:n.zMY}))(),hC=(()=>({type:(0,n.dYl)("stacked"),linkIndentation:n.LyW,nodeIndentation:n.LyW,stackFromDepth:n.MX6}))(),cC=(()=>({...n.XxK,...s.n1.organizationSeriesThemeableOptionsDef,type:(0,n.mw3)((0,n.dYl)("organization")),expander:iC,idKey:n.YjP,layout:hC,link:sC,node:lC,parentIdKey:n.YjP}))(),dC={zoom:{enabled:!0,enableAxisDragging:!1,enableAxisScrolling:!1,enablePanning:!0,enableScrolling:!0,enableTwoFingerZoom:!0,enableDoubleClickToReset:!0,axes:"xy",keepAspectRatio:!0,anchorPointX:"pointer",anchorPointY:"pointer",autoScaling:{enabled:!1},onDataChange:{strategy:"preserveRatios"},minVisibleItems:1,buttons:{enabled:!1}},series:{depthSpacing:52,innerSpacing:20,outerSpacing:40,expander:{enabled:!0,cornerRadius:{$path:"../node/cornerRadius"},fill:{$path:"../node/fill"},stroke:{$path:"../node/stroke"},strokeOpacity:{$path:"../node/strokeOpacity"},strokeWidth:{$path:"../node/strokeWidth"},lineDash:{$path:"../node/lineDash"},lineDashOffset:{$path:"../node/lineDashOffset"},padding:{$applyPadding:{top:5,right:7.5,bottom:5,left:7.5}},hoverStyle:{fill:{$ref:"focusColor"}},text:{color:{$ref:"subtleTextColor"},fontFamily:{$ref:"fontFamily"},fontSize:{$rem:n.q8q.SMALL},fontStyle:"normal",fontWeight:"normal",showAllChildren:!0,showDirectChildren:!1}},highlight:{enabled:{$path:["/highlight/enabled",!0]},highlightedItem:{stroke:{$ref:"accentColor"},strokeWidth:2}},selection:n.zg6,layout:{linkIndentation:{$if:[{$eq:[{$path:"../direction"},"horizontal"]},18,26]},nodeIndentation:26,stackFromDepth:4},link:{interpolation:{type:"step",cornerRadius:8},lineDash:[],stroke:{$foregroundBackgroundMix:.2},strokeOpacity:1,strokeWidth:1},tooltip:{enabled:!1},node:{cornerRadius:4,fill:{$foregroundBackgroundMix:.02},padding:{$applyPadding:8},stroke:{$foregroundBackgroundMix:.2},strokeOpacity:1,strokeWidth:1,image:{cornerRadius:0,key:"image",height:50,position:"top",spacing:8,width:50},title:{color:{$ref:"foregroundColor"},fontFamily:{$ref:"fontFamily"},fontSize:{$rem:n.q8q.LARGE},fontStyle:"normal",fontWeight:"bold",key:"title",overflowStrategy:"ellipsis",padding:{$applyPadding:0},spacing:4,textAlign:"center",wrapping:"on-space"},subtitle:{color:{$ref:"subtleTextColor"},fontFamily:{$ref:"fontFamily"},fontSize:{$rem:n.q8q.SMALL},fontStyle:"normal",fontWeight:"normal",key:"subtitle",overflowStrategy:"ellipsis",padding:{$applyPadding:0},spacing:4,textAlign:"center",wrapping:"on-space"},labels:{$apply:{color:{$ref:"subtleTextColor"},fontFamily:{$ref:"fontFamily"},fontSize:{$rem:11/n.Efy},fontStyle:"normal",fontWeight:"normal",overflowStrategy:"ellipsis",padding:{$applyPadding:0},spacing:4,textAlign:"center",wrapping:"on-space"}},clickToExpand:{$not:{$or:[{$path:["/series/$index/selection/enabled",!1]},{$isUserOption:"/listeners/seriesNodeClick"},{$isUserOption:"/listeners/seriesNodeDoubleClick"},{$isUserOption:"/series/$index/listeners/seriesNodeClick"},{$isUserOption:"/series/$index/listeners/seriesNodeDoubleClick"}]}}}}},uC={type:"series",name:"organization",chartType:"standalone",enterprise:!0,solo:!0,version:s.xv,depen
1dencies:[Py,ay],options:cC,themeTemplate:dC,create:e=>new tC(e)},{BBox:pC,Path:gC}=s.n1,mC=(()=>{var e=class extends gC{constructor(){super(...arguments),this.x1=0,this.x2=0,this.y1=0,this.y2=0,this.height=0,this.inset=0,this.elbows=[],this.startEdge=void 0,this.endEdge=void 0}computeBBox(){const e=Math.min(this.x1,this.x2),t=Math.max(this.x1,this.x2)-e,i=Math.min(this.y1,this.y2),n=Math.max(this.y1,this.y2)-i+this.height;return new pC(e,i,t,n)}updatePath(){const{path:e,inset:t,startEdge:i,endEdge:n}=this;e.clear();const s=this.height-2*this.inset,a=s/2,o=this.y1+t,r=o+s,l=this.y2+t,h=l+s,c=this.x1+t,d=this.x2-t;let u=xC(i,o,t,c),p=o;e.moveTo(u,p);for(const e of this.elbows)this.updatePathSection(u,p,e.x,e.y,s,-a),u=e.x,p=e.y;const g=xC(n,l,t,d),m=l;this.updatePathSection(u,p,g,m,s,-a),bC(e,n,l,h,t,d),u=xC(n,h,t,d),p=m;for(const e of this.elbows.toReversed())this.updatePathSection(u,p,e.x,e.y,s,a),u=e.x,p=e.y;this.updatePathSection(u,p,xC(i,r,t,c),o,s,a),bC(e,i,r,o,t,c),e.closePath()}updatePathSection(e,t,i,s,a,o){const{path:r}=this,l=n.ZY9.from(e,t+o+a/2),h=n.ZY9.from(i,s+o+a/2);if(Math.abs(h.y-l.y)<2)return void r.lineTo(h.x,h.y);let c=n.ZY9.angle(n.ZY9.sub(h,l));c<0&&(c=2*Math.PI+c);const d=Math.PI/2,u=Math.PI,p=1.5*Math.PI,g=vC(l,h,0),m=vC(l,h,a);g.radius<a?r.cubicCurveTo((l.x+h.x)/2,l.y,(l.x+h.x)/2,h.y,h.x,h.y):c>=p?(r.arc(l.x,t-g.radius,g.radius,d,d+m.angle,!0),r.arc(h.x,s+m.radius,m.radius,p+m.angle,p),r.lineTo(h.x,h.y)):c>
10&&c<=d?(r.arc(l.x,t+m.radius,m.radius,p,p+m.angle),r.arc(h.x,s-g.radius,g.radius,d+g.angle,d,!0),r.lineTo(h.x,h.y)):c>d&&c<=u?(r.arc(l.x,t+m.radius,m.radius-a,p,p+m.angle,!0),r.arc(h.x,s-g.radius,g.radius+a,d+g.angle,d),r.lineTo(h.x,h.y)):(r.arc(l.x,t-g.radius,g.radius+a,d,d+g.angle),r.arc(h.x,s+m.radius,m.radius-a,p+m.angle,p,!0),r.lineTo(h.x,h.y))}};return l([(0,n.k8u)()],e.prototype,"x1",2),l([(0,n.k8u)()],e.prototype,"x2",2),l([(0,n.k8u)()],e.prototype,"y1",2),l([(0,n.k8u)()],e.prototype,"y2",2),l([(0,n.k8u)()],e.prototype,"height",2),l([(0,n.k8u)()],e.prototype,"inset",2),e})();function yC({y:e,height:t,radius:i}){return[{lo:e,hi:e+i,centerY:e+i},{lo:e+i,hi:e+t-i,centerY:void 0},{lo:e+t-i,hi:e+t,centerY:e+t-i}]}function fC(e,t,i){const s=Math.asin((0,n.qE8)(-1,(i-t)/e.radius,1));return 1===e.direction?Math.PI-s:s}function xC(e,t,i,s){if(null==e||e.radius<=0)return s;const a=e.x-e.direction*i,o=(0,n.qE8)(e.y,t,e.y+e.height),r=yC(e).find((({lo:e,hi:t,centerY:i})=>null!=i&&o>=e&&o<=t));if(null==r?.centerY)return a;const l=(0,n.qE8)(-e.radius,o-r.centerY,e.radius);return a+e.direction*(e.radius-Math.sqrt(e.radius**2-l**2))}function bC(e,t,i,n,s,a){if(null==t||t.radius<=0)return void e.lineTo(a,n);const o=t.x-t.direction*s,r=o+t.direction*t.radius,l=n>i,h=Math.min(i,n),c=Math.max(i,n),d=yC(t);for(const{lo:i,hi:n,centerY:s}of l?d:d.toReversed()){const a=Math.max(i,h),d=Math.min(n,c);if(!(a>=d))if(null==s)e.lineTo(o,l?d:a);else{const i=fC(t,s,l?a:d),n=fC(t,s,l?d:a);e.arc(r,s,t.radius,i,n,!0)}}e.lineTo(xC(t,n,s,a),n)}function vC(e,t,i){const s=n.ZY9.angle(n.ZY9.sub(t,e)),a=n.ZY9.distance(e,t),o=n.ZY9.add(e,n.ZY9.rotate(n.ZY9.from(a/2,0),s)),r=-1/n.ZY9.gradient(e,t),l=n.ZY9.intercept(o,r),h=(c=.1,d=.5,u=Math.PI/2-Math.abs(n.ZY9.gradient(e,t)),(0,n.qE8)(c,(d-c)*u+c,d));var c,d,u;const p=n.ZY9.intersectAtX(r,l,e.x),g=Math.max(i,n.ZY9.distance(e,p)*h);return{angle:n.ZY9.angle(n.ZY9.sub(p,e),n.ZY9.sub(p,o))/-(1.1-h),radius:g}}var{FillGradientDefaults:SC,FillPatternDefaults:MC,FillImageDefaults:kC,makeSeriesTooltip:DC,SeriesProperties:wC,Label:IC}=s.n1,AC=(()=>{var e=class extends IC{constructor(){super(...arguments),this.spacing=1,this.placement=void 0,this.edgePlacement=void 0}};return l([n.mAP],e.prototype,"spacing",2),l([n.mAP],e.prototype,"placement",2),l([n.mAP],e.prototype,"edgePlacement",2),e})(),CC=(()=>{var e=class extends n.XPE{constructor(){super(...arguments),this.fill=void 0,this.fillOpacity=1,this.stroke=void 0,this.strokeOpacity=1,this.strokeWidth=1,this.lineDash=[0],this.lineDashOffset=0}};return l([n.mAP],e.prototype,"fill",2),l([n.mAP],e.prototype,"fillOpacity",2),l([n.mAP],e.prototype,"stroke",2),l([n.mAP],e.prototype,"strokeOpacity",2),l([n.mAP],e.prototype,"strokeWidth",2),l([n.mAP],e.prototype,"lineDash",2),l([n.mAP],e.prototype,"lineDashOffset",2),l([n.mAP],e.prototype,"itemStyler",2),e})(),NC=(()=>{var e=class extends n.XPE{constructor(){super(...arguments),this.spacing=1,this.minSpacing=0,this.width=1,this.cornerRadius=0,this.alignment="justify",this.verticalAlignment="center",this.sort="auto",this.fill=void 0,this.fillOpacity=1,this.stroke=void 0,this.strokeOpacity=1,this.strokeWidth=1,this.lineDash=[0],this.lineDashOffset=0}};return l([n.mAP],e.prototype,"spacing",2),l([n.mAP],e.prototype,"minSpacing",2),l([n.mAP],e.prototype,"width",2),l([n.mAP],e.prototype,"cornerRadius",2),l([n.mAP],e.prototype,"alignment",2),l([n.mAP],e.prototype,"verticalAlignment",2),l([n.mAP],e.prototype,"sort",2),l([n.mAP],e.prototype,"fill",2),l([n.mAP],e.prototype,"fillOpacity",2),l([n.mAP],e.prototype,"stroke",2),l([n.mAP],e.prototype,"strokeOpacity",2),l([n.mAP],e.prototype,"strokeWidth",2),l([n.mAP],e.prototype,"lineDash",2),l([n.mAP],e.prototype,"lineDashOffset",2),l([n.mAP],e.prototype,"itemStyler",2),e})(),LC=(()=>{var e=class extends wC{constructor(){super(...arguments),this.nodes=void 0,this.idKey="",this.idName=void 0,this.labelKey=void 0,this.labelName=void 0,this.sizeKey=void 0,this.sizeName=void 0,this.getItemId=void 0,this.fillGradientDefaults=new SC,this.fillPatternDefaults=new MC,this.fillImageDefaults=new kC,this.defaultColorRange=[],this.defaultPatternFills=[],this.fills=[],this.strokes=[],this.label=new AC,this.link=new CC,this.node=new NC,this.tooltip=DC()}getStyle(e,t,i,n){const{fillOpacity:s,strokeWidth:a,strokeOpacity:o,lineDash:r,lineDashOffset:l,fill:h=t[n%t.length],stroke:c=i[n%t.length]}=e?this.link:this.node;return{fill:h,fillOpacity:s,stroke:c,strokeWidth:a,strokeOpacity:o,lineDash:r,lineDashOffset:l}}};return l([n.mAP],e.prototype,"nodes",2),l([n.mAP],e.prototype,"fromKey",2),l([n.mAP],e.prototype,"toKey",2),l([n.mAP],e.prototype,"idKey",2),l([n.mAP],e.prototype,"idName",2),l([n.mAP],e.prototype,"labelKey",2),l([n.mAP],e.prototype,"labelName",2),l([n.mAP],e.prototype,"sizeKey",2),l([n.mAP],e.prototype,"sizeName",2),l([n.mAP],e.prototype,"getItemId",2),l([n.mAP],e.prototype,"fillGradientDefaults",2),l([n.mAP],e.prototype,"fillPatternDefaults",2),l([n.mAP],e.prototype,"fillImageDefaults",2),l([n.mAP],e.prototype,"defaultColorRange",2),l([n.mAP],e.prototype,"defaultPatternFills",2),l([n.mAP],e.prototype,"fills",2),l([n.mAP],e.prototype,"strokes",2),l([n.mAP],e.prototype,"label",2),l([n.mAP],e.prototype,"link",2),l([n.mAP],e.prototype,"node",2),l([n.mAP],e.prototype,"tooltip",2),e})(),{Transformable:PC,SeriesNodePickMode:TC,createDatumId:OC,getShapeStyle:RC,getLabelStyles:EC,Rect:zC,BBox:BC}=s.n1;function FC(e,t){return e<=0||!Number.isFinite(t.height)?0:Math.min(e,t.width/2,t.height/2)}function VC(e,t,i){const n=FC(t,e);return{x:1===i?e.x:e.x+e.width,y:e.y,height:e.height,radius:n,direction:i}}var $C=(()=>{var e=class extends Uy{constructor(e){super({moduleCtx:e,pickModes:[TC.NEAREST_NODE,TC.EXACT_SHAPE_MATCH]}),this.properties=new LC}isLabelEnabled(){return(null!=this.properties.labelKey||null==this.nodes)&&this.properties.label.enabled}linkFactory(){return new mC}nodeFactory(){return new zC}createNodeData(){const e=this._nodeDataDependencies?.seriesRectWidth??0,t=this.properties.node.width,{nodeGraph:i,links:s,maxPathLength:a}=this.getNodeGraph(this.createNode.bind(this,t),this.createLink,{includeCircularReferences:!1}),o=i;if(0===o.size)return;const r=this.initialiseColumns(a);this.assignNodesToColumns(o,r,a);const l=(0,n.K$y)(this.properties.label),{columnLabelInsetBefore:h,columnLabelInsetAfter:c}=this.getColumnLabelInsets(r,l,a),d=(e-t-h-c)/(a-1);this.positionNodesInColumnsX(r,d,h),this.createGhostNodesAndColumnDiffs(o,r),this.weightNodes(r);const{sizeScale:u,nodeSpacing:p}=this.getScaleAndSpacing(r,1);if(u<0)return void this.ctx.logger.warnOnce("There was insufficient space to display the Sankey Series. Reduce [node.spacing], [node.minSpacing], or provide a larger container.");this.positionNodesInColumnsY(r,1,u,p),this.sortAndPositionLinks(o,u);const g=[],m=[];return this.createNodesNodeData(g,o,r,d,l,m),this.createLinksNodeData(g,s,1,u),{itemId:this.id,nodeData:g,labelData:m}}createNode(e,t){return{...t,x:Number.NaN,y:Number.NaN,width:e,height:Number.NaN}}createLink(e){return{...e,x1:Number.NaN,x2:Number.NaN,y1:Number.NaN,y2:Number.NaN,height:Number.NaN,elbows:[]}}initialiseColumns(e){const t=[];for(let i=0;i<e;i+=1)t.push({index:i,size:0,nodes:[],x:0});return t}assignNodesToColumns(e,t,i){const{fromKey:s,toKey:a,sizeKey:o,labelKey:r,label:l}=this.properties,h=(0,n.A_g)(l,!1);for(const c of e.values()){const{datum:e,linksBefore:d,linksAfter:u}=c,p=Math.max(d.reduce(((e,{link:t})=>e+t.size),0),u.reduce(((e,{link:t})=>e+t.size),0));if(0===d.length&&0===u.length||0===p){c.columnIndex=-1;continue}const g=this.getNodeColumn(t,c,i);e.size=p;let m=l.enabled?this.getLabelText(e.label,e.datum,r,"label",[],this.properties.label,{datum:e.datum,value:e.label,fromKey:s,toKey:a,sizeKey:o,size:p}):void 0;null!=m&&(m=(0,n.HRu)(m,h,l)),e.label=(0,n.boc)(m),g.nodes.push(c),g.size+=p,c.columnIndex=g.index}}getNodeColumn(e,t,i){const{node:{alignment:n}}=this.properties,{linksBefore:s,linksAfter:a,maxPathLengthBefore:o,maxPathLengthAfter:r}=t;let l;switch(n){case"left":l=e[o];break;case"right":l=e[i-1-r];break;case"center":if(0!==s.length)l=e[o];else if(0===a.length)l=e[0];else{l=e[a.reduce(((e,t)=>Math.min(e,t.node.maxPathLengthBefore)),i)-1]}break;case"justify":l=0===a.length?e[i-1]:e[o]}return l}getColumnLabelInsets(e,t,i){const{label:{spacing:s,placement:a,edgePlacement:o},node:{width:r}}=this.properties,l=this._nodeDataDependencies?.seriesRectWidth??0;let h=0,c=0;if(this.isLabelEnabled()&&("outside"===o||null==o)){const d=(e,h)=>{const c=h;if(null==c.datum.label||""===c.datum.label)return e;let d=(l-r)/(i-1)-s;"center"===a&&null==o&&(d/=2);const u=(0,n.C1g)(c.datum.label,{maxWidth:d,maxHeight:c.datum.height,font:this.properties.label,textWrap:"never"});let{width:p}=t.measureLines(u);return"center"===a&&null==o&&(p/=2),Math.max(e,p)};"right"===a&&"outside"!==o||(h=r+e[0].nodes.reduce(d,0)),"left"===a&&"outside"!==o||(c=r+e.at(-1).nodes.reduce(d,0))}return{columnLabelInsetBefore:h,columnLabelInsetAfter:c}}positionNodesInColumnsX(e,t,i){for(let n=0;n<e.length;n++){const s=e[n];s.x=i+n*t;for(const e of s.nodes)e.datum.x=s.x}}createGhostNodesAndColumnDiffs(e,t){for(const i of e.values()){i.weight=0;let e=1/0;for(const t of i.linksAfter){const n=t.node;e=Math.min(e,n.columnIndex-i.columnIndex)}if(e===1/0)for(const t of i.linksBefore){const n=t.node;e=Math.min(e,i.columnIndex-n.columnIndex)}i.closestColumnDiff=e,this.createNodeGhostNodes(i,t,e)}}createNodeGhostNodes(e,t,i){for(const n of e.linksAfter){const s=n.node;if(!(s.columnIndex<=e.columnIndex))for(let a=s.columnIndex-1;a>e.columnIndex;a--){const o=n.link.size,r={ghost:!0,datum:{...e.datum,size:o,y:0,height:0},weight:0,linksBefore:[{node:{columnIndex:a-1,datum:{size:o}}}],linksAfter:[{node:{columnIndex:a+1,datum:{size:o}}}],link:n.link,columnIndex:e.columnIndex,size:e.datum.size,closestColumnDiff:i,fromNode:{y:s.datum.y},toNode:{y:0}};t[a].size+=o,t[a].nodes.push(r)}}}weightNodes(e){const{properties:t}=this;if("data"===t.node.sort)return;if("auto"!==t.node.sort){for(const t of e)t.nodes.sort(((e,t)=>this.sortNodes(e,t)));return}const i=e.toSorted(((e,t)=>{const i=e.nodes.reduce(((e,t)=>Math.max(e,t.datum.size)),0);return t.nodes.reduce(((e,t)=>Math.max(e,t.datum.size)),0)-i})),n={};for(let e=0;e<i.length;e++)n[i[e].index]=Math.pow(10,i.length-e-1);for(const t of e){for(const e of t.nodes)"ghost"in e&&e.ghost?e.weight=e.size/t.size*n[t.index]:e.weight=e.datum.size/t.size*n[t.index];t.nodes.sort(((e,t)=>e.weight-t.weight))}for(const t of e){for(const i of t.nodes)"ghost"in i&&i.ghost||(i.weight+=i.linksBefore.reduce(((i,s)=>{if(s.node.columnIndex!==t.index-1)return i;const a=e[s.node.columnIndex].nodes.indexOf(s.node)*n[s.node.columnIndex];return Math.max(i,a)}),0),i.weight+=i.linksAfter.reduce(((i,s)=>{if(s.node.columnIndex!==t.index+1)return i;const a=e[s.node.columnIndex].nodes.indexOf(s.node)*n[s.node.columnIndex];return Math.max(i,a)}),0));t.nodes.sort(((e,t)=>this.sortNodes(e,t)))}}getScaleAndSpacing(e,t){const i=this._nodeDataDependencies?.seriesRectHeight??0,n=n=>e.reduce(((e,{size:s,nodes:a})=>{const o=i-a.length*t,r=(1-(a.length-1)*n/o)/s;return Math.min(e,r)}),1/0);let s=this.properties.node.spacing,a=n(s);for(;a<0&&s>this.properties.node.minSpacing;)s-=1,a=n(s);return{nodeSpacing:s,sizeScale:a}}positionNodesInColumnsY(e,t,i,n){const s=this._nodeDataDependencies?.seriesRectHeight??0;for(const a of e){let e=0;for(const n of a.nodes){const a=s*n.datum.size*i;n.datum.height=Math.max(t,a),e+=a}const o=n*(a.nodes.length-1);let r=0;"bottom"===this.properties.node.verticalAlignment?r=s-e-o:"center"===this.properties.node.verticalAlignment&&(r=(s-e-o)/2);for(const e of a.nodes)e.datum.y=r,r+=s*e.datum.size*i+n,"ghost"in e&&e.ghost&&e.link.elbows.push({x:a.x,y:e.datum.y})}}sortAndPositionLinks(e,t){const i=this._nodeDataDependencies?.seriesRectHeight??0;for(const{datum:n,linksBefore:s,linksAfter:a}of e.values()){let e=n.y;s.sort(((e,t)=>this.sortNodes(e.node,t.node)));for(const{link:n}of s)n.y2=e,e+=n.size*i*t;let o=n.y;a.sort(((e,t)=>this.sortNodes(e.node,t.node,{invertColumnSort:!0})));for(const{link:e}of a)e.y1=o,o+=e.size*i*t}}createNodesNodeData(e,t,i,n,s,a){for(const[o,r]of i.entries()){const l=0===o,h=o===i.length-1;let c=-1/0;r.nodes.sort(((e,t)=>e.datum.y-t.datum.y));for(const i of r.nodes){if("ghost"in i&&i.ghost)continue;const{datum:o}=i;o.midPoint={x:o.x+o.width/2,y:o.y+o.height/2},e.push(o),c=this.createNodeLabelData(t,n,s,a,o,l,h,c)}}}createNodeLabelData(e,t,i,s,a,o,r,l){if(null==a.label)return l;const{label:{spacing:h,edgePlacement:c,fontSize:d}}=this.properties,u=this._nodeDataDependencies?.seriesRectWidth??0,p=a.y+a.height/2;let g;if(!o&&!r){const t=(0,n.VKS)(d),i=p-t,s=p+t;let o=u;for(const{datum:t}of e.values()){t.x>
1a.x&&Math.max(t.y,i)<=Math.min(t.y+t.height,s)&&(o=Math.min(o,t.x-h))}const r=o-a.x-2*h;g=(0,n.C1g)(a.label,{maxWidth:r,maxHeight:a.height,font:this.properties.label,textWrap:"never",overflow:"hide"})}if(null==g||""===g){const e=null==c&&(o||r)?h:2*h;g=(0,n.C1g)(a.label,{maxWidth:t-e,maxHeight:a.height,font:this.properties.label,textWrap:"never"})}if(""===g)return l;const{height:m}=i.measureLines(g),y=p-m/2,f=p+m/2,{x,textAlign:b}=this.getNodeLabelPlacement(a,o,r);return y>=l&&(s.push({x,y:p,textAlign:b,text:g,size:a.size,nodeDatum:a,datumIndex:a.datumIndex}),l=f),l}getNodeLabelPlacement(e,t,i){const{label:{spacing:n,placement:s,edgePlacement:a}}=this.properties;let o=e.x+e.width+n,r="left",l=s;return t&&null==a&&null==s&&(l="left"),"outside"===a?(t&&(l="left"),i&&(l="right")):"inside"===a&&(t&&(l="right"),i&&(l="left")),"left"===l?(o=e.x-n,r="right"):"center"===l&&(o=e.x+e.width/2,r="center"),{x:o,textAlign:r}}createLinksNodeData(e,t,i,n){const s=this._nodeDataDependencies?.seriesRectHeight??0,{width:a,cornerRadius:o}=this.properties.node;for(const r of t){const{fromNode:t,toNode:l,size:h}=r;r.height=Math.max(i,s*h*n),r.x1=t.x+a-FC(o,t),r.x2=l.x+FC(o,l),r.midPoint={x:(r.x1+r.x2)/2,y:(r.y1+r.y2)/2+r.height/2},e.push(r)}}sortNodes(e,t,i){const{properties:n}=this;return"ascending"===n.node.sort?(e.datum.label??"").localeCompare(t.datum.label??""):"descending"===n.node.sort?(t.datum.label??"").localeCompare(e.datum.label??""):"data"===n.node.sort?0:e.columnIndex<t.columnIndex?i?.invertColumnSort?1:-1:e.columnIndex>t.columnIndex?i?.invertColumnSort?-1:1:e.weight===t.weight?e.datum.size-t.datum.size:e.closestColumnDiff<t.closestColumnDiff?1:e.closestColumnDiff>t.closestColumnDiff?-1:e.weight-t.weight}updateLabelSelection(e){const t=this.isLabelEnabled()?e.labelData:[];return e.labelSelection.update(t)}updateLabelNodes(e){const t=this.getHighlightedDatum();e.labelSelection.each(((e,i)=>{const{x:n,y:s,textAlign:a,text:o,datumIndex:r,nodeDatum:l}=i,h={fromKey:this.properties.fromKey,size:i.size,sizeKey:this.properties.sizeKey,toKey:this.properties.toKey},c=this.isLabelHighlighted(l,t),d=this.getHighlightStyle(c,r),u=EC(this,void 0,h,this.properties.label,c,t);if(!u.enabled)return void(e.visible=!1);const{color:p,fontStyle:g,fontWeight:m,fontSize:y,fontFamily:f}=u;e.visible=!0,e.x=n,e.y=s,e.text=o,e.fill=p,e.fontStyle=g,e.fontWeight=m,e.fontSize=y,e.fontFamily=f,e.textAlign=a,e.textBaseline="middle";const x=d.opacity??1;e.opacity=x,e.fillOpacity=x,e.setBoxing(u)}))}updateNodeSelection(e){return e.datumSelection.update(e.nodeData,void 0,(e=>OC(e.type,e.id)))}getNodeStyle(e,t,i){const{properties:s}=this,{fills:a,strokes:o,defaultColorRange:r,defaultPatternFills:l,fillGradientDefaults:h,fillPatternDefaults:c,fillImageDefaults:d}=s,{itemStyler:u}=s.node,p=Oy(t),g=r[p%r.length].map((e=>({color:e}))),m=l[p%l.length],y=this.getHighlightStyle(i,e.datumIndex),f=this.getSelectionStyle(e.datumIndex),x=(0,n.HFk)(f,y,s.getStyle(!1,a,o,p)),b=null!=s.node.fill;let v=RC(x,b?h:{...h.toJson(),colorStops:g},b?c:{...c.toJson(),fill:m,stroke:m},d);if(null!=u&&null!=e.datumIndex){const t=this.cachedDatumCallback(OC(e.datumIndex,"node",i?"highlight":"node"),(()=>{const t=this.makeItemStylerParams(e,i,v);return this.ctx.optionsGraphService.resolvePartial(["series",`${this.declarationOrder}`],this.callWithContext(u,t))}));t&&(v=(0,n.HFk)(t,v,{...h.toJson(),colorStops:g},{...c.toJson(),fill:m,stroke:m},d))}return v.opacity=1,v}makeItemStylerParams({datum:e,datumIndex:t,size:i=0,label:n},s,a){const{id:o}=this,{fromKey:r,toKey:l,sizeKey:h}=this.properties,c=this.ctx.highlightManager?.getActiveHighlight(),d=this.getHighlightStateString(c,s,t),u=this.getSelectionStateString(t),p=this.getCandidateStateString(t),g=this.filterItemStylerFillParams(a.fill)??a.fill;return{seriesId:o,datum:e,fromKey:r,toKey:l,sizeKey:h,highlightState:d,selectionState:u,candidateState:p,...a,size:i,label:n,fill:g}}updateNodeNodes(e){const{datumSelection:t,isHighlight:i}=e,n=this.getShapeFillBBox();t.each(((e,t)=>{const{datumIndex:s}=t,a=this.getNodeStyle(t,s,i);e.x=t.x,e.y=t.y,e.width=Math.max(t.width,0),e.height=Math.max(t.height,0),e.cornerRadius=this.properties.node.cornerRadius,e.setStyleProperties(a,n)}))}getShapeFillBBox(){const e=this._nodeDataDependencies?.seriesRectWidth??0,t=this._nodeDataDependencies?.seriesRectHeight??0,i=new BC(0,0,e,t);return{series:i,axis:i}}updateLinkSelection(e){return e.datumSelection.update(e.nodeData,void 0,(e=>OC(e.type,e.datumIndex,e.fromNode.id,e.toNode.id)))}getLinkStyle(e,t,i,s){const{id:a,properties:o}=this,{fills:r,strokes:l,defaultColorRange:h,defaultPatternFills:c,fillGradientDefaults:d,fillPatternDefaults:u,fillImageDefaults:p}=o,{itemStyler:g}=o.link,m=Oy(i),y=h[m%h.length].map((e=>({color:e}))),f=c[m%c.length],x=this.getHighlightStyle(s,t),b=this.getSelectionStyle(t),v=(0,n.HFk)(b,x,o.getStyle(!0,r,l,m)),S=null!=o.link.fill;let M=RC(v,S?d:{...d.toJson(),colorStops:y},S?u:{...u.toJson(),fill:f,stroke:f},p);if(null!=g&&null!=t){const i=this.cachedDatumCallback(OC(t,"link",s?"highlight":"node"),(()=>{const i=this.ctx.highlightManager?.getActiveHighlight(),n=this.getHighlightStateString(i,s,t);return this.ctx.optionsGraphService.resolvePartial(["series",`${this.declarationOrder}`],this.callWithContext(g,{seriesId:a,datum:e,highlightState:n,...M}))}));i&&(M=(0,n.HFk)(i,M,{...d.toJson(),colorStops:y},{...u.toJson(),fill:f,stroke:f},p))}return M.opacity=1,M}updateLinkNodes(e){const{datumSelection:t,isHighlight:i}=e,n=this.getShapeFillBBox(),{cornerRadius:s}=this.properties.node;t.each(((e,t)=>{const a=this.getLinkStyle(t.datum,t.datumIndex,t.fromNode.datumIndex,i);e.x1=t.x1,e.y1=t.y1,e.x2=t.x2,e.y2=t.y2,e.height=t.height,e.elbows=t.elbows,e.startEdge=VC(t.fromNode,s,-1),e.endEdge=VC(t.toNode,s,1),e.setStyleProperties(a,n),e.
1inset=e.strokeWidth/2}))}computeFocusBounds(e){if(e instanceof zC){const{x:t,y:i,width:n,height:s}=e,a=new BC(t,i,n,s);return PC.toCanvas(this.contentGroup,a)}return e}hasItemStylers(){return this.properties.selection.enabled||null!=this.properties.node.itemStyler||null!=this.properties.link.itemStyler||null!=this.properties.label.itemStyler}};return e.className="SankeySeries",e.type="sankey",e})(),{sankeySeriesThemeableOptionsDef:HC}=s.n1,jC=(()=>({...HC,...n.XxK,type:(0,n.mw3)((0,n.dYl)("sankey")),fromKey:(0,n.mw3)(n.YjP),toKey:(0,n.mw3)(n.YjP),sizeKey:n.YjP,sizeName:n.YjP,getItemId:(0,n.R3$)(n.YjP)}))();jC.fillGradientDefaults=(0,n._Le)(n.wiP),jC.fillPatternDefaults=(0,n._Le)(n.GYY),jC.fillImageDefaults=(0,n._Le)(n.Zdq),jC.defaultColorRange=(0,n._Le)((0,n.jk9)((0,n.jk9)(n.yWT))),jC.defaultPatternFills=(0,n._Le)((0,n.jk9)(n.yWT));var WC=(()=>({type:"series",name:"sankey",chartType:"standalone",enterprise:!0,solo:!0,version:s.xv,dependencies:[Py],options:jC,themeTemplate:{seriesArea:{padding:{top:10,bottom:10}},series:{fills:{$palette:"fills"},strokes:{$palette:"strokes"},highlight:{enabled:{$path:["/highlight/enabled",!0]},unhighlightedItem:{opacity:.5}},label:{...n.mgV,enabled:!0,fontFamily:{$ref:"fontFamily"},fontSize:{$ref:"fontSize"},fontWeight:{$ref:"fontWeight"},color:{$ref:"textColor"},spacing:10},node:{spacing:{$if:[{$greaterThan:[{$path:"./minSpacing"},20]},{$path:"./minSpacing"},20]},minSpacing:0,width:10,strokeWidth:{$isUserOption:["./stroke",2,0]}},link:{fillOpacity:.5,strokeWidth:{$isUserOption:["./stroke",2,0]}},...(0,n.fs4)({selection:n.zg6,fillGradientDefaults:n.Euh,fillPatternDefaults:n.eu4,fillImageDefaults:n.pwE,defaultColorRange:{$palette:"gradients"},defaultPatternFills:n.Hsq})},legend:{enabled:!1,toggleSeries:!1}},create:e=>new $C(e)}))(),{HierarchySeriesProperties:_C,makeSeriesTooltip:GC,HighlightProperties:KC,Label:YC}=s.n1,UC=(()=>{var e=class extends n.XPE{};return l([n.mAP],e.prototype,"fill",2),l([n.mAP],e.prototype,"fillOpacity",2),l([n.mAP],e.prototype,"stroke",2),l([n.mAP],e.prototype,"strokeWidth",2),l([n.mAP],e.prototype,"strokeOpacity",2),l([n.mAP],e.prototype,"opacity",2),e})(),XC=(()=>{var e=class extends KC{constructor(){super(...arguments),this.highlightedBranch=new UC,this.unhighlightedBranch=new UC}};return l([n.mAP],e.prototype,"highlightedBranch",2),l([n.mAP],e.prototype,"unhighlightedBranch",2),e})(),ZC=(()=>{var e=class extends YC{constructor(){super(...arguments),this.spacing=2}set(e,t){return super.set(e)}};return l([n.mAP],e.prototype,"text",2),l([n.mAP],e.prototype,"spacing",2),e})(),qC=(()=>{var e=class extends _C{constructor(){super(...arguments),this.fillOpacity=1,this.strokeWidth=0,this.strokeOpacity=1,this.cornerRadius=0,this.innerLabels=new n.F_c(ZC),this.highlight=new XC,this.label=new Zl,this.secondaryLabel=new ql,this.tooltip=GC()}getStyle(e){const{fills:t,strokes:i,fillOpacity:n,strokeWidth:s,strokeOpacity:a}=this;return{fill:t[e%t.length],fillOpacity:n,stroke:i[e%i.length],strokeWidth:s,strokeOpacity:a,opacity:1}}};return l([n.mAP],e.prototype,"sizeName",2),l([n.mAP],e.prototype,"labelKey",2),l([n.mAP],e.prototype,"secondaryLabelKey",2),l([n.mAP],e.prototype,"fillOpacity",2),l([n.mAP],e.prototype,"strokeWidth",2),l([n.mAP],e.prototype,"strokeOpacity",2),l([n.mAP],e.prototype,"cornerRadius",2),l([n.mAP],e.prototype,"sectorSpacing",2),l([n.mAP],e.prototype,"padding",2),l([n.mAP],e.prototype,"innerRadiusRatio",2),l([n.mAP],e.prototype,"innerRadiusSize",2),l([n.mAP],e.prototype,"innerCircle",2),l([n.mAP],e.prototype,"innerLabels",2),l([n.mAP],e.prototype,"itemStyler",2),l([n.mAP],e.prototype,"highlight",2),l([n.mAP],e.prototype,"label",2),l([n.mAP],e.prototype,"secondaryLabel",2),l([n.mAP],e.prototype,"tooltip",2),e})(),{fromToMotion:QC,createDatumId:JC,PointerEvents:eN,Sector:tN,Group:iN,ScalableGroup:nN,Selection:sN,Text:aN,TransformableText:oN,BBox:rN,fitLabelToContainer:lN,getLabelStyles:hN,toHierarchyHighlightString:cN}
1=s.n1,dN=class extends s.n1.HierarchyNode{constructor(){super(...arguments),this.label=void 0,this.secondaryLabel=void 0,this.contentHeight=0,this.bbox=void 0,this.startAngle=0,this.endAngle=0}};function uN(e,t=0,i=2*Math.PI/e.sumSize){for(const n of e.children){const e=t+n.sumSize*i;n.startAngle=t,n.endAngle=e,uN(n,t,i),t=e}}var pN=(()=>{var e=class extends s.n1.HierarchySeries{constructor(e){super(e),this.NodeClass=dN,this.properties=new qC,this.scalingGroup=this.contentGroup.appendChild(new nN),this.sectorGroup=this.scalingGroup.appendChild(new iN),this.highlightSectorGroup=this.scalingGroup.appendChild(new iN),this.innerCircleGroup=this.scalingGroup.appendChild(new iN),this.sectorLabelGroup=this.scalingGroup.appendChild(new iN),this.innerLabelsGroup=this.scalingGroup.appendChild(new iN({name:"innerLabels"})),this.datumSelection=sN.select(this.sectorGroup,tN),this.labelSelection=sN.select(this.sectorLabelGroup,iN),this.highlightSelection=sN.select(this.highlightSectorGroup,tN),this.innerCircleSelection=sN.select(this.innerCircleGroup,tN),this.innerLabelsSelection=sN.select(this.innerLabelsGroup,aN),this.centreCircle=null,this.sectorLabelGroup.pointerEvents=eN.None,this.innerCircleGroup.pointerEvents=eN.None,this.innerLabelsGroup.pointerEvents=eN.None}processData(){super.processData(),uN(this.rootNode)}updateSelections(){const e=this.getActiveHighlightNode();if(this.highlightSelection.update(null==e?[]:[e],void 0,(e=>e.datumIndex)),!this.nodeDataRefresh)return;this.nodeDataRefresh=!1;const{chart:t}=this;if(null==t)return;if(null==t.seriesRect)return;const i=Array.from(this.rootNode);this.datumSelection.update(i,void 0,(e=>e.datumIndex)),this.labelSelection.update(i,(e=>{e.append([new oN({tag:0}),new oN({tag:1})])}),(e=>e.datumIndex))}getItemStyle(e,t){const{properties:i,colorScale:s}=this,{itemStyler:a,colorKey:o}=i,{missingDataFill:r}=i.colorScale,l=e.path?.[0]??0,h=this.getActiveHighlightNode(),c=this.getHierarchyHighlightState(t,h,e),d=this.getHierarchyHighlightStyles(c,this.properties.highlight),u=this.getSelectionStyle(e.datumIndex),p=(0,n.HFk)(u,d,i.getStyle(l));null!=e.colorValue&&null==d?.fill?p.fill=s.convert(e.colorValue):null!=o&&null!=r&&null==d?.fill&&(p.fill=r);let g=p;if(null!=a&&null!=e){const i=this.cachedDatumCallback(JC(e.datumIndex,t?"highlight":"node"),(()=>{const t=this.makeItemStylerParams(e,g,cN(c));return this.ctx.optionsGraphService.resolvePartial(["series",`${this.declarationOrder}`],this.callWithContext(a,t))}));i&&(g=(0,n.HFk)(i,g))}return g}makeItemStylerParams(e,t,i){const{id:n}=this,{colorKey:s,childrenKey:a,sizeKey:o,labelKey:r,secondaryLabelKey:l}=this.properties,h=this.filterItemStylerFillParams(t.fill)??t.fill;return{seriesId:n,datum:e.datum,depth:e.depth??0,colorKey:s,childrenKey:a,sizeKey:o,labelKey:r,secondaryLabelKey:l,highlightState:i,selectionState:this.getSelectionStateString(e.datumIndex),candidateState:this.getCandidateStateString(e.datumIndex),...t,fill:h}}updateNodes(){this.centreCircle=null;const{chart:e,data:t,maxDepth:i}=this;if(null==e||null==t)return;const{width:s,height:a}=e.seriesRect,{sectorSpacing:o=0,padding:r=0,cornerRadius:l,childrenKey:h,colorKey:c,colorName:d,labelKey:u,secondaryLabelKey:p,sizeKey:g,sizeName:m,innerRadiusRatio:y,innerRadiusSize:f,innerCircle:x}=this.properties;this.contentGroup.translationX=s/2,this.contentGroup.translationY=a/2;const b=.5*o,v=Math.min(s,a)/2,S=null==y&&null==f?0:v*(y??0)+(f??0),M=Math.max(S,0),k=Math.max(v-M,0)/(i+1),D=-Math.PI/2,w={series:new rN(-v,-v,2*v,2*v),axis:new rN(-v,-v,2*v,2*v)},{rootNode:I}=this;M>0&&M<v&&(this.centreCircle={radius:M}),I?.walk((e=>{const{startAngle:t,endAngle:i}=e;if(null!=e.depth){const n=(t+i)/2+D,s=M+(e.depth+.5)*k;e.midPoint.x=Math.cos(n)*s,e.midPoint.y=Math.sin(n)*s}})),I?.walk((e=>{const{datum:t,depth:i,startAngle:s,endAngle:a,parent:o,sumSize:l}=e;let y,f;if(e.label=void 0,e.secondaryLabel=void 0,e.contentHeight=0,null!=t&&null!=i&&null!=u){const e=t[u];y=this.getLabelText(e,t,u,"label",[],this.properties.label,{depth:i,datum:t,childrenKey:h,colorKey:c,colorName:d,labelKey:u,secondaryLabelKey:p,sizeKey:g,
1sizeName:m,value:e})}if(""===y&&(y=void 0),null!=t&&null!=i&&null!=p){const e=t[p];f=this.getLabelText(e,t,p,"secondaryLabel",[],this.properties.secondaryLabel,{depth:i,datum:t,childrenKey:h,colorKey:c,colorName:d,labelKey:u,secondaryLabelKey:p,sizeKey:g,sizeName:m,value:e})}if(""===f&&(f=void 0),null==i)return;if(k<=0)return;const x=M+i*k+b,v=M+(i+1)*k-b,S=x>b?b/x:b,w=v>b?b/v:b,I=a+S-(s+S),A=a+w-(s+w),C=Yl(y,this.properties.label,f,this.properties.secondaryLabel,{padding:r},(e=>{if(0===i&&0===M&&o?.sumSize===l){return{width:2*Math.sqrt(v**2-(.5*e)**2),height:e,meta:0}}const t=e,s=2*Math.sqrt(v**2-(x+t)**2),a=I<Math.PI?2*x*Math.tan(.5*I):1/0,r=Math.min(s,a),h=Math.PI/4;let c,d;return 0===i&&0===M?(c=e,d=Math.sqrt(v**2-(c/2)**2)-e/(2*Math.tan(.5*A))):(0,n.YcT)(I)<h?(c=2*x*Math.tan(.5*I),d=Math.sqrt(v**2-(c/2)**2)-x):(d=0,c=0),r>=d?{width:r,height:t,meta:1}:{width:d,height:c,meta:2}}));if(null==C)return;const{width:N,height:L,meta:P,label:T,secondaryLabel:O}=C,R=D+(s+a)/2,E=(Math.sin(R)>=0?3:12)&(Math.cos(R)>=0?6:9);let z;switch(P){case 0:z=0;break;case 1:{const e=v-(k-L)*.58,t=Math.sqrt((v-r)**2-(N/2)**2);z=Math.min(e,t);break}case 2:if(0===i&&0===M){z=.5*(L/(2*Math.tan(.5*I))+.5*N+(Math.sqrt(v**2-(.5*L)**2)-.5*N))}else z=.5*(x+v)}if(null!=T){const{fontStyle:t="normal",fontFamily:i,fontWeight:n="normal",color:s="black"}=this.properties.label;e.label={...T,fontStyle:t,fontFamily:i,fontWeight:n,color:s,labelPlacement:P,circleQuarter:E,radius:z,theta:R}}if(null!=O){const{fontStyle:t="normal",fontFamily:i,fontWeight:n="normal",color:s="black"}=this.properties.secondaryLabel;e.secondaryLabel={...O,fontStyle:t,fontFamily:i,fontWeight:n,color:s,labelPlacement:P,circleQuarter:E,radius:z,theta:R}}e.contentHeight=C.height}));const A=(e,t,i)=>{const{depth:s,startAngle:a,endAngle:o}=e;if(null==s)return void(t.visible=!1);t.visible=!0;const r=this.getItemStyle(e,i),h=r.fill,c=r.strokeWidth,d=(0,n.MBc)(h)&&"item"!==h.bounds?w:void 0;t.setStyleProperties(r,d),t.centerX=0,t.centerY=0,t.innerRadius=M+s*k,t.outerRadius=M+(s+1)*k,t.startAngle=a+D,t.endAngle=o+D,t.inset=b+.5*c,t.cornerRadius=l};this.datumSelection.each(((e,t)=>{A(t,e,!1)})),this.highlightSelection.each(((e,t)=>{A(t,e,!0)}));const{innerLabels:C}=this.properties,N=this.resolveCentreCircle();if(this.innerCircleSelection.update(null==x||null==N?[]:[N]),this.innerLabelsSelection.update(null==N?[]:C,(e=>{e.pointerEvents=eN.None})),(null!=x||C.length>0)&&null==y&&null==f)this.ctx.logger.warnOnce("Options [series.innerCircle] and [series.innerL
1abels] have no effect unless either [series.innerRadiusRatio] or [series.innerRadiusSize] is set.");else if(null!=x){const{fill:e,fillOpacity:t=1}=x,i=(0,n.MBc)(e)&&"item"!==e.bounds?w:void 0;this.innerCircleSelection.each(((n,{radius:s})=>{n.setStyleProperties({fill:e,fillOpacity:t},i),n.centerX=0,n.centerY=0,n.innerRadius=0,n.outerRadius=s,n.startAngle=0,n.endAngle=2*Math.PI}))}const L=this.getActiveHighlightNode(),P=(e,t,i,n)=>{const{depth:s,contentHeight:a}=e,o=0===i,r=o?e.label:e.secondaryLabel;if(null==s||null==r)return void(t.visible=!1);const{labelPlacement:l,circleQuarter:h,radius:c,theta:d}=r,u=this.getHierarchyHighlightState(n,L,e),{opacity:p}=this.getHierarchyHighlightStyles(u,this.properties.highlight)??{},g={childrenKey:this.properties.childrenKey,colorKey:this.properties.colorKey,colorName:this.properties.colorName??this.properties.colorKey,depth:e.depth??Number.NaN,labelKey:this.properties.labelKey,secondaryLabelKey:this.properties.secondaryLabelKey,sizeKey:this.properties.sizeKey,sizeName:this.properties.sizeName??this.properties.sizeKey},m=o?this.properties.label:this.properties.secondaryLabel,y=this.ctx.highlightManager?.getActiveHighlight(),f=hN(this,e,g,m,n,y);switch(t.text=r.text,t.fontSize=r.fontSize,t.lineHeight=r.lineHeight,t.fontStyle=r.fontStyle,t.fontFamily=r.fontFamily,t.fontWeight=r.fontWeight,t.fillOpacity=p??1,t.fill=f.color,t.setBoxing(f),l){case 0:t.textAlign="center",t.textBaseline="top",t.translationX=0,t.translationY=(o?0:a-r.height)-.5*a,t.rotation=0;break;case 1:{const e=!!(3&h),i=o===!e?c:c-(a-r.height);t.textAlign="center",t.textBaseline=e?"bottom":"top",t.translationX=Math.cos(d)*i,t.translationY=Math.sin(d)*i,t.rotation=e?d-.5*Math.PI:d+.5*Math.PI;break}case 2:{const e=!!(6&h),i=o===!e?.5*(a-r.height):.5*(r.height-a);t.textAlign="center",t.textBaseline="middle",t.translationX=Math.cos(d)*c+Math.cos(d+Math.PI/2)*i,t.translationY=Math.sin(d)*c+Math.sin(d+Math.PI/2)*i,t.rotation=e?d:d+Math.PI;break}}t.visible=!0},T=this.getActiveHighlightNode();for(const e of this.labelSelection.selectByClass(oN)){const t=e.unsafeClosestDatum();P(t,e,e.tag,t===T)}null!=N&&C.length>0&&this.updateInnerLabelNodes(N)}updateInnerLabelNodes(e){const{radius:t}=e,i=[],s=[],a=t*Math.SQRT2,o={width:a,height:a};this.innerLabelsSelection.each(((e,t)=>{const{fontStyle:a,fontWeight:r,fontSize:l,fontFamily:h,color:c}=t;e.fontStyle=a,e.fontWeight=r,e.fontSize=l,e.fontFamily=h,e.text=lN(t.text,(0,n.A_g)(t,!1),t,o),e.x=0,e.y=0,e.fill=c,e.textAlign="center",e.textBaseline="bottom",i.push(e.getBBox()),s.push(t.spacing)}));const r=e=>0===e?0:s[e],l=e=>e===s.length-1?0:s[e],h=i.reduce(((e,t)=>Math.max(e,t.width)),0),c=i.reduce(((e,t,i)=>e+t.height+r(i)+l(i)),0),d=Math.sqrt(Math.pow(h/2,2)+Math.pow(c/2,2))<=t,u=[];for(let e=0,t=-c/2;e<i.length;e++){const n=i[e].height+t+r(e);u.push(n),t=n+l(e)}this.innerLabelsSelection.each(((e,t,i)=>{e.visible=d,e.y=u[i]}))}getTooltipContent(e){const{id:t,properties:i,ctx:s}=this,{labelKey:a,secondaryLabelKey:o,childrenKey:r,sizeKey:l,sizeName:h,colorKey:c,colorName:d,tooltip:u}=i,{formatManager:p}=s,g=this.dfsFind(e);if(null==g)return;const{datum:m,depth:y}=g;if(null==m||null==y)return;const f=[],x=null==l?void 0:m[l];if(null!=x){const e=[0,this.rootNode?.sumSize??0],i=p.format(this.callWithContext.bind(this),{type:"number",value:x,datum:m,seriesId:t,legendItemName:void 0,key:l,source:"tooltip",property:"size",boundSeries:this.getFormatterContext("size"),domain:e,fractionDigits:void 0,visibleDomain:void 0});f.push({label:h,fallbackLabel:l,value:i??(0,n.Fl2)(x)})}const b=null==c?void 0:m[c];if(null!=b){const{colorDomain:e}=this,s=p.format(this.callWithContext.bind(this),{type:"number",value:b,datum:m,seriesId:t,legendItemName:void 0,key:c,source:"tooltip",property:"color",boundSeries:this.getFormatterContext("color"),domain:e,fractionDigits:void 0,visibleDomain:void 0}),a=(0,n.zP6)(this.colorScale,i.colorScale.fills,b,n.Fl2);f.push({label:d,fallbackLabel:c,value:s??a??(0,n.Fl2)(b)})}const v=this.getItemStyle({...g,colorValue:b??g.colorValue},!1),S={shape:"square",fill:v.fill,fillOpacity:1,stroke:void 0,strokeWidth:0,strokeOpacity:1,lineDash:[0],lineDashOffset:0};return(0,n.MBc)(S.fill)&&(S.fill={...S.fill,gradient:"linear",rotation:0,reverse:!1}),this.formatTooltipWithContext(u,{title:null==a?void 0:m[a],symbol:{marker:S},data:f},{seriesId:t,datum:m,title:void 0,depth:y,labelKey:a,secondaryLabelKey:o,childrenKey:r,sizeKey:l,sizeName:h,colorKey:c,colorName:d,...v})}createNodeData(){}resolveCentreCircle(){return this.centreCircle}pickNodeClosestDatum(e){return this.pickNodeNearestDistantObject(e,this.datumSelection.nodes())}pickNodesInBBoxPredicate(){return s.n1.pickSectorsInBBoxPredicate(this)}animateEmptyUpdateReady(){QC(this.id,"nodes",this.ctx.animationManager,[this.scalingGroup],{toFn:()=>({scalingX:1,scalingY:1}),fromFn:()=>({scalingX:0,scalingY:0})})}computeFocusBounds(e){return e}hasItemStylers(){return this.properties.selection.enabled||null!=this.properties.itemStyler||null!=this.properties.label.itemStyler}};return e.className="SunburstSeries",e.type="sunburst",e})(),{sunburstSeriesThemeableOptionsDef:gN}=s.n1,mN=(()=>
1({...gN,...(0,n.FFB)(n.XxK,["highlightStyle","highlight","showInLegend"]),type:(0,n.mw3)((0,n.dYl)("sunburst")),innerCircle:{fill:(0,n.mw3)(n.JpK),fillOpacity:n.CGN},innerLabels:(0,n.J$N)({text:(0,n.mw3)(n.JwX),spacing:n.LyW,...n.LVV,...n.lb7},"inner label options array"),labelKey:n.YjP,secondaryLabelKey:n.YjP,childrenKey:n.YjP,sizeKey:n.YjP,colorKey:n.YjP,sizeName:n.YjP,colorName:n.YjP}))(),yN={series:{fills:{$applyCycle:[{$size:{$path:["./data",{$path:"/data"}]}},{$palette:"fills"},{$applySwitch:[{$path:["/type",void 0,{$value:"$1"}]},{$value:"$1"},["gradient",n.p3y],["pattern",n.eu4],["image",n.pwE]]}]},strokes:{$applyCycle:[{$size:{$path:["./data",{$path:"/data"}]}},{$palette:"strokes"}]},colorScale:{fills:{$map:[{color:{$value:"$1"}},{$palette:"divergingColors"}]}},strokeWidth:{$isUserOption:["./strokes/0",2,0]},label:{...n.mgV,enabled:!0,fontFamily:{$ref:"fontFamily"},fontSize:{$rem:n.q8q.LARGE},minimumFontSize:{$rem:9/n.Efy},fontWeight:{$ref:"fontWeight"},color:{$ref:"chartBackgroundColor"},overflowStrategy:"ellipsis",wrapping:"never",spacing:2},secondaryLabel:{...n.mgV,enabled:!0,fontFamily:{$ref:"fontFamily"},fontSize:{$rem:n.q8q.SMALLEST},minimumFontSize:{$rem:7/n.Efy},fontWeight:{$ref:"fontWeight"},color:{$ref:"chartBackgroundColor"},overflowStrategy:"ellipsis",wrapping:"never"},innerLabels:{$apply:{...n.mgV,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"textColor"},spacing:2}},sectorSpacing:2,padding:3,highlight:{enabled:{$circular:{$path:"/highlight/enabled"}},unhighlightedItem:{fillOpacity:.6,strokeOpacity:.6},unhighlightedBranch:{fillOpacity:.2,strokeOpacity:.2}},selection:n.zg6},legend:{enabled:{$and:[{$path:"../series/0/colorKey"},{$eq:[{$path:"../series/0/colorScale/mode"},"discrete"]}]}},gradientLegend:{enabled:{$and:[{$path:"../series/0/colorKey"},{$not:{$eq:[{$path:"../series/0/colorScale/mode"},"discrete"]}}]}}},fN={type:"series",name:"sunburst",chartType:"standalone",enterprise:!0,solo:!0,version:s.xv,dependencies:[Py],options:mN,themeTemplate:yN,create:e=>new pN(e)},{HierarchySeriesProperties:xN,makeSeriesTooltip:bN,Label:vN}=s.n1,SN=(()=>{var e=class extends vN{constructor(){super(...arguments),this.spacing=0}};return l([n.mAP],e.prototype,"spacing",2),e})(),MN=(()=>{var e=class extends n.XPE{};return l([n.mAP],e.prototype,"fill",2),l([n.mAP],e.prototype,"fillOpacity",2),l([n.mAP],e.prototype,"stroke",2),l([n.mAP],e.prototype,"strokeWidth",2),l([n.mAP],e.prototype,"strokeOpacity",2),l([n.mAP],e.prototype,"opacity",2),e})(),kN=(()=>{var e=class extends n.XPE{constructor(){super(...arguments),this.enabled=!0,this.highlightedItem=new MN,this.unhighlightedItem=new MN}};return l([n.mAP],e.prototype,"enabled",2),l([n.mAP],e.prototype,"highlightedItem",2),l([n.mAP],e.prototype,"unhighlightedItem",2),e})(),DN=(()=>{var e=class extends n.XPE{};return l([n.mAP],e.prototype,"fill",2),l([n.mAP],e.prototype,"fillOpacity",2),l([n.mAP],e.prototype,"stroke",2),l([n.mAP],e.prototype,"strokeWidth",2),l([n.mAP],e.prototype,"strokeOpacity",2),l([n.mAP],e.prototype,"opacity",2),e})(),wN=(()=>{var e=class extends n.XPE{constructor(){super(...arguments),this.enabled=!0,this.highlightedBranch=new DN,this.highlightedItem=new DN,this.unhighlightedItem=new DN,this.unhighlightedBranch=new DN}};return l([n.mAP],e.prototype,"enabled",2),l([n.mAP],e.prototype,"highlightedBranch",2),l([n.mAP],e.prototype,"highlightedItem",2),l([n.mAP],e.prototype,"unhighlightedItem",2),l([n.mAP],e.prototype,"unhighlightedBranch",2),e})(),IN=(()=>{var e=class extends n.XPE{constructor(){super(...arguments),this.fill=void 0,this.fills=[],this.fillOpacity=1,this.strokeWidth=1,this.strokeOpacity=1,this.cornerRadius=0,this.textAlign="center",this.gap=0,this.padding=0,this.interactive=!0,this.label=new SN,this.highlight=new kN,this.selection=new s.n1.SeriesSelectionProperties}};return l([n.mAP],e.prototype,"fill",2),l([n.mAP],e.prototype,"fills",2),l([n.mAP],e.prototype,"fillOpacity",2),l([n.mAP],e.prototype,"stroke",2),l([n.mAP],e.prototype,"strokeWidth",2),l([n.mAP],e.prototype,"strokeOpacity",2),l([n.mAP],e.prototype,"cornerRadius",2),l([n.mAP],e.prototype,"textAlign",2),l([n.mAP],e.prototype,"gap",2),l([n.mAP],e.prototype,"padding",2),l([n.mAP],e.prototype,"interactive",2),l([n.mAP],e.prototype,"label",2),l([n.mAP],e.prototype,"highlight",2),l([n.mAP],e.prototype,"selection",2),e})(),AN=(()=>{var e=class extends n.XPE{constructor(){super(...arguments),this.fill=void 0,this.fillOpacity=1,this.strokeWidth=1,this.strokeOpacity=1,this.cornerRadius=0,this.textAlign="center",this.verticalAlign="middle",this.gap=0,this.padding=0,this.label=new Zl,this.secondaryLabel=new ql,this.highlight=new wN,this.selection=new s.n1.SeriesSelectionProperties}};return l([n.mAP],e.prototype,"fill",2),l([n.mAP],e.prototype,"fillOpacity",2),l([n.mAP],e.prototype,"stroke",2),l([n.mAP],e.prototype,"strokeWidth",2),l([n.mAP],e.prototype,"strokeOpacity",2),l([n.mAP],e.prototype,"cornerRadius",2),l([n.mAP],e.prototype,"textAlign",2),l([n.mAP],e.prototype,"verticalAlign",2),l([n.mAP],e.prototype,"gap",2),l([n.mAP],e.prototype,"padding",2),l([n.mAP],e.prototype,"label",2),l([n.mAP],e.prototype,"secondaryLabel",2),l([n.mAP],e.prototype,"highlight",2),l([n.mAP],e.prototype,"selection",2),e})(),CN=(()=>{var e=class extends xN{constructor(){super(...arguments),this.tooltip=bN(),this.group=new IN,this.tile=new AN,this.undocumentedGroupStrokes=[]}getStyle(e,t,i,n){const{fillOpacity:s,strokeWidth:a,strokeOpacity:o,fill:r=t[n%t.length],stroke:l=(e?i[n%i.length]:i[Math.min(n,i.length)])}=e?this.tile:this.group;return{fill:r,fillOpacity:s,stroke:l,strokeWidth:a,strokeOpacity:o,opacity:1}}};return l([n.mAP],e.prototype,"sizeName",2),l([n.mAP],e.prototype,"labelKey",2),l([n.mAP],e.prototype,"secondaryLabelKey",2),l([n.mAP],e.prototype,"itemStyler",2),l([n.mAP],e.prototype,"tooltip",2),l([n.mAP],e.prototype,"group",2),l([n.mAP],e.prototype,"tile",2),l([n.mAP],e.prototype,"undocumentedGroupStrokes",2),e})(),{createDatumId:NN,Rect:LN,Group:PN,BBox:TN,Selection:ON,Text:RN,Transformable:EN,getLabelStyles:zN,HierarchyHighlightState:BN,toHierarchyHighlightString:FN}
1=s.n1,VN=class extends s.n1.HierarchyNode{constructor(){super(...arguments),this.labelValue=void 0,this.secondaryLabelValue=void 0,this.labelText=void 0,this.secondaryLabelText=void 0,this.label=void 0,this.secondaryLabel=void 0,this.bbox=void 0,this.padding=void 0}};function $N(e){return e.children.length>0?e.sumSize-e.sizeValue:e.sizeValue}var HN={left:0,center:.5,right:1},jN={top:0,middle:.5,bottom:1},WN=(()=>{var e=class extends s.n1.HierarchySeries{constructor(){super(...arguments),this.NodeClass=VN,this.properties=new CN,this.rectGroup=this.contentGroup.appendChild(new PN),this.datumSelection=ON.select(this.rectGroup,LN),this.labelSelection=ON.select(this.labelGroup,PN),this.highlightSelection=ON.select(this.rectGroup,LN)}get data(){const e=super.data;if(e instanceof Iy)return e}groupTitleHeight(e,t){const{label:i}=this.properties.group,{labelValue:s}=e,{fontSize:a}=i;if(i.enabled&&null!=s&&a<=t.width/3&&a<=t.height/3){const{height:e}=(0,n.K$y)(i).measureLines(s);return Math.max(e,a)}}getNodePadding(e,t){if(null==e.parent)return{top:0,right:0,bottom:0,left:0};if(0===e.children.length){const{padding:e}=this.properties.tile;return{top:e,right:e,bottom:e,left:e}}const{padding:i,label:{spacing:n}}=this.properties.group,s=this.groupTitleHeight(e,t);return{top:i+(null==s?0:s+n),right:i,bottom:i,left:i}}sortChildren({children:e}){return Array.from(e,((e,t)=>t)).filter((t=>$N(e[t])>0)).sort(((t,i)=>$N(e[i])-$N(e[t])))}hideNode(e){e.bbox=void 0,e.padding=void 0,e.midPoint.x=Number.NaN,e.midPoint.y=Number.NaN}collapses(e,t){if(0===e.children.length)return!1;if(t.width<=0||t.height<=0)return!0;const i=null==e.datum?{top:0,right:0,bottom:0,left:0}:this.getNodePadding(e,t);return t.width-i.left-i.right<=0||t.height-i.top-i.bottom<=0}squarify(e,t){const{datum:i,children:n}=e;if(t.width<=0||t.height<=0)return void e.walk((e=>this.hideNode(e)));const s=null==i?{top:0,right:0,bottom:0,left:0}:this.getNodePadding(e,t);null==e.parent?this.hideNode(e):(e.bbox=t,e.padding=s,e.midPoint.x=t.x+t.width/2,e.midPoint.y=t.y);const a=this.sortChildren(e),o=a.every((e=>0===n[e].children.length)),r=t.width-s.left-s.right,l=t.height-s.top-s.bottom;if(r<=0||l<=0)return void(n.length>0&&e.walk((e=>this.hideNode(e))));const h=new TN(t.x+s.left,t.y+s.top,r,l);let c=a;const d=new Set;let u=this.layoutChildren(n,c,h,o),p=u.filter((({child:e,bbox:t})=>this.collapses(e,t)));for(;p.length>0;){for(const{child:e}of p)d.add(e);if(c=c.filter((e=>!d.has(n[e]))),0===c.length)return void e.walk((e=>this.hideNode(e)));u=this.layoutChildren(n,c,h,o),p=u.filter((({child:e,bbox:t})=>this.collapses(e,t)))}for(const e of d)e.walk((e=>this.hideNode(e)));for(const{child:e,bbox:t}of u)this.squarify(e,t)}layoutChildren(e,t,i,n){const s=i=>e[t[i]],a=t.length,o=[];let r=0,l=0,h=1/0,c=t.reduce(((t,i)=>t+$N(e[i])),0);const d=i.clone();let u=0;for(;u<a;){const e=$N(s(u)),t=$N(s(l)),a=d.width<d.height;r+=e;const p=a?d.height:d.width,g=a?d.width:d.height,m=g*t/r;let y=p*r/c;const f=Math.max(m,y)/Math.min(m,y),x=Math.abs(1-f);if(x<h){h=x,u++;continue}r-=e,y=p*r/c;let b=a?d.x:d.y;for(let e=l;e<u;e++){const t=s(e),l=$N(t),h=a?b:d.x,u=a?d.y:b,p=g*l/r,m=new TN(h,u,a?p:y,a?y:p);this.applyGap(i,m,n),o.push({child:t,bbox:m}),c-=l,b+=p}a?(d.y+=y,d.height-=y):(d.x+=y,d.width-=y),l=u,r=0,h=1/0}const p=d.width<d.height;let g=p?d.x:d.y;for(let e=l;e<a;e++){const t=s(e),a=p?g:d.x,r=p?d.y:g,l=$N(t)/c,h=d.width*(p?l:1),u=d.height*(p?1:l),m=new TN(a,r,h,u);this.applyGap(i,m,n),o.push({child:t,bbox:m}),g+=p?h:u}return o}applyGap(e,t,i){const s=i?.5*this.properties.tile.gap:.5*this.properties.group.gap,a=e=>({left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height}),o=a(e),r=a(t),l=["top","right","bottom","left"];for(const e of l)(0,n.YXt)(o[e],r[e])||t.shrink(s,e)}createNodeData(){}getItemStyle(e,t,i){const{properties:s,colorScale:a}=this,{itemStyler:o,colorKey:r}=s,{missingDataFill:l}=s.colorScale,h=e.path?.[0]??0,c=t?s.fills:s.group.fills,d=t?s.strokes:s.undocumentedGroupStrokes,u=t?h:e.depth??-1,p=this.getActiveHighlightNode(),g=this.getHierarchyHighlightState(i,p,e),m=this.getGroupHighlightState(i,p,e),y=t?g:m,f=t?this.getTileHighlightStyle(g,m,p):this.getGroupHighlightStyle(m),x=t?this.getTileSelectionStyle(e.datumIndex):this.getGroupSelectionStyle(e.datumIndex),b=(0,n.HFk)(x,f,s.getStyle(t,c,d,u));t&&null!=e.colorValue&&null==f?.fill?b.fill=a.convert(e.colorValue):t&&null!=r&&null!=l&&null==f?.fill&&(b.fill=l);let v=b;if(null!=o&&null!=e){const t=this.cachedDatumCallback(NN(e.datumIndex,i?"highlight":"node"),(()=>{const t=this.makeItemStylerParams(e,v,FN(y));return this.ctx.optionsGraphService.resolvePartial(["series",`${this.declarationOrder}`],this.callWithContext(o,t))}));t&&(v=(0,n.HFk)(t,v))}return v}makeItemStylerParams(e,t,i){const{id:n}=this,{colorKey:s,childrenKey:a,sizeKey:o,labelKey:r,secondaryLabelKey:l}
1=this.properties,h=this.filterItemStylerFillParams(t.fill)??t.fill;return{seriesId:n,datum:e.datum,depth:e.depth??-1,colorKey:s,childrenKey:a,sizeKey:o,labelKey:r,secondaryLabelKey:l,highlightState:i,selectionState:this.getSelectionStateString(e.datumIndex),candidateState:this.getCandidateStateString(e.datumIndex),...t,fill:h}}updateSelections(){const e=this.getActiveHighlightNode();if(this.highlightSelection.update(null==e?[]:[e],void 0,(e=>e.datumIndex)),!this.nodeDataRefresh)return;this.nodeDataRefresh=!1;const{seriesRect:t}=this.chart??{};if(!t)return;const i=Array.from(this.rootNode);this.datumSelection.update(i,void 0,(e=>e.datumIndex)),this.labelSelection.update(i,(e=>{e.append([new RN({tag:0}),new RN({tag:1})])}),(e=>e.datumIndex))}getActiveHighlightNode(){const e=super.getActiveHighlightNode();if(!e?.children.length||this.properties.group.interactive)return e}updateNodes(){const{rootNode:e,data:t}=this,{childrenKey:i,colorKey:s,colorName:a,labelKey:o,secondaryLabelKey:r,sizeKey:l,sizeName:h,tile:c,group:d}=this.properties,{seriesRect:u}=this.chart??{};if(!u||!t)return;this.rootNode?.walk((e=>{const{datum:t,depth:u,children:p}=e,g=0===p.length,m=g?c.label:d.label;let y,f;if(m.enabled&&null!=t&&null!=u&&null!=o){const e=t[o];y=this.getLabelText(e,t,o,"label",[],m,{depth:u,datum:t,childrenKey:i,colorKey:s,colorName:a,labelKey:o,secondaryLabelKey:r,sizeKey:l,sizeName:h,value:e})}if(""===y&&(y=void 0),c.secondaryLabel.enabled&&g&&null!=t&&null!=u&&null!=r){const e=t[r];f=this.getLabelText(e,t,r,"secondaryLabel",[],c.secondaryLabel,{depth:u,datum:t,childrenKey:i,colorKey:s,colorName:a,labelKey:o,secondaryLabelKey:r,sizeKey:l,sizeName:h,value:e})}""===f&&(f=void 0),e.labelValue=(0,n.boc)(y),e.secondaryLabelValue=(0,n.boc)(f),e.labelText=g?y:void 0,e.secondaryLabelText=g?f:void 0}));const{width:p,height:g}=u;this.squarify(e,new TN(0,0,p,g)),this.rootNode?.walk((e=>{const{bbox:t,children:i,labelValue:s,secondaryLabelValue:a,labelText:o,secondaryLabelText:r}=e;if(e.label=void 0,e.secondaryLabel=void 0,null!=t)if(0===i.length){const i={width:t.width,height:t.height,meta:null},l=Yl(o??s,this.properties.tile.label,r??a,this.properties.tile.secondaryLabel,{padding:c.padding},(()=>i));if(null==l)return;const{height:h,label:d,secondaryLabel:u}=l,{textAlign:p,verticalAlign:g,padding:m}=c,y=(0,n.vDS)(p,this.ctx.domManager.isRtl),f=HN[y]??.5,x=t.x+m+(t.width-2*m)*f,b=jN[g]??.5,v=t.y+m+.5*h+(t.height-2*m-h)*b;if(null!=d){const{fontStyle:t="normal",fontFamily:i,fontWeight:n="normal",color:s="black"}=this.properties.tile.label;e.label={text:d.text,fontSize:d.fontSize,lineHeight:d.lineHeight,fontStyle:t,fontFamily:i,fontWeight:n,color:s,textAlign:p,verticalAlign:"middle",x,y:v-.5*(h-d.height)}}if(null!=u){const{fontStyle:t="normal",fontFamily:i,fontWeight:n="normal",color:s="black"}=this.properties.tile.secondaryLabel;e.secondaryLabel={text:u.text,fontSize:u.fontSize,lineHeight:u.fontSize,fontStyle:t,fontFamily:i,fontWeight:n,color:s,textAlign:p,verticalAlign:"middle",x,y:v+.5*(h-u.height)}}}else{if(null==s)return;{const{padding:i,textAlign:a}=d,o=this.groupTitleHeight(e,t);if(null==o)return;const r=t.width-2*i,l=(0,n.C1g)(s,{maxWidth:t.width-2*i,font:d.label,textWrap:"never"}),h=(0,n.vDS)(a,this.ctx.domManager.isRtl),c=HN[h]??.5,{fontStyle:u="normal",fontFamily:p,fontWeight:g="normal",color:m="black"}=this.properties.group.label;e.label={text:l,fontSize:d.label.fontSize,lineHeight:(0,n.VKS)(d.label.fontSize),fontStyle:u,fontFamily:p,fontWeight:g,color:m,textAlign:a,verticalAlign:"middle",x:t.x+i+r*c,y:t.y+i+.5*o}}}}));const m={series:new TN(0,0,p,g),axis:new TN(0,0,p,g)},y=(e,t,i)=>{const{bbox:n}=e;if(null==n)return void(t.visible=!1);const{depth:s=-1}=e,a=0===e.children.length,o=this.getItemStyle(e,a,i);t.crisp=!0,t.setStyleProperties(o,m),t.cornerRadius=a?c.cornerRadius:d.cornerRadius,t.zIndex=[0,s,i?1:0];const r=e.parent?.children.every((e=>0===e.children.length)),l=null==e.parent?void 0:e.parent.bbox,h=null==e.parent?void 0:e.parent.padding;!0===r&&null!=l&&null!=h?(t.clipBBox=n,t.x=l.x+h.left,t.y=l.y+h.top,t.width=l.width-(h.left+h.right),t.height=l.height-(h.top+h.bottom)):(t.clipBBox=void 0,t.x=n.x,t.y=n.y,t.width=n.width,t.height=n.height),t.visible=!0};this.datumSelection.each(((e,t)=>y(t,e,!1))),this.highlightSelection.each(((e,t)=>{y(t,e,!0)}));const f=(e,t,i,n)=>{const s=0===e.children.length,a=0===i?e.label:e.secondaryLabel;if(null==a)return void(t.visible=!1);let o,r;0===i?(o=s?c.label:d.label,r=["series",`${this.declarationOrder}`,s?"tile":"group","label"]):(o=c.secondaryLabel,r=["series",`${this.declarationOrder}`,"tile","secondaryLabel"]);const{opacity:l}=this.getItemStyle(e,s,n)??{},h={childrenKey:this.properties.childrenKey,colorKey:this.properties.colorKey,colorName:this.properties.colorName??this.properties.colorKey,depth:e.depth??Number.NaN,labelKey:this.properties.labelKey,secondaryLabelKey:this.properties.secondaryLabelKey,sizeKey:this.properties.sizeKey,sizeName:this.properties.sizeName??this.properties.sizeKey},u=this.ctx.highlightManager?.getActiveHighlight(),p=zN(this,e,h,o,n,u,r);t.text=a.text,t.fontSize=a.fontSize,t.lineHeight=a.lineHeight,t.fontStyle=a.fontStyle,t.fontFamily=a.fontFamily,t.fontWeight=a.fontWeight,t.fillOpacity=l??1,t.fill=p.color,t.setBoxing(p),t.textAlign=a.textAlign,t.textBaseline=a.verticalAlign,t.x=a.x,t.y=a.y,t.visible=!0,t.zIndex=1},x=this.getActiveHighlightNode();for(const e of this.labelSelection.selectByClass(RN)){const t=e.unsafeClosestDatum(
1);f(t,e,e.tag,t===x)}}getGroupHighlightState(e,t,i){const n=i.path,s=t?.path,a=this.isDescendantDatumIndex(n,s);if(0===i.children?.length)return null==n||null==t||0===t.children?.length?BN.None:a?BN.Item:BN.OtherItem;if(null==t||0===t.children?.length)return BN.None;const o=null!=i.depth&&null!=t.depth&&i.depth===t.depth;return a&&!o?BN.None:e?BN.Item:BN.OtherItem}getTileHighlightStyle(e,t,i){if(i?.children&&i.children.length>0){const e=this.getGroupHighlightStyle(t);if(null==e?.fillOpacity&&null==e?.strokeOpacity)return;return{fillOpacity:e.fillOpacity,strokeOpacity:e.strokeOpacity}}if(this.properties.tile.highlight.enabled)return this.getHierarchyHighlightStyles(e,this.properties.tile.highlight)}getGroupHighlightStyle(e){const{highlight:t}=this.properties.group;if(t.enabled)switch(e){case BN.Item:return t.highlightedItem;case BN.OtherItem:return t.unhighlightedItem;default:return}}isSelectionEnabled(){return this.properties.tile.selection.enabled}isDatumSelectable(e){return!0===this.data?.isLeaf(e)}getTileSelectionStyle(e){const t=this.getDataSelectionState(e);if(void 0!==t)return this.properties.tile.selection.getStyle(t)}getGroupSelectionStyle(e){const t=this.getDataSelectionState(e);if(void 0!==t)return this.properties.group.selection.getStyle(t)}getHighlightStateString(e,t,i){if(null==i)return FN(BN.None);const n=this.dfsFind(i),s=this.getActiveHighlightNode();if(null==n)return FN(BN.None);if(0===(n.children?.length??0)){const e=this.getHierarchyHighlightState(t??!1,s,n);return FN(e)}const a=this.getGroupHighlightState(t??!1,s,n);return FN(a)}isDescendantDatumIndex(e,t){if(null==t||0===t.length)return!0;if(null==e||e.length<t.length)return!1;for(let i=0;i<t.length;i+=1)if(e[i]!==t[i])return!1;return!0}pickNodesExactShape(e){const t=super.pickNodesExactShape(e);return t.sort(((e,t)=>t.datum.path.length-e.datum.path.length)),t}pickNodeClosestDatum(e){const t=this.pickNodesExactShape(e);return 0!==t.length?t[0]:this.pickNodeNearestDistantObject(e,this.datumSelection.nodes())}getTooltipContent(e){const{id:t,properties:i,ctx:s}=this,{formatManager:a}=s,{labelKey:o,secondaryLabelKey:r,childrenKey:l,sizeKey:h,sizeName:c,colorKey:d,colorName:u,tooltip:p}=i,g=this.dfsFind(e);if(null==g)return;const{datum:m,depth:y,children:f}=g;if(null==m||null==y)return;const x=0===f.length,b=[],v=null==h?void 0:m[h];if(null!=v){const e=[0,this.rootNode?.sumSize??0],i=a.format(this.callWithContext.bind(this),{type:"number",value:v,datum:m,seriesId:t,legendItemName:void 0,key:h,source:"tooltip",property:"size",boundSeries:this.getFormatterContext("size"),domain:e,fractionDigits:void 0,visibleDomain:void 0});b.push({label:c,fallbackLabel:h,value:i??(0,n.Fl2)(v)})}const S=null==d?void 0:m[d];if(null!=S){const{colorDomain:e}=this,s=a.format(this.callWithContext.bind(this),{type:"number",value:S,datum:m,seriesId:t,legendItemName:void 0,key:d,source:"tooltip",property:"color",boundSeries:this.getFormatterContext("color"),domain:e,fractionDigits:void 0,visibleDomain:void 0}),o=(0,n.zP6)(this.colorScale,i.colorScale.fills,S,n.Fl2);b.push({label:u,fallbackLabel:d,value:s??o??(0,n.Fl2)(S)})}const M=this.getItemStyle({...g,colorValue:S??g.colorValue},x,!1),k={shape:"square",fill:M.fill,fillOpacity:1,stroke:void 0,strokeWidth:0,strokeOpacity:1,lineDash:[0],lineDashOffset:0};(0,n.MBc)(k.fill)&&(k.fill={...k.fill,gradient:"linear",rotation:0,reverse:!1});const D=x?{marker:k}:void 0;return this.formatTooltipWithContext(p,{title:null==o?void 0:m[o],symbol:D,data:b},{seriesId:t,datum:m,title:void 0,depth:y,labelKey:o,secondaryLabelKey:r,childrenKey:l,sizeKey:h,sizeName:c,colorKey:d,colorName:u,...M})}computeFocusBounds(e){return EN.toCanvas(this.contentGroup,e.getBBox())}hasItemStylers(){return this.isSelectionEnabled()||null!=this.properties.itemStyler||null!=this.properties.tile.label.itemStyler||null!=this.properties.group.label.itemStyler}};return e.className="TreemapSeries",e.type="treemap",e})(),{treemapSeriesThemeableOptionsDef:_N}=s.n1,GN=(()=>({..._N,...(0,n.FFB)(n.XxK,["highlightStyle","highlight","selection","showInLegend"]),type:(0,n.mw3)((0,n.dYl)("treemap")),labelKey:n.YjP,secondaryLabelKey:n.YjP,childrenKey:n.YjP,sizeKey:n.YjP,colorKey:n.YjP,sizeName:n.YjP,colorName:n.YjP}))();GN.undocumentedGroupStrokes=(0,n._Le)((0,n.jk9)(n.yWT));var KN=(()=>({type:"series",name:"treemap",chartType:"standalone",enterprise:!0,solo:!0,version:s.xv,depen
vendor: 4,161 bytes, line 1
1dencies:[Py],options:GN,themeTemplate:{series:{fills:{$applyCycle:[{$size:{$path:["./data",{$path:"/data"}]}},{$palette:"fills"},{$applySwitch:[{$path:["/type",void 0,{$value:"$1"}]},{$value:"$1"},["gradient",n.Euh],["pattern",n.eu4],["image",n.pwE]]}]},strokes:{$applyCycle:[{$size:{$path:["./data",{$path:"/data"}]}},{$palette:"strokes"}]},colorScale:{fills:{$map:[{color:{$value:"$1"}},{$palette:"divergingColors"}]}},group:{label:{...n.mgV,enabled:!0,color:{$ref:"textColor"},fontStyle:void 0,fontWeight:{$ref:"fontWeight"},fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},spacing:4},fill:void 0,fills:{$palette:"hierarchyColors"},stroke:void 0,strokeWidth:1,padding:4,gap:2,textAlign:"left",highlight:{enabled:{$circular:{$path:"/highlight/enabled"}},unhighlightedItem:{opacity:.2,fillOpacity:.2,strokeOpacity:.2}}},tile:{label:{...n.mgV,enabled:!0,color:{$ref:"chartBackgroundColor"},fontStyle:void 0,fontWeight:{$ref:"fontWeight"},fontSize:{$rem:1.5},minimumFontSize:{$rem:n.q8q.SMALLER},fontFamily:{$ref:"fontFamily"},wrapping:"on-space",overflowStrategy:"ellipsis",spacing:2},secondaryLabel:{...n.mgV,enabled:!0,color:{$ref:"chartBackgroundColor"},fontStyle:void 0,fontWeight:void 0,fontSize:{$ref:"fontSize"},minimumFontSize:{$rem:n.q8q.SMALLER},fontFamily:{$ref:"fontFamily"},wrapping:"never",overflowStrategy:"ellipsis"},fill:void 0,stroke:void 0,strokeWidth:{$isUserOption:["../strokes/0",2,{$isUserOption:["./stroke",2,0]}]},padding:3,gap:1,highlight:{enabled:{$circular:{$path:"/highlight/enabled"}},unhighlightedItem:{fillOpacity:.6,strokeOpacity:.6},unhighlightedBranch:{fillOpacity:.2,strokeOpacity:.2}},selection:n.zg6},...(0,n.fs4)({undocumentedGroupStrokes:{$palette:"secondHierarchyColors"}})},legend:{enabled:{$and:[{$path:"../series/0/colorKey"},{$eq:[{$path:"../series/0/colorScale/mode"},"discrete"]}]}},gradientLegend:{enabled:{$and:[{$path:"../series/0/colorKey"},{$not:{$eq:[{$path:"../series/0/colorScale/mode"},"discrete"]}}]}}},create:e=>new WN(e)}))(),YN=[[q,Z,Q,U,X,J,ae],[s.jc,Yr,$l,Hx,lb,Lh,zh,rd,cu,up].flat(),Re,Ba,K,Ya,Qa,po,ko,wo,zo,Go,ky,Lp,Vg,fg,rm,ym,Im,ay].flat(),UN=["ohlc","line","step-line","hlc","high-low","candlestick","hollow-candlestick"],XN=[{icon:"trend-line-drawing",tooltip:"toolbarAnnotationsLineAnnotations",value:"line-menu"},{icon:"fibonacci-retracement-drawing",tooltip:"toolbarAnnotationsFibonacciAnnotations",value:"fibonacci-menu"},{icon:"text-annotation",tooltip:"toolbarAnnotationsTextAnnotations",value:"text-menu"},{icon:"arrow-drawing",tooltip:"toolbarAnnotationsShapeAnnotations",value:"shape-menu"},{icon:"measurer-drawing",tooltip:"toolbarAnnotationsMeasurerAnnotations",value:"measurer-menu"},{icon:"delete",tooltip:"toolbarAnnotationsClearAll",value:"clear"}];var ZN="range-area";function qN(e,t){return[{type:"candlestick",focusPriority:0,...e,...t}]}var{nW0:QN,KCM:JN,Fn1:eL,Xg7:tL,wAP:iL,w9K:nL,lO7:sL,fsm:aL,zVM:oL,oC3:rL,vjx:lL,xFO:hL,U4X:cL,yQs:dL}=n,uL={stroke:rL},pL={fill:QN},gL={color:"white",fill:rL},mL={color:rL},yL={color:dL,fontSize:{$rem:n.q8q.LARGE},fontFamily:{$ref:"fontFamily"}},fL={...yL,fontSize:{$ref:"fontSize"},color:JN,fill:nL,stroke:sL,strokeWidth:1,divider:{stroke:eL,strokeWidth:1,strokeOpacity:.5}},xL={...uL,background:{fill:oL,fillOpacity:.2},handle:{...pL},text:{...mL},statistics:{...fL}},bL={line:{...uL,handle:{...pL},text:{...mL}},"horizontal-line":{...uL,handle:{...pL},axisLabel:{...gL},text:{...mL}},"vertical-line":{...uL,handle:{...pL},axisLabel:{...gL},text:{...mL}},"disjoint-channel":{...uL,background:{fill:oL,fillOpacity:.2},handle:{...pL},text:{...mL}},"parallel-channel":{...uL,background:{fill:oL,fillOpacity:.2},handle:{...pL},text:{...mL}},"fibonacci-retracement":{...uL,strokes:aL,rangeStroke:rL,handle:{...pL},text:{...mL,position:"center"},label:{...yL,color:void 0,fontSize:{$rem:n.q8q.SMALLER}}},"fibonacci-retracement-trend-based":{...uL,strokes:aL,rangeStroke:rL,handle:{...pL},text:{...mL,position:"center"},label:{...yL,color:void 0,fontSize:{$rem:n.q8q.SMALLER}}},callout:{...uL,...yL,color:{$ref:"textColor"},handle:{...pL},fill:oL,fillOpacity:.2},comment:{...yL,color:"white",fontWeight:700,handle:{...pL},fill:rL}
1,note:{...yL,color:lL,fill:rL,stroke:{$ref:"chartBackgroundColor"},strokeWidth:1,strokeOpacity:1,handle:{...pL},background:{fill:hL,stroke:cL,strokeWidth:1}},text:{...yL,handle:{...pL}},arrow:{...uL,handle:{...pL},text:{...mL}},"arrow-up":{fill:{$palette:"up.fill"},handle:{...pL,stroke:rL}},"arrow-down":{fill:{$palette:"down.fill"},handle:{...pL,stroke:rL}},"date-range":{...xL},"price-range":{...xL},"date-price-range":{...xL},"quick-date-price-range":{up:{...uL,fill:oL,fillOpacity:.2,handle:{...pL},statistics:{...fL,color:"#fff",fill:oL,strokeWidth:0,divider:{stroke:"#fff",strokeWidth:1,strokeOpacity:.5}}},down:{...uL,stroke:iL,fill:tL,fillOpacity:.2,handle:{...pL,stroke:iL},statistics:{...fL,color:"#fff",fill:tL,strokeWidth:0,divider:{stroke:"#fff",strokeWidth:1,strokeOpacity:.5}}}},axesButtons:{enabled:!0}},vL=(()=>({chartType:(0,n.KCZ)("candlestick","hollow-candlestick","ohlc","line","step-line","hlc","high-low"),dateKey:n.YjP,openKey:n.YjP,highKey:n.YjP,lowKey:n.YjP,closeKey:n.YjP,volumeKey:n.YjP,navigator:n.zMY,volume:n.zMY,rangeButtons:n.zMY,statusBar:n.zMY,toolbar:n.zMY,zoom:n.zMY,sync:n.zMY,theme:n.swK,container:n.swK,width:n.swK,height:n.swK,minWidth:n.swK,minHeight:n.swK,listeners:n.swK,initialState:n.swK,title:n.swK,data:n.YOg,dataIdKey:n.YjP,dataSource:n.swK,formatter:n.swK,enableRtl:n.zMY}))();vL.overrideDevicePixelRatio=(0,n._Le)(n.LyW),vL.foreground=(0,n._Le)(n.swK);var SL=[{type:"preset",name:"price-volume",enterprise:!0,dependencies:[Qa,ym],version:s.xv,options:vL,create:function(e,t,i,n,s){const{dateKey:a="date",highKey:o="high",openKey:r="open",lowKey:l="low",closeKey:h="close",volumeKey:c="volume",chartType:d="candlestick",navigator:u=!1,volume:p=!0,rangeButtons:g=!0,statusBar:m=!0,toolbar:y=!0,zoom:f=!0,sync:x=!1,theme:b,data:v,formatter:S,...M}=e,k=function(e,t,i,n,s,a,o){const r={xKey:t,openKey:s,closeKey:a,highKey:i,lowKey:n},l={xKey:t,yKey:a},h={pickOutsideVisibleMinorAxis:!0};switch(e??"candlestick"){case"ohlc":return function(e,t){return[{type:"ohlc",focusPriority:0,...e,...t}]}(h,r);case"line":case"step-line":return function(e,t){return[{type:"line",focusPriority:0,...e,...t}]}(h,l);case"hlc":return function(e,t,{xKey:i,highKey:n,closeKey:s,lowKey:a}){return[{type:ZN,focusPriority:0,...e,xKey:i,yHighKey:n,yLowKey:s},{type:ZN,focusPriority:0,...e,xKey:i,yHighKey:s,yLowKey:a},{type:"line",...e,...t}]}(h,l,r);case"high-low":return function(e,{xKey:t,highKey:i,lowKey:n}){return[{type:"range-bar",...e,xKey:t,yHighKey:i,yLowKey:n,tooltip:{range:"nearest"},focusPriority:0}]}(h,r);case"candlestick":case"hollow-candlestick":return qN(h,r);default:return o.warnOnce(`unknown chart type: ${e}; expected one of: ${UN.join(", ")}`),qN(h,r)}}(d,a,o,l,r,h,s),D=function(e,t,i,n,s,a){return s?[{type:"bar",xKey:t,yKey:a,yKeyAxis:"yVolume",tooltip:{enabled:!1},simpleItemStyler(t){const{up:s,down:a}=e().palette;return{fill:t[i]<t[n]?s?.fill:a?.fill}},focusPriority:1,highlight:{unhighlightedSeries:{opacity:1}}}]:[]}(i,a,r,h,p,c),w=n?.common?.annotations?.toolbar?.buttons;return{animation:{enabled:!1},legend:{enabled:!1},series:[...D,...k],axes:{y:{type:"number",position:"right",crosshair:{enabled:!0,snap:!1},layoutConstraints:{stacked:!1,width:100,unit:"percent",align:"start"}},...p?{yVolume:{type:"number",position:"left",label:{enabled:!1},crosshair:{enabled:!1},gridLine:{enabled:!1},nice:!1,layoutConstraints:{stacked:!1,width:20,unit:"percent",align:"end"}}}:{},x:{type:"ordinal-time",position:"bottom",line:{enabled:!1},label:{enabled:!0},crosshair:{enabled:!0}}},tooltip:{enabled:!1},data:v,formatter:S,...{annotations:{enabled:y,optionsToolbar:{enabled:y},snap:!0,toolbar:{enabled:y,buttons:w??XN,padding:0},data:v,xKey:a,volumeKey:p?c:void 0}},...{navigator:{enabled:u,...p?{miniChart:{enabled:u,series:[{type:"line",xKey:a,yKey:c}]}}:null}},...m?{statusBar:{enabled:!0,highKey:o,openKey:r,lowKey:l,closeKey:h,volumeKey:p?c:void 0}}:null,...{zoom:{enabled:f}},...{ranges:{enabled:g&&f}},...x?{sync:{enabled:x}}:null,...M}},baseTheme:"ag-financial",themeTemplate:{common:{title:{padding:4},chartToolbar:{enabled:{$preset:["toolbar",!0]}},annotations:{...bL},ranges:{enableOutOfRange:!0,position:"bottom-left",fontSize:{$rem:[n.q8q.MEDIUM,"chromeFontSize"]},minSize:34},navigator:{height:40,minHandle:{height:46},maxHandle:{height:46},miniChart:{series:{$apply:{stroke:n.HHJ,marker:{enabled:!1}}}}},sync:{nodeInteraction:!0,zoom:!0},zoom:{autoScaling:{enabled:!0},onDataChange:{stickToEnd:!0},enableIndependentAxes:!0},axes:{number:{interval:{maxSpacing:45},label:{format:".2f",formatter:{$path:"/formatter"}}},category:{gridLine:{enabled:!0}},time:{gridLine:{enabled:!0}},"unit-time":{gridLine:{enabled:!0}},"ordinal-time":{gridLine:{enabled:!0}}},padding:{$applyPadding:{top:6,right:8,bottom:6,left:0}}},bar:{series:{fillOpacity:.5,highlight:{unhighlightedItem:{opacity:1},unhighlightedSeries:{opacity:1}}}}
1,candlestick:{series:{highlight:{unhighlightedItem:{opacity:1},unhighlightedSeries:{opacity:1}},item:{up:{fill:{$switch:[{$preset:"chartType"},$l.themeTemplate.series.item.up.fill,["hollow-candlestick","transparent"]]}}}}},line:{series:{marker:{enabled:!1},highlight:{unhighlightedSeries:{opacity:1}},stroke:{$switch:[{$preset:"chartType"},s.GT.themeTemplate.series.stroke,["hlc",{$palette:"altNeutral.stroke"}],["line",{$palette:"neutral.stroke"}],["step-line",{$palette:"neutral.stroke"}]]},strokeWidth:{$switch:[{$preset:"chartType"},s.GT.themeTemplate.series.strokeWidth,["hlc",2]]},interpolation:{$switch:[{$preset:"chartType"},s.GT.themeTemplate.series.interpolation,["step-line",{type:"step"}]]}}},ohlc:{series:{highlight:{unhighlightedItem:{opacity:1},unhighlightedSeries:{opacity:1}}}},"range-area":{series:{fillOpacity:.3,strokeWidth:2,highlight:{bringToFront:!1,unhighlightedItem:{opacity:1},unhighlightedSeries:{opacity:1}},fill:{$switch:[{$preset:"chartType"},rd.themeTemplate.series.fill,["hlc",{$if:[{$eq:[{$value:"$index"},1]},{$palette:"up.fill"},{$palette:"down.fill"}]}]]},stroke:{$switch:[{$preset:"chartType"},rd.themeTemplate.series.stroke,["hlc",{$if:[{$eq:[{$value:"$index"},1]},{$palette:"up.stroke"},{$palette:"down.stroke"}]}]]}}},"range-bar":{series:{highlight:{unhighlightedItem:{opacity:1},unhighlightedSeries:{opacity:1}},fill:{$switch:[{$preset:"chartType"},cu.themeTemplate.series.fill,["high-low",{$palette:"neutral.fill"}]]},stroke:{$switch:[{$preset:"chartType"},cu.themeTemplate.series.stroke,["high-low",{$palette:"neutral.stroke"}]]}}}}},s.Di,s.GT,$l,zh,cu,rd,Re,Ba,Ya,Qa,po,ko,wo,zo,ky,Lp,Vg,rm,Im,ay,ae,Q,q],ML=[yv,qI],kL=[s.Gq,H,B,ve,fe,Te,Bk,rw,mw,Uw,nI,Re,po,wo,ky,rm].flat(),DL=10,wL={topLeft:{x:-1,y:-1},topRight:{x:1,y:-1},bottomLeft:{x:-1,y:1},bottomRight:{x:1,y:1}},IL={"outside-outer":{x:-1,y:1},"outside-center":{x:0,y:1},"outside-inner":{x:1,y:1},"inside-outer-outer":{x:-1,y:-1},"inside-outer-center":{x:0,y:-1},"inside-outer-inner":{x:1,y:-1},"inside-center-outer":{x:-1,y:0},"inside-center":{x:0,y:0},"inside-center-inner":{x:1,y:0},"inside-inner-outer":{x:-1,y:1},"inside-inner-center":{x:0,y:1},"inside-inner-inner":{x:1,y:1}},AL=(e,t,i,n)=>({topLeft:e,topRight:t,bottomLeft:i,bottomRight:n}),CL=(()=>({"outside-outer":AL("top-left","top-right","bottom-left","bottom-right"),"outside-center":AL("top","top","bottom","bottom"),"outside-inner":AL("top-right","top-left","bottom-right","bottom-left"),"inside-outer-outer":AL("inside-top-left","inside-top-right","inside-bottom-left","inside-bottom-right"),"inside-outer-center":AL("inside-top","inside-top","inside-bottom","inside-bottom"),"inside-outer-inner":AL("inside-top-right","inside-top-left","inside-bottom-right","inside-bottom-left"),"inside-center-outer":AL("inside-left","inside-right","inside-left","inside-right"),"inside-center":AL("inside","inside","inside","inside"),"inside-center-inner":AL("inside-right","inside-left","inside-right","inside-left"),"inside-inner-outer":AL("inside-bottom-left","inside-bottom-right","inside-top-left","inside-top-right"),"inside-inner-center":AL("inside-bottom","inside-bottom","inside-top","inside-top"),"inside-inner-inner":AL("inside-bottom-right","inside-bottom-left","inside-top-right","inside-top-left")}))();function NL(e,t,i){return 0===t?0:e*t*i}function LL(e,t,i){const s=i?.position??t?.position??"inside-outer-outer",{spacing:a=DL,...o}=(0,n.HFk)(i,t)??{},r=wL[e],l=IL[s];return{...o,position:CL[s][e],xOffset:NL(a,l.x,r.x),yOffset:NL(a,l.y,r.y)}}function PL(e,t,i){const n=e.datum[e.xKey],s=e.datum[e.yKey];let a="bottom-left",o=2;return n>t&&s>i?(a="top-right",o=1):n>t?(a="bottom-right",o=3):s>i&&(a="top-left",o=0),{regionName:a,index:o}}var TL=(()=>({crosshairLabel:(0,n.KCZ)("crossing","edge"),label:(0,n.KCZ)("crossing","edge"),title:(0,n.KCZ)("crossing","edge")}))(),OL={x:n.r3t,y:n.r3t},RL=(()=>({border:n.swK,color:n.swK,cornerRadius:n.swK,enabled:n.swK,fontFamily:n.swK,fontSize:n.swK,fontStyle:n.swK,fontWeight:n.swK,fill:n.swK,fillOpacity:n.swK,padding:n.swK,position:(0,n.KCZ)("outside-outer","outside-center","outside-inner","inside-outer-outer","inside-outer-center","inside-outer-inner","inside-center-outer","inside-center","inside-center-inner","inside-inner-outer","inside-inner-center","inside-inner-inner"),rotation:n.swK,spacing:n.aig}))(),EL={fill:n.swK,fillOpacity:n.swK,label:{...RL,text:n.YjP},marker:n.swK,stroke:n.swK,strokeOpacity:n.swK,strokeWidth:n.swK},zL=(()=>({...(0,n.FFB)(s.n1.numberAxisOptionsDefs,["crossAt","crossLines","keys","reverse","position","type"])}))(),BL={alignAxesToPivot:n.zMY,axisPlacement:TL,pivot:OL,regions:{label:RL,bottomLeft:EL,bottomRight:EL,topLeft:EL,topRight:EL},xAxis:zL,yAxis:zL,cursor:n.swK,errorBar:n.swK,fill:n.swK,fillOpacity:n.swK,highlight:n.swK,itemStyler:n.swK,lineDash:n.swK,lineDashOffset:n.swK,label:n.swK,labelName:n.swK,labelKey:n.swK,maxRenderedItems:n.swK,maxSize:n.swK,minSize:n.swK,nodeClickRange:n.swK,styler:n.swK,shape:n.swK,size:n.swK,sizeKey:n.swK,sizeName:n.swK,stroke:n.swK,strokeOpacity:n.swK,strokeWidth:n.swK,tooltip:n.swK,xName:n.swK,xKey:n.swK,yName:n.swK,yKey:n.swK,animation:n.swK,container:n.swK,contextMenu:n.swK,context:()=>!0,data:n.YOg,dataIdKey:n.YjP,enableRtl:n.zMY,footnote:n.swK,formatter:n.swK,height:n.swK,initialState:n.swK,listeners:n.swK,locale:n.swK,minHeight:n.swK,minWidth:n.swK,padding:n.swK,selection:n.swK,subtitle:n.swK,title:n.swK,theme:n.swK,width:n.swK};BL.overrideDevicePixelRatio=(0,n._Le)(n.LyW);var FL={axes:{number:{label:{spacing:6}
1,line:{enabled:!0,width:1,stroke:{$foregroundBackgroundMix:.5}},tick:{enabled:!1}}},seriesArea:{backgroundRegions:{$apply:[{...h,fill:{$palette:"fill"},fillOpacity:.3,stroke:{$palette:"stroke"},label:{...h.label,fontWeight:"bold"}},c.$apply[1],c.$apply[2]]}},series:{fillOpacity:1}},VL=[{type:"preset",name:"quadrant",enterprise:!0,dependencies:[],version:s.xv,options:BL,create:function(e,t,i,s,a,o){const{alignAxesToPivot:r=!0,pivot:l,regions:h,xAxis:c,yAxis:d,context:u}=e,p=(0,n.UpN)(e,["animation","container","contextMenu","data","dataIdKey","dataSource","enableRtl","footnote","formatter","height","initialState","listeners","locale","minHeight","minWidth","overrideDevicePixelRatio","padding","selection","subtitle","title","theme","width"]),g=["cursor","errorBar","fill","fillOpacity","highlight","itemStyler","lineDash","lineDashOffset","label","labelName","labelKey","maxRenderedItems","nodeClickRange","styler","shape","stroke","strokeOpacity","strokeWidth","tooltip","xName","xKey","yName","yKey"],m=[...g,"size"],y=[...g,"maxSize","minSize","sizeKey","sizeName"],f=l?.x??0,x=l?.y??0,{marker:b,...v}=h?.topLeft??{},{marker:S,...M}=h?.topRight??{},{marker:k,...D}=h?.bottomLeft??{},{marker:w,...I}=h?.bottomRight??{},A={topLeft:{...v,label:LL("topLeft",h?.label,v.label),xRange:{axis:"x",end:f},yRange:{axis:"y",start:x}},topRight:{...M,label:LL("topRight",h?.label,M.label),xRange:{axis:"x",start:f},yRange:{axis:"y",start:x}},bottomLeft:{...D,label:LL("bottomLeft",h?.label,D.label),xRange:{axis:"x",end:f},yRange:{axis:"y",end:x}},bottomRight:{...I,label:LL("bottomRight",h?.label,I.label),xRange:{axis:"x",start:f},yRange:{axis:"y",end:x}}},C=t=>{const{regionName:i,index:s}=PL(t,f,x);let r=k;"top-right"===i?r=S:"bottom-right"===i?r=w:"top-left"===i&&(r=b);let l=(0,n.UpN)(t,["fillOpacity","lineDash","lineDashOffset","shape","size","strokeOpacity","strokeWidth"]);l={...l,...r};const h=o().resolvePartial(a,["seriesArea","backgroundRegions",`${s}`],l,{pick:!1});let c={...(0,n.UpN)(h,["fillOpacity","lineDash","lineDashOffset","shape","size","strokeOpacity","strokeWidth"]),stroke:r?.stroke??t.stroke??h.stroke,fill:r?.fill??t.fill??h.fill};return e.itemStyler&&(c={...c,...e.itemStyler({...t,...c,region:i})}),c},N=t=>{const{regionName:i}=PL(t,f,x);return e.tooltip?.renderer?.({...t,region:i})},L=e.label?.formatter?t=>{const{regionName:i}=PL(t,f,x);return e.label?.formatter?.({...t,region:i})}:void 0,P=e.label?.itemStyler?t=>{const{regionName:i}=PL(t,f,x);return e.label?.itemStyler?.({...t,region:i})}:void 0,T=e.label?.enabled??(null!=e.label||Boolean(e.labelKey)),O=[];null==e.sizeKey?O.push({...(0,n.UpN)(e,m),type:"scatter",context:u,itemStyler:C,tooltip:{...e.tooltip,renderer:N},label:{...e.label,enabled:T,formatter:L,itemStyler:P}}):O.push({minSize:e.size,...(0,n.UpN)(e,y),sizeKey:e.sizeKey,type:"bubble",context:u,itemStyler:C,tooltip:{...e.tooltip,renderer:N},label:{...e.label,enabled:T,formatter:L,itemStyler:P}});const R={x:{...c,type:"number",position:"bottom",context:u},y:{...d,type:"number",position:"left",context:u}};if(r){const t={titlePlacement:e.axisPlacement?.title??"edge",labelPlacement:e.axisPlacement?.label??"edge",crosshairLabelPlacement:e.axisPlacement?.crosshairLabel??"edge"};R.x.crossAt={value:x,...t},R.y.crossAt={value:f,...t}}return{...p,axes:R,context:u,series:O,seriesArea:{backgroundRegions:Object.values(A)}}},themeTemplate:{scatter:FL,bubble:FL},removeThemeSeriesKeys:["fill","stroke"]},q,s.SF,s.e8,Re,Ba,Ya,po,ko,wo,ky,Lp,Vg,rm,Im,ay],$L=[xS,NS,hM,zM,YM,rm],HL=[s.JK,YN,kL,$L,ML,SL,VL,bf,uC,xD,WC,fN,KN].flat();var jL={setLicenseKey(e){k.setLicenseKey(e)}};n.syG.setRegistryMode(n.syG.RegistryMode.Enterprise),n.dC9.styles=w,n.dC9.licenseManager=e=>new k(e),n.dC9.injectWatermark=D,n.dC9.createBackground=e=>new u(e),n.dC9.createForeground=e=>new p(e),n.dC9.createSeriesArea=e=>new x(e),n.dC9.seriesAreaThemeTemplate={backgroundRegions:c}},buQv(e,t,i){i.d(t,{ui:()=>l});var n=i("NhsO"),s=i("Vwos"),a=i("Q3ZI");function o(e,t,i){return{...s.ui.__validateOptionsArgument(e,`${i} \`options\` prop`),container:t.current}}function r(e,t){const i=(0,n.forwardRef)((function(i,s){const{options:r,modules:l,style:h,className:c}=i,d=(0,n.useRef)(null),u=(0,n.useRef)();(0,n.useLayoutEffect)((()=>{const i=e(o(r,d,t),{modules:l});return u.current=i,()=>{i.destroy()}}),[]);const p=void 0===u.current;return(0,n.useEffect)((()=>{p||u.current?.update(o(r,d,t)).catch((e=>a.error(e)))}),[r]),(0,n.useImperativeHandle)(s,(()=>u.current),[]),(0,n.useMemo)((()=>(0,n.createElement)("div",{ref:d,style:h,className:c})),[h,c])}));return i.displayName=t,i}var l=r(((e,t)=>s.ui.create(e,t)),"AgCharts")}}]); 2//# sourceMappingURL=ag-charts.vendor.809f6922c6b165022f3f.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.