UNPKG

igniteui-webcomponents-charts

Version:

Ignite UI Web Components charting components for building rich data visualizations using TypeScript APIs.

27,717 lines 881 kB
/*
THIS INFRAGISTICS ULTIMATE SOFTWARE LICENSE  AGREEMENT ("AGREEMENT") LOCATED HERE:
https://www.infragistics.com/legal/license/igultimate-la
https://www.infragistics.com/legal/license/igultimate-eula
GOVERNS THE LICENSING, INSTALLATION AND USE OF INFRAGISTICS SOFTWARE. BY DOWNLOADING AND/OR INSTALLING AND USING INFRAGISTICS SOFTWARE:  you are indicating that you have read and understand this Agreement, and agree to be legally bound by it on behalf of the yourself and your company.
*/
import { __extends, __generator, __values } from "tslib";
import { Control } from "igniteui-webcomponents-core";
import { INotifyPropertyChanged_$type, Base, Type, EventArgs, PropertyChangedEventArgs, IEnumerable_$type, callStaticConstructors, Point_$type, runOn, delegateCombine, fromEnum, delegateRemove, fromEn, typeCast, enumGetBox, EnumUtil, Boolean_$type, Number_$type, typeGetValue, toEnum, String_$type, markType, markDep, PointUtil, TypeRegistrar, Delegate_$type, Array_$type, Date_$type, getInstanceType } from "igniteui-webcomponents-core";
import { ILegendOwner_$type } from "igniteui-webcomponents-core";
import { IInternalLegendOwner_$type } from "igniteui-webcomponents-core";
import { IDataLegendTarget_$type } from "igniteui-webcomponents-core";
import { IToolbarTarget_$type } from "igniteui-webcomponents-core";
import { ISupportsAnimation_$type } from "igniteui-webcomponents-core";
import { SRProvider } from "igniteui-webcomponents-core";
import { HashSet$1 } from "igniteui-webcomponents-core";
import { IToolbarContextAccessor_$type } from "igniteui-webcomponents-core";
import { DVContainer } from "igniteui-webcomponents-core";
import { SeriesPlotAreaMarginHorizontalMode_$type } from "./SeriesPlotAreaMarginHorizontalMode";
import { SeriesPlotAreaMarginVerticalMode_$type } from "./SeriesPlotAreaMarginVerticalMode";
import { SeriesViewerScrollbarMode_$type } from "./SeriesViewerScrollbarMode";
import { DoubleAnimator } from "igniteui-webcomponents-core";
import { BrushCollection } from "igniteui-webcomponents-core";
import { DependencyProperty } from "igniteui-webcomponents-core";
import { DependencyObject } from "igniteui-webcomponents-core";
import { MarkerAutomaticBehavior_$type } from "./MarkerAutomaticBehavior";
import { IChartLegend_$type } from "igniteui-webcomponents-core";
import { SeriesHighlightingMode_$type } from "./SeriesHighlightingMode";
import { SeriesSelectionMode_$type } from "./SeriesSelectionMode";
import { SeriesSelectionBehavior_$type } from "./SeriesSelectionBehavior";
import { SeriesViewerHorizontalScrollbarPosition_$type } from "./SeriesViewerHorizontalScrollbarPosition";
import { SeriesViewerVerticalScrollbarPosition_$type } from "./SeriesViewerVerticalScrollbarPosition";
import { Brush } from "igniteui-webcomponents-core";
import { SeriesHighlightingBehavior_$type } from "./SeriesHighlightingBehavior";
import { LegendHighlightingMode_$type } from "./LegendHighlightingMode";
import { LegendItemBadgeShape_$type } from "igniteui-webcomponents-core";
import { LegendItemBadgeMode_$type } from "igniteui-webcomponents-core";
import { Rect } from "igniteui-webcomponents-core";
import { ChartHitTestMode_$type } from "./ChartHitTestMode";
import { InteractionState_$type } from "igniteui-webcomponents-core";
import { WindowResponse_$type } from "./WindowResponse";
import { Visibility_$type } from "igniteui-webcomponents-core";
import { SeriesViewerComponentsFromView } from "./SeriesViewerComponentsFromView";
import { ZoomCoercionMode_$type } from "./ZoomCoercionMode";
import { ModifierKeys_$type } from "igniteui-webcomponents-core";
import { SeriesHighlightedValuesDisplayMode_$type } from "igniteui-webcomponents-core";
import { DataTemplate } from "igniteui-webcomponents-core";
import { HorizontalAlignment_$type } from "igniteui-webcomponents-core";
import { CanvasRenderScheduler } from "igniteui-webcomponents-core";
import { SyncSettings } from "./SyncSettings";
import { PropertyMetadata } from "igniteui-webcomponents-core";
import { ICommandStateChangedListener_$type } from "igniteui-webcomponents-core";
import { List$1 } from "igniteui-webcomponents-core";
import { SeriesViewerComponentsForView } from "./SeriesViewerComponentsForView";
import { VersionQueueHelper } from "igniteui-webcomponents-core";
import { Dictionary$2 } from "igniteui-webcomponents-core";
import { IDataLegend_$type } from "igniteui-webcomponents-core";
import { PropertyUpdatedEventArgs } from "igniteui-webcomponents-core";
import { NotifyCollectionChangedEventArgs } from "igniteui-webcomponents-core";
import { ObservableCollection$1 } from "igniteui-webcomponents-core";
import { Size } from "igniteui-webcomponents-core";
import { FrameworkElement } from "igniteui-webcomponents-core";
import { MouseEventArgs } from "igniteui-webcomponents-core";
import { MouseButtonEventArgs } from "igniteui-webcomponents-core";
import { Tuple$2 } from "igniteui-webcomponents-core";
import { ScalerParams } from "./ScalerParams";
import { SeriesViewerManipulationEventArgs } from "./SeriesViewerManipulationEventArgs";
import { IFastItemsSource_$type } from "igniteui-webcomponents-core";
import { RectChangedEventArgs } from "igniteui-webcomponents-core";
import { MathUtil } from "igniteui-webcomponents-core";
import { DeviceUtils } from "igniteui-webcomponents-core";
import { RefreshCompletedEventArgs } from "./RefreshCompletedEventArgs";
import { Thickness } from "igniteui-webcomponents-core";
import { AxisTitlePosition_$type } from "./AxisTitlePosition";
import { FontInfo } from "igniteui-webcomponents-core";
import { CoercionInfo } from "./CoercionInfo";
import { FastItemsSource } from "igniteui-webcomponents-core";
import { FontUtil } from "igniteui-webcomponents-core";
import { IDataLegendSeries_$type } from "igniteui-webcomponents-core";
import { CaptureImageSettings } from "igniteui-webcomponents-core";
import { ImageCapturedEventArgs } from "igniteui-webcomponents-core";
import { truncate, intDivide, isNaN_, isInfinity, logBase, log10 } from "igniteui-webcomponents-core";
import { ChartContentType_$type } from "./ChartContentType";
import { defaultDVDateParse, dateNow } from "igniteui-webcomponents-core";
import { stringIsNullOrEmpty, stringEmpty, stringEndsWith, stringStartsWith, stringIsNullOrWhiteSpace } from "igniteui-webcomponents-core";
import { ISchedulableRender_$type } from "igniteui-webcomponents-core";
import { Rectangle } from "igniteui-webcomponents-core";
import { Path } from "igniteui-webcomponents-core";
import { Line } from "igniteui-webcomponents-core";
import { RenderingContext } from "igniteui-webcomponents-core";
import { TextBlock } from "igniteui-webcomponents-core";
import { ITileZoomTile_$type } from "./ITileZoomTile";
import { DOMExecutionContext } from "igniteui-webcomponents-core";
import { RenderSurface } from "./RenderSurface";
import { PathFigureCollection } from "igniteui-webcomponents-core";
import { PathFigure } from "igniteui-webcomponents-core";
import { LineSegment } from "igniteui-webcomponents-core";
import { PathGeometry } from "igniteui-webcomponents-core";
import { GeometryGroup } from "igniteui-webcomponents-core";
import { DataContext } from "igniteui-webcomponents-core";
import { LabelPanelsArrangeState } from "./LabelPanelsArrangeState";
import { MarkerTemplates } from "./MarkerTemplates";
import { DataTemplateRenderInfo } from "igniteui-webcomponents-core";
import { DataTemplateMeasureInfo } from "igniteui-webcomponents-core";
import { AxisLabelsLocation_$type } from "./AxisLabelsLocation";
import { IProvidesViewport_$type } from "./IProvidesViewport";
import { ArgumentNullException } from "igniteui-webcomponents-core";
import { ActualLegendItemBadgeShape_$type } from "./ActualLegendItemBadgeShape";
import { CanvasViewRenderer } from "igniteui-webcomponents-core";
import { Defaults } from "./Defaults";
import { EllipseGeometry } from "igniteui-webcomponents-core";
import { DataTemplatePassInfo } from "igniteui-webcomponents-core";
import { BrushUtil } from "igniteui-webcomponents-core";
import { LegendItemHelper } from "igniteui-webcomponents-core";
import { DomWrapper_$type } from "igniteui-webcomponents-core";
import { PointerTooltipStyle } from "./PointerTooltipStyle";
import { DefaultPaletteInfo } from "./DefaultPaletteInfo";
import { CssGradientUtil } from "igniteui-webcomponents-core";
import { AxisDefaults } from "./AxisDefaults";
import { BrushUtilCore } from "igniteui-webcomponents-core";
import { AxisRange } from "./AxisRange";
import { LinearNumericSnapper } from "./LinearNumericSnapper";
import { AxisAnnotationCollection } from "./AxisAnnotationCollection";
import { VerticalAlignment_$type } from "igniteui-webcomponents-core";
import { Canvas } from "igniteui-webcomponents-core";
import { IFastItemsSourceProvider_$type } from "igniteui-webcomponents-core";
import { DoubleCollection } from "igniteui-webcomponents-core";
import { LabelPosition } from "./LabelPosition";
import { BindingFormatter } from "igniteui-webcomponents-core";
import { LabelFontHeuristics } from "./LabelFontHeuristics";
import { Pool$1 } from "igniteui-webcomponents-core";
import { AxisComponentsFromView } from "./AxisComponentsFromView";
import { FastReflectionHelper } from "igniteui-webcomponents-core";
import { AxisRangeChangedEventArgs } from "./AxisRangeChangedEventArgs";
import { RectangleGeometry } from "igniteui-webcomponents-core";
import { PathRenderingInfo } from "./PathRenderingInfo";
import { LineGeometry } from "igniteui-webcomponents-core";
import { RenderRequestedEventArgs } from "./RenderRequestedEventArgs";
import { CategoryMode_$type } from "./CategoryMode";
import { GridMode_$type } from "./GridMode";
import { Panel } from "igniteui-webcomponents-core";
import { UIElement } from "igniteui-webcomponents-core";
import { RectUtil } from "igniteui-webcomponents-core";
import { TickmarkValues } from "./TickmarkValues";
import { TransformGroup } from "igniteui-webcomponents-core";
import { RotateTransform } from "igniteui-webcomponents-core";
import { TranslateTransform } from "igniteui-webcomponents-core";
import { AngleSimplifier } from "igniteui-webcomponents-core";
import { TransformMatrixHelpler } from "igniteui-webcomponents-core";
import { ICategoryScaler_$type } from "./ICategoryScaler";
import { AxisRangeBufferMode_$type } from "./AxisRangeBufferMode";
import { NumericAxisRenderingParameters } from "./NumericAxisRenderingParameters";
import { LogarithmicTickmarkValues } from "./LogarithmicTickmarkValues";
import { LinearTickmarkValues } from "./LinearTickmarkValues";
import { CategoryAxisRenderingParameters } from "./CategoryAxisRenderingParameters";
import { TickmarkValuesInitializationParameters } from "./TickmarkValuesInitializationParameters";
import { NumberAbbreviatorFactory } from "./NumberAbbreviatorFactory";
import { AutomaticSeriesPurpose_$type } from "./AutomaticSeriesPurpose";
import { SeriesMatcher } from "./SeriesMatcher";
import { Stack$1 } from "igniteui-webcomponents-core";
import { RenderValidEventArgs } from "./RenderValidEventArgs";
import { ArrayExtension } from "igniteui-webcomponents-core";
import { SeriesLayerPropertyOverlayValueResolvingEventArgs } from "./SeriesLayerPropertyOverlayValueResolvingEventArgs";
import { PlatformAPIHelper } from "igniteui-webcomponents-core";
import { Marker } from "./Marker";
import { ContentControl } from "igniteui-webcomponents-core";
import { AutoMarginsAndAngleUpdateMode_$type } from "./AutoMarginsAndAngleUpdateMode";
import { ComputedPlotAreaMarginMode_$type } from "./ComputedPlotAreaMarginMode";
import { PolygonUtil } from "igniteui-webcomponents-core";
import { ILegendSeries_$type } from "igniteui-webcomponents-core";
import { ILegendSeriesInternal_$type } from "igniteui-webcomponents-core";
import { ILegendTemplateProvider_$type } from "igniteui-webcomponents-core";
import { PenLineJoin_$type } from "igniteui-webcomponents-core";
import { PenLineCap_$type } from "igniteui-webcomponents-core";
import { Color } from "igniteui-webcomponents-core";
import { SeriesVisibleRangeMode_$type } from "./SeriesVisibleRangeMode";
import { SeriesOutlineMode_$type } from "./SeriesOutlineMode";
import { TransitionInSpeedType_$type } from "./TransitionInSpeedType";
import { TransitionOutSpeedType_$type } from "./TransitionOutSpeedType";
import { SeriesHitTestMode_$type } from "./SeriesHitTestMode";
import { SeriesComponentsForView } from "./SeriesComponentsForView";
import { Binding } from "igniteui-webcomponents-core";
import { MarkerOutlineMode_$type } from "./MarkerOutlineMode";
import { MarkerFillMode_$type } from "./MarkerFillMode";
import { SeriesPointOfInterest } from "./SeriesPointOfInterest";
import { FastItemColumn } from "igniteui-webcomponents-core";
import { TransitionOutCompletedEventArgs } from "./TransitionOutCompletedEventArgs";
import { IChartItemLegend_$type } from "igniteui-webcomponents-core";
import { SeriesComponentsFromView } from "./SeriesComponentsFromView";
import { DataLegendSeriesValueInfo } from "igniteui-webcomponents-core";
import { DataLegendSeriesContext } from "igniteui-webcomponents-core";
import { MarkerType_$type } from "./MarkerType";
import { Style } from "igniteui-webcomponents-core";
import { FastItemsSourceReference } from "igniteui-webcomponents-core";
import { stringFormat } from "igniteui-webcomponents-core";
import { EasingFunctions } from "igniteui-webcomponents-core";
/**
 * @hidden
 */
var SeriesViewer = /** @class */ /*@__PURE__*/ (function (_super) {
    __extends(SeriesViewer, _super);
    function SeriesViewer() {
        var _this = _super.call(this) || this;
        _this._widget = null;
        _this.c9 = null;
        _this.ds = null;
        _this.an = null;
        _this.gp = new List$1(ICommandStateChangedListener_$type, 0);
        _this._commandCompleted = null;
        _this._invalidateActions = null;
        _this.gm = null;
        _this.a8 = null;
        _this.ba = null;
        _this.eb = false;
        _this.ea = false;
        _this.c1 = null;
        _this.br = new SeriesCollection();
        _this.i0 = 0;
        _this.bz = 0;
        _this.b1 = 0;
        _this._skipDataCleanup = false;
        _this.db = null;
        _this.dd = null;
        _this.da = null;
        _this.dc = null;
        _this.ar = null;
        _this.v7 = null;
        _this.plotAreaMouseLeftButtonDown = null;
        _this.plotAreaMouseLeftButtonUp = null;
        _this.plotAreaClicked = null;
        _this.plotAreaMouseEnter = null;
        _this.plotAreaMouseLeave = null;
        _this.plotAreaMouseOver = null;
        _this.cf = 0;
        _this.cg = 0;
        _this.bu = 1;
        _this.b7 = 1;
        _this.b3 = 3;
        _this.propertyChanged = null;
        _this.propertyUpdated = null;
        _this.jf = null;
        _this.d6 = false;
        _this.seriesCursorMouseMove = null;
        _this.seriesMouseLeftButtonDown = null;
        _this.seriesMouseLeftButtonUp = null;
        _this.seriesClick = null;
        _this.seriesMouseMove = null;
        _this.seriesMouseEnter = null;
        _this.seriesMouseLeave = null;
        _this.d0 = false;
        _this.dz = false;
        _this.wg = Rect.empty;
        _this.we = Rect.empty;
        _this.dx = true;
        _this.wd = null;
        _this.eg = false;
        _this.iz = 30;
        _this.fq = false;
        _this.ei = false;
        _this.cc = new SeriesViewerComponentsForView();
        _this.d4 = false;
        _this.at = 0;
        _this.as = 1;
        _this.seriesAnimating = null;
        _this.du = new VersionQueueHelper();
        _this.d3 = false;
        _this.d1 = false;
        _this.cv = 0;
        _this.d8 = false;
        _this.eq = false;
        _this.dy = false;
        _this.mm = null;
        _this.viewerManipulationStarting = null;
        _this.viewerManipulationEnding = null;
        _this.ee = false;
        _this.d9 = false;
        _this.windowRectChanged = null;
        _this.sizeChanged = null;
        _this.e1 = false;
        _this.actualWindowRectChanged = null;
        _this.gridAreaRectChanged = null;
        _this.es = false;
        _this.g2 = 0.0001;
        _this.g1 = 0.0001;
        _this._syncChannel = null;
        _this.cm = null;
        _this.gb = false;
        _this.ed = false;
        _this.e0 = false;
        _this.gh = false;
        _this.cq = 1;
        _this.w1 = null;
        _this.i2 = 0;
        _this.bq = null;
        _this.ec = false;
        _this.gc = false;
        _this.wf = Rect.empty;
        _this._selectedSeriesItems = null;
        _this._focusedSeriesItems = null;
        _this.selectedSeriesItemsChanged = null;
        _this.focusedSeriesItemsChanged = null;
        _this.gw = new Date();
        _this.gk = false;
        _this.refreshCompleted = null;
        _this.jk = null;
        _this.jj = null;
        _this.vi = null;
        _this.vh = null;
        _this.hh = NaN;
        _this.hf = NaN;
        _this.hg = NaN;
        _this.he = NaN;
        _this.hd = NaN;
        _this.hb = NaN;
        _this.hc = NaN;
        _this.ha = NaN;
        _this.jh = null;
        _this.al = null;
        _this.am = null;
        _this.ak = null;
        _this.d7 = false;
        _this.dw = false;
        _this._syncSettings = null;
        _this.destroyed = false;
        _this.je = null;
        _this.gl = new Dictionary$2(String_$type, Base.$, 0);
        _this.fo = false;
        _this.hi = NaN;
        _this.g7 = NaN;
        _this.g9 = NaN;
        _this.g5 = NaN;
        _this.g4 = 30;
        _this.g3 = NaN;
        _this.d2 = true;
        _this.g8 = NaN;
        _this.g6 = NaN;
        _this.ji = null;
        _this.gy = 1;
        _this.gx = NaN;
        _this.wc = null;
        _this.ez = false;
        _this.gz = 0;
        _this.g0 = 0;
        _this.sk = null;
        _this.az = null;
        _this.e4 = false;
        _this.e5 = false;
        _this.e2 = false;
        _this.d5 = false;
        _this.i1 = 0;
        _this.eo = false;
        _this.e8 = false;
        _this.seriesDataUpdated = null;
        _this.gq = new List$1(IDataLegend_$type, 0);
        _this.dv = null;
        _this.seriesDataChanged = null;
        _this.gt = null;
        _this.imageCaptured = null;
        DVContainer.instance.registerIfLoaded("AnnotationFactoryManager");
        DVContainer.instance.registerIfLoaded("InteractivityFactoryManager");
        DVContainer.instance.registerIfLoaded("DataChartToolbarFactoryManager");
        DVContainer.instance.registerIfLoaded("VisualDataFactoryManager");
        _this.wc = Rect.empty;
        _this.v7 = { $type: Point_$type, x: NaN, y: NaN };
        _this.gw = dateNow();
        _this.e4 = false;
        _this.e5 = false;
        _this.al = new CanvasRenderScheduler();
        _this.al.a = runOn(_this, _this.nn);
        _this.am = new CanvasRenderScheduler();
        _this.ak = new CanvasRenderScheduler();
        SeriesViewer.wu = new Rect(0, 0, 0, 1, 1);
        _this.syncSettings = ((function () {
            var $ret = new SyncSettings();
            $ret.synchronizeHorizontally = true;
            $ret.synchronizeVertically = true;
            return $ret;
        })());
        _this.c9 = _this.c8();
        _this.qe(_this.c9);
        _this.c9.c4();
        _this.rv();
        _this.n8();
        _this.actualSyncLink = new SyncLink();
        _this.r2(null, _this.actualSyncLink);
        _this.ar = new ChartContentManager(_this);
        _this.propertyUpdated = delegateCombine(_this.propertyUpdated, function (a, b) { return _this.qq(a, b.propertyName, b.oldValue, b.newValue); });
        _this.selectedSeriesItems = new ChartSelectedItemCollection();
        var a = _this.selectedSeriesItems;
        a.collectionChanged = delegateCombine(a.collectionChanged, runOn(_this, _this.p1));
        var b = _this.selectedSeriesItems;
        b.collectionResetting = delegateCombine(b.collectionResetting, runOn(_this, _this.ri));
        _this.focusedSeriesItems = new ChartSelectedItemCollection();
        var c = _this.focusedSeriesItems;
        c.collectionChanged = delegateCombine(c.collectionChanged, runOn(_this, _this.pe));
        var d = _this.focusedSeriesItems;
        d.collectionResetting = delegateCombine(d.collectionResetting, runOn(_this, _this.n1));
        var e = _this.series;
        e.collectionChanged = delegateCombine(e.collectionChanged, runOn(_this, _this.rk));
        var f = _this.series;
        f.collectionResetting = delegateCombine(f.collectionResetting, runOn(_this, _this.rl));
        _this.dc = new DoubleAnimator(0, 1, _this.ja);
        _this.db = new DoubleAnimator(0, 1, _this.i9);
        var g = _this.db;
        g.propertyChanged = delegateCombine(g.propertyChanged, runOn(_this, _this.n7));
        _this.dd = new DoubleAnimator(0, 1, _this.jc);
        _this.da = new DoubleAnimator(0, 1, _this.i6);
        var h = _this.dd;
        h.propertyChanged = delegateCombine(h.propertyChanged, runOn(_this, _this.rj));
        var i = _this.da;
        i.propertyChanged = delegateCombine(i.propertyChanged, runOn(_this, _this.n2));
        _this.c9.bx();
        _this.oa();
        _this.n9();
        return _this;
    }
    Object.defineProperty(SeriesViewer.prototype, "widget", {
        get: function () {
            return this._widget;
        },
        set: function (a) {
            this._widget = a;
        },
        enumerable: false,
        configurable: true
    });
    SeriesViewer.staticInit = function () {
        SeriesViewer.wu = new Rect(0, 0, 0, 1, 1);
    };
    Object.defineProperty(SeriesViewer.prototype, "dt", {
        get: function () {
            if (this.ds == null) {
                this.ds = new SRProvider(this.c9.j.ae);
            }
            return this.ds;
        },
        enumerable: false,
        configurable: true
    });
    SeriesViewer.prototype.ao = function (a) {
        if (this.an == null) {
            this.an = new AutomaticSeriesManager(this);
        }
        return this.an;
    };
    SeriesViewer.prototype.getDesiredToolbarActions = function () {
        if (!this.fi) {
            return null;
        }
        return this.a9.getDesiredToolbarActions(this);
    };
    SeriesViewer.prototype.onToolCommandExecuting = function (a) {
        if (!this.fi) {
            return 1;
        }
        return this.a9.onToolCommandExecuting(this, a);
    };
    SeriesViewer.prototype.addCommandAvailabilityListener = function (a) {
    };
    SeriesViewer.prototype.removeCommandAvailabilityListener = function (a) {
    };
    SeriesViewer.prototype.addCommandStateChangedListener = function (a) {
        if (!this.gp.contains(a)) {
            this.gp.add(a);
        }
    };
    SeriesViewer.prototype.removeCommandStateChangedListener = function (a) {
        if (this.gp.contains(a)) {
            this.gp.remove(a);
        }
    };
    Object.defineProperty(SeriesViewer.prototype, "commandCompleted", {
        get: function () {
            return this._commandCompleted;
        },
        set: function (a) {
            this._commandCompleted = a;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(SeriesViewer.prototype, "invalidateActions", {
        get: function () {
            return this._invalidateActions;
        },
        set: function (a) {
            this._invalidateActions = a;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(SeriesViewer.prototype, "gn", {
        get: function () {
            return this.gm;
        },
        enumerable: false,
        configurable: true
    });
    SeriesViewer.prototype.provideContextAccessor = function (a) {
        if (this.gm == null) {
            this.gm = new HashSet$1(IToolbarContextAccessor_$type, 0);
        }
        this.gm.add_1(a);
    };
    SeriesViewer.prototype.dismissContextAccessor = function (a) {
        if (this.gm == null) {
            return;
        }
        this.gm.remove(a);
    };
    SeriesViewer.prototype.od = function () {
        if (this.invalidateActions != null) {
            this.invalidateActions();
        }
    };
    Object.defineProperty(SeriesViewer.prototype, "a9", {
        get: function () {
            var _this = this;
            if (this.a8 == null) {
                this.a8 = DVContainer.instance.createInstance(IDataChartToolbarProvider_$type, function () { return _this.dt.n; });
                this.a8.container = this.c9.bi;
            }
            return this.a8;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(SeriesViewer.prototype, "fi", {
        get: function () {
            return DVContainer.instance.checkLoaded("DataChartToolbarFactoryManager");
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(SeriesViewer.prototype, "bb", {
        get: function () {
            var _this = this;
            if (this.ba == null) {
                this.ba = DVContainer.instance.createInstance(ISeriesViewerInteractionManager_$type, function () { return _this.dt.n; });
            }
            return this.ba;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(SeriesViewer.prototype, "fa", {
        get: function () {
            return DVContainer.instance.checkLoaded("InteractivityFactoryManager");
        },
        enumerable: false,
        configurable: true
    });
    SeriesViewer.prototype.ri = function (a, b) {
        for (var c = 0; c < this.selectedSeriesItems.count; c++) {
            this.pk(this.selectedSeriesItems._inner[c]);
        }
    };
    SeriesViewer.prototype.n1 = function (a, b) {
        for (var c = 0; c < this.focusedSeriesItems.count; c++) {
            this.pj(this.focusedSeriesItems._inner[c]);
        }
    };
    SeriesViewer.prototype.p1 = function (a, b) {
        if (b.action == 4 && b.newItems == null && b.oldItems == null) {
            return;
        }
        if (this.eb) {
            return;
        }
        if (b.oldItems != null) {
            for (var c = 0; c < b.oldItems.count; c++) {
                var d = b.oldItems.item(c);
                this.pk(d);
            }
        }
        if (b.newItems != null) {
            for (var e = 0; e < b.newItems.count; e++) {
                var f = b.newItems.item(e);
                f.g(this);
            }
            for (var g = 0; g < b.newItems.count; g++) {
                var h = b.newItems.item(g);
                this.pm(h);
            }
        }
        var i = new ChartSelectedItemCollection();
        if (b.oldItems != null) {
            for (var j = 0; j < b.oldItems.count; j++) {
                i.add(b.oldItems.item(j));
            }
        }
        var k = new ChartSelectedItemCollection();
        if (b.newItems != null) {
            for (var l = 0; l < b.newItems.count; l++) {
                k.add(b.newItems.item(l));
            }
        }
        var m = this.selectedSeriesItems;
        this.p0(this, new SeriesViewerSelectedSeriesItemsChangedEventArgs(i, k, m));
    };
    SeriesViewer.prototype.pe = function (a, b) {
        if (b.action == 4 && b.newItems == null && b.oldItems == null) {
            return;
        }
        if (this.ea) {
            return;
        }
        if (b.oldItems != null) {
            for (var c = 0; c < b.oldItems.count; c++) {
                var d = b.oldItems.item(c);
                this.pj(d);
            }
        }
        if (b.newItems != null) {
            for (var e = 0; e < b.newItems.count; e++) {
                var f = b.newItems.item(e);
                this.pl(f);
            }
        }
        var g = new ChartSelectedItemCollection();
        if (b.oldItems != null) {
            for (var h = 0; h < b.oldItems.count; h++) {
                g.add(b.oldItems.item(h));
            }
        }
        var i = new ChartSelectedItemCollection();
        if (b.newItems != null) {
            for (var j = 0; j < b.newItems.count; j++) {
                i.add(b.newItems.item(j));
            }
        }
        var k = this.selectedSeriesItems;
        this.pd(this, new SeriesViewerSelectedSeriesItemsChangedEventArgs(g, i, k));
    };
    SeriesViewer.prototype.pl = function (a) {
        this.n3(function (b) {
            var c = a;
            if (c.series != null && c.series != b) {
                return;
            }
            b.pt(c.item);
        });
    };
    SeriesViewer.prototype.pj = function (a) {
        this.n3(function (b) {
            var c = a;
            if (c.series != null && c.series != b) {
                return;
            }
            b.pr(c.item);
        });
    };
    SeriesViewer.prototype.n3 = function (a) {
        var e_1, _a;
        try {
            for (var _b = __values(fromEnum(this.series)), _c = _b.next(); !_c.done; _c = _b.next()) {
                var b = _c.value;
                a(b);
                if (b.isStacked) {
                    b.p5(function (c) {
                        a(c);
                        if (c.ei) {
                            c.p3(function (d) {
                                a(d);
                                return true;
                            });
                        }
                        return true;
                    });
                }
                if (b.ei) {
                    b.p3(function (c) {
                        a(c);
                        return true;
                    });
                }
            }
        }
        catch (e_1_1) {
            e_1 = { error: e_1_1 };
        }
        finally {
            try {
                if (_c && !_c.done && (_a = _b.return))
                    _a.call(_b);
            }
            finally {
                if (e_1)
                    throw e_1.error;
            }
        }
    };
    SeriesViewer.prototype.pm = function (a) {
        this.n3(function (b) {
            var c = a;
            if (c.series != null && c.series != b) {
                return;
            }
            if (c.item == null) {
                b.pz();
            }
            else {
                b.pu(c.item);
            }
        });
    };
    SeriesViewer.prototype.pk = function (a) {
        this.n3(function (b) {
            var c = a;
            if (c.series != null && c.series != b) {
                return;
            }
            if (c.item == null) {
                b.px();
            }
            else {
                b.ps(c.item);
            }
        });
    };
    SeriesViewer.prototype.n8 = function () {
        if (this.c1 != null && this.c2 == null) {
            var a = this.c2;
            a.thumbnailSizeChanged = delegateRemove(a.thumbnailSizeChanged, runOn(this, this.qm));
        }
        if (this.c2 != null) {
            var b = this.c2;
            b.thumbnailSizeChanged = delegateCombine(b.thumbnailSizeChanged, runOn(this, this.qm));
        }
        if (this.ji != null) {
            this.c2.backgroundImageUri = this.ji;
        }
        if (this.c2 != null) {
            this.c2.initializeScalingRatio(this.hk);
        }
        if (this.c1 == null && this.c2 != null) {
            this.or();
        }
        this.c1 = this.c2;
    };
    SeriesViewer.prototype.qm = function (a, b) {
        var e_2, _a;
        this.c2.surfaceIsDirty = true;
        try {
            for (var _b = __values(fromEnum(this.series)), _c = _b.next(); !_c.done; _c = _b.next()) {
                var c = _c.value;
                c.g1 = true;
            }
        }
        catch (e_2_1) {
            e_2 = { error: e_2_1 };
        }
        finally {
            try {
                if (_c && !_c.done && (_a = _b.return))
                    _a.call(_b);
            }
            finally {
                if (e_2)
                    throw e_2.error;
            }
        }
    };
    SeriesViewer.prototype.get_ft = function () {
        return false;
    };
    Object.defineProperty(SeriesViewer.prototype, "ft", {
        get: function () {
            return this.get_ft();
        },
        enumerable: false,
        configurable: true
    });
    SeriesViewer.prototype.get_fs = function () {
        return false;
    };
    Object.defineProperty(SeriesViewer.prototype, "fs", {
        get: function () {
            return this.get_fs();
        },
        enumerable: false,
        configurable: true
    });
    SeriesViewer.prototype.n9 = function () {
        this.c9.co();
        if (this.c2 != null) {
            this.c2.initializeScalingRatio(this.hk);
        }
    };
    Object.defineProperty(SeriesViewer.prototype, "series", {
        get: function () {
            return this.br;
        },
        enumerable: false,
        configurable: true
    });
    SeriesViewer.prototype.rk = function (a, b) {
        var e_3, _a, e_4, _b, e_5, _c, e_6, _d;
        var c = this.eo;
        this.eo = this.eu();
        if (b.oldItems != null) {
            var d = this.i0;
            try {
                for (var _e = __values(fromEn(b.oldItems)), _f = _e.next(); !_f.done; _f = _e.next()) {
                    var e = _f.value;
                    if (e != null && e.eq) {
                        this.i0--;
                        if (this.i0 < 0) {
                            this.i0 = 0;
                        }
                    }
                    e.c4 = null;
                    e.dc = null;
                    this.rc(e);
                    this.c9.dy(e);
                }
            }
            catch (e_3_1) {
                e_3 = { error: e_3_1 };
            }
            finally {
                try {
                    if (_f && !_f.done && (_a = _e.return))
                        _a.call(_e);
                }
                finally {
                    if (e_3)
                        throw e_3.error;
                }
            }
            if (this.i0 < d) {
                try {
                    for (var _g = __values(fromEnum(this.series)), _h = _g.next(); !_h.done; _h = _g.next()) {
                        var f = _h.value;
                        if (f.eu) {
                            continue;
                        }
                        f.pw();
                    }
                }
                catch (e_4_1) {
                    e_4 = { error: e_4_1 };
                }
                finally {
                    try {
                        if (_h && !_h.done && (_b = _g.return))
                            _b.call(_g);
                    }
                    finally {
                        if (e_4)
                            throw e_4.error;
                    }
                }
            }
        }
        if (b.newItems != null) {
            var g = this.i0;
            try {
                for (var _j = __values(fromEn(b.newItems)), _k = _j.next(); !_k.done; _k = _j.next()) {
                    var h = _k.value;
                    if (h != null && h.eq) {
                        this.i0++;
                    }
                    if (!this.c9.aq(h)) {
                        this.rw(h);
                        this.c9.bp(h);
                        h.dc = this;
                        h.c4 = this.actualSyncLink;
                        h.st();
                    }
                }
            }
            catch (e_5_1) {
                e_5 = { error: e_5_1 };
            }
            finally {
                try {
                    if (_k && !_k.done && (_c = _j.return))
                        _c.call(_j);
                }
                finally {
                    if (e_5)
                        throw e_5.error;
                }
            }
            if (this.i0 > g) {
                try {
                    for (var _l = __values(fromEnum(this.series)), _m = _l.next(); !_m.done; _m = _l.next()) {
                        var i = _m.value;
                        if (i.eu || b.newItems.contains(i)) {
                            continue;
                        }
                        i.pw();
                    }
                }
                catch (e_6_1) {
                    e_6 = { error: e_6_1 };
                }
                finally {
                    try {
                        if (_m && !_m.done && (_d = _l.return))
                            _d.call(_l);
                    }
                    finally {
                        if (e_6)
                            throw e_6.error;
                    }
                }
            }
        }
        if (this.eo != c && !this.wz.isEmpty) {
            this.qp(this.wz, this.wz);
        }
        this.oq();
        this.oz();
        this.ph();
        this.ok();
    };
    Object.defineProperty(SeriesViewer.prototype, "b0", {
        get: function () {
            return this.bz;
        },
        set: function (a) {
            this.bz = a;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(SeriesViewer.prototype, "b2", {
        get: function () {
            return this.b1;
        },
        set: function (a) {
            this.b1 = a;
        },
        enumerable: false,
        configurable: true
    });
    SeriesViewer.prototype.ob = function () {
        this.oz();
    };
    SeriesViewer.prototype.oz = function () {
    };
    Object.defineProperty(SeriesViewer.prototype, "skipDataCleanup", {
        get: function () {
            return this._skipDataCleanup;
        },
        set: function (a) {
            this._skipDataCleanup = a;
        },
        enumerable: false,
        configurable: true
    });
    SeriesViewer.prototype.rc = function (a) {
        if (!this.skipDataCleanup) {
            if (typeCast(Series.$, a) !== null) {
                a.itemsSource = null;
            }
            else if (typeCast(CategoryAxisBase.$, a) !== null) {
                a.itemsSource = null;
            }
        }
        this.re(a.name, true);
    };
    Object.defineProperty(SeriesViewer.prototype, "ew", {
        get: function () {
            return this.i0 > 0;
        },
        enumerable: false,
        configurable: true
    });
    SeriesViewer.prototype.rl = function (a, b) {
        var e_7, _a;
        this.eo = this.eu();
        try {
            for (var _b = __values(fromEnum(this.series)), _c = _b.next(); !_c.done; _c = _b.next()) {
                var c = _c.value;
                c.c4 = null;
                c.dc = null;
                this.rc(c);
                this.c9.dy(c);
            }
        }
        catch (e_7_1) {
            e_7 = { error: e_7_1 };
        }
        finally {
            try {
                if (_c && !_c.done && (_a = _b.return))
                    _a.call(_b);
            }
            finally {
                if (e_7)
                    throw e_7.error;
            }
        }
        this.i0 = 0;
        this.ok();
    };
    SeriesViewer.prototype.of = function (a, b, c, d) {
        var e = this.wz;
        var f = e.width;
        var g = e.height;
        var h = 1;
        var i = a / b;
        if (isNaN_(h)) {
            return {
                p0: a,
                p1: b
            };
        }
        if (isNaN_(i) || c || d || Math.abs(h - i) > 0.0001) {
            if (c && d) {
                if (a > b) {
                    b = a / h;
                }
                else {
                    a = b * h;
                }
            }
            else if (c) {
                b = a / h;
            }
            else {
                a = b * h;
            }
        }
        if (b > 1) {
            var j = 1 / b;
            b = 1;
            a = a * j;
        }
        if (a > 1) {
            var k = 1 / a;
            a = 1;
            b = b * k;
        }
        return {
            p0: a,
            p1: b
        };
    };
    SeriesViewer.prototype.eu = function () {
        return false;
    };
    Object.defineProperty(SeriesViewer.prototype, "f8", {
        get: function () {
            return this.fj;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(SeriesViewer.prototype, "e6", {
        get: function () {
            return this.ba != null;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(SeriesViewer.prototype, "en", {
        get: function () {
            return this.ba != null;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(SeriesViewer.prototype, "em", {
        get: function () {
            return this.cf != 0 || this.cg != 0;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(SeriesViewer.prototype, "el", {
        get: function () {
            return this.en && this.em;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(SeriesViewer.prototype, "dk", {
        get: function () {
            var a = this.bb.f$e;
            if (a.executionContext == null) {
                a.executionContext = this.c9.l();
            }
            if (a.ensureAnimator == null) {
                a.ensureAnimator = runOn(this, this.nx);
            }
            a.dismissHighlightDelay = this.i8;
            return a;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(SeriesViewer.prototype, "dl", {
        get: function () {
            var a = this.bb.f$f;
            if (a.executionContext == null) {
                a.executionContext = this.c9.l();
            }
            if (a.ensureAnimator == null) {
                a.ensureAnimator = runOn(this, this.ny);
            }
            return a;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(SeriesViewer.prototype, "dj", {
        get: function () {
            var a = this.bb.f$d;
            if (a.executionContext == null) {
                a.executionContext = this.c9.l();
            }
            if (a.ensureAnimator == null) {
                a.ensureAnimator = runOn(this, this.nw);
            }
            return a;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(SeriesViewer.prototype, "bc", {
        get: function () {
            var a = this.bb.f$b;
            if (a.executionContext == null) {
                a.executionContext = this.c9.l();
            }
            if (a.animator == null) {
                a.animator = this.dc;
                a.owner = this;
            }
            return a;
        },
        enumerable: false,
        configurable: true
    });
    SeriesViewer.prototype.nx = function () {
        {
            var a = this.db;
            if (!a.f() && a.r > 0) {
                a.v();
            }
            if (a.r == 0) {
                var b = this.ge(1);
                while (b) {
                    b = this.ge(0);
                    b = this.ge(1);
                }
            }
        }
    };
    SeriesViewer.prototype.ny = function () {
        {
            var a = this.dd;
            if (!a.f() && a.r > 0) {
                a.v();
            }
            if (a.r == 0) {
                var b = this.gf(1);
                while (b) {
                    b = this.gf(0);
                    b = this.gf(1);
                }
            }
        }
    };
    SeriesViewer.prototype.nw = function () {
        {
            var a = this.da;
            if (!a.f() && a.r > 0) {
                a.v();
            }
            if (a.r == 0) {
                var b = this.gd(1);
                while (b) {
                    b = this.gd(0);
                    b = this.gd(1);
                }
            }
        }
    };
    SeriesViewer.prototype.n7 = function (a, b) {
        this.ge(this.db.o);
    };
    SeriesViewer.prototype.rj = function (a, b) {
        this.gf(this.dd.o);
    };
    SeriesViewer.prototype.n2 = function (a, b) {
        this.gd(this.da.o);
    };
    SeriesViewer.prototype.ge = function (a) {
        var b = this.dk.tick(a);
        if (a == 1 && b && this.db.r > 0) {
            this.db.v();
        }
        var c = this.dk.dirtyContexts;
        if (this.dk.allDirty) {
            var d = this.series;
            for (var e = 0; e < d.count; e++) {
                var f = d._inner[e];
                f.q6();
            }
        }
        else {
            for (var g = 0; g < c.count; g++) {
                var h = c._inner[g];
                h.q6();
            }
        }
        if (!b) {
            this.db.w();
            this.pg();
        }
        return b;
    };
    SeriesViewer.prototype.gf = function (a) {
        var b = this.dl.tick(a);
        if (a == 1 && b && this.dd.r > 0) {
            this.dd.v();
        }
        var c = this.dl.dirtyContexts;
        if (this.dl.allDirty) {
            var d = this.series;
            for (var e = 0; e < d.count; e++) {
                var f = d._inner[e];
                f.q6();
            }
        }
        else {
            for (var g = 0; g < c.count; g++) {
                var h = c._inner[g];
                h.q6();
            }
        }
        if (!b) {
            this.dd.w();
        }
        return b;
    };
    SeriesViewer.prototype.gd = function (a) {
        var b = this.dj.tick(a);
        if (a == 1 && b && this.da.r > 0) {
            this.da.v();
        }
        var c = this.dj.dirtyContexts;
        if (this.dj.allDirty) {
            var d = this.series;
            for (var e = 0; e < d.count; e++) {
                var f = d._inner[e];
                f.q6();
            }
        }
        else {
            for (var g = 0; g < c.count; g++) {
                var h = c._inner[g];
                h.q6();
            }
        }
        if (!b) {
            this.da.w();
        }
        return b;
    };
    SeriesViewer.prototype.n6 = function () {
        this.c9.ck();
        this.n5();
        for (var a = 0; a < this.series.count; a++) {
            if (this.series._inner[a].eu) {
                this.series._inner[a].p9();
            }
        }
    };
    SeriesViewer.prototype.vn = function (a) {
        return this.vm(this.ag, a);
    };
    SeriesViewer.prototype.vt = function (a) {
        return this.vm(this.aj, a);
    };
    SeriesViewer.prototype.vr = function (a) {
        return this.vm(this.ah, a);
    };
    SeriesViewer.prototype.vs = function (a) {
        return this.vm(this.ai, a);
    };
    SeriesViewer.prototype.vm = function (a, b) {
        if (a == null || a.count == 0) {
            return null;
        }
        else {
            return a.item(b % a.count);
        }
    };
    Object.defineProperty(SeriesViewer.prototype, "v8", {
        get: function () {
            return this.v7;
        },
        set: function (a) {
            if (PointUtil.notEquals(this.v7, a)) {
                var b = this.v7;
                this.v7 = a;
                this.qv("CrosshairPoint", b, this.v7);
            }
        },
        enumerable: false,
        configurable: true
    });
    SeriesViewer.prototype.q8 = function () {
    };
    Object.defineProperty(SeriesViewer.prototype, "e9", {
        get: function () {
            return this.c0 == 1 || this.c0 == 2 || this.c0 == 3;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(SeriesViewer.prototype, "legend", {
        get: function () {
            return this.c(SeriesViewer.tp);
        },
        set: function (a) {
            this.h(SeriesViewer.tp, a);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(SeriesViewer.prototype, "ej", {
        get: function () {
            return this.c(SeriesViewer.sm);
        },
        set: function (a) {
            this.h(SeriesViewer.sm, a);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(SeriesViewer.prototype, "f2", {
        get: function () {
            return this.c(SeriesViewer.ud);
        },
        set: function (a) {
            this.h(SeriesViewer.ud, a);
        },
        enumerable: false,
        configurable: true
    });
    SeriesViewer.prototype.pw = function (a, b) {
        this.d6 = false;
        var c = false;
        c = false;
        if (this.c9.k.al) {
            return;
        }
        if (this.plotAreaMouseLeftButtonDown != null) {
            var d = this.bh(a, b, c);
            this.plotAreaMouseLeftButtonDown(this, d);
        }
    };
    SeriesViewer.prototype.bh = function (a, b, c) {
        var d = { $type: Point_$type, x: a.x, y: a.y };
        var e = { $type: Point_$type, x: a.x, y: a.y };
        if (!this.wz.isEmpty) {
            if (c) {
                e.x -= this.wz.left;
                e.y -= this.wz.top;
            }
            else {
                d.x += this.wz.left;
                d.y += this.wz.top;
            }
        }
        var f = new PlotAreaMouseButtonEventArgs(this, d, e);
        f.manipulationOccurred = this.d6;
        return f;
    };
    SeriesViewer.prototype.bl = function (a, b, c) {
        var d = { $type: Point_$type, x: a.x, y: a.y };
        var e = { $type: Point_$type, x: a.x, y: a.y };
        if (!this.wz.isEmpty) {
            if (c) {
                e.x -= this.wz.left;
                e.y -= this.wz.top;
            }
            else {
                d.x += this.wz.left;
                d.y += this.wz.top;
            }
        }
        var f = new PlotAreaMouseEventArgs(this, d, e);
        return f;
    };
    SeriesViewer.prototype.px = function (a, b, c) {
        var d = false;
        d = false;
        if (this.c9.k.al) {
            return;
        }
        if (this.plotAreaMouseLeftButtonUp != null) {
            var e = this.bh(a, b, d);
            this.plotAreaMouseLeftButtonUp(this, e);
        }
        if (!this.d6 && !c) {
            if (this.plotAreaClicked != null) {
                var f = this.bh(a, b, d);
                this.plotAreaClicked(this, f);
            }
        }
        this.d6 = false;
    };
    Object.defineProperty(SeriesViewer.prototype, "fj", {
        get: function () {
            return this.c(SeriesViewer.tl);
        },
        set: function (a) {
            this.h(SeriesViewer.tl, a);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(SeriesViewer.prototype, "f7", {
        get: function () {
            return this.c(SeriesViewer.ug);
        },
        set: function (a) {
            this.h(SeriesViewer.ug, a);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(SeriesViewer.prototype, "by", {
        get: function () {
            return EnumUtil.getEnumValue(SeriesHighlightingMode_$type, this.c(SeriesViewer.s3));
        },
        set: function (a) {
            this.h(SeriesViewer.s3, enumGetBox(SeriesHighlightingMode_$type, a));
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(SeriesViewer.prototype, "cb", {
        get: function () {
            return EnumUtil.getEnumValue(SeriesSelectionMode_$type, this.c(SeriesViewer.ua));
        },
        set: function (a) {
            this.h(SeriesViewer.ua, enumGetBox(SeriesSelectionMode_$type, a));
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(SeriesViewer.prototype, "b6", {
        get: function () {
            return EnumUtil.getEnumValue(SeriesSelectionBehavior_$type, this.c(SeriesViewer.t7));
        },
        set: function (a) {
            this.h(SeriesViewer.t7, enumGetBox(SeriesSelectionBehavior_$type, a));
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(SeriesViewer.prototype, "b9", {
        get: function () {
            return EnumUtil.getEnumValue(SeriesSelectionMode_$type, this.c(SeriesViewer.sw));
        },
        set: function (a) {
            this.h(SeriesViewer.sw, enumGetBox(SeriesSelectionMode_$type, a));
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(SeriesViewer.prototype, "ch", {
        get: function () {
            return EnumUtil.getEnumValue(SeriesViewerScrollbarMode_$type, this.c(SeriesViewer.tb));
        },
        set: function (a) {
            this.h(SeriesViewer.tb, enumGetBox(SeriesViewerScrollbarMode_$type, a));
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(SeriesViewer.prototype, "ci", {
        get: function () {
            return EnumUtil.getEnumValue(SeriesViewerScrollbarMode_$type, this.c(SeriesViewer.uu));
        },
        set: function (a) {
            this.h(SeriesViewer.uu, enumGetBox(SeriesViewerScrollbarMode_$type, a));
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(SeriesViewer.prototype, "ce", {
        get: function () {
            return EnumUtil.getEnumValue(SeriesViewerHorizontalScrollbarPosition_$type, this.c(SeriesViewer.td));
        },
        set: function (a) {
            this.h(SeriesViewer.td, enumGetBox(SeriesViewerHorizontalScrollbarPosition_$type, a));
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(SeriesViewer.prototype, "cl", {
        get: function () {
            return EnumUtil.getEnumValue(SeriesViewerVerticalScrollbarPosition_$type, this.c(SeriesViewer.uw));
        },
        set: function (a) {
            this.h(SeriesViewer.uw, enumGetBox(SeriesViewerVerticalScrollbarPosition_$type, a));
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(SeriesViewer.prototype, "vv", {
        get: function () {
            return this.c(SeriesViewer.s7);
        },
        set: function (a) {
            this.h(SeriesViewer.s7, a);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(SeriesViewer.prototype, "vw", {
        get: function () {
            return this.c(SeriesViewer.tc);
        },
        set: function (a) {
            this.h(SeriesViewer.tc, a);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(SeriesViewer.prototype, "h0", {
        get: function () {
            return this.c(SeriesViewer.tf);
        },
        set: function (a) {
            this.h(SeriesViewer.tf, a);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(SeriesViewer.prototype, "hz", {
        get: function () {
            return this.c(SeriesViewer.ta);
        },
        set: function (a) {
            this.h(SeriesViewer.ta, a);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(SeriesViewer.prototype, "hw", {
        get: function () {
            return this.c(SeriesViewer.s6);
        },
        set: function (a) {
            this.h(SeriesViewer.s6, a);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(SeriesViewer.prototype, "hx", {
        get: function () {
            return this.c(SeriesViewer.s8);
        },
        set: function (a) {
            this.h(SeriesViewer.s8, a);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(SeriesViewer.prototype, "hy", {
        get: function () {
            return this.c(SeriesViewer.s9);
        },
        set: function (a) {
            this.h(SeriesViewer.s9, a);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(SeriesViewer.prototype, "h2", {
        get: function () {
            return this.c(SeriesViewer.th);
        },
        set: function (a) {
            this.h(SeriesViewer.th, a);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(SeriesViewer.prototype, "h1", {
        get: function () {
            return this.c(SeriesViewer.tg);
        },
        set: function (a) {
            this.h(SeriesViewer.tg, a);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(SeriesViewer.prototype, "ey", {
        get: function () {
            return this.c(SeriesViewer.te);
        },
        set: function (a) {
            this.h(SeriesViewer.te, a);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(SeriesViewer.prototype, "v5", {
        get: function () {
            return this.c(SeriesViewer.ur);
        },
        set: function (a) {
            this.h(SeriesViewer.ur, a);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(SeriesViewer.prototype, "v6", {
        get: function () {
            return this.c(SeriesViewer.uv);
        },
        set: function (a) {
            this.h(SeriesViewer.uv, a);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(SeriesViewer.prototype, "io", {
        get: function () {
            return this.c(SeriesViewer.uy);
        },
        set: function (a) {
            this.h(SeriesViewer.uy, a);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(SeriesViewer.prototype, "im", {
        get: function () {
            return this.c(SeriesViewer.ut);
        },
        set: function (a) {
            this.h(SeriesViewer.ut, a);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(SeriesViewer.prototype, "ik", {
        get: function () {
            return this.c(SeriesViewer.uq);
        },
        set: function (a) {
            this.h(SeriesViewer.uq, a);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(SeriesViewer.prototype, "ir", {
        get: function () {
            return this.c(SeriesViewer.u1);
        },
        set: function (a) {
            this.h(SeriesViewer.u1, a);
        },
        enumerable: false,
        configurable: true
    });
    SeriesViewer.prototype.nn = function () {
        if (!this.al.g && !this.al.f && !this.c9.a.g && !this.c9.a.f) {
            this.pz();
        }
    };
    SeriesViewer.prototype.pz = function () {
        this.nl();
    };
    Object.defineProperty(SeriesViewer.prototype, "il", {
        get: function () {
            return this.c(SeriesViewer.us);
        },
        set: function (a) {
            this.h(SeriesViewer.us, a);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(SeriesViewer.prototype, "iq", {
        get: function () {
            return this.c(SeriesViewer.u0);
        },
        set: function (a) {
            this.h(SeriesViewer.u0, a);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(SeriesViewer.prototype, "ip", {
        get: function () {
            return this.c(SeriesViewer.uz);
        },
        set: function (a) {
            this.h(SeriesViewer.uz, a);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(SeriesViewer.prototype, "gj", {
        get: function () {
            return this.c(SeriesViewer.ux);
        },
        set: function (a) {
            this.h(SeriesViewer.ux, a);
        },
        enumerable: false,
        configurable: true
    });
    SeriesViewer.prototype.ca = function () {
        if (this.cb == 0) {
            return 1;
        }
        return this.cb;
    };
    SeriesViewer.prototype.b5 = function () {
        if (this.b6 == 0) {
            return 3;
        }
        return this.b6;
    };
    SeriesViewer.prototype.bx = function () {
        if (this.bw == 0) {
            return 1;
        }
        if (this.by == 3 || this.by == 5) {
            if (this.bw == 2) {
                return 4;
            }
        }
        return this.bw;
    };
    Object.defineProperty(SeriesViewer.prototype, "bv", {
        get: function () {
            return this.bu;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(SeriesViewer.prototype, "b8", {
        get: function () {
            return this.b7;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(SeriesViewer.prototype, "b4", {
        get: function () {
            return this.b3;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(SeriesViewer.prototype, "bw", {
        get: function () {
            return EnumUtil.getEnumValue(SeriesHighlightingBehavior_$type, this.c(SeriesViewer.s1));
        },
        set: function (a) {
            this.h(SeriesViewer.s1, enumGetBox(SeriesHighlightingBehavior_$type, a));
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(SeriesViewer.prototype, "bd", {
        get: function () {
            return EnumUtil.getEnumValue(LegendHighlightingMode_$type, this.c(SeriesViewer.tm));
        },
        set: function (a) {
            this.h(SeriesViewer.tm, enumGetBox(LegendHighlightingMode_$type, a));
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(SeriesViewer.prototype, "bf", {
        get: function () {
            return EnumUtil.getEnumValue(LegendItemBadgeShape_$type, this.c(SeriesViewer.to));
        },
        set: function (a) {
            this.h(SeriesViewer.to, enumGetBox(LegendItemBadgeShape_$type, a));
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(SeriesViewer.prototype, "be", {
        get: function () {
            return EnumUtil.getEnumValue(LegendItemBadgeMode_$type, this.c(SeriesViewer.tn));
        },
        set: function (a) {
            this.h(SeriesViewer.tn, enumGetBox(LegendItemBadgeMode_$type, a));
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(SeriesViewer.prototype, "ev", {
        get: function () {
            return this.c(SeriesViewer.st);
        },
        set: function (a) {
            this.h(SeriesViewer.st, a);
        },
        enumerable: false,
        configurable: true
    });
    SeriesViewer.prototype.qv = function (a, b, c) {
        if (this.propertyChanged != null) {
            this.propertyChanged(this, new PropertyChangedEventArgs(a));
        }
        if (this.propertyUpdated != null) {
            this.propertyUpdated(this, new PropertyUpdatedEventArgs(a, b, c));
        }
    };
    SeriesViewer.prototype.pn = function () {
        this.po(this.series);
    };
    SeriesViewer.prototype.po = function (a) {
        var e_8, _a;
        try {
            for (var _b = __values(fromEn(a)), _c = _b.next(); !_c.done; _c = _b.next()) {
                var b = _c.value;
                var c = b.a5;
                if (c == null) {
                    continue;
                }
                var d = b.sy;
                if (d == null) {
                    continue;
                }
                if (c.containsChild(d)) {
                    c.removeChild(d);
                }
                if (!c.containsChild(d) && b.legendItemVisibility != 1) {
                    c.addChildInOrder(d, b);
                }
            }
        }
        catch (e_8_1) {
            e_8 = { error: e_8_1 };
        }
        finally {
            try {
                if (_c && !_c.done && (_a = _b.return))
                    _a.call(_b);
            }
            finally {
                if (e_8)
                    throw e_8.error;
            }
        }
    };
    SeriesViewer.prototype.p4 = function (a, b, c, d) {
        this.q1(a, b, typeCast(MouseEventArgs.$, c), d);
    };
    SeriesViewer.prototype.p8 = function (a, b, c, d) {
        this.q5(a, b, typeCast(MouseEventArgs.$, c), d);
    };
    SeriesViewer.prototype.p5 = function (a, b, c, d) {
        this.q2(a, b, typeCast(MouseEventArgs.$, c), d);
    };
    SeriesViewer.prototype.p6 = function (a, b, c, d) {
        this.q3(a, b, typeCast(MouseButtonEventArgs.$, c), d);
    };
    SeriesViewer.prototype.p7 = function (a, b, c, d) {
        var e = typeCast(MouseButtonEventArgs.$, c);
        if (e != null) {
            this.q4(a, b, typeCast(MouseButtonEventArgs.$, c), d);
        }
        if (e != null) {
            if (!this.d6) {
                this.qy(a, b, typeCast(MouseButtonEventArgs.$, c), d);
            }
        }
    };
    SeriesViewer.prototype.nd = function (a, b) {
        return null;
    };
    Object.defineProperty(SeriesViewer.prototype, "fp", {
        get: function () {
            return this.d6;
        },
        enumerable: false,
        configurable: true
    });
    SeriesViewer.prototype.oy = function (a, b) {
        if (!this.d0 && a) {
            this.nq({ $type: Point_$type, x: NaN, y: NaN });
            this.d0 = true;
            this.d6 = true;
            if (this.ev) {
                this.bb.f$y(this, b);
            }
            if (this.viewerManipulationStarting != null) {
                var c = new SeriesViewerManipulationEventArgs();
                c.isDragZoom = true;
                this.viewerManipulationStarting(this, c);
            }
        }
    };
    SeriesViewer.prototype.ow = function (a, b) {
        if (!this.dz && a) {
            this.nq({ $type: Point_$type, x: NaN, y: NaN });
            this.dz = true;
            this.d6 = true;
            if (this.ev) {
                this.bb.f$y(this, b);
            }
            if (this.viewerManipulationStarting != null) {
                var c = new SeriesViewerManipulationEventArgs();
                c.isDragSelect = true;
                this.viewerManipulationStarting(this, c);
            }
        }
    };
    SeriesViewer.prototype.p9 = function (a, b, c, d) {
    };
    SeriesViewer.prototype.qa = function (a, b, c, d) {
    };
    SeriesViewer.prototype.qz = function (a, b) {
        if (this.seriesCursorMouseMove != null && this.eq) {
            this.seriesCursorMouseMove(this, new ChartCursorEventArgs(this, a, b));
        }
    };
    SeriesViewer.prototype.q3 = function (a, b, c, d) {
        if (this.seriesMouseLeftButtonDown != null) {
            this.seriesMouseLeftButtonDown(this, new DataChartMouseButtonEventArgs(this, a, b, c, d));
        }
    };
    SeriesViewer.prototype.q4 = function (a, b, c, d) {
        if (this.seriesMouseLeftButtonUp != null) {
            this.seriesMouseLeftButtonUp(this, new DataChartMouseButtonEventArgs(this, a, b, c, d));
        }
    };
    SeriesViewer.prototype.qy = function (a, b, c, d) {
        var e = false;
        if (this.seriesClick != null) {
            var f = new DataChartMouseButtonEventArgs(this, a, b, c, d);
            this.seriesClick(this, f);
            e = f.cancelSelection;
        }
        if (a.isStacked) {
            return;
        }
        if (!e) {
            this.p2(a, b);
        }
    };
    SeriesViewer.prototype.p2 = function (a, b) {
        if (b != null && this.b8 != 1) {
            if (a != null) {
                if (!a.eg(b)) {
                    return;
                }
                if (a.bo != null) {
                    if (a.dp != null) {
                        var c = a.dp.indexOf(b);
                        if (c >= 0 && a.bo.dp != null) {
                            b = a.bo.dp.item(c);
                            a = a.bo;
                        }
                    }
                }
            }
            var d = this.gs(a, b, this.b4);
            d = this.gu(d, this.b4);
            var e = this.gr(this.selectedSeriesItems, d, this.b4);
            for (var f = 0; f < e.count; f++) {
                this.selectedSeriesItems.remove(e._inner[f]);
            }
            for (var g = 0; g < d.count; g++) {
                this.selectedSeriesItems.add(d._inner[g]);
            }
        }
    };
    SeriesViewer.prototype.gu = function (a, b) {
        var e_9, _a, e_10, _b;
        var c = new List$1(ChartSelection.$, 0);
        var d = new List$1(ChartSelection.$, 0);
        try {
            for (var _c = __values(fromEnum(a)), _d = _c.next(); !_d.done; _d = _c.next()) {
                var e = _d.value;
                if (this.selectedSeriesItems.contains(e)) {
                    c.add(e);
                }
                else {
                    d.add(e);
                }
            }
        }
        catch (e_9_1) {
            e_9 = { error: e_9_1 };
        }
        finally {
            try {
                if (_d && !_d.done && (_a = _c.return))
                    _a.call(_c);
            }
            finally {
                if (e_9)
                    throw e_9.error;
            }
        }
        try {
            for (var _e = __values(fromEnum(c)), _f = _e.next(); !_f.done; _f = _e.next()) {
                var f = _f.value;
                this.selectedSeriesItems.remove(f);
            }
        }
        catch (e_10_1) {
            e_10 = { error: e_10_1 };
        }
        finally {
            try {
                if (_f && !_f.done && (_b = _e.return))
                    _b.call(_e);
            }
            finally {
                if (e_10)
                    throw e_10.error;
            }
        }
        return d;
    };
    SeriesViewer.prototype.gv = function (a, b) {
        var c = new List$1(ChartSelection.$, 0);
        for (var d = 0; d < a.count; d++) {
            if (!this.fc(d, a, b)) {
                c.add(a._inner[d]);
            }
        }
        return c;
    };
    SeriesViewer.prototype.fc = function (a, b, c) {
        var d = b._inner[a];
        switch (c) {
            case 1: return d.series != null;
            case 2:
                if (d.series != null) {
                    return true;
                }
                for (var e = a + 1; e < b.count; e++) {
                    if (!Base.equalsStatic(d.item, b._inner[e].item)) {
                        return true;
                    }
                }
                return false;
            case 3: return d.series == null || d.item == null;
            case 4:
                if (d.series == null || d.item == null) {
                    return true;
                }
                for (var f = a + 1; f < b.count; f++) {
                    if (d.series == b._inner[f].series && !Base.equalsStatic(d.item, b._inner[f].item)) {
                        return true;
                    }
                }
                return false;
            case 5:
                if (d.series == null || d.item == null) {
                    return true;
                }
                for (var g = a + 1; g < b.count; g++) {
                    if (d.series != b._inner[g].series && !Base.equalsStatic(d.item, b._inner[g].item)) {
                        return true;
                    }
                }
                return false;
            case 6: return d.item != null;
            case 7:
                if (d.item != null) {
                    return true;
                }
                for (var h = a + 1; h < b.count; h++) {
                    if (d.series != b._inner[h].series) {
                        return true;
                    }
                }
                return false;
        }
        return false;
    };
    SeriesViewer.prototype.gr = function (a, b, c) {
        var e_11, _a;
        var d = new List$1(ChartSelection.$, 0);
        var e = new HashSet$1(ChartSelection.$, 0);
        try {
            for (var _b = __values(fromEnum(b)), _c = _b.next(); !_c.done; _c = _b.next()) {
                var f = _c.value;
                this.n4(a, e, d, f, c);
            }
        }
        catch (e_11_1) {
            e_11 = { error: e_11_1 };
        }
        finally {
            try {
                if (_c && !_c.done && (_a = _b.return))
                    _a.call(_b);
            }
            finally {
                if (e_11)
                    throw e_11.error;
            }
        }
        return d;
    };
    SeriesViewer.prototype.n4 = function (a, b, c, d, e) {
        var e_12, _a, e_13, _b, e_14, _c, e_15, _d, e_16, _e, e_17, _f, e_18, _g;
        switch (e) {
            case 1:
                try {
                    for (var _h = __values(fromEnum(a)), _j = _h.next(); !_j.done; _j = _h.next()) {
                        var f = _j.value;
                        if (f.series != null) {
                            if (!b.contains(f)) {
                                b.add_1(f);
                                c.add(f);
                            }
                        }
                    }
                }
                catch (e_12_1) {
                    e_12 = { error: e_12_1 };
                }
                finally {
                    try {
                        if (_j && !_j.done && (_a = _h.return))
                            _a.call(_h);
                    }
                    finally {
                        if (e_12)
                            throw e_12.error;
                    }
                }
                break;
            case 2:
                try {
                    for (var _k = __values(fromEnum(a)), _l = _k.next(); !_l.done; _l = _k.next()) {
                        var g = _l.value;
                        if (g.series != null || (g.item != null && !Base.equalsStatic(g.item, d.item))) {
                            if (!b.contains(g)) {
                                b.add_1(g);
                                c.add(g);
                            }
                        }
                    }
                }
                catch (e_13_1) {
                    e_13 = { error: e_13_1 };
                }
                finally {
                    try {
                        if (_l && !_l.done && (_b = _k.return))
                            _b.call(_k);
                    }
                    finally {
                        if (e_13)
                            throw e_13.error;
                    }
                }
                break;
            case 3:
                try {
                    for (var _m = __values(fromEnum(a)), _o = _m.next(); !_o.done; _o = _m.next()) {
                        var h = _o.value;
                        if (h.item == null) {
                            if (!b.contains(h)) {
                                b.add_1(h);
                                c.add(h);
                            }
                        }
                    }
                }
                catch (e_14_1) {
                    e_14 = { error: e_14_1 };
                }
                finally {
                    try {
                        if (_o && !_o.done && (_c = _m.return))
                            _c.call(_m);
                    }
                    finally {
                        if (e_14)
                            throw e_14.error;
                    }
                }
                break;
            case 4:
                try {
                    for (var _p = __values(fromEnum(a)), _q = _p.next(); !_q.done; _q = _p.next()) {
                        var i = _q.value;
                        if (i.item == null || (i.series == d.series && i.item != null && !Base.equalsStatic(i.item, d.item))) {
                            if (!b.contains(i)) {
                                b.add_1(i);
                                c.add(i);
                            }
                        }
                    }
                }
                catch (e_15_1) {
                    e_15 = { error: e_15_1 };
                }
                finally {
                    try {
                        if (_q && !_q.done && (_d = _p.return))
                            _d.call(_p);
                    }
                    finally {
                        if (e_15)
                            throw e_15.error;
                    }
                }
                break;
            case 5:
                try {
                    for (var _r = __values(fromEnum(a)), _t = _r.next(); !_t.done; _t = _r.next()) {
                        var j = _t.value;
                        if (j.item == null || (j.series != null && j.series != d.series) || (j.item != null && !Base.equalsStatic(j.item, d.item))) {
                            if (!b.contains(j)) {
                                b.add_1(j);
                                c.add(j);
                            }
                        }
                    }
                }
                catch (e_16_1) {
                    e_16 = { error: e_16_1 };
                }
                finally {
                    try {
                        if (_t && !_t.done && (_e = _r.return))
                            _e.call(_r);
                    }
                    finally {
                        if (e_16)
                            throw e_16.error;
                    }
                }
                break;
            case 6:
                try {
                    for (var _u = __values(fromEnum(a)), _v = _u.next(); !_v.done; _v = _u.next()) {
                        var k = _v.value;
                        if (k.item != null) {
                            if (!b.contains(k)) {
                                b.add_1(k);
                                c.add(k);
                            }
                        }
                    }
                }
                catch (e_17_1) {
                    e_17 = { error: e_17_1 };
                }
                finally {
                    try {
                        if (_v && !_v.done && (_f = _u.return))
                            _f.call(_u);
                    }
                    finally {
                        if (e_17)
                            throw e_17.error;
                    }
                }
                break;
            case 7:
                try {
                    for (var _w = __values(fromEnum(a)), _x = _w.next(); !_x.done; _x = _w.next()) {
                        var l = _x.value;
                        if (l.item != null || l.series != d.series) {
                            if (!b.contains(l)) {
                                b.add_1(l);
                                c.add(l);
                            }
                        }
                    }
                }
                catch (e_18_1) {
                    e_18 = { error: e_18_1 };
                }
                finally {
                    try {
                        if (_x && !_x.done && (_g = _w.return))
                            _g.call(_w);
                    }
                    finally {
                        if (e_18)
                            throw e_18.error;
                    }
                }
                break;
        }
    };
    SeriesViewer.prototype.gs = function (a, b, c) {
        var d = new List$1(ChartSelection.$, 0);
        switch (c) {
            case 1:
            case 2:
                d.add(((function () {
                    var $ret = new ChartSelection();
                    $ret.item = b;
                    return $ret;
                })()));
                break;
            case 3:
            case 4:
            case 5:
                d.add(((function () {
                    var $ret = new ChartSelection();
                    $ret.item = b;
                    $ret.series = a;
                    return $ret;
                })()));
                break;
            case 6:
            case 7:
                d.add(((function () {
                    var $ret = new ChartSelection();
                    $ret.series = a;
                    return $ret;
                })()));
                break;
        }
        return d;
    };
    SeriesViewer.prototype.rp = function (a) {
        this.bb.f$as(this, a);
    };
    SeriesViewer.prototype.rq = function (a) {
        a = { $type: Point_$type, x: a.x - this.wz.left, y: a.y - this.wz.top };
        var b = this.wb(a);
        if (this.f7) {
            this.nq(b);
        }
        else {
            var c = this.bv;
            var d = c == 2 || c == 3 || c == 4;
            if (d) {
                this.ry(b);
                for (var e = 0; e < this.series.count; e++) {
                    var f = this.series._inner[e];
                    f.ss(b);
                    if (f.isStacked) {
                        f.p5(function (g) {
                            if (g.ei) {
                                g.p3(function (h) {
                                    h.ss(b);
                                    return true;
                                });
                            }
                            g.ss(b);
                            return true;
                        });
                    }
                    if (f.ei) {
                        f.p3(function (g) {
                            g.ss(b);
                            return true;
                        });
                    }
                }
            }
        }
    };
    SeriesViewer.prototype.q5 = function (a, b, c, d) {
        if (this.seriesMouseMove != null) {
            this.seriesMouseMove(this, new ChartMouseEventArgs(this, a, b, c, d));
        }
    };
    SeriesViewer.prototype.q1 = function (a, b, c, d) {
        if (this.seriesMouseEnter != null) {
            this.seriesMouseEnter(this, new ChartMouseEventArgs(this, a, b, c, d));
        }
    };
    SeriesViewer.prototype.q2 = function (a, b, c, d) {
        if (this.seriesMouseLeave != null) {
            this.seriesMouseLeave(this, new ChartMouseEventArgs(this, a, b, c, d));
        }
    };
    SeriesViewer.prototype.ox = function () {
        if (this.d0) {
            this.d0 = false;
            if (this.viewerManipulationEnding != null) {
                var a = new SeriesViewerManipulationEventArgs();
                a.isDragZoom = true;
                this.viewerManipulationEnding(this, a);
            }
        }
    };
    SeriesViewer.prototype.ov = function () {
        if (this.dz) {
            this.dz = false;
            if (this.viewerManipulationEnding != null) {
                var a = new SeriesViewerManipulationEventArgs();
                a.isDragSelect = true;
                this.viewerManipulationEnding(this, a);
            }
        }
    };
    SeriesViewer.prototype.get_wz = function () {
        return this.wg;
    };
    Object.defineProperty(SeriesViewer.prototype, "wz", {
        get: function () {
            return this.get_wz();
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(SeriesViewer.prototype, "wl", {
        get: function () {
            return this.we;
        },
        set: function (a) {
            this.we = a;
        },
        enumerable: false,
        configurable: true
    });
    SeriesViewer.prototype.get_ex = function () {
        return false;
    };
    Object.defineProperty(SeriesViewer.prototype, "ex", {
        get: function () {
            return this.get_ex();
        },
        enumerable: false,
        configurable: true
    });
    SeriesViewer.prototype.wr = function (a, b, c) {
        if (c.isEmpty) {
            return c;
        }
        var d = c;
        var e = b;
        var f = (d.left - e.left) / e.width;
        var g = (d.top - e.top) / e.height;
        var h = (d.right - e.left) / e.width;
        var i = (d.bottom - e.top) / e.height;
        f = a.left + f * a.width;
        g = a.top + g * a.height;
        h = a.left + h * a.width;
        i = a.top + i * a.height;
        return new Rect(0, f, g, h - f, i - g);
    };
    SeriesViewer.prototype.get_wk = function () {
        if (this.dx) {
            this.dx = false;
            var a = this.wp(this.wz, this.wl, this.wh);
            this.wd = a;
        }
        return this.wd;
    };
    Object.defineProperty(SeriesViewer.prototype, "wk", {
        get: function () {
            return this.get_wk();
        },
        enumerable: false,
        configurable: true
    });
    SeriesViewer.prototype.wp = function (a, b, c) {
        var d = b;
        var e = c;
        var f = a;
        if (f.isEmpty) {
            return Rect.empty;
        }
        if (d.isEmpty) {
            return a;
        }
        var g = (d.left - f.left) / f.width;
        var h = (d.right - f.left) / f.width;
        var i = (d.top - f.top) / f.height;
        var j = (d.bottom - f.top) / f.height;
        g = f.left + (g - e.left) / e.width * f.width;
        h = f.left + (h - e.left) / e.width * f.width;
        i = f.top + (i - e.top) / e.height * f.height;
        j = f.top + (j - e.top) / e.height * f.height;
        var k = new Rect(0, g, i, h - g, j - i);
        k.intersect(f);
        return k;
    };
    SeriesViewer.prototype.wj = function (a) {
        this.dx = true;
        if (this.eu()) {
            if (a.isEmpty) {
                return Rect.empty;
            }
            var b = void 0;
            if (a.width > a.height) {
                var c = intDivide(truncate((a.width - a.height)), 2);
                b = new Rect(0, a.left + c, a.top, a.height, a.height);
            }
            else {
                var d = intDivide(truncate((a.height - a.width)), 2);
                b = new Rect(0, a.left, a.top + d, a.width, a.width);
            }
            return b;
        }
        return Rect.empty;
    };
    SeriesViewer.prototype.wq = function () {
        return this.wz;
    };
    SeriesViewer.prototype.ru = function (a) {
        a.kh = this.wz;
    };
    Object.defineProperty(SeriesViewer.prototype, "i3", {
        get: function () {
            return this.iz;
        },
        set: function (a) {
            this.iz = a;
        },
        enumerable: false,
        configurable: true
    });
    SeriesViewer.prototype.qp = function (a, b) {
        if (!b.isEmpty) {
            this.wg = b;
            this.we = this.wj(this.wg);
            this.c9.eq(this.wg);
        }
        if (this.eu()) {
            if (this.actualSyncLink != null) {
                this.r6(this.wh, false);
            }
        }
        this.py(a, b);
        if (this.el) {
            this.bc.updateScrollbars(this, this.wh, this.wh, a, b);
        }
    };
    SeriesViewer.prototype.cd = function () {
        return this.cc;
    };
    SeriesViewer.prototype.nm = function (a, b) {
        var c = false;
        c = true;
        if (this.wz.containsPoint(a)) {
            if (!this.d4) {
                this.d4 = true;
                if (this.plotAreaMouseEnter != null) {
                    var d = this.bl(a, false, c);
                    d.isDuringManipulation = b;
                    this.plotAreaMouseEnter(this, d);
                }
            }
            else {
                this.d4 = true;
                if (this.plotAreaMouseOver != null) {
                    var e = this.bl(a, false, c);
                    e.isDuringManipulation = b;
                    this.plotAreaMouseOver(this, e);
                }
            }
        }
        else {
            if (this.d4) {
                this.d4 = false;
                if (this.plotAreaMouseLeave != null) {
                    var f = this.bl(a, false, c);
                    f.isDuringManipulation = b;
                    this.plotAreaMouseLeave(this, f);
                }
            }
        }
    };
    Object.defineProperty(SeriesViewer.prototype, "av", {
        get: function () {
            return this.at;
        },
        set: function (a) {
            var b = this.at;
            this.at = a;
            if (b != this.at) {
                this.qv("ContentHitTestMode", enumGetBox(ChartHitTestMode_$type, b), enumGetBox(ChartHitTestMode_$type, this.at));
            }
        },
        enumerable: false,
        configurable: true
    });
    SeriesViewer.prototype.q7 = function () {
        this.au = this.aw();
    };
    SeriesViewer.prototype.aw = function () {
        if (!this.fa) {
            return 1;
        }
        return this.bb.f$a(this);
    };
    Object.defineProperty(SeriesViewer.prototype, "au", {
        get: function () {
            return this.as;
        },
        set: function (a) {
            var b = this.as;
            this.as = a;
            if (b != this.as) {
                this.qv("ActualContentHitTestMode", enumGetBox(ChartHitTestMode_$type, b), enumGetBox(ChartHitTestMode_$type, this.as));
            }
        },
        enumerable: false,
        configurable: true
    });
    SeriesViewer.prototype.queueForAnimationIdle = function (a, b) {
        this.du.j(a, b);
    };
    SeriesViewer.prototype.getAnimationIdleVersionNumber = function () {
        return this.du.f();
    };
    SeriesViewer.prototype.isAnimationActive = function () {
        for (var a = 0; a < this.series.count; a++) {
            if (this.series._inner[a].d4()) {
                return true;
            }
        }
        if (this.db.f()) {
            return true;
        }
        return false;
    };
    SeriesViewer.prototype.p3 = function (a) {
        this.qb();
    };
    SeriesViewer.prototype.pg = function () {
        this.qb();
    };
    SeriesViewer.prototype.qb = function () {
        if (!this.isAnimationActive()) {
            this.du.h();
        }
    };
    SeriesViewer.prototype.qx = function (a) {
        if (this.seriesAnimating != null) {
            this.seriesAnimating(a);
        }
    };
    SeriesViewer.prototype.fk = function () {
        return this.fl() || this.fm();
    };
    SeriesViewer.prototype.onDetachedFromUI = function () {
        this.d3 = true;
        this.c9.c2();
        SyncManager.e(this);
    };
    SeriesViewer.prototype.onAttachedToUI = function () {
        this.d3 = false;
        this.c9.cw();
        SyncManager.c(this);
    };
    Object.defineProperty(SeriesViewer.prototype, "c0", {
        get: function () {
            return this.cv;
        },
        set: function (a) {
            if (this.c0 != a) {
                var b = this.cv;
                this.cv = a;
                if (this.fa) {
                    this.bb.f$aj(this);
                }
                if (b == 1 && this.cv != 1) {
                    this.ox();
                }
                if (b == 3 && this.cv != 3) {
                    this.ov();
                }
            }
        },
        enumerable: false,
        configurable: true
    });
    SeriesViewer.prototype.pq = function (a) {
        this.nq(this.wb(a));
    };
    SeriesViewer.prototype.pr = function (a, b) {
        var c = false;
        c = false;
        this.nq({ $type: Point_$type, x: NaN, y: NaN });
        if (this.d4) {
            this.d4 = false;
            if (this.plotAreaMouseLeave != null) {
                var d = this.bl(a, false, c);
                d.isDuringManipulation = b;
                this.plotAreaMouseLeave(this, d);
            }
        }
    };
    SeriesViewer.prototype.fx = function (a, b) {
        return this.bb.f$h(this, a, b);
    };
    SeriesViewer.prototype.o9 = function (a) {
        this.bb.f$r(this, a);
    };
    SeriesViewer.prototype.fw = function (a) {
        return this.bb.f$g(this, a);
    };
    Object.defineProperty(SeriesViewer.prototype, "ek", {
        get: function () {
            return this.dy;
        },
        set: function (a) {
            this.dy = a;
        },
        enumerable: false,
        configurable: true
    });
    SeriesViewer.prototype.get_fb = function () {
        return this.eo || this.gg();
    };
    Object.defineProperty(SeriesViewer.prototype, "fb", {
        get: function () {
            return this.get_fb();
        },
        enumerable: false,
        configurable: true
    });
    SeriesViewer.prototype.pb = function (a) {
        this.bb.f$t(this, a);
    };
    Object.defineProperty(SeriesViewer.prototype, "et", {
        get: function () {
            return this.dy;
        },
        enumerable: false,
        configurable: true
    });
    SeriesViewer.prototype.pv = function (a) {
        this.bb.f$ah(this, a);
    };
    SeriesViewer.prototype.pc = function (a, b) {
        this.bb.f$u(this, a, b);
    };
    SeriesViewer.prototype.pa = function (a) {
        this.bb.f$s(this, a);
    };
    Object.defineProperty(SeriesViewer.prototype, "fy", {
        get: function () {
            return this.d8;
        },
        set: function (a) {
            this.d8 = a;
        },
        enumerable: false,
        configurable: true
    });
    SeriesViewer.prototype.qk = function (a) {
        this.bb.f$ao(this, a);
    };
    SeriesViewer.prototype.pu = function (a) {
        this.bb.f$ag(this, a);
    };
    SeriesViewer.prototype.ql = function (a, b, c, d) {
        this.bb.f$ap(this, a, b, c, d);
    };
    SeriesViewer.prototype.pt = function (a) {
        this.bb.f$af(this, a);
    };
    SeriesViewer.prototype.qh = function (a, b, c, d) {
        this.bb.f$al(this, a, b, c, d);
    };
    SeriesViewer.prototype.pp = function (a) {
        this.bb.f$ac(this, a);
    };
    SeriesViewer.prototype.ps = function (a) {
        this.bb.f$ae(this, a);
    };
    SeriesViewer.prototype.pf = function (a) {
        this.bb.f$v(this, a);
    };
    SeriesViewer.prototype.qg = function (a, b, c, d) {
        this.bb.f$ak(this, a, b, c, d);
    };
    SeriesViewer.prototype.qd = function () {
        this.d6 = false;
    };
    SeriesViewer.prototype.pi = function (a) {
        this.c9.ej(a.height);
    };
    SeriesViewer.prototype.n5 = function () {
        if (this.dy) {
            this.nq({ $type: Point_$type, x: NaN, y: NaN });
            this.c9.ch();
        }
        this.dy = false;
    };
    SeriesViewer.prototype.o2 = function (a, b) {
        this.bb.f$q(this, a, b);
    };
    SeriesViewer.prototype.cy = function (a) {
        var b = this.c9.k != null && this.c9.k.al ? this.cz : this.cw;
        if (b != 4) {
            return b;
        }
        return this.c9.m(a);
    };
    SeriesViewer.prototype.qj = function (a, b) {
        this.ed = false;
        if (!this.ee) {
            this.nq({ $type: Point_$type, x: NaN, y: NaN });
            if (a) {
                this.ee = true;
                this.d6 = true;
                if (this.ev) {
                    this.bb.f$y(this, b);
                }
                if (this.viewerManipulationStarting != null) {
                    var c = new SeriesViewerManipulationEventArgs();
                    c.isZoomPan = true;
                    this.viewerManipulationStarting(this, c);
                }
            }
        }
        this.bb.f$an(this);
    };
    SeriesViewer.prototype.qi = function () {
        if (this.ee) {
            this.ee = false;
            if (this.viewerManipulationEnding != null) {
                var a = new SeriesViewerManipulationEventArgs();
                a.isZoomPan = true;
                this.viewerManipulationEnding(this, a);
            }
        }
        this.bb.f$am(this);
    };
    SeriesViewer.prototype.rr = function () {
        this.bb.f$at(this);
    };
    SeriesViewer.prototype.nu = function () {
        if (this.ed) {
            this.o6();
        }
        this.bb.f$n(this);
    };
    SeriesViewer.prototype.np = function () {
        this.no();
    };
    SeriesViewer.prototype.no = function () {
        if (this.fa) {
            this.bb.f$k(this);
        }
    };
    SeriesViewer.prototype.qn = function () {
    };
    SeriesViewer.prototype.rb = function () {
    };
    SeriesViewer.prototype.q9 = function () {
        for (var a = 0; a < this.series.count; a++) {
            this.series._inner[a].ru(false);
        }
        this.n0(false, false, true);
    };
    SeriesViewer.prototype.o1 = function (a, b) {
        this.bb.f$p(this, a, b);
    };
    SeriesViewer.prototype.f4 = function () {
        return false;
    };
    Object.defineProperty(SeriesViewer.prototype, "ga", {
        get: function () {
            return this.d9;
        },
        set: function (a) {
            this.d9 = a;
        },
        enumerable: false,
        configurable: true
    });
    SeriesViewer.prototype.o0 = function (a, b, c) {
        this.bb.f$o(this, a, b, c);
    };
    SeriesViewer.prototype.r3 = function (a, b) {
        if (b.propertyName == SyncSettings.$$p[0]) {
            SyncManager.b(this, b.oldValue, b.newValue);
        }
    };
    SeriesViewer.prototype.r2 = function (a, b) {
        var e_19, _a;
        if (a != null) {
            a.as(this);
            a.propertyUpdated = delegateRemove(a.propertyUpdated, this.propertyUpdated);
        }
        if (b != null) {
            b.al(this);
            b.propertyUpdated = delegateCombine(b.propertyUpdated, this.propertyUpdated);
        }
        try {
            for (var _b = __values(fromEnum(this.series)), _c = _b.next(); !_c.done; _c = _b.next()) {
                var c = _c.value;
                c.c4 = this.actualSyncLink;
                c.dc = this;
            }
        }
        catch (e_19_1) {
            e_19 = { error: e_19_1 };
        }
        finally {
            try {
                if (_c && !_c.done && (_a = _b.return))
                    _a.call(_b);
            }
            finally {
                if (e_19)
                    throw e_19.error;
            }
        }
    };
    SeriesViewer.prototype.nq = function (a) {
        if (this.el) {
            this.bc.onCrosshairMoved(this.v9(a));
        }
        this.actualSyncLink.an(this, a);
    };
    SeriesViewer.prototype.r6 = function (a, b) {
        this.r7(a, b, !b);
    };
    SeriesViewer.prototype.r7 = function (a, b, c) {
        if (!b) {
            this.actualSyncLink.au(this, a, c);
        }
        else {
            if (!this.fl() && !this.fm()) {
                return;
            }
            var d = !a.isEmpty && !isNaN_(a.x) && !isNaN_(a.y) && !isNaN_(a.width) && !isNaN_(a.height);
            var e = a;
            if (d && !this.f6) {
                if (e.width < this.ho) {
                    return;
                }
                else if (e.height < this.hn) {
                    return;
                }
            }
            if (d && !this.fl()) {
                e = new Rect(0, 0, a.y, 1, a.height);
            }
            if (d && !this.fm()) {
                e = new Rect(0, a.x, 0, a.width, 1);
            }
            this.actualSyncLink.at(this, e);
        }
    };
    SeriesViewer.prototype.qo = function (a, b) {
        if (!b) {
            this.actualSyncLink.ap(this, a);
        }
        else {
            if (!this.fl() && !this.fm()) {
                return;
            }
            var c = !a.isEmpty && !isNaN_(a.x) && !isNaN_(a.y) && !isNaN_(a.width) && !isNaN_(a.height);
            var d = a;
            if (c && !this.fl()) {
                d = new Rect(0, 0, a.y, 1, a.height);
            }
            if (c && !this.fm()) {
                d = new Rect(0, a.x, 0, a.width, 1);
            }
            this.actualSyncLink.ap(this, d);
        }
    };
    Object.defineProperty(SeriesViewer.prototype, "fg", {
        get: function () {
            return this.actualSyncLink != null;
        },
        enumerable: false,
        configurable: true
    });
    SeriesViewer.prototype._go = function () {
        var _a, _b, a, e_20_1;
        var e_20, _c;
        return __generator(this, function (_d) {
            switch (_d.label) {
                case 0:
                    if (this.actualSyncLink == null) {
                        return [2 /*return*/, undefined];
                    }
                    _d.label = 1;
                case 1:
                    _d.trys.push([1, 6, 7, 8]);
                    _a = __values(fromEnum(this.actualSyncLink.ai)), _b = _a.next();
                    _d.label = 2;
                case 2:
                    if (!!_b.done)
                        return [3 /*break*/, 5];
                    a = _b.value;
                    return [4 /*yield*/, a];
                case 3:
                    _d.sent();
                    _d.label = 4;
                case 4:
                    _b = _a.next();
                    return [3 /*break*/, 2];
                case 5: return [3 /*break*/, 8];
                case 6:
                    e_20_1 = _d.sent();
                    e_20 = { error: e_20_1 };
                    return [3 /*break*/, 8];
                case 7:
                    try {
                        if (_b && !_b.done && (_c = _a.return))
                            _c.call(_a);
                    }
                    finally {
                        if (e_20)
                            throw e_20.error;
                    }
                    return [7 /*endfinally*/];
                case 8: return [2 /*return*/];
            }
        });
    };
    SeriesViewer.prototype.go = function () {
        var _this = this;
        return toEnum(function () { return _this._go(); });
    };
    SeriesViewer.prototype.wb = function (a) {
        a = { $type: Point_$type, x: a.x + this.wz.left, y: a.y + this.wz.top };
        var b = this.wk;
        var c = ViewportUtils.b(a.x, this.wh, this.wz, this.wl);
        var d = ViewportUtils.g(a.y, this.wh, this.wz, this.wl);
        return { $type: Point_$type, x: c, y: d };
    };
    SeriesViewer.prototype.v9 = function (a) {
        var b = this.wk;
        var c = ViewportUtils.e(a.x, this.wh, this.wz, this.wl);
        var d = ViewportUtils.i(a.y, this.wh, this.wz, this.wl);
        return { $type: Point_$type, x: c, y: d };
    };
    SeriesViewer.prototype.wy = function (a) {
        var b = this.wb({ $type: Point_$type, x: a.left, y: a.top });
        var c = this.wb({ $type: Point_$type, x: a.right, y: a.bottom });
        return new Rect(0, b.x, b.y, c.x - b.x, c.y - b.y);
    };
    SeriesViewer.prototype.wm = function (a) {
        var b = this.v9({ $type: Point_$type, x: a.left, y: a.top });
        var c = this.v9({ $type: Point_$type, x: a.right, y: a.bottom });
        return new Rect(0, b.x, b.y, c.x - b.x, c.y - b.y);
    };
    SeriesViewer.prototype.q6 = function (a, b) {
        if (this.windowRectChanged != null && Rect.l_op_Inequality(a, b)) {
            this.windowRectChanged(this, new RectChangedEventArgs(a, b));
        }
    };
    SeriesViewer.prototype.qf = function (a, b) {
        this.q6(a, b);
    };
    SeriesViewer.prototype.qc = function (a, b) {
        if (this.sizeChanged != null && Size.l_op_Inequality(a, b)) {
            this.sizeChanged(this, new RectChangedEventArgs(new Rect(1, 0, 0, a), new Rect(1, 0, 0, b)));
        }
    };
    SeriesViewer.prototype.f0 = function (a, b) {
        if (a.width != b.width || a.height != b.height || a.x != b.x || a.y != b.y) {
            return true;
        }
        return false;
    };
    SeriesViewer.prototype.qs = function (a, b) {
        if (this.actualWindowRectChanged != null && this.f0(a, b)) {
            this.actualWindowRectChanged(this, new RectChangedEventArgs(a, b));
        }
    };
    SeriesViewer.prototype.r8 = function (a) {
        if (isNaN_(a) || isInfinity(a)) {
            a = 0.05;
        }
        var b = this.hu() - a;
        var c = this.hu() - a;
        var d = this.hl + (a / 2);
        var e = this.hm + (a / 2);
        this.w0 = new Rect(0, d, e, b, c);
    };
    SeriesViewer.prototype.r9 = function (a) {
        this.r8(a * -1);
    };
    SeriesViewer.prototype.rh = function () {
        this.c9.d2();
    };
    SeriesViewer.prototype.qt = function (a, b) {
        if (this.gridAreaRectChanged != null && Rect.l_op_Inequality(a, b)) {
            this.gridAreaRectChanged(this, new RectChangedEventArgs(a, b));
        }
    };
    SeriesViewer.prototype.get_fd = function () {
        return false;
    };
    Object.defineProperty(SeriesViewer.prototype, "fd", {
        get: function () {
            return this.get_fd();
        },
        enumerable: false,
        configurable: true
    });
    SeriesViewer.prototype.py = function (a, b) {
        this.qt(a, b);
        if (this.fa) {
            this.bb.f$ar(this);
        }
        if (this.fd && (Rect.l_op_Equality(a, null) || a.isEmpty || a.width == 0 || a.height == 0)) {
            this.r6(this.w0, false);
        }
        else {
            this.oa();
        }
        if (a.isEmpty || a.width == 0 || a.height == 0) {
            this.ok();
        }
    };
    SeriesViewer.prototype.oe = function () {
        this.oa();
    };
    Object.defineProperty(SeriesViewer.prototype, "ho", {
        get: function () {
            return this.g2;
        },
        set: function (a) {
            var b = this.g2;
            this.g2 = a;
            this.qv("ActualWindowRectMinWidth", b, this.g2);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(SeriesViewer.prototype, "hn", {
        get: function () {
            return this.g1;
        },
        set: function (a) {
            var b = this.g1;
            this.g1 = a;
            this.qv("ActualWindowRectMinHeight", b, this.g1);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(SeriesViewer.prototype, "syncChannel", {
        get: function () {
            return this._syncChannel;
        },
        set: function (a) {
            this._syncChannel = a;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(SeriesViewer.prototype, "actualSyncLink", {
        get: function () {
            return this.cm;
        },
        set: function (a) {
            var b = this.cm;
            this.cm = a;
            this.qv("ActualSyncLink", b, this.cm);
        },
        enumerable: false,
        configurable: true
    });
    SeriesViewer.prototype.oc = function () {
        this.c9.d3();
    };
    SeriesViewer.prototype.o7 = function () {
        this.ed = true;
    };
    SeriesViewer.prototype.o5 = function () {
        this.ed = false;
    };
    SeriesViewer.prototype.o6 = function () {
        if (this.ed) {
            if (this.ee) {
                this.ee = false;
                if (!this.d0) {
                    if (this.viewerManipulationEnding != null) {
                        var a = new SeriesViewerManipulationEventArgs();
                        a.isZoomPan = true;
                        this.viewerManipulationEnding(this, a);
                    }
                    this.d6 = false;
                }
            }
        }
    };
    Object.defineProperty(SeriesViewer.prototype, "c2", {
        get: function () {
            return this.c9.i().a;
        },
        enumerable: false,
        configurable: true
    });
    SeriesViewer.prototype.rz = function (a) {
        if (this.c2 != null) {
            this.c2.mobileMode = a;
        }
    };
    Object.defineProperty(SeriesViewer.prototype, "cr", {
        get: function () {
            return this.cq;
        },
        set: function (a) {
            this.cq = a;
        },
        enumerable: false,
        configurable: true
    });
    SeriesViewer.prototype.cs = function () {
        if (this.ct == 0) {
            return 1;
        }
        return this.ct;
    };
    SeriesViewer.prototype.ep = function () {
        return this.c0 == 0 && !this.d8 && !this.d9;
    };
    SeriesViewer.prototype.eh = function () {
        if (this.actualSyncLink != null && this.actualSyncLink.ai.count > 0) {
            var a = true;
            a = this.ep();
            if (!a) {
                return false;
            }
            for (var b = 0; b < this.actualSyncLink.ai.count; b++) {
                if (!this.actualSyncLink.ai.item(b).ep()) {
                    return false;
                }
            }
            return true;
        }
        else {
            return this.ep();
        }
    };
    SeriesViewer.prototype.nj = function () {
        if (this.c0 == 2) {
            this.c9.bt();
            this.c0 = 0;
            this.qi();
            this.qo(Rect.empty, true);
            if (this.cp == 1) {
                this.r6(this.w1, true);
            }
        }
        if (this.c0 == 1 || this.c0 == 3) {
            this.c9.bt();
            this.c0 = 0;
            this.qi();
            this.c9.cf();
            this.qo(Rect.empty, true);
        }
    };
    SeriesViewer.prototype.notifyCrosshairUpdate = function () {
    };
    SeriesViewer.prototype.r4 = function (a, b) {
        var c = this.ho;
        var d = this.hn;
        this.w0 = new Rect(0, this.hl, this.hm, MathUtil.d(a, c, 1), MathUtil.d(b, d, 1));
    };
    SeriesViewer.prototype.r5 = function (a, b, c, d) {
        if (!MathUtil.a(a) || a < 0 || a >= 1) {
            a = this.hl;
        }
        if (!MathUtil.a(b) || b < 0 || b >= 1) {
            b = this.hm;
        }
        if (!MathUtil.a(d)) {
            d = this.hv();
        }
        if (!MathUtil.a(c)) {
            c = this.hu();
        }
        this.w0 = new Rect(0, a, b, MathUtil.d(c, this.ho, 1), MathUtil.d(d, this.hn, 1));
    };
    SeriesViewer.prototype.hu = function () {
        return 1;
    };
    SeriesViewer.prototype.hv = function () {
        return 1;
    };
    SeriesViewer.prototype.h8 = function () {
        if (this.iv > 0) {
            return this.iv;
        }
        var a = Rect.l_op_Inequality(this.wz, null) && !this.wz.isEmpty && MathUtil.a(this.wz.width);
        var b = MathUtil.a(this.ix);
        if (b && a) {
            var c = this.ix / this.wz.width;
            if (c <= 0 || c >= 1) {
                c = 0.0001;
            }
            return c;
        }
        return 0.0001;
    };
    SeriesViewer.prototype.h7 = function () {
        if (this.iu > 0) {
            return this.iu;
        }
        var a = Rect.l_op_Inequality(this.wz, null) && !this.wz.isEmpty && MathUtil.a(this.wz.height);
        var b = MathUtil.a(this.iw);
        if (b && a) {
            var c = this.iw / this.wz.height;
            if (c <= 0 || c >= 1) {
                c = 0.0001;
            }
            return c;
        }
        return 0.0001;
    };
    SeriesViewer.prototype.qq = function (a, b, c, d) {
        var e_21, _a, e_22, _b, e_23, _c;
        switch (b) {
            case SeriesViewer.$$p[47]:
                this.c9.dj();
                break;
            case SeriesViewer.$$p[44]:
                this.c9.dj();
                break;
            case SeriesViewer.$$p[59]:
                this.cr = this.cs();
                break;
            case "HorizontalViewScrollbarMode":
                this.cf = this.ch;
                if (this.en || this.fa) {
                    this.bc.onHorizontalScrollbarModeChanged(this.cf);
                }
                break;
            case "VerticalViewScrollbarMode":
                this.cg = this.ci;
                if (this.en || this.fa) {
                    this.bc.onVerticalScrollbarModeChanged(this.cg);
                }
                break;
            case "ActualContentHitTestMode":
                this.os();
                break;
            case "ContentHitTestMode":
                this.q7();
                break;
            case SeriesViewer.$$p[46]:
                this.c9.dh(c, d);
                this.c9.dj();
                break;
            case SeriesViewer.$$p[43]:
                this.c9.dd(c, d);
                this.c9.dj();
                break;
            case "TitleTextStyle":
            case "TitleTextColor":
            case "SubtitleTextStyle":
            case "SubtitleTextColor":
            case "TitleTopMargin":
            case "TitleLeftMargin":
            case "TitleRightMargin":
            case "TitleBottomMargin":
            case "SubtitleTopMargin":
            case "SubtitleLeftMargin":
            case "SubtitleRightMargin":
            case "SubtitleBottomMargin":
                this.c9.dj();
                break;
            case SeriesViewer.$$p[30]:
            case SeriesViewer.$$p[31]:
            case SeriesViewer.$$p[32]:
                this.c9.db();
                break;
            case "PixelScalingRatio":
                if (isNaN_(DeviceUtils.a(this.h5))) {
                    this.n9();
                }
                else {
                    this.hk = DeviceUtils.a(this.h5);
                }
                break;
            case "InteractionPixelScalingRatio":
                this.hj = this.h3;
                break;
            case "ActualPixelScalingRatio":
                this.c9.dq();
                break;
            case SeriesViewer.$$p[17]:
                this.c9.cp();
                break;
            case "ActualSyncLink":
                this.r2(typeCast(SyncLink.$, c), typeCast(SyncLink.$, d));
                break;
            case SeriesViewer.$$p[3]:
                if (!this.e0) {
                    this.gh = true;
                }
                if (this.w4 == 0) {
                    this.eq = true;
                }
                else {
                    this.eq = this.ef;
                }
                if (this.fa) {
                    this.bb.f$ar(this);
                }
                break;
            case "CrosshairPoint":
                if (this.fa) {
                    if (this.fv) {
                        this.ry(this.v8);
                    }
                    this.bb.f$ar(this);
                }
                this.notifyCrosshairUpdate();
                break;
            case SeriesViewer.$$p[55]:
                if (this.actualSyncLink != null) {
                    this.i2++;
                    this.r6(d, false);
                    this.i2--;
                }
                if (!this.w0.equals1(c) && this.i2 == 0) {
                    this.qf(c, this.w0);
                }
                this.oa();
                break;
            case SeriesViewer.$$p[51]:
                this.hl = this.is;
                break;
            case SeriesViewer.$$p[52]:
                this.hm = this.it;
                break;
            case "ActualWindowPositionVertical":
            case "ActualWindowPositionHorizontal":
                if (!this.gc) {
                    this.r4(this.hu(), this.hv());
                }
                break;
            case SeriesViewer.$$p[54]:
            case SeriesViewer.$$p[58]:
                this.ho = this.h8();
                break;
            case SeriesViewer.$$p[53]:
            case SeriesViewer.$$p[57]:
                this.hn = this.h7();
                break;
            case SeriesViewer.$$p[18]:
                this.c9.c5();
                break;
            case SeriesViewer.$$p[14]:
                this.db.r = this.i9;
                break;
            case SeriesViewer.$$p[39]:
                this.dd.r = this.jc;
                break;
            case SeriesViewer.$$p[9]:
                this.da.r = this.i6;
                break;
            case SeriesViewer.$$p[37]:
                if (this.fa) {
                    var e = this.dl;
                    e.dismissHighlightDelay = this.jb;
                }
                break;
            case SeriesViewer.$$p[13]:
                if (this.fa) {
                    var f = this.dk;
                    f.dismissHighlightDelay = this.i8;
                }
                break;
            case SeriesViewer.$$p[8]:
                if (this.fa) {
                    var g = this.dj;
                    g.dismissHighlightDelay = this.i5;
                }
                break;
            case SeriesViewer.$$p[23]:
                this.r1();
                break;
            case "ActualWindowRect":
                this.dx = true;
                if (this.f0(c, d)) {
                    this.ne(c, d);
                }
                if (d.width == 1 && d.height == 1 && c.isEmpty) {
                    this.gk = true;
                }
                this.qs(c, d);
                break;
            case SeriesViewer.$$p[27]:
                this.c9.da(d);
                break;
            case SeriesViewer.$$p[49]:
                this.eg = this.gi;
                break;
            case SeriesViewer.$$p[60]:
                this.i3 = this.jd;
                this.no();
                break;
            case SeriesViewer.$$p[29]:
                this.bb.f$ai(this);
                break;
            case "HighlightingMode":
            case "HighlightingBehavior":
                this.bu = this.bx();
                if (this.fa) {
                    var h = this.dk;
                    h.retainMainShapes = this.bv == 3;
                    h.isExclusiveHighlight = this.bv == 1;
                }
                break;
            case "SelectionMode":
                this.b7 = this.ca();
                if (this.b7 == 1 && this.selectedSeriesItems.count > 0) {
                    this.selectedSeriesItems.clear();
                }
                if (this.fa) {
                    var i = this.dl;
                }
                break;
            case "SelectionBehavior":
                this.b3 = this.b5();
                if (this.fa) {
                    var j = this.dl;
                }
                break;
            case "LegendItemBadgeShape":
                try {
                    for (var _d = __values(fromEnum(this.series)), _e = _d.next(); !_e.done; _e = _d.next()) {
                        var k = _e.value;
                        k.legendItemBadgeShape = this.bf;
                    }
                }
                catch (e_21_1) {
                    e_21 = { error: e_21_1 };
                }
                finally {
                    try {
                        if (_e && !_e.done && (_a = _d.return))
                            _a.call(_d);
                    }
                    finally {
                        if (e_21)
                            throw e_21.error;
                    }
                }
                break;
            case "LegendItemBadgeMode":
                try {
                    for (var _f = __values(fromEnum(this.series)), _g = _f.next(); !_g.done; _g = _f.next()) {
                        var l = _g.value;
                        l.be = this.be;
                    }
                }
                catch (e_22_1) {
                    e_22 = { error: e_22_1 };
                }
                finally {
                    try {
                        if (_g && !_g.done && (_b = _f.return))
                            _b.call(_f);
                    }
                    finally {
                        if (e_22)
                            throw e_22.error;
                    }
                }
                break;
            case SeriesViewer.$$p[1]:
            case SeriesViewer.$$p[22]:
            case SeriesViewer.$$p[20]:
            case SeriesViewer.$$p[21]:
            case SeriesViewer.$$p[19]:
                try {
                    for (var _h = __values(fromEnum(this.series)), _j = _h.next(); !_j.done; _j = _h.next()) {
                        var m = _j.value;
                        m.qi();
                    }
                }
                catch (e_23_1) {
                    e_23 = { error: e_23_1 };
                }
                finally {
                    try {
                        if (_j && !_j.done && (_c = _h.return))
                            _c.call(_h);
                    }
                    finally {
                        if (e_23)
                            throw e_23.error;
                    }
                }
                break;
            case "HorizontalViewScrollbarCornerRadius":
            case "HorizontalViewScrollbarFill":
            case "HorizontalViewScrollbarMaxOpacity":
            case "HorizontalViewScrollbarOutline":
            case "HorizontalViewScrollbarStrokeThickness":
            case "VerticalViewScrollbarCornerRadius":
            case "VerticalViewScrollbarFill":
            case "VerticalViewScrollbarMaxOpacity":
            case "VerticalViewScrollbarOutline":
            case "VerticalViewScrollbarStrokeThickness":
                if (this.fa) {
                    this.bc.updateBarAppearance(this, this.vv, this.v5, this.vw, this.v6, this.h0, this.io, this.hz, this.im);
                }
                break;
            case "HorizontalViewScrollbarHeight":
            case "HorizontalViewScrollbarInset":
            case SeriesViewer.kr:
            case "HorizontalViewScrollbarTrackStartInset":
            case "HorizontalViewScrollbarTrackEndInset":
                if (this.fa) {
                    this.bc.updateBarDimensions(this, this.hx, this.hw, this.hy, this.ey, this.h2, this.h1, this.ir, this.ik, this.il, this.gj, this.iq, this.ip);
                }
                break;
            case "VerticalViewScrollbarPosition":
                if (this.fa) {
                    this.bc.updateVerticalScrollbarPosition(this.cl);
                }
                break;
            case "HorizontalViewScrollbarPosition":
                if (this.fa) {
                    this.bc.updateHorizontalScrollbarPosition(this.ce);
                }
                break;
        }
        if (this.fi && this.a8 != null) {
            this.a9.onTargetPropertyChanged(this, b, c, d);
        }
    };
    Object.defineProperty(SeriesViewer.prototype, "e7", {
        get: function () {
            return this.bv == 2 || this.bv == 3 || this.bv == 4;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(SeriesViewer.prototype, "fv", {
        get: function () {
            return this.bv == 2 || this.bv == 3 || this.bv == 4;
        },
        enumerable: false,
        configurable: true
    });
    SeriesViewer.prototype.ry = function (a) {
        var _this = this;
        var b = 1.7976931348623157E+308;
        var c = null;
        for (var d = 0; d < this.series.count; d++) {
            var e = this.series._inner[d];
            if (e.eu) {
                continue;
            }
            if (e.ef && e.el) {
                continue;
            }
            if (e.isStacked) {
                e.p5(function (f) {
                    var g = _this.nc(f, b, c, a);
                    if (g == null) {
                        return true;
                    }
                    b = g.c;
                    c = g.d;
                    if (f.ei) {
                        f.p3(function (h) {
                            var i = _this.nc(h, b, c, a);
                            if (i == null) {
                                return true;
                            }
                            b = i.c;
                            c = i.d;
                            return true;
                        });
                    }
                    return true;
                });
            }
            if (e.ei) {
                e.p3(function (f) {
                    var g = _this.nc(f, b, c, a);
                    if (g == null) {
                        return true;
                    }
                    b = g.c;
                    c = g.d;
                    return true;
                });
            }
            var f = this.nc(e, b, c, a);
            if (f == null) {
                continue;
            }
            b = f.c;
            c = f.d;
        }
        this.bq = c;
    };
    SeriesViewer.prototype.nc = function (a, b, c, d) {
        var e = a.wc(d);
        var f = a.wh(d, true, true);
        if (isNaN_(f.x) || isNaN_(f.y)) {
            return null;
        }
        var g = (e.x - f.x) * (e.x - f.x) + (e.y - f.y) * (e.y - f.y);
        if (g < b) {
            b = g;
            c = a;
        }
        return new Tuple$2(Number_$type, Series.$, b, c);
    };
    SeriesViewer.prototype.r1 = function () {
        this.ec = this.w5 == 0;
        this.c9.dp();
        this.r0();
        this.c9.em();
        this.oc();
        this.oq();
    };
    SeriesViewer.prototype.os = function () {
        this.c9.cv();
    };
    SeriesViewer.prototype.r0 = function () {
        if (this.c2 == null) {
            return;
        }
        this.c2.visibility = this.w5;
        this.c2.isZoomable = this.fk();
    };
    Object.defineProperty(SeriesViewer.prototype, "ws", {
        get: function () {
            return this.wf;
        },
        set: function (a) {
            var b = this.wf;
            this.wf = a;
            if (this.wf.isEmpty) {
                this.c9.cj();
            }
            else {
                this.c9.en(this.wz, this.wv(this.ws));
                this.c9.ec();
                this.qv("PreviewRect", b, this.wf);
            }
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(SeriesViewer.prototype, "selectedSeriesItems", {
        get: function () {
            return this._selectedSeriesItems;
        },
        set: function (a) {
            this._selectedSeriesItems = a;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(SeriesViewer.prototype, "focusedSeriesItems", {
        get: function () {
            return this._focusedSeriesItems;
        },
        set: function (a) {
            this._focusedSeriesItems = a;
        },
        enumerable: false,
        configurable: true
    });
    SeriesViewer.prototype.p0 = function (a, b) {
        if (this.selectedSeriesItemsChanged != null) {
            this.selectedSeriesItemsChanged(a, b);
        }
    };
    SeriesViewer.prototype.pd = function (a, b) {
        if (this.focusedSeriesItemsChanged != null) {
            this.focusedSeriesItemsChanged(a, b);
        }
    };
    SeriesViewer.prototype.rt = function () {
        this.hl = this.wh.x;
        this.hm = this.wh.y;
    };
    SeriesViewer.prototype.ne = function (a, b) {
        this.gk = false;
        this.gw = dateNow();
        if (this.e6) {
            for (var c = 0; c < this.series.count; c++) {
                this.series._inner[c].o5();
            }
            this.dk.clear();
        }
        if (this.db.f()) {
            this.db.w();
        }
        var d = this.gc;
        this.gc = true;
        this.rt();
        this.gc = d;
        this.c9.ck();
        this.c9.ep(this.wh);
        if (this.el) {
            this.bc.updateScrollbars(this, a, this.wh, this.wz, this.wz);
        }
        this.ot(a, b);
    };
    SeriesViewer.prototype.f1 = function () {
        return this.b8 != 1;
    };
    SeriesViewer.prototype.ot = function (a, b) {
    };
    SeriesViewer.prototype.wv = function (a) {
        if (this.wz.isEmpty) {
            return Rect.empty;
        }
        var b = this.wz;
        var c = b.left + (b.width * (a.left - this.wh.left) / this.wh.width);
        var d = b.top + (b.height * (a.top - this.wh.top) / this.wh.height);
        var e = b.left + (b.width * (a.right - this.wh.left) / this.wh.width);
        var f = b.top + (b.height * (a.bottom - this.wh.top) / this.wh.height);
        return new Rect(0, c, d, e - c, f - d);
    };
    SeriesViewer.prototype.qw = function () {
        if (this.refreshCompleted != null && !this.destroyed) {
            this.refreshCompleted(this, new RefreshCompletedEventArgs());
        }
    };
    SeriesViewer.prototype.qe = function (a) {
        this.r0();
    };
    Object.defineProperty(SeriesViewer.prototype, "mj", {
        get: function () {
            return this.jk;
        },
        set: function (a) {
            var b = this.jk;
            this.jk = a;
            this.qv("TitleTextStyle", b, a);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(SeriesViewer.prototype, "l7", {
        get: function () {
            return this.jj;
        },
        set: function (a) {
            var b = this.jj;
            this.jj = a;
            this.qv("SubtitleTextStyle", b, a);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(SeriesViewer.prototype, "v3", {
        get: function () {
            return this.vi;
        },
        set: function (a) {
            var b = this.vi;
            this.vi = a;
            this.qv("TitleTextColor", b, a);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(SeriesViewer.prototype, "v2", {
        get: function () {
            return this.vh;
        },
        set: function (a) {
            var b = this.vh;
            this.vh = a;
            this.qv("SubtitleTextColor", b, a);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(SeriesViewer.prototype, "ii", {
        get: function () {
            return this.hh;
        },
        set: function (a) {
            var b = this.hh;
            this.hh = a;
            this.qv("TitleTopMargin", b, a);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(SeriesViewer.prototype, "ig", {
        get: function () {
            return this.hf;
        },
        set: function (a) {
            var b = this.hf;
            this.hf = a;
            this.qv("TitleLeftMargin", b, a);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(SeriesViewer.prototype, "ih", {
        get: function () {
            return this.hg;
        },
        set: function (a) {
            var b = this.hg;
            this.hg = a;
            this.qv("TitleRightMargin", b, a);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(SeriesViewer.prototype, "ie", {
        get: function () {
            return this.he;
        },
        set: function (a) {
            var b = this.he;
            this.he = a;
            this.qv("TitleBottomMargin", b, a);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(SeriesViewer.prototype, "id", {
        get: function () {
            return this.hd;
        },
        set: function (a) {
            var b = this.hd;
            this.hd = a;
            this.qv("SubtitleTopMargin", b, a);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(SeriesViewer.prototype, "ib", {
        get: function () {
            return this.hb;
        },
        set: function (a) {
            var b = this.hb;
            this.hb = a;
            this.qv("SubtitleLeftMargin", b, a);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(SeriesViewer.prototype, "ic", {
        get: function () {
            return this.hc;
        },
        set: function (a) {
            var b = this.hc;
            this.hc = a;
            this.qv("SubtitleRightMargin", b, a);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(SeriesViewer.prototype, "ia", {
        get: function () {
            return this.ha;
        },
        set: function (a) {
            var b = this.ha;
            this.ha = a;
            this.qv("SubtitleBottomMargin", b, a);
        },
        enumerable: false,
        configurable: true
    });
    SeriesViewer.prototype.w2 = function () {
        return this.c9.fj();
    };
    SeriesViewer.prototype.w3 = function () {
        return this.c9.fk();
    };
    SeriesViewer.prototype.ap = function (a) {
        return this.c9.c(a);
    };
    SeriesViewer.prototype.aq = function (a) {
        return this.c9.d(a);
    };
    SeriesViewer.prototype.getFontHeight = function () {
        return this.c9.a9;
    };
    SeriesViewer.prototype.get_fu = function () {
        return false;
    };
    Object.defineProperty(SeriesViewer.prototype, "fu", {
        get: function () {
            return this.get_fu();
        },
        enumerable: false,
        configurable: true
    });
    SeriesViewer.prototype.o4 = function () {
    };
    SeriesViewer.prototype.provideContainer = function (a) {
        this.c9.c0(a);
    };
    SeriesViewer.prototype.o3 = function (a, b) {
        this.c9.c1(a, b);
    };
    SeriesViewer.prototype.notifyContainerResized = function () {
        this.c9.cu();
    };
    SeriesViewer.prototype.wn = function () {
        return this.c9.fb();
    };
    SeriesViewer.prototype.nv = function () {
        this.c9.b5();
    };
    SeriesViewer.prototype.wa = function () {
        return this.c9.e8();
    };
    SeriesViewer.prototype.df = function () {
        return this.c9.t();
    };
    SeriesViewer.prototype.de = function () {
        return this.c9.q();
    };
    SeriesViewer.prototype.vo = function () {
        return this.c9.e0();
    };
    SeriesViewer.prototype.vp = function () {
        return this.c9.e3();
    };
    SeriesViewer.prototype.nh = function (a) {
        this.c9.bp(a);
    };
    SeriesViewer.prototype.rd = function (a) {
        this.c9.dy(a);
    };
    Object.defineProperty(SeriesViewer.prototype, "fr", {
        get: function () {
            return this.d7;
        },
        set: function (a) {
            var b = this.d7;
            this.d7 = a;
            if (b != this.d7) {
                this.c9.cr(this.d7);
            }
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(SeriesViewer.prototype, "ef", {
        get: function () {
            return this.dw;
        },
        set: function (a) {
            var b = this.dw;
            this.dw = a;
            if (b != this.dw) {
                this.c9.bk(this.dw);
            }
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(SeriesViewer.prototype, "syncSettings", {
        get: function () {
            return this._syncSettings;
        },
        set: function (a) {
            this._syncSettings = a;
        },
        enumerable: false,
        configurable: true
    });
    SeriesViewer.prototype.ng = function (a) {
        this.c9.bn(a);
    };
    SeriesViewer.prototype.rf = function (a) {
        this.c9.dz(a);
    };
    SeriesViewer.prototype.op = function (source_, a, b, c) {
        if (source_.dataView && source_.dataSource) {
            source_ = source_.dataView();
        }
        ;
        var d = this.actualSyncLink.ag(source_);
        if (d == null) {
            return;
        }
        d.handleCollectionChanged(new NotifyCollectionChangedEventArgs(2, 2, c, b, a));
    };
    SeriesViewer.prototype.og = function (source_) {
        if (source_.dataView && source_.dataSource) {
            source_ = source_.dataView();
        }
        ;
        var a = this.actualSyncLink.ag(source_);
        if (a == null) {
            return;
        }
        a.handleCollectionChanged(new NotifyCollectionChangedEventArgs(0, 4));
    };
    SeriesViewer.prototype.on = function (source_, a, b) {
        if (source_.dataView && source_.dataSource) {
            source_ = source_.dataView();
        }
        ;
        var c = this.actualSyncLink.ag(source_);
        if (c == null) {
            return;
        }
        c.handleCollectionChanged(new NotifyCollectionChangedEventArgs(1, 0, b, a));
    };
    SeriesViewer.prototype.oo = function (source_, a, b) {
        if (source_.dataView && source_.dataSource) {
            source_ = source_.dataView();
        }
        ;
        var c = this.actualSyncLink.ag(source_);
        if (c == null) {
            return;
        }
        c.handleCollectionChanged(new NotifyCollectionChangedEventArgs(1, 1, b, a));
    };
    SeriesViewer.prototype.destroy = function () {
        this.destroyed = true;
        var a = new List$1(Series.$, 0);
        for (var b = 0; b < this.series.count; b++) {
            a.add(this.series._inner[b]);
        }
        for (var c = 0; c < a.count; c++) {
            if (a._inner[c].cw != null) {
                a._inner[c].cw.as();
            }
            this.series.remove(a._inner[c]);
            this.re(a._inner[c].name, true);
            a._inner[c].itemsSource = null;
            a._inner[c].rd(null, null);
        }
        this.nt();
        this.rg();
        this.onDetachedFromUI();
        this.c9.c0(null);
    };
    SeriesViewer.prototype.nt = function () {
    };
    SeriesViewer.prototype.ro = function (source_) {
        if (source_.dataView && source_.dataSource) {
            source_ = source_.dataView();
        }
        ;
        this.je = source_;
        this.rx();
    };
    SeriesViewer.prototype.rg = function () {
        this.je = null;
        this.rx();
    };
    SeriesViewer.prototype.rn = function (a, source_) {
        if (source_.dataView && source_.dataSource) {
            source_ = source_.dataView();
        }
        ;
        if (stringIsNullOrEmpty(a) == false) {
            if (!this.gl.containsKey(a)) {
                this.gl.addItem(a, source_);
            }
            else {
                this.gl.item(a, source_);
            }
        }
        this.rx();
    };
    SeriesViewer.prototype.re = function (a, b) {
        if (stringIsNullOrEmpty(a) == false) {
            if (this.gl.containsKey(a)) {
                this.gl.removeItem(a);
            }
        }
        if (!b) {
            this.rx();
        }
    };
    SeriesViewer.prototype.rm = function (a, b) {
        if (a.itemsSource != b) {
            a.itemsSource = b;
        }
    };
    SeriesViewer.prototype.rw = function (a) {
        if (!this.fo) {
            return;
        }
        if (typeCast(Series.$, a) !== null) {
            var b = a;
            if (this.gl.containsKey(b.name)) {
                var c = this.gl.item(b.name);
                this.rm(b, c);
            }
            else {
                this.rm(b, this.je);
            }
        }
        if (typeCast(CategoryAxisBase.$, a) !== null) {
            var d = a;
            if (this.gl.containsKey(d.name)) {
                var e = this.gl.item(d.name);
                if (d.itemsSource != e) {
                    d.itemsSource = e;
                }
            }
            else {
                if (d.itemsSource != this.je) {
                    d.itemsSource = this.je;
                }
            }
        }
    };
    SeriesViewer.prototype.rx = function () {
        var e_24, _a;
        if (!this.fo) {
            return;
        }
        try {
            for (var _b = __values(fromEnum(this.series)), _c = _b.next(); !_c.done; _c = _b.next()) {
                var a = _c.value;
                this.rw(a);
            }
        }
        catch (e_24_1) {
            e_24 = { error: e_24_1 };
        }
        finally {
            try {
                if (_c && !_c.done && (_a = _b.return))
                    _a.call(_b);
            }
            finally {
                if (e_24)
                    throw e_24.error;
            }
        }
    };
    Object.defineProperty(SeriesViewer.prototype, "ij", {
        get: function () {
            return this.hi;
        },
        set: function (a) {
            this.hi = a;
            this.oc();
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(SeriesViewer.prototype, "h4", {
        get: function () {
            return this.g7;
        },
        set: function (a) {
            this.g7 = a;
            this.oc();
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(SeriesViewer.prototype, "h9", {
        get: function () {
            return this.g9;
        },
        set: function (a) {
            this.g9 = a;
            this.oc();
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(SeriesViewer.prototype, "hr", {
        get: function () {
            return this.g5;
        },
        set: function (a) {
            this.g5 = a;
            this.oc();
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(SeriesViewer.prototype, "hq", {
        get: function () {
            return this.g4;
        },
        set: function (a) {
            this.g4 = a;
            this.oc();
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(SeriesViewer.prototype, "hp", {
        get: function () {
            return this.g3;
        },
        set: function (a) {
            this.g3 = a;
            this.oc();
        },
        enumerable: false,
        configurable: true
    });
    SeriesViewer.prototype.f3 = function () {
        return false;
    };
    Object.defineProperty(SeriesViewer.prototype, "e3", {
        get: function () {
            return this.d2;
        },
        set: function (a) {
            var b = this.d2;
            this.d2 = a;
            this.qv("IsAntiAliasingEnabledDuringInteraction", b, this.d2);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(SeriesViewer.prototype, "h5", {
        get: function () {
            return this.g8;
        },
        set: function (a) {
            var b = this.g8;
            this.g8 = a;
            this.qv("PixelScalingRatio", b, this.g8);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(SeriesViewer.prototype, "h3", {
        get: function () {
            return this.g6;
        },
        set: function (a) {
            var b = this.g6;
            this.g6 = a;
            this.qv("InteractionPixelScalingRatio", b, this.g6);
        },
        enumerable: false,
        configurable: true
    });
    SeriesViewer.cu = function (a, b) {
        var c = new CoercionInfo();
        c.b = a;
        c.a = null;
        var d = FastItemsSource.f(a);
        if (d.d == null) {
            return c;
        }
        if (b != null) {
            var methods_ = b;
            var key_ = d.d;
            var val_ = null;
            if (typeof methods_[key_] != 'undefined') {
                val_ = methods_[key_];
            }
            ;
            c.b = d.c;
            c.a = val_;
        }
        else if (d.d == "defaultDateParse") {
            var e = defaultDVDateParse;
            c.b = d.c;
            c.a = e;
        }
        return c;
    };
    Object.defineProperty(SeriesViewer.prototype, "k9", {
        get: function () {
            return this.ji;
        },
        set: function (a) {
            this.ji = a;
            if (this.c2 == null) {
                return;
            }
            this.c2.backgroundImageUri = this.ji;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(SeriesViewer.prototype, "hk", {
        get: function () {
            return this.gy;
        },
        set: function (a) {
            var b = this.gy;
            this.gy = a;
            this.qv("ActualPixelScalingRatio", b, this.gy);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(SeriesViewer.prototype, "hj", {
        get: function () {
            return this.gx;
        },
        set: function (a) {
            var b = this.gx;
            this.gx = a;
            this.qv("ActualInteractionPixelScalingRatio", b, this.gx);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(SeriesViewer.prototype, "wh", {
        get: function () {
            return this.wc;
        },
        set: function (a) {
            var b = Rect.l_op_Inequality(this.wc, a);
            if (b) {
                var c = this.wc;
                this.wc = a;
                this.qv("ActualWindowRect", c, a);
            }
        },
        enumerable: false,
        configurable: true
    });
    SeriesViewer.prototype.wo = function () {
        return this.wh;
    };
    SeriesViewer.prototype.oa = function () {
        if (this.ez) {
            return;
        }
        this.wh = this.wi();
    };
    SeriesViewer.prototype.wt = function () {
        return Rect.empty;
    };
    SeriesViewer.prototype.wi = function () {
        var a = this.w0.left;
        var b = this.w0.top;
        var c = this.w0.width;
        var d = this.w0.height;
        if (this.cr == 1) {
            a = Math.min(1, Math.max(0, this.w0.left));
            c = Math.min(1, Math.max(0, this.w0.width));
        }
        if (this.cr == 1) {
            b = Math.min(1, Math.max(0, this.w0.top));
            d = Math.min(1, Math.max(0, this.w0.height));
        }
        return new Rect(0, a, b, c, d);
    };
    SeriesViewer.prototype.jg = function (a, b) {
        return this.c9.bj(a, b, this.hk);
    };
    Object.defineProperty(SeriesViewer.prototype, "hl", {
        get: function () {
            return this.gz;
        },
        set: function (a) {
            var b = this.gz;
            this.gz = a;
            this.qv("ActualWindowPositionHorizontal", b, this.gz);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(SeriesViewer.prototype, "hm", {
        get: function () {
            return this.g0;
        },
        set: function (a) {
            var b = this.g0;
            this.g0 = a;
            this.qv("ActualWindowPositionVertical", b, this.g0);
        },
        enumerable: false,
        configurable: true
    });
    SeriesViewer.prototype.or = function () {
        if (this.ec && this.c2 != null) {
            this.c2.surfaceIsDirty = true;
            this.c2.doRefresh(false);
        }
        this.np();
        this.ol();
    };
    SeriesViewer.prototype.oq = function () {
        if (this.ec && this.c2 != null) {
            this.c2.surfaceIsDirty = true;
            this.c2.doRefresh(false);
        }
        this.np();
    };
    SeriesViewer.prototype.flush = function () {
        this.n0(true, true, true);
    };
    SeriesViewer.prototype.n0 = function (a, b, c) {
        this.ar.y();
        if (a) {
            this.c9.b7();
            this.ar.y();
        }
        if (c) {
            this.al.l();
        }
        if (b) {
            this.c9.a.l();
        }
        this.gk = true;
    };
    SeriesViewer.prototype.gg = function () {
        return false;
    };
    SeriesViewer.prototype.ra = function (a, b) {
        if (this.sk != null) {
            this.rs(this.sk);
            this.sk = null;
            this.az = null;
        }
        this.sk = a;
        this.az = this.ar.k(2, a, b);
    };
    SeriesViewer.prototype.rs = function (a) {
        this.ar.ad(2, a);
        this.sk = null;
        this.az = null;
    };
    SeriesViewer.prototype.nr = function () {
        this.ar.ac(2, this.sk, this.az, false);
    };
    SeriesViewer.prototype.ph = function () {
        var a = false;
        var b = false;
        var c = false;
        for (var d = 0; d < this.series.count; d++) {
            var e = this.series._inner[d];
            if (e.e3) {
                a = true;
            }
            if (e.e4) {
                b = true;
            }
            if (e.eu) {
                c = true;
            }
        }
        this.e4 = a;
        this.e5 = b;
        this.e2 = c;
    };
    Object.defineProperty(SeriesViewer.prototype, "fh", {
        get: function () {
            return this.ec;
        },
        enumerable: false,
        configurable: true
    });
    SeriesViewer.prototype.ni = function () {
        this.c9.bq();
        for (var a = 0; a < this.series.count; a++) {
            this.series._inner[a].qr();
        }
    };
    SeriesViewer.prototype.fn = function () {
        return this.c9.am();
    };
    SeriesViewer.prototype.i7 = function () {
        var a = this.i1;
        this.i1++;
        return a;
    };
    SeriesViewer.prototype.di = function () {
        if (this.mj == null || this.c9.j.ae == null) {
            return null;
        }
        return FontUtil.toFontInfo(this.c9.j.ae, this.mj);
    };
    SeriesViewer.prototype.dh = function () {
        if (this.l7 == null || this.c9.j.ae == null) {
            return null;
        }
        return FontUtil.toFontInfo(this.c9.j.ae, this.l7);
    };
    SeriesViewer.prototype.rv = function () {
        var a = false;
        a = this.ef;
        this.e0 = true;
        this.eq = (a && !this.gh) || this.w4 == 0;
        this.e0 = false;
    };
    SeriesViewer.prototype.q0 = function () {
        if (this.seriesDataUpdated != null) {
            this.seriesDataUpdated(this, EventArgs.empty);
        }
    };
    SeriesViewer.prototype.ok = function () {
        for (var a = 0; a < this.gq.count; a++) {
            this.gq._inner[a].notifySeriesCollectionChanged();
        }
    };
    SeriesViewer.prototype.ol = function () {
        for (var a = 0; a < this.gq.count; a++) {
            this.gq._inner[a].notifySeriesDataChanged();
        }
        this.notifySeriesDataChanged();
    };
    SeriesViewer.prototype.om = function (a) {
        for (var b = 0; b < this.gq.count; b++) {
            this.gq._inner[b].notifyVisualPropertiesChanged(a);
        }
    };
    SeriesViewer.prototype.oj = function (a) {
        for (var b = 0; b < this.gq.count; b++) {
            this.gq._inner[b].notifyCursorPositionChanged(a);
        }
    };
    SeriesViewer.prototype.attachDataLegend = function (a) {
        this.gq.add(a);
    };
    SeriesViewer.prototype.detachDataLegend = function (a) {
        this.gq.remove(a);
    };
    Object.defineProperty(SeriesViewer.prototype, "isDetached", {
        get: function () {
            return this.destroyed || this.d3;
        },
        enumerable: false,
        configurable: true
    });
    SeriesViewer.prototype.getDataLegendSeries = function () {
        var a = 0;
        for (var b = 0; b < this.series.count; b++) {
            if (this.series._inner[b].isStacked) {
                this.series._inner[b].p5(function (c) {
                    if (c.isUsableInLegend) {
                        a++;
                    }
                    if (c.ei) {
                        c.p3(function (d) {
                            if (d.isUsableInLegend) {
                                a++;
                            }
                            return true;
                        });
                    }
                    return true;
                });
            }
            else if (this.series._inner[b].ei) {
                if (this.series._inner[b].isUsableInLegend) {
                    a++;
                }
                this.series._inner[b].p3(function (c) {
                    if (c.isUsableInLegend) {
                        a++;
                    }
                    return true;
                });
            }
            else {
                if (this.series._inner[b].isUsableInLegend) {
                    a++;
                }
            }
        }
        var c = new Array(a);
        var d = 0;
        for (var e = 0; e < this.series.count; e++) {
            if (this.series._inner[e].isStacked) {
                this.series._inner[e].p5(function (f) {
                    if (f.isUsableInLegend) {
                        c[d] = f;
                        d++;
                    }
                    if (f.ei) {
                        f.p3(function (g) {
                            if (g.isUsableInLegend) {
                                c[d] = g;
                                d++;
                            }
                            return true;
                        });
                    }
                    return true;
                });
            }
            else if (this.series._inner[e].ei) {
                if (this.series._inner[e].isUsableInLegend) {
                    c[d] = this.series._inner[e];
                    d++;
                }
                this.series._inner[e].p3(function (f) {
                    if (f.isUsableInLegend) {
                        c[d] = f;
                        d++;
                    }
                    return true;
                });
            }
            else {
                if (this.series._inner[e].isUsableInLegend) {
                    c[d] = this.series._inner[e];
                    d++;
                }
            }
        }
        return c;
    };
    SeriesViewer.prototype.nf = function (a) {
        var e_25, _a;
        var b = this.wy(a);
        var c = new List$1(ChartSelection.$, 0);
        try {
            for (var _b = __values(fromEnum(this.series)), _c = _b.next(); !_c.done; _c = _b.next()) {
                var d = _c.value;
                d.p6(b, c, this.b4);
            }
        }
        catch (e_25_1) {
            e_25 = { error: e_25_1 };
        }
        finally {
            try {
                if (_c && !_c.done && (_a = _b.return))
                    _a.call(_b);
            }
            finally {
                if (e_25)
                    throw e_25.error;
            }
        }
        if (c.count == 0) {
            return;
        }
        c = this.gu(c, this.b4);
        c = this.gv(c, this.b4);
        var e = this.gr(this.selectedSeriesItems, c, this.b4);
        for (var f = 0; f < e.count; f++) {
            this.selectedSeriesItems.remove(e._inner[f]);
        }
        for (var g = 0; g < c.count; g++) {
            this.selectedSeriesItems.add(c._inner[g]);
        }
    };
    SeriesViewer.prototype.ww = function (a) {
        a = new Rect(0, a.left, a.top, a.width, a.height);
        var b = this.wz;
        var c = this.wh.left + this.wh.width * (a.left - b.left) / b.width;
        var d = this.wh.top + this.wh.height * (a.top - b.top) / b.height;
        var e = this.wh.left + this.wh.width * (a.right - b.left) / b.width;
        var f = this.wh.top + this.wh.height * (a.bottom - b.top) / b.height;
        return new Rect(0, c, d, e - c, f - d);
    };
    SeriesViewer.prototype.wx = function (a) {
        a = new Rect(0, a.left + this.wz.left, a.top + this.wz.top, a.width, a.height);
        return this.ww(a);
    };
    SeriesViewer.prototype.nk = function (a) {
        if (this.gt == null) {
            this.gt = new List$1(CaptureImageSettings.$, 0);
        }
        this.gt.add(a);
        this.ar.z();
    };
    SeriesViewer.prototype.nl = function () {
        var _this = this;
        if (this.gt != null && this.gt.count > 0) {
            var a = this.gt.toArray();
            this.gt.clear();
            var _loop_1 = function (c) {
                var b = a[c];
                this_1.jx(b, function (d, e) {
                    if (d != null) {
                        _this.qu(b, d, e);
                    }
                });
            };
            var this_1 = this;
            for (var c = 0; c < a.length; c++) {
                _loop_1(c);
            }
        }
    };
    SeriesViewer.prototype.jx = function (a, b) {
        var c = "image/png";
        switch (a.a) {
            case 0:
                c = "image/png";
                break;
            case 1:
                c = "image/jpeg";
                break;
            default: return null;
        }
        var d = null;
        d = this.c9.j.at(this.c9.a8, this.c9.a7, this.hk, c, function (e, f) {
            var _a;
            if (a.b) {
                var b_ = f;
                if ((window.ClipboardItem)) {
                    navigator.clipboard.write([new window.ClipboardItem((_a = {}, _a[b_.type] = b_, _a))]);
                }
            }
            if (b != null) {
                b(e, f);
            }
        });
        return d;
    };
    SeriesViewer.prototype.qu = function (a, b, c) {
        if (c === void 0) {
            c = null;
        }
        if (this.imageCaptured != null) {
            var d = new ImageCapturedEventArgs(b, c, a);
            this.imageCaptured(this, d);
        }
    };
    SeriesViewer.prototype.notifySeriesDataChanged = function () {
        if (this.seriesDataChanged != null) {
            this.seriesDataChanged(this, null);
        }
    };
    SeriesViewer.$t = markType(SeriesViewer, 'SeriesViewer', Control.$, [INotifyPropertyChanged_$type, ILegendOwner_$type, IInternalLegendOwner_$type, IDataLegendTarget_$type, IToolbarTarget_$type, ISupportsAnimation_$type]);
    SeriesViewer.tp = DependencyProperty.i("Legend", IChartLegend_$type, SeriesViewer.$, new PropertyMetadata(2, null, function (a, b) {
        var c = typeCast(SeriesViewer.$, a);
        c.qv("Legend", b.oldValue, b.newValue);
    }));
    SeriesViewer.sm = DependencyProperty.i("AnimateSeriesWhenAxisRangeChanges", Boolean_$type, SeriesViewer.$, new PropertyMetadata(2, false, function (a, b) {
        var c = typeCast(SeriesViewer.$, a);
        c.qv("AnimateSeriesWhenAxisRangeChanges", b.oldValue, b.newValue);
    }));
    SeriesViewer.ud = DependencyProperty.i("SeriesValueLayerUseLegend", Boolean_$type, SeriesViewer.$, new PropertyMetadata(2, false, function (a, b) {
        var c = typeCast(SeriesViewer.$, a);
        c.qv("SeriesValueLayerUseLegend", b.oldValue, b.newValue);
    }));
    SeriesViewer.tl = DependencyProperty.i("IsWindowSyncedToVisibleRange", Boolean_$type, SeriesViewer.$, new PropertyMetadata(2, false, function (a, b) {
        var c = typeCast(SeriesViewer.$, a);
        c.qv("IsWindowSyncedToVisibleRange", b.oldValue, b.newValue);
    }));
    SeriesViewer.ug = DependencyProperty.i("ShouldSimulateHoverMoveCrosshairPoint", Boolean_$type, SeriesViewer.$, new PropertyMetadata(2, false, function (a, b) {
        var c = typeCast(SeriesViewer.$, a);
        c.qv("ShouldSimulateHoverMoveCrosshairPoint", b.oldValue, b.newValue);
    }));
    SeriesViewer.s3 = DependencyProperty.i("HighlightingMode", SeriesHighlightingMode_$type, SeriesViewer.$, new PropertyMetadata(2, enumGetBox(SeriesHighlightingMode_$type, 0), function (a, b) {
        var c = typeCast(SeriesViewer.$, a);
        c.qv("HighlightingMode", b.oldValue, b.newValue);
    }));
    SeriesViewer.ua = DependencyProperty.i("SelectionMode", SeriesSelectionMode_$type, SeriesViewer.$, new PropertyMetadata(2, enumGetBox(SeriesSelectionMode_$type, 0), function (a, b) {
        var c = typeCast(SeriesViewer.$, a);
        c.qv("SelectionMode", b.oldValue, b.newValue);
    }));
    SeriesViewer.t7 = DependencyProperty.i("SelectionBehavior", SeriesSelectionBehavior_$type, SeriesViewer.$, new PropertyMetadata(2, enumGetBox(SeriesSelectionBehavior_$type, 0), function (a, b) {
        var c = typeCast(SeriesViewer.$, a);
        c.qv("SelectionBehavior", b.oldValue, b.newValue);
    }));
    SeriesViewer.sw = DependencyProperty.i("FocusMode", SeriesSelectionMode_$type, SeriesViewer.$, new PropertyMetadata(2, enumGetBox(SeriesSelectionMode_$type, 0), function (a, b) {
        var c = typeCast(SeriesViewer.$, a);
        c.qv("FocusMode", b.oldValue, b.newValue);
    }));
    SeriesViewer.tb = DependencyProperty.i("HorizontalViewScrollbarMode", SeriesViewerScrollbarMode_$type, SeriesViewer.$, new PropertyMetadata(2, enumGetBox(SeriesViewerScrollbarMode_$type, 0), function (a, b) {
        var c = typeCast(SeriesViewer.$, a);
        c.qv("HorizontalViewScrollbarMode", b.oldValue, b.newValue);
    }));
    SeriesViewer.uu = DependencyProperty.i("VerticalViewScrollbarMode", SeriesViewerScrollbarMode_$type, SeriesViewer.$, new PropertyMetadata(2, enumGetBox(SeriesViewerScrollbarMode_$type, 0), function (a, b) {
        var c = typeCast(SeriesViewer.$, a);
        c.qv("VerticalViewScrollbarMode", b.oldValue, b.newValue);
    }));
    SeriesViewer.td = DependencyProperty.i("HorizontalViewScrollbarPosition", SeriesViewerHorizontalScrollbarPosition_$type, SeriesViewer.$, new PropertyMetadata(2, enumGetBox(SeriesViewerHorizontalScrollbarPosition_$type, 0), function (a, b) {
        var c = typeCast(SeriesViewer.$, a);
        c.qv("HorizontalViewScrollbarPosition", b.oldValue, b.newValue);
    }));
    SeriesViewer.uw = DependencyProperty.i("VerticalViewScrollbarPosition", SeriesViewerVerticalScrollbarPosition_$type, SeriesViewer.$, new PropertyMetadata(2, enumGetBox(SeriesViewerVerticalScrollbarPosition_$type, 0), function (a, b) {
        var c = typeCast(SeriesViewer.$, a);
        c.qv("VerticalViewScrollbarPosition", b.oldValue, b.newValue);
    }));
    SeriesViewer.s7 = DependencyProperty.i("HorizontalViewScrollbarFill", Brush.$, SeriesViewer.$, new PropertyMetadata(2, null, function (a, b) {
        var c = typeCast(SeriesViewer.$, a);
        c.qv("HorizontalViewScrollbarFill", b.oldValue, b.newValue);
    }));
    SeriesViewer.tc = DependencyProperty.i("HorizontalViewScrollbarOutline", Brush.$, SeriesViewer.$, new PropertyMetadata(2, null, function (a, b) {
        var c = typeCast(SeriesViewer.$, a);
        c.qv("HorizontalViewScrollbarOutline", b.oldValue, b.newValue);
    }));
    SeriesViewer.tf = DependencyProperty.i("HorizontalViewScrollbarStrokeThickness", Number_$type, SeriesViewer.$, new PropertyMetadata(2, NaN, function (a, b) {
        var c = typeCast(SeriesViewer.$, a);
        c.qv("HorizontalViewScrollbarStrokeThickness", b.oldValue, b.newValue);
    }));
    SeriesViewer.ta = DependencyProperty.i("HorizontalViewScrollbarMaxOpacity", Number_$type, SeriesViewer.$, new PropertyMetadata(2, NaN, function (a, b) {
        var c = typeCast(SeriesViewer.$, a);
        c.qv("HorizontalViewScrollbarMaxOpacity", b.oldValue, b.newValue);
    }));
    SeriesViewer.s6 = DependencyProperty.i("HorizontalViewScrollbarCornerRadius", Number_$type, SeriesViewer.$, new PropertyMetadata(2, NaN, function (a, b) {
        var c = typeCast(SeriesViewer.$, a);
        c.qv("HorizontalViewScrollbarCornerRadius", b.oldValue, b.newValue);
    }));
    SeriesViewer.s8 = DependencyProperty.i("HorizontalViewScrollbarHeight", Number_$type, SeriesViewer.$, new PropertyMetadata(2, NaN, function (a, b) {
        var c = typeCast(SeriesViewer.$, a);
        c.qv("HorizontalViewScrollbarHeight", b.oldValue, b.newValue);
    }));
    SeriesViewer.s9 = DependencyProperty.i("HorizontalViewScrollbarInset", Number_$type, SeriesViewer.$, new PropertyMetadata(2, NaN, function (a, b) {
        var c = typeCast(SeriesViewer.$, a);
        c.qv("HorizontalViewScrollbarInset", b.oldValue, b.newValue);
    }));
    SeriesViewer.th = DependencyProperty.i("HorizontalViewScrollbarTrackStartInset", Number_$type, SeriesViewer.$, new PropertyMetadata(2, NaN, function (a, b) {
        var c = typeCast(SeriesViewer.$, a);
        c.qv("HorizontalViewScrollbarTrackStartInset", b.oldValue, b.newValue);
    }));
    SeriesViewer.tg = DependencyProperty.i("HorizontalViewScrollbarTrackEndInset", Number_$type, SeriesViewer.$, new PropertyMetadata(2, NaN, function (a, b) {
        var c = typeCast(SeriesViewer.$, a);
        c.qv("HorizontalViewScrollbarTrackEndInset", b.oldValue, b.newValue);
    }));
    SeriesViewer.kr = "HorizontalViewScrollbarShouldAddAutoTrackInsets";
    SeriesViewer.te = DependencyProperty.i(SeriesViewer.kr, Boolean_$type, SeriesViewer.$, new PropertyMetadata(2, true, function (a, b) {
        var c = typeCast(SeriesViewer.$, a);
        c.qv(SeriesViewer.kr, b.oldValue, b.newValue);
    }));
    SeriesViewer.ur = DependencyProperty.i("VerticalViewScrollbarFill", Brush.$, SeriesViewer.$, new PropertyMetadata(2, null, function (a, b) {
        var c = typeCast(SeriesViewer.$, a);
        c.qv("VerticalViewScrollbarFill", b.oldValue, b.newValue);
    }));
    SeriesViewer.uv = DependencyProperty.i("VerticalViewScrollbarOutline", Brush.$, SeriesViewer.$, new PropertyMetadata(2, null, function (a, b) {
        var c = typeCast(SeriesViewer.$, a);
        c.qv("VerticalViewScrollbarOutline", b.oldValue, b.newValue);
    }));
    SeriesViewer.uy = DependencyProperty.i("VerticalViewScrollbarStrokeThickness", Number_$type, SeriesViewer.$, new PropertyMetadata(2, NaN, function (a, b) {
        var c = typeCast(SeriesViewer.$, a);
        c.qv("VerticalViewScrollbarStrokeThickness", b.oldValue, b.newValue);
    }));
    SeriesViewer.ut = DependencyProperty.i("VerticalViewScrollbarMaxOpacity", Number_$type, SeriesViewer.$, new PropertyMetadata(2, NaN, function (a, b) {
        var c = typeCast(SeriesViewer.$, a);
        c.qv("VerticalViewScrollbarMaxOpacity", b.oldValue, b.newValue);
    }));
    SeriesViewer.uq = DependencyProperty.i("VerticalViewScrollbarCornerRadius", Number_$type, SeriesViewer.$, new PropertyMetadata(2, NaN, function (a, b) {
        var c = typeCast(SeriesViewer.$, a);
        c.qv("VerticalViewScrollbarCornerRadius", b.oldValue, b.newValue);
    }));
    SeriesViewer.u1 = DependencyProperty.i("VerticalViewScrollbarWidth", Number_$type, SeriesViewer.$, new PropertyMetadata(2, NaN, function (a, b) {
        var c = typeCast(SeriesViewer.$, a);
        c.qv("VerticalViewScrollbarWidth", b.oldValue, b.newValue);
    }));
    SeriesViewer.us = DependencyProperty.i("VerticalViewScrollbarInset", Number_$type, SeriesViewer.$, new PropertyMetadata(2, NaN, function (a, b) {
        var c = typeCast(SeriesViewer.$, a);
        c.qv("VerticalViewScrollbarInset", b.oldValue, b.newValue);
    }));
    SeriesViewer.u0 = DependencyProperty.i("VerticalViewScrollbarTrackStartInset", Number_$type, SeriesViewer.$, new PropertyMetadata(2, NaN, function (a, b) {
        var c = typeCast(SeriesViewer.$, a);
        c.qv("VerticalViewScrollbarTrackStartInset", b.oldValue, b.newValue);
    }));
    SeriesViewer.uz = DependencyProperty.i("VerticalViewScrollbarTrackEndInset", Number_$type, SeriesViewer.$, new PropertyMetadata(2, NaN, function (a, b) {
        var c = typeCast(SeriesViewer.$, a);
        c.qv("VerticalViewScrollbarTrackEndInset", b.oldValue, b.newValue);
    }));
    SeriesViewer.mx = "VerticalViewScrollbarShouldAddAutoTrackInsets";
    SeriesViewer.ux = DependencyProperty.i(SeriesViewer.mx, Boolean_$type, SeriesViewer.$, new PropertyMetadata(2, true, function (a, b) {
        var c = typeCast(SeriesViewer.$, a);
        c.qv(SeriesViewer.mx, b.oldValue, b.newValue);
    }));
    SeriesViewer.s1 = DependencyProperty.i("HighlightingBehavior", SeriesHighlightingBehavior_$type, SeriesViewer.$, new PropertyMetadata(2, enumGetBox(SeriesHighlightingBehavior_$type, 0), function (a, b) {
        var c = typeCast(SeriesViewer.$, a);
        c.qv("HighlightingBehavior", b.oldValue, b.newValue);
    }));
    SeriesViewer.tm = DependencyProperty.i("LegendHighlightingMode", LegendHighlightingMode_$type, SeriesViewer.$, new PropertyMetadata(2, enumGetBox(LegendHighlightingMode_$type, 0), function (a, b) {
        var c = typeCast(SeriesViewer.$, a);
        c.qv("LegendHighlightingMode", b.oldValue, b.newValue);
    }));
    SeriesViewer.to = DependencyProperty.i("LegendItemBadgeShape", LegendItemBadgeShape_$type, SeriesViewer.$, new PropertyMetadata(2, enumGetBox(LegendItemBadgeShape_$type, 0), function (a, b) {
        var c = typeCast(SeriesViewer.$, a);
        c.qv("LegendItemBadgeShape", b.oldValue, b.newValue);
    }));
    SeriesViewer.tn = DependencyProperty.i("LegendItemBadgeMode", LegendItemBadgeMode_$type, SeriesViewer.$, new PropertyMetadata(2, enumGetBox(LegendItemBadgeMode_$type, 0), function (a, b) {
        var c = typeCast(SeriesViewer.$, a);
        c.qv("LegendItemBadgeMode", b.oldValue, b.newValue);
    }));
    SeriesViewer.st = DependencyProperty.i("FireMouseLeaveOnManipulationStart", Boolean_$type, SeriesViewer.$, new PropertyMetadata(2, false, function (a, b) {
        var c = typeCast(SeriesViewer.$, a);
        c.qv("FireMouseLeaveOnManipulationStart", b.oldValue, b.newValue);
    }));
    SeriesViewer.wu = Rect.empty;
    SeriesViewer.$$p = markDep(DependencyProperty, PropertyMetadata, SeriesViewer, 'qv', ['ActualPlotAreaBorderBrush:vj:sl', [Brush.$, null], 'Brushes:ag:sn', [BrushCollection.$, null], 'CircleMarkerTemplate:sa:so', [DataTemplate.$, null], 'CrosshairVisibility:w4:sp', [Visibility_$type, enumGetBox(Visibility_$type, 0)], 'DefaultInteraction:cw:sq', [InteractionState_$type, enumGetBox(InteractionState_$type, 4)], 'DiamondMarkerTemplate:sb:sr', [DataTemplate.$, null], 'DragModifier:ve:ss', [ModifierKeys_$type, enumGetBox(ModifierKeys_$type, 2)], 'FocusBrush:vk:su', [Brush.$, null], 'FocusDismissDelayMilliseconds:i5:sv', [1, 200], 'FocusTransitionDuration:i6:sx', [1, 100], 'HexagonMarkerTemplate:sc:sy', [DataTemplate.$, null], 'HexagramMarkerTemplate:sd:sz', [DataTemplate.$, null], 'HighlightedValuesDisplayMode:bt:s0', [SeriesHighlightedValuesDisplayMode_$type, enumGetBox(SeriesHighlightedValuesDisplayMode_$type, 0)], 'HighlightingDismissDelayMilliseconds:i8:s2', [1, 200], 'HighlightingTransitionDuration:i9:s4', [1, 300], 'HorizontalCrosshairBrush:vu:s5', [Brush.$, null], 'InteractionOverride:cx:ti', [InteractionState_$type, enumGetBox(InteractionState_$type, 0)], 'IsPagePanningAllowed:fe:tj', [0, true], 'IsSurfaceInteractionDisabled:ff:tk', [0, false], 'MarkerAutomaticBehavior:bg:tq', [MarkerAutomaticBehavior_$type, enumGetBox(MarkerAutomaticBehavior_$type, 4)], 'MarkerBrushes:ah:tr', [BrushCollection.$, null], 'MarkerOutlines:ai:ts', [BrushCollection.$, null], 'Outlines:aj:tt', [BrushCollection.$, null], 'OverviewPlusDetailPaneVisibility:w5:tu', [Visibility_$type, enumGetBox(Visibility_$type, 1)], 'PanModifier:vf:tv', [ModifierKeys_$type, enumGetBox(ModifierKeys_$type, 4)], 'PentagonMarkerTemplate:se:tw', [DataTemplate.$, null], 'PentagramMarkerTemplate:sf:tx', [DataTemplate.$, null], 'PlotAreaBackground:vx:ty', [Brush.$, null], 'PlotAreaBorderBrush:vy:tz', [Brush.$, null], 'PreferHigherResolutionTiles:fz:t0', [0, false], 'PreviewPathFill:vz:t1', [Brush.$, null], 'PreviewPathOpacity:h6:t2', [1, NaN], 'PreviewPathStroke:v0:t3', [Brush.$, null], 'PyramidMarkerTemplate:sg:t4', [DataTemplate.$, null], 'RightButtonDefaultInteraction:cz:t5', [InteractionState_$type, enumGetBox(InteractionState_$type, 4)], 'ScrollbarsAnimationDuration:ja:t6', [1, 300], 'SelectionBrush:v1:t8', [Brush.$, null], 'SelectionDismissDelayMilliseconds:jb:t9', [1, 200], 'SelectionModifier:vg:ub', [ModifierKeys_$type, enumGetBox(ModifierKeys_$type, 1)], 'SelectionTransitionDuration:jc:uc', [1, 300], 'ShouldMatchZOrderToSeriesOrder:f5:ue', [0, false], 'ShouldPanOnMaximumZoom:f6:uf', [0, true], 'SquareMarkerTemplate:sh:uh', [DataTemplate.$, null], 'SubtitleHorizontalAlignment:vc:ui', [HorizontalAlignment_$type, enumGetBox(HorizontalAlignment_$type, 1)], 'Subtitle:l0:uj', [2, null], 'TetragramMarkerTemplate:si:uk', [DataTemplate.$, null], 'TitleHorizontalAlignment:vd:ul', [HorizontalAlignment_$type, enumGetBox(HorizontalAlignment_$type, 1)], 'Title:mc:um', [2, null], 'TriangleMarkerTemplate:sj:un', [DataTemplate.$, null], 'UseTiledZooming:gi:uo', [0, false], 'VerticalCrosshairBrush:v4:up', [Brush.$, null], 'WindowPositionHorizontal:is:u2', [1, NaN], 'WindowPositionVertical:it:u3', [1, NaN], 'WindowRectMinHeight:iu:u4', [1, NaN], 'WindowRectMinWidth:iv:u5', [1, NaN], 'WindowRect:w0:u6', [Rect.$, new Rect(0, 0, 0, 1, 1)], 'WindowResponse:cp:u7', [WindowResponse_$type, enumGetBox(WindowResponse_$type, 1)], 'WindowSizeMinHeight:iw:u8', [1, NaN], 'WindowSizeMinWidth:ix:u9', [1, NaN], 'ZoomCoercionMode:ct:va', [ZoomCoercionMode_$type, enumGetBox(ZoomCoercionMode_$type, 0)], 'ZoomTileCacheSize:jd:vb', [1, 30]]);
    return SeriesViewer;
}(Control));
export { SeriesViewer };
/**
 * @hidden
 */
var SeriesViewerView = /** @class */ /*@__PURE__*/ (function (_super) {
    __extends(SeriesViewerView, _super);
    function SeriesViewerView(a) {
        var _this = _super.call(this) || this;
        _this.p = null;
        _this.a = null;
        _this.n = null;
        _this.o = null;
        _this.g = null;
        _this.b = null;
        _this.ai = false;
        _this.fi = null;
        _this.ff = null;
        _this.fe = null;
        _this.fd = null;
        _this.h = new SeriesViewerComponentsFromView();
        _this.j = null;
        _this.w = null;
        _this.z = null;
        _this.y = null;
        _this.x = null;
        _this.an = false;
        _this.ao = false;
        _this.bi = null;
        _this.k = null;
        _this.a9 = 0;
        _this.a8 = 0;
        _this.a7 = 0;
        _this.e9 = Rect.empty;
        _this.aj = false;
        _this.fg = null;
        _this.fh = null;
        _this.a1 = 0;
        _this.az = 0;
        _this.a0 = 0;
        _this.ay = 0;
        _this.ak = true;
        _this.aa = false;
        _this.a2 = NaN;
        _this.fa = Rect.empty;
        _this.ab = false;
        _this.af = false;
        _this.ae = false;
        _this.av = false;
        _this.et = null;
        _this.es = null;
        _this.ad = false;
        _this.ac = false;
        _this.ag = true;
        _this.ax = null;
        _this.ar = false;
        _this.bg = 0;
        _this.ah = true;
        _this.a8 = 0;
        _this.a7 = 0;
        _this.p = a;
        _this.p.v8 = { $type: Point_$type, x: NaN, y: NaN };
        _this.p.cp = 1;
        _this.j = new SeriesViewerViewManager(_this);
        _this.fd = ((function () {
            var $ret = new Line();
            $ret.visibility = 1;
            return $ret;
        })());
        _this.fe = ((function () {
            var $ret = new Line();
            $ret.visibility = 1;
            return $ret;
        })());
        return _this;
    }
    SeriesViewerView.prototype.l = function () {
        return new DOMExecutionContext(this.j.ae);
    };
    SeriesViewerView.prototype.co = function () {
        this.j.ba();
    };
    SeriesViewerView.prototype.c4 = function () {
        this.p.e0 = true;
        this.p.w4 = 1;
        this.p.e0 = false;
        this.ff = new Path();
        this.fi = new Rectangle();
        this.fi._visibility = 1;
        this.d6();
        this.g = new SeriesCollection();
        this.b = new AxisCollection();
        this.a = new CanvasRenderScheduler();
        this.a.o(this);
        this.a.h.add(this.p.am);
        if (this.p.w5 == 0) {
            this.cn();
        }
        var a = this.p;
        a.windowRectChanged = delegateCombine(a.windowRectChanged, runOn(this, this.ct));
        var b = this.p;
        b.gridAreaRectChanged = delegateCombine(b.gridAreaRectChanged, runOn(this, this.cs));
        this.o = new OverviewPlusDetailViewportHost(this);
        this.dp();
    };
    SeriesViewerView.prototype.e = function () {
        for (var a = 0; a < this.g.count; a++) {
            if (this.g._inner[a].ba.a$e) {
                return this.g._inner[a];
            }
        }
        return null;
    };
    SeriesViewerView.prototype.cn = function () {
        if (this.n == null) {
            this.n = this.j.g();
        }
        this.p.c2.provideContext(this.z);
        this.p.c2.provideContainer(this.bi);
        this.p.c2.provideEventSource(this.k);
        this.n.world = new Rect(0, 0, 0, 1, 1);
        this.n.window = this.p.w0;
        this.n.surfaceViewer = TypeRegistrar.create("SeriesViewerSurfaceViewer", this.p, this);
        this.n.viewScheduler = this.a;
        this.em();
        var a = this.n;
        a.windowChanging = delegateCombine(a.windowChanging, runOn(this, this.dn));
        var b = this.n;
        b.windowChanged = delegateCombine(b.windowChanged, runOn(this, this.dm));
    };
    SeriesViewerView.prototype.dn = function (a, b) {
        var c = b.newValue;
        if (this.n != null) {
            c = this.n.changeRect(b.oldValue, b.newValue, this.p.fl(), this.p.fm(), this.n.world);
        }
        if (c.isEmpty) {
            this.n.window = b.oldValue;
        }
        else if (!c.equals1(b.newValue)) {
            this.n.window = c;
        }
        if (this.p.cp == 1) {
            var d = this.p.wz.width / this.p.wz.height;
            c = new Rect(0, c.left / d, c.top, c.width / d, c.height);
            this.p.w0 = c;
        }
    };
    SeriesViewerView.prototype.dm = function (a, b) {
        var c = b.newValue;
        if (this.n != null) {
            c = this.n.changeRect(b.oldValue, b.newValue, this.p.fl(), this.p.fm(), this.n.world);
        }
        if (c.isEmpty) {
            c = b.oldValue;
        }
        else if (!c.equals1(b.newValue)) {
            this.n.window = c;
        }
        var d = this.p.wz.width / this.p.wz.height;
        c = new Rect(0, c.left / d, c.top, c.width / d, c.height);
        this.p.w0 = c;
    };
    SeriesViewerView.prototype.em = function () {
        if (this.n == null) {
            return;
        }
        if (this.p.w5 != 0) {
            return;
        }
        var a = 1;
        if (this.p.wz.isEmpty == false) {
            a = this.p.wz.width / this.p.wz.height;
        }
        var b = this.n.world;
        var c = new Rect(0, 0, 0, a, 1);
        this.n.world = c;
        if (b.width != c.width || b.height != c.height || b.x != c.x || b.y != c.y) {
            this.n.surfaceViewer.isDirty = true;
        }
        this.n.window = new Rect(0, this.p.w0.left * a, this.p.w0.top, this.p.w0.width * a, this.p.w0.height);
    };
    SeriesViewerView.prototype.ct = function (a, b) {
        this.em();
    };
    SeriesViewerView.prototype.cs = function (a, b) {
        this.em();
    };
    SeriesViewerView.prototype.cb = function (a, b, c) {
        var e_26, _a;
        var d = true;
        try {
            for (var _b = __values(fromEnum(this.p.series)), _c = _b.next(); !_c.done; _c = _b.next()) {
                var e = _c.value;
                if (d && e.g1) {
                    d = false;
                    if (!c.a.e) {
                        c.a.l(0, 0, a, b);
                    }
                }
                e.rw(new Rect(0, 0, 0, a, b), c);
            }
        }
        catch (e_26_1) {
            e_26 = { error: e_26_1 };
        }
        finally {
            try {
                if (_c && !_c.done && (_a = _b.return))
                    _a.call(_b);
            }
            finally {
                if (e_26)
                    throw e_26.error;
            }
        }
    };
    SeriesViewerView.prototype.d5 = function () {
        this.j.bm();
    };
    SeriesViewerView.prototype.cd = function () {
    };
    SeriesViewerView.prototype.d7 = function () {
        this.j.bn();
    };
    SeriesViewerView.prototype.ck = function () {
        for (var a = 0; a < this.p.series.count; a++) {
            this.p.series._inner[a].cw.a1();
        }
    };
    SeriesViewerView.prototype.cc = function () {
    };
    SeriesViewerView.prototype.ce = function () {
    };
    SeriesViewerView.prototype.dy = function (a) {
        var _this = this;
        var b = this.g.indexOf(a);
        if (b >= 0) {
            this.g.removeAt(b);
        }
        if (a.isStacked) {
            a.p5(function (c) {
                c.dc = null;
                b = _this.g.indexOf(c);
                if (b >= 0) {
                    _this.g.removeAt(b);
                }
                if (c.ei) {
                    c.p3(function (d) {
                        d.dc = null;
                        b = _this.g.indexOf(d);
                        if (b >= 0) {
                            _this.g.removeAt(b);
                        }
                        return true;
                    });
                }
                return true;
            });
        }
        if (a.ei) {
            a.p3(function (c) {
                c.dc = null;
                b = _this.g.indexOf(c);
                if (b >= 0) {
                    _this.g.removeAt(b);
                }
                return true;
            });
        }
        this.p.q7();
        a.rd(null, null);
        this.dc();
    };
    SeriesViewerView.prototype.dc = function () {
        if (this.p.destroyed) {
            return;
        }
        if (this.g.count == 0) {
            if (this.y != null && Rect.l_op_Inequality(this.p.wz, null) && !this.p.wz.isEmpty) {
                this.er();
            }
        }
        this.p.al.r(this.y, this.x);
    };
    SeriesViewerView.prototype.er = function () {
        if (this.g.count > 0) {
            return;
        }
        if (this.y != null && Rect.l_op_Inequality(this.p.wz, null) && !this.p.wz.isEmpty) {
            if (this.p.hk != 1) {
                this.y.aa();
                this.y.ab(this.p.hk, this.p.hk);
            }
            if (!this.y.e) {
                this.y.l(this.p.wz.left, this.p.wz.top, this.p.wz.width, this.p.wz.height);
            }
            if (this.p.hk != 1) {
                this.y.z();
            }
        }
    };
    SeriesViewerView.prototype.aq = function (a) {
        a.q4(a.cw.b9, this.e9);
        return this.g.contains(a);
    };
    Object.defineProperty(SeriesViewerView.prototype, "au", {
        get: function () {
            return this.ai;
        },
        set: function (a) {
            this.ai = a;
        },
        enumerable: false,
        configurable: true
    });
    SeriesViewerView.prototype.bp = function (a) {
        var _this = this;
        if (this.p.f5) {
            var b = this.p.series.indexOf(a);
            if (b < (this.p.series.count - 1)) {
                var c = this.p.series._inner[b + 1];
                var d = this.g.indexOf(c);
                var e_27 = d;
                if (!this.g.contains(a)) {
                    this.g.insert(e_27, a);
                    e_27++;
                    if (a.isStacked) {
                        a.p5(function (f) {
                            _this.g.insert(e_27, f);
                            e_27++;
                            if (f.ei) {
                                f.p3(function (g) {
                                    if (!_this.g.contains(g)) {
                                        _this.g.insert(e_27, g);
                                        e_27++;
                                    }
                                    return true;
                                });
                            }
                            return true;
                        });
                    }
                    if (a.ei) {
                        a.p3(function (f) {
                            if (!_this.g.contains(f)) {
                                _this.g.insert(e_27, f);
                                e_27++;
                            }
                            return true;
                        });
                    }
                }
            }
        }
        if (!this.g.contains(a)) {
            this.g.add(a);
            if (a.isStacked) {
                a.p5(function (f) {
                    _this.g.add(f);
                    if (f.ei) {
                        f.p3(function (g) {
                            if (!_this.g.contains(g)) {
                                _this.g.add(g);
                            }
                            return true;
                        });
                    }
                    return true;
                });
            }
            if (a.ei) {
                a.p3(function (f) {
                    if (!_this.g.contains(f)) {
                        _this.g.add(f);
                    }
                    return true;
                });
            }
        }
        this.p.q7();
        a.rd(this.y, this.x);
        this.p.oc();
    };
    SeriesViewerView.prototype.dt = function (a) {
        this.x = a;
        for (var b = 0; b < this.g.count; b++) {
            this.g._inner[b].rd(this.y, this.x);
        }
        for (var c = 0; c < this.b.count; c++) {
            this.b._inner[c].h0(this.y, this.x);
        }
    };
    SeriesViewerView.prototype.bx = function () {
    };
    SeriesViewerView.prototype.bt = function () {
        this.cf();
        this.ck();
    };
    SeriesViewerView.prototype.cf = function () {
        this.fi._visibility = 1;
        this.cq();
    };
    SeriesViewerView.prototype.ca = function () {
    };
    SeriesViewerView.prototype.dr = function () {
    };
    SeriesViewerView.prototype.d8 = function () {
        this.fi._visibility = 0;
        this.cq();
    };
    SeriesViewerView.prototype.eg = function (a) {
        this.fi.o = a.top + this.p.wz.top;
        this.fi.n = a.left + this.p.wz.left;
        this.fi.width = a.width;
        this.fi.height = a.height;
        this.db();
        this.fi._fill = null;
        this.fi.ad = 0.5;
        this.cq();
    };
    SeriesViewerView.prototype.bw = function () {
    };
    SeriesViewerView.prototype.df = function () {
    };
    SeriesViewerView.prototype.eo = function (a, b, c, d) {
        this.fe.an = a;
        this.fe.ap = b;
        this.fe.ao = c;
        this.fe.aq = d;
        this.cq();
    };
    SeriesViewerView.prototype.ed = function () {
        this.fe._visibility = 0;
        this.cq();
    };
    SeriesViewerView.prototype.cl = function () {
        if (this.fe._visibility == 0) {
            this.fe._visibility = 1;
            this.cq();
        }
    };
    SeriesViewerView.prototype.eh = function (a, b, c, d) {
        this.fd.an = a;
        this.fd.ap = b;
        this.fd.ao = c;
        this.fd.aq = d;
        this.cq();
    };
    SeriesViewerView.prototype.d9 = function () {
        this.fd._visibility = 0;
        this.cq();
    };
    SeriesViewerView.prototype.cg = function () {
        if (this.fd._visibility == 0) {
            this.fd._visibility = 1;
            this.cq();
        }
    };
    SeriesViewerView.prototype.cj = function () {
        this.ff._visibility = 1;
        this.cq();
    };
    SeriesViewerView.prototype.e6 = function (a) {
        var b = new PathFigureCollection();
        var c = new PathFigure();
        c._isClosed = true;
        c._startPoint = { $type: Point_$type, x: a.left, y: a.top };
        c._segments.add(new LineSegment(0, { $type: Point_$type, x: a.left, y: a.bottom }));
        c._segments.add(new LineSegment(0, { $type: Point_$type, x: a.right, y: a.bottom }));
        c._segments.add(new LineSegment(0, { $type: Point_$type, x: a.right, y: a.top }));
        c._segments.add(new LineSegment(0, { $type: Point_$type, x: a.left, y: a.top }));
        b.add(c);
        return b;
    };
    SeriesViewerView.prototype.e7 = function (a) {
        var b = new PathFigureCollection();
        var c = new PathFigure();
        c._isClosed = true;
        c._startPoint = { $type: Point_$type, x: a.left, y: a.top };
        c._segments.add(new LineSegment(0, { $type: Point_$type, x: a.right, y: a.top }));
        c._segments.add(new LineSegment(0, { $type: Point_$type, x: a.right, y: a.bottom }));
        c._segments.add(new LineSegment(0, { $type: Point_$type, x: a.left, y: a.bottom }));
        c._segments.add(new LineSegment(0, { $type: Point_$type, x: a.left, y: a.top }));
        b.add(c);
        return b;
    };
    SeriesViewerView.prototype.en = function (a, b) {
        b.intersect(a);
        var c = new PathGeometry();
        c.c = this.e7(a);
        var d = new PathGeometry();
        d.c = this.e6(b);
        var e = new GeometryGroup();
        e.d.add(c);
        e.d.add(d);
        this.ff.an = e;
        this.db();
        this.cq();
    };
    SeriesViewerView.prototype.ec = function () {
        this.ff._visibility = 0;
        this.cq();
    };
    SeriesViewerView.prototype.ep = function (a) {
    };
    SeriesViewerView.prototype.dw = function (a) {
        var b = this.b.indexOf(a);
        this.b.removeAt(b);
        a.h0(null, null);
        this.d3();
        this.p.re(a.name, true);
    };
    SeriesViewerView.prototype.dx = function (a) {
    };
    SeriesViewerView.prototype.bo = function (a) {
        if (!this.b.contains(a)) {
            this.b.add(a);
        }
        a.h0(this.y, this.x);
        this.d3();
    };
    SeriesViewerView.prototype.bl = function (a) {
    };
    SeriesViewerView.prototype.i = function () {
        this.h.a = this.n;
        return this.h;
    };
    SeriesViewerView.aw = function (a) {
        var b = a.dc.series;
        var c = new List$1(Series.$, 0);
        for (var d = 0; d < b.count; d++) {
            c.add(b._inner[d]);
            if (b._inner[d].isStacked) {
                b._inner[d].p5(function (e) {
                    c.add(e);
                    return true;
                });
            }
        }
        return c;
    };
    SeriesViewerView.prototype.d2 = function () {
        this.p.w0 = new Rect(0, 0, 0, 1, 1);
    };
    SeriesViewerView.prototype.c0 = function (a) {
        var e_28, _a, e_29, _b;
        var _this = this;
        if (a == this.bi) {
            return;
        }
        if (a == null) {
            if (this.k != null) {
                this.k.av();
            }
            this.j.bg(null);
            this.w = null;
            this.z = null;
            this.y = null;
            this.x = null;
            this.k = null;
            if (this.p.c2 != null) {
                this.p.c2.provideContext(null);
                this.p.c2.provideContainer(null);
                this.p.c2.provideEventSource(null);
            }
            return;
        }
        this.bi = a;
        if (this.au) {
            this.a.h.add(this.p.al);
        }
        this.j.bg(a);
        this.w = this.j.t;
        this.z = this.j.w;
        this.y = this.j.v;
        this.x = this.j.u;
        this.an = false;
        try {
            this.an = (window.navigator.msPointerEnabled && window.MSGesture !== undefined);
        }
        catch (b) {
        }
        this.ao = false;
        try {
            this.ao = (window.PointerEvent !== undefined);
        }
        catch (c) {
        }
        if (this.an || this.ao) {
            this.av = true;
        }
        this.k = this.j.f;
        if (this.k != null) {
            this.k.bl = this.p.wz;
            this.k.ao = runOn(this, this.as);
            var d = this.k;
            d.onContactCompleted = delegateCombine(d.onContactCompleted, function (d, e) { return _this.cx(d, e, _this.k.am); });
            var e = this.k;
            e.onContactMoved = delegateCombine(e.onContactMoved, runOn(this, this.cy));
            var f = this.k;
            f.onContactStarted = delegateCombine(f.onContactStarted, runOn(this, this.cz));
            var g = this.k;
            g.onDragCompleted = delegateCombine(g.onDragCompleted, runOn(this.p, this.p.pa));
            var h = this.k;
            h.onFlingStarted = delegateCombine(h.onFlingStarted, runOn(this, this.al));
            var i = this.k;
            i.onDragDelta = delegateCombine(i.onDragDelta, function (i) { return _this.p.pb(i); });
            var j = this.k;
            j.onDragStarted = delegateCombine(j.onDragStarted, function (j) { return _this.p.pc(j, true); });
            var k = this.k;
            k.onKeyDown = delegateCombine(k.onKeyDown, runOn(this.p, this.p.fw));
            var l = this.k;
            l.onMouseDown = delegateCombine(l.onMouseDown, runOn(this, this.c6));
            var m = this.k;
            m.onMouseLeave = delegateCombine(m.onMouseLeave, runOn(this, this.c7));
            var n = this.k;
            n.onMouseOver = delegateCombine(n.onMouseOver, runOn(this, this.c8));
            var o = this.k;
            o.onMouseUp = delegateCombine(o.onMouseUp, runOn(this, this.c9));
            var p = this.k;
            p.onMouseWheel = delegateCombine(p.onMouseWheel, runOn(this.p, this.p.fx));
            if (this.k.an) {
                var q = this.k;
                q.onZoomDelta = delegateCombine(q.onZoomDelta, function (q, r, s, t) { return _this.p.qh(q, r, s, t); });
                var r = this.k;
                r.onZoomStarted = delegateCombine(r.onZoomStarted, function (r, s, t, u) { return _this.p.ql(r, s, t, u); });
                var s = this.k;
                s.onZoomCompleted = delegateCombine(s.onZoomCompleted, function (s, t, u, v) {
                    if (_this.k.af) {
                        _this.p.qd();
                    }
                    _this.p.qg(s, t, u, v);
                });
            }
            else {
                var t = this.k;
                t.onPinchDelta = delegateCombine(t.onPinchDelta, function (t, u) { return _this.p.pt(u); });
                var u = this.k;
                u.onPinchStarted = delegateCombine(u.onPinchStarted, function (u, v) { return _this.p.pu(u); });
                var v = this.k;
                v.onGestureCompleted = delegateCombine(v.onGestureCompleted, function (v, w) { return _this.p.pf(v); });
            }
            var w = this.k;
            w.onDoubleTap = delegateCombine(w.onDoubleTap, function (w) { return _this.p.o9(w); });
            var x = this.k;
            x.onHold = delegateCombine(x.onHold, runOn(this, this.c3));
        }
        if (this.p.c2 != null) {
            this.p.c2.provideContext(this.z);
            this.p.c2.provideContainer(a);
            this.p.c2.provideEventSource(this.k);
        }
        try {
            for (var _c = __values(fromEnum(this.b)), _d = _c.next(); !_d.done; _d = _c.next()) {
                var y = _d.value;
                y.a5.a2();
                this.bo(y);
            }
        }
        catch (e_28_1) {
            e_28 = { error: e_28_1 };
        }
        finally {
            try {
                if (_d && !_d.done && (_a = _c.return))
                    _a.call(_c);
            }
            finally {
                if (e_28)
                    throw e_28.error;
            }
        }
        try {
            for (var _e = __values(fromEnum(this.g)), _f = _e.next(); !_f.done; _f = _e.next()) {
                var z = _f.value;
                this.bp(z);
            }
        }
        catch (e_29_1) {
            e_29 = { error: e_29_1 };
        }
        finally {
            try {
                if (_f && !_f.done && (_b = _e.return))
                    _b.call(_e);
            }
            finally {
                if (e_29)
                    throw e_29.error;
            }
        }
    };
    SeriesViewerView.prototype.al = function (a, b, c) {
        if (this.p.ek) {
            return false;
        }
        return true;
    };
    SeriesViewerView.prototype.cy = function (a, b) {
        this.p.o1(a, b);
    };
    SeriesViewerView.prototype.cz = function (a, b) {
        this.p.bb.f$w(this.p, a, b);
    };
    SeriesViewerView.prototype.c3 = function (a) {
        this.p.pv(a);
    };
    SeriesViewerView.prototype.cx = function (a, b, c) {
        this.p.o0(a, b, c);
    };
    SeriesViewerView.prototype.du = function (a) {
    };
    SeriesViewerView.prototype.get_ap = function () {
        return false;
    };
    Object.defineProperty(SeriesViewerView.prototype, "ap", {
        get: function () {
            return this.get_ap();
        },
        enumerable: false,
        configurable: true
    });
    SeriesViewerView.prototype.ef = function () {
        this.a9 = FontUtil.getCurrentFontHeight(this.j.ae, this.p.getFontInfo());
    };
    SeriesViewerView.prototype.f = function (a, b, c, d) {
        var _this = this;
        return {
            ret: ((function () { var e = _this.p.bb.f$c(_this.p, _this.g, _this.x, a, b, c, d); c = e.p5; return e.ret; })()),
            p2: c
        };
    };
    SeriesViewerView.prototype.bd = function () {
        return this.a8;
    };
    SeriesViewerView.prototype.bc = function () {
        return this.a7;
    };
    SeriesViewerView.prototype.cu = function () {
        this.j.bd();
    };
    SeriesViewerView.prototype.c1 = function (a, b) {
        var c = this.a8;
        var d = this.a7;
        if (this.a8 != a) {
            this.aj = true;
        }
        this.a8 = a;
        if (this.a7 != b) {
            this.aj = true;
        }
        this.a7 = b;
        if (this.aj) {
            var e = new Size(1, c, d);
            var f = new Size(1, a, b);
            this.p.qc(e, f);
        }
        this.dj();
        this.d3();
        this.p.o4();
        this.p.al.r(this.y, this.x);
    };
    SeriesViewerView.prototype.b6 = function (a) {
        this.fg = a;
    };
    SeriesViewerView.prototype.b9 = function (a) {
        this.fh = a;
    };
    SeriesViewerView.prototype.b8 = function () {
        this.a.r(this.z, null);
    };
    SeriesViewerView.prototype.d3 = function () {
        if (this.p.destroyed) {
            return;
        }
        this.ag = true;
        this.p.ar.z();
    };
    SeriesViewerView.prototype.b2 = function () {
        var e_30, _a, e_31, _b, e_32, _c, e_33, _d;
        var _this = this;
        if (this.a8 == 0 || this.a7 == 0) {
            return;
        }
        this.ag = false;
        this.aa = false;
        if (this.ak) {
            this.di();
            this.de();
            this.ak = false;
            this.cq();
        }
        var a = this.a8;
        var b = this.a7;
        var c = this.p.h4;
        var d = this.p.h9;
        var e = this.p.hr;
        var f = this.p.ij;
        var g = this.p.hp;
        var h = this.p.hq;
        if (isNaN_(g)) {
            g = this.a9 / 2;
        }
        if (isNaN_(h)) {
            h = 0;
        }
        var i = this.p.f3();
        var j = new List$1(AxisLabelPanelBase.$, 0);
        try {
            for (var _e = __values(fromEnum(this.b)), _f = _e.next(); !_f.done; _f = _e.next()) {
                var k = _f.value;
                if (k.aw != null) {
                    j.add(k.aw);
                    k.aw.bx = function () { return _this.aj; };
                }
            }
        }
        catch (e_30_1) {
            e_30 = { error: e_30_1 };
        }
        finally {
            try {
                if (_f && !_f.done && (_a = _e.return))
                    _a.call(_e);
            }
            finally {
                if (e_30)
                    throw e_30.error;
            }
        }
        if (i) {
            var l = false;
            var m = false;
            var n = false;
            var o = false;
            try {
                for (var _g = __values(fromEnum(j)), _h = _g.next(); !_h.done; _h = _g.next()) {
                    var p = _h.value;
                    if (LabelPanelArranger.b(p) == 2 && (p.ad.az == null || p.ad.az.visibility == 0)) {
                        l = true;
                    }
                    if (LabelPanelArranger.b(p) == 3 && (p.ad.az == null || p.ad.az.visibility == 0)) {
                        m = true;
                    }
                    if (LabelPanelArranger.b(p) == 0 && (p.ad.az == null || p.ad.az.visibility == 0)) {
                        n = true;
                    }
                    if (LabelPanelArranger.b(p) == 1 && (p.ad.az == null || p.ad.az.visibility == 0)) {
                        o = true;
                    }
                    if (p.ad != null && p.ad.az != null) {
                        p.ad.az.c = p.ad.az.location;
                    }
                }
            }
            catch (e_31_1) {
                e_31 = { error: e_31_1 };
            }
            finally {
                try {
                    if (_h && !_h.done && (_b = _g.return))
                        _b.call(_g);
                }
                finally {
                    if (e_31)
                        throw e_31.error;
                }
            }
            if (l || m) {
                if (!n && isNaN_(f)) {
                    f = g;
                }
                if (!o && isNaN_(e)) {
                    e = g;
                }
            }
            if (o || n) {
                if (!l && isNaN_(c)) {
                    c = h;
                }
                if (!m && isNaN_(d)) {
                    d = h;
                }
            }
        }
        if (isNaN_(f)) {
            f = 0;
        }
        if (isNaN_(c)) {
            c = 0;
        }
        if (isNaN_(d)) {
            d = 0;
        }
        if (isNaN_(e)) {
            e = 0;
        }
        var q = this.bf();
        f += q;
        var r = this.be();
        f += r;
        var s = new Rect(0, c, f, a - (c + d), b - (f + e));
        s = LabelPanelArranger.e(j, s);
        var t = new Size(1, Math.max(0, a - (c + d)), Math.max(0, b - (f + e)));
        this.a1 = f - (q + r);
        this.az = c;
        this.a0 = d;
        this.ay = e;
        this.e9 = s;
        var u = ((function () {
            var $ret = new LabelPanelsArrangeState();
            $ret.f = c;
            $ret.c = c;
            $ret.a = f + t.height;
            $ret.b = f + t.height;
            $ret.g = c + t.width;
            $ret.d = c + t.width;
            $ret.h = f;
            $ret.e = f;
            return $ret;
        })());
        LabelPanelArranger.d(j, u, this.e9, function (v, w) {
            if (!v.c1.equals1(w)) {
                if (v.ad != null) {
                    v.ad.cr = true;
                }
                v.c1 = w;
                v.ad.a5.ai();
            }
        });
        var v = false;
        if (this.aj) {
            this.aj = false;
            v = true;
        }
        this.p.qp(this.p.wz, this.e9);
        try {
            for (var _j = __values(fromEnum(this.b)), _k = _j.next(); !_k.done; _k = _j.next()) {
                var w = _k.value;
                if (Rect.l_op_Equality(w.kh, null) || w.kh.isEmpty) {
                    this.aa = true;
                }
                if (w.kh.equals1(this.e9) && !this.j.y()) {
                    continue;
                }
                w.hs(w.kh, this.e9);
            }
        }
        catch (e_32_1) {
            e_32 = { error: e_32_1 };
        }
        finally {
            try {
                if (_k && !_k.done && (_c = _j.return))
                    _c.call(_j);
            }
            finally {
                if (e_32)
                    throw e_32.error;
            }
        }
        try {
            for (var _l = __values(fromEnum(this.g)), _m = _l.next(); !_m.done; _m = _l.next()) {
                var x = _m.value;
                if (Rect.l_op_Equality(x.cw.b9, null) || x.cw.b9.isEmpty) {
                    this.aa = true;
                }
                if (x.cw.b9.equals1(this.e9) && !this.j.y()) {
                    continue;
                }
                x.q4(x.cw.b9, this.e9);
            }
        }
        catch (e_33_1) {
            e_33 = { error: e_33_1 };
        }
        finally {
            try {
                if (_m && !_m.done && (_d = _l.return))
                    _d.call(_l);
            }
            finally {
                if (e_33)
                    throw e_33.error;
            }
        }
        this.ek();
        this.dv(this.e9);
        this.j.bc(false);
    };
    SeriesViewerView.prototype.ek = function () {
        if (this.p.c2 != null && !this.e9.isEmpty) {
            var a = this.p.c2;
            var b = (this.p.ef) ? this.e9.width : Number.POSITIVE_INFINITY;
            var c = (this.p.ef) ? this.e9.height : Number.POSITIVE_INFINITY;
            var d = a.getDesiredSize(new Size(1, b, c));
            this.p.c2.arrange(new Rect(0, this.e9.right - d.width, this.e9.bottom - d.height, d.width, d.height));
            this.em();
        }
    };
    SeriesViewerView.prototype.v = function () {
        var a = this.p.getFontInfo();
        var b = this.s();
        if (this.p.di() != null) {
            a = this.p.di();
        }
        else if (b != null) {
            a = b;
        }
        return a;
    };
    SeriesViewerView.prototype.u = function () {
        var a = this.p.getFontInfo();
        var b = this.r();
        if (this.p.dh() != null) {
            a = this.p.dh();
        }
        else if (b != null) {
            a = b;
        }
        return a;
    };
    SeriesViewerView.prototype.e5 = function () {
        var a = this.p.getFontBrush();
        var b = this.e2();
        if (this.p.v3 != null) {
            a = this.p.v3;
        }
        else if (b != null) {
            a = b;
        }
        return a;
    };
    SeriesViewerView.prototype.e4 = function () {
        var a = this.p.getFontBrush();
        var b = this.e1();
        if (this.p.v2 != null) {
            a = this.p.v2;
        }
        else if (b != null) {
            a = b;
        }
        return a;
    };
    SeriesViewerView.prototype.bf = function () {
        if (this.p.mc == null || !(typeCast(XamDataChart.$, this.p) !== null)) {
            return 0;
        }
        var a = this.v();
        var b = 0;
        b = FontUtil.getCurrentFontHeight(this.j.ae, a);
        var c = this.fm();
        b += c.top + c.bottom;
        return b;
    };
    SeriesViewerView.prototype.be = function () {
        if (this.p.l0 == null || !(typeCast(XamDataChart.$, this.p) !== null)) {
            return 0;
        }
        if (!isNaN_(this.a2)) {
            return this.a2;
        }
        var a = this.u();
        this.a2 = FontUtil.getCurrentFontHeight(this.j.ae, a);
        var b = this.fl();
        this.a2 += b.top + b.bottom;
        return this.a2;
    };
    SeriesViewerView.prototype.fm = function () {
        var a = this.j.ce();
        var b = isNaN_(this.p.ii) ? a.top : this.p.ii;
        var c = isNaN_(this.p.ig) ? a.left : this.p.ig;
        var d = isNaN_(this.p.ih) ? a.right : this.p.ih;
        var e = isNaN_(this.p.ie) ? a.bottom : this.p.ie;
        return new Thickness(1, c, b, d, e);
    };
    SeriesViewerView.prototype.fl = function () {
        var a = this.j.cd();
        var b = isNaN_(this.p.id) ? a.top : this.p.id;
        var c = isNaN_(this.p.ib) ? a.left : this.p.ib;
        var d = isNaN_(this.p.ic) ? a.right : this.p.ic;
        var e = isNaN_(this.p.ia) ? a.bottom : this.p.ia;
        return new Thickness(1, c, b, d, e);
    };
    SeriesViewerView.prototype.dv = function (a) {
    };
    SeriesViewerView.prototype.cq = function () {
        if (!this.af) {
            if (this.z != null) {
                this.af = true;
                this.a.r(this.z, null);
            }
        }
    };
    SeriesViewerView.prototype.d0 = function () {
        if (this.z == null) {
            return;
        }
        if (this.z.d) {
            if (this.p.hk != 1) {
                this.z.aa();
                this.z.ab(this.p.hk, this.p.hk);
            }
            if (!this.fa.isEmpty) {
                if (!this.au) {
                    if (!this.z.e) {
                        this.z.l(this.fa.left, this.fa.top, this.fa.width, this.fa.height);
                    }
                }
            }
        }
        this.d1();
        if (this.z.d) {
            if (this.p.hk != 1) {
                this.z.z();
            }
        }
    };
    SeriesViewerView.prototype.isValid = function () {
        return true;
    };
    SeriesViewerView.prototype.preRender = function () {
        this.j.a6(this.a8, this.a7);
        this.ds();
    };
    SeriesViewerView.prototype.ds = function () {
    };
    SeriesViewerView.prototype.d1 = function () {
        if (this.z.d) {
            this.fa = new Rect(0, 0, 0, this.a8, this.a7);
            if (this.ax != null && this.ax.count > 0) {
                this.ci();
                this.z.aa();
                this.z.af(this.p.wz);
                if (!this.au) {
                    if (!this.z.e) {
                        this.z.l(this.p.wz.left, this.p.wz.top, this.p.wz.width, this.p.wz.height);
                    }
                }
            }
            this.z.s(this.fd);
            this.z.s(this.fe);
            this.z.t(this.ff);
            this.z.w(this.fi);
            this.z.ad(this.v());
            if (this.et != null) {
                this.et.ao = this.e5();
                this.z.x(this.et);
            }
            this.z.ad(this.u());
            if (this.es != null) {
                this.es.ao = this.e4();
                this.z.x(this.es);
            }
            if (this.ax != null && this.ax.count > 0) {
                this.j.bl(this.ax);
                this.z.z();
            }
            if (this.ar) {
                this.eb();
                this.ar = false;
                this.ax.clear();
                this.p.bb.f$l(this.p);
                this.cq();
            }
            if (this.p.el) {
                if (this.fh != null) {
                    this.z.w(this.fh);
                }
                if (this.fg != null) {
                    this.z.w(this.fg);
                }
            }
        }
    };
    SeriesViewerView.prototype.c2 = function () {
        this.j.bh();
    };
    SeriesViewerView.prototype.cw = function () {
        this.j.bf();
    };
    SeriesViewerView.prototype.fb = function () {
        return new Rect(0, 0, 0, this.a8, this.a7);
    };
    SeriesViewerView.prototype.e8 = function () {
        return this.j.b8();
    };
    SeriesViewerView.prototype.d6 = function () {
        this.p.sa = ((function () {
            var $ret = new DataTemplate();
            $ret.render = MarkerTemplates.d;
            $ret.measure = MarkerTemplates.b;
            return $ret;
        })());
        this.p.sj = ((function () {
            var $ret = new DataTemplate();
            $ret.render = MarkerTemplates.m;
            $ret.measure = MarkerTemplates.b;
            return $ret;
        })());
        this.p.sg = ((function () {
            var $ret = new DataTemplate();
            $ret.render = MarkerTemplates.j;
            $ret.measure = MarkerTemplates.b;
            return $ret;
        })());
        this.p.sh = ((function () {
            var $ret = new DataTemplate();
            $ret.render = MarkerTemplates.k;
            $ret.measure = MarkerTemplates.b;
            return $ret;
        })());
        this.p.sb = ((function () {
            var $ret = new DataTemplate();
            $ret.render = MarkerTemplates.e;
            $ret.measure = MarkerTemplates.b;
            return $ret;
        })());
        this.p.se = ((function () {
            var $ret = new DataTemplate();
            $ret.render = MarkerTemplates.h;
            $ret.measure = MarkerTemplates.b;
            return $ret;
        })());
        this.p.sc = ((function () {
            var $ret = new DataTemplate();
            $ret.render = MarkerTemplates.f;
            $ret.measure = MarkerTemplates.b;
            return $ret;
        })());
        this.p.si = ((function () {
            var $ret = new DataTemplate();
            $ret.render = MarkerTemplates.l;
            $ret.measure = MarkerTemplates.b;
            return $ret;
        })());
        this.p.sf = ((function () {
            var $ret = new DataTemplate();
            $ret.render = MarkerTemplates.i;
            $ret.measure = MarkerTemplates.b;
            return $ret;
        })());
        this.p.sd = ((function () {
            var $ret = new DataTemplate();
            $ret.render = MarkerTemplates.g;
            $ret.measure = MarkerTemplates.b;
            return $ret;
        })());
    };
    SeriesViewerView.prototype.ee = function () {
        this.j.bp();
        this.d4();
        var a = this.a9;
        this.ef();
        if (a != this.a9) {
            this.p.oc();
        }
    };
    SeriesViewerView.prototype.dp = function () {
        if (this.p.w5 == 0) {
            this.cn();
            this.p.n8();
        }
        if (this.p.c2 != null) {
            var a = this.p.w5;
            this.p.c2.visibility = a;
            this.p.c2.doRefresh(false);
        }
    };
    SeriesViewerView.prototype.as = function (a) {
        return this.p.bb.f$i(this.p, a);
    };
    SeriesViewerView.prototype.c8 = function (a, b, c) {
        this.p.bb.f$z(this.p, this.g, this.x, a, b, c);
        this.p.nm(a, this.p.c0 != 0 || this.p.fp);
    };
    SeriesViewerView.prototype.c7 = function (a) {
        this.p.bb.f$y(this.p, a);
    };
    SeriesViewerView.prototype.c6 = function (a) {
        this.p.bb.f$x(this.p, this.k, a);
    };
    SeriesViewerView.prototype.c9 = function (a) {
        this.p.bb.f$aa(this.p, this.k, a);
    };
    SeriesViewerView.prototype.d4 = function () {
    };
    Object.defineProperty(SeriesViewerView.prototype, "ez", {
        get: function () {
            return this.k.bi;
        },
        enumerable: false,
        configurable: true
    });
    SeriesViewerView.prototype.eq = function (a) {
        if (this.k != null) {
            this.k.bl = this.p.wz;
        }
    };
    SeriesViewerView.prototype.cr = function (a) {
        this.p.bb.f$ad(this.p, a);
        this.p.ef = a;
    };
    SeriesViewerView.prototype.bk = function (a) {
        this.p.rv();
        this.j.bw(a);
        if (this.p.c2 != null) {
            this.p.c2.mobileMode = a;
        }
        this.el();
    };
    SeriesViewerView.prototype.el = function () {
        this.p.r1();
    };
    Object.defineProperty(SeriesViewerView.prototype, "isDirty", {
        get: function () {
            return this.af;
        },
        set: function (a) {
            this.af = a;
        },
        enumerable: false,
        configurable: true
    });
    SeriesViewerView.prototype.undirty = function (a) {
        this.af = false;
        this.d0();
    };
    Object.defineProperty(SeriesViewerView.prototype, "index", {
        get: function () {
            return 10;
        },
        enumerable: false,
        configurable: true
    });
    SeriesViewerView.prototype.postRender = function () {
    };
    SeriesViewerView.prototype.b7 = function () {
        this.d3();
    };
    SeriesViewerView.prototype.ch = function () {
        this.j.a9();
    };
    SeriesViewerView.prototype.ea = function () {
        this.j.bo();
    };
    SeriesViewerView.prototype.bv = function (a) {
        this.j.ay();
    };
    SeriesViewerView.prototype.bm = function (a) {
        this.j.au(a);
    };
    SeriesViewerView.prototype.ei = function (a) {
        this.j.bu(a);
    };
    SeriesViewerView.prototype.ej = function (a) {
        this.j.bv(a);
    };
    SeriesViewerView.prototype.bn = function (a) {
        this.j.av(a);
    };
    SeriesViewerView.prototype.dz = function (a) {
        this.j.bk(a);
    };
    SeriesViewerView.prototype.da = function (a) {
        this.p.al.r(this.y, this.z);
    };
    SeriesViewerView.prototype.bu = function (a) {
    };
    SeriesViewerView.prototype.m = function (a) {
        if (this.p.ef) {
            return 2;
        }
        else {
            return 1;
        }
    };
    SeriesViewerView.prototype.c5 = function () {
        if (this.k != null) {
            this.k.ae = this.p.ff;
        }
        if (this.n != null) {
            this.n.isSurfaceInteractionDisabled = this.p.ff;
        }
    };
    SeriesViewerView.prototype.bb = function (a, b) {
        if (a == null || this.z == null) {
            return 0;
        }
        this.z.ad(b);
        return this.z.f(a);
    };
    SeriesViewerView.prototype.ba = function (a, b) {
        if (a == null) {
            return 0;
        }
        var c = 0;
        c = FontUtil.getCurrentFontHeight(this.j.ae, b);
        return c;
    };
    SeriesViewerView.prototype.dj = function () {
        this.ak = true;
        this.d3();
        this.cq();
    };
    SeriesViewerView.prototype.eu = function (a, b, c, d) {
        if (a == null) {
            return null;
        }
        var e = ((function () {
            var $ret = new TextBlock();
            $ret.al = a;
            $ret.o = b.top;
            return $ret;
        })());
        var f = this.bb(e, c);
        e.o = b.top;
        var g = this.ba(a, c);
        e.m = f;
        e.l = g;
        switch (d) {
            case 0:
                e.n = b.left;
                break;
            case 2:
                e.n = Math.max((this.a8 - b.right) - f, b.left);
                break;
            case 1:
            case 3:
            default:
                var h = (this.a8 / 2) - (f / 2);
                h += b.left;
                h -= b.right;
                e.n = h;
                break;
        }
        return e;
    };
    SeriesViewerView.prototype.di = function () {
        this.et = typeCast(XamDataChart.$, this.p) !== null ? this.eu(this.p.mc, this.fm(), this.v(), this.ey()) : null;
    };
    SeriesViewerView.prototype.de = function () {
        this.a2 = NaN;
        this.es = typeCast(XamDataChart.$, this.p) !== null ? this.eu(this.p.l0, this.fl(), this.u(), this.ex()) : null;
        if (this.es != null) {
            this.es.o += this.bf();
        }
    };
    SeriesViewerView.prototype.c = function (a) {
        var b = this.j.c();
        if (b == 0) {
            var c = LabelPanelArranger.b(a.aw);
            if (a.aj == null) {
                if (c == 4) {
                    return 4;
                }
                if (c == 5) {
                    return 3;
                }
            }
            else {
                if (c == 4) {
                    return 3;
                }
                if (c == 5) {
                    return 4;
                }
            }
            if (c == 0) {
                return 3;
            }
            return 4;
        }
        return b;
    };
    SeriesViewerView.prototype.d = function (a) {
        var b = this.j.d();
        if (b == 0) {
            var c = LabelPanelArranger.b(a.aw);
            if (a.aj == null) {
                if (c == 7) {
                    return 1;
                }
                if (c == 6) {
                    return 2;
                }
            }
            else {
                if (c == 7) {
                    return 2;
                }
                if (c == 6) {
                    return 1;
                }
            }
            if (c == 3) {
                return 2;
            }
            return 1;
        }
        return b;
    };
    SeriesViewerView.prototype.dk = function () {
        if (!isNaN_(this.p.hj)) {
            if (!isNaN_(DeviceUtils.a(this.p.h5))) {
                this.p.hk = DeviceUtils.a(this.p.h5);
            }
            else {
                this.co();
            }
        }
        if (!this.p.e3) {
            this.j.a5();
        }
    };
    SeriesViewerView.prototype.dl = function () {
        if (!isNaN_(DeviceUtils.a(this.p.hj))) {
            this.p.hk = DeviceUtils.a(this.p.hj);
        }
        if (!this.p.e3) {
            this.j.a4();
        }
    };
    SeriesViewerView.prototype.t = function () {
        return this.j.r();
    };
    SeriesViewerView.prototype.e3 = function () {
        return this.j.b7();
    };
    SeriesViewerView.prototype.q = function () {
        return this.j.q();
    };
    SeriesViewerView.prototype.e0 = function () {
        return this.j.b6();
    };
    SeriesViewerView.prototype.s = function () {
        return this.j.p();
    };
    SeriesViewerView.prototype.r = function () {
        return this.j.o();
    };
    SeriesViewerView.prototype.e2 = function () {
        return this.j.b5();
    };
    SeriesViewerView.prototype.e1 = function () {
        return this.j.b4();
    };
    Object.defineProperty(SeriesViewerView.prototype, "a4", {
        get: function () {
            return this.az;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(SeriesViewerView.prototype, "a5", {
        get: function () {
            return this.a0;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(SeriesViewerView.prototype, "a6", {
        get: function () {
            return this.a1;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(SeriesViewerView.prototype, "a3", {
        get: function () {
            return this.ay;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(SeriesViewerView.prototype, "ew", {
        get: function () {
            return this.et;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(SeriesViewerView.prototype, "ev", {
        get: function () {
            return this.es;
        },
        enumerable: false,
        configurable: true
    });
    SeriesViewerView.prototype.fc = function () {
        return new Rect(0, 0, 0, this.a8, this.a7);
    };
    SeriesViewerView.prototype.fk = function () {
        return this.j.cg();
    };
    SeriesViewerView.prototype.fj = function () {
        return this.j.cf();
    };
    SeriesViewerView.prototype.dd = function (a, b) {
        this.ac = true;
    };
    SeriesViewerView.prototype.dh = function (a, b) {
        this.ad = true;
    };
    SeriesViewerView.prototype.ey = function () {
        if (this.ad) {
            return this.p.vd;
        }
        else {
            var a = 1;
            switch (this.j.as()) {
                case "left":
                    a = 0;
                    break;
                case "right":
                    a = 2;
                    break;
            }
            return a;
        }
    };
    SeriesViewerView.prototype.ex = function () {
        if (this.ac) {
            return this.p.vc;
        }
        else {
            var a = 1;
            switch (this.j.ar()) {
                case "left":
                    a = 0;
                    break;
                case "right":
                    a = 2;
                    break;
            }
            return a;
        }
    };
    SeriesViewerView.prototype.bq = function () {
        if (this.ag) {
            this.b2();
            if (this.aa) {
                this.p.ar.y();
            }
            if (this.ag) {
                this.b2();
            }
        }
    };
    SeriesViewerView.prototype.am = function () {
        if (this.p.gk) {
            return false;
        }
        if ((dateNow().getTime() - this.p.gw.getTime()) < 300) {
            return true;
        }
        return false;
    };
    SeriesViewerView.prototype.b5 = function () {
        this.j.a6(this.a8, this.a7);
    };
    SeriesViewerView.prototype.cp = function () {
        this.j.bb(this.p.fe);
    };
    SeriesViewerView.prototype.at = function (a) {
        var b = this.p.wh;
        var c = b.top > 0;
        var d = b.left > 0;
        var e = b.right < 1;
        var f = b.bottom < 1;
        var g = a.y < 0;
        var h = a.y > 0;
        var i = a.x < 0;
        var j = a.x > 0;
        if (c && g) {
            return true;
        }
        if (d && i) {
            return true;
        }
        if (f && h) {
            return true;
        }
        if (j && e) {
            return true;
        }
        return false;
    };
    SeriesViewerView.prototype.dq = function () {
        this.j.bj();
        this.p.al.r(this.y, this.x);
        this.p.am.r(this.y, null);
        this.p.ak.r(this.y, this.x);
        this.a.r(this.z, null);
    };
    SeriesViewerView.prototype.b3 = function (a, b, c) {
        this.ar = false;
        if (this.ax == null) {
            this.ax = new List$1(ITileZoomTile_$type, 0);
        }
        for (var d = 0; d < this.ax.count; d++) {
            while (d < this.ax.count && !a.containsKey(this.ax._inner[d].content)) {
                this.ax.removeAt(d);
            }
        }
        for (var e = 0; e < b.count; e++) {
            this.ax.add(b._inner[e]);
        }
        this.cq();
    };
    SeriesViewerView.prototype.bh = function (a, b, c) {
        return this.j.an(a, b, c);
    };
    SeriesViewerView.prototype.b0 = function () {
        this.j.a2();
    };
    SeriesViewerView.prototype.b1 = function (a) {
        this.j.a3(a);
    };
    SeriesViewerView.prototype.cm = function () {
        if (this.ax == null) {
            return;
        }
        this.ar = true;
        this.cq();
    };
    SeriesViewerView.prototype.by = function () {
        this.j.a0();
    };
    SeriesViewerView.prototype.br = function () {
        this.j.aw();
    };
    SeriesViewerView.prototype.bz = function (a) {
        this.j.a1(a);
        this.p.o7();
    };
    SeriesViewerView.prototype.bs = function () {
        this.j.ax();
        this.p.o5();
    };
    SeriesViewerView.prototype.ci = function () {
        if (this.ah) {
            this.ah = false;
            if (!this.y.e) {
                this.y.l(this.p.wz.left, this.p.wz.top, this.p.wz.width, this.p.wz.height);
            }
            this.p.al.e = true;
        }
    };
    SeriesViewerView.prototype.eb = function () {
        if (!this.ah) {
            this.ah = true;
            this.p.al.e = false;
            this.p.al.r(this.y, this.x);
        }
    };
    SeriesViewerView.prototype.dg = function () {
    };
    SeriesViewerView.prototype.cv = function () {
        this.j.be();
    };
    SeriesViewerView.prototype.db = function () {
        this.ff._fill = this.p.vz == null ? this.j.b3() : this.p.vz;
        this.ff._opacity = isNaN_(this.p.h6) ? 0.1 : this.p.h6;
        this.fi._stroke = this.p.v0 == null ? this.j.b3() : this.p.v0;
    };
    SeriesViewerView.prototype.b4 = function (a) {
        if (this.j.ae == null || (this.j.ae != a)) {
            this.p.provideContainer(a);
        }
    };
    SeriesViewerView.prototype.bj = function (a, b, c) {
        return this.j.ao(a, b, c);
    };
    SeriesViewerView.$t = markType(SeriesViewerView, 'SeriesViewerView', Base.$, [ISchedulableRender_$type]);
    return SeriesViewerView;
}(Base));
export { SeriesViewerView };
/**
 * @hidden
 */
var OverviewPlusDetailViewportHost = /** @class */ /*@__PURE__*/ (function (_super) {
    __extends(OverviewPlusDetailViewportHost, _super);
    function OverviewPlusDetailViewportHost(a) {
        var _this = _super.call(this) || this;
        _this.a = null;
        if (a == null) {
            throw new ArgumentNullException(0, "view");
        }
        _this.a = a;
        return _this;
    }
    OverviewPlusDetailViewportHost.prototype.getViewInfo = function (a, b) {
        a = new Rect(0, 0, 0, this.a.n.worldRectViewport.width, this.a.n.worldRectViewport.height);
        b = SeriesViewer.wu;
        return {
            p0: a,
            p1: b
        };
    };
    OverviewPlusDetailViewportHost.prototype.getEffectiveViewport = function () {
        if (!this.a.p.fd) {
            if (this.a.p.wl.isEmpty) {
                return this.a.p.wl;
            }
            return this.a.p.wr(this.a.n.previewViewportdRect, this.a.p.wz, this.a.p.wl);
        }
        return Rect.empty;
    };
    OverviewPlusDetailViewportHost.prototype.getMainContentViewport = function () {
        if (!this.a.p.fd) {
            if (this.a.p.wk.isEmpty) {
                return this.a.p.wk;
            }
            return Rect.empty;
        }
        return Rect.empty;
    };
    OverviewPlusDetailViewportHost.$t = markType(OverviewPlusDetailViewportHost, 'OverviewPlusDetailViewportHost', Base.$, [IProvidesViewport_$type]);
    return OverviewPlusDetailViewportHost;
}(Base));
export { OverviewPlusDetailViewportHost };
/**
 * @hidden
 */
var LegendTemplates = /** @class */ /*@__PURE__*/ (function (_super) {
    __extends(LegendTemplates, _super);
    function LegendTemplates() {
        return _super !== null && _super.apply(this, arguments) || this;
    }
    LegendTemplates.af = function (a) {
        var b = a.av();
        switch (b) {
            case 3: return LegendTemplates.y;
            case 4: return LegendTemplates.aa;
            case 0: return LegendTemplates.z;
            case 8: return LegendTemplates.ae;
            case 9: return LegendTemplates.ac;
            case 5: return LegendTemplates.ah;
            case 1:
            case 2: return LegendTemplates.ad;
            case 6:
            case 7: return LegendTemplates.ab;
        }
        return LegendTemplates.ah;
    };
    LegendTemplates.a = function (a) {
        return new RenderingContext(new CanvasViewRenderer(), a.context);
    };
    LegendTemplates.v = function (a) {
        var b = typeCast(Series.$, a.series);
        if (b == null || b.be == 0) {
            a.thickness = Defaults.legendBadge_ShapeThickness;
        }
        else {
            a.thickness = b.ig;
        }
        if (a.itemBrush != null) {
            a.actualItemBrush = a.itemBrush;
        }
        else {
            if (b != null) {
                a.actualItemBrush = b.vg;
            }
        }
        if (a.outline == null) {
            if (b != null) {
                a.m = a.outline;
                a.outline = b.vh;
            }
        }
    };
    LegendTemplates.b = function (a, b, c) {
        var d = (c - b) / 2;
        return a + d;
    };
    LegendTemplates.c = function (a, b, c) {
        var d = (c - b) / 2;
        return a + d;
    };
    LegendTemplates.u = function (a, b, c, d, e, f, g, h) {
        var i = DeviceUtils.g(Defaults.legendBadge_ShapeWidth);
        var j = DeviceUtils.g(Defaults.legendBadge_ShapeHeight);
        var k = LegendTemplates.c(f, j, a.availableHeight);
        var l = LegendTemplates.c(h, j, a.availableHeight);
        var m = LegendTemplates.b(e, i, a.availableWidth);
        var n = LegendTemplates.b(g, i, a.availableWidth);
        var o = ((function () {
            var $ret = new PathFigure();
            $ret.isClosed = true;
            $ret.isFilled = true;
            return $ret;
        })());
        o._startPoint = { $type: Point_$type, x: m, y: l };
        o._segments.add(new LineSegment(0, { $type: Point_$type, x: m, y: l }));
        o._segments.add(new LineSegment(0, { $type: Point_$type, x: n, y: l }));
        o._segments.add(new LineSegment(0, { $type: Point_$type, x: n, y: k }));
        o._segments.add(new LineSegment(0, { $type: Point_$type, x: m, y: k }));
        var p = new PathGeometry();
        p.c.add(o);
        var q = new Path();
        q.an = p;
        q.ad = b;
        q._stroke = c;
        q._fill = d;
        var r = LegendTemplates.a(a);
        r.t(q);
    };
    LegendTemplates.s = function (a) {
        var b = a.data;
        var c = b.series;
        LegendTemplates.v(b);
        var d = DeviceUtils.g(Defaults.legendBadge_ShapeWidth);
        var e = DeviceUtils.g(Defaults.legendBadge_ShapeHeight);
        var f = new Line();
        f.an = LegendTemplates.b(0, d, a.availableWidth);
        f.ap = a.availableHeight / 2;
        f.ao = LegendTemplates.b(d, d, a.availableWidth);
        f.aq = a.availableHeight / 2;
        f._stroke = b.actualItemBrush;
        if (c.be == 0) {
            f.ad = Defaults.legendBadge_ShapeThickness;
        }
        else {
            f.ad = c.ig;
            f.al = c.v9;
            f.ak = c.v9;
            f.ai = c.v7;
            f.ac = c.ji;
            f.am = c.wa;
        }
        var g = LegendTemplates.a(a);
        g.s(f);
    };
    LegendTemplates.r = function (a, b, c) {
        var d = a.data;
        LegendTemplates.v(d);
        var e = DeviceUtils.g(Defaults.legendBadge_ShapeWidth);
        var f = DeviceUtils.g(Defaults.legendBadge_ShapeHeight);
        var g = e / 2;
        var h = f / 2;
        var i = LegendTemplates.b(g, e, a.availableWidth);
        var j = LegendTemplates.c(h, f, a.availableHeight);
        var k = new EllipseGeometry();
        k.e = { $type: Point_$type, x: i, y: j };
        k.c = g;
        k.d = h;
        var l = new Path();
        l.an = k;
        l.ad = d.thickness;
        l._stroke = d.outline;
        l._fill = d.actualItemBrush;
        var m = LegendTemplates.a(a);
        m.t(l);
    };
    LegendTemplates.t = function (a, b) {
        if (b === void 0) {
            b = 0;
        }
        var c = a.data;
        var d = DeviceUtils.g(Defaults.legendBadge_ShapeWidth - b);
        var e = DeviceUtils.g(Defaults.legendBadge_ShapeHeight - b);
        var f = new DataTemplateMeasureInfo();
        f.passInfo = a.passInfo;
        f.width = d;
        f.height = e;
        f.data = a.data;
        f.context = a.context;
        f.renderContext = a.renderContext;
        var g = c.actualItemBrush;
        var h = c.itemBrush;
        var i = c.outline;
        var j = c.series;
        var k = j.s3();
        c.actualItemBrush = j.vq();
        c.outline = j.vr();
        if (c.itemBrush != null) {
            c.actualItemBrush = c.itemBrush;
        }
        if (c.m != null) {
            c.outline = c.m;
        }
        if (j.be == 1) {
            c.thickness = j.ip();
        }
        else {
            c.thickness = Defaults.series_MarkerThickness;
        }
        if (k != null && k.measure != null && k.render != null) {
            var l = new DataTemplateRenderInfo();
            l.passInfo = a.passInfo;
            l.availableWidth = f.width;
            l.availableHeight = f.height;
            l.xPosition = (a.availableWidth / 2);
            l.yPosition = (a.availableHeight / 2);
            l.data = a.data;
            l.context = a.context;
            l.renderContext = a.renderContext;
            k.render(l);
        }
        c.itemBrush = h;
        c.actualItemBrush = g;
        c.outline = i;
    };
    LegendTemplates.j = function (a) {
        var b = a.data;
        LegendTemplates.v(b);
        LegendTemplates.r(a, Defaults.legendBadge_ShapeWidth, Defaults.legendBadge_ShapeHeight);
    };
    LegendTemplates.n = function (a) {
        var b = a.data;
        var c = b.series;
        LegendTemplates.s(a);
        if (c.be == 1) {
            LegendTemplates.t(a, Defaults.legendBadge_OverlaidMarkerPadding);
        }
    };
    LegendTemplates.o = function (a) {
        LegendTemplates.t(a, 0);
    };
    LegendTemplates.q = function (a) {
        var b = a.data;
        LegendTemplates.v(b);
        LegendTemplates.u(a, b.thickness, b.outline, b.actualItemBrush, 0, 0, Defaults.legendBadge_ShapeWidth, Defaults.legendBadge_ShapeHeight);
    };
    LegendTemplates.p = function (a) {
        var b = a.data;
        var c = b.series;
        LegendTemplates.v(b);
        if (c.be == 0) {
            var d = Defaults.legendBadge_ShapeThickness;
            var e = b.actualItemBrush;
            var f = c.vh;
            var g = Defaults.legendBadge_ShapeWidth;
            var h = Defaults.legendBadge_ShapeHeight;
            LegendTemplates.u(a, d, f, e, 0, 0, g, h);
        }
        else {
            var i = Defaults.legendBadge_ShapeThickness;
            var j = b.actualItemBrush;
            var k = c.v1();
            var l = Defaults.legendBadge_ShapeWidth / 2;
            var m = Defaults.legendBadge_ShapeWidth;
            var n = Defaults.legendBadge_ShapeHeight;
            LegendTemplates.u(a, i, j, j, 0, 0, l, n);
            LegendTemplates.u(a, i, k, k, l, 0, m, n);
        }
    };
    LegendTemplates.i = function (a) {
        var b = a.data;
        LegendTemplates.v(b);
        var c = 0;
        var d = Defaults.legendBadge_ShapeWidth;
        var e = (Defaults.legendBadge_ShapeHeight * 0.25);
        var f = (Defaults.legendBadge_ShapeHeight * 0.75);
        LegendTemplates.u(a, b.thickness, b.outline, b.actualItemBrush, c, e, d, f);
    };
    LegendTemplates.l = function (a) {
        var b = a.data;
        LegendTemplates.v(b);
        var c = (Defaults.legendBadge_ShapeWidth * 0.25);
        var d = (Defaults.legendBadge_ShapeWidth * 0.75);
        var e = Defaults.legendBadge_ShapeHeight;
        var f = 0;
        LegendTemplates.u(a, b.thickness, b.outline, b.actualItemBrush, c, f, d, e);
    };
    LegendTemplates.m = function (a) {
        var b = a.data;
        var c = BrushUtil.j(0, 0, 0, 0);
        var d = BrushUtil.j(0, 0, 0, 0);
        LegendTemplates.u(a, Defaults.legendBadge_ShapeThickness, c, d, 0, 0, Defaults.legendBadge_ShapeWidth, Defaults.legendBadge_ShapeHeight);
    };
    LegendTemplates.k = function (a) {
    };
    LegendTemplates.g = function (a) {
        var b = a.data;
        var c = b.series;
        var d = c.legendItemBadgeTemplate;
        if (d == null) {
            d = LegendTemplates.af(c);
        }
        var e = c.title;
        if (e == null) {
            e = "Series Title";
        }
        LegendItemHelper.d(a.context, a.xPosition, a.yPosition, a.availableWidth, a.availableHeight, a.data, e.toString(), d, a.passInfo, c.a5 != null && c.a5.isFinancial, c.io, c.jj);
    };
    LegendTemplates.resolveLegendItemTemplate = function (a) {
        switch (a) {
            case 0: return LegendTemplates.w;
            case 1: return LegendTemplates.x;
        }
        return LegendTemplates.w;
    };
    LegendTemplates.e = function (a) {
        var b = a.data;
        var c = b.series;
        var d = c.legendItemBadgeTemplate;
        if (d == null) {
            d = LegendTemplates.af(c);
        }
        var e = b.legendLabel != null ? b.legendLabel : b.itemLabel;
        if (e == null) {
            e = "Series Item";
        }
        LegendItemHelper.c(a.context, a.xPosition, a.yPosition, a.availableWidth, a.availableHeight, a.data, e.toString(), d, a.passInfo);
    };
    LegendTemplates.f = function (a) {
    };
    LegendTemplates.d = function (a) {
    };
    LegendTemplates.h = function (a) {
    };
    LegendTemplates.$t = markType(LegendTemplates, 'LegendTemplates');
    LegendTemplates.z = ((function () {
        var $ret = new DataTemplate();
        $ret.measure = LegendTemplates.f;
        $ret.render = LegendTemplates.j;
        return $ret;
    })());
    LegendTemplates.ae = ((function () {
        var $ret = new DataTemplate();
        $ret.measure = LegendTemplates.f;
        $ret.render = LegendTemplates.o;
        return $ret;
    })());
    LegendTemplates.ad = ((function () {
        var $ret = new DataTemplate();
        $ret.measure = LegendTemplates.f;
        $ret.render = LegendTemplates.n;
        return $ret;
    })());
    LegendTemplates.ah = ((function () {
        var $ret = new DataTemplate();
        $ret.measure = LegendTemplates.f;
        $ret.render = LegendTemplates.q;
        return $ret;
    })());
    LegendTemplates.ab = ((function () {
        var $ret = new DataTemplate();
        $ret.measure = LegendTemplates.f;
        $ret.render = LegendTemplates.p;
        return $ret;
    })());
    LegendTemplates.y = ((function () {
        var $ret = new DataTemplate();
        $ret.measure = LegendTemplates.f;
        $ret.render = LegendTemplates.i;
        return $ret;
    })());
    LegendTemplates.aa = ((function () {
        var $ret = new DataTemplate();
        $ret.measure = LegendTemplates.f;
        $ret.render = LegendTemplates.l;
        return $ret;
    })());
    LegendTemplates.ac = ((function () {
        var $ret = new DataTemplate();
        $ret.measure = LegendTemplates.f;
        $ret.render = LegendTemplates.m;
        return $ret;
    })());
    LegendTemplates.w = ((function () {
        var $ret = new DataTemplate();
        $ret.measure = LegendTemplates.f;
        $ret.render = LegendTemplates.g;
        return $ret;
    })());
    LegendTemplates.x = ((function () {
        var $ret = new DataTemplate();
        $ret.measure = LegendTemplates.d;
        $ret.render = LegendTemplates.e;
        return $ret;
    })());
    return LegendTemplates;
}(Base));
export { LegendTemplates };
/**
 * @hidden
 */
var SeriesViewerViewManager = /** @class */ /*@__PURE__*/ (function (_super) {
    __extends(SeriesViewerViewManager, _super);
    function SeriesViewerViewManager(a) {
        var _this = _super.call(this) || this;
        _this.ae = null;
        _this.af = null;
        _this.aj = null;
        _this.ai = null;
        _this.ag = null;
        _this.ak = null;
        _this.t = null;
        _this.w = null;
        _this.v = null;
        _this.u = null;
        _this.x = null;
        _this.f = null;
        _this.j = null;
        _this.ah = null;
        _this.ab = 0;
        _this.aa = 0;
        _this.ac = 1;
        _this.ad = 0;
        _this.l = null;
        _this.ca = new Thickness(0, 0);
        _this.aq = null;
        _this.ap = stringEmpty();
        _this.b9 = new Thickness(0, 0);
        _this.b0 = null;
        _this.bz = null;
        _this.k = null;
        _this.a = 0;
        _this.b = 0;
        _this.n = null;
        _this.b2 = null;
        _this.m = null;
        _this.b1 = null;
        _this.cb = new Thickness(0, 0);
        _this.cc = new Thickness(0, 0);
        _this.h = null;
        _this.z = new Dictionary$2(String_$type, Tuple$2.$.specialize(DomWrapper_$type, RenderingContext.$), 0);
        _this.al = -1;
        _this.am = -1;
        _this.s = null;
        _this.j = a;
        return _this;
    }
    SeriesViewerViewManager.prototype.bj = function () {
    };
    SeriesViewerViewManager.prototype.bg = function (a) {
        if (a == null) {
            if (this.f != null) {
                this.f.av();
            }
            this.ae = null;
            if (this.af != null) {
                this.af.remove();
            }
            this.af = null;
            if (this.aj != null) {
                this.aj.remove();
            }
            this.aj = null;
            if (this.ai != null) {
                this.ai.remove();
            }
            this.ai = null;
            if (this.ag != null) {
                this.ag.remove();
            }
            this.ag = null;
            if (this.ak != null) {
                this.ak.remove();
            }
            this.ak = null;
            this.t = null;
            this.w = null;
            this.v = null;
            this.u = null;
            if (this.ah != null) {
                this.ah.remove();
            }
            this.ah = null;
            this.f = null;
            this.j.p.db.u(null);
            this.j.p.dd.u(null);
            this.j.p.da.u(null);
            this.j.p.dc.u(null);
            this.j.p.al.m(null);
            this.j.p.am.m(null);
            this.j.p.ak.m(null);
            this.j.a.m(null);
            return;
        }
        this.ae = a;
        this.j.p.db.u(this.ae);
        this.j.p.dd.u(this.ae);
        this.j.p.da.u(this.ae);
        this.j.p.dc.u(this.ae);
        this.j.p.al.m(this.ae);
        this.j.p.am.m(this.ae);
        this.j.p.ak.m(this.ae);
        this.j.a.m(this.ae);
        this.j.p.ar.aa(this.ae);
        this.bi();
        this.ae.rootWrapper.setStyleProperty("position", "relative");
        this.af = this.ae.createElement("canvas");
        this.af.setStyleProperty("position", "absolute");
        this.af.setStyleProperty("top", "0px");
        this.af.setStyleProperty("left", "0px");
        this.aj = this.ae.createElement("canvas");
        this.aj.setStyleProperty("position", "absolute");
        this.aj.setStyleProperty("top", "0px");
        this.aj.setStyleProperty("left", "0px");
        this.ai = this.ae.createElement("canvas");
        this.ai.setStyleProperty("position", "absolute");
        this.ai.setStyleProperty("top", "0px");
        this.ai.setStyleProperty("left", "0px");
        this.ag = this.ae.createElement("canvas");
        this.ag.setStyleProperty("position", "absolute");
        this.ag.setStyleProperty("top", "0px");
        this.ag.setStyleProperty("left", "0px");
        this.ak = this.ae.createElement("canvas");
        this.ak.setStyleProperty("position", "absolute");
        this.ak.setStyleProperty("top", "0px");
        this.ak.setStyleProperty("left", "0px");
        this.ae.append(this.af);
        this.ae.append(this.ai);
        this.ae.append(this.aj);
        this.t = new RenderingContext(new CanvasViewRenderer(), this.ae.get2DCanvasContext(this.af));
        this.w = new RenderingContext(new CanvasViewRenderer(), this.ae.get2DCanvasContext(this.aj));
        this.v = new RenderingContext(new CanvasViewRenderer(), this.ae.get2DCanvasContext(this.ai));
        if (this.j.p.au != 1) {
            this.u = new RenderingContext(new CanvasViewRenderer(), this.ae.get2DCanvasContext(this.ag));
            this.s = this.u;
        }
        else {
            this.u = new RenderingContext(null, null);
        }
        this.x = new RenderingContext(new CanvasViewRenderer(), this.ae.get2DCanvasContext(this.ak));
        this.j.du(this.t);
        this.j.c1(this.ae.rootWrapper.width(), this.ae.rootWrapper.height());
        {
            if ((TypeRegistrar.isRegistered('CanvasGestureDOMEventProxy'))) {
                var overlayCanvas_ = this.aj;
                var container_ = this.ae;
                this.f = (TypeRegistrar.create('CanvasGestureDOMEventProxy', overlayCanvas_, container_, false));
            }
            else {
                this.f = null;
            }
            if (this.f != null) {
                this.f.ap = runOn(this.j, this.j.at);
            }
        }
        this.ah = this.ae.createElement("div");
        this.ah.hide();
        this.ah.setStyleProperty("position", "absolute");
        this.ah.setStyleProperty("z-index", "10000");
        this.ah.addClass(this.j.p.mm);
        this.ae.append(this.ah);
    };
    SeriesViewerViewManager.by = function (a, b) {
        b();
        return;
    };
    SeriesViewerViewManager.prototype.bi = function () {
        this.j.d4();
        this.j.ef();
        this.bp();
    };
    SeriesViewerViewManager.prototype.ba = function () {
        var a = this.j.p.h5;
        var b = this.j.p.hk;
        if (!isNaN_(a) && a != 0) {
            return;
        }
        if (window.devicePixelRatio != undefined && window.devicePixelRatio != b) {
            this.j.p.hk = window.devicePixelRatio;
        }
    };
    SeriesViewerViewManager.prototype.g = function () {
        if ((TypeRegistrar.isRegistered('XamOverviewPlusDetailPane'))) {
            var overlayCanvas_ = this.aj;
            var container_ = this.ae;
            return (TypeRegistrar.create('XamOverviewPlusDetailPane'));
        }
        return null;
    };
    SeriesViewerViewManager.prototype.bm = function () {
        this.aj.setStyleProperty("cursor", "default");
    };
    SeriesViewerViewManager.prototype.bn = function () {
        this.aj.setStyleProperty("cursor", "pointer");
    };
    SeriesViewerViewManager.prototype.b3 = function () {
        return ((function () {
            var $ret = new Brush();
            $ret.fill = "#000000";
            return $ret;
        })());
    };
    SeriesViewerViewManager.prototype.az = function (a, b, c) {
        this.ab = a;
        this.aa = b;
        this.ac = c;
        var d = a;
        var e = b;
        if (c != 1) {
            d = Math.round(a * c);
            e = Math.round(b * c);
        }
        if (this.af != null) {
            this.af.setAttribute("width", d.toString());
            this.af.setAttribute("height", e.toString());
            this.af.setStyleProperty("width", a.toString() + "px");
            this.af.setStyleProperty("height", b.toString() + "px");
        }
        if (this.aj != null) {
            this.aj.setAttribute("width", d.toString());
            this.aj.setAttribute("height", e.toString());
            this.aj.setStyleProperty("width", a.toString() + "px");
            this.aj.setStyleProperty("height", b.toString() + "px");
            this.aj.setAttribute("tabindex", "0");
            this.aj.setStyleProperty("outline", "0");
        }
        if (this.ai != null) {
            this.ai.setAttribute("width", d.toString());
            this.ai.setAttribute("height", e.toString());
            this.ai.setStyleProperty("width", a.toString() + "px");
            this.ai.setStyleProperty("height", b.toString() + "px");
        }
        if (this.ag != null) {
            this.ag.setAttribute("width", d.toString());
            this.ag.setAttribute("height", e.toString());
            this.ag.setStyleProperty("width", a.toString() + "px");
            this.ag.setStyleProperty("height", b.toString() + "px");
        }
        if (this.ak != null) {
            this.ak.setAttribute("width", d.toString());
            this.ak.setAttribute("height", e.toString());
            this.ak.setStyleProperty("width", a.toString() + "px");
            this.ak.setStyleProperty("height", b.toString() + "px");
        }
        this.j.p.al.q();
        this.j.p.am.q();
        this.j.p.ak.q();
    };
    SeriesViewerViewManager.prototype.b8 = function () {
        if (this.f == null) {
            return { $type: Point_$type, x: 0, y: 0 };
        }
        var a = this.f.bk(this.ae.rootWrapper);
        return { $type: Point_$type, x: a.left, y: a.top };
    };
    SeriesViewerViewManager.prototype.y = function () {
        return false;
    };
    SeriesViewerViewManager.prototype.bc = function (a) {
    };
    SeriesViewerViewManager.prototype.a8 = function (a, b, c, d, e) {
        var f = this.e();
        a = f.a;
        b = f.f;
        c = f.k;
        d = f.h;
        e = f.i;
        return {
            p0: a,
            p1: b,
            p2: c,
            p3: d,
            p4: e
        };
    };
    SeriesViewerViewManager.prototype.e = function () {
        var e_34, _a;
        var a = new DefaultPaletteInfo();
        a.a = new BrushCollection();
        a.f = new BrushCollection();
        a.b = new BrushCollection();
        a.c = new BrushCollection();
        var b = new List$1(String_$type, 0);
        b.add("background-image");
        this.ae.startCSSQuery();
        var c = this.ae.getCssDefaultValuesForClassCollection("ui-chart-fill-palette-", b.toArray());
        var d = c.length;
        var e = this.ae.getCssDefaultValuesForClassCollection("ui-chart-outline-palette-", b.toArray());
        var f = e.length;
        var g = this.ae.getCssDefaultValuesForClassCollection("ui-chart-marker-fill-palette-", b.toArray());
        var h = g.length;
        var i = this.ae.getCssDefaultValuesForClassCollection("ui-chart-marker-outline-palette-", b.toArray());
        var j = i.length;
        for (var k = 0; k < d; k++) {
            a.a.add(CssGradientUtil.brushFromGradientString(c[k][0]));
        }
        for (var l = 0; l < f; l++) {
            a.f.add(CssGradientUtil.brushFromGradientString(e[l][0]));
        }
        for (var m = 0; m < h; m++) {
            a.b.add(CssGradientUtil.brushFromGradientString(g[m][0]));
        }
        for (var n = 0; n < j; n++) {
            a.c.add(CssGradientUtil.brushFromGradientString(i[n][0]));
        }
        b.clear();
        var o = 0;
        var p = 0;
        var q = Math.min(d, f);
        var r = null;
        if (d == 0) {
            b.add("background-color");
        }
        if (f == 0) {
            b.add("border-top-color");
            p = d == 0 ? 1 : 0;
        }
        if (b.count > 0) {
            r = this.ae.getCssDefaultValuesForClassCollection("ui-chart-palette-", b.toArray());
            q = r.length;
        }
        if (d == 0) {
            if (q > 0) {
                for (var s = 0; s < q; s++) {
                    var t = new Brush();
                    t._fill = r[s][o];
                    a.a.add(t);
                }
            }
            else {
                a.a.add(((function () {
                    var $ret = new Brush();
                    $ret.fill = "#8BDC5C";
                    return $ret;
                })()));
                a.a.add(((function () {
                    var $ret = new Brush();
                    $ret.fill = "#8961A9";
                    return $ret;
                })()));
                a.a.add(((function () {
                    var $ret = new Brush();
                    $ret.fill = "#6DB1FF";
                    return $ret;
                })()));
                a.a.add(((function () {
                    var $ret = new Brush();
                    $ret.fill = "#82E9D9";
                    return $ret;
                })()));
                a.a.add(((function () {
                    var $ret = new Brush();
                    $ret.fill = "#EA3C63";
                    return $ret;
                })()));
                a.a.add(((function () {
                    var $ret = new Brush();
                    $ret.fill = "#735656";
                    return $ret;
                })()));
                a.a.add(((function () {
                    var $ret = new Brush();
                    $ret.fill = "#F8CE4F";
                    return $ret;
                })()));
                a.a.add(((function () {
                    var $ret = new Brush();
                    $ret.fill = "#A8A8B7";
                    return $ret;
                })()));
                a.a.add(((function () {
                    var $ret = new Brush();
                    $ret.fill = "#E051A9";
                    return $ret;
                })()));
                a.a.add(((function () {
                    var $ret = new Brush();
                    $ret.fill = "#FF903B";
                    return $ret;
                })()));
            }
        }
        if (f == 0) {
            if (q > 0) {
                for (var u = 0; u < q; u++) {
                    var v = new Brush();
                    v._fill = r[u][p];
                    a.f.add(v);
                }
            }
            else {
                a.f.add(((function () {
                    var $ret = new Brush();
                    $ret.fill = "#8BDC5C";
                    return $ret;
                })()));
                a.f.add(((function () {
                    var $ret = new Brush();
                    $ret.fill = "#8961A9";
                    return $ret;
                })()));
                a.f.add(((function () {
                    var $ret = new Brush();
                    $ret.fill = "#6DB1FF";
                    return $ret;
                })()));
                a.f.add(((function () {
                    var $ret = new Brush();
                    $ret.fill = "#82E9D9";
                    return $ret;
                })()));
                a.f.add(((function () {
                    var $ret = new Brush();
                    $ret.fill = "#EA3C63";
                    return $ret;
                })()));
                a.f.add(((function () {
                    var $ret = new Brush();
                    $ret.fill = "#735656";
                    return $ret;
                })()));
                a.f.add(((function () {
                    var $ret = new Brush();
                    $ret.fill = "#F8CE4F";
                    return $ret;
                })()));
                a.f.add(((function () {
                    var $ret = new Brush();
                    $ret.fill = "#A8A8B7";
                    return $ret;
                })()));
                a.f.add(((function () {
                    var $ret = new Brush();
                    $ret.fill = "#E051A9";
                    return $ret;
                })()));
                a.f.add(((function () {
                    var $ret = new Brush();
                    $ret.fill = "#FF903B";
                    return $ret;
                })()));
            }
        }
        b.clear();
        var w = Math.min(h, j);
        if (h == 0) {
            b.add("background-color");
        }
        if (j == 0) {
            b.add("border-top-color");
            p = h == 0 ? 1 : 0;
        }
        if (b.count > 0) {
            r = this.ae.getCssDefaultValuesForClassCollection("ui-chart-marker-palette-", b.toArray());
            w = r.length;
        }
        if (h == 0) {
            if (w > 0) {
                var _loop_2 = function (x) {
                    var y = ((function () {
                        var $ret = new Brush();
                        $ret.fill = r[x][o];
                        return $ret;
                    })());
                    a.b.add(y);
                };
                for (var x = 0; x < w; x++) {
                    _loop_2(x);
                }
            }
            else {
                a.b.add(((function () {
                    var $ret = new Brush();
                    $ret.fill = "#FFFFFF";
                    return $ret;
                })()));
            }
        }
        if (j == 0) {
            if (w > 0) {
                var _loop_3 = function (z) {
                    var aa = ((function () {
                        var $ret = new Brush();
                        $ret.fill = r[z][p];
                        return $ret;
                    })());
                    a.c.add(aa);
                };
                for (var z = 0; z < w; z++) {
                    _loop_3(z);
                }
            }
            else {
                try {
                    for (var _b = __values(fromEnum(a.a)), _c = _b.next(); !_c.done; _c = _b.next()) {
                        var ab = _c.value;
                        a.c.add(ab);
                    }
                }
                catch (e_34_1) {
                    e_34 = { error: e_34_1 };
                }
                finally {
                    try {
                        if (_c && !_c.done && (_a = _b.return))
                            _a.call(_b);
                    }
                    finally {
                        if (e_34)
                            throw e_34.error;
                    }
                }
            }
        }
        var ac = this.ae.getCssDefaultPropertyValue("ui-chart-axis", "border-top-color");
        if (ac != null) {
            a.i = new Brush();
            a.i._fill = ac;
        }
        else {
            a.i = AxisDefaults.axis_LineBrush;
        }
        a.k = new Brush();
        a.k._fill = this.ae.getCssDefaultPropertyValue("", "color");
        a.j = Defaults.crosshairLineBrush;
        var ad = this.ae.getCssDefaultPropertyValue("ui-chart-crosshair", "border-top-color");
        if (ad != null) {
            a.j = new Brush();
            a.j._fill = ad;
        }
        this.ae.endCSSQuery();
        a.h = FontUtil.getFont(this.ae);
        var ae = ((function () {
            var $ret = new Brush();
            $ret.fill = "#ee5879";
            return $ret;
        })());
        a.d = new BrushCollection();
        a.d.add(ae);
        a.e = new BrushCollection();
        a.e.add(ae);
        return a;
    };
    SeriesViewerViewManager.prototype.a7 = function (a, b, c, d, e, f) {
        this.ae.startCSSQuery();
        var g = this.ae.getCssDefaultPropertyValue("ui-chart-area-fill-opacity", "opacity");
        a = g != null ? parseFloat(g) : 1;
        b = new Array(4);
        var h = this.ae.getCssDefaultPropertyValue("ui-chart-render-margins", "margin-top");
        var i = this.ae.getCssDefaultPropertyValue("ui-chart-render-margins", "margin-right");
        var j = this.ae.getCssDefaultPropertyValue("ui-chart-render-margins", "margin-bottom");
        var k = this.ae.getCssDefaultPropertyValue("ui-chart-render-margins", "margin-left");
        b[0] = h != null ? parseFloat(h) : NaN;
        b[1] = i != null ? parseFloat(i) : NaN;
        b[2] = j != null ? parseFloat(j) : NaN;
        b[3] = k != null ? parseFloat(k) : NaN;
        c = d = null;
        var l = this.ae.getCssDefaultPropertyValue("ui-chart-axis-stroke", "border-top-color");
        if (l != null) {
            var m = new Brush();
            m._fill = l;
            c = m;
        }
        var n = this.ae.getCssDefaultPropertyValue("ui-chart-axis-major-line", "border-top-color");
        if (n != null) {
            var o = new Brush();
            o._fill = n;
            d = o;
        }
        var p = this.ae.getCssDefaultPropertyValue("ui-chart-aligned-gridlines", "visibility");
        f = p != null && p == "visible";
        var q = this.ae.getCssDefaultPropertyValue("ui-chart-category-axis-tick", "height");
        if (q != null) {
            e = parseFloat(q);
            if (Math.abs(e) > 4000) {
                e = 0;
            }
        }
        else {
            q = this.ae.getCssDefaultPropertyValue("ui-chart-category-axis-tick", "width");
            e = q != null ? parseFloat(q) : 0;
        }
        this.ae.endCSSQuery();
        return {
            p0: a,
            p1: b,
            p2: c,
            p3: d,
            p4: e,
            p5: f
        };
    };
    SeriesViewerViewManager.prototype.ay = function () {
        this.ah.removeChildren();
    };
    SeriesViewerViewManager.prototype.bu = function (x_) {
        var box_ = this.ah;
        var offset_ = this.f.bk(this.ah);
        var a = this.b8();
        x_ = a.x + this.j.p.wz.left + x_;
        box_.setOffset(x_, this.j.p.wz.top + this.ad + a.y);
    };
    SeriesViewerViewManager.prototype.bv = function (y_) {
        this.ad = y_;
        var box_ = this.ah;
        var offset_ = this.ah.getOffset();
        var a = this.b8();
        y_ = this.j.p.wz.top + this.ad + a.y;
        box_.setOffset(offset_.left, y_);
    };
    SeriesViewerViewManager.prototype.au = function (a) {
        var b = a;
        b.show();
        this.ah.append(b);
    };
    SeriesViewerViewManager.prototype.a9 = function () {
        this.ah.hide();
    };
    SeriesViewerViewManager.prototype.bo = function () {
        this.ah.show();
    };
    SeriesViewerViewManager.prototype.av = function (a) {
        this.ae.appendToBody(a);
    };
    SeriesViewerViewManager.prototype.bk = function (a) {
        a.remove();
    };
    SeriesViewerViewManager.prototype.bd = function () {
        if (this.ae == null) {
            return;
        }
        this.ba();
        this.j.c1(this.ae.rootWrapper.width(), this.ae.rootWrapper.height());
    };
    SeriesViewerViewManager.prototype.p = function () {
        return this.l;
    };
    SeriesViewerViewManager.prototype.ce = function () {
        return this.ca;
    };
    SeriesViewerViewManager.prototype.as = function () {
        return this.aq;
    };
    SeriesViewerViewManager.prototype.ar = function () {
        return this.ap;
    };
    SeriesViewerViewManager.prototype.cd = function () {
        return this.b9;
    };
    SeriesViewerViewManager.prototype.b5 = function () {
        return this.b0;
    };
    SeriesViewerViewManager.prototype.b4 = function () {
        return this.bz;
    };
    SeriesViewerViewManager.prototype.o = function () {
        return this.k;
    };
    SeriesViewerViewManager.prototype.c = function () {
        return this.a;
    };
    SeriesViewerViewManager.prototype.d = function () {
        return this.b;
    };
    SeriesViewerViewManager.prototype.r = function () {
        return this.n;
    };
    SeriesViewerViewManager.prototype.b7 = function () {
        return this.b2;
    };
    SeriesViewerViewManager.prototype.q = function () {
        return this.m;
    };
    SeriesViewerViewManager.prototype.b6 = function () {
        return this.b1;
    };
    SeriesViewerViewManager.prototype.cf = function () {
        return this.cb;
    };
    SeriesViewerViewManager.prototype.cg = function () {
        return this.cc;
    };
    SeriesViewerViewManager.prototype.bp = function () {
        this.ae.startCSSQuery();
        this.br();
        this.bq();
        this.bt();
        this.bs();
        this.bx();
        this.ae.endCSSQuery();
    };
    SeriesViewerViewManager.prototype.bx = function () {
        var a = "ui-chart-pointer-tooltip";
        var b = this.ae.getCssDefaultPropertyValue(a, "background-color");
        var c = this.ae.getCssDefaultPropertyValue(a, "border-top-color");
        var d = this.ae.getCssDefaultPropertyValue(a, "border-top-left-radius");
        var e = this.ae.getCssDefaultPropertyValue(a, "border-top-width");
        var f = new PointerTooltipStyle();
        f.a = d != null ? parseFloat(d) : 0;
        f.c = b != null ? Brush.create(b) : ((function () {
            var $ret = new Brush();
            $ret.fill = "white";
            return $ret;
        })());
        f.d = c != null ? Brush.create(c) : ((function () {
            var $ret = new Brush();
            $ret.fill = "gray";
            return $ret;
        })());
        f.b = e != null ? parseFloat(e) : 0;
        this.h = f;
    };
    SeriesViewerViewManager.prototype.br = function () {
        var _this = this;
        var a = "ui-chart-title";
        this.l = FontUtil.getFontForClass(this.ae, a);
        this.b0 = ((function () {
            var $ret = new Brush();
            $ret.fill = _this.ae.getCssDefaultPropertyValue(a, "color");
            return $ret;
        })());
        this.aq = this.ae.getCssDefaultPropertyValue(a, "text-align");
        if (this.aq == null) {
            this.aq = "center";
        }
        var b = this.ae.getCssDefaultPropertyValue(a, "margin-top");
        var c = this.ae.getCssDefaultPropertyValue(a, "margin-bottom");
        var d = this.ae.getCssDefaultPropertyValue(a, "margin-left");
        var e = this.ae.getCssDefaultPropertyValue(a, "margin-right");
        var f = b != null ? parseFloat(b) : 0;
        var g = c != null ? parseFloat(c) : 0;
        var h = d != null ? parseFloat(d) : 0;
        var i = e != null ? parseFloat(e) : 0;
        this.ca = new Thickness(1, h, f, i, g);
    };
    SeriesViewerViewManager.prototype.bq = function () {
        var _this = this;
        var a = "ui-chart-subtitle";
        this.k = FontUtil.getFontForClass(this.ae, a);
        this.bz = ((function () {
            var $ret = new Brush();
            $ret.fill = _this.ae.getCssDefaultPropertyValue(a, "color");
            return $ret;
        })());
        this.ap = this.ae.getCssDefaultPropertyValue(a, "text-align");
        if (this.ap == null) {
            this.ap = "center";
        }
        var b = this.ae.getCssDefaultPropertyValue(a, "margin-top");
        var c = this.ae.getCssDefaultPropertyValue(a, "margin-bottom");
        var d = this.ae.getCssDefaultPropertyValue(a, "margin-left");
        var e = this.ae.getCssDefaultPropertyValue(a, "margin-right");
        var f = b != null ? parseFloat(b) : 0;
        var g = c != null ? parseFloat(c) : 0;
        var h = d != null ? parseFloat(d) : 0;
        var i = e != null ? parseFloat(e) : 0;
        this.b9 = new Thickness(1, h, f, i, g);
    };
    SeriesViewerViewManager.prototype.bs = function () {
        var _this = this;
        var a = "ui-chart-horizontal-axis-title";
        this.m = FontUtil.getFontForClass(this.ae, a);
        this.b1 = ((function () {
            var $ret = new Brush();
            $ret.fill = _this.ae.getCssDefaultPropertyValue(a, "color");
            return $ret;
        })());
        var b = this.ae.getCssDefaultPropertyValue(a, "vertical-align");
        if (b == null) {
            this.a = 0;
        }
        else if (b.toLowerCase() == "bottom") {
            this.a = 4;
        }
        else {
            this.a = 3;
        }
        var c = this.ae.getCssDefaultPropertyValue(a, "margin-top");
        var d = this.ae.getCssDefaultPropertyValue(a, "margin-bottom");
        var e = this.ae.getCssDefaultPropertyValue(a, "margin-left");
        var f = this.ae.getCssDefaultPropertyValue(a, "margin-right");
        var g = c != null ? parseFloat(c) : 2;
        var h = d != null ? parseFloat(d) : 2;
        var i = e != null ? parseFloat(e) : 2;
        var j = f != null ? parseFloat(f) : 2;
        this.cb = new Thickness(1, i, g, j, h);
    };
    SeriesViewerViewManager.prototype.bt = function () {
        var _this = this;
        var a = "ui-chart-vertical-axis-title";
        this.n = FontUtil.getFontForClass(this.ae, a);
        this.b2 = ((function () {
            var $ret = new Brush();
            $ret.fill = _this.ae.getCssDefaultPropertyValue(a, "color");
            return $ret;
        })());
        var b = this.ae.getCssDefaultPropertyValue(a, "text-align");
        if (b == null) {
            this.b = 0;
        }
        else if (b.toLowerCase() == "right") {
            this.b = 2;
        }
        else {
            this.b = 1;
        }
        var c = this.ae.getCssDefaultPropertyValue(a, "margin-top");
        var d = this.ae.getCssDefaultPropertyValue(a, "margin-bottom");
        var e = this.ae.getCssDefaultPropertyValue(a, "margin-left");
        var f = this.ae.getCssDefaultPropertyValue(a, "margin-right");
        var g = c != null ? parseFloat(c) : 0;
        var h = d != null ? parseFloat(d) : 0;
        var i = e != null ? parseFloat(e) : 0;
        var j = f != null ? parseFloat(f) : 0;
        this.cc = new Thickness(1, i, g, j, h);
    };
    SeriesViewerViewManager.prototype.a6 = function (a, b) {
        var c = this.j.p.hk;
        if (a != this.ab || b != this.aa || c != this.ac) {
            this.az(a, b, this.j.p.hk);
            this.j.p.al.l();
            this.j.a.l();
        }
    };
    SeriesViewerViewManager.prototype.i = function () {
        return this.h;
    };
    SeriesViewerViewManager.prototype.bb = function (a) {
        if (this.f == null) {
            return;
        }
        this.f.ab = a;
        this.f.ap = runOn(this.j, this.j.at);
    };
    SeriesViewerViewManager.prototype.an = function (a, b, c) {
        var _this = this;
        var d;
        if (!((function () { var e = _this.z.tryGetValue(b.iD.toString(), d); d = e.p1; return e.ret; })())) {
            var e = this.ae.createElement("canvas");
            e.setAttribute("width", c.toString());
            e.setAttribute("height", c.toString());
            e.setStyleProperty("width", c.toString() + "px");
            e.setStyleProperty("height", c.toString() + "px");
            var f = this.ae.get2DCanvasContext(e);
            var g = new RenderingContext(new CanvasViewRenderer(), f);
            var h = new Tuple$2(DomWrapper_$type, RenderingContext.$, e, g);
            d = h;
            this.z.addItem(b.iD.toString(), d);
        }
        var i = new Rect(0, 0, 0, c, c);
        var j = new RenderSurface();
        j.a = d.d;
        for (var k = 0; k < this.j.p.series.count; k++) {
            var l = this.j.p.series._inner[k];
            l.rt(i, a, j, "tile", 1);
        }
        this.j.p.ak.l();
        return d.c;
    };
    SeriesViewerViewManager.prototype.a3 = function (a) {
        this.z.removeItem(a.iD.toString());
    };
    SeriesViewerViewManager.prototype.a2 = function () {
        this.z.clear();
    };
    SeriesViewerViewManager.prototype.bl = function (a) {
        for (var b = 0; b < a.count; b++) {
            var c = a._inner[b];
            var d = c.content;
            this.j.z.n(d.getNativeElement(), 1, c.xPosition + this.j.p.wz.left, c.yPosition + this.j.p.wz.top, c.width, c.height);
        }
    };
    SeriesViewerViewManager.prototype.a0 = function () {
        var _this = this;
        if (this.al != -1) {
            this.aw();
        }
        if (this.ae != null) {
            this.al = this.ae.setTimeout(function () { return _this.j.p.bb.f$m(_this.j.p); }, 5000);
        }
        else {
            this.al = window.setTimeout(function () { return _this.j.p.bb.f$m(_this.j.p); }, 5000);
        }
    };
    SeriesViewerViewManager.prototype.aw = function () {
        if (this.al != -1) {
            if (this.ae != null) {
                this.ae.clearTimeout(this.al);
            }
            else {
                window.clearTimeout(this.al);
            }
            this.al = -1;
        }
    };
    SeriesViewerViewManager.prototype.a1 = function (a) {
        var _this = this;
        if (this.am != -1) {
            this.ax();
        }
        if (this.ae != null) {
            this.am = this.ae.setTimeout(function () { return _this.j.p.nu(); }, a);
        }
        else {
            this.am = window.setTimeout(function () { return _this.j.p.nu(); }, a);
        }
    };
    SeriesViewerViewManager.prototype.ax = function () {
        if (this.am != -1) {
            if (this.ae != null) {
                this.ae.clearTimeout(this.am);
            }
            else {
                window.clearTimeout(this.am);
            }
            this.am = -1;
        }
    };
    SeriesViewerViewManager.prototype.be = function () {
        if (this.j.p.au != 1) {
            if (this.s == null) {
                this.u = new RenderingContext(new CanvasViewRenderer(), this.ae.get2DCanvasContext(this.ag));
                this.s = this.u;
            }
            else {
                this.u = this.s;
            }
        }
        else {
            this.u = new RenderingContext(null, null);
        }
        this.j.dt(this.u);
    };
    SeriesViewerViewManager.prototype.bw = function (a) {
        if (this.ae != null) {
            var b = "igTouch";
            if (a) {
                this.ae.rootWrapper.addClass(b);
            }
            else {
                this.ae.rootWrapper.removeClass(b);
            }
        }
    };
    SeriesViewerViewManager.prototype.a4 = function () {
    };
    SeriesViewerViewManager.prototype.a5 = function () {
    };
    SeriesViewerViewManager.prototype.bh = function () {
        if (this.f != null) {
            this.f.bh(this.aj, "");
        }
    };
    SeriesViewerViewManager.prototype.bf = function () {
        this.ba();
        if (this.f != null) {
            this.f.at(this.aj, "");
        }
    };
    SeriesViewerViewManager.prototype.ao = function (a, b, c) {
        var d = this.ae.createElement("img");
        d.setProperty("src", this.at(a, b, c, "image/png"));
        return d.getNativeElement();
    };
    SeriesViewerViewManager.prototype.at = function (a, b, c, d, e) {
        var _this = this;
        if (e === void 0) {
            e = null;
        }
        var f = a * c;
        var g = b * c;
        var h = this.ae.createElement("canvas");
        h.setStyleProperty("width", a + "px");
        h.setStyleProperty("height", b + "px");
        h.setProperty("width", f);
        h.setProperty("height", g);
        var i = this.ae.get2DCanvasContext(h);
        var j = ((function () {
            var $ret = new Brush();
            $ret.fill = _this.ae.rootWrapper.getStyleProperty("background-color");
            return $ret;
        })());
        if (BrushUtilCore.a(j)) {
            j._fill = this.ae.rootWrapper.parent().getStyleProperty("background-color");
            if (BrushUtilCore.a(j)) {
                j._fill = "rgb(255, 255, 255)";
            }
        }
        if (c != 1) {
            i.save();
            i.scale(c, c);
        }
        i.fillStyle = j._fill;
        i.fillRect(0, 0, a, b);
        if (this.t != null && this.t != this.v) {
            i.drawImage(this.af.getNativeElement(), 0, 0, a, b);
        }
        if (this.v != null) {
            i.drawImage(this.ai.getNativeElement(), 0, 0, a, b);
        }
        if (this.w != null && this.w != this.v) {
            i.drawImage(this.aj.getNativeElement(), 0, 0, a, b);
        }
        if (c != 1) {
            i.restore();
        }
        var format_ = d;
        var sCanv_ = h.getNativeElement();
        var url_ = (sCanv_.toDataURL(format_));
        if (e != null) {
            var cb_1 = e;
            sCanv_.toBlob(function (blob) { cb_1(url_, blob); }, format_);
        }
        return url_;
    };
    SeriesViewerViewManager.$t = markType(SeriesViewerViewManager, 'SeriesViewerViewManager');
    return SeriesViewerViewManager;
}(Base));
export { SeriesViewerViewManager };
/**
 * @hidden
 */
var AutoRangeCalculator = /** @class */ /*@__PURE__*/ (function (_super) {
    __extends(AutoRangeCalculator, _super);
    function AutoRangeCalculator() {
        return _super !== null && _super.apply(this, arguments) || this;
    }
    AutoRangeCalculator.a = function (a, b, c, d, e, f, g) {
        f = !isNaN_(b) && !isInfinity(b) ? b : Number.POSITIVE_INFINITY;
        g = !isNaN_(c) && !isInfinity(c) ? c : Number.NEGATIVE_INFINITY;
        var h = f;
        var i = g;
        if (isInfinity(h) || isInfinity(i)) {
            if (a != null) {
                var j = a.kv();
                if (j != null) {
                    h = Math.min(h, j.c);
                    i = Math.max(i, j.b);
                }
            }
        }
        if (!isInfinity(h) && !isInfinity(i)) {
            if (h == i && h != 0) {
                h *= h > 0 ? 0.9 : 1.1;
                i *= i > 0 ? 1.1 : 0.9;
            }
            if (h == i && h == 0) {
                i = 1;
            }
            if (b > c) {
                var k = c;
                c = b;
                b = k;
            }
            var l = isNaN_(b) || isInfinity(b) ? h : b;
            var m = isNaN_(c) || isInfinity(c) ? i : c;
            if (d) {
                if (l <= 0) {
                    if (m > 1) {
                        l = 1;
                    }
                    else {
                        l = Math.pow(e, Math.floor(logBase(m, e)));
                    }
                }
                if (isNaN_(b) || isInfinity(b)) {
                    var n = logBase(l, e);
                    h = Math.pow(e, Math.floor(n));
                }
                else {
                    h = l;
                }
                if (isNaN_(c) || isInfinity(c)) {
                    i = Math.pow(e, Math.ceil(logBase(m, e)));
                }
                else {
                    i = m;
                }
            }
            else {
                var o = Math.pow(10, Math.floor(log10(m - l)) - 1);
                var p = a.ek();
                if (a != null && p > 0 && (!a.lm && !a.ll)) {
                    var q = new LinearNumericSnapper(0, h, i, p, a.e0(), a.mk);
                    o = q.g;
                }
                else if (a.lh && p > 0 && (!a.lm || !a.ll)) {
                    var r = h;
                    var s = i;
                    if (a.lm) {
                        r = b;
                    }
                    if (a.ll) {
                        s = c;
                    }
                    var t = new LinearNumericSnapper(0, r, s, p, a.e0(), a.mk);
                    o = t.g;
                }
                if ((isNaN_(b) || isInfinity(b)) && !isNaN_(h) && !isNaN_(o) && o != 0) {
                    {
                        h = o * Math.floor(h / o);
                    }
                }
                else {
                    h = l;
                }
                if ((isNaN_(c) || isInfinity(c)) && !isNaN_(i) && !isNaN_(o) && o != 0) {
                    var u = Math.ceil(i / o);
                    {
                        i = o * u;
                    }
                }
                else {
                    i = m;
                }
                if (a.lh) {
                    if (a.lh && p > 0 && (!a.lm || !a.ll)) {
                        var v = new LinearNumericSnapper(0, h, i, p, a.e0(), a.mk);
                        var w = v.g;
                        if (w != o) {
                            o = w;
                            if ((isNaN_(b) || isInfinity(b)) && !isNaN_(h) && !isNaN_(o) && o != 0) {
                                {
                                    h = o * Math.floor(h / o);
                                }
                            }
                            else {
                                h = l;
                            }
                            if ((isNaN_(c) || isInfinity(c)) && !isNaN_(i) && !isNaN_(o) && o != 0) {
                                var x = Math.ceil(i / o);
                                {
                                    i = o * x;
                                }
                            }
                            else {
                                i = m;
                            }
                        }
                    }
                }
            }
        }
        f = h;
        g = i;
        return {
            p5: f,
            p6: g
        };
    };
    AutoRangeCalculator.$t = markType(AutoRangeCalculator, 'AutoRangeCalculator');
    return AutoRangeCalculator;
}(Base));
export { AutoRangeCalculator };
/**
 * @hidden
 */
export var IAxisAnnotationManager_$type = /*@__PURE__*/ new Type(null, 'IAxisAnnotationManager');
/**
 * @hidden
 */
var AxisLabelSettings = /** @class */ /*@__PURE__*/ (function (_super) {
    __extends(AxisLabelSettings, _super);
    function AxisLabelSettings() {
        var _this = _super.call(this) || this;
        _this.ab = null;
        _this.ay = null;
        _this.b = 1;
        _this.a3 = 0;
        _this.i = true;
        _this.c = 0;
        _this.a = null;
        _this.n = 0;
        _this.p = NaN;
        _this.q = 2;
        _this.r = 2;
        _this.s = 2;
        _this.o = 2;
        _this.av = 0;
        _this.a0 = 1;
        _this.propertyChanged = null;
        _this.propertyUpdated = null;
        _this.f = null;
        _this.propertyUpdated = delegateCombine(_this.propertyUpdated, function (a, b) { return _this.ar(a, b.propertyName, b.oldValue, b.newValue); });
        return _this;
    }
    Object.defineProperty(AxisLabelSettings.prototype, "textStyle", {
        get: function () {
            return this.ab;
        },
        set: function (a) {
            var b = this.ab;
            this.ab = a;
            if (this.ab != b) {
                this.f = null;
                this.as("TextStyle", b, a);
            }
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(AxisLabelSettings.prototype, "textColor", {
        get: function () {
            return this.ay;
        },
        set: function (a) {
            var b = this.ay;
            this.ay = a;
            this.as("TextColor", b, a);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(AxisLabelSettings.prototype, "location", {
        get: function () {
            return this.b;
        },
        set: function (a) {
            var b = this.b;
            this.b = a;
            this.as("Location", enumGetBox(AxisLabelsLocation_$type, b), enumGetBox(AxisLabelsLocation_$type, a));
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(AxisLabelSettings.prototype, "visibility", {
        get: function () {
            return this.a3;
        },
        set: function (a) {
            var b = this.a3;
            this.a3 = a;
            this.as("Visibility", enumGetBox(Visibility_$type, b), enumGetBox(Visibility_$type, a));
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(AxisLabelSettings.prototype, "showFirstLabel", {
        get: function () {
            return this.i;
        },
        set: function (a) {
            var b = this.i;
            this.i = a;
            this.as("ShowFirstLabel", b, a);
        },
        enumerable: false,
        configurable: true
    });
    AxisLabelSettings.prototype.registerAxis = function (a) {
        this.a = a;
    };
    AxisLabelSettings.prototype.unregisterAxis = function (a) {
        this.a = null;
    };
    Object.defineProperty(AxisLabelSettings.prototype, "angle", {
        get: function () {
            return this.n;
        },
        set: function (a) {
            var b = this.n;
            this.n = a;
            this.as("Angle", b, a);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(AxisLabelSettings.prototype, "extent", {
        get: function () {
            return this.p;
        },
        set: function (a) {
            var b = this.p;
            this.p = a;
            this.as("Extent", b, a);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(AxisLabelSettings.prototype, "margin", {
        set: function (a) {
            this.leftMargin = a;
            this.bottomMargin = a;
            this.rightMargin = a;
            this.topMargin = a;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(AxisLabelSettings.prototype, "leftMargin", {
        get: function () {
            return this.q;
        },
        set: function (a) {
            var b = this.q;
            this.q = a;
            this.as("LeftMargin", b, a);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(AxisLabelSettings.prototype, "rightMargin", {
        get: function () {
            return this.r;
        },
        set: function (a) {
            var b = this.r;
            this.r = a;
            this.as("RightMargin", b, a);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(AxisLabelSettings.prototype, "topMargin", {
        get: function () {
            return this.s;
        },
        set: function (a) {
            var b = this.s;
            this.s = a;
            this.as("TopMargin", b, a);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(AxisLabelSettings.prototype, "bottomMargin", {
        get: function () {
            return this.o;
        },
        set: function (a) {
            var b = this.o;
            this.o = a;
            this.as("BottomMargin", b, a);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(AxisLabelSettings.prototype, "horizontalAlignment", {
        get: function () {
            return this.av;
        },
        set: function (a) {
            var b = this.av;
            this.av = a;
            this.as("HorizontalAlignment", enumGetBox(HorizontalAlignment_$type, b), enumGetBox(HorizontalAlignment_$type, a));
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(AxisLabelSettings.prototype, "verticalAlignment", {
        get: function () {
            return this.a0;
        },
        set: function (a) {
            var b = this.a0;
            this.a0 = a;
            this.as("VerticalAlignment", enumGetBox(VerticalAlignment_$type, b), enumGetBox(VerticalAlignment_$type, a));
        },
        enumerable: false,
        configurable: true
    });
    AxisLabelSettings.prototype.as = function (a, b, c) {
        if (this.propertyChanged != null) {
            this.propertyChanged(this, new PropertyChangedEventArgs(a));
        }
        if (this.propertyUpdated != null) {
            this.propertyUpdated(this, new PropertyUpdatedEventArgs(a, b, c));
        }
    };
    AxisLabelSettings.prototype.ar = function (a, b, c, d) {
        switch (b) {
            case "Location":
                this.c = this.location;
                break;
        }
        if (this.a == null || this.a.bg == null) {
            return;
        }
        switch (b) {
            case "Angle":
                this.a.cq = true;
                this.a.ia();
                break;
            case "TextStyle":
                this.f = null;
                this.a.cq = true;
                if (this.a.bi != null) {
                    this.a.bi.oc();
                }
                this.a.ia();
                break;
            case "Location":
            case "Extent":
            case "Visibility":
            case "HorizontalAlignment":
            case "VerticalAlignment":
            case "TopMargin":
            case "RightMargin":
            case "BottomMargin":
            case "LeftMargin":
            case "ShowFirstLabel":
                this.a.cq = true;
                if (this.a.bi != null) {
                    this.a.bi.oc();
                }
                this.a.ia();
                break;
            case "TextColor":
                this.a.ia();
                break;
        }
    };
    AxisLabelSettings.prototype.k = function () {
        return this.n != 0;
    };
    AxisLabelSettings.prototype.l = function () {
        return !isNaN_(this.p);
    };
    Object.defineProperty(AxisLabelSettings.prototype, "j", {
        get: function () {
            return this.textStyle != null || this.f != null;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(AxisLabelSettings.prototype, "g", {
        get: function () {
            return this.f;
        },
        set: function (a) {
            this.f = a;
        },
        enumerable: false,
        configurable: true
    });
    AxisLabelSettings.prototype.h = function (a) {
        if (this.f == null) {
            this.f = FontUtil.toFontInfo(a, this.textStyle);
        }
        return this.f;
    };
    AxisLabelSettings.$t = markType(AxisLabelSettings, 'AxisLabelSettings', Base.$, [INotifyPropertyChanged_$type]);
    AxisLabelSettings.extentPropertyDefault = NaN;
    return AxisLabelSettings;
}(Base));
export { AxisLabelSettings };
/**
 * @hidden
 */
var TitleSettings = /** @class */ /*@__PURE__*/ (function (_super) {
    __extends(TitleSettings, _super);
    function TitleSettings() {
        var _this = _super.call(this) || this;
        _this.a5 = 0;
        _this.horizontalAlignment = 1;
        _this.leftMargin = NaN;
        _this.rightMargin = NaN;
        _this.topMargin = NaN;
        _this.bottomMargin = NaN;
        return _this;
    }
    Object.defineProperty(TitleSettings.prototype, "position", {
        get: function () {
            return this.a5;
        },
        set: function (a) {
            var b = this.a5;
            this.a5 = a;
            this.as("AxisTitlePosition", enumGetBox(AxisTitlePosition_$type, b), enumGetBox(AxisTitlePosition_$type, a));
        },
        enumerable: false,
        configurable: true
    });
    TitleSettings.prototype.ar = function (a, b, c, d) {
        _super.prototype.ar.call(this, a, b, c, d);
        if (this.a == null || this.a.bi == null) {
            return;
        }
        switch (b) {
            case "AxisTitlePosition":
                this.a.cq = true;
                this.a.ia();
                break;
        }
    };
    TitleSettings.$t = markType(TitleSettings, 'TitleSettings', AxisLabelSettings.$);
    return TitleSettings;
}(AxisLabelSettings));
export { TitleSettings };
/**
 * @hidden
 */
var Axis = /** @class */ /*@__PURE__*/ (function (_super) {
    __extends(Axis, _super);
    function Axis() {
        var _this = _super.call(this) || this;
        _this.a5 = null;
        _this.bt = null;
        _this.a9 = null;
        _this.a7 = null;
        _this.iu = null;
        _this.bn = null;
        _this.bh = null;
        _this.bs = null;
        _this.by = false;
        _this.dm = NaN;
        _this.dg = 50;
        _this.dt = 0;
        _this.dq = 150;
        _this.as = 0;
        _this.dl = NaN;
        _this.dx = 0;
        _this.ds = 0;
        _this.dp = 180;
        _this.bk = null;
        _this.bj = null;
        _this.f5 = "Verdana";
        _this.dn = NaN;
        _this.dz = 0;
        _this.du = 8;
        _this.dr = 16;
        _this.fq = -1;
        _this.fp = 1;
        _this.fo = 3;
        _this.fr = 0;
        _this.kn = 0;
        _this.dw = 0;
        _this.dv = 2;
        _this.iv = null;
        _this.d0 = 0;
        _this.ci = false;
        _this.bw = false;
        _this.dh = 0;
        _this.cv = false;
        _this.cx = false;
        _this.bz = false;
        _this.rangeChanged = null;
        _this.al = new AxisAnnotationCollection();
        _this.am = new AxisAnnotationCollection();
        _this.j9 = Rect.empty;
        _this.kg = null;
        _this.dd = null;
        _this.de = null;
        _this.aw = null;
        _this.bx = false;
        _this.ka = null;
        _this.a6 = null;
        _this.fn = null;
        _this.ai = null;
        _this._coercionMethods = null;
        _this.bv = false;
        _this.cy = false;
        _this.c7 = false;
        _this.renderRequested = null;
        _this.bc = null;
        _this.cr = false;
        _this.dj = NaN;
        _this.dk = -1;
        _this.cs = false;
        _this.propertyChanged = null;
        _this.propertyUpdated = null;
        _this.df = null;
        _this.da = new Dictionary$2(String_$type, String_$type, 0);
        _this.c9 = new Dictionary$2(String_$type, FastReflectionHelper.$, 0);
        _this.km = new Size();
        _this.ap = new AxisComponentsForView();
        _this.d4 = 0;
        _this.di = 0;
        _this.br = null;
        _this.bq = null;
        _this.bp = null;
        _this.ax = new AxisLabelSettings();
        _this.fm = null;
        DVContainer.instance.registerIfLoaded("VisualDataFactoryManager");
        DVContainer.instance.registerIfLoaded("AnnotationFactoryManager");
        _this.ka = Rect.empty;
        _this.bz = true;
        _this.d4 = NaN;
        _this.a5 = _this.a4();
        _this.hv(_this.a5);
        _this.a5.al();
        _this.br = ((function () {
            var $ret = new Pool$1(TextBlock.$);
            $ret.create = runOn(_this.a5, _this.a5.a3);
            $ret.activate = runOn(_this.a5, _this.a5.aw);
            $ret.disactivate = runOn(_this.a5, _this.a5.ay);
            $ret.destroy = runOn(_this.a5, _this.a5.ax);
            return $ret;
        })());
        _this.bq = ((function () {
            var $ret = new Pool$1(TextBlock.$);
            $ret.create = runOn(_this.a5, _this.a5.a3);
            $ret.activate = runOn(_this.a5, _this.a5.aw);
            $ret.disactivate = runOn(_this.a5, _this.a5.ay);
            $ret.destroy = runOn(_this.a5, _this.a5.ax);
            return $ret;
        })());
        _this.bp = ((function () {
            var $ret = new Pool$1(Rectangle.$);
            $ret.create = runOn(_this.a5, _this.a5.bi);
            $ret.activate = runOn(_this.a5, _this.a5.t);
            $ret.disactivate = runOn(_this.a5, _this.a5.v);
            $ret.destroy = runOn(_this.a5, _this.a5.u);
            return $ret;
        })());
        _this.kg = Rect.empty;
        _this.dd = new List$1(Base.$, 0);
        _this.de = new List$1(LabelPosition.$, 0);
        _this.aw = _this.av();
        _this.aw.ag = _this.az;
        _this.aw.ad = _this;
        _this.df = new List$1(Series.$, 0);
        var a = _this.al;
        a.collectionResetting = delegateCombine(a.collectionResetting, runOn(_this, _this.he));
        var b = _this.al;
        b.collectionChanged = delegateCombine(b.collectionChanged, runOn(_this, _this.hd));
        var c = _this.am;
        c.collectionResetting = delegateCombine(c.collectionResetting, runOn(_this, _this.hg));
        var d = _this.am;
        d.collectionChanged = delegateCombine(d.collectionChanged, runOn(_this, _this.hf));
        _this.ab = Axis.$;
        if (_this.az != null) {
            _this.ax = _this.az;
        }
        _this.propertyUpdated = delegateCombine(_this.propertyUpdated, function (e, f) { return _this.hz(e, f.propertyName, f.oldValue, f.newValue); });
        _this.bs = function (e, f) {
            if (_this.bi == null || !_this.bi.e1) {
                _this.it(f.oldRect, f.newRect);
            }
        };
        _this.a5.aa();
        return _this;
    }
    Axis.prototype.a4 = function () {
        return new AxisView(this);
    };
    Axis.prototype.hv = function (a) {
    };
    Axis.prototype.hh = function () {
        if (this.ca) {
            this.a8.onAddAnnotations(this);
        }
    };
    Object.defineProperty(Axis.prototype, "bu", {
        get: function () {
            if (this.bt == null) {
                this.bt = new SRProvider(this.fn);
            }
            if (this.bt.l == null) {
                this.bt.l = this.fn;
            }
            return this.bt;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(Axis.prototype, "ba", {
        get: function () {
            var _this = this;
            if (this.a9 == null) {
                this.a9 = DVContainer.instance.createInstance(IAxisVisualDataManager_$type, function () { return _this.bu.q; });
            }
            return this.a9;
        },
        enumerable: false,
        configurable: true
    });
    Axis.prototype.ek = function () {
        return this.kb().width;
    };
    Axis.prototype.f4 = function () {
        return null;
    };
    Axis.prototype.f3 = function () {
        return null;
    };
    Axis.prototype.get_cb = function () {
        return false;
    };
    Object.defineProperty(Axis.prototype, "cb", {
        get: function () {
            return this.get_cb();
        },
        enumerable: false,
        configurable: true
    });
    Axis.prototype.get_cj = function () {
        return false;
    };
    Object.defineProperty(Axis.prototype, "cj", {
        get: function () {
            return this.get_cj();
        },
        enumerable: false,
        configurable: true
    });
    Axis.prototype.get_b9 = function () {
        return false;
    };
    Object.defineProperty(Axis.prototype, "b9", {
        get: function () {
            return this.get_b9();
        },
        enumerable: false,
        configurable: true
    });
    Axis.prototype.get_cm = function () {
        return false;
    };
    Object.defineProperty(Axis.prototype, "cm", {
        get: function () {
            return this.get_cm();
        },
        enumerable: false,
        configurable: true
    });
    Axis.prototype.get_cp = function () {
        return false;
    };
    Object.defineProperty(Axis.prototype, "cp", {
        get: function () {
            return this.get_cp();
        },
        enumerable: false,
        configurable: true
    });
    Axis.prototype.get_cn = function () {
        return false;
    };
    Object.defineProperty(Axis.prototype, "cn", {
        get: function () {
            return this.get_cn();
        },
        enumerable: false,
        configurable: true
    });
    Axis.prototype.d5 = function (a) {
        return NaN;
    };
    Axis.prototype.get_ce = function () {
        return false;
    };
    Object.defineProperty(Axis.prototype, "ce", {
        get: function () {
            return this.get_ce();
        },
        enumerable: false,
        configurable: true
    });
    Axis.prototype.get_ck = function () {
        return false;
    };
    Object.defineProperty(Axis.prototype, "ck", {
        get: function () {
            return this.get_ck();
        },
        enumerable: false,
        configurable: true
    });
    Axis.prototype.get_cl = function () {
        return false;
    };
    Object.defineProperty(Axis.prototype, "cl", {
        get: function () {
            return this.get_cl();
        },
        enumerable: false,
        configurable: true
    });
    Axis.prototype.get_cc = function () {
        return false;
    };
    Object.defineProperty(Axis.prototype, "cc", {
        get: function () {
            return this.get_cc();
        },
        enumerable: false,
        configurable: true
    });
    Axis.prototype.get_cd = function () {
        return true;
    };
    Object.defineProperty(Axis.prototype, "cd", {
        get: function () {
            return this.get_cd();
        },
        enumerable: false,
        configurable: true
    });
    Axis.prototype.ak = function () {
        return this.aj;
    };
    Object.defineProperty(Axis.prototype, "a8", {
        get: function () {
            var _this = this;
            if (this.a7 == null) {
                this.a7 = DVContainer.instance.createInstance(IAxisAnnotationManager_$type, function () { return _this.bu.n; });
                this.a7.owner = this;
            }
            return this.a7;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(Axis.prototype, "ca", {
        get: function () {
            return DVContainer.instance.checkLoaded("AnnotationFactoryManager");
        },
        enumerable: false,
        configurable: true
    });
    Axis.prototype.hf = function (a, b) {
        if (!this.ca) {
            return;
        }
        this.a8.onAutoAnnotionsChanged(this, this.am, b);
    };
    Axis.prototype.hg = function (a, b) {
        if (!this.ca) {
            return;
        }
        this.a8.onAutoAnnotionsReset(this, this.am, b);
    };
    Axis.prototype.hd = function (a, b) {
        if (!this.ca) {
            return;
        }
        this.a8.onAnnotionsChanged(this, this.al, b);
    };
    Axis.prototype.he = function (a, b) {
        if (!this.ca) {
            return;
        }
        this.a8.onAnnotionsReset(this, this.al, b);
    };
    Axis.prototype.provideRenderer = function (a) {
        this.fn = a;
        this.hi();
        this.aw.ag = this.az;
    };
    Axis.prototype.hs = function (a, b) {
        if (!a.equals1(b)) {
            this.is(a, b);
        }
    };
    Axis.prototype.ac = function () {
        _super.prototype.ac.call(this);
        this.a5.ao();
    };
    Object.defineProperty(Axis.prototype, "bo", {
        get: function () {
            return this.bn;
        },
        set: function (a) {
            if (this.bo != a) {
                var b = this.bo;
                this.bn = a;
                this.h5("FastItemsSourceProvider", b, this.bn);
            }
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(Axis.prototype, "bi", {
        get: function () {
            return this.bh;
        },
        set: function (a) {
            if (this.bi != a) {
                var b = this.bi;
                this.bh = a;
                this.h5("SeriesViewer", b, this.bh);
            }
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(Axis.prototype, "bg", {
        get: function () {
            return typeCast(XamDataChart.$, this.bi);
        },
        set: function (a) {
            this.bi = a;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(Axis.prototype, "c6", {
        get: function () {
            return this.by;
        },
        set: function (a) {
            if (this.by == a) {
                return;
            }
            this.by = a;
            var b = null;
            if (this.aw != null && Rect.l_op_Inequality(this.aw.c1, null)) {
                b = this.aw.c1;
            }
            this.aw = this.av();
            this.aw.ad = this;
            this.aw.ag = this.az;
            if (Rect.l_op_Inequality(b, null)) {
                this.aw.c1 = b;
            }
            if (this.bi != null && this.bi.c9 != null) {
                this.aw.af.al(this.bi.c9.y);
                this.h9(true);
            }
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(Axis.prototype, "e8", {
        get: function () {
            return this.dm;
        },
        set: function (a) {
            var b = this.dm;
            if (b != a) {
                this.dm = a;
                this.dy = a;
                this.h9(true);
            }
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(Axis.prototype, "dy", {
        get: function () {
            return this.dg;
        },
        set: function (a) {
            this.dg = a;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(Axis.prototype, "fe", {
        get: function () {
            return this.dt;
        },
        set: function (a) {
            this.dt = a;
            this.h9(true);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(Axis.prototype, "fb", {
        get: function () {
            return this.dq;
        },
        set: function (a) {
            this.dq = a;
            this.h9(true);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(Axis.prototype, "at", {
        get: function () {
            return this.as;
        },
        set: function (a) {
            var b = this.as;
            if (b != a) {
                this.as = a;
                this.h9(true);
            }
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(Axis.prototype, "e7", {
        get: function () {
            return this.dl;
        },
        set: function (a) {
            this.dl = a;
            this.h8();
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(Axis.prototype, "fd", {
        get: function () {
            return this.ds;
        },
        set: function (a) {
            this.ds = a;
            this.h8();
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(Axis.prototype, "fa", {
        get: function () {
            return this.dp;
        },
        set: function (a) {
            this.dp = a;
            this.h8();
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(Axis.prototype, "bm", {
        get: function () {
            if (this.bk == null) {
                if (this.bj == null) {
                    this.bj = this.a5.i();
                }
                return this.bj;
            }
            return this.bk;
        },
        set: function (a) {
            this.bk = a;
            this.dn = FontUtil.getFontSize(this.bk);
            this.h8();
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(Axis.prototype, "gz", {
        get: function () {
            return this.f5;
        },
        set: function (a) {
            this.f5 = a;
            var b = this.dn;
            if (isNaN_(b)) {
                b = 12;
            }
            this.bm.q = a;
            this.bm.f = b;
            this.aw.b8();
            this.h8();
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(Axis.prototype, "e9", {
        get: function () {
            return this.dn;
        },
        set: function (a) {
            this.dn = a;
            this.bm = FontUtil.getFontWithNewFontSize(this.bm, this.dn);
            this.h8();
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(Axis.prototype, "ff", {
        get: function () {
            return this.du;
        },
        set: function (a) {
            this.du = a;
            this.h8();
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(Axis.prototype, "fc", {
        get: function () {
            return this.dr;
        },
        set: function (a) {
            this.dr = a;
            this.h8();
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(Axis.prototype, "fv", {
        get: function () {
            return this.fq;
        },
        set: function (a) {
            this.fq = a;
            this.h8();
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(Axis.prototype, "fu", {
        get: function () {
            return this.fp;
        },
        set: function (a) {
            this.fp = a;
            this.h8();
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(Axis.prototype, "ft", {
        get: function () {
            return this.fo;
        },
        set: function (a) {
            this.fo = a;
            this.h8();
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(Axis.prototype, "kq", {
        get: function () {
            return this.kn;
        },
        set: function (a) {
            this.kn = a;
            this.h8();
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(Axis.prototype, "fh", {
        get: function () {
            return this.dw;
        },
        set: function (a) {
            this.dw = a;
            this.h8();
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(Axis.prototype, "fg", {
        get: function () {
            return this.dv;
        },
        set: function (a) {
            this.dv = a;
            this.h8();
        },
        enumerable: false,
        configurable: true
    });
    Axis.prototype.ik = function () {
        this.aw.cp();
    };
    Axis.prototype.h8 = function () {
        this.h9(false);
    };
    Axis.prototype.h9 = function (a) {
        if (a) {
            this.aw.co();
        }
        this.cq = true;
        this.h7();
    };
    Axis.prototype.io = function () {
        if (this.fj > 0) {
            this.d0 = this.fj;
            return;
        }
        var a = typeCast(XamDataChart.$, this.bi);
        if (a != null && isNaN_(this.fj) && this.cb && (this.cp || this.a2 == 0)) {
            this.d0 = a.xk.fq;
            return;
        }
        this.d0 = 0;
    };
    Object.defineProperty(Axis.prototype, "b4", {
        get: function () {
            return this.bw;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(Axis.prototype, "b7", {
        get: function () {
            return this.az != null && this.az.k();
        },
        enumerable: false,
        configurable: true
    });
    Axis.prototype.ij = function (a) {
        this.bw = true;
        if (this.dh != a) {
            this.dh = a;
            this.ib(false);
        }
    };
    Axis.prototype.id = function () {
        this.bw = false;
        this.dh = 0;
        this.ib(false);
    };
    Axis.prototype.eh = function () {
        if (this.b4 && (!this.b7 || (this.b7 && this.az.angle == 0))) {
            return this.ey();
        }
        if (this.b7) {
            return this.az.angle;
        }
        return 0;
    };
    Axis.prototype.ey = function () {
        return this.dh;
    };
    Object.defineProperty(Axis.prototype, "c4", {
        get: function () {
            return this.c(Axis.js);
        },
        set: function (a) {
            this.h(Axis.js, a);
        },
        enumerable: false,
        configurable: true
    });
    Axis.prototype.d7 = function () {
        return 0;
    };
    Axis.prototype.ju = function () {
        if (this.cp) {
            return 2;
        }
        return 0;
    };
    Axis.prototype.ko = function () {
        return 1;
    };
    Axis.prototype.jv = function () {
        return 1;
    };
    Axis.prototype.kp = function () {
        return 1;
    };
    Axis.prototype.d9 = function () {
        if (this.cp) {
            return DeviceUtils.g(5);
        }
        return 0;
    };
    Axis.prototype.eb = function () {
        if (!this.cp && !this.b9) {
            return DeviceUtils.g(5);
        }
        return 0;
    };
    Axis.prototype.ea = function () {
        if (this.cp) {
            return DeviceUtils.g(5);
        }
        return 0;
    };
    Axis.prototype.d8 = function () {
        if (!this.cp && !this.b9) {
            return DeviceUtils.g(5);
        }
        return 0;
    };
    Axis.prototype.ee = function () {
        return NaN;
    };
    Axis.prototype.eg = function () {
        return NaN;
    };
    Axis.prototype.ef = function () {
        return NaN;
    };
    Axis.prototype.ed = function () {
        return NaN;
    };
    Axis.prototype.a0 = function () {
        if (this.cp) {
            return 2;
        }
        if (this.cm) {
            return 5;
        }
        return 1;
    };
    Axis.prototype.a1 = function () {
        return 1;
    };
    Axis.prototype.h6 = function (a) {
        if (this.rangeChanged != null) {
            this.rangeChanged(this, a);
        }
    };
    Axis.prototype.ec = function () {
        if (this.cp) {
            return -90;
        }
        return 0;
    };
    Axis.prototype.d6 = function () {
        return NaN;
    };
    Object.defineProperty(Axis.prototype, "an", {
        get: function () {
            return this.al;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(Axis.prototype, "ao", {
        get: function () {
            return this.am;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(Axis.prototype, "kh", {
        get: function () {
            if (this.kg.isEmpty) {
                return this.j9;
            }
            return this.kg;
        },
        set: function (a) {
            this.j9 = a;
        },
        enumerable: false,
        configurable: true
    });
    Axis.prototype.ip = function () {
        var a = 0;
        var b = typeCast(XamDataChart.$, this.bi);
        if (b != null && b.xb == 0) {
            a = 1;
        }
        this.a5.a1(a);
    };
    Axis.prototype.c8 = function (a, b, c) {
        return this.bi != null;
    };
    Axis.prototype.co = function () {
        var a = Rect.empty;
        if (this.bi != null) {
            a = this.bi.w0;
        }
        return this.c8(this.kh, a, this.a5);
    };
    Axis.prototype.is = function (a, b) {
        this.cr = false;
        this.kh = b;
        this.cq = true;
        this.c1();
        this.ib(false);
        if (this.bi != null) {
            this.bi.ar.ae(1, this, this.a6, b);
        }
    };
    Object.defineProperty(Axis.prototype, "cq", {
        get: function () {
            return this.bx;
        },
        set: function (a) {
            this.bx = a;
        },
        enumerable: false,
        configurable: true
    });
    Axis.prototype.ke = function () {
        if (this.bi == null || this.bi.wl.isEmpty) {
            return Rect.empty;
        }
        var a = this.bi.wl;
        var b = this.kh;
        var c = (a.left - b.left) / b.width;
        var d = (a.top - b.top) / b.height;
        var e = (a.right - b.left) / b.width;
        var f = (a.bottom - b.top) / b.height;
        return new Rect(0, c, d, e - c, f - d);
    };
    Axis.prototype.it = function (a, b) {
        this.ka = b;
        this.cq = true;
        this.ib(true);
    };
    Axis.prototype.h7 = function () {
        this.ib(false);
    };
    Axis.prototype.hz = function (a, b, c, d) {
        var e_35, _a;
        switch (b) {
            case Axis.$$p[10]:
            case Axis.$$p[11]:
                if (this.gi != null) {
                    this.ai = new BindingFormatter();
                    this.ai.j = this.gi;
                    this.ai.d = this.ah;
                }
                else {
                    this.ai = null;
                }
                break;
            case "SeriesViewer":
                var e = typeCast(SeriesViewer.$, c);
                if (e != null) {
                    this.fn = null;
                    e.actualWindowRectChanged = delegateRemove(e.actualWindowRectChanged, this.bs);
                    e.ar.ad(1, this);
                    this.a5.af(e);
                }
                var f = typeCast(SeriesViewer.$, d);
                if (f != null) {
                    this.fn = f.c9.j.ae;
                    this.ka = f.wh;
                    f.actualWindowRectChanged = delegateCombine(f.actualWindowRectChanged, this.bs);
                    this.a6 = f.ar.k(1, this, runOn(this, this.hn));
                    if (this.az == null && this.fn != null) {
                        this.provideRenderer(this.fn);
                    }
                    this.a5.y(f);
                    if (this.cs && !this.a6.e) {
                        this.cs = false;
                        this.c1();
                    }
                    this.im();
                    this.io();
                }
                break;
            case Axis.$$p[8]:
                this.ib(false);
                break;
            case Axis.$$p[21]:
                this.cx = this.cw;
                this.ib(false);
                break;
            case Axis.$$p[20]:
                this.cv = this.cu;
                this.ib(false);
                break;
            case Axis.$$p[9]:
                this.ci = this.ch;
                var g = new AxisRangeChangedEventArgs(0, 0, 0, 1, 1);
                this.hm(g);
                try {
                    for (var _b = __values(fromEnum(this.df)), _c = _b.next(); !_c.done; _c = _b.next()) {
                        var h = _c.value;
                        h.qd();
                        if (h.dc != null) {
                            h.qn();
                        }
                    }
                }
                catch (e_35_1) {
                    e_35 = { error: e_35_1 };
                }
                finally {
                    try {
                        if (_c && !_c.done && (_a = _b.return))
                            _a.call(_b);
                    }
                    finally {
                        if (e_35)
                            throw e_35.error;
                    }
                }
                break;
            case Axis.$$p[12]:
                this.a5.am();
                if (typeCast(DataTemplate.$, d) !== null) {
                    this.c7 = true;
                }
                else {
                    this.c7 = false;
                }
                this.cq = true;
                this.ig();
                this.ib(false);
                break;
            case Axis.$$p[16]:
            case Axis.$$p[19]:
            case Axis.$$p[25]:
                this.ib(false);
                break;
            case Axis.$$p[13]:
                var i = typeCast(AxisLabelSettings.$, d);
                if (i != null) {
                    i.registerAxis(this);
                    this.ax = i;
                }
                else {
                    this.ax = new AxisLabelSettings();
                }
                if (this.aw != null) {
                    this.aw.ag = this.ax;
                }
                this.hx();
                this.cq = true;
                this.ib(false);
                break;
            case Axis.$$p[30]:
                this.a5.ap();
                break;
            case Axis.$$p[31]:
                var j = typeCast(TitleSettings.$, d);
                if (j != null) {
                    j.registerAxis(this);
                }
                else {
                    j = new TitleSettings();
                }
                if (this.iv != null) {
                    this.iv.dataContext = j;
                }
                this.hy();
                this.ib(false);
                break;
            case Axis.$$p[26]:
                this.cq = true;
                this.io();
                this.a5.ai();
                this.ib(false);
                break;
            case Axis.$$p[32]:
            case Axis.$$p[5]:
            case "UseEnhancedIntervalManagement":
            case Axis.$$p[6]:
                this.bz = this.c5;
                this.cq = true;
                this.ib(false);
                break;
            case Axis.$$p[3]:
                if (this.bi != null) {
                    this.bi.oc();
                }
                break;
            case Axis.$$p[18]:
                this.im();
                if (d != null) {
                    this.cy = true;
                    this.ib(false);
                }
                else {
                    this.cy = false;
                }
                break;
            case Axis.$$p[4]:
                if (this.aj != null) {
                    this.aj.ia();
                }
                break;
            case Axis.$$p[24]:
            case Axis.$$p[15]:
                this.im();
                this.ib(false);
                break;
            case Axis.$$p[23]:
            case Axis.$$p[14]:
            case Axis.$$p[17]:
            case Axis.$$p[7]:
            case Axis.$$p[28]:
            case Axis.$$p[29]:
            case Axis.$$p[27]:
            case Axis.$$p[2]:
            case Axis.$$p[0]:
            case Axis.$$p[1]:
            case Axis.$$p[22]:
                this.ib(false);
                break;
            case "MinExtent":
                this.a5.ai();
                break;
        }
    };
    Axis.prototype.hx = function () {
        if (this.a5.p()) {
            this.a5.ab(this.ax);
        }
    };
    Axis.prototype.hy = function () {
        this.a5.ap();
    };
    Object.defineProperty(Axis.prototype, "coercionMethods", {
        get: function () {
            return this._coercionMethods;
        },
        set: function (a) {
            this._coercionMethods = a;
        },
        enumerable: false,
        configurable: true
    });
    Axis.prototype.get_expectFunctions = function () {
        return this.bv;
    };
    Axis.prototype.set_expectFunctions = function (a) {
        this.bv = a;
    };
    Object.defineProperty(Axis.prototype, "expectFunctions", {
        get: function () {
            return this.get_expectFunctions();
        },
        set: function (a) {
            this.set_expectFunctions(a);
        },
        enumerable: false,
        configurable: true
    });
    Axis.prototype.ig = function () {
        this.br.count = 0;
        this.bq.count = 0;
        this.bp.count = 0;
        if (this.a5.p()) {
            this.a5.at();
        }
    };
    Axis.prototype.hu = function (a, b, c, d) {
        var e = Math.min(b, c);
        var f = Math.max(b, c);
        if (e < d.bottom && f > d.top) {
            var g = new RectangleGeometry();
            g.e = new Rect(0, d.left, e, d.width, f - e);
            a.add(g);
        }
    };
    Axis.prototype.ht = function (a, b, c, d, e) {
        var f = b <= c.bottom && b >= c.top;
        if (!e && f) {
            f = !this.cg(b, d.c, c, false);
        }
        if (f) {
            if (d.a) {
                b = this.d1(b, c.top, c.bottom, d);
            }
            var g = new LineGeometry();
            g.d = { $type: Point_$type, x: c.left, y: b };
            g.c = { $type: Point_$type, x: c.right, y: b };
            a.add(g);
        }
    };
    Axis.prototype.ir = function (a, b, c, d) {
        var e = Math.min(b, c);
        var f = Math.max(b, c);
        if (f > d.left && e < d.right) {
            var g = new RectangleGeometry();
            g.e = new Rect(0, e, d.top, f - e, d.height);
            a.add(g);
        }
    };
    Axis.prototype.iq = function (a, b, c, d, e) {
        var f = b >= c.left && b <= c.right;
        if (!f) {
            var g = truncate(Math.round(b));
            var h = truncate(Math.round(c.left));
            var i = truncate(Math.round(c.right));
            if (g >= h && g <= i) {
                f = true;
            }
        }
        if (!e && f) {
            f = !this.cg(b, d.c, c, true);
        }
        if (f) {
            if (d.a) {
                b = this.d1(b, c.left, c.right, d);
            }
            var j = new LineGeometry();
            j.d = { $type: Point_$type, x: b, y: c.top };
            j.c = { $type: Point_$type, x: b, y: c.bottom };
            a.add(j);
        }
    };
    Axis.prototype.cg = function (a, b, c, d) {
        var e_36, _a;
        var e = false;
        var f = typeCast(XamDataChart.$, this.bi);
        if (f != null && (f.x2 || f.x3) && !c.isEmpty) {
            var g = this.bi.wh.width == 1 && this.bi.wh.height == 1;
            try {
                for (var _b = __values(fromEnum(f.axes)), _c = _b.next(); !_c.done; _c = _b.next()) {
                    var h = _c.value;
                    if (h._visibility != 0 || h.fi < 1 || h.jy == null || BrushUtilCore.a(h.jy) || h.kh.isEmpty) {
                        continue;
                    }
                    if (h.aj != null && h.b5()) {
                        if (f.x2) {
                            var i = this.cp ? c.left : c.top;
                            var j = 0;
                            var k = h.ii(i, j, h.bi.w0, c, h.kc(), d ? c.left : c.top, d ? c.right : c.bottom);
                            i = k.p0;
                            j = k.p1;
                            var l = Rect.empty;
                            var m = Rect.empty;
                            if (d && h.cp) {
                                l = new Rect(0, i - (h.fi / 2), h.kh.top, h.fi, h.kh.height);
                                m = new Rect(0, a - (b / 2), c.top, b, c.height);
                            }
                            else if (!d && !h.cp) {
                                l = new Rect(0, h.kh.left, i - (h.fi / 2), h.kh.width, h.fi);
                                m = new Rect(0, c.left, a - (b / 2), c.width, b);
                            }
                            if (l.left <= m.right && m.left <= l.right && l.top <= m.bottom && m.top <= l.bottom) {
                                e = true;
                                break;
                            }
                        }
                    }
                    else {
                        var n = Rect.empty;
                        var o = Rect.empty;
                        if (d && h.cp) {
                            n = new Rect(0, h.kh.left, h.kh.top, h.fi, h.kh.height);
                            o = new Rect(0, a - (b / 2), c.top, b, c.height);
                        }
                        else if (!d && !h.cp) {
                            n = new Rect(0, h.kh.left, h.kh.bottom - (h.fi / 2), h.kh.width, h.fi);
                            o = new Rect(0, c.left, a - (b / 2), c.width, b);
                        }
                        if (n.left <= o.right && o.left <= n.right && n.top <= o.bottom && o.top <= n.bottom) {
                            e = true;
                            break;
                        }
                        if (g && f.x3) {
                            var p = f.yw;
                            if (isNaN_(p)) {
                                if (d && h.cp) {
                                    p = 0;
                                    p = Math.max(p, f.yo);
                                    p = Math.max(p, f.yl);
                                }
                                else if (!d && !h.cp) {
                                    p = 0;
                                    p = Math.max(p, f.ym);
                                    p = Math.max(p, f.yn);
                                }
                                p += 1;
                            }
                            p *= 2;
                            if (d && h.cp) {
                                n = new Rect(0, h.kh.left, h.kh.top, h.fi, h.kh.height);
                                o = new Rect(0, a - (p / 2), c.top, p, c.height);
                            }
                            else if (!d && !h.cp) {
                                n = new Rect(0, h.kh.left, h.kh.bottom - (h.fi / 2), h.kh.width, h.fi);
                                o = new Rect(0, c.left, a - (p / 2), c.width, p);
                            }
                            if (n.left <= o.right && o.left <= n.right && n.top <= o.bottom && o.top <= n.bottom) {
                                e = true;
                                break;
                            }
                        }
                    }
                }
            }
            catch (e_36_1) {
                e_36 = { error: e_36_1 };
            }
            finally {
                try {
                    if (_c && !_c.done && (_a = _b.return))
                        _a.call(_b);
                }
                finally {
                    if (e_36)
                        throw e_36.error;
                }
            }
        }
        return e;
    };
    Axis.prototype.ii = function (a, b, c, d, e, f, g) {
        var h = Math.abs(f - g);
        a = this.fx;
        a = this.aj.e6(a);
        var i = typeCast(CategoryAxisBase.$, this.aj);
        if (i != null && i.categoryMode == 2) {
            var j = 0.5 * i.getCategorySize(c, d, e);
            var k = i.a2 == 0;
            if (i.ch == k) {
                j = -j;
            }
            a = a + j;
        }
        b = a - f;
        if (a < f) {
            a = f;
        }
        else if (a > g) {
            a = g;
        }
        if (b < 0) {
            b = 0;
        }
        else if (b > h) {
            b = h;
        }
        return {
            p0: a,
            p1: b
        };
    };
    Axis.prototype.d1 = function (a, b, c, d) {
        var e = a;
        if (d != null && d.c > 0) {
            var f = d.c % 2;
            if (f == 0 || f == 1) {
                var g = 1;
                e = Math.floor(a);
                if (e + 0.5 < a) {
                    g = -1;
                    e = Math.ceil(a);
                }
                if (f == 1) {
                    e += 0.5 * g;
                }
                if (e >= c) {
                    e -= 1;
                }
                else if (e <= b) {
                    e += 1;
                }
            }
        }
        return e;
    };
    Axis.prototype.hk = function (a) {
        this.a5.ae(a);
    };
    Axis.prototype.hj = function () {
        this.br.count = 0;
        this.bq.count = 0;
        this.bp.count = 0;
        this.a5.ac();
        this.dd.clear();
        this.de.clear();
    };
    Axis.prototype.ia = function () {
        this.ib(false);
    };
    Axis.prototype.ib = function (a) {
        if (this.bi != null) {
            this.bi.ar.ac(1, this, this.a6, a);
            if (this.renderRequested != null) {
                var b = new RenderRequestedEventArgs();
                b.animate = a;
                this.renderRequested(this, b);
                a = b.animate;
            }
        }
    };
    Axis.prototype.e1 = function () {
        if (this.bc == null) {
            return -1;
        }
        if (isNaN_(this.bc.b)) {
            return -1;
        }
        if (this.eh() != 0) {
            return -1;
        }
        var a = this.bc.b;
        var b = this.e5();
        var c = this.e2();
        a = a + b + c;
        return Math.max(Axis.ev, a);
    };
    Axis.prototype.e5 = function () {
        if (this.az == null) {
            return 0;
        }
        else {
            return this.az.topMargin;
        }
    };
    Axis.prototype.e3 = function () {
        if (this.az == null) {
            return 0;
        }
        else {
            return this.az.leftMargin;
        }
    };
    Axis.prototype.e4 = function () {
        if (this.az == null) {
            return 0;
        }
        else {
            return this.az.rightMargin;
        }
    };
    Axis.prototype.e2 = function () {
        if (this.az == null) {
            return 0;
        }
        else {
            return this.az.bottomMargin;
        }
    };
    Axis.prototype.ez = function () {
        if (this.bc == null) {
            return -1;
        }
        if (isNaN_(this.bc.d) && isNaN_(this.dj)) {
            return -1;
        }
        if (this.az != null && (this.az.angle != 0)) {
            return -1;
        }
        var a = this.bc.d;
        if (!isNaN_(this.dj) && this.fs == -1) {
            return this.dj;
        }
        return Math.max(Axis.ev, this.bc.d);
    };
    Axis.prototype.d3 = function (a, b, c, d, e) {
        if (a == 1) {
            return 1;
        }
        if (b) {
            return a;
        }
        var f = 0;
        var g = this.es(a, b, c, d, e);
        if (!b && f < 10 && this.cz(g, a, c, d, e)) {
            a = g;
            g = a - 1;
            f += 1;
            while (!b && f < 10 && this.cz(g, a, c, d, e)) {
                a = g;
                g = a - 1;
                f += 1;
            }
        }
        return a;
    };
    Axis.prototype.es = function (a, b, c, d, e) {
        var f = false;
        if (this.cp) {
            f = this.cb && this.b1 && this.bc != null;
        }
        else {
            f = this.cb && this.b1 && this.b6();
        }
        if (f) {
            var g = this.ei(a, c, d, e);
            if (isNaN_(g)) {
                return a;
            }
            var h = this.ej(a, c, d, e);
            if (g <= h) {
                return a;
            }
            var i = Math.ceil((h / g) * a) + 1;
            if (f && i == a) {
                i--;
            }
            return i;
        }
        return a;
    };
    Axis.prototype.ej = function (a, b, c, d) {
        if (this.cp) {
            var e = this.bc.b;
            return e;
        }
        else {
            var f = this.dj;
            if (this.bi != null && this.bi.ft) {
                f = this.bc.b;
            }
            return f;
        }
    };
    Axis.prototype.cz = function (a, b, c, d, e) {
        if (this.cp) {
            if (this.cb && this.b1 && this.bc != null) {
                var f = this.bc.b;
                if (a >= 1) {
                    var g = a;
                    if (g < 1) {
                        return false;
                    }
                    var h = this.ei(g, c, d, e);
                    if (isNaN_(h)) {
                        return false;
                    }
                    if (h > f) {
                        return true;
                    }
                }
            }
        }
        else {
            if (this.cb && this.b1 && this.b6()) {
                if (a >= 1) {
                    var i = a;
                    if (i < 1) {
                        return false;
                    }
                    var j = this.ei(i, c, d, e);
                    if (isNaN_(j)) {
                        return false;
                    }
                    var k = this.dj;
                    if (this.bi != null && this.bi.ft) {
                        k = this.bc.b;
                    }
                    if (j > k) {
                        return true;
                    }
                }
            }
        }
        return false;
    };
    Axis.prototype.ei = function (a, b, c, d) {
        return NaN;
    };
    Axis.prototype.e0 = function () {
        if (this.cp) {
            return this.e1();
        }
        else {
            return this.ez();
        }
    };
    Object.defineProperty(Axis.prototype, "c0", {
        get: function () {
            return this.fs == -1;
        },
        enumerable: false,
        configurable: true
    });
    Axis.prototype.hn = function (a) {
        if (this.a5.n()) {
            return;
        }
        var b = 0;
        var c = 0;
        if (this.de != null && this.de.count > 0) {
            b = this.de._inner[this.de.count - 1].c;
            c = this.de.count;
        }
        if (this.cq && this.c4) {
            this.bc = this.bb();
        }
        this.a5.z();
        this.ic(a);
        this.a5.aq();
        if (!this.cp && this.cq && this.c4 && this.c0) {
            if (this.b2()) {
                this.a5.z();
                this.ic(a);
                this.a5.aq();
            }
        }
        var d = 1;
        var e = 0;
        if (this.de != null && this.de.count > 0) {
            d = this.de._inner[this.de.count - 1].c;
            e = this.de.count;
        }
        if (this.c6) {
            this.cq = true;
        }
        var f = false;
        if (d != b || e != c || this.cq) {
            this.cq = false;
            if (this.a5.p()) {
                this.a5.ai();
                f = true;
            }
        }
        this.a5.ah();
        if (!f) {
            this.ho();
        }
    };
    Axis.prototype.b2 = function () {
        if (!isNaN_(this.dj) || this.dd == null || this.dd.count == 0) {
            return false;
        }
        var a = this.bl();
        if (a == null) {
            return false;
        }
        var b = -1.7976931348623157E+308;
        for (var c = 0; c < this.dd.count; c++) {
            var d = this.dd._inner[c];
            if (typeof d === 'string') {
                var e = FontUtil.measureStringWidth(d, a, this.a5.j);
                b = Math.max(e, b);
            }
        }
        b += 5;
        if (this.az != null) {
            b += this.az.leftMargin + this.az.rightMargin;
        }
        this.dj = b;
        return true;
    };
    Axis.prototype.ie = function () {
        this.dj = NaN;
        this.ib(false);
    };
    Axis.prototype.b6 = function () {
        return !isNaN_(this.dj) && this.fs == -1;
    };
    Axis.prototype.d2 = function (a, b) {
        return a;
    };
    Axis.prototype.ih = function () {
        this.dj = NaN;
    };
    Axis.prototype.bb = function () {
        var a = this.bl();
        if (a == null) {
            return null;
        }
        if (a.f == 0) {
            return null;
        }
        var b = "W";
        if (this.a5.j == null) {
            return null;
        }
        var c = FontUtil.measureStringWidth(b, a, this.a5.j);
        if (this.dk != c || this.bc == null) {
            this.dk = c;
            var d = FontUtil.getCurrentFontHeight(this.bi.c9.j.ae, a);
            if (this.bc == null) {
                this.bc = new LabelFontHeuristics();
            }
            this.bc.b = d;
            this.bc.c = this.fs;
            this.bc.a = this.b1;
            this.bc.e = c;
            this.bc.d = this.bc.e * this.bc.c;
        }
        return this.bc;
    };
    Axis.prototype.bl = function () {
        var a = null;
        if (this.bi != null) {
            a = this.bi.getFontInfo();
        }
        if (this.az != null && this.az.j) {
            if (this.bi != null) {
                a = this.az.h(this.bi.c9.j.ae);
            }
        }
        return a;
    };
    Axis.prototype.ho = function () {
        if (!this.a5.p()) {
            return;
        }
        if (!this.b8()) {
            this.a5.ag();
        }
    };
    Axis.prototype.c1 = function () {
        return this.c2(false);
    };
    Axis.prototype.c2 = function (a) {
        if (a || this.bi == null) {
            var b = this.c3();
            if (b) {
                this.cq = true;
            }
            this.cs = false;
            return b;
        }
        if (!this.cs) {
            this.cs = true;
            this.bi.ar.ab(this, this.a6);
        }
        return false;
    };
    Axis.prototype.c3 = function () {
        return false;
    };
    Axis.prototype.hl = function () {
    };
    Axis.prototype.ic = function (a) {
        if (this.iv != null) {
            if ((this.bf == null || this.bf.visibility == 0) && (this.az == null || this.az.visibility == 0) && this.g8 != null) {
                this.iv._visibility = 0;
            }
            else {
                this.iv._visibility = 1;
            }
        }
    };
    Axis.prototype.im = function () {
        var e_37, _a, e_38, _b;
        var a = typeCast(XamDataChart.$, this.bi);
        if (a == null) {
            return;
        }
        var b = null, c = null, d = null;
        if (this.cb && !this.b9) {
            b = a.aa7;
            try {
                for (var _c = __values(fromEnum(this.df)), _d = _c.next(); !_d.done; _d = _c.next()) {
                    var e = _d.value;
                    if (e.fx || e.fu || e.fq || e.fu) {
                        c = a.aa5;
                        d = a.aa6;
                        break;
                    }
                }
            }
            catch (e_37_1) {
                e_37 = { error: e_37_1 };
            }
            finally {
                try {
                    if (_d && !_d.done && (_a = _c.return))
                        _a.call(_c);
                }
                finally {
                    if (e_37)
                        throw e_37.error;
                }
            }
        }
        else if (this.cj && !this.b9) {
            c = a.aa5;
            d = a.aa6;
            b = this.aj != null ? a.aa7 : null;
            try {
                for (var _e = __values(fromEnum(this.df)), _f = _e.next(); !_f.done; _f = _e.next()) {
                    var f = _f.value;
                    if (f.fx || f.fu || f.fq || f.fu) {
                        b = a.aa7;
                        break;
                    }
                }
            }
            catch (e_38_1) {
                e_38 = { error: e_38_1 };
            }
            finally {
                try {
                    if (_f && !_f.done && (_b = _e.return))
                        _b.call(_e);
                }
                finally {
                    if (e_38)
                        throw e_38.error;
                }
            }
        }
        else if (this.b9 || this.a2 == 3) {
            b = a.aa7;
            c = a.aa5;
            d = a.aa6;
        }
        this.jy = this.j2 != null ? this.j2 : b;
        this.jw = this.jz != null ? this.jz : c;
        this.jx = this.j0 != null ? this.j0 : d;
    };
    Axis.prototype.h5 = function (a, b, c) {
        if (this.propertyChanged != null) {
            this.propertyChanged(this, new PropertyChangedEventArgs(a));
        }
        if (this.propertyUpdated != null) {
            this.propertyUpdated(this, new PropertyUpdatedEventArgs(a, b, c));
        }
    };
    Axis.prototype.ct = function (a) {
        var b = this.df.contains(a);
        if (!b) {
            this.df.add(a);
        }
        this.im();
        return !b;
    };
    Axis.prototype.b0 = function (a) {
        var b = this.df.contains(a);
        if (b) {
            this.df.remove(a);
        }
        this.im();
        return b;
    };
    Axis.prototype.fz = function (a, b) {
        var c = this.gu(b);
        if (c == Axis.$$p[12]) {
            return this.f0(a, b, this.f2);
        }
        return null;
    };
    Axis.prototype.gu = function (a) {
        if (!this.da.containsKey(a)) {
            var b = a.charAt(0).toUpperCase() + a.substr(1);
            this.da.addItem(a, b);
        }
        return this.da.item(a);
    };
    Axis.prototype.f0 = function (a, b, c) {
        var d = null;
        if (!this.c9.containsKey(b)) {
            d = new FastReflectionHelper(false, c);
            this.c9.addItem(b, d);
        }
        else {
            d = this.c9.item(b);
        }
        d.propertyName = c;
        return d.getPropertyValue(a);
    };
    Axis.prototype.f1 = function (a) {
        return this.a5.q(a);
    };
    Axis.prototype.gf = function (a) {
        return this.a5.s(a);
    };
    Axis.prototype.ex = function () {
        return NaN;
    };
    Axis.prototype.el = function (a, b) {
        return 0;
    };
    Axis.prototype.em = function (a, b, c) {
        return 0;
    };
    Axis.prototype.kd = function (a) {
        if (this.bi == null) {
            return Rect.empty;
        }
        if (!a.equals1(this.kh)) {
            return Rect.empty;
        }
        return this.bi.wl;
    };
    Axis.prototype.kc = function () {
        if (this.bi == null) {
            return Rect.empty;
        }
        return this.bi.wl;
    };
    Axis.prototype.kb = function () {
        if (this.bi == null || this.bi.wk.isEmpty) {
            return this.kh;
        }
        return this.bi.wk;
    };
    Axis.prototype.kf = function (a, b) {
        if (b.isEmpty) {
            return a;
        }
        return b;
    };
    Axis.prototype.en = function (a, b, c) {
        var d = this.kd(c);
        var e = new ScalerParams(0, b, c, this.ch, d);
        return this.el(a, e);
    };
    Axis.prototype.hq = function (a, b, c, d) {
    };
    Axis.prototype.hp = function (a, b, c, d, e) {
    };
    Axis.prototype.eo = function (a, b) {
        return 0;
    };
    Axis.prototype.ep = function (a, b, c) {
        return 0;
    };
    Axis.prototype.eq = function (a, b, c) {
        var d = this.kd(c);
        var e = new ScalerParams(0, b, c, this.ch, d);
        return this.eo(a, e);
    };
    Axis.prototype.hr = function (a, b, c, d) {
    };
    Axis.prototype.e6 = function (a) {
        var b = this.kc();
        var c = new ScalerParams(0, this.bi.wh, this.kh, this.ch, b);
        return this.el(a, c);
    };
    Axis.prototype.hw = function (a) {
        var b = false;
        if (this.km.width == 0 || this.km.height == 0) {
            this.kg = new Rect(0, 0, 0, a.width, a.height);
        }
        else {
            b = true;
            this.kg = new Rect(0, 0, 0, this.km.width, this.km.height);
        }
        if (b) {
            this.a6.c = true;
            this.cq = true;
            this.aw.ci();
            this.c2(true);
        }
    };
    Axis.prototype.il = function () {
        this.kg = Rect.empty;
        this.aw.cq();
    };
    Axis.prototype.aq = function () {
        this.ap.a = this.aw;
        return this.ap;
    };
    Object.defineProperty(Axis.prototype, "eu", {
        get: function () {
            return this.di;
        },
        set: function (a) {
            var b = this.eu;
            if (a != b) {
                this.di = a;
                this.h5("MinExtent", b, this.eu);
            }
        },
        enumerable: false,
        configurable: true
    });
    Axis.prototype.b8 = function () {
        if (!isNaN_(this.d4)) {
            return true;
        }
        if (this.az == null) {
            return false;
        }
        else {
            return this.az.l();
        }
    };
    Axis.prototype.er = function () {
        if (!isNaN_(this.d4)) {
            return this.d4;
        }
        if (this.az == null) {
            return 50;
        }
        return this.az.extent;
    };
    Axis.prototype.hi = function () {
        this.a5.x();
    };
    Axis.prototype.hm = function (a) {
        this.h6(a);
    };
    Object.defineProperty(Axis.prototype, "ki", {
        get: function () {
            return this.ar().a;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(Axis.prototype, "kj", {
        get: function () {
            return this.ar().b;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(Axis.prototype, "kl", {
        get: function () {
            return this.a5.c().d;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(Axis.prototype, "kk", {
        get: function () {
            return this.ar().c;
        },
        enumerable: false,
        configurable: true
    });
    Axis.prototype.be = function () {
        return SyncManager.a(this.bh);
    };
    Axis.prototype.ar = function () {
        return this.a5.c();
    };
    Object.defineProperty(Axis.prototype, "ay", {
        get: function () {
            return this.ax;
        },
        enumerable: false,
        configurable: true
    });
    Axis.prototype.h0 = function (a, b) {
        if (this.aw != null) {
            this.aw.cj(a);
        }
        this.a5.ak(a, b);
    };
    Axis.prototype.b5 = function () {
        return this.fx != null;
    };
    Axis.prototype.fy = function () {
        return this.ba.exportVisualData(this);
    };
    Axis.prototype._db = function () {
        var a, b;
        return __generator(this, function (_a) {
            switch (_a.label) {
                case 0:
                    a = 0;
                    _a.label = 1;
                case 1:
                    if (!(a < this.df.count))
                        return [3 /*break*/, 4];
                    b = this.df._inner[a];
                    return [4 /*yield*/, b];
                case 2:
                    _a.sent();
                    _a.label = 3;
                case 3:
                    a++;
                    return [3 /*break*/, 1];
                case 4: return [2 /*return*/];
            }
        });
    };
    Axis.prototype.db = function () {
        var _this = this;
        return toEnum(function () { return _this._db(); });
    };
    Axis.prototype.dc = function () {
        var e_39, _a;
        var a = new List$1(Series.$, 0);
        for (var b = 0; b < this.df.count; b++) {
            var c = this.df._inner[b];
            a.add(c);
        }
        if (this.bi != null && this.bi.series != null) {
            try {
                for (var _b = __values(fromEnum(this.bi.series)), _c = _b.next(); !_c.done; _c = _b.next()) {
                    var d = _c.value;
                    if (d.eq) {
                        a.add(d);
                    }
                }
            }
            catch (e_39_1) {
                e_39 = { error: e_39_1 };
            }
            finally {
                try {
                    if (_c && !_c.done && (_a = _b.return))
                        _a.call(_b);
                }
                finally {
                    if (e_39)
                        throw e_39.error;
                }
            }
        }
        return a;
    };
    Axis.prototype.h1 = function (a) {
    };
    Axis.prototype.h4 = function (a) {
    };
    Axis.prototype.h3 = function (a) {
    };
    Axis.prototype.j8 = function (a, b, c, d, e) {
        if (this.cp) {
            var f = new LineGeometry();
            f.d = { $type: Point_$type, x: c.left, y: a };
            f.c = { $type: Point_$type, x: c.right, y: a };
            return f;
        }
        else {
            var g = new LineGeometry();
            g.d = { $type: Point_$type, x: a, y: c.bottom };
            g.c = { $type: Point_$type, x: a, y: c.top };
            return g;
        }
    };
    Axis.$t = markType(Axis, 'Axis', Control.$, [INotifyPropertyChanged_$type]);
    Axis.js = DependencyProperty.i("UseEnhancedIntervalManagement", Boolean_$type, Axis.$, new PropertyMetadata(2, false, function (a, b) { return a.h5("UseEnhancedIntervalManagement", b.oldValue, b.newValue); }));
    Axis.ev = 7;
    Axis.$$p = markDep(DependencyProperty, PropertyMetadata, Axis, 'h5', ['ActualMajorStroke:jw:iw', [Brush.$], 'ActualMinorStroke:jx:ix', [Brush.$], 'ActualStroke:jy:iy', [Brush.$], 'CrossingAxis:aj:iz', [Axis.$], 'CrossingValue:fx:i0', [4, null], 'EnhancedIntervalMinimumCharacters:fs:i1', [1, -1], 'EnhancedIntervalPreferMoreCategoryLabels:b1:i2', [0, false], 'FormatLabel:au:i3', [Delegate_$type], 'IsDisabled:cf:i4', [0, false], 'IsInverted:ch:i5', [0, false], 'LabelFormat:gi:i6', [2, null], 'LabelFormatSpecifiers:ah:i7', [Array_$type, null], 'Label:f2:i8', [4, null], 'LabelSettings:az:i9', [AxisLabelSettings.$, null], 'MajorStrokeDashArray:j4:ja', [DoubleCollection.$], 'MajorStroke:jz:jb', [Brush.$], 'MajorStrokeThickness:et:jc', [1, 1], 'MinorStrokeDashArray:j5:jd', [DoubleCollection.$], 'MinorStroke:j0:je', [Brush.$], 'MinorStrokeThickness:ew:jf', [1, 1], 'ShouldAvoidAnnotationCollisions:cu:jg', [0, false], 'ShouldKeepAnnotationsInView:cw:jh', [0, false], 'Strip:j1:ji', [Brush.$], 'StrokeDashArray:j6:jj', [DoubleCollection.$], 'Stroke:j2:jk', [Brush.$], 'StrokeThickness:fi:jl', [1, DeviceUtils.g(2)], 'TickLength:fj:jm', [1, NaN], 'TickStrokeDashArray:j7:jn', [DoubleCollection.$], 'TickStroke:j3:jo', [Brush.$], 'TickStrokeThickness:fk:jp', [1, DeviceUtils.g(2)], 'Title:g8:jq', [2], 'TitleSettings:bf:jr', [TitleSettings.$, null], 'UsePerLabelHeightMeasurement:c5:jt', [0, true]]);
    return Axis;
}(Control));
export { Axis };
/**
 * @hidden
 */
var AxisCollection = /** @class */ /*@__PURE__*/ (function (_super) {
    __extends(AxisCollection, _super);
    function AxisCollection() {
        var _this = _super.call(this, Axis.$, 0) || this;
        _this.collectionResetting = null;
        _this.propertyChanged = delegateCombine(_this.propertyChanged, function (a, b) {
            if (b.propertyName == "Name") {
                for (var c = 0; c < _this.count; ++c) {
                    if (_this._inner[c].name == b.propertyName) {
                        _this.ac(new NotifyCollectionChangedEventArgs(2, 2, _this._inner[c], _this._inner[c], c));
                    }
                }
            }
        });
        return _this;
    }
    AxisCollection.prototype.p = function () {
        if (this.collectionResetting != null) {
            this.collectionResetting(this, null);
        }
        _super.prototype.p.call(this);
    };
    AxisCollection.$t = markType(AxisCollection, 'AxisCollection', ObservableCollection$1.$.specialize(Axis.$));
    return AxisCollection;
}(ObservableCollection$1));
export { AxisCollection };
/**
 * @hidden
 */
var AxisLabelManager = /** @class */ /*@__PURE__*/ (function (_super) {
    __extends(AxisLabelManager, _super);
    function AxisLabelManager() {
        var _this = _super.call(this) || this;
        _this.e = null;
        _this.f = null;
        _this.b = null;
        _this.a = null;
        _this.c = null;
        _this.c = function (a) {
        };
        return _this;
    }
    AxisLabelManager.prototype.n = function (a, b) {
        this.e.clear();
        this.f.clear();
        this.b.ad = this.a;
        this.b.c5 = a;
        this.b.c4 = b;
        if (b.isEmpty || a.isEmpty) {
            this.s(0);
            this.a.bq.count = 0;
            this.a.bp.count = 0;
        }
        if (this.a.br.count == 0 && this.a.bq.count == 0 && this.a.a5.l()) {
            this.b.ab.clear();
        }
    };
    AxisLabelManager.prototype.i = function (a, b) {
        this.e.add1(a);
        this.f.add(b);
    };
    AxisLabelManager.prototype.t = function () {
        this.b.a9 = this.e;
        this.b.ba = this.f;
        this.b.cl();
    };
    AxisLabelManager.j = function (a, b) {
        AxisLabelManager.k(a, false, b);
    };
    AxisLabelManager.k = function (a, b, c) {
    };
    AxisLabelManager.l = function (a, b, c) {
    };
    AxisLabelManager.m = function (a, b) {
        AxisLabelManager.l(a, true, b);
    };
    AxisLabelManager.prototype.h = function (a) {
        this.b.ab.add(a);
    };
    AxisLabelManager.prototype.r = function (a) {
        this.b.bw = a;
    };
    AxisLabelManager.prototype.o = function (a) {
        this.c(a);
    };
    AxisLabelManager.prototype.u = function (a) {
        var b = this.a.br.item(a);
        return b;
    };
    AxisLabelManager.prototype.s = function (a) {
        if (this.a == null) {
            return;
        }
        this.a.br.count = a;
    };
    Object.defineProperty(AxisLabelManager.prototype, "d", {
        get: function () {
            if (this.a == null || this.a.az == null) {
                return false;
            }
            return this.a.az.visibility != 0;
        },
        enumerable: false,
        configurable: true
    });
    AxisLabelManager.prototype.q = function () {
        this.a.br.count = 0;
        this.a.bq.count = 0;
        this.a.bp.count = 0;
        this.a.aw.bb.clear();
    };
    AxisLabelManager.prototype.p = function () {
        this.a.cq = true;
    };
    AxisLabelManager.prototype.g = function () {
        this.a.hh();
    };
    AxisLabelManager.$t = markType(AxisLabelManager, 'AxisLabelManager');
    return AxisLabelManager;
}(Base));
export { AxisLabelManager };
/**
 * @hidden
 */
var AxisLabelPanelBase = /** @class */ /*@__PURE__*/ (function (_super) {
    __extends(AxisLabelPanelBase, _super);
    function AxisLabelPanelBase() {
        var _this = _super.call(this) || this;
        _this.cx = null;
        _this.bw = 0;
        _this.ad = null;
        _this.ak = false;
        _this.a3 = null;
        _this.ba = null;
        _this.c4 = null;
        _this.cw = Rect.empty;
        _this.cv = null;
        _this.c2 = null;
        _this.bc = 0;
        _this.bx = null;
        _this.bb = null;
        _this.a8 = null;
        _this.ag = null;
        _this.ao = false;
        _this.c3 = null;
        _this.ar = false;
        _this.av = false;
        _this.aw = false;
        _this.ax = false;
        _this.bz = null;
        _this.al = false;
        _this.bd = 50;
        _this.be = 0;
        _this.bf = 0;
        _this.c7 = new Size();
        _this.be = NaN;
        _this.c4 = Rect.empty;
        _this.c2 = Rect.empty;
        _this.c1 = Rect.empty;
        _this.af = _this.ae();
        _this.ch(_this.af);
        _this.af.an();
        _this.bb = new List$1(FrameworkElement.$, 0);
        _this.ba = new List$1(LabelPosition.$, 0);
        _this.a8 = new List$1(Rect.$, 0);
        _this.aw = false;
        _this.av = false;
        _this.ax = false;
        _this.ao = false;
        _this.ar = false;
        _this.c3 = Rect.empty;
        _this.ak = false;
        return _this;
    }
    AxisLabelPanelBase.prototype.ae = function () {
        return new AxisLabelPanelBaseView(this);
    };
    AxisLabelPanelBase.prototype.ch = function (a) {
    };
    AxisLabelPanelBase.prototype.b8 = function () {
    };
    AxisLabelPanelBase.prototype.cp = function () {
    };
    AxisLabelPanelBase.prototype.co = function () {
    };
    Object.defineProperty(AxisLabelPanelBase.prototype, "az", {
        get: function () {
            return this.ak;
        },
        set: function (a) {
            this.ak = a;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(AxisLabelPanelBase.prototype, "a9", {
        get: function () {
            return this.a3;
        },
        set: function (a) {
            var b = this.a3;
            this.a3 = a;
            if (b == null && b != a) {
                this.ce();
            }
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(AxisLabelPanelBase.prototype, "c5", {
        get: function () {
            return this.cw;
        },
        set: function (a) {
            var b = this.cw;
            this.cw = a;
            this.ct(b, this.cw);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(AxisLabelPanelBase.prototype, "c1", {
        get: function () {
            if (!this.c2.isEmpty) {
                return this.c2;
            }
            return this.cv;
        },
        set: function (a) {
            var b = this.cv;
            this.cv = a;
            this.cd(b, this.cv);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(AxisLabelPanelBase.prototype, "bg", {
        get: function () {
            return this.bc;
        },
        set: function (a) {
            this.bc = a;
        },
        enumerable: false,
        configurable: true
    });
    AxisLabelPanelBase.prototype.bn = function () {
        var a = 1.7976931348623157E+308;
        if (this.ba != null && this.ba.count > 1) {
            for (var b = 1; b < this.ba.count; b++) {
                var c = this.ba._inner[b];
                var d = this.ba._inner[b - 1];
                if (c.a || d.a) {
                    continue;
                }
                var e = Math.abs(c.c - d.c);
                if (e < a) {
                    a = e;
                }
            }
        }
        return a;
    };
    AxisLabelPanelBase.prototype.cl = function () {
        this.ar = false;
        this.c3 = Rect.empty;
    };
    AxisLabelPanelBase.prototype.an = function (a, b) {
        for (var c = 0; c < a.count - 1; c++) {
            if (b._inner[c]) {
                continue;
            }
            for (var d = c; d < a.count - 1; d++) {
                if (b._inner[d + 1]) {
                    continue;
                }
                if (a._inner[c].intersectsWith(a._inner[d + 1])) {
                    return true;
                }
            }
        }
        return false;
    };
    AxisLabelPanelBase.prototype.by = function (a, b, c) {
        return {
            ret: 0,
            p1: b
        };
    };
    AxisLabelPanelBase.prototype.a5 = function () {
        return null;
    };
    AxisLabelPanelBase.prototype.b6 = function () {
    };
    AxisLabelPanelBase.prototype.b2 = function (a) {
    };
    Object.defineProperty(AxisLabelPanelBase.prototype, "ap", {
        get: function () {
            return this.ag != null && this.ag.k();
        },
        enumerable: false,
        configurable: true
    });
    AxisLabelPanelBase.prototype.bl = function () {
        if (this.ad.b4 && (!this.ap || (this.ap && this.ag.angle == 0))) {
            return this.ad.ey();
        }
        return this.ag != null ? this.ag.angle : 0;
    };
    AxisLabelPanelBase.prototype.bq = function () {
        return this.ad.bf != null ? this.ad.bf.angle : 0;
    };
    AxisLabelPanelBase.prototype.at = function (a, b) {
        if (a == 0 && !this.ad.b9 && this.ag != null) {
            if (this.ad.cp) {
                if (!this.ag.showFirstLabel && this.ad.bi.hv() == 1) {
                    return false;
                }
            }
            else {
                if (!this.ag.showFirstLabel && this.ad.bi.hu() == 1) {
                    return false;
                }
            }
        }
        return true;
    };
    AxisLabelPanelBase.prototype.bk = function (a) {
        return this.af.m(a);
    };
    AxisLabelPanelBase.prototype.bv = function (a) {
        return this.af.w(a);
    };
    AxisLabelPanelBase.prototype.bm = function (a) {
        return this.af.n(a);
    };
    AxisLabelPanelBase.prototype.bj = function (a) {
        return this.af.l(a);
    };
    AxisLabelPanelBase.prototype.aq = function () {
        return false;
    };
    AxisLabelPanelBase.prototype.ct = function (a, b) {
    };
    AxisLabelPanelBase.prototype.cd = function (a, b) {
    };
    AxisLabelPanelBase.prototype.a7 = function () {
        if (this.ab.count < 1 || this.ba.count == 0) {
            return new List$1(Rect.$, 0);
        }
        this.bb = new List$1(FrameworkElement.$, 0);
        this.a8 = new List$1(Rect.$, 0);
        this.b6();
        this.af.af();
        var a = this.bl();
        if (a % 360 == 0) {
            this.av = false;
        }
        if (this.bb.count == 0) {
            return new List$1(Rect.$, 0);
        }
        this.a8 = this.a5();
        this.a8 = this.a6(this.a8);
        this.ak = true;
        return this.a8;
    };
    AxisLabelPanelBase.prototype.a6 = function (a) {
        var _this = this;
        if (this.ad.cu || this.ad.cw) {
            var b = this.af.p();
            var c = this.af.r();
            var d = this.af.q();
            var e = this.af.o();
            var f = Math.max(b, Math.max(c, Math.max(d, e)));
            var g_1 = new Thickness(0, f);
            if (this.av) {
                g_1 = new Thickness(0, Math.sqrt((f * f) / 2));
            }
            var h = this.a4(a);
            var i = new List$1(Thickness.$, 0);
            if (h.count < 1) {
                return a;
            }
            h.aa(function (j, k) {
                var l = _this.cy(j, a._inner[j], g_1);
                var m = _this.cy(k, a._inner[k], g_1);
                var n = l.top;
                var o = m.top;
                if (n < o) {
                    return -1;
                }
                if (n > o) {
                    return 1;
                }
                return 0;
            });
            for (var j = 0; j < h.count; j++) {
                var k = h._inner[j];
                var l = a._inner[k];
                var m = this.cy(k, a._inner[k], g_1);
                var n = this.ad.bi.wz.top;
                if (this.ad.cw) {
                    if (l.top < (this.ad.bi.wz.top - n)) {
                        l = new Rect(0, l.left, l.top + ((this.ad.bi.wz.top - n) - l.top), l.width, l.height);
                        a._inner[k] = l;
                    }
                }
            }
            var o = this.as(a, h, g_1);
            if (o && (this.ad.cu)) {
                for (var p = 0; p < h.count - 1; p++) {
                    var q = h._inner[p];
                    var r = h._inner[p + 1];
                    var s = a._inner[q];
                    var t = a._inner[r];
                    var u = this.cy(q, a._inner[q], g_1);
                    var v = this.cy(r, a._inner[r], g_1);
                    if (u.intersectsWith(v) || u.top > v.bottom) {
                        var w = new Rect(0, t.left, u.bottom + 1 + (t.top - v.top), t.width, t.height);
                        a._inner[r] = w;
                    }
                }
            }
            for (var x = h.count - 1; x >= 0; x--) {
                var y = h._inner[x];
                var z = a._inner[y];
                var aa = this.cy(y, a._inner[y], g_1);
                var ab = this.ad.bi.c9.a3;
                if (this.ad.cw) {
                    if (aa.bottom > this.ad.bi.wz.bottom + ab) {
                        z = new Rect(0, z.left, z.top - (aa.bottom - (this.ad.bi.wz.bottom + ab)), z.width, z.height);
                        a._inner[y] = z;
                    }
                }
            }
            if (this.ad.cu) {
                for (var ac = h.count - 1; ac >= 1; ac--) {
                    var ad = h._inner[ac];
                    var ae = h._inner[ac - 1];
                    var af = a._inner[ad];
                    var ag = a._inner[ae];
                    var ah = this.cy(ad, a._inner[ad], g_1);
                    var ai = this.cy(ae, a._inner[ae], g_1);
                    if (ah.intersectsWith(ai) || ah.top < ai.bottom) {
                        var aj = new Rect(0, ag.left, ah.top - (ai.height + 1 + (ag.top - ai.top)), ag.width, ag.height);
                        a._inner[ae] = aj;
                    }
                }
            }
            return a;
        }
        else {
            return a;
        }
    };
    AxisLabelPanelBase.prototype.cy = function (a, b, c) {
        var d = this.ba._inner[a];
        var e = d.d;
        if (isNaN_(e.left) || isNaN_(e.top) || isNaN_(e.right) || isNaN_(e.bottom)) {
            e = c;
        }
        if (e.left > c.left || e.top > c.top || e.right > c.right || e.bottom > c.bottom) {
            e = c;
        }
        var f = new Rect(0, b.left - e.left, b.top - e.top, b.width + e.left + e.right, b.height + e.top + e.bottom);
        return f;
    };
    AxisLabelPanelBase.prototype.as = function (a, b, c) {
        if (b.count <= 1) {
            return false;
        }
        for (var d = 0; d < b.count - 1; d++) {
            var e = b._inner[d];
            var f = b._inner[d + 1];
            var g = a._inner[e];
            var h = a._inner[f];
            var i = this.cy(e, a._inner[e], c);
            var j = this.cy(f, a._inner[f], c);
            if (i.intersectsWith(j)) {
                return true;
            }
        }
        return false;
    };
    AxisLabelPanelBase.prototype.a4 = function (a) {
        var b = new List$1(Number_$type, 0);
        for (var c = 0; c < a.count; c++) {
            var d = this.ba._inner[c].a;
            if (d) {
                b.add(c);
            }
        }
        return b;
    };
    AxisLabelPanelBase.prototype.bp = function (a, b) {
        var c = a * (Math.PI / 180);
        var d = Math.abs(b.width * Math.cos(c)) + Math.abs(b.height * Math.sin(c));
        return d;
    };
    AxisLabelPanelBase.prototype.bo = function (a, b) {
        var c = a * (Math.PI / 180);
        var d = Math.abs(b.height * Math.cos(c)) + Math.abs(b.width * Math.sin(c));
        return d;
    };
    AxisLabelPanelBase.prototype.bt = function () {
        var a = this.af.k();
        return a;
    };
    AxisLabelPanelBase.prototype.br = function () {
        var a = this.af.j();
        return a;
    };
    AxisLabelPanelBase.prototype.bs = function () {
        if (this.ad.g8 == null || (this.ad.bf != null && this.ad.bf.visibility == 1)) {
            return 0;
        }
        var a = this.br();
        var b = this.bt();
        var c = new Rect(0, 0, 0, b, a);
        var d = this.bq();
        var e = RectUtil.w(c, d);
        return e.height + this.af.v() + this.af.s();
    };
    AxisLabelPanelBase.prototype.bu = function () {
        if (this.ad.g8 == null || (this.ad.bf != null && this.ad.bf.visibility == 1)) {
            return 0;
        }
        var a = this.br();
        var b = this.bt();
        var c = new Rect(0, 0, 0, b, a);
        var d = this.bq();
        var e = RectUtil.w(c, d);
        return e.width + this.af.t() + this.af.u();
    };
    AxisLabelPanelBase.prototype.c6 = function (a) {
        if (this.ad == null || this.ab.count == 0) {
            return a;
        }
        this.b5(a);
        this.b9();
        this.b4(a);
        this.a8 = this.a7();
        if (this.bb.count != this.a8.count) {
            return a;
        }
        var b = this.af.p();
        var c = this.af.r();
        var d = this.af.q();
        var e = this.af.o();
        if (this.av) {
            for (var f = 0; f < this.bb.count; f++) {
                if (this.at(f, this.a8._inner[f])) {
                    this.af.aa(this.bb._inner[f], this.a8._inner[f], b, c, d, e);
                }
                this.cm(this.bb._inner[f], this.bl());
            }
        }
        for (var g = 0; g < this.bb.count; g++) {
            if (!this.av) {
                this.af.ae(this.bb._inner[g]);
            }
            if (this.at(g, this.a8._inner[g])) {
                this.af.aa(this.bb._inner[g], this.a8._inner[g], b, c, d, e);
            }
            else {
                this.af.aa(this.bb._inner[g], new Rect(0, 0, 0, 0, 0), b, c, d, e);
            }
        }
        if (this.ad.bq.count > 0) {
            this.ad.a8.arrangeAnnotations(this.ad, this.af, this.bb, this.a8, this.av, this.bl(), b, c, d, e);
        }
        this.b2(a);
        if (this.aq() && this.am && this.ad != null && this.ad.bg != null && !this.ad.cr && this.ad.bg.xp && !this.ad.bg.xw && this.a8 != null && this.a8.count > 0) {
            var h = this.a8.count - 1;
            if (this.ad.bq.count > 0) {
                h -= this.ad.bq.count;
            }
            if (h < 0) {
                h = 0;
            }
            this.ad.bg.aaa(this, this.c1, this.a8._inner[0], this.a8._inner[h]);
        }
        return a;
    };
    Object.defineProperty(AxisLabelPanelBase.prototype, "am", {
        get: function () {
            return this.ad.az != null && (this.ad.az.c != 5 && this.ad.az.c != 4);
        },
        enumerable: false,
        configurable: true
    });
    AxisLabelPanelBase.prototype.c0 = function () {
        return Rect.empty;
    };
    AxisLabelPanelBase.prototype.b5 = function (a) {
        if (this.ad.iv == null) {
            return;
        }
        this.af.ai(this.ad.iv, new Size(1, Number.POSITIVE_INFINITY, Number.POSITIVE_INFINITY));
        var b = Math.abs(this.bq() - 0) > 1E-06;
        var c = this.c0();
        var d = c.left + (c.width / 2);
        var e = c.top + (c.height / 2);
        var f = this.bt() + this.af.t() + this.af.u();
        var g = this.br() + this.af.v() + this.af.s();
        var h = f / 2;
        var i = g / 2;
        var j = new Rect(0, d - h, e - i, f, g);
        if (b) {
            this.cn(this.ad.iv);
        }
        else {
            this.af.ae(this.ad.iv);
        }
        this.af.aa(this.ad.iv, j, this.af.t(), this.af.v(), this.af.u(), this.af.s());
        if ((this.ad.bf == null || this.ad.bf.visibility == 0) && (this.ad.az == null || this.ad.az.visibility == 0) && this.ad.g8 != null) {
            this.ad.iv._visibility = 0;
        }
        else {
            this.ad.iv._visibility = 1;
            this.af.aa(this.ad.iv, new Rect(0, 0, 0, 0, 0), 0, 0, 0, 0);
        }
    };
    AxisLabelPanelBase.prototype.b4 = function (a) {
        this.af.ab(a);
    };
    AxisLabelPanelBase.prototype.b9 = function () {
    };
    AxisLabelPanelBase.prototype.a2 = function () {
        if (typeCast(CategoryAxisBase.$, this.ad) !== null) {
            return this.ad.k2;
        }
        if (typeCast(NumericAxisBase.$, this.ad) !== null) {
            var a = new List$1(Number_$type, 0);
            var d = this.ad.k9.j();
            for (var c = 0; c < d.length; c++) {
                var b = d[c];
                var e = this.ad.kc();
                var f = new ScalerParams(0, this.ad.bi.w0, this.ad.kh, this.ad.ci, e);
                a.add(this.ad.el(b, f));
            }
            return a;
        }
        return null;
    };
    Object.defineProperty(AxisLabelPanelBase.prototype, "ah", {
        get: function () {
            var a = this.ag != null ? this.ag.c : this.ai();
            if (this.ad.aj == null) {
                if (a == 4) {
                    a = 5;
                }
                else if (a == 5) {
                    a = 4;
                }
                else if (a == 6) {
                    a = 7;
                }
                else if (a == 7) {
                    a = 6;
                }
            }
            return a;
        },
        enumerable: false,
        configurable: true
    });
    AxisLabelPanelBase.prototype.cs = function (a, b, c, d, e, f) {
        var g = b;
        var h = b;
        if (f != null) {
            var i = f.c / 2;
            g -= i;
            h += i;
        }
        if (h >= e.left && g <= e.right) {
            if (f.a) {
                b = this.ad.d1(b, e.left, e.right, f);
            }
            var j = new LineGeometry();
            j.d = { $type: Point_$type, x: b, y: c };
            j.c = { $type: Point_$type, x: b, y: d };
            a.add(j);
        }
    };
    AxisLabelPanelBase.prototype.cc = function (a, b, c, d, e, f) {
        if (b <= e.bottom && b >= e.top) {
            if (f.a) {
                b = this.ad.d1(b, e.top, e.bottom, f);
            }
            var g = new LineGeometry();
            g.d = { $type: Point_$type, x: c, y: b };
            g.c = { $type: Point_$type, x: d, y: b };
            a.add(g);
        }
    };
    AxisLabelPanelBase.prototype.cm = function (a, b) {
        var c = this.bl();
        this.af.aj(a, c);
    };
    AxisLabelPanelBase.prototype.get_au = function () {
        return false;
    };
    Object.defineProperty(AxisLabelPanelBase.prototype, "au", {
        get: function () {
            return this.get_au();
        },
        enumerable: false,
        configurable: true
    });
    AxisLabelPanelBase.prototype.ac = function (a, b) {
        var c = a.height;
        var d = a.width;
        var e = 0 + a.left;
        var f = (c / 2) + a.top;
        var g = new TransformGroup();
        var h = AngleSimplifier.a(b);
        var i = ((function () {
            var $ret = new RotateTransform();
            $ret.j = h;
            $ret.k = e;
            $ret.l = f;
            return $ret;
        })());
        var j = 0;
        var k = 0;
        if (h != 0 && h != 360) {
            if (h > 0 && h < 180) {
                j = -Math.sin(MathUtil.o(h)) * (c / 2);
            }
            else {
                i.k = d;
                k = -d;
                j = -Math.sin(MathUtil.o(h - 180)) * (c / 2);
            }
        }
        var l = ((function () {
            var $ret = new TranslateTransform();
            $ret.k = j;
            $ret.j = k;
            return $ret;
        })());
        g.j.add(i);
        g.j.add(l);
        var m = TransformMatrixHelpler.f(g);
        var n = RectUtil.n(a);
        var o = RectUtil.o(a);
        var p = RectUtil.k(a);
        var q = RectUtil.j(a);
        var r = TransformMatrixHelpler.i(m, n);
        var s = TransformMatrixHelpler.i(m, o);
        var t = TransformMatrixHelpler.i(m, p);
        var u = TransformMatrixHelpler.i(m, q);
        var v = new Array(4);
        v[0] = r;
        v[1] = s;
        v[2] = t;
        v[3] = u;
        return v;
    };
    AxisLabelPanelBase.prototype.cz = function (a, b) {
        var c = this.ac(a, b);
        var d = 1.7976931348623157E+308;
        var e = 1.7976931348623157E+308;
        var f = -1.7976931348623157E+308;
        var g = -1.7976931348623157E+308;
        for (var h = 0; h < c.length; h++) {
            d = c[h].x < d ? c[h].x : d;
            e = c[h].y < e ? c[h].y : e;
            f = c[h].x > f ? c[h].x : f;
            g = c[h].y > g ? c[h].y : g;
        }
        return new Rect(0, d, e, Math.max(f - d, 0), Math.max(g - e, 0));
    };
    AxisLabelPanelBase.prototype.cn = function (a) {
        var b = this.bq();
        this.cb(a, b);
    };
    AxisLabelPanelBase.prototype.cb = function (a, b) {
        var c = typeCast(FrameworkElement.$, a);
        var d = this.br();
        var e = this.bt();
        var f = 0.5 * e;
        var g = 0.5 * d;
        var h = ((function () {
            var $ret = new RotateTransform();
            $ret.j = b;
            $ret.k = f;
            $ret.l = g;
            return $ret;
        })());
        var i = new TransformGroup();
        i.j.add(h);
        c.j = i;
    };
    AxisLabelPanelBase.prototype.c8 = function (a) {
        var e_40, _a;
        if ((this.ab.contains(this.ad.iv) == false) && this.ad.iv != null) {
            this.ab.add(this.ad.iv);
            AxisLabelManager.m(this.ad.iv, this.ad.bf);
        }
        try {
            for (var _b = __values(fromEnum(this.ab)), _c = _b.next(); !_c.done; _c = _b.next()) {
                var b = _c.value;
                if (b != this.ad.iv && b != this.af.aw) {
                    this.af.ah(b);
                }
            }
        }
        catch (e_40_1) {
            e_40 = { error: e_40_1 };
        }
        finally {
            try {
                if (_c && !_c.done && (_a = _b.return))
                    _a.call(_b);
            }
            finally {
                if (e_40)
                    throw e_40.error;
            }
        }
        var c = (this.ad == null || this.bd <= 0 || isNaN_(this.bd)) ? 50 : this.bd;
        if (this.ad != null && (this.ad.df == null || this.ad.df.count == 0)) {
            if (this.ad.b8()) {
                c = this.ad.er();
            }
        }
        var d = this.aq();
        c = Math.min(c, d ? a.height : a.width);
        c = isInfinity(c) ? 50 : c;
        return d ? new Size(1, 50, c) : new Size(1, c, 50);
    };
    Object.defineProperty(AxisLabelPanelBase.prototype, "bh", {
        get: function () {
            return this.c(AxisLabelPanelBase.cu);
        },
        set: function (a) {
            this.h(AxisLabelPanelBase.cu, a);
        },
        enumerable: false,
        configurable: true
    });
    AxisLabelPanelBase.prototype.aj = function (a) {
        if (a == null) {
            return this.ad.bi.ap(this.ad);
        }
        if (a.position == 0) {
            if (this.ad != null && this.ad.bi != null) {
                return this.ad.bi.ap(this.ad);
            }
            return 4;
        }
        return a.position;
    };
    AxisLabelPanelBase.prototype.ai = function () {
        return 1;
    };
    AxisLabelPanelBase.prototype.ay = function (a) {
        return true;
    };
    AxisLabelPanelBase.prototype._a0 = function () {
        var _a, _b, a, e_41_1;
        var e_41, _c;
        return __generator(this, function (_d) {
            switch (_d.label) {
                case 0:
                    _d.trys.push([0, 5, 6, 7]);
                    _a = __values(fromEnum(this.ab)), _b = _a.next();
                    _d.label = 1;
                case 1:
                    if (!!_b.done)
                        return [3 /*break*/, 4];
                    a = _b.value;
                    if (!(a != this.ad.iv && a != this.af.aw))
                        return [3 /*break*/, 3];
                    return [4 /*yield*/, a];
                case 2:
                    _d.sent();
                    _d.label = 3;
                case 3:
                    _b = _a.next();
                    return [3 /*break*/, 1];
                case 4: return [3 /*break*/, 7];
                case 5:
                    e_41_1 = _d.sent();
                    e_41 = { error: e_41_1 };
                    return [3 /*break*/, 7];
                case 6:
                    try {
                        if (_b && !_b.done && (_c = _a.return))
                            _c.call(_a);
                    }
                    finally {
                        if (e_41)
                            throw e_41.error;
                    }
                    return [7 /*endfinally*/];
                case 7: return [2 /*return*/];
            }
        });
    };
    AxisLabelPanelBase.prototype.a0 = function () {
        var _this = this;
        return toEnum(function () { return _this._a0(); });
    };
    AxisLabelPanelBase.prototype.b1 = function (a, b, c, d, e) {
        var f = this.af.x(b, c, d, e);
        return f;
    };
    AxisLabelPanelBase.prototype.b7 = function (a) {
        if (this.bz == null || this.bk(this.bz) < this.bk(a)) {
            this.bz = a;
        }
    };
    AxisLabelPanelBase.prototype.cg = function (a) {
        this.bb.add(a);
    };
    AxisLabelPanelBase.prototype._a1 = function () {
        var a, b;
        return __generator(this, function (_a) {
            switch (_a.label) {
                case 0:
                    a = 0;
                    _a.label = 1;
                case 1:
                    if (!(a < this.ad.br.count))
                        return [3 /*break*/, 4];
                    return [4 /*yield*/, this.ad.br.item(a)];
                case 2:
                    _a.sent();
                    _a.label = 3;
                case 3:
                    a++;
                    return [3 /*break*/, 1];
                case 4:
                    b = 0;
                    _a.label = 5;
                case 5:
                    if (!(b < this.ad.bq.count))
                        return [3 /*break*/, 8];
                    return [4 /*yield*/, this.ad.bq.item(b)];
                case 6:
                    _a.sent();
                    _a.label = 7;
                case 7:
                    b++;
                    return [3 /*break*/, 5];
                case 8: return [2 /*return*/];
            }
        });
    };
    AxisLabelPanelBase.prototype.a1 = function () {
        var _this = this;
        return toEnum(function () { return _this._a1(); });
    };
    AxisLabelPanelBase.prototype.ca = function () {
        this.af.ag();
        this.cr();
    };
    AxisLabelPanelBase.prototype.cr = function () {
        this.a8 = this.a7();
    };
    AxisLabelPanelBase.prototype.ce = function () {
    };
    AxisLabelPanelBase.prototype.bi = function (a) {
        return this.bd;
    };
    AxisLabelPanelBase.prototype.ci = function () {
        this.c2 = new Rect(0, 0, 0, this.c7.width, this.c7.height);
    };
    AxisLabelPanelBase.prototype.cq = function () {
        this.c2 = Rect.empty;
    };
    AxisLabelPanelBase.prototype.cf = function () {
        this.af.ak();
    };
    AxisLabelPanelBase.prototype.cj = function (a) {
        this.af.al(a);
    };
    AxisLabelPanelBase.prototype.b3 = function () {
        this.af.y();
    };
    AxisLabelPanelBase.prototype.ck = function () {
        this.af.ao();
    };
    AxisLabelPanelBase.$t = markType(AxisLabelPanelBase, 'AxisLabelPanelBase', Panel.$);
    AxisLabelPanelBase.cu = DependencyProperty.i("Extent", Number_$type, AxisLabelPanelBase.$, new PropertyMetadata(2, 50, function (a, b) { return a.bd = b.newValue; }));
    return AxisLabelPanelBase;
}(Panel));
export { AxisLabelPanelBase };
/**
 * @hidden
 */
var CategoryAxisBase = /** @class */ /*@__PURE__*/ (function (_super) {
    __extends(CategoryAxisBase, _super);
    function CategoryAxisBase() {
        var _this = _super.call(this) || this;
        _this.k2 = null;
        _this.ku = null;
        _this.lh = 0;
        _this.lj = 0;
        _this.ks = 0;
        _this.k4 = 1;
        _this.li = 0;
        _this.kw = false;
        _this.k2 = new List$1(Number_$type, 0);
        return _this;
    }
    CategoryAxisBase.prototype.a4 = function () {
        return new CategoryAxisBaseView(this);
    };
    CategoryAxisBase.prototype.ag = function () {
        return [0, this.lk - 1];
    };
    CategoryAxisBase.prototype.get_cd = function () {
        return false;
    };
    CategoryAxisBase.prototype.hv = function (a) {
        _super.prototype.hv.call(this, a);
        this.kr = a;
    };
    CategoryAxisBase.prototype.ei = function (a, b, c, d) {
        var e = this.getCategorySize(b, c, d);
        var f = e * a;
        return f;
    };
    CategoryAxisBase.prototype.c8 = function (a, b, c) {
        var d = _super.prototype.c8.call(this, a, b, c);
        if (!d) {
            return false;
        }
        return this.itemsSource != null && this.lj > 0;
    };
    CategoryAxisBase.prototype.l6 = function () {
        if (this.kv != null && this.bo != null && this.itemsSource != null) {
            this.kv = this.bo.releaseFastItemsSource(this.itemsSource);
        }
    };
    CategoryAxisBase.prototype.l5 = function () {
        if (this.kv == null && this.bo != null && this.itemsSource != null) {
            this.kv = this.bo.getFastItemsSource(this.itemsSource);
        }
    };
    CategoryAxisBase.prototype.get_cb = function () {
        return true;
    };
    CategoryAxisBase.prototype.mj = function (a, b, c) {
        if (this.b9) {
            return Rect.empty;
        }
        return this.mk(a, b, c, this.cp);
    };
    CategoryAxisBase.prototype.mk = function (a, b, c, d) {
        var e = 0;
        var f = a.x;
        var g = this.kh.left;
        var h = this.kh.right;
        if (d) {
            f = a.y;
            g = this.kh.top;
            h = this.kh.bottom;
        }
        var i = this.k2;
        if ((d && !this.ch) || (!d && this.ch)) {
            i = new List$1(Number_$type, 0);
            for (var j = this.k2.count - 1; j >= 0; j--) {
                i.add(this.k2._inner[j]);
            }
        }
        if (this.categoryMode == 0) {
            if (b) {
                var k = void 0;
                if (d) {
                    k = new Rect(0, this.kh.left, a.y - c / 2, this.kh.width, c);
                }
                else {
                    k = new Rect(0, a.x - c / 2, this.kh.top, c, this.kh.height);
                }
                k.intersect(this.kh);
                return k;
            }
            else {
                if (f > h) {
                    return Rect.empty;
                }
                if (f < g) {
                    return Rect.empty;
                }
                var l = 1.7976931348623157E+308;
                var m = -1;
                for (e = 0; e < i.count; e++) {
                    var n = Math.abs(i._inner[e] - f);
                    if (n < l) {
                        l = n;
                        m = e;
                    }
                }
                if (m == -1) {
                    return Rect.empty;
                }
                var o = i._inner[m];
                var p = void 0;
                if (d) {
                    p = new Rect(0, this.kh.left, o - c / 2, this.kh.width, c);
                }
                else {
                    p = new Rect(0, o - c / 2, this.kh.top, c, this.kh.height);
                }
                p.intersect(this.kh);
                return p;
            }
        }
        else {
            for (e = 0; e < i.count; e++) {
                if (i._inner[e] > f) {
                    break;
                }
            }
            if (e == 0) {
                return Rect.empty;
            }
            if (f > h) {
                return Rect.empty;
            }
            if (f < g) {
                return Rect.empty;
            }
            var q = this.kh.right;
            if (d) {
                q = this.kh.bottom;
            }
            if (e < i.count) {
                q = i._inner[e];
            }
            if (d) {
                return new Rect(0, this.kh.left, i._inner[e - 1], this.kh.width, q - i._inner[e - 1]);
            }
            else {
                return new Rect(0, i._inner[e - 1], this.kh.top, q - i._inner[e - 1], this.kh.height);
            }
        }
    };
    Object.defineProperty(CategoryAxisBase.prototype, "itemsSource", {
        get: function () {
            return this.c(CategoryAxisBase.me);
        },
        set: function (a) {
            this.h(CategoryAxisBase.me, a);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(CategoryAxisBase.prototype, "lk", {
        get: function () {
            return this.lh;
        },
        set: function (a) {
            this.lh = a;
            this.lj = this.lh;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(CategoryAxisBase.prototype, "categoryMode", {
        get: function () {
            return this.ks;
        },
        set: function (a) {
            if (this.ks != a) {
                var b = this.ks;
                this.ks = a;
                this.h5("CategoryMode", enumGetBox(CategoryMode_$type, b), enumGetBox(CategoryMode_$type, a));
            }
        },
        enumerable: false,
        configurable: true
    });
    CategoryAxisBase.prototype.lf = function (a, b, c) {
        var d = !isNaN_(this.k5) ? MathUtil.d(this.k5, 0, this.k4) : 0;
        if (!this.b9 && this.ld > 0) {
            var e = this.getCategorySize(a, b, c);
            var f = 0.5 * d;
            var g = e * f;
            if (g < this.ld) {
                g = this.ld;
                f = g / e;
                d = f / 0.5;
                d = MathUtil.d(d, 0, this.k4);
            }
        }
        return d;
    };
    Object.defineProperty(CategoryAxisBase.prototype, "ll", {
        get: function () {
            return this.li;
        },
        set: function (a) {
            if (a != this.li) {
                var b = this.li;
                this.li = a;
                this.h5("GroupCount", b, this.li);
            }
        },
        enumerable: false,
        configurable: true
    });
    CategoryAxisBase.prototype.eo = function (a, b) {
        return NaN;
    };
    CategoryAxisBase.prototype.getUnscaledValue3 = function (a, b, c, d) {
        return NaN;
    };
    CategoryAxisBase.prototype.getCategorySize = function (a, b, c) {
        return NaN;
    };
    CategoryAxisBase.prototype.k8 = function (a, b, c) {
        return NaN;
    };
    CategoryAxisBase.prototype.getGroupCenter = function (a, b, c, d) {
        return NaN;
    };
    CategoryAxisBase.prototype.lg = function (a) {
        var b = this.bi.w0;
        var c = this.kh;
        var d = this.kc();
        var e = new ScalerParams(0, b, c, this.ch, d);
        return this.eo(a, e);
    };
    CategoryAxisBase.prototype._k1 = function () {
        var _a, _b, a, e_42_1, _c, _d, b, _e, _f, c, e_43_1, e_44_1;
        var e_42, _g, e_44, _h, e_43, _j;
        return __generator(this, function (_k) {
            switch (_k.label) {
                case 0:
                    _k.trys.push([0, 5, 6, 7]);
                    _a = __values(fromEnum(this.df)), _b = _a.next();
                    _k.label = 1;
                case 1:
                    if (!!_b.done)
                        return [3 /*break*/, 4];
                    a = _b.value;
                    return [4 /*yield*/, a];
                case 2:
                    _k.sent();
                    _k.label = 3;
                case 3:
                    _b = _a.next();
                    return [3 /*break*/, 1];
                case 4: return [3 /*break*/, 7];
                case 5:
                    e_42_1 = _k.sent();
                    e_42 = { error: e_42_1 };
                    return [3 /*break*/, 7];
                case 6:
                    try {
                        if (_b && !_b.done && (_g = _a.return))
                            _g.call(_a);
                    }
                    finally {
                        if (e_42)
                            throw e_42.error;
                    }
                    return [7 /*endfinally*/];
                case 7:
                    if (!(this.bi != null && this.bi.fg && this.ky(this.bi)))
                        return [3 /*break*/, 21];
                    _k.label = 8;
                case 8:
                    _k.trys.push([8, 19, 20, 21]);
                    _c = __values(fromEnum(this.bi.go())), _d = _c.next();
                    _k.label = 9;
                case 9:
                    if (!!_d.done)
                        return [3 /*break*/, 18];
                    b = _d.value;
                    if (!(b != this.bi))
                        return [3 /*break*/, 17];
                    _k.label = 10;
                case 10:
                    _k.trys.push([10, 15, 16, 17]);
                    _e = (e_43 = void 0, __values(fromEnum(b.series))), _f = _e.next();
                    _k.label = 11;
                case 11:
                    if (!!_f.done)
                        return [3 /*break*/, 14];
                    c = _f.value;
                    return [4 /*yield*/, c];
                case 12:
                    _k.sent();
                    _k.label = 13;
                case 13:
                    _f = _e.next();
                    return [3 /*break*/, 11];
                case 14: return [3 /*break*/, 17];
                case 15:
                    e_43_1 = _k.sent();
                    e_43 = { error: e_43_1 };
                    return [3 /*break*/, 17];
                case 16:
                    try {
                        if (_f && !_f.done && (_j = _e.return))
                            _j.call(_e);
                    }
                    finally {
                        if (e_43)
                            throw e_43.error;
                    }
                    return [7 /*endfinally*/];
                case 17:
                    _d = _c.next();
                    return [3 /*break*/, 9];
                case 18: return [3 /*break*/, 21];
                case 19:
                    e_44_1 = _k.sent();
                    e_44 = { error: e_44_1 };
                    return [3 /*break*/, 21];
                case 20:
                    try {
                        if (_d && !_d.done && (_h = _c.return))
                            _h.call(_c);
                    }
                    finally {
                        if (e_44)
                            throw e_44.error;
                    }
                    return [7 /*endfinally*/];
                case 21: return [2 /*return*/];
            }
        });
    };
    CategoryAxisBase.prototype.k1 = function () {
        var _this = this;
        return toEnum(function () { return _this._k1(); });
    };
    CategoryAxisBase.prototype.kx = function (a) {
        return this.df.contains(a);
    };
    CategoryAxisBase.prototype.ky = function (a) {
        return false;
    };
    CategoryAxisBase.prototype._k0 = function () {
        var a, _a, _b, b, c, _c, _d, d, e_45_1, e_46_1;
        var e_46, _e, e_45, _f;
        return __generator(this, function (_g) {
            switch (_g.label) {
                case 0:
                    a = typeCast(XamDataChart.$, this.bi);
                    if (!(a != null && a.fg && this.ky(a)))
                        return [3 /*break*/, 14];
                    _g.label = 1;
                case 1:
                    _g.trys.push([1, 12, 13, 14]);
                    _a = __values(fromEnum(a.go())), _b = _a.next();
                    _g.label = 2;
                case 2:
                    if (!!_b.done)
                        return [3 /*break*/, 11];
                    b = _b.value;
                    if (!(b != this.bi))
                        return [3 /*break*/, 10];
                    c = typeCast(XamDataChart.$, b);
                    if (!(c != null))
                        return [3 /*break*/, 10];
                    _g.label = 3;
                case 3:
                    _g.trys.push([3, 8, 9, 10]);
                    _c = (e_45 = void 0, __values(fromEnum(c.axes))), _d = _c.next();
                    _g.label = 4;
                case 4:
                    if (!!_d.done)
                        return [3 /*break*/, 7];
                    d = _d.value;
                    if (!(typeCast(CategoryAxisBase.$, d) !== null))
                        return [3 /*break*/, 6];
                    return [4 /*yield*/, typeCast(CategoryAxisBase.$, d)];
                case 5:
                    _g.sent();
                    _g.label = 6;
                case 6:
                    _d = _c.next();
                    return [3 /*break*/, 4];
                case 7: return [3 /*break*/, 10];
                case 8:
                    e_45_1 = _g.sent();
                    e_45 = { error: e_45_1 };
                    return [3 /*break*/, 10];
                case 9:
                    try {
                        if (_d && !_d.done && (_f = _c.return))
                            _f.call(_c);
                    }
                    finally {
                        if (e_45)
                            throw e_45.error;
                    }
                    return [7 /*endfinally*/];
                case 10:
                    _b = _a.next();
                    return [3 /*break*/, 2];
                case 11: return [3 /*break*/, 14];
                case 12:
                    e_46_1 = _g.sent();
                    e_46 = { error: e_46_1 };
                    return [3 /*break*/, 14];
                case 13:
                    try {
                        if (_b && !_b.done && (_e = _a.return))
                            _e.call(_a);
                    }
                    finally {
                        if (e_46)
                            throw e_46.error;
                    }
                    return [7 /*endfinally*/];
                case 14: return [2 /*return*/];
            }
        });
    };
    CategoryAxisBase.prototype.k0 = function () {
        var _this = this;
        return toEnum(function () { return _this._k0(); });
    };
    CategoryAxisBase.prototype.ma = function (a) {
        var e_47, _a, e_48, _b;
        if (this.kw) {
            return;
        }
        try {
            this.kw = true;
            var b = 0;
            var c = 0;
            var d = false;
            try {
                for (var _c = __values(fromEnum(this.k1())), _d = _c.next(); !_d.done; _d = _c.next()) {
                    var e = _d.value;
                    if (!e.e0 && !e.fu && !e.e8) {
                        continue;
                    }
                    if (e.bo != null) {
                        continue;
                    }
                    var f = e;
                    var g = f.preferredCategoryMode(this);
                    if (g == 2) {
                        b = 2;
                        d = true;
                        if (this.kx(e)) {
                            c++;
                        }
                    }
                    if (g == 1 && !d) {
                        b = 1;
                    }
                }
            }
            catch (e_47_1) {
                e_47 = { error: e_47_1 };
            }
            finally {
                try {
                    if (_d && !_d.done && (_a = _c.return))
                        _a.call(_c);
                }
                finally {
                    if (e_47)
                        throw e_47.error;
                }
            }
            var h = this.kz;
            try {
                for (var _e = __values(fromEnum(this.k0())), _f = _e.next(); !_f.done; _f = _e.next()) {
                    var i = _f.value;
                    if (i.kz) {
                        h = true;
                    }
                    if (a) {
                        i.ma(false);
                    }
                }
            }
            catch (e_48_1) {
                e_48 = { error: e_48_1 };
            }
            finally {
                try {
                    if (_f && !_f.done && (_b = _e.return))
                        _b.call(_e);
                }
                finally {
                    if (e_48)
                        throw e_48.error;
                }
            }
            if (b == 0 && h) {
                b = 2;
                if (c == 0) {
                    c = 1;
                }
            }
            this.categoryMode = b;
            this.ll = c;
        }
        finally {
            this.kw = false;
        }
    };
    CategoryAxisBase.prototype.lm = function () {
        if (this.kv == null) {
            return 0;
        }
        return this.kv.count;
    };
    CategoryAxisBase.prototype.hz = function (a, b, c, d) {
        var e_49, _a, e_50, _b, e_51, _c;
        _super.prototype.hz.call(this, a, b, c, d);
        switch (b) {
            case "FastItemsSourceProvider":
                if ((typeCast(IFastItemsSourceProvider_$type, c)) != null) {
                    this.kv = c.releaseFastItemsSource(this.itemsSource);
                }
                if ((typeCast(IFastItemsSourceProvider_$type, d)) != null) {
                    this.kv = d.getFastItemsSource(this.itemsSource);
                }
                this.lk = 0;
                if (this.kv != null) {
                    this.lk = this.lm();
                }
                this.ma(true);
                break;
            case "ItemsSource":
                if (this.bo != null) {
                    this.kv = this.bo.getFastItemsSource(this.itemsSource);
                }
                break;
            case CategoryAxisBase.$$p[0]:
                var e = typeCast(IFastItemsSource_$type, c);
                this.lx();
                this.cq = true;
                if (e != null) {
                    e.event = delegateRemove(e.event, runOn(this, this.l0));
                }
                this.lk = 0;
                if (this.kv != null) {
                    this.lk = this.lm();
                }
                if (this.kv != null) {
                    var f = this.kv;
                    f.event = delegateCombine(f.event, runOn(this, this.l0));
                    this.ib(false);
                    try {
                        for (var _d = __values(fromEnum(this.db())), _e = _d.next(); !_e.done; _e = _d.next()) {
                            var g = _e.value;
                            g.ru(false);
                            if (g.dc != null) {
                                g.qn();
                            }
                        }
                    }
                    catch (e_49_1) {
                        e_49 = { error: e_49_1 };
                    }
                    finally {
                        try {
                            if (_e && !_e.done && (_a = _d.return))
                                _a.call(_d);
                        }
                        finally {
                            if (e_49)
                                throw e_49.error;
                        }
                    }
                    if (this.bi != null && this.bi.fu) {
                        this.bi.q8();
                    }
                }
                else {
                    this.hj();
                    try {
                        for (var _f = __values(fromEnum(this.db())), _g = _f.next(); !_g.done; _g = _f.next()) {
                            var h = _g.value;
                            h.o7(true, h.cw);
                            if (h.dc != null) {
                                h.qn();
                            }
                        }
                    }
                    catch (e_50_1) {
                        e_50 = { error: e_50_1 };
                    }
                    finally {
                        try {
                            if (_g && !_g.done && (_b = _f.return))
                                _b.call(_f);
                        }
                        finally {
                            if (e_50)
                                throw e_50.error;
                        }
                    }
                }
                break;
            case "ItemsCount":
                this.h6(new AxisRangeChangedEventArgs(0, 0, 0, typeGetValue((c)) - 1, typeGetValue((d)) - 1));
                this.ib(false);
                break;
            case CategoryAxisBase.$$p[5]:
                this.cq = true;
                this.mb();
                this.ib(false);
                this.ly();
                break;
            case "CategoryMode":
                this.cq = true;
                this.ib(false);
                this.l8();
                this.ly();
                break;
            case CategoryAxisBase.$$p[4]:
            case CategoryAxisBase.$$p[3]:
            case CategoryAxisBase.$$p[2]:
            case CategoryAxisBase.$$p[1]:
                this.k4 = this.lc;
                this.cq = true;
                try {
                    for (var _h = __values(fromEnum(this.db())), _j = _h.next(); !_j.done; _j = _h.next()) {
                        var i = _j.value;
                        i.g1 = true;
                        var j = typeCast(IHasCategoryModePreference_$type, i);
                        if (j != null && j.preferredCategoryMode(this) == 2) {
                            i.ru(false);
                        }
                    }
                }
                catch (e_51_1) {
                    e_51 = { error: e_51_1 };
                }
                finally {
                    try {
                        if (_j && !_j.done && (_c = _h.return))
                            _c.call(_h);
                    }
                    finally {
                        if (e_51)
                            throw e_51.error;
                    }
                }
                this.ib(false);
                if (this.bi != null) {
                    this.bi.oq();
                }
                break;
            case Axis.$$p[4]:
            case Axis.$$p[3]:
                this.cq = true;
                this.ib(true);
                break;
        }
    };
    CategoryAxisBase.prototype.ly = function () {
        var e_52, _a;
        try {
            for (var _b = __values(fromEnum(this.db())), _c = _b.next(); !_c.done; _c = _b.next()) {
                var a = _c.value;
                a.ru(false);
            }
        }
        catch (e_52_1) {
            e_52 = { error: e_52_1 };
        }
        finally {
            try {
                if (_c && !_c.done && (_a = _b.return))
                    _a.call(_b);
            }
            finally {
                if (e_52)
                    throw e_52.error;
            }
        }
    };
    CategoryAxisBase.prototype.l0 = function (a, b) {
        this.l7(b);
    };
    CategoryAxisBase.prototype.l7 = function (a) {
        switch (a.action) {
            case 3:
            case 0:
            case 1:
            case 2:
            case 4:
                if (this.kv != null) {
                    this.lk = this.lm();
                }
                this.ib(false);
                break;
        }
        if (this.kv != null) {
            this.lk = this.lm();
        }
    };
    CategoryAxisBase.prototype.mb = function () {
        var e_53, _a;
        var a = false, b = false;
        try {
            for (var _b = __values(fromEnum(this.df)), _c = _b.next(); !_c.done; _c = _b.next()) {
                var c = _c.value;
                var d = typeCast(IHasCategoryModePreference_$type, c);
                if (d == null) {
                    continue;
                }
                var e = d.preferredCategoryMode(this);
                a = a || e == 1;
                b = b || e == 2;
            }
        }
        catch (e_53_1) {
            e_53 = { error: e_53_1 };
        }
        finally {
            try {
                if (_c && !_c.done && (_a = _b.return))
                    _a.call(_b);
            }
            finally {
                if (e_53)
                    throw e_53.error;
            }
        }
        var f = b ? 2 : a ? 1 : 0;
        if (f == 0 && this.kz) {
            f = 1;
            if (this.ll == 0) {
                this.ll = 1;
            }
        }
        this.categoryMode = f;
    };
    CategoryAxisBase.prototype.ct = function (a) {
        var e_54, _a;
        var b = _super.prototype.ct.call(this, a);
        if (b) {
            this.ma(true);
            var c = typeCast(IHasCategoryModePreference_$type, a);
            if (c != null && c.preferredCategoryMode(this) == 2) {
                try {
                    for (var _b = __values(fromEnum(this.db())), _c = _b.next(); !_c.done; _c = _b.next()) {
                        var d = _c.value;
                        var e = typeCast(IHasCategoryModePreference_$type, d);
                        if (e != null && e != c && e.preferredCategoryMode(this) == 2) {
                            d.ru(false);
                        }
                    }
                }
                catch (e_54_1) {
                    e_54 = { error: e_54_1 };
                }
                finally {
                    try {
                        if (_c && !_c.done && (_a = _b.return))
                            _a.call(_b);
                    }
                    finally {
                        if (e_54)
                            throw e_54.error;
                    }
                }
            }
            this.ib(false);
            this.c1();
        }
        return b;
    };
    CategoryAxisBase.prototype.b0 = function (a) {
        var e_55, _a;
        var b = _super.prototype.b0.call(this, a);
        if (b) {
            this.ma(true);
            var c = typeCast(IHasCategoryModePreference_$type, a);
            if (c != null && c.preferredCategoryMode(this) != 0) {
                try {
                    for (var _b = __values(fromEnum(this.db())), _c = _b.next(); !_c.done; _c = _b.next()) {
                        var d = _c.value;
                        var e = typeCast(IHasCategoryModePreference_$type, d);
                        if (e != null) {
                            d.ru(false);
                        }
                    }
                }
                catch (e_55_1) {
                    e_55 = { error: e_55_1 };
                }
                finally {
                    try {
                        if (_c && !_c.done && (_a = _b.return))
                            _a.call(_b);
                    }
                    finally {
                        if (e_55)
                            throw e_55.error;
                    }
                }
            }
            this.ib(false);
        }
        return b;
    };
    CategoryAxisBase.prototype.l8 = function () {
        var e_56, _a;
        var a = null;
        try {
            for (var _b = __values(fromEnum(this.db())), _c = _b.next(); !_c.done; _c = _b.next()) {
                var b = _c.value;
                if (b.e0) {
                    var c = b.aw(this);
                    if (c != null && c.aj == this) {
                        a = c;
                    }
                }
            }
        }
        catch (e_56_1) {
            e_56 = { error: e_56_1 };
        }
        finally {
            try {
                if (_c && !_c.done && (_a = _b.return))
                    _a.call(_b);
            }
            finally {
                if (e_56)
                    throw e_56.error;
            }
        }
        if (a != null) {
            a.ia();
        }
    };
    CategoryAxisBase.prototype.lx = function () {
        this.ku = this.kv;
    };
    CategoryAxisBase.prototype.l9 = function () {
        var a = this.az;
        if (a == null) {
            a = new AxisLabelSettings();
        }
        if (a.visibility == 1) {
            this.br.count = 0;
            this.bq.count = 0;
            this.bp.count = 0;
        }
        else {
            var b = 0;
            b = this.kr.bl(this.dd);
            this.br.count = b;
        }
    };
    CategoryAxisBase.prototype.lz = function (a) {
        if (this.kv != null) {
            this.kv.handleCollectionChanged(a);
        }
    };
    CategoryAxisBase.prototype.l4 = function (a, b, c) {
        this.lz(new NotifyCollectionChangedEventArgs(2, 2, c, b, a));
    };
    CategoryAxisBase.prototype.l1 = function () {
        this.lz(new NotifyCollectionChangedEventArgs(0, 4));
    };
    CategoryAxisBase.prototype.l2 = function (a, b) {
        this.lz(new NotifyCollectionChangedEventArgs(1, 0, b, a));
    };
    CategoryAxisBase.prototype.l3 = function (a, b) {
        this.lz(new NotifyCollectionChangedEventArgs(1, 1, b, a));
    };
    CategoryAxisBase.prototype.k9 = function (a, b, c, d) {
        return this.la(a, b, c, d, this.categoryMode);
    };
    CategoryAxisBase.prototype.la = function (a, b, c, d, e) {
        var f = 0;
        var g = e;
        if (g == 0 && this.categoryMode != 0) {
            g = 1;
        }
        switch (g) {
            case 0:
                f = 0;
                break;
            case 1:
                f = 0.5 * this.getCategorySize(a, b, c);
                break;
            case 2:
                f = this.getGroupCenter(d, a, b, c);
                break;
        }
        if (this.cp != this.ch) {
            f *= -1;
        }
        return f;
    };
    CategoryAxisBase.prototype.getSeriesOffset = function (a, b, c, d, e) {
        return this.la(a, b, c, d, e);
    };
    Object.defineProperty(CategoryAxisBase.prototype, "isVertical", {
        get: function () {
            return this.cp;
        },
        enumerable: false,
        configurable: true
    });
    CategoryAxisBase.prototype.j$d = function (a, b) {
        return this.eo.apply(this, arguments);
    };
    CategoryAxisBase.prototype.j$c = function (a, b) {
        return this.el.apply(this, arguments);
    };
    CategoryAxisBase.prototype.j$e = function (a, b, c, d, e) {
        this.hp.apply(this, arguments);
    };
    CategoryAxisBase.prototype.j$f = function (a, b, c, d) {
        this.hq.apply(this, arguments);
    };
    CategoryAxisBase.prototype.j$g = function (a, b, c, d) {
        this.hr.apply(this, arguments);
    };
    Object.defineProperty(CategoryAxisBase.prototype, "j$b", {
        get: function () {
            return this.ch;
        },
        enumerable: false,
        configurable: true
    });
    CategoryAxisBase.prototype.j$a = function () {
        return this.ag.apply(this, arguments);
    };
    CategoryAxisBase.$t = markType(CategoryAxisBase, 'CategoryAxisBase', Axis.$, [ICategoryScaler_$type]);
    CategoryAxisBase.me = DependencyProperty.i("ItemsSource", IEnumerable_$type, CategoryAxisBase.$, new PropertyMetadata(2, null, function (a, b) {
        var c = typeCast(CategoryAxisBase.$, a);
        if (c.bo != null) {
            c.bo.releaseFastItemsSource(b.oldValue);
        }
        a.h5("ItemsSource", b.oldValue, b.newValue);
    }));
    CategoryAxisBase.$$p = markDep(DependencyProperty, PropertyMetadata, CategoryAxisBase, 'h5', ['FastItemsSource:kv:mc', [IFastItemsSource_$type], 'Gap:k5:md', [1, 0.2], 'MaximumGap:lc:mf', [1, 1], 'MinimumGapSize:ld:mg', [1, 0], 'Overlap:le:mh', [1, 0], 'UseClusteringMode:kz:mi', [0, false]]);
    return CategoryAxisBase;
}(Axis));
export { CategoryAxisBase };
/**
 * @hidden
 */
var HorizontalAxisLabelPanelBase = /** @class */ /*@__PURE__*/ (function (_super) {
    __extends(HorizontalAxisLabelPanelBase, _super);
    function HorizontalAxisLabelPanelBase() {
        var _this = _super !== null && _super.apply(this, arguments) || this;
        _this.dl = 0;
        _this.di = 0;
        _this.dk = 0;
        _this.dj = 0;
        return _this;
    }
    HorizontalAxisLabelPanelBase.prototype.ae = function () {
        return new HorizontalAxisLabelPanelBaseView(this);
    };
    HorizontalAxisLabelPanelBase.prototype.ch = function (a) {
        _super.prototype.ch.call(this, a);
        this.c9 = a;
    };
    HorizontalAxisLabelPanelBase.prototype.b6 = function () {
        this.c9.a1();
    };
    HorizontalAxisLabelPanelBase.prototype.db = function () {
        return ((this.ag != null && this.ag.k()) || this.ad.b4) && this.bl() % 360 != 0;
    };
    HorizontalAxisLabelPanelBase.prototype.dc = function () {
        return this.ao && !this.av;
    };
    HorizontalAxisLabelPanelBase.prototype.aq = function () {
        return true;
    };
    HorizontalAxisLabelPanelBase.prototype.a5 = function () {
        var _this = this;
        var a = new List$1(Rect.$, 0);
        var b = new List$1(Boolean_$type, 0);
        this.aw = false;
        this.av = false;
        this.ax = false;
        var c = this.bl();
        var d = c * Math.PI / 180;
        if (this.db()) {
            this.av = true;
        }
        this.ao = false;
        this.dn(a, b, d);
        if (this.ad != null && this.ad.bi != null && (this.ad.bi.ft || this.ad.bi.fs) && a != null) {
            for (var e = 0; e < a.count; e++) {
                var f = a._inner[e];
                if (this.c3.isEmpty) {
                    this.c3 = f;
                }
                else {
                    if (this.c3.width < f.width) {
                        this.c3 = f;
                    }
                }
            }
        }
        this.ao = this.ao || this.an(a, b);
        if (this.ao) {
            this.dq(a, b);
        }
        else {
            this.dr();
        }
        var g = this.ad.b8();
        if (!g) {
            this.dm(c);
        }
        else {
            this.af.ac();
        }
        if (this.av) {
            for (var h = 0; h < a.count; h++) {
                var i = a._inner[h];
                i.x = this.ba._inner[h].c;
                a._inner[h] = i;
            }
        }
        var j = 0;
        if (this.dc()) {
            j = ((function () { var k = _this.by(_this.di, a, b); a = k.p1; return k.ret; })());
        }
        if (this.ao && !this.aw) {
            if (j > 0) {
                if (this.c9.a0()) {
                    this.ax = true;
                }
            }
        }
        if (this.ao && this.da()) {
            this.ar = true;
            var k = this.c1.width;
            var l = this.dg();
            var m = this.df();
            var n = this.ba.count > 1 ? this.ba._inner[1].c - this.ba._inner[0].c : k;
            var o = Math.abs(n * 0.8);
            var p = 0;
            var q = Math.abs(Math.atan(this.di / n) * 180 / Math.PI);
            var r = this.af.p();
            var s = this.af.q();
            for (var t = 0; t < a.count; t++) {
                if (this.al) {
                    if (t > 0 && t < a.count - 1) {
                        var u = this.ba.count > 1 ? this.ba._inner[t].c - (a._inner[t - 1].x + a._inner[t - 1].width) : k;
                        var v = this.ba.count > 1 ? a._inner[t + 1].x - this.ba._inner[t].c : k;
                        o = Math.abs(Math.min(Math.abs(u * 2), Math.abs(v * 2)) * 0.8);
                    }
                    else {
                        if (t == 0) {
                            var w = this.ba.count > 1 ? a._inner[t + 1].x - this.ba._inner[t].c : k;
                            o = Math.abs((n * 2) * 0.8);
                        }
                        if (t == a.count - 1) {
                            var x = this.ba.count > 1 ? this.ba._inner[t].c - (a._inner[t - 1].x + a._inner[t - 1].width) : k;
                            o = Math.abs((x * 2) * 0.8);
                        }
                    }
                }
                var y = Math.min(a._inner[t].width, o);
                p = this.av ? this.ba._inner[t].c : this.ba._inner[t].c - y / 2;
                var z = AngleSimplifier.a(c);
                var aa = (z >= q && z <= 180 - q) || (z >= 180 + q && z <= 360 - q);
                var ab = a._inner[t];
                if (this.av && aa) {
                    var ac = this.bv(this.bb._inner[t]);
                    o = Math.min(l / Math.abs(Math.sin(d)), ac);
                }
                ab.x = p;
                ab.width = Math.min(o, ab.width);
                a._inner[t] = ab;
                if (!(typeCast(TextBlock.$, this.bb._inner[t]) !== null)) {
                    this.bb._inner[t].width = Math.min(o, ab.width);
                }
                var ad = typeCast(TextBlock.$, this.bb._inner[t]);
                if (ad != null) {
                    var ae = this.b1(t, ad, o, r, s);
                    if (this.ax) {
                        ad.height = m;
                    }
                    else if (!Base.equalsStatic(ad.al, ae)) {
                        ad.al = ae;
                        this.bb._inner[t].width = Math.min(o, this.bk(this.bb._inner[t]));
                        this.dk = Math.min(this.dk, this.bb._inner[t].width);
                    }
                }
            }
            if (!g) {
                this.dm(c);
            }
        }
        if (this.dd()) {
            this.dp(a);
        }
        return a;
    };
    HorizontalAxisLabelPanelBase.prototype.dn = function (a, b, c) {
        var d = this.bs();
        var e = this.dh();
        this.di = -1.7976931348623157E+308;
        this.dl = -1.7976931348623157E+308;
        this.dj = -1.7976931348623157E+308;
        this.dk = -1.7976931348623157E+308;
        var f = this.af.p();
        var g = this.af.q();
        var h = this.af.r();
        var i = this.af.o();
        var j = this.c1.top;
        var k = (this.c1.height - d);
        var l = false;
        for (var m = 0; m < this.bb.count; m++) {
            if (!this.ba._inner[m].a) {
                l = true;
            }
        }
        for (var n = 0; n < this.bb.count; n++) {
            if (this.ba == null || n >= this.ba.count) {
                break;
            }
            var o = void 0, p = void 0, q = void 0, r = void 0, s = void 0, t = void 0;
            var u = this.bb._inner[n];
            s = this.bk(u);
            t = this.bj(u);
            r = s + this.af.p() + this.af.q();
            q = t + h + i;
            var v = this.ba._inner[n].a;
            if (this.av) {
                o = this.ba._inner[n].c;
            }
            else {
                o = this.ba._inner[n].c - r / 2;
            }
            p = j + e;
            if (!v || !l) {
                this.di = Math.max(q, this.di);
                this.dl = Math.max(r, this.dl);
                this.dj = Math.max(t, this.dj);
                this.dk = Math.max(s, this.dk);
            }
            var w = new Rect(0, o, p, r, q);
            a.add(w);
            b.add(v);
            var x = r * Math.abs(Math.sin(c));
            this.ao = this.ao || x > k;
        }
        if (this.ad != null && this.ad.bz) {
            var y = -1;
            for (var z = 0; z < this.bb.count; z++) {
                var aa = this.bb._inner[z];
                y = Math.max(aa.ah, y);
            }
            if (y >= 0 && !isNaN_(y)) {
                for (var ab = 0; ab < this.bb.count; ab++) {
                    var ac = this.bb._inner[ab];
                    ac.ah = y;
                }
            }
        }
    };
    HorizontalAxisLabelPanelBase.prototype.dm = function (a) {
        var b = a * (Math.PI / 180);
        var c = Math.abs(this.dk * Math.sin(b)) + Math.abs(this.dj * Math.cos(b));
        c += this.af.r() + this.af.o();
        var d = this.bs();
        this.bh = (c) + (d) + this.ad.d0;
    };
    HorizontalAxisLabelPanelBase.prototype.dp = function (a) {
        this.c9.a2(a);
    };
    HorizontalAxisLabelPanelBase.prototype.dq = function (a, b) {
    };
    HorizontalAxisLabelPanelBase.prototype.dr = function () {
    };
    HorizontalAxisLabelPanelBase.prototype.get_au = function () {
        return true;
    };
    HorizontalAxisLabelPanelBase.prototype.cm = function (a, b) {
        var c = a.l;
        var d = a.m;
        var e = 0;
        var f = c / 2;
        var g = new TransformGroup();
        var h = AngleSimplifier.a(this.bl());
        var i = ((function () {
            var $ret = new RotateTransform();
            $ret.j = h;
            $ret.k = e;
            $ret.l = f;
            return $ret;
        })());
        var j = 0;
        var k = 0;
        if (h != 0 && h != 360) {
            if (h > 0 && h < 180) {
                j = -Math.sin(MathUtil.o(h)) * (c / 2);
            }
            else {
                i.k = d;
                k = -d;
                j = -Math.sin(MathUtil.o(h - 180)) * (c / 2);
            }
        }
        var l = ((function () {
            var $ret = new TranslateTransform();
            $ret.k = j;
            $ret.j = k;
            return $ret;
        })());
        g.j.add(i);
        g.j.add(l);
        a.j = g;
    };
    HorizontalAxisLabelPanelBase.prototype.dd = function () {
        return !this.aw && !this.av;
    };
    HorizontalAxisLabelPanelBase.prototype.da = function () {
        if (this.ad != null && this.ad.bi != null && this.ad.bi.fu) {
            return false;
        }
        return true;
    };
    HorizontalAxisLabelPanelBase.prototype.by = function (a, b, c) {
        var d = 0;
        var e = new List$1(Rect.$, 0);
        var f = this.dh() + this.c1.top;
        var g = this.dg();
        var h = f + g;
        if (a * 3 <= this.bd) {
            d = 3;
        }
        else if (a * 2 <= this.bd) {
            d = 2;
        }
        else {
            return {
                ret: d,
                p1: b
            };
        }
        var i = 0;
        for (var j = 0; j < b.count; j++) {
            var k = RectUtil.p(b._inner[j]);
            if (!c._inner[j]) {
                if (i % d == 0) {
                    k.y = f;
                }
                else if (i % d == d - 1) {
                    k.y = h - k.height;
                }
                else {
                    k.y = (f + (g / 2)) - k.height / 2;
                }
                i++;
            }
            e.add(k);
        }
        this.ao = this.an(e, c);
        if (!this.ao) {
            this.aw = true;
            b = e;
        }
        return {
            ret: d,
            p1: b
        };
    };
    HorizontalAxisLabelPanelBase.prototype.c0 = function () {
        var a = this.aj(this.ad.bf);
        var b = this.bs();
        var c = this.ah;
        var d = 0;
        if (a == 3) {
            d += this.c1.top;
            if (c == 1 || c == 5) {
                d += this.ad.d0;
            }
        }
        else {
            d = this.c1.bottom - b;
            if (c == 4 || c == 0) {
                d -= this.ad.d0;
            }
        }
        var e = this.bu();
        var f = 0;
        var g = this.ad.bf == null ? 1 : this.ad.bf.horizontalAlignment;
        if (g == 0) {
            f = this.c1.left;
        }
        else if (g == 2) {
            f = this.c1.right - e;
        }
        else {
            f = (this.c1.left + (this.c1.width / 2)) - (e / 2);
        }
        return new Rect(0, f, d, e, b);
    };
    HorizontalAxisLabelPanelBase.prototype.dh = function () {
        var a = 0;
        var b = this.aj(this.ad.bf);
        if (b == 3) {
            a += this.bs();
        }
        var c = this.ah;
        if (c == 1 || c == 5) {
            a += this.ad.d0;
        }
        return a;
    };
    HorizontalAxisLabelPanelBase.prototype.de = function () {
        var a = 0;
        var b = this.aj(this.ad.bf);
        if (b == 4) {
            a += this.bs();
        }
        var c = this.ah;
        if (c == 0 || c == 4) {
            a += this.ad.d0;
        }
        return a;
    };
    HorizontalAxisLabelPanelBase.prototype.dg = function () {
        var a = (this.bd - this.dh()) - this.de();
        if (a < 0) {
            a = 0;
        }
        return a;
    };
    HorizontalAxisLabelPanelBase.prototype.df = function () {
        var a = ((this.dg() - this.af.r()) - this.af.o());
        if (a < 0) {
            a = 0;
        }
        return a;
    };
    HorizontalAxisLabelPanelBase.prototype.b9 = function () {
        var e_57, _a;
        var a = this.af.au();
        this.ad.hk(a);
        if (this.ag != null && this.ag.visibility != 0) {
            return;
        }
        var b = this.ad.d0;
        if (b == 0) {
            return;
        }
        var c = this.a2();
        if (c == null) {
            return;
        }
        var d = this.c1.top;
        var e;
        var f = this.ah;
        if (f == 0 || f == 4) {
            d = this.c1.bottom;
            e = d - this.ad.d0;
        }
        else {
            e = d + this.ad.d0;
        }
        var g = this.af.b();
        try {
            for (var _b = __values(fromEnum(c)), _c = _b.next(); !_c.done; _c = _b.next()) {
                var h = _c.value;
                this.cs(a, h, d, e, this.c4, g);
            }
        }
        catch (e_57_1) {
            e_57 = { error: e_57_1 };
        }
        finally {
            try {
                if (_c && !_c.done && (_a = _b.return))
                    _a.call(_b);
            }
            finally {
                if (e_57)
                    throw e_57.error;
            }
        }
        if (!this.ab.contains(this.af.aw)) {
            this.ab.add(this.af.aw);
        }
    };
    HorizontalAxisLabelPanelBase.prototype.a6 = function (a) {
        var _this = this;
        if (this.ad.cu || this.ad.cw) {
            var b = this.af.p();
            var c = this.af.r();
            var d = this.af.q();
            var e = this.af.o();
            var f = Math.max(b, Math.max(c, Math.max(d, e)));
            var g_2 = new Thickness(0, f);
            if (this.av) {
                g_2 = new Thickness(0, Math.sqrt((f * f) / 2));
            }
            var h = this.a4(a);
            var i = new List$1(Thickness.$, 0);
            if (h.count < 1) {
                return a;
            }
            h.aa(function (j, k) {
                var l = _this.cy(j, a._inner[j], g_2);
                var m = _this.cy(k, a._inner[k], g_2);
                var n = l.left;
                var o = m.left;
                if (n < o) {
                    return -1;
                }
                if (n > o) {
                    return 1;
                }
                return 0;
            });
            for (var j = 0; j < h.count; j++) {
                var k = h._inner[j];
                var l = a._inner[k];
                var m = this.cy(k, a._inner[k], g_2);
                var n = this.ad.bi.wz.left;
                if (this.ad.cw) {
                    if (l.left < (this.ad.bi.wz.left - n)) {
                        l = new Rect(0, l.left + ((this.ad.bi.wz.left - n) - l.left), l.top, l.width, l.height);
                        a._inner[k] = l;
                    }
                }
            }
            var o = this.as(a, h, g_2);
            if (o && (this.ad.cu)) {
                for (var p = 0; p < h.count - 1; p++) {
                    var q = h._inner[p];
                    var r = h._inner[p + 1];
                    var s = a._inner[q];
                    var t = a._inner[r];
                    var u = this.cy(q, a._inner[q], g_2);
                    var v = this.cy(r, a._inner[r], g_2);
                    if (u.intersectsWith(v) || u.left > v.right) {
                        var w = new Rect(0, u.right + 1 + (t.left - v.left), t.top, t.width, t.height);
                        a._inner[r] = w;
                    }
                }
            }
            for (var x = h.count - 1; x >= 0; x--) {
                var y = h._inner[x];
                var z = a._inner[y];
                var aa = this.cy(y, a._inner[y], g_2);
                var ab = this.ad.bi.c9.a5;
                if (this.ad.cw) {
                    if (aa.right > this.ad.bi.wz.right + ab) {
                        z = new Rect(0, z.left - (aa.right - (this.ad.bi.wz.right + ab)), z.top, z.width, z.height);
                        a._inner[y] = z;
                    }
                }
            }
            if (this.ad.cu) {
                for (var ac = h.count - 1; ac >= 1; ac--) {
                    var ad = h._inner[ac];
                    var ae = h._inner[ac - 1];
                    var af = a._inner[ad];
                    var ag = a._inner[ae];
                    var ah = this.cy(ad, a._inner[ad], g_2);
                    var ai = this.cy(ae, a._inner[ae], g_2);
                    if (ah.intersectsWith(ai) || ah.left < ai.right) {
                        var aj = new Rect(0, ah.left - (ai.width + 1) + (ag.left - ai.left), ag.top, ag.width, ag.height);
                        a._inner[ae] = aj;
                    }
                }
            }
            return a;
        }
        else {
            return a;
        }
    };
    HorizontalAxisLabelPanelBase.$t = markType(HorizontalAxisLabelPanelBase, 'HorizontalAxisLabelPanelBase', AxisLabelPanelBase.$);
    return HorizontalAxisLabelPanelBase;
}(AxisLabelPanelBase));
export { HorizontalAxisLabelPanelBase };
/**
 * @hidden
 */
var HorizontalAxisLabelPanel = /** @class */ /*@__PURE__*/ (function (_super) {
    __extends(HorizontalAxisLabelPanel, _super);
    function HorizontalAxisLabelPanel() {
        return _super !== null && _super.apply(this, arguments) || this;
    }
    HorizontalAxisLabelPanel.prototype.ai = function () {
        return 1;
    };
    HorizontalAxisLabelPanel.prototype.ay = function (a) {
        return a == 5 || a == 4 || a == 1 || a == 0;
    };
    HorizontalAxisLabelPanel.$t = markType(HorizontalAxisLabelPanel, 'HorizontalAxisLabelPanel', HorizontalAxisLabelPanelBase.$);
    return HorizontalAxisLabelPanel;
}(HorizontalAxisLabelPanelBase));
export { HorizontalAxisLabelPanel };
/**
 * @hidden
 */
var NumericAxisBase = /** @class */ /*@__PURE__*/ (function (_super) {
    __extends(NumericAxisBase, _super);
    function NumericAxisBase() {
        var _this = _super.call(this) || this;
        _this.kw = 0;
        _this.lw = 0;
        _this.ma = 0;
        _this.lz = 0;
        _this.lv = 0;
        _this.l9 = 0;
        _this.ly = 0;
        _this.lu = 0;
        _this.mh = -1;
        _this.mg = 0;
        _this.mi = -1;
        _this.le = false;
        _this.lx = 0;
        _this.lc = false;
        _this.ld = false;
        _this.mn = 0;
        _this.k4 = null;
        _this.lq = false;
        _this.lr = false;
        _this.ks = null;
        _this.ku = null;
        _this.l1 = -1;
        _this.l0 = -1;
        _this.kx = 0;
        _this.ln = false;
        _this.k8 = null;
        _this.lb = false;
        _this.mn = 10;
        return _this;
    }
    NumericAxisBase.prototype.a4 = function () {
        return new NumericAxisBaseView(this);
    };
    NumericAxisBase.prototype.ag = function () {
        return [this.l4, this.l3];
    };
    NumericAxisBase.prototype.hv = function (a) {
        _super.prototype.hv.call(this, a);
        this.k1 = a;
    };
    NumericAxisBase.prototype.d2 = function (a, b) {
        var c = a < this.l4 ? this.l4 : a;
        c = a > this.l3 ? this.l3 : c;
        return c;
    };
    NumericAxisBase.prototype.get_cj = function () {
        return true;
    };
    Object.defineProperty(NumericAxisBase.prototype, "ky", {
        get: function () {
            return EnumUtil.getEnumValue(AxisRangeBufferMode_$type, this.c(NumericAxisBase.nw));
        },
        set: function (a) {
            this.h(NumericAxisBase.nw, enumGetBox(AxisRangeBufferMode_$type, a));
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(NumericAxisBase.prototype, "kz", {
        get: function () {
            return this.kw;
        },
        set: function (a) {
            this.kw = a;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(NumericAxisBase.prototype, "l4", {
        get: function () {
            return this.lw;
        },
        set: function (a) {
            if (this.l4 != a) {
                var b = this.lw;
                this.lw = a;
                this.ma = Math.log(this.l4);
                this.h5("ActualMinimumValue", b, this.l4);
            }
        },
        enumerable: false,
        configurable: true
    });
    NumericAxisBase.prototype.f4 = function () {
        return this.mc;
    };
    Object.defineProperty(NumericAxisBase.prototype, "l7", {
        get: function () {
            return this.lz;
        },
        set: function (a) {
            if (this.l7 != a) {
                var b = this.lz;
                this.lz = a;
                this.h5("ActualVisibleMinimumValue", b, this.l7);
            }
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(NumericAxisBase.prototype, "l3", {
        get: function () {
            return this.lv;
        },
        set: function (a) {
            if (this.l3 != a) {
                var b = this.lv;
                this.lv = a;
                this.l9 = Math.log(this.l3);
                this.h5("ActualMaximumValue", b, this.l3);
            }
        },
        enumerable: false,
        configurable: true
    });
    NumericAxisBase.prototype.f3 = function () {
        return this.l3;
    };
    Object.defineProperty(NumericAxisBase.prototype, "l6", {
        get: function () {
            return this.ly;
        },
        set: function (a) {
            if (this.l6 != a) {
                var b = this.ly;
                this.ly = a;
                this.h5("ActualVisibleMaximumValue", b, this.l6);
            }
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(NumericAxisBase.prototype, "l2", {
        get: function () {
            return this.lu;
        },
        set: function (a) {
            if (this.l2 != a) {
                var b = this.lu;
                this.lu = a;
                this.h5("ActualInterval", b, this.l2);
            }
        },
        enumerable: false,
        configurable: true
    });
    NumericAxisBase.prototype.ex = function () {
        return this.l2;
    };
    Object.defineProperty(NumericAxisBase.prototype, "mk", {
        get: function () {
            return this.mh;
        },
        set: function (a) {
            this.mh = a;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(NumericAxisBase.prototype, "mj", {
        get: function () {
            return this.mg;
        },
        set: function (a) {
            if (this.mj != a) {
                var b = this.mg;
                this.mg = a;
                this.h5("ActualMaxPrecision", b, this.mj);
            }
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(NumericAxisBase.prototype, "ml", {
        get: function () {
            return this.mi;
        },
        set: function (a) {
            this.mi = a;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(NumericAxisBase.prototype, "li", {
        get: function () {
            return this.le;
        },
        set: function (a) {
            this.le = a;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(NumericAxisBase.prototype, "l5", {
        get: function () {
            return this.lx;
        },
        set: function (a) {
            if (this.l5 != a) {
                var b = this.lx;
                this.lx = a;
                this.h5("ActualMinorInterval", b, this.l5);
            }
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(NumericAxisBase.prototype, "lg", {
        get: function () {
            return this.lc;
        },
        set: function (a) {
            if (this.lg != a) {
                var b = this.lc;
                if (b != a) {
                    this.lc = a;
                    this.h5("ActualIsLogarithmic", b, this.lg);
                }
            }
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(NumericAxisBase.prototype, "lh", {
        get: function () {
            return this.ld;
        },
        set: function (a) {
            this.ld = a;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(NumericAxisBase.prototype, "lp", {
        get: function () {
            return this.lg && this.l4 > 0 && this.mn > 1;
        },
        enumerable: false,
        configurable: true
    });
    NumericAxisBase.prototype.ic = function (a) {
        _super.prototype.ic.call(this, a);
        if (this.lp && this.bi != null) {
            var b = this.kc();
            var c = this.kb();
            var d = this.k5(this.kh, this.bi.wh, b, c);
            if (d == null) {
                return;
            }
            var _loop_4 = function (e) {
                var f = this_2.mm;
                var g = d.k._inner[e];
                var h = Math.min(g.d, g.c);
                var i = Math.max(g.d, g.c);
                var j = Math.floor(logBase(h, f));
                var k = Math.ceil(logBase(i, f));
                if (k - j < 2) {
                    if (typeCast(LogarithmicTickmarkValues.$, this_2.k8) !== null) {
                        this_2.k8 = new LinearTickmarkValues();
                    }
                }
                else {
                    this_2.k8 = this_2.la != null ? this_2.la : ((function () {
                        var $ret = new LogarithmicTickmarkValues();
                        $ret.x = f;
                        return $ret;
                    })());
                }
            };
            var this_2 = this;
            for (var e = 0; e < d.k.count; e++) {
                _loop_4(e);
            }
        }
    };
    NumericAxisBase.prototype.it = function (a, b) {
        _super.prototype.it.call(this, a, b);
        if (this.mo != -1) {
            this.mj = this.mp();
        }
        else {
            if (this.mj != -1) {
                this.mj = -1;
            }
        }
    };
    NumericAxisBase.prototype.h4 = function (a) {
        _super.prototype.h4.call(this, a);
        this.mc = a;
    };
    NumericAxisBase.prototype.h3 = function (a) {
        _super.prototype.h4.call(this, a);
        this.mb = a;
    };
    NumericAxisBase.prototype.hz = function (a, b, c, d) {
        _super.prototype.hz.call(this, a, b, c, d);
        switch (b) {
            case "SeriesViewer":
                this.mj = this.mp();
                break;
            case NumericAxisBase.$$p[12]:
                this.li = this.ls;
                this.mj = this.mp();
                break;
            case NumericAxisBase.$$p[7]:
                this.ml = this.mo;
                this.mj = this.mp();
                break;
            case "ActualMaxPrecision":
                this.mk = this.mj;
                this.c1();
                this.ib(false);
                break;
            case NumericAxisBase.$$p[0]:
            case NumericAxisBase.$$p[1]:
                if (this.mq != null) {
                    this.ks = new BindingFormatter();
                    this.ks.j = this.mq;
                    this.ks.d = this.kr;
                }
                else {
                    this.ks = null;
                }
                break;
            case "AutoRangeBufferMode":
                this.kz = this.ky;
                this.hl();
                this.c1();
                this.ib(false);
                break;
            case NumericAxisBase.$$p[9]:
                this.c1();
                this.ib(false);
                break;
            case NumericAxisBase.$$p[8]:
                this.c1();
                this.ib(false);
                break;
            case NumericAxisBase.$$p[2]:
                this.lh = this.lj;
                this.c1();
                this.ib(false);
                break;
            case NumericAxisBase.$$p[5]:
                this.lq = true;
                this.lg = this.lo;
                break;
            case Axis.$$p[4]:
            case Axis.$$p[3]:
            case NumericAxisBase.$$p[4]:
            case NumericAxisBase.$$p[10]:
                this.cq = true;
                this.ib(false);
                break;
            case NumericAxisBase.$$p[6]:
                this.lq = true;
                this.mn = this.mm;
                if (this.lg) {
                    this.c1();
                    this.ni();
                    this.ib(false);
                }
                break;
            case NumericAxisBase.$$p[11]:
                var e = new AxisRangeChangedEventArgs(0, this.l4, this.l4, this.l3, this.l3);
                this.h6(e);
                this.cq = true;
                this.ib(false);
                break;
            case Axis.$$p[13]:
                this.k4 = this.k2();
                this.cq = true;
                this.ib(false);
                break;
            case "TickmarkValues":
                this.nk();
                break;
            case "ActualIsLogarithmic":
                this.c1();
                this.ni();
                this.cq = true;
                this.nk();
                this.ib(false);
                break;
            case "ActualTickmarkValues":
                this.cq = true;
                this.ib(false);
                break;
            case "AbbreviateLargeNumbers":
                this.ib(false);
                break;
        }
    };
    NumericAxisBase.prototype.ni = function () {
        var e_58, _a;
        try {
            for (var _b = __values(fromEnum(this.db())), _c = _b.next(); !_c.done; _c = _b.next()) {
                var a = _c.value;
                a.ru(false);
            }
        }
        catch (e_58_1) {
            e_58 = { error: e_58_1 };
        }
        finally {
            try {
                if (_c && !_c.done && (_a = _b.return))
                    _a.call(_b);
            }
            finally {
                if (e_58)
                    throw e_58.error;
            }
        }
    };
    NumericAxisBase.prototype.kv = function () {
        var e_59, _a;
        var a = new AxisRange(Number.POSITIVE_INFINITY, Number.NEGATIVE_INFINITY);
        var b = false;
        if (this.bi != null) {
            try {
                for (var _b = __values(fromEnum(this.db())), _c = _b.next(); !_c.done; _c = _b.next()) {
                    var c = _c.value;
                    var d = c.ay(this);
                    if (d != null) {
                        b = true;
                        a = new AxisRange(Math.min(a.c, d.c), Math.max(a.b, d.b));
                    }
                }
            }
            catch (e_59_1) {
                e_59 = { error: e_59_1 };
            }
            finally {
                try {
                    if (_c && !_c.done && (_a = _b.return))
                        _a.call(_b);
                }
                finally {
                    if (e_59)
                        throw e_59.error;
                }
            }
        }
        if (b) {
            if (this.l1 >= 0) {
                a = new AxisRange(a.c - this.l1, a.b);
            }
            if (this.l0 >= 0) {
                a = new AxisRange(a.c, a.b + this.l0);
            }
            this.ku = a;
            return a;
        }
        this.ku = null;
        return null;
    };
    NumericAxisBase.prototype.lt = function (a) {
        var e_60, _a;
        if (a == 1 || a == 2 || a == 3) {
            var b = this.ku;
            if (b == null) {
                b = this.kv();
            }
            if (b == null) {
                return false;
            }
            if (this.bi == null || this.bi.wz.isEmpty || this.bi.wz.height == 0 || this.bi.wz.width == 0) {
                return false;
            }
            var c = -1;
            var d = -1;
            try {
                for (var _b = __values(fromEnum(this.dc())), _c = _b.next(); !_c.done; _c = _b.next()) {
                    var e = _c.value;
                    var f = e.ax(b, this, new Rect(0, 0, 0, 1, 1));
                    if (f.c != b.c) {
                        if (a == 1 || a == 2) {
                            c = Math.max(c, b.c - f.c);
                        }
                    }
                    if (f.b != b.b) {
                        if (a == 1 || a == 3) {
                            d = Math.max(d, f.b - b.b);
                        }
                    }
                }
            }
            catch (e_60_1) {
                e_60 = { error: e_60_1 };
            }
            finally {
                try {
                    if (_c && !_c.done && (_a = _b.return))
                        _a.call(_b);
                }
                finally {
                    if (e_60)
                        throw e_60.error;
                }
            }
            if (c >= 0 || d >= 0) {
                this.l1 = c;
                this.l0 = d;
                return true;
            }
            return false;
        }
        return false;
    };
    NumericAxisBase.prototype.k0 = function () {
        if (this.kz == 0) {
            if (this.bi != null) {
                if (this.cp) {
                    if (this.bi.b2 == 2) {
                        return 1;
                    }
                    if (this.ci) {
                        if (this.bi.b2 == 4) {
                            return 3;
                        }
                        if (this.bi.b2 == 3) {
                            return 2;
                        }
                    }
                    else {
                        if (this.bi.b2 == 4) {
                            return 2;
                        }
                        if (this.bi.b2 == 3) {
                            return 3;
                        }
                    }
                }
                else {
                    if (this.bi.b0 == 2) {
                        return 1;
                    }
                    if (this.ci) {
                        if (this.bi.b0 == 4) {
                            return 3;
                        }
                        if (this.bi.b0 == 3) {
                            return 2;
                        }
                    }
                    else {
                        if (this.bi.b0 == 4) {
                            return 2;
                        }
                        if (this.bi.b0 == 3) {
                            return 3;
                        }
                    }
                }
            }
            return 4;
        }
        else {
            return this.kz;
        }
    };
    NumericAxisBase.prototype.ng = function (a, b, c, d, e, f, g) {
        var h = AutoRangeCalculator.a(a, b, c, d, e, f, g);
        f = h.p5;
        g = h.p6;
        return {
            p5: f,
            p6: g
        };
    };
    NumericAxisBase.prototype.c3 = function () {
        if (this.cq && this.c4) {
            this.bc = this.bb();
        }
        var a = this.lg && !isNaN_(this.mm) && !isInfinity(this.mm) && this.mm > 1;
        var b;
        var c;
        var d = this.k0();
        if (d != this.kx) {
            this.kx = d;
            this.hl();
        }
        var e = false;
        if (!this.kh.isEmpty && d != 4) {
            if (this.l1 == -1 && this.l0 == -1) {
                e = true;
            }
        }
        var f = this.ng(this, this.mc, this.mb, a, this.mm, b, c);
        b = f.p5;
        c = f.p6;
        if (b != this.l4 || c != this.l3 || this.lq) {
            if (d != 4 && (this.l1 >= 0 || this.l0 >= 0)) {
                this.hl();
                var g = this.ng(this, this.mc, this.mb, a, this.mm, b, c);
                b = g.p5;
                c = g.p6;
            }
        }
        if (b != this.l4 || c != this.l3 || this.lq || e) {
            this.lq = false;
            var h = new AxisRangeChangedEventArgs(0, this.l4, b, this.l3, c);
            this.l4 = b;
            this.l3 = c;
            if (!this.kh.isEmpty && d != 4) {
                if (this.lt(d)) {
                    var i = this.ng(this, this.mc, this.mb, a, this.mm, b, c);
                    b = i.p5;
                    c = i.p6;
                    h = new AxisRangeChangedEventArgs(0, h.oldMinimumValue, b, h.oldMaximumValue, c);
                    this.l4 = b;
                    this.l3 = c;
                }
            }
            this.h6(h);
            this.nj(h);
            this.ib(true);
            return true;
        }
        return false;
    };
    NumericAxisBase.prototype.hl = function () {
        this.l1 = -1;
        this.l0 = -1;
    };
    NumericAxisBase.prototype.nj = function (a) {
    };
    NumericAxisBase.prototype.ct = function (a) {
        var b = _super.prototype.ct.call(this, a);
        if (b) {
            this.c1();
        }
        return b;
    };
    NumericAxisBase.prototype.b0 = function (a) {
        var b = _super.prototype.b0.call(this, a);
        if (b) {
            this.c1();
        }
        return b;
    };
    NumericAxisBase.prototype.k3 = function (a) {
        return new NumericAxisRenderer(a);
    };
    NumericAxisBase.prototype.k2 = function () {
        var _this = this;
        var a = ((function () {
            var $ret = new AxisLabelManager();
            $ret.a = _this;
            $ret.f = _this.de;
            $ret.e = _this.dd;
            $ret.b = _this.aw;
            return $ret;
        })());
        if (this.az != null) {
            this.az.registerAxis(this);
        }
        var b = this.k3(a);
        b.u = function () {
            var c = _this.a5.a4();
            var d = _this.a5.a7();
            var e = _this.a5.a5();
            var f = _this.a5.a6();
            _this.ip();
            _this.hk(c);
            _this.hk(d);
            _this.hk(e);
            _this.hk(f);
        };
        b.o = function (c, d) { return !d.isEmpty && !c.isEmpty; };
        b.d = function (c, d, e, f) { return _this.k5(c, d, e, f); };
        b.g = function (c, d) {
            _this.ln = d;
            var e = _this.f1(c);
            _this.ln = false;
            return e;
        };
        return b;
    };
    NumericAxisBase.prototype.k6 = function () {
        return new NumericAxisRenderingParameters();
    };
    NumericAxisBase.prototype.nh = function () {
    };
    NumericAxisBase.prototype.k7 = function () {
        return null;
    };
    NumericAxisBase.prototype.mp = function () {
        if (!this.li && (this.ka.isEmpty || this.ka.width < 1 || this.ka.height < 1)) {
            return -1;
        }
        return this.ml;
    };
    NumericAxisBase.prototype.k5 = function (a, b, c, d) {
        var e = this.k6();
        var f = this.a5.a4();
        var g = this.a5.a7();
        var h = this.a5.a5();
        var i = this.a5.a6();
        var j = this.a5.e();
        var k = this.a5.f();
        var l = this.a5.g();
        e.u = f;
        e.x = g;
        e.v = h;
        e.w = i;
        e.a = j;
        e.c = k;
        e.d = l;
        e.l = this.l3;
        e.m = this.l4;
        e.h = this.ll;
        e.f = this.k9;
        e.aa = a;
        e.z = c;
        e.y = d;
        e.ab = b;
        e.o = this.e0();
        e.s = this.mk;
        e.g = this.lk();
        e.p = this.l8;
        e.q = this.md;
        e.t = this.f2;
        if (this.f2 == null && (this.au != null || this.ai != null || this.k1.m())) {
            e.t = "Format";
        }
        e.j = this.cy;
        e.ac = this.lf;
        return e;
    };
    NumericAxisBase.prototype.mf = function (a) {
        var b = this.kc();
        var c = new ScalerParams(0, this.bi.wh, this.kh, this.ch, b);
        return this.eo(a, c);
    };
    NumericAxisBase.prototype.lk = function () {
        return !isNaN_(this.l8);
    };
    Object.defineProperty(NumericAxisBase.prototype, "lm", {
        get: function () {
            return !isNaN_(this.mc);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(NumericAxisBase.prototype, "ll", {
        get: function () {
            return !isNaN_(this.mb);
        },
        enumerable: false,
        configurable: true
    });
    NumericAxisBase.prototype.nk = function () {
        if (this.la != null) {
            this.k9 = this.la;
        }
        else if (this.lg) {
            this.k9 = new LogarithmicTickmarkValues();
            this.k1.bl();
        }
        else {
            this.k9 = new LinearTickmarkValues();
        }
    };
    Object.defineProperty(NumericAxisBase.prototype, "la", {
        get: function () {
            return typeCast(TickmarkValues.$, this.c(NumericAxisBase.nz));
        },
        set: function (a) {
            this.h(NumericAxisBase.nz, a);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(NumericAxisBase.prototype, "k9", {
        get: function () {
            if (this.k8 == null) {
                this.nk();
            }
            return this.k8;
        },
        set: function (a) {
            var b = this.k8;
            var c = b != a;
            if (c) {
                this.k8 = a;
                this.h5("ActualTickmarkValues", b, a);
            }
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(NumericAxisBase.prototype, "lf", {
        get: function () {
            return this.lb;
        },
        set: function (a) {
            var b = this.lf;
            if (a != b) {
                this.lb = a;
                this.h5("AbbreviateLargeNumbers", b, this.lf);
            }
        },
        enumerable: false,
        configurable: true
    });
    NumericAxisBase.$t = markType(NumericAxisBase, 'NumericAxisBase', Axis.$);
    NumericAxisBase.nw = DependencyProperty.i("AutoRangeBufferMode", AxisRangeBufferMode_$type, NumericAxisBase.$, new PropertyMetadata(2, enumGetBox(AxisRangeBufferMode_$type, 0), function (a, b) { return a.h5("AutoRangeBufferMode", b.oldValue, b.newValue); }));
    NumericAxisBase.nz = DependencyProperty.i("TickmarkValues", TickmarkValues.$, NumericAxisBase.$, new PropertyMetadata(1, function (a, b) { return a.h5("TickmarkValues", b.oldValue, b.newValue); }));
    NumericAxisBase.$$p = markDep(DependencyProperty, PropertyMetadata, NumericAxisBase, 'h5', ['AbbreviatedLabelFormat:mq:nl', [2, null], 'AbbreviatedLabelFormatSpecifiers:kr:nm', [Array_$type, null], 'FavorLabellingScaleEnd:lj:nn', [0, false], 'FormatAbbreviatedLabel:kt:no', [Delegate_$type], 'Interval:l8:np', [1, NaN], 'IsLogarithmic:lo:nq', [0, false], 'LogarithmBase:mm:nr', [1, 10], 'MaxPrecision:mo:nt', [1, -1], 'MaximumValue:mb:ns', [1, NaN], 'MinimumValue:mc:nu', [1, NaN], 'MinorInterval:md:nv', [1, NaN], 'ReferenceValue:me:nx', [1, 0], 'ShouldApplyMaxPrecisionWhenZoomed:ls:ny', [0, false]]);
    return NumericAxisBase;
}(Axis));
export { NumericAxisBase };
/**
 * @hidden
 */
var NumericScaler = /** @class */ /*@__PURE__*/ (function (_super) {
    __extends(NumericScaler, _super);
    function NumericScaler() {
        var _this = _super !== null && _super.apply(this, arguments) || this;
        _this.o = 0;
        _this.n = 0;
        _this.m = 0;
        return _this;
    }
    NumericScaler.prototype.y = function (a) {
        this.l = a;
    };
    NumericScaler.prototype.x = function (a) {
        this.k = a;
    };
    NumericScaler.prototype.w = function (a, b, c) {
        switch (a) {
            case NumericScaler.$$p[1]:
                this.o = this.l;
                this.z();
                break;
            case NumericScaler.$$p[0]:
                this.n = this.k;
                this.z();
                break;
        }
    };
    NumericScaler.prototype.z = function () {
        if (isNaN_(this.l) || isNaN_(this.k) || isInfinity(this.l) || isInfinity(this.k) || this.l < (-7.9228162514264338E+28) || this.k > (7.9228162514264338E+28)) {
            this.m = this.k - this.l;
        }
        else {
            this.m = this.k - this.l;
        }
    };
    NumericScaler.prototype.j = function (a, b, c, d) {
        var e = new List$1(Number_$type, 2, a.count);
        for (var f = b; f < c; f++) {
            e.add(this.q(a.item(f), d));
        }
        return e;
    };
    NumericScaler.prototype.v = function (a, b, c, d) {
        for (var e = b; e < c; e++) {
            a.item(e, this.p(a.item(e), d));
        }
    };
    NumericScaler.prototype.u = function (a, b, c, d, e) {
        for (var f = 0; f < b.count; f++) {
            var g = b.item(f);
            for (var h = c; h < d; h++) {
                a.item(h)[g] = this.p(a.item(h)[g], e);
            }
        }
    };
    NumericScaler.$t = markType(NumericScaler, 'NumericScaler', DependencyObject.$);
    NumericScaler.ac = new Rect(0, 0, 0, 1, 1);
    NumericScaler.$$p = markDep(DependencyProperty, PropertyMetadata, NumericScaler, 'w', ['ActualMaximumValue:k:aa', [1, NaN], 'ActualMinimumValue:l:ab', [1, NaN]]);
    return NumericScaler;
}(DependencyObject));
export { NumericScaler };
/**
 * @hidden
 */
var AxisRendererBase = /** @class */ /*@__PURE__*/ (function (_super) {
    __extends(AxisRendererBase, _super);
    function AxisRendererBase(a) {
        var _this = _super.call(this) || this;
        _this.u = null;
        _this.o = null;
        _this.v = null;
        _this.m = null;
        _this.l = null;
        _this.k = null;
        _this.q = null;
        _this.n = null;
        _this.j = null;
        _this.e = null;
        _this.p = null;
        _this.h = null;
        _this.t = null;
        _this.b = null;
        _this.g = null;
        _this.d = null;
        _this.r = null;
        _this.a = null;
        _this.f = null;
        _this.i = null;
        _this.u = function () {
        };
        _this.o = function (b, c) { return false; };
        _this.v = function () {
        };
        _this.m = function (b, c) { return c; };
        _this.l = function (b, c, d, e) {
        };
        _this.k = function (b, c, d) {
        };
        _this.q = function (b, c) { return false; };
        _this.n = function (b, c) { return _this.q(b, c); };
        _this.j = function (b) {
        };
        _this.e = function (b) {
        };
        _this.p = function (b, c, d) { return false; };
        _this.h = function (b, c) { return new LabelPosition(c); };
        _this.t = function (b, c) { return c; };
        _this.g = function (b, c) { return null; };
        _this.r = function (b, c, d, e) { return c; };
        _this.a = function (b, c, d, e) { return c; };
        _this.b = a;
        _this.d = function (b, c, d, e) { return null; };
        return _this;
    }
    AxisRendererBase.prototype.c = function (a, b, c, d, e) {
        var e_61, _a;
        this.x(c, b);
        if (this.o(b, c)) {
            this.v();
            var f_1 = this.d(b, c, d, e);
            this.x(c, b);
            if (f_1 == null) {
                this.aa();
                return null;
            }
            if (f_1.k.count > 1 && !f_1.g) {
                this.ab(f_1);
            }
            var _loop_5 = function (g) {
                f_1.e = g;
                if (isNaN_(g.c) || isInfinity(g.c) || isNaN_(g.d) || isInfinity(g.d)) {
                    return "continue";
                }
                if (g.d == g.c) {
                    return "continue";
                }
                this_3.e(f_1);
                this_3.b.o(f_1.r);
                var h = 0;
                var i = 0;
                var j = false;
                var k = function (l) { return l; };
                if (this_3.f != null) {
                    k = this_3.i;
                }
                if (typeCast(CategoryAxisRenderingParameters.$, f_1) !== null) {
                    h = f_1.ac;
                    i = f_1.ag;
                    j = f_1.ad;
                }
                f_1.f = this_3.s(f_1);
                f_1.f.s(((function () {
                    var $ret = new TickmarkValuesInitializationParameters();
                    $ret.n = f_1.e.d;
                    $ret.m = f_1.e.c;
                    $ret.g = f_1.m;
                    $ret.f = f_1.l;
                    $ret.k = f_1.e.b;
                    $ret.d = f_1.g;
                    $ret.l = f_1.p;
                    $ret.j = f_1.q;
                    $ret.h = f_1.o;
                    $ret.i = f_1.e.a;
                    $ret.q = f_1.e.e;
                    $ret.a = h;
                    $ret.r = i;
                    $ret.t = f_1.ab;
                    $ret.s = f_1.aa;
                    $ret.e = j;
                    $ret.c = k;
                    $ret.p = f_1.s;
                    return $ret;
                })()));
                this_3.y(f_1);
            };
            var this_3 = this;
            try {
                for (var _b = __values(fromEnum(f_1.k)), _c = _b.next(); !_c.done; _c = _b.next()) {
                    var g = _c.value;
                    _loop_5(g);
                }
            }
            catch (e_61_1) {
                e_61 = { error: e_61_1 };
            }
            finally {
                try {
                    if (_c && !_c.done && (_a = _b.return))
                        _a.call(_b);
                }
                finally {
                    if (e_61)
                        throw e_61.error;
                }
            }
            this.z();
            return f_1;
        }
        return null;
    };
    AxisRendererBase.prototype.aa = function () {
        this.b.q();
    };
    AxisRendererBase.prototype.ab = function (a) {
        var e_62, _a, e_63, _b;
        var b = -1.7976931348623157E+308;
        var c = -2147483648;
        var d = 0;
        var e = 0;
        var f = false;
        var g = function (h) { return h; };
        if (this.f != null) {
            g = this.i;
        }
        if (typeCast(CategoryAxisRenderingParameters.$, a) !== null) {
            d = a.ac;
            e = a.ag;
            f = a.ad;
        }
        var _loop_6 = function (h) {
            a.e = h;
            a.f.s(((function () {
                var $ret = new TickmarkValuesInitializationParameters();
                $ret.n = h.d;
                $ret.m = h.c;
                $ret.g = a.m;
                $ret.f = a.l;
                $ret.k = h.b;
                $ret.d = a.g;
                $ret.l = a.p;
                $ret.i = h.a;
                $ret.q = h.e;
                $ret.h = a.o;
                $ret.j = a.q;
                $ret.a = d;
                $ret.r = e;
                $ret.t = a.ab;
                $ret.s = a.aa;
                $ret.e = f;
                $ret.c = g;
                $ret.p = a.s;
                return $ret;
            })()));
            h.a = a.f.m;
            h.e = a.f.r;
            if (!isNaN_(a.f.m)) {
                b = Math.max(b, a.f.m);
                c = Math.max(c, a.f.r);
            }
        };
        try {
            for (var _c = __values(fromEnum(a.k)), _d = _c.next(); !_d.done; _d = _c.next()) {
                var h = _d.value;
                _loop_6(h);
            }
        }
        catch (e_62_1) {
            e_62 = { error: e_62_1 };
        }
        finally {
            try {
                if (_d && !_d.done && (_a = _c.return))
                    _a.call(_c);
            }
            finally {
                if (e_62)
                    throw e_62.error;
            }
        }
        try {
            for (var _e = __values(fromEnum(a.k)), _f = _e.next(); !_f.done; _f = _e.next()) {
                var i = _f.value;
                if (i.a == b) {
                    i.a = -1;
                    i.e = -1;
                }
                else {
                    i.a = b;
                    i.e = c;
                }
            }
        }
        catch (e_63_1) {
            e_63 = { error: e_63_1 };
        }
        finally {
            try {
                if (_f && !_f.done && (_b = _e.return))
                    _b.call(_e);
            }
            finally {
                if (e_63)
                    throw e_63.error;
            }
        }
    };
    AxisRendererBase.prototype.x = function (a, b) {
        this.u();
        this.b.n(a, b);
        this.b.t();
    };
    AxisRendererBase.prototype.z = function () {
        var e_64, _a;
        this.b.t();
        var a = false;
        if (this.b.d) {
            this.b.s(0);
        }
        else {
            var b = 0;
            try {
                for (var _b = __values(fromEnum(this.b.e)), _c = _b.next(); !_c.done; _c = _b.next()) {
                    var c = _c.value;
                    var d = typeCast(FrameworkElement.$, c);
                    if (d == null) {
                        d = this.b.u(b);
                        var e = d.al;
                        var f = c.toString();
                        var g = 0;
                        var h = 0;
                        if (e != null) {
                            g = e.length;
                        }
                        if (f != null) {
                            h = f.length;
                        }
                        if (g != h) {
                            a = true;
                        }
                        d.al = f;
                        b++;
                    }
                    else {
                    }
                }
            }
            catch (e_64_1) {
                e_64 = { error: e_64_1 };
            }
            finally {
                try {
                    if (_c && !_c.done && (_a = _b.return))
                        _a.call(_b);
                }
                finally {
                    if (e_64)
                        throw e_64.error;
                }
            }
            if (a) {
                this.b.p();
            }
            this.b.g();
            this.b.s(b);
        }
    };
    AxisRendererBase.prototype.s = function (a) {
        return a.f;
    };
    AxisRendererBase.prototype.y = function (a) {
        var b = a.f.j();
        var c = a.f.k();
        this.b.r(this.m(a, a.f.m));
        this.j(a);
        for (var d = 0; d < b.length; d++) {
            var e = a.f.p + d;
            var f = b[d];
            var g = f;
            var h = 0;
            if (d < b.length - 1) {
                h = b[d + 1];
            }
            else {
                h = Number.POSITIVE_INFINITY;
            }
            g = this.r(a, g, e, a.f.m);
            h = this.r(a, h, e, a.f.m);
            var i = this.m(a, g);
            var j = this.m(a, h);
            if (this.q(a, i)) {
                if (e % 2 == 0 && this.n(a, j) && !isInfinity(j)) {
                    this.l(a, a.x, i, j);
                }
                a.b = a.c;
                this.k(a, a.v, i);
                a.b = null;
            }
            i = this.a(a, i, e, a.f.m);
            if (!isNaN_(i) && !isInfinity(i) && this.p(a, i, d == b.length - 1)) {
                var k = this.w(a, g, e, a.f.m);
                if (k != null) {
                    this.b.i(k, this.h(a, i));
                }
            }
        }
        if (a.j) {
            for (var l = 0; l < c.length; l++) {
                var m = c[l];
                var n = this.m(a, m);
                a.b = a.d;
                this.k(a, a.w, n);
                a.b = null;
            }
        }
    };
    AxisRendererBase.prototype.w = function (a, b, c, d) {
        return null;
    };
    AxisRendererBase.$t = markType(AxisRendererBase, 'AxisRendererBase');
    return AxisRendererBase;
}(Base));
export { AxisRendererBase };
/**
 * @hidden
 */
var NumericAxisRenderer = /** @class */ /*@__PURE__*/ (function (_super) {
    __extends(NumericAxisRenderer, _super);
    function NumericAxisRenderer(a) {
        var _this = _super.call(this, a) || this;
        _this.ac = null;
        _this.ad = false;
        return _this;
    }
    NumericAxisRenderer.prototype.w = function (a, b, c, d) {
        var e;
        if (a.t != null) {
            if (a.i() && a.ac) {
                return this.ae(b, this.g);
            }
            e = this.g(b, false);
        }
        else {
            b = Math.round(b * 1000000) / 1000000;
            if (a.i() && a.ac) {
                return this.ae(b, null);
            }
            e = MathUtil.s(b);
        }
        return e;
    };
    NumericAxisRenderer.prototype.ae = function (a, b) {
        if (this.ad) {
            return a.toString();
        }
        if (this.ac == null) {
            this.ac = NumberAbbreviatorFactory.a(this.b.a.bu);
            if (this.ac == null) {
                this.ad = true;
                return a.toString();
            }
        }
        return this.ac.abbreviate(a, b);
    };
    NumericAxisRenderer.$t = markType(NumericAxisRenderer, 'NumericAxisRenderer', AxisRendererBase.$);
    return NumericAxisRenderer;
}(AxisRendererBase));
export { NumericAxisRenderer };
/**
 * @hidden
 */
var VerticalAxisLabelPanel = /** @class */ /*@__PURE__*/ (function (_super) {
    __extends(VerticalAxisLabelPanel, _super);
    function VerticalAxisLabelPanel() {
        var _this = _super !== null && _super.apply(this, arguments) || this;
        _this.di = 0;
        _this.df = 0;
        _this.dh = 0;
        _this.dg = 0;
        return _this;
    }
    VerticalAxisLabelPanel.prototype.ae = function () {
        return new VerticalAxisLabelPanelView(this);
    };
    VerticalAxisLabelPanel.prototype.ch = function (a) {
        _super.prototype.ch.call(this, a);
        this.c9 = a;
    };
    VerticalAxisLabelPanel.prototype.b6 = function () {
        this.c9.a0();
    };
    VerticalAxisLabelPanel.prototype.bq = function () {
        return this.ad.bf != null ? this.ad.bf.angle : -90;
    };
    VerticalAxisLabelPanel.prototype.db = function () {
        var a = 0;
        var b = this.aj(this.ad.bf);
        if (b == 1) {
            a += this.bu();
        }
        var c = this.ah;
        if (c == 3 || c == 7) {
            a += this.ad.d0;
        }
        return a;
    };
    VerticalAxisLabelPanel.prototype.dd = function () {
        var a = 0;
        var b = this.aj(this.ad.bf);
        if (b == 2) {
            a += this.bu();
        }
        var c = this.ah;
        if (c == 2 || c == 6) {
            a += this.ad.d0;
        }
        return a;
    };
    VerticalAxisLabelPanel.prototype.de = function () {
        var a = (this.bd - this.db()) - this.dd();
        if (a < 0) {
            a = 0;
        }
        return a;
    };
    VerticalAxisLabelPanel.prototype.dc = function () {
        var a = ((this.de() - this.af.p()) - this.af.q());
        if (a < 0) {
            a = 0;
        }
        return a;
    };
    VerticalAxisLabelPanel.prototype.a5 = function () {
        var a = new List$1(Rect.$, 0);
        this.aw = false;
        this.av = false;
        if (this.ag != null && this.ag.k() && this.bl() % 360 != 0) {
            this.av = true;
        }
        this.di = -1.7976931348623157E+308;
        this.df = -1.7976931348623157E+308;
        this.dh = -1.7976931348623157E+308;
        this.dg = -1.7976931348623157E+308;
        var b = this.af.p();
        var c = this.af.r();
        var d = this.af.q();
        var e = this.af.o();
        var f = this.db();
        var g = false;
        if (!isNaN_(this.be)) {
            this.di = Math.max(this.be, this.di);
            this.dh = Math.max(this.bf, this.dh);
        }
        for (var h = 0; h < this.bb.count; h++) {
            var i = this.bb._inner[h];
            var j = this.ba._inner[h].a;
            var k = this.bj(i);
            var l = this.bk(i);
            var m = k + c + e;
            var n = l + b + d;
            var o = this.c1.left + f;
            var p = this.ba._inner[h].c - m / 2;
            if (j) {
                var q = this.be;
                if ((isNaN_(this.be) || n > this.be || this.ba._inner[h].b) && !g) {
                    if (this.ba._inner[h].b) {
                        g = true;
                    }
                    this.ba._inner[h].b = false;
                    this.be = n;
                    this.bf = l;
                }
                this.di = Math.max(this.be, this.di);
                this.df = Math.max(m, this.df);
                this.dh = Math.max(this.bf, this.dh);
                this.dg = Math.max(k, this.dg);
            }
            else {
                this.di = Math.max(n, this.di);
                this.df = Math.max(m, this.df);
                this.dh = Math.max(l, this.dh);
                this.dg = Math.max(k, this.dg);
            }
            var r = new Rect(0, o, p, n, m);
            a.add(r);
        }
        var s = 0;
        if (this.av) {
            s = this.bl() % 360;
            if (s < 0) {
                s += 360;
            }
        }
        var t = this.ad.b8();
        if (!t) {
            this.dj(s, b, d);
        }
        else {
            this.af.ac();
        }
        if (this.av) {
            for (var u = 0; u < a.count; u++) {
                var v = a._inner[u];
                v.y = this.ba._inner[u].c - this.df / 2;
                a._inner[u] = v;
            }
        }
        var w = false;
        if (!this.av && this.di <= this.bd) {
            w = true;
        }
        if (!w) {
            var x = this.c1.height;
            var y = this.de();
            var z = y;
            var aa = this.ba.count > 1 ? Math.abs(this.ba._inner[1].c - this.ba._inner[0].c) : x;
            var ab = Math.abs(Math.asin(aa / this.di) * (180 / Math.PI));
            var ac = (s >= ab && s <= 180 - ab) || (s - 180 >= ab && s - 180 <= 180 - ab);
            for (var ad = 0; ad < a.count; ad++) {
                if (this.av) {
                    var ae = s * (Math.PI / 180);
                    var af = this.bv(this.bb._inner[ad]);
                    z = Math.min(y / Math.abs(Math.cos(ae)), af);
                    if (ac) {
                        var ag = void 0;
                        if (s > 0 && s < 90) {
                            ag = (Math.PI / 180) * (90 - s);
                        }
                        else if (s > 270 && s < 360) {
                            ag = (Math.PI / 180) * (s - 270);
                        }
                        else {
                            ag = 0;
                        }
                        z = aa / Math.cos(ag);
                    }
                }
                var ah = a._inner[ad];
                ah.width = Math.min(ah.width, z);
                a._inner[ad] = ah;
                if (!(typeCast(TextBlock.$, this.bb._inner[ad]) !== null)) {
                    this.bb._inner[ad].width = z;
                }
                var ai = typeCast(TextBlock.$, this.bb._inner[ad]);
                if (ai != null) {
                    var aj = this.b1(ad, ai, z, b, d);
                    if (!Base.equalsStatic(ai.al, aj)) {
                        ai.al = aj;
                        this.bb._inner[ad].width = z;
                    }
                }
            }
            if (!t) {
                this.dj(s, b, d);
            }
        }
        if (this.da()) {
            this.dk(a);
        }
        return a;
    };
    VerticalAxisLabelPanel.prototype.dj = function (a, b, c) {
        var d = a * (Math.PI / 180);
        var e = Math.abs(this.dh * Math.cos(d)) + Math.abs(this.dg * Math.sin(d));
        var f = this.bu();
        var g = (e + b + c) + (f) + this.ad.d0;
        this.bh = Math.max(this.ad.eu, g);
    };
    VerticalAxisLabelPanel.prototype.dk = function (a) {
        this.c9.a1(a, this.di);
    };
    VerticalAxisLabelPanel.prototype.cm = function (a, b) {
        var c = 0;
        var d = this.dg / 2;
        var e = new TransformGroup();
        var f = AngleSimplifier.a(this.bl());
        var g = ((function () {
            var $ret = new RotateTransform();
            $ret.j = f;
            $ret.k = c;
            $ret.l = d;
            return $ret;
        })());
        var h = 0;
        var i = 0;
        if (f != 0 && f != 360) {
            f -= 90;
            if (f > 0 && f < 180) {
                g.k = this.dh;
                h = -this.dh + this.dg / 2;
                h = h + Math.sin(MathUtil.o(f - 180)) * (this.dg / 2);
            }
            else {
                if (f >= 180) {
                    h = h - Math.cos(MathUtil.o(f)) * (this.dg / 2);
                }
                else {
                    h = h + Math.cos(MathUtil.o(f)) * (this.dg / 2);
                }
            }
        }
        var j = ((function () {
            var $ret = new TranslateTransform();
            $ret.j = h;
            $ret.k = i;
            return $ret;
        })());
        e.j.add(g);
        e.j.add(j);
        a.j = e;
    };
    VerticalAxisLabelPanel.prototype.da = function () {
        return !this.aw && !this.av;
    };
    VerticalAxisLabelPanel.prototype.c0 = function () {
        var a = this.aj(this.ad.bf);
        var b = this.bu();
        var c = this.ah;
        var d = 0;
        if (a == 1) {
            d += this.c1.left;
            if (c == 3 || c == 7) {
                d += this.ad.d0;
            }
        }
        else {
            d = this.c1.right - b;
            if (c == 6 || c == 2) {
                d -= this.ad.d0;
            }
        }
        var e = this.bs();
        var f = 0;
        var g = this.ad.bf == null ? 1 : this.ad.bf.verticalAlignment;
        if (g == 0) {
            f = this.c1.top;
        }
        else if (g == 2) {
            f = this.c1.bottom - e;
        }
        else {
            f = (this.c1.top + (this.c1.height / 2)) - (e / 2);
        }
        return new Rect(0, d, f, b, e);
    };
    VerticalAxisLabelPanel.prototype.aj = function (a) {
        if (a == null) {
            return this.ad.bi.aq(this.ad);
        }
        if (a.position == 0) {
            if (this.ad != null && this.ad.bi != null) {
                return this.ad.bi.aq(this.ad);
            }
            return 1;
        }
        return a.position;
    };
    VerticalAxisLabelPanel.prototype.ai = function () {
        return 2;
    };
    VerticalAxisLabelPanel.prototype.ay = function (a) {
        return a == 2 || a == 3 || a == 6 || a == 7;
    };
    VerticalAxisLabelPanel.prototype.b9 = function () {
        var e_65, _a;
        var a = this.af.au();
        this.ad.hk(a);
        if (this.ag != null && this.ag.visibility != 0) {
            return;
        }
        var b = this.ad.d0;
        if (b == 0) {
            return;
        }
        var c = this.a2();
        if (c == null) {
            return;
        }
        var d = this.c1.left;
        var e;
        var f = this.ah;
        if (f == 2 || f == 6) {
            d = this.c1.right;
            e = d - b;
        }
        else {
            e = d + b;
        }
        var g = this.af.b();
        try {
            for (var _b = __values(fromEnum(c)), _c = _b.next(); !_c.done; _c = _b.next()) {
                var h = _c.value;
                this.cc(a, h, d, e, this.c4, g);
            }
        }
        catch (e_65_1) {
            e_65 = { error: e_65_1 };
        }
        finally {
            try {
                if (_c && !_c.done && (_a = _b.return))
                    _a.call(_b);
            }
            finally {
                if (e_65)
                    throw e_65.error;
            }
        }
        if (!this.ab.contains(this.af.aw)) {
            this.ab.add(this.af.aw);
        }
    };
    VerticalAxisLabelPanel.$t = markType(VerticalAxisLabelPanel, 'VerticalAxisLabelPanel', AxisLabelPanelBase.$);
    return VerticalAxisLabelPanel;
}(AxisLabelPanelBase));
export { VerticalAxisLabelPanel };
/**
 * @hidden
 */
var ViewportUtils = /** @class */ /*@__PURE__*/ (function (_super) {
    __extends(ViewportUtils, _super);
    function ViewportUtils() {
        return _super !== null && _super.apply(this, arguments) || this;
    }
    ViewportUtils.e = function (a, b, c, d) {
        if (!d.isEmpty) {
            var e = NumericScaler.ac;
            var f = d.left + d.width * (a - e.left) / e.width;
            f = (f - c.left) / c.width;
            return c.left + c.width * (f - b.left) / b.width;
        }
        return c.left + c.width * (a - b.left) / b.width;
    };
    ViewportUtils.b = function (a, b, c, d) {
        if (!d.isEmpty) {
            var e = NumericScaler.ac;
            var f = b.left + b.width * (a - c.left) / c.width;
            f = (f * c.width) + c.left;
            f = ((f - d.left) * e.width / d.width) + e.left;
            return f;
        }
        return ((a - c.left) * b.width / c.width) + b.left;
    };
    ViewportUtils.i = function (a, b, c, d) {
        if (!d.isEmpty) {
            var e = NumericScaler.ac;
            var f = d.top + d.height * (a - e.top) / e.height;
            f = (f - c.top) / c.height;
            return c.top + c.height * (f - b.top) / b.height;
        }
        return c.top + c.height * (a - b.top) / b.height;
    };
    ViewportUtils.g = function (a, b, c, d) {
        if (!d.isEmpty) {
            var e = NumericScaler.ac;
            var f = b.top + b.height * (a - c.top) / c.height;
            f = (f * c.height) + c.top;
            f = ((f - d.top) * e.height / d.height) + e.top;
            return f;
        }
        return ((a - c.top) * b.height / c.height) + b.top;
    };
    ViewportUtils.d = function (a, b, c, d) {
        var e = d;
        if (e.isEmpty) {
            e = c;
        }
        return e.width * a / b.width;
    };
    ViewportUtils.a = function (a, b, c, d) {
        var e = d;
        if (e.isEmpty) {
            e = c;
        }
        return b.width * a / e.width;
    };
    ViewportUtils.h = function (a, b, c, d) {
        var e = d;
        if (e.isEmpty) {
            e = c;
        }
        return e.height * a / b.height;
    };
    ViewportUtils.f = function (a, b, c) {
        return c.width * a / b.width;
    };
    ViewportUtils.c = function (a, b, c) {
        return b.width * a / c.width;
    };
    ViewportUtils.j = function (a, b, c) {
        return c.height * a / b.height;
    };
    ViewportUtils.$t = markType(ViewportUtils, 'ViewportUtils');
    return ViewportUtils;
}(Base));
export { ViewportUtils };
/**
 * @hidden
 */
export var IHasCategoryAxis_$type = /*@__PURE__*/ new Type(null, 'IHasCategoryAxis');
/**
 * @hidden
 */
export var IHasCategoryModePreference_$type = /*@__PURE__*/ new Type(null, 'IHasCategoryModePreference', null, [IHasCategoryAxis_$type]);
/**
 * @hidden
 */
var AutomaticSeriesManager = /** @class */ /*@__PURE__*/ (function (_super) {
    __extends(AutomaticSeriesManager, _super);
    function AutomaticSeriesManager(a) {
        var _this = _super.call(this) || this;
        _this.g = new HashSet$1(AutomaticSeriesPurpose_$type, 0);
        _this.c = null;
        _this.f = false;
        _this.a = null;
        _this.a = new AutomaticSeriesRequestCollection();
        var b = _this.a;
        b.collectionChanged = delegateCombine(b.collectionChanged, runOn(_this, _this.i));
        var c = a.series;
        _this.c = c;
        c.collectionChanged = delegateCombine(c.collectionChanged, runOn(_this, _this.m));
        c.collectionResetting = delegateCombine(c.collectionResetting, runOn(_this, _this.n));
        return _this;
    }
    AutomaticSeriesManager.prototype.e = function (a) {
        return this.g.contains(a);
    };
    AutomaticSeriesManager.prototype.i = function (a, b) {
        this.j();
    };
    AutomaticSeriesManager.prototype.n = function (a, b) {
        this.j();
    };
    AutomaticSeriesManager.prototype.m = function (a, b) {
        this.j();
    };
    AutomaticSeriesManager.prototype.j = function () {
        if (this.f) {
            return;
        }
        this.f = true;
        try {
            this.k();
        }
        finally {
            this.f = false;
        }
    };
    AutomaticSeriesManager.prototype.k = function () {
        this.g.clear();
        var a = new Dictionary$2(Series.$, Number_$type, 0);
        var b = new Dictionary$2(Series.$, AutomaticSeriesRequest.$, 0);
        for (var c = 0; c < this.c.count; c++) {
            a.addItem(this.c._inner[c], c);
        }
        for (var d = 0; d < this.a.count; d++) {
            this.g.add_1(this.a._inner[d].a);
            b.addItem(this.a._inner[d].d, this.a._inner[d]);
        }
        var e = new List$1(Series.$, 0);
        var f = new List$1(AutomaticSeriesRequest.$, 0);
        var g = new List$1(AutomaticSeriesRequest.$, 0);
        for (var h = 0; h < this.a.count; h++) {
            if (!a.containsKey(this.a._inner[h].d)) {
                f.add(this.a._inner[h]);
            }
        }
        for (var i = 0; i < this.c.count; i++) {
            if (this.c._inner[i].ey && !b.containsKey(this.c._inner[i])) {
                e.add(this.c._inner[i]);
            }
            if (b.containsKey(this.c._inner[i]) && this.d(b.item(this.c._inner[i]), a, b)) {
                e.add(this.c._inner[i]);
                g.add(b.item(this.c._inner[i]));
                f.add(b.item(this.c._inner[i]));
            }
        }
        for (var j = e.count - 1; j >= 0; j--) {
            var k = e._inner[j];
            var l = a.item(k);
            this.c.removeAt(l);
        }
        a.clear();
        for (var m = 0; m < this.c.count; m++) {
            a.addItem(this.c._inner[m], m);
        }
        for (var n = 0; n < f.count; n++) {
            f._inner[n].d.ey = true;
            var o = this.h(f._inner[n], a);
            this.c.insert(o, f._inner[n].d);
            a.item(f._inner[n].d, o);
            for (var p = o; p < this.c.count; p++) {
                var q = this.c._inner[p];
                if (a.containsKey(q)) {
                    a.item(q, p);
                }
            }
        }
    };
    AutomaticSeriesManager.prototype.l = function (a) {
        for (var b = this.a.count - 1; b >= 0; b--) {
            if (this.a._inner[b].a == a) {
                this.a.removeAt(b);
            }
        }
    };
    AutomaticSeriesManager.prototype.h = function (a, b) {
        if (a.f) {
            return 0;
        }
        if (a.e) {
            return this.c.count;
        }
        if (a.c != null) {
            if (!b.containsKey(a.c)) {
                return this.c.count;
            }
            var c = b.item(a.c);
            return c;
        }
        if (a.b != null) {
            if (!b.containsKey(a.b)) {
                return this.c.count;
            }
            var d = b.item(a.b);
            return d + 1;
        }
        return this.c.count;
    };
    AutomaticSeriesManager.prototype.d = function (a, b, c) {
        var d = b.item(a.d);
        if (a.f) {
            for (var e = d; e >= 0; e--) {
                if (!c.containsKey(this.c._inner[e])) {
                    return true;
                }
            }
        }
        if (a.e) {
            for (var f = d; f < this.c.count; f++) {
                if (!c.containsKey(this.c._inner[f])) {
                    return true;
                }
            }
        }
        if (a.c != null) {
            if (!b.containsKey(a.c)) {
                return false;
            }
            var g = b.item(a.c);
            if (d != g - 1) {
                return true;
            }
        }
        if (a.b != null) {
            if (!b.containsKey(a.b)) {
                return false;
            }
            var h = b.item(a.b);
            if (d != h + 1) {
                return true;
            }
        }
        return false;
    };
    Object.defineProperty(AutomaticSeriesManager.prototype, "b", {
        get: function () {
            return this.a;
        },
        enumerable: false,
        configurable: true
    });
    AutomaticSeriesManager.$t = markType(AutomaticSeriesManager, 'AutomaticSeriesManager');
    return AutomaticSeriesManager;
}(Base));
export { AutomaticSeriesManager };
/**
 * @hidden
 */
var AutomaticSeriesRequest = /** @class */ /*@__PURE__*/ (function (_super) {
    __extends(AutomaticSeriesRequest, _super);
    function AutomaticSeriesRequest() {
        var _this = _super !== null && _super.apply(this, arguments) || this;
        _this.a = 0;
        _this.d = null;
        _this.b = null;
        _this.c = null;
        _this.e = false;
        _this.f = false;
        return _this;
    }
    AutomaticSeriesRequest.$t = markType(AutomaticSeriesRequest, 'AutomaticSeriesRequest');
    return AutomaticSeriesRequest;
}(Base));
export { AutomaticSeriesRequest };
/**
 * @hidden
 */
var AutomaticSeriesRequestCollection = /** @class */ /*@__PURE__*/ (function (_super) {
    __extends(AutomaticSeriesRequestCollection, _super);
    function AutomaticSeriesRequestCollection() {
        return _super.call(this, AutomaticSeriesRequest.$, 0) || this;
    }
    AutomaticSeriesRequestCollection.$t = markType(AutomaticSeriesRequestCollection, 'AutomaticSeriesRequestCollection', ObservableCollection$1.$.specialize(AutomaticSeriesRequest.$));
    return AutomaticSeriesRequestCollection;
}(ObservableCollection$1));
export { AutomaticSeriesRequestCollection };
/**
 * @hidden
 */
var ChartSelection = /** @class */ /*@__PURE__*/ (function (_super) {
    __extends(ChartSelection, _super);
    function ChartSelection() {
        var _this = _super !== null && _super.apply(this, arguments) || this;
        _this._item = null;
        _this._series = null;
        _this.b = null;
        return _this;
    }
    Object.defineProperty(ChartSelection.prototype, "item", {
        get: function () {
            return this._item;
        },
        set: function (a) {
            this._item = a;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(ChartSelection.prototype, "series", {
        get: function () {
            return this._series;
        },
        set: function (a) {
            this._series = a;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(ChartSelection.prototype, "c", {
        get: function () {
            if (this.b == null && this.series != null) {
                this.b = this.series.cg();
            }
            return this.b;
        },
        set: function (a) {
            this.b = a;
        },
        enumerable: false,
        configurable: true
    });
    ChartSelection.prototype.equals = function (a) {
        var b = typeCast(ChartSelection.$, a);
        if (b == null) {
            return false;
        }
        return b.series == this.series && b.item == this.item;
    };
    ChartSelection.prototype.getHashCode = function () {
        var a = 31;
        if (this.item != null) {
            a ^= Base.getHashCodeStatic(this.item);
        }
        if (this.series != null) {
            a ^= Base.getHashCodeStatic(this.series);
        }
        return a;
    };
    ChartSelection.prototype.g = function (a) {
        if (this.b != null && this.series == null) {
            var b = SeriesMatcherHelper.a(a, this.b);
            if (b != null && b.length > 0) {
                this.series = b[0];
            }
        }
    };
    ChartSelection.$t = markType(ChartSelection, 'ChartSelection');
    return ChartSelection;
}(Base));
export { ChartSelection };
/**
 * @hidden
 */
var ChartSelectedItemCollection = /** @class */ /*@__PURE__*/ (function (_super) {
    __extends(ChartSelectedItemCollection, _super);
    function ChartSelectedItemCollection() {
        var _this = _super.call(this, ChartSelection.$, 0) || this;
        _this.collectionResetting = null;
        return _this;
    }
    ChartSelectedItemCollection.prototype.p = function () {
        if (this.collectionResetting != null) {
            this.collectionResetting(this, null);
        }
        _super.prototype.p.call(this);
    };
    ChartSelectedItemCollection.$t = markType(ChartSelectedItemCollection, 'ChartSelectedItemCollection', ObservableCollection$1.$.specialize(ChartSelection.$));
    return ChartSelectedItemCollection;
}(ObservableCollection$1));
export { ChartSelectedItemCollection };
/**
 * @hidden
 */
var SeriesMatcherHelper = /** @class */ /*@__PURE__*/ (function (_super) {
    __extends(SeriesMatcherHelper, _super);
    function SeriesMatcherHelper() {
        return _super !== null && _super.apply(this, arguments) || this;
    }
    SeriesMatcherHelper.a = function (a, b) {
        var c = new List$1(Series.$, 0);
        a.n3(function (d) {
            if (SeriesMatcherHelper.b(b, d)) {
                c.add(d);
            }
        });
        return c.toArray();
    };
    SeriesMatcherHelper.b = function (a, b) {
        if (a.b >= 0) {
            if (b.index == a.b) {
                return true;
            }
        }
        if (a.e != null) {
            if (Base.equalsStatic(a.e, b.name)) {
                return true;
            }
        }
        if (a.f != null) {
            if (Base.equalsStatic(a.f, b.title)) {
                return true;
            }
        }
        if (a.d != null && a.c != null) {
            var c = a.d;
            if (!stringEndsWith(c, "MemberPath")) {
                c += "MemberPath";
            }
            var d = b.mf(c);
            if (Base.equalsStatic(a.c, d)) {
                return true;
            }
        }
        return false;
    };
    SeriesMatcherHelper.$t = markType(SeriesMatcherHelper, 'SeriesMatcherHelper');
    return SeriesMatcherHelper;
}(Base));
export { SeriesMatcherHelper };
/**
 * @hidden
 */
var SeriesLayer = /** @class */ /*@__PURE__*/ (function (_super) {
    __extends(SeriesLayer, _super);
    function SeriesLayer() {
        var _this = _super.call(this) || this;
        _this._source = null;
        _this._target = null;
        _this.z = null;
        _this.n = null;
        _this.u = new Dictionary$2(String_$type, Delegate_$type, 0);
        _this.y = new Dictionary$2(String_$type, Stack$1.$.specialize(Boolean_$type), 0);
        _this.p = false;
        _this.aa = new HashSet$1(SeriesLayerPropertyOverlay.$, 0);
        _this.ab = new HashSet$1(SeriesLayerPropertyOverlay.$, 0);
        _this.v = new Dictionary$2(String_$type, List$1.$.specialize(SeriesLayerPropertyOverlay.$), 0);
        _this.w = new Dictionary$2(String_$type, SeriesLayerPropertyOverlay.$, 0);
        _this.x = new Dictionary$2(String_$type, SeriesLayerPropertyOverlay.$, 0);
        _this.propertyChanged = null;
        _this.q = false;
        _this.l = new SeriesLayerPropertyOverlayCollection();
        _this.o = false;
        _this.z = new HashSet$1(String_$type, 0);
        _this.z.add_1("FastItemsSource");
        var a = _this.l;
        a.collectionResetting = delegateCombine(a.collectionResetting, runOn(_this, _this.al));
        var b = _this.l;
        b.collectionChanged = delegateCombine(b.collectionChanged, runOn(_this, _this.ak));
        return _this;
    }
    Object.defineProperty(SeriesLayer.prototype, "source", {
        get: function () {
            return this._source;
        },
        set: function (a) {
            this._source = a;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(SeriesLayer.prototype, "target", {
        get: function () {
            return this._target;
        },
        set: function (a) {
            this._target = a;
        },
        enumerable: false,
        configurable: true
    });
    SeriesLayer.prototype.ak = function (a, b) {
        if (b.oldItems != null) {
            for (var c = 0; c < b.oldItems.count; c++) {
                var d = b.oldItems.item(c);
                if (d == null) {
                    continue;
                }
                var e = d;
                e.propertyUpdated = delegateRemove(e.propertyUpdated, runOn(this, this.av));
                if (this.p && (this.aa.contains(e) || this.ab.contains(e))) {
                    this.aq(e);
                }
            }
        }
        if (b.newItems != null) {
            for (var f = 0; f < b.newItems.count; f++) {
                var g = b.newItems.item(f);
                if (g == null) {
                    continue;
                }
                var h = g;
                if (h.ad != null) {
                    if (h.r) {
                        this.x.item(h.aa, h);
                    }
                    else {
                        this.w.item(h.aa, h);
                    }
                }
                if (h.y != null) {
                    var i = h.y;
                    if (!h.q) {
                        i = Series.ny(i);
                    }
                    if (!this.v.containsKey(i)) {
                        this.v.addItem(i, new List$1(SeriesLayerPropertyOverlay.$, 0));
                    }
                    this.v.item(i).add(h);
                }
                h.propertyUpdated = delegateCombine(h.propertyUpdated, runOn(this, this.av));
            }
        }
        if (this.target != null && this.target.fw) {
            this.a3();
        }
        else {
            this.a5();
        }
    };
    SeriesLayer.prototype.au = function () {
        if (this.target != null) {
            this.target.ra();
        }
    };
    SeriesLayer.prototype.at = function () {
        if (this.target != null) {
            this.target.q8();
        }
    };
    Object.defineProperty(SeriesLayer.prototype, "t", {
        get: function () {
            return this.target != null && this.target.g5;
        },
        enumerable: false,
        configurable: true
    });
    SeriesLayer.prototype.a3 = function () {
        var e_66, _a;
        if (this.p) {
            try {
                for (var _b = __values(fromEnum(this.l)), _c = _b.next(); !_c.done; _c = _b.next()) {
                    var a = _c.value;
                    if (!this.aa.contains(a) && !this.ab.contains(a)) {
                        this.a2(a, this.source, this.target);
                    }
                }
            }
            catch (e_66_1) {
                e_66 = { error: e_66_1 };
            }
            finally {
                try {
                    if (_c && !_c.done && (_a = _b.return))
                        _a.call(_b);
                }
                finally {
                    if (e_66)
                        throw e_66.error;
                }
            }
        }
    };
    SeriesLayer.prototype.a4 = function () {
        var e_67, _a;
        if (this.p) {
            try {
                for (var _b = __values(fromEnum(this.l)), _c = _b.next(); !_c.done; _c = _b.next()) {
                    var a = _c.value;
                    if (!this.aa.contains(a) && !this.ab.contains(a)) {
                        this.a2(a, this.source, null);
                    }
                }
            }
            catch (e_67_1) {
                e_67 = { error: e_67_1 };
            }
            finally {
                try {
                    if (_c && !_c.done && (_a = _b.return))
                        _a.call(_b);
                }
                finally {
                    if (e_67)
                        throw e_67.error;
                }
            }
        }
    };
    SeriesLayer.prototype.a5 = function () {
        var e_68, _a;
        if (this.p) {
            try {
                for (var _b = __values(fromEnum(this.l)), _c = _b.next(); !_c.done; _c = _b.next()) {
                    var a = _c.value;
                    if (!this.aa.contains(a) && !this.ab.contains(a)) {
                        this.a2(a, null, this.target);
                    }
                }
            }
            catch (e_68_1) {
                e_68 = { error: e_68_1 };
            }
            finally {
                try {
                    if (_c && !_c.done && (_a = _b.return))
                        _a.call(_b);
                }
                finally {
                    if (e_68)
                        throw e_68.error;
                }
            }
        }
    };
    SeriesLayer.prototype.a2 = function (a, b, c) {
        if (a.p) {
            if (a.r && b != null) {
                if (!this.aa.contains(a)) {
                    this.aa.add_1(a);
                    this.an(a, b);
                }
            }
            else if (!a.r && c != null) {
                if (!this.ab.contains(a)) {
                    this.ab.add_1(a);
                    this.an(a, c);
                }
            }
        }
        else {
            if (a.r) {
                this.aa.add_1(a);
            }
            else {
                this.ab.add_1(a);
            }
        }
    };
    SeriesLayer.prototype.ah = function (a) {
        if (a == null) {
            return null;
        }
        if (this.source == null) {
            return null;
        }
        if (this.x.containsKey(a.name) && this.aa.contains(this.x.item(a.name))) {
            return this.x.item(a.name).w;
        }
        return this.source.c(a);
    };
    SeriesLayer.prototype.an = function (a, b) {
        if (b == null) {
            return;
        }
        var c = a.aa;
        var d = b.tr(c);
        if (d == null) {
            return;
        }
        var e = b.c(d);
        if (!a.r) {
            e = this.ah(d);
        }
        var f = this.ag(e, a, b);
        var g = this.af(a, e, f, b);
        this.ao(b, d, g);
    };
    SeriesLayer.prototype.ag = function (a, b, c) {
        var d = a;
        if (b.y != null) {
            var e = b.y;
            if (!b.q) {
                e = Series.ny(b.y);
            }
            var f = c.tr(e);
            if (f != null) {
                d = c.c(f);
                if (!b.r) {
                    d = this.ah(f);
                }
            }
        }
        return d;
    };
    SeriesLayer.prototype.ao = function (a, b, c) {
        var _this = this;
        if (a.f5(b.name) || a.f5("Actual" + b.name)) {
            this.ar(b.name, function () {
                _this.az(a, b);
                a.h(b, c);
                _this.a0(a, b);
            });
        }
        else {
            this.az(a, b);
            a.h(b, c);
            this.a0(a, b);
        }
    };
    SeriesLayer.prototype.ar = function (a, b) {
        if (this.n == null) {
            this.n = this.source.cw.k();
        }
        if (!this.o) {
            this.o = true;
            this.n.enqueueAction(runOn(this, this.as));
        }
        this.u.item(a, b);
    };
    SeriesLayer.prototype.as = function () {
        var e_69, _a;
        this.o = false;
        var a = new List$1(Delegate_$type, 0);
        try {
            for (var _b = __values(fromEnum(this.u.values)), _c = _b.next(); !_c.done; _c = _b.next()) {
                var b = _c.value;
                a.add(b);
            }
        }
        catch (e_69_1) {
            e_69 = { error: e_69_1 };
        }
        finally {
            try {
                if (_c && !_c.done && (_a = _b.return))
                    _a.call(_b);
            }
            finally {
                if (e_69)
                    throw e_69.error;
            }
        }
        this.u.clear();
        for (var c = 0; c < a.count; c++) {
            var d = a._inner[c];
            d();
        }
    };
    SeriesLayer.prototype.az = function (a, b) {
        var c = b.name;
        var d = null;
        if (!this.y.containsKey(c)) {
            this.y.addItem(c, new Stack$1(Boolean_$type));
        }
        this.y.item(c).h(true);
    };
    SeriesLayer.prototype.a0 = function (a, b) {
        var c = b.name;
        if (this.y.containsKey(c)) {
            this.y.item(c).e();
            if (this.y.item(c).f == 0) {
                this.y.removeItem(c);
            }
        }
    };
    SeriesLayer.prototype.r = function (a, b) {
        if (this.y.containsKey(b.name) && this.y.item(b.name).d()) {
            return true;
        }
        return false;
    };
    SeriesLayer.prototype.af = function (a, b, c, d) {
        return a.t(b, c, d);
    };
    SeriesLayer.prototype.al = function (a, b) {
        for (var c = 0; c < this.l.count; c++) {
            var d = this.l._inner[c];
            if (d == null) {
                continue;
            }
            d.propertyUpdated = delegateRemove(d.propertyUpdated, runOn(this, this.av));
            if (this.p && (this.aa.contains(d) || this.ab.contains(d))) {
                this.aq(d);
            }
        }
    };
    SeriesLayer.prototype.av = function (a, b) {
        var c = a;
        if (b.propertyName == SeriesLayerPropertyOverlay.$$p[0]) {
            if (b.oldValue != null) {
                var d = b.oldValue;
                if (!c.q) {
                    d = Series.ny(d);
                }
                if (this.v.containsKey(d)) {
                    var e = this.v.item(d);
                    e.remove(c);
                    if (e.count == 0) {
                        this.v.removeItem(d);
                    }
                }
            }
            if (b.newValue != null) {
                var f = b.newValue;
                if (!c.q) {
                    f = Series.ny(f);
                }
                if (!this.v.containsKey(f)) {
                    this.v.addItem(f, new List$1(SeriesLayerPropertyOverlay.$, 0));
                }
                this.v.item(f).add(c);
            }
        }
        if (this.aa.contains(c) || this.ab.contains(c)) {
            this.a2(c, this.source, this.target);
        }
    };
    SeriesLayer.prototype.ax = function (a, b, c) {
        this.aw(a, b, c);
        if (this.propertyChanged != null) {
            this.propertyChanged(this, new PropertyChangedEventArgs(a));
        }
    };
    SeriesLayer.prototype.am = function (a, b) {
        this.source = a;
        this.target = b;
        this.p = true;
        this.a5();
        var c = this.target;
        c.renderValid = delegateCombine(c.renderValid, runOn(this, this.a1));
        a.propertyUpdated = delegateCombine(a.propertyUpdated, runOn(this, this.ay));
    };
    SeriesLayer.prototype.ay = function (a, b) {
        if (this.p) {
            if (!this.source.gn(b.propertyName)) {
                var c = this.source.tr(b.propertyName);
                if (c != null) {
                    this.ai(this.source, this.target, c, b.newValue);
                }
            }
        }
    };
    SeriesLayer.prototype.a1 = function (a, b) {
        if (this.source == null || this.source.f3()) {
            return;
        }
        this.a4();
        if (this.target != null) {
            var c = this.target;
            c.renderValid = delegateRemove(c.renderValid, runOn(this, this.a1));
        }
    };
    SeriesLayer.prototype.ap = function (a) {
        var e_70, _a;
        var b = this.source;
        b.propertyUpdated = delegateRemove(b.propertyUpdated, runOn(this, this.ay));
        this.p = false;
        var c = new List$1(SeriesLayerPropertyOverlay.$, 1, this.ab);
        c.o(this.aa);
        try {
            for (var _b = __values(fromEnum(c)), _c = _b.next(); !_c.done; _c = _b.next()) {
                var d = _c.value;
                this.aq(d);
            }
        }
        catch (e_70_1) {
            e_70 = { error: e_70_1 };
        }
        finally {
            try {
                if (_c && !_c.done && (_a = _b.return))
                    _a.call(_b);
            }
            finally {
                if (e_70)
                    throw e_70.error;
            }
        }
    };
    SeriesLayer.prototype.aq = function (a) {
        if (a.y != null) {
            if (this.v.containsKey(a.y)) {
                var b = this.v.item(a.y);
                b.remove(a);
                if (b.count == 0) {
                    this.v.removeItem(a.y);
                }
            }
        }
        if (a.r) {
            if (this.x.containsKey(a.aa)) {
                this.x.removeItem(a.aa);
            }
        }
        else {
            if (this.w.containsKey(a.aa)) {
                this.w.removeItem(a.aa);
            }
        }
        if (this.aa.contains(a) || this.ab.contains(a)) {
            if (this.aa.contains(a)) {
                this.aa.remove(a);
            }
            if (this.ab.contains(a)) {
                this.ab.remove(a);
            }
            if (a.r) {
                if (this.source == null) {
                    return;
                }
                var c = this.source.tr(a.aa);
                if (c == null) {
                    return;
                }
                this.ao(this.source, c, a.w);
            }
        }
    };
    SeriesLayer.prototype.aw = function (a, b, c) {
        this.q = true;
    };
    SeriesLayer.prototype.ai = function (a, b, c, d) {
        var e_71, _a;
        var e = d;
        if (this.r(a, c)) {
            return this.ah(c);
        }
        var f = false;
        if (this.s(a, b, c)) {
            f = true;
        }
        if (this.v.containsKey(c.name)) {
            if (this.p) {
                var g = this.v.item(c.name);
                try {
                    for (var _b = __values(fromEnum(g)), _c = _b.next(); !_c.done; _c = _b.next()) {
                        var h = _c.value;
                        if (h.y != null) {
                            var i = h.ad;
                            if (!h.q) {
                                i = Series.ny(i);
                            }
                            var j = a.tr(i);
                            var k = a.c(j);
                            k = this.ad(a, b, j, k);
                            if (h.r) {
                                if (!a.gn(c.name)) {
                                    var l = this.ae(a, b, j, k);
                                    this.az(a, c);
                                    this.ao(a, j, l);
                                    this.a0(a, c);
                                }
                            }
                            else {
                                b.h(j, k);
                            }
                        }
                    }
                }
                catch (e_71_1) {
                    e_71 = { error: e_71_1 };
                }
                finally {
                    try {
                        if (_c && !_c.done && (_a = _b.return))
                            _a.call(_b);
                    }
                    finally {
                        if (e_71)
                            throw e_71.error;
                    }
                }
            }
        }
        if (!f) {
            d = this.ad(a, b, c, d);
            b.h(c, d);
        }
        return e;
    };
    SeriesLayer.prototype.s = function (a, b, c) {
        if (this.z.contains(c.name)) {
            return true;
        }
        if (c.name != null && stringStartsWith(c.name, "Actual")) {
            return true;
        }
        return false;
    };
    SeriesLayer.prototype.ad = function (a, b, c, d) {
        if (this.w.containsKey(c.name)) {
            var e = false;
            if (this.source == null) {
                this.source = a;
                e = true;
            }
            var f = this.w.item(c.name);
            var g = this.ag(d, f, a);
            d = this.w.item(c.name).t(d, g, a);
            if (e) {
                this.source = null;
            }
        }
        return d;
    };
    SeriesLayer.prototype.ae = function (a, b, c, d) {
        if (this.p && this.x.containsKey(c.name)) {
            var e = false;
            if (this.source == null) {
                this.source = a;
                e = true;
            }
            if (this.r(a, c)) {
                d = this.ah(c);
            }
            var f = this.x.item(c.name);
            var g = this.ag(d, f, a);
            d = this.x.item(c.name).t(d, g, a);
            if (e) {
                this.source = null;
            }
        }
        return d;
    };
    Object.defineProperty(SeriesLayer.prototype, "m", {
        get: function () {
            return this.l;
        },
        enumerable: false,
        configurable: true
    });
    SeriesLayer.$t = markType(SeriesLayer, 'SeriesLayer', DependencyObject.$, [INotifyPropertyChanged_$type]);
    SeriesLayer.$$p = markDep(DependencyProperty, PropertyMetadata, SeriesLayer, 'ax', ['ZIndex:ac:a6', [1, 0]]);
    return SeriesLayer;
}(DependencyObject));
export { SeriesLayer };
/**
 * @hidden
 */
var SeriesLayerCollection = /** @class */ /*@__PURE__*/ (function (_super) {
    __extends(SeriesLayerCollection, _super);
    function SeriesLayerCollection() {
        var _this = _super.call(this, SeriesLayer.$, 0) || this;
        _this.collectionResetting = null;
        return _this;
    }
    SeriesLayerCollection.prototype.p = function () {
        if (this.collectionResetting != null) {
            this.collectionResetting(this, null);
        }
        _super.prototype.p.call(this);
    };
    SeriesLayerCollection.$t = markType(SeriesLayerCollection, 'SeriesLayerCollection', ObservableCollection$1.$.specialize(SeriesLayer.$));
    return SeriesLayerCollection;
}(ObservableCollection$1));
export { SeriesLayerCollection };
/**
 * @hidden
 */
var SeriesLayerManager = /** @class */ /*@__PURE__*/ (function (_super) {
    __extends(SeriesLayerManager, _super);
    function SeriesLayerManager() {
        var _this = _super !== null && _super.apply(this, arguments) || this;
        _this.a = null;
        return _this;
    }
    SeriesLayerManager.prototype.b = function (a, b) {
        if (b.propertyName == "ZIndex") {
            this.n(this.a);
        }
    };
    SeriesLayerManager.prototype.i = function (a, b) {
        if (b.oldItems != null) {
            for (var c = 0; c < b.oldItems.count; c++) {
                var d = b.oldItems.item(c);
                if (d == null) {
                    continue;
                }
                var e = d;
                e.propertyChanged = delegateRemove(e.propertyChanged, runOn(this, this.b));
            }
        }
        if (b.newItems != null) {
            for (var f = 0; f < b.newItems.count; f++) {
                var g = b.newItems.item(f);
                if (g == null) {
                    continue;
                }
                var h = g;
                h.propertyChanged = delegateCombine(h.propertyChanged, runOn(this, this.b));
            }
        }
        this.n(a);
    };
    SeriesLayerManager.prototype.n = function (a) {
        var e_72, _a, e_73, _b;
        var b = new SeriesLayerCollection();
        try {
            for (var _c = __values(fromEnum(a.cb)), _d = _c.next(); !_d.done; _d = _c.next()) {
                var c = _d.value;
                b.add(c);
            }
        }
        catch (e_72_1) {
            e_72 = { error: e_72_1 };
        }
        finally {
            try {
                if (_d && !_d.done && (_a = _c.return))
                    _a.call(_c);
            }
            finally {
                if (e_72)
                    throw e_72.error;
            }
        }
        try {
            for (var _e = __values(fromEnum(a.cc)), _f = _e.next(); !_f.done; _f = _e.next()) {
                var d = _f.value;
                b.add(d);
            }
        }
        catch (e_73_1) {
            e_73 = { error: e_73_1 };
        }
        finally {
            try {
                if (_f && !_f.done && (_b = _e.return))
                    _b.call(_e);
            }
            finally {
                if (e_73)
                    throw e_73.error;
            }
        }
        var e = function (f, g) {
            if (f.ac < g.ac) {
                return -1;
            }
            else if (f.ac > g.ac) {
                return 1;
            }
            else {
                return 0;
            }
        };
        ArrayExtension.quickSort(b, function (f, g) { return e(f, g); });
        this.m(b, a.actualLayers);
    };
    SeriesLayerManager.prototype.m = function (a, b) {
        var c = new List$1(Number_$type, 0);
        var d = 0;
        for (var e = 0; e < b.count; e++) {
            if (b._inner[e] == null) {
                c.add(e);
                continue;
            }
            if (d > a.count - 1) {
                c.add(e);
                continue;
            }
            if (Base.equalsStatic(b._inner[e], a._inner[d])) {
                d++;
                continue;
            }
            b.insert(e, a._inner[d]);
            d++;
        }
        for (var f = c.count - 1; f >= 0; f--) {
            b.removeAt(f);
        }
        for (; d < a.count; d++) {
            b.add(a._inner[d]);
        }
    };
    SeriesLayerManager.prototype.h = function (a, b, c) {
        this.i(a, c);
    };
    SeriesLayerManager.prototype.j = function (a, b, c) {
        var e_74, _a;
        try {
            for (var _b = __values(fromEnum(b)), _c = _b.next(); !_c.done; _c = _b.next()) {
                var d = _c.value;
                d.propertyChanged = delegateRemove(d.propertyChanged, runOn(this, this.b));
            }
        }
        catch (e_74_1) {
            e_74 = { error: e_74_1 };
        }
        finally {
            try {
                if (_c && !_c.done && (_a = _b.return))
                    _a.call(_b);
            }
            finally {
                if (e_74)
                    throw e_74.error;
            }
        }
    };
    SeriesLayerManager.prototype.e = function (a, b, c) {
        this.i(a, c);
    };
    SeriesLayerManager.prototype.f = function (a, b, c) {
        var e_75, _a;
        try {
            for (var _b = __values(fromEnum(b)), _c = _b.next(); !_c.done; _c = _b.next()) {
                var d = _c.value;
                d.propertyChanged = delegateRemove(d.propertyChanged, runOn(this, this.b));
            }
        }
        catch (e_75_1) {
            e_75 = { error: e_75_1 };
        }
        finally {
            try {
                if (_c && !_c.done && (_a = _b.return))
                    _a.call(_b);
            }
            finally {
                if (e_75)
                    throw e_75.error;
            }
        }
    };
    SeriesLayerManager.prototype.c = function (a, b, c) {
        var e_76, _a;
        switch (c.action) {
            case 0:
                if (c.newItems != null) {
                    for (var d = 0; d < c.newItems.count; d++) {
                        var e = c.newItems.item(d);
                        this.k(d + c.newStartingIndex, e);
                    }
                }
                break;
            case 1:
                if (c.oldItems != null) {
                    for (var f = 0; f < c.oldItems.count; f++) {
                        var g = c.oldItems.item(f);
                        this.l(g, c.oldStartingIndex);
                    }
                }
                break;
            case 2:
                if (c.oldItems != null) {
                    for (var h = 0; h < c.oldItems.count; h++) {
                        var i = c.oldItems.item(h);
                        this.l(i, c.oldStartingIndex);
                    }
                }
                if (c.newItems != null) {
                    for (var j = 0; j < c.newItems.count; j++) {
                        var k = c.newItems.item(j);
                        this.k(j + c.newStartingIndex, k);
                    }
                }
                break;
            case 4:
                this.g();
                var l = 0;
                try {
                    for (var _b = __values(fromEnum(b)), _c = _b.next(); !_c.done; _c = _b.next()) {
                        var m = _c.value;
                        var n = m;
                        this.k(l, n);
                        l++;
                    }
                }
                catch (e_76_1) {
                    e_76 = { error: e_76_1 };
                }
                finally {
                    try {
                        if (_c && !_c.done && (_a = _b.return))
                            _a.call(_b);
                    }
                    finally {
                        if (e_76)
                            throw e_76.error;
                    }
                }
                break;
        }
    };
    SeriesLayerManager.prototype.g = function () {
        var e_77, _a;
        try {
            for (var _b = __values(fromEnum(this.a.actualLayers)), _c = _b.next(); !_c.done; _c = _b.next()) {
                var a = _c.value;
                this.a.pj(a);
            }
        }
        catch (e_77_1) {
            e_77 = { error: e_77_1 };
        }
        finally {
            try {
                if (_c && !_c.done && (_a = _b.return))
                    _a.call(_b);
            }
            finally {
                if (e_77)
                    throw e_77.error;
            }
        }
    };
    SeriesLayerManager.prototype.l = function (a, b) {
        this.a.pj(a);
    };
    SeriesLayerManager.prototype.k = function (a, b) {
        this.a.bn(a, b);
    };
    SeriesLayerManager.prototype.d = function (a, b, c) {
        this.g();
    };
    SeriesLayerManager.$t = markType(SeriesLayerManager, 'SeriesLayerManager');
    return SeriesLayerManager;
}(Base));
export { SeriesLayerManager };
/**
 * @hidden
 */
var SeriesLayerPropertyOverlay = /** @class */ /*@__PURE__*/ (function (_super) {
    __extends(SeriesLayerPropertyOverlay, _super);
    function SeriesLayerPropertyOverlay() {
        var _this = _super !== null && _super.apply(this, arguments) || this;
        _this.o = false;
        _this.k = null;
        _this.propertyChanged = null;
        _this.propertyUpdated = null;
        _this.q = false;
        _this.n = false;
        _this.m = false;
        _this.w = null;
        _this.s = null;
        _this.valueResolving = null;
        return _this;
    }
    SeriesLayerPropertyOverlay.prototype.ah = function (a, b, c) {
        this.ag(a, b, c);
        if (this.propertyChanged != null) {
            this.propertyChanged(this, new PropertyChangedEventArgs(a));
        }
        if (this.propertyUpdated != null) {
            this.propertyUpdated(this, new PropertyUpdatedEventArgs(a, b, c));
        }
    };
    SeriesLayerPropertyOverlay.prototype.ag = function (a, b, c) {
        this.n = true;
        switch (a) {
            case SeriesLayerPropertyOverlay.$$p[4]:
                this.m = true;
                break;
            default: break;
        }
    };
    SeriesLayerPropertyOverlay.prototype.t = function (a, b, c) {
        this.w = a;
        var d = this.x;
        if (a == null && this.y != null) {
            a = b;
            if (this.x == null) {
                d = b;
            }
        }
        if (d == this.s && this.s != null) {
            return d;
        }
        if (this.valueResolving != null) {
            var e_78 = a;
            var f = ((function () {
                var $ret = new SeriesLayerPropertyOverlayValueResolvingEventArgs();
                $ret.value = e_78;
                return $ret;
            })());
            if (!this.q) {
                this.ai(f, c);
                d = f.value;
            }
            {
                this.valueResolving(this, f);
            }
            if (f.b) {
                if (!this.q) {
                    this.aj(f, c);
                }
                d = f.value;
            }
        }
        else {
            if (!this.q) {
                d = this.v(d, c);
            }
        }
        this.s = d;
        return d;
    };
    SeriesLayerPropertyOverlay.prototype.aj = function (a, b) {
        var c = b.tr(this.aa);
        if (c == null) {
            return;
        }
        var d = PlatformAPIHelper.n(c.propertyType, a.value);
        a.value = d;
        a.b = false;
    };
    SeriesLayerPropertyOverlay.prototype.v = function (a, b) {
        var c = b.tr(this.aa);
        if (c == null) {
            return a;
        }
        var d = PlatformAPIHelper.n(c.propertyType, a);
        a = d;
        return a;
    };
    SeriesLayerPropertyOverlay.prototype.ai = function (a, b) {
        var c = b.tr(this.aa);
        if (c == null) {
            return;
        }
        var d = PlatformAPIHelper.f(c.propertyType, a.value);
        a.value = d;
        a.b = false;
    };
    SeriesLayerPropertyOverlay.prototype.u = function (a, b) {
        var c = b.tr(this.aa);
        if (c == null) {
            return a;
        }
        var d = PlatformAPIHelper.f(c.propertyType, a);
        a = d;
        return a;
    };
    Object.defineProperty(SeriesLayerPropertyOverlay.prototype, "aa", {
        get: function () {
            if (!this.q) {
                return Series.ny(this.ad);
            }
            return this.ad;
        },
        enumerable: false,
        configurable: true
    });
    SeriesLayerPropertyOverlay.$t = markType(SeriesLayerPropertyOverlay, 'SeriesLayerPropertyOverlay', DependencyObject.$, [INotifyPropertyChanged_$type]);
    SeriesLayerPropertyOverlay.$$p = markDep(DependencyProperty, PropertyMetadata, SeriesLayerPropertyOverlay, 'ah', ['CurrentValuePropertyName:y:ak', [2, null], 'IsAlwaysApplied:p:al', [0, false], 'IsSourceOverlay:r:am', [0, false], 'PropertyName:ad:an', [2, null], 'Value:x:ao', [4]]);
    return SeriesLayerPropertyOverlay;
}(DependencyObject));
export { SeriesLayerPropertyOverlay };
/**
 * @hidden
 */
var SeriesLayerPropertyOverlayCollection = /** @class */ /*@__PURE__*/ (function (_super) {
    __extends(SeriesLayerPropertyOverlayCollection, _super);
    function SeriesLayerPropertyOverlayCollection() {
        var _this = _super.call(this, SeriesLayerPropertyOverlay.$, 0) || this;
        _this.collectionResetting = null;
        return _this;
    }
    SeriesLayerPropertyOverlayCollection.prototype.p = function () {
        if (this.collectionResetting != null) {
            this.collectionResetting(this, null);
        }
        _super.prototype.p.call(this);
    };
    SeriesLayerPropertyOverlayCollection.$t = markType(SeriesLayerPropertyOverlayCollection, 'SeriesLayerPropertyOverlayCollection', ObservableCollection$1.$.specialize(SeriesLayerPropertyOverlay.$));
    return SeriesLayerPropertyOverlayCollection;
}(ObservableCollection$1));
export { SeriesLayerPropertyOverlayCollection };
/**
 * @hidden
 */
export var IDataChartToolbarProvider_$type = /*@__PURE__*/ new Type(null, 'IDataChartToolbarProvider');
/**
 * @hidden
 */
export var ISeriesViewerScrollbarManager_$type = /*@__PURE__*/ new Type(null, 'ISeriesViewerScrollbarManager');
/**
 * @hidden
 */
export var ISeriesInteractionManager_$type = /*@__PURE__*/ new Type(null, 'ISeriesInteractionManager');
/**
 * @hidden
 */
export var ISeriesViewerInteractionManager_$type = /*@__PURE__*/ new Type(null, 'ISeriesViewerInteractionManager');
/**
 * @hidden
 */
export var IDataChartVisualDataManager_$type = /*@__PURE__*/ new Type(null, 'IDataChartVisualDataManager');
/**
 * @hidden
 */
export var IAxisVisualDataManager_$type = /*@__PURE__*/ new Type(null, 'IAxisVisualDataManager');
/**
 * @hidden
 */
export var ISeriesVisualDataManager_$type = /*@__PURE__*/ new Type(null, 'ISeriesVisualDataManager');
/**
 * @hidden
 */
var XamDataChart = /** @class */ /*@__PURE__*/ (function (_super) {
    __extends(XamDataChart, _super);
    function XamDataChart() {
        var _this = _super.call(this) || this;
        _this._xsr = null;
        _this.xc = null;
        _this.yd = 1;
        _this.ye = 1;
        _this.xw = false;
        _this.x0 = false;
        _this.xz = false;
        _this.yf = 0;
        _this.yg = 0;
        _this.yx = NaN;
        _this.yy = NaN;
        _this.w7 = new AxisCollection();
        _this.axisRangeChanged = null;
        _this.xl = null;
        _this.xo = false;
        _this.ya = 0;
        _this.yc = 0;
        _this.yb = 0;
        _this.x9 = 0;
        _this.yi = NaN;
        _this.yk = NaN;
        _this.yj = NaN;
        _this.yh = NaN;
        _this.ab = XamDataChart.$;
        _this.xz = true;
        var a = _this.axes;
        a.collectionChanged = delegateCombine(a.collectionChanged, runOn(_this, _this.z4));
        var b = _this.axes;
        b.collectionResetting = delegateCombine(b.collectionResetting, runOn(_this, _this.z5));
        return _this;
    }
    Object.defineProperty(XamDataChart.prototype, "XSRP", {
        get: function () {
            if (this._xsr == null) {
                this._xsr = new SRProvider(this.c9.j.ae);
            }
            return this._xsr;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(XamDataChart.prototype, "xd", {
        get: function () {
            var _this = this;
            if (this.xc == null) {
                this.xc = DVContainer.instance.createInstance(IDataChartVisualDataManager_$type, function () { return _this.XSRP.q; });
            }
            return this.xc;
        },
        enumerable: false,
        configurable: true
    });
    XamDataChart.staticInit = function () {
        XamDataChart.yu = -1.7976931348623157E+308;
        XamDataChart.yt = 1.7976931348623157E+308;
    };
    XamDataChart.y6 = function (a) {
        if (a.dc == null) {
            return -1;
        }
        if (!a.fh) {
            return -1;
        }
        var b = XamDataChartView.aw(a);
        if (b.count == 0) {
            return -1;
        }
        var c = -1;
        for (var d = 0; d < b.count; d++) {
            c = Math.max(c, b._inner[d].index);
        }
        var e = c + 1;
        if (a.isFragment) {
            e = a.j3();
            if (e == -1) {
                return -1;
            }
            var f = a.bq();
            e = f.index + e;
        }
        if (a.bo != null) {
            e = a.j7() + a.bo.index;
            if (e == -1) {
                return -1;
            }
        }
        return e;
    };
    XamDataChart.prototype.qq = function (a, b, c, d) {
        var e_79, _a, e_80, _b, e_81, _c;
        _super.prototype.qq.call(this, a, b, c, d);
        switch (b) {
            case XamDataChart.$$p[23]:
                this.yp = this.y4;
                break;
            case XamDataChart.$$p[24]:
                this.yq = this.y5;
                break;
            case "ActualWindowScaleHorizontal":
            case "ActualWindowScaleVertical":
                if (!this.gc) {
                    this.r4(this.hu(), this.hv());
                }
                break;
            case XamDataChart.$$p[8]:
                this.c9.fr(d);
                {
                    try {
                        for (var _d = __values(fromEnum(this.axes)), _e = _d.next(); !_e.done; _e = _d.next()) {
                            var e = _e.value;
                            e.ia();
                        }
                    }
                    catch (e_79_1) {
                        e_79 = { error: e_79_1 };
                    }
                    finally {
                        try {
                            if (_e && !_e.done && (_a = _d.return))
                                _a.call(_d);
                        }
                        finally {
                            if (e_79)
                                throw e_79.error;
                        }
                    }
                }
                break;
            case XamDataChart.$$p[9]:
                this.xv = this.xu;
                break;
            case XamDataChart.$$p[22]:
                this.xy = this.x7;
                break;
            case XamDataChart.$$p[11]:
            case XamDataChart.$$p[13]:
                this.r0();
                break;
            case XamDataChart.$$p[0]:
            case XamDataChart.$$p[17]:
                if (c != d) {
                    try {
                        for (var _f = __values(fromEnum(this.axes)), _g = _f.next(); !_g.done; _g = _f.next()) {
                            var f = _g.value;
                            f.cq = true;
                            f.ia();
                        }
                    }
                    catch (e_80_1) {
                        e_80 = { error: e_80_1 };
                    }
                    finally {
                        try {
                            if (_g && !_g.done && (_b = _f.return))
                                _b.call(_f);
                        }
                        finally {
                            if (e_80)
                                throw e_80.error;
                        }
                    }
                }
                break;
            case XamDataChart.$$p[7]:
            case XamDataChart.$$p[5]:
            case XamDataChart.$$p[6]:
                try {
                    for (var _h = __values(fromEnum(this.axes)), _j = _h.next(); !_j.done; _j = _h.next()) {
                        var g = _j.value;
                        g.im();
                    }
                }
                catch (e_81_1) {
                    e_81 = { error: e_81_1 };
                }
                finally {
                    try {
                        if (_j && !_j.done && (_c = _h.return))
                            _c.call(_h);
                    }
                    finally {
                        if (e_81)
                            throw e_81.error;
                    }
                }
                break;
            case XamDataChart.$$p[4]:
                this.z8();
                break;
        }
    };
    XamDataChart.prototype.q8 = function () {
        _super.prototype.q8.call(this);
        if (this.w6 == 1 || this.w6 == 2) {
            this.aac();
        }
    };
    XamDataChart.prototype.o4 = function () {
        _super.prototype.o4.call(this);
        if (this.xp && this.w6 != 0) {
            if (!this.x6) {
                this.aac();
            }
        }
    };
    XamDataChart.prototype.ot = function (a, b) {
        _super.prototype.ot.call(this, a, b);
        if (this.xp && this.w6 == 2) {
            if (!a.isEmpty && !b.isEmpty) {
                if (Math.abs(a.width - b.width) > 1E-10) {
                    if (!this.x6) {
                        this.aac();
                    }
                }
            }
        }
    };
    XamDataChart.prototype.oz = function () {
        _super.prototype.oz.call(this);
        if (this.w9 == 1) {
            this.z8();
        }
    };
    XamDataChart.prototype.aad = function () {
        this.z8();
    };
    XamDataChart.prototype.z8 = function () {
        var e_82, _a, e_83, _b;
        var a = this.aa8();
        this.xo = false;
        if (!isNaN_(this.y0)) {
            this.ym = this.y0;
        }
        else {
            this.ym = a.left;
        }
        if (!isNaN_(this.y2)) {
            this.yo = this.y2;
        }
        else {
            this.yo = a.top;
        }
        if (!isNaN_(this.y1)) {
            this.yn = this.y1;
        }
        else {
            this.yn = a.right;
        }
        if (!isNaN_(this.yz)) {
            this.yl = this.yz;
        }
        else {
            this.yl = a.bottom;
        }
        this.wl = this.wj(this.wz);
        if (this.xo) {
            this.xo = false;
            try {
                for (var _c = __values(fromEnum(this.axes)), _d = _c.next(); !_d.done; _d = _c.next()) {
                    var b = _d.value;
                    b.cq = true;
                    b.ia();
                }
            }
            catch (e_82_1) {
                e_82 = { error: e_82_1 };
            }
            finally {
                try {
                    if (_d && !_d.done && (_a = _c.return))
                        _a.call(_c);
                }
                finally {
                    if (e_82)
                        throw e_82.error;
                }
            }
            try {
                for (var _e = __values(fromEnum(this.series)), _f = _e.next(); !_f.done; _f = _e.next()) {
                    var c = _f.value;
                    c.ru(false);
                }
            }
            catch (e_83_1) {
                e_83 = { error: e_83_1 };
            }
            finally {
                try {
                    if (_f && !_f.done && (_b = _e.return))
                        _b.call(_e);
                }
                finally {
                    if (e_83)
                        throw e_83.error;
                }
            }
        }
    };
    XamDataChart.prototype.aa8 = function () {
        this.aaf();
        switch (this.w9) {
            case 1:
                var a = this.aa9();
                return a;
            default: return new Thickness(1, 0, 0, 0, 0);
        }
    };
    XamDataChart.prototype.aaf = function () {
        this.b0 = this.xf();
        this.b2 = this.xi();
    };
    XamDataChart.prototype.xi = function () {
        var e_84, _a;
        var a = 1;
        try {
            for (var _b = __values(fromEnum(this.series)), _c = _b.next(); !_c.done; _c = _b.next()) {
                var b = _c.value;
                var c = b.cm();
                a = this.xh(a, c);
            }
        }
        catch (e_84_1) {
            e_84 = { error: e_84_1 };
        }
        finally {
            try {
                if (_c && !_c.done && (_a = _b.return))
                    _a.call(_b);
            }
            finally {
                if (e_84)
                    throw e_84.error;
            }
        }
        return a;
    };
    XamDataChart.prototype.xh = function (a, b) {
        switch (a) {
            case 2: return 2;
            case 4:
                if (b == 2 || b == 3) {
                    return 2;
                }
                return a;
            case 3:
                if (b == 2 || b == 4) {
                    return 2;
                }
                return a;
            case 1: return b;
        }
        return a;
    };
    XamDataChart.prototype.xf = function () {
        var e_85, _a;
        var a = 1;
        try {
            for (var _b = __values(fromEnum(this.series)), _c = _b.next(); !_c.done; _c = _b.next()) {
                var b = _c.value;
                var c = b.cl();
                a = this.xe(a, c);
            }
        }
        catch (e_85_1) {
            e_85 = { error: e_85_1 };
        }
        finally {
            try {
                if (_c && !_c.done && (_a = _b.return))
                    _a.call(_b);
            }
            finally {
                if (e_85)
                    throw e_85.error;
            }
        }
        return a;
    };
    XamDataChart.prototype.xe = function (a, b) {
        switch (a) {
            case 2: return 2;
            case 4:
                if (b == 2 || b == 3) {
                    return 2;
                }
                return a;
            case 3:
                if (b == 2 || b == 4) {
                    return 2;
                }
                return a;
            case 1: return b;
        }
        return a;
    };
    XamDataChart.prototype.aa9 = function () {
        var a = new Thickness(1, 0, 0, 0, 0);
        for (var b = 0; b < this.series.count; b++) {
            var c = this.series._inner[b];
            var d = c.wz();
            a = new Thickness(1, Math.max(d.left, a.left), Math.max(d.top, a.top), Math.max(d.right, a.right), Math.max(d.bottom, a.bottom));
        }
        return a;
    };
    XamDataChart.prototype.aba = function (a, b) {
        var c = new Thickness(1, 0, 0, 0, 0);
        for (var d = 0; d < this.series.count; d++) {
            var e = this.series._inner[d];
            var f = e.w1(a, b);
            c = new Thickness(1, Math.max(f.left, c.left), Math.max(f.top, c.top), Math.max(f.right, c.right), Math.max(f.bottom, c.bottom));
        }
        return c;
    };
    XamDataChart.prototype.get_ex = function () {
        return this.w9 == 1;
    };
    XamDataChart.prototype.hu = function () {
        return this.yp;
    };
    XamDataChart.prototype.hv = function () {
        return this.yq;
    };
    XamDataChart.prototype.rt = function () {
        _super.prototype.rt.call(this);
        this.yp = this.wh.width;
        this.yq = this.wh.height;
    };
    Object.defineProperty(XamDataChart.prototype, "yp", {
        get: function () {
            return this.yd;
        },
        set: function (a) {
            var b = this.yd;
            this.yd = a;
            this.qv("ActualWindowScaleHorizontal", b, this.yd);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(XamDataChart.prototype, "yq", {
        get: function () {
            return this.ye;
        },
        set: function (a) {
            var b = this.ye;
            this.ye = a;
            this.qv("ActualWindowScaleVertical", b, this.ye);
        },
        enumerable: false,
        configurable: true
    });
    XamDataChart.prototype.fl = function () {
        return this.xv;
    };
    XamDataChart.prototype.fm = function () {
        return this.xy;
    };
    Object.defineProperty(XamDataChart.prototype, "xp", {
        get: function () {
            return this.x1 || this.x4;
        },
        enumerable: false,
        configurable: true
    });
    XamDataChart.prototype.get_fu = function () {
        return this.xq;
    };
    Object.defineProperty(XamDataChart.prototype, "xq", {
        get: function () {
            return this.x5 || (this.ft && this.w6 != 0);
        },
        enumerable: false,
        configurable: true
    });
    XamDataChart.prototype.get_ft = function () {
        return this.x4;
    };
    XamDataChart.prototype.get_fs = function () {
        return this.x1;
    };
    XamDataChart.prototype.aac = function () {
        this.xw = false;
        this.x0 = true;
        this.xz = true;
        for (var a = 0; a < this.axes.count; a++) {
            this.axes._inner[a].cq = true;
            this.axes._inner[a].ia();
        }
    };
    XamDataChart.prototype.aab = function () {
        this.xw = false;
        this.xz = true;
        for (var a = 0; a < this.axes.count; a++) {
            this.axes._inner[a].cq = true;
            this.axes._inner[a].ia();
        }
    };
    XamDataChart.prototype.aaa = function (a, b, c, d) {
        if (a.ad == null) {
            return;
        }
        if (a.ad.cq || a.ad.kh.isEmpty) {
            return;
        }
        var e = false;
        for (var f = 0; f < this.axes.count; f++) {
            var g = this.axes._inner[f].aw.bh;
            this.axes._inner[f].aw.ca();
            if (this.axes._inner[f].aw.bh != g) {
                e = true;
            }
        }
        if (e) {
            return;
        }
        if (isNaN_(this.yx)) {
            this.yx = this.c9.a4;
            this.yy = this.c9.a5;
        }
        var h = false;
        var i = false;
        var j = 0;
        if (a.au) {
            var k = this.xz;
            if (this.x4 && this.xz) {
                j = this.y3(a, b, c, d);
                this.xz = false;
                if (a.bl() != j) {
                    if (j == 0 && a.ad.b4) {
                        if (k) {
                            this.x0 = true;
                            a.ad.id();
                            h = true;
                            i = true;
                        }
                    }
                    else {
                        if ((j > a.bl()) || k) {
                            this.x0 = true;
                            a.ad.ij(j);
                            h = true;
                            i = true;
                        }
                    }
                }
            }
        }
        this.ei = h;
        if (a.bl() != 0 || j != 0 || h) {
            var l = a.bl();
            var m = c.left + c.width / 2;
            var n = d.left + d.width / 2;
            if (a.av) {
                m = c.left;
                n = d.left;
            }
            if (l == 0) {
                m = m - a.c3.width / 2;
                n = n - a.c3.width / 2;
            }
            var o = a.cz(new Rect(0, m, c.top, a.c3.width, a.c3.height), l);
            var p = a.cz(new Rect(0, n, d.top, a.c3.width, a.c3.height), l);
            c = o;
            d = p;
        }
        var q = false;
        if (this.x0) {
            this.x0 = false;
            q = true;
        }
        this.xw = true;
        var r = 0;
        var s = 0;
        var t = 0;
        var u = c.left + t;
        var v = d.right + t;
        var w = 0;
        w = this.wz.right + this.c9.a5;
        if (u < 0) {
            r = -u;
            r += this.yr;
        }
        if (v > w) {
            s = v - w;
            s += this.yr;
        }
        if (q) {
            if (u > 0) {
                r = -u;
                r += this.yr;
            }
            if (v < w) {
                s = -(w - v);
                s += this.yr;
            }
        }
        var x = false;
        var y = false;
        if (r != 0 || s != 0) {
            x = true;
            this.yf = this.yf + r;
            this.yg = this.yg + s;
            if (this.yf > this.ys) {
                this.yf = this.ys;
                y = true;
            }
            if (this.yg > this.ys) {
                this.yg = this.ys;
                y = true;
            }
            if (this.yf < 0) {
                this.yf = 0;
                y = true;
            }
            if (this.yg < 0) {
                this.yg = 0;
                y = true;
            }
        }
        else {
            if (this.ei) {
                this.z7();
            }
            return;
        }
        this.gb = true;
        this.h4 = this.yx + this.yf;
        this.h9 = this.yy + this.yg;
        this.gb = false;
        this.fq = x;
        if (y) {
            if (q && (this.fq || this.ei)) {
                this.z7();
            }
            return;
        }
        if (this.fq || this.ei) {
            this.z7();
        }
    };
    XamDataChart.prototype.y3 = function (a, b, c, d) {
        var e = this.yv(-1, a, b, c, d);
        var f = a.bl();
        if (e < f) {
            var g = c.left + c.width / 2;
            var h = d.left + d.width / 2;
            if (a.av) {
                g = c.left;
                h = d.left;
            }
            var i = a.cz(new Rect(0, g, c.top, a.c3.width, a.c3.height), e);
            var j = a.cz(new Rect(0, h, d.top, a.c3.width, a.c3.height), e);
            if (e == 0) {
                i = new Rect(0, g - a.c3.width / 2, c.top, a.c3.width, a.c3.height);
                j = new Rect(0, h - a.c3.width / 2, d.top, a.c3.width, a.c3.height);
            }
            var k = a.cz(new Rect(0, g, c.top, a.c3.width, a.c3.height), f);
            var l = a.cz(new Rect(0, h, d.top, a.c3.width, a.c3.height), f);
            var m = j.right - l.right;
            var n = 0;
            var o = 0;
            o = this.wz.right + this.c9.a5;
            var p = i.left + n;
            var q = j.right + n;
            var r = 0;
            var s = 0;
            if (p < 0) {
                r = -p;
                r += this.yr;
            }
            if (q > o) {
                s = q - o;
                s += this.yr;
            }
            var t = false;
            if (this.x0 || this.xz) {
                t = true;
            }
            if (t) {
                if (p > 0) {
                    r = -p;
                    r += this.yr;
                }
                if (q < o) {
                    s = -(o - q);
                    s += this.yr;
                }
            }
            var u = false;
            var v = false;
            var w = 0;
            var x = 0;
            if (r != 0 || s != 0) {
                v = true;
                w = this.yf + r;
                x = this.yg + s;
                if (w > this.ys) {
                    w = this.ys;
                    u = true;
                }
                if (x > this.ys) {
                    x = this.ys;
                    u = true;
                }
                if (w < 0) {
                    w = 0;
                    u = true;
                }
                if (x < 0) {
                    x = 0;
                    u = true;
                }
            }
            var y = this.c9.a4;
            var z = this.c9.a5;
            var aa = new Thickness(1, this.yx + w, 0, this.yy + x, 0);
            var ab = (aa.left - y) + (aa.right - z);
            var ac = a.ad.kb().width;
            var ad = ac - ab;
            var ae = ad / ac;
            var af = a.bn() * ae;
            var ag = this.yv(af, a, b, c, d);
            if (ag == e) {
                return e;
            }
            else {
                return f;
            }
        }
        return e;
    };
    XamDataChart.prototype.yv = function (a, b, c, d, e) {
        var f = b.c3;
        var g = b.bn();
        if (a < 0) {
        }
        if (a > 0) {
            g = a;
        }
        if (f.width < g) {
            return 0;
        }
        var h = 45;
        var i = new Rect(0, 0, f.top, f.width, f.height);
        var j = new Rect(0, g, f.top, f.width, f.height);
        var k = b.ac(i, h);
        var l = b.ac(j, h);
        var m = true;
        for (var n = 0; n < k.length; n++) {
            if (PolygonUtil.a(l, k[n])) {
                m = false;
                break;
            }
        }
        if (!m) {
            h = 90;
        }
        return h;
    };
    XamDataChart.prototype.z7 = function () {
        for (var a = 0; a < this.axes.count; a++) {
            this.axes._inner[a].cq = true;
            this.axes._inner[a].ib(false);
        }
        this.n0(true, false, false);
        this.xw = false;
        for (var b = 0; b < this.axes.count; b++) {
            this.axes._inner[b].cq = true;
            this.axes._inner[b].ib(false);
        }
        this.n0(true, false, false);
    };
    Object.defineProperty(XamDataChart.prototype, "axes", {
        get: function () {
            return this.w7;
        },
        enumerable: false,
        configurable: true
    });
    XamDataChart.prototype.z4 = function (a, b) {
        var e_86, _a, e_87, _b, e_88, _c;
        if (b.oldItems != null) {
            try {
                for (var _d = __values(fromEn(b.oldItems)), _e = _d.next(); !_e.done; _e = _d.next()) {
                    var c = _e.value;
                    if (c != null) {
                        c.bo = null;
                        c.bi = null;
                        this.rc(c);
                        this.c9.dw(c);
                        c.rangeChanged = delegateRemove(c.rangeChanged, runOn(this, this.z6));
                        this.c9.dx(c);
                        if (c.df != null) {
                            try {
                                for (var _f = (e_87 = void 0, __values(fromEnum(c.db()))), _g = _f.next(); !_g.done; _g = _f.next()) {
                                    var d = _g.value;
                                    d.ru(false);
                                }
                            }
                            catch (e_87_1) {
                                e_87 = { error: e_87_1 };
                            }
                            finally {
                                try {
                                    if (_g && !_g.done && (_b = _f.return))
                                        _b.call(_f);
                                }
                                finally {
                                    if (e_87)
                                        throw e_87.error;
                                }
                            }
                        }
                    }
                }
            }
            catch (e_86_1) {
                e_86 = { error: e_86_1 };
            }
            finally {
                try {
                    if (_e && !_e.done && (_a = _d.return))
                        _a.call(_d);
                }
                finally {
                    if (e_86)
                        throw e_86.error;
                }
            }
            if (this.axes.count == 0) {
                this.rh();
            }
        }
        if (b.newItems != null) {
            try {
                for (var _h = __values(fromEn(b.newItems)), _j = _h.next(); !_j.done; _j = _h.next()) {
                    var e = _j.value;
                    if (e != null) {
                        this.rw(e);
                        e.bo = this.actualSyncLink;
                        e.bi = this;
                        e.a5.a2();
                        this.c9.bo(e);
                        e.rangeChanged = delegateCombine(e.rangeChanged, runOn(this, this.z6));
                        this.c9.bl(e);
                    }
                }
            }
            catch (e_88_1) {
                e_88 = { error: e_88_1 };
            }
            finally {
                try {
                    if (_j && !_j.done && (_c = _h.return))
                        _c.call(_h);
                }
                finally {
                    if (e_88)
                        throw e_88.error;
                }
            }
        }
        this.oq();
        if (!this.x6 && this.fu) {
            this.q8();
        }
    };
    XamDataChart.prototype.z5 = function (a, b) {
        var e_89, _a, e_90, _b, e_91, _c, e_92, _d;
        var c = new List$1(Series.$, 0);
        try {
            for (var _e = __values(fromEnum(this.axes)), _f = _e.next(); !_f.done; _f = _e.next()) {
                var d = _f.value;
                if (d.df != null) {
                    try {
                        for (var _g = (e_90 = void 0, __values(fromEnum(d.db()))), _h = _g.next(); !_h.done; _h = _g.next()) {
                            var e = _h.value;
                            if (!c.contains(e)) {
                                c.add(e);
                            }
                        }
                    }
                    catch (e_90_1) {
                        e_90 = { error: e_90_1 };
                    }
                    finally {
                        try {
                            if (_h && !_h.done && (_b = _g.return))
                                _b.call(_g);
                        }
                        finally {
                            if (e_90)
                                throw e_90.error;
                        }
                    }
                }
                d.bo = null;
                d.bi = null;
                this.rc(d);
                this.c9.dw(d);
                d.rangeChanged = delegateRemove(d.rangeChanged, runOn(this, this.z6));
                this.c9.dx(d);
                this.rh();
            }
        }
        catch (e_89_1) {
            e_89 = { error: e_89_1 };
        }
        finally {
            try {
                if (_f && !_f.done && (_a = _e.return))
                    _a.call(_e);
            }
            finally {
                if (e_89)
                    throw e_89.error;
            }
        }
        try {
            for (var _j = __values(fromEnum(this.series)), _k = _j.next(); !_k.done; _k = _j.next()) {
                var f = _k.value;
                if (!c.contains(f)) {
                    c.add(f);
                }
            }
        }
        catch (e_91_1) {
            e_91 = { error: e_91_1 };
        }
        finally {
            try {
                if (_k && !_k.done && (_c = _j.return))
                    _c.call(_j);
            }
            finally {
                if (e_91)
                    throw e_91.error;
            }
        }
        try {
            for (var _l = __values(fromEnum(c)), _m = _l.next(); !_m.done; _m = _l.next()) {
                var g = _m.value;
                g.ru(false);
            }
        }
        catch (e_92_1) {
            e_92 = { error: e_92_1 };
        }
        finally {
            try {
                if (_m && !_m.done && (_d = _l.return))
                    _d.call(_l);
            }
            finally {
                if (e_92)
                    throw e_92.error;
            }
        }
    };
    XamDataChart.prototype.z6 = function (a, b) {
        var e_93, _a, e_94, _b, e_95, _c;
        var c = typeCast(Axis.$, a);
        if (c == null) {
            return;
        }
        this.oq();
        if (this.axisRangeChanged != null) {
            this.axisRangeChanged(this, new ChartAxisRangeChangedEventArgs(this, c, b.oldMinimumValue, b.minimumValue, b.oldMaximumValue, b.maximumValue));
        }
        if (c.aj != null) {
            c.aj.h7();
        }
        c.h7();
        var d = this.ej;
        if (typeCast(CategoryAxisBase.$, c) !== null) {
            d = true;
        }
        try {
            for (var _d = __values(fromEnum(c.db())), _e = _d.next(); !_e.done; _e = _d.next()) {
                var e = _e.value;
                e.g1 = true;
                this.oq();
                e.ru(d);
            }
        }
        catch (e_93_1) {
            e_93 = { error: e_93_1 };
        }
        finally {
            try {
                if (_e && !_e.done && (_a = _d.return))
                    _a.call(_d);
            }
            finally {
                if (e_93)
                    throw e_93.error;
            }
        }
        if (c.bi != null) {
            try {
                for (var _f = __values(fromEnum(c.bi.series)), _g = _f.next(); !_g.done; _g = _f.next()) {
                    var f = _g.value;
                    XamDataChart.z9(c, d, f);
                }
            }
            catch (e_94_1) {
                e_94 = { error: e_94_1 };
            }
            finally {
                try {
                    if (_g && !_g.done && (_b = _f.return))
                        _b.call(_f);
                }
                finally {
                    if (e_94)
                        throw e_94.error;
                }
            }
        }
        try {
            for (var _h = __values(fromEnum(this.axes)), _j = _h.next(); !_j.done; _j = _h.next()) {
                var g = _j.value;
                if (g != c && g.aj != null && g.aj == c) {
                    g.h7();
                }
            }
        }
        catch (e_95_1) {
            e_95 = { error: e_95_1 };
        }
        finally {
            try {
                if (_j && !_j.done && (_c = _h.return))
                    _c.call(_h);
            }
            finally {
                if (e_95)
                    throw e_95.error;
            }
        }
    };
    XamDataChart.z9 = function (a, b, c) {
    };
    XamDataChart.prototype.r2 = function (a, b) {
        var e_96, _a;
        _super.prototype.r2.call(this, a, b);
        if (this.axes == null) {
            return;
        }
        try {
            for (var _b = __values(fromEnum(this.axes)), _c = _b.next(); !_c.done; _c = _b.next()) {
                var c = _c.value;
                c.bo = this.actualSyncLink;
                c.bi = this;
            }
        }
        catch (e_96_1) {
            e_96 = { error: e_96_1 };
        }
        finally {
            try {
                if (_c && !_c.done && (_a = _b.return))
                    _a.call(_b);
            }
            finally {
                if (e_96)
                    throw e_96.error;
            }
        }
    };
    XamDataChart.prototype.getFontInfo = function () {
        this.xl = this.xk.fo;
        return this.xl;
    };
    XamDataChart.prototype.aae = function () {
        var e_97, _a, e_98, _b;
        this.c9.ee();
        try {
            for (var _c = __values(fromEnum(this.axes)), _d = _c.next(); !_d.done; _d = _c.next()) {
                var a = _d.value;
                a.ib(false);
            }
        }
        catch (e_97_1) {
            e_97 = { error: e_97_1 };
        }
        finally {
            try {
                if (_d && !_d.done && (_a = _c.return))
                    _a.call(_c);
            }
            finally {
                if (e_97)
                    throw e_97.error;
            }
        }
        try {
            for (var _e = __values(fromEnum(this.series)), _f = _e.next(); !_f.done; _f = _e.next()) {
                var b = _f.value;
                b.cw.bx();
                b.ru(false);
            }
        }
        catch (e_98_1) {
            e_98 = { error: e_98_1 };
        }
        finally {
            try {
                if (_f && !_f.done && (_b = _e.return))
                    _b.call(_e);
            }
            finally {
                if (e_98)
                    throw e_98.error;
            }
        }
    };
    XamDataChart.prototype.getFontBrush = function () {
        return this.xk.fw;
    };
    XamDataChart.prototype.nt = function () {
        _super.prototype.nt.call(this);
        var a = new List$1(Axis.$, 0);
        for (var b = 0; b < this.axes.count; b++) {
            a.add(this.axes._inner[b]);
        }
        for (var c = 0; c < a.count; c++) {
            this.axes.remove(a._inner[c]);
            if (typeCast(CategoryAxisBase.$, a._inner[c]) !== null) {
                var d = a._inner[c];
                this.re(d.name, true);
                d.itemsSource = null;
            }
            a._inner[c].h0(null, null);
        }
    };
    XamDataChart.prototype.vl = function () {
        return this.xk.fs;
    };
    XamDataChart.prototype.f3 = function () {
        return true;
    };
    XamDataChart.prototype.rx = function () {
        var e_99, _a;
        _super.prototype.rx.call(this);
        if (!this.fo) {
            return;
        }
        try {
            for (var _b = __values(fromEnum(this.axes)), _c = _b.next(); !_c.done; _c = _b.next()) {
                var a = _c.value;
                this.rw(a);
            }
        }
        catch (e_99_1) {
            e_99 = { error: e_99_1 };
        }
        finally {
            try {
                if (_c && !_c.done && (_a = _b.return))
                    _a.call(_b);
            }
            finally {
                if (e_99)
                    throw e_99.error;
            }
        }
    };
    XamDataChart.prototype.eu = function () {
        if (this.xx) {
            return true;
        }
        return this.xt();
    };
    XamDataChart.prototype.xt = function () {
        for (var a = 0; a < this.series.count; a++) {
            if (this.series._inner[a].fu || this.series._inner[a].fq) {
                return true;
            }
        }
        for (var b = 0; b < this.axes.count; b++) {
            if (this.axes._inner[b].b9 || this.axes._inner[b].cm) {
                return true;
            }
        }
        return false;
    };
    XamDataChart.prototype.c8 = function () {
        return new XamDataChartView(this);
    };
    XamDataChart.prototype.qe = function (a) {
        _super.prototype.qe.call(this, a);
        this.xk = a;
    };
    XamDataChart.prototype.q9 = function () {
        for (var a = 0; a < this.w7.count; a++) {
            this.w7._inner[a].cq = true;
            this.w7._inner[a].ib(false);
        }
        _super.prototype.q9.call(this);
    };
    Object.defineProperty(XamDataChart.prototype, "ym", {
        get: function () {
            return this.ya;
        },
        set: function (a) {
            var b = this.ya;
            this.ya = a;
            if (this.ya != b) {
                this.xo = true;
                this.qv(XamDataChart.y9, b, this.ya);
            }
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(XamDataChart.prototype, "yo", {
        get: function () {
            return this.yc;
        },
        set: function (a) {
            var b = this.yc;
            this.yc = a;
            if (this.yc != b) {
                this.xo = true;
                this.qv(XamDataChart.zb, b, this.yc);
            }
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(XamDataChart.prototype, "yn", {
        get: function () {
            return this.yb;
        },
        set: function (a) {
            var b = this.yb;
            this.yb = a;
            if (this.yb != b) {
                this.xo = true;
                this.qv(XamDataChart.za, b, this.yb);
            }
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(XamDataChart.prototype, "yl", {
        get: function () {
            return this.x9;
        },
        set: function (a) {
            var b = this.x9;
            this.x9 = a;
            if (this.x9 != b) {
                this.xo = true;
                this.qv(XamDataChart.y8, b, this.x9);
            }
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(XamDataChart.prototype, "y0", {
        get: function () {
            return this.yi;
        },
        set: function (a) {
            this.yi = a;
            this.z8();
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(XamDataChart.prototype, "y2", {
        get: function () {
            return this.yk;
        },
        set: function (a) {
            this.yk = a;
            this.z8();
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(XamDataChart.prototype, "y1", {
        get: function () {
            return this.yj;
        },
        set: function (a) {
            this.yj = a;
            this.z8();
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(XamDataChart.prototype, "yz", {
        get: function () {
            return this.yh;
        },
        set: function (a) {
            this.yh = a;
            this.z8();
        },
        enumerable: false,
        configurable: true
    });
    XamDataChart.prototype.wj = function (a) {
        var b = _super.prototype.wj.call(this, a);
        if (a.isEmpty) {
            return Rect.empty;
        }
        if (this.ym == 0 && this.yo == 0 && this.yn == 0 && this.yl == 0) {
            return b;
        }
        if (this.ym + this.yn >= a.width || this.yo + this.yl >= a.height) {
            return b;
        }
        var c = new Rect(0, a.left + this.ym, a.top + this.yo, a.width - this.ym - this.yn, a.height - this.yo - this.yl);
        if (this.eu()) {
            var d = void 0;
            if (c.width > c.height) {
                var e = intDivide(truncate((c.width - c.height)), 2);
                d = new Rect(0, c.left + e, c.top, c.height, c.height);
            }
            else {
                var f = intDivide(truncate((c.height - c.width)), 2);
                d = new Rect(0, c.left, c.top + f, c.width, c.width);
            }
            return d;
        }
        return c;
    };
    XamDataChart.prototype.wq = function () {
        var a = this.wz;
        var b = this.w0;
        var c = this.wl;
        if (c.isEmpty || a.isEmpty) {
            return a;
        }
        if (c.containsRect(a)) {
            return a;
        }
        if (a.containsRect(c)) {
            return c;
        }
        return a;
    };
    XamDataChart.prototype.y7 = function () {
        return this.xd.exportVisualData(this);
    };
    XamDataChart.prototype.zm = function () {
        var cvd_ = this.y7();
        cvd_.scaleByViewport();
        return (cvd_.serialize());
    };
    XamDataChart.prototype.qn = function () {
        _super.prototype.qn.call(this);
        for (var a = 0; a < this.axes.count; a++) {
            var b = this.axes._inner[a];
            var c = 50;
            if (!isNaN_(b.aw.bh)) {
                c = b.aw.bh;
            }
            b.d4 = c;
        }
    };
    XamDataChart.prototype.rb = function () {
        _super.prototype.rb.call(this);
        for (var a = 0; a < this.axes.count; a++) {
            var b = this.axes._inner[a];
            b.d4 = NaN;
            b.cq = true;
            b.ib(false);
        }
    };
    XamDataChart.prototype.x8 = function (a) {
        var e_100, _a;
        var b = new List$1(Axis.$, 0);
        try {
            for (var _b = __values(fromEnum(this.series)), _c = _b.next(); !_c.done; _c = _b.next()) {
                var c = _c.value;
                var d = c.aw(a);
                if (d != null) {
                    b.add(d);
                }
            }
        }
        catch (e_100_1) {
            e_100 = { error: e_100_1 };
        }
        finally {
            try {
                if (_c && !_c.done && (_a = _b.return))
                    _a.call(_b);
            }
            finally {
                if (e_100)
                    throw e_100.error;
            }
        }
        return b;
    };
    XamDataChart.$t = markType(XamDataChart, 'XamDataChart', SeriesViewer.$);
    XamDataChart.yu = 0;
    XamDataChart.yt = 0;
    XamDataChart.y9 = "ActualPlotAreaMarginLeft";
    XamDataChart.zb = "ActualPlotAreaMarginTop";
    XamDataChart.za = "ActualPlotAreaMarginRight";
    XamDataChart.y8 = "ActualPlotAreaMarginBottom";
    XamDataChart.$$p = markDep(DependencyProperty, PropertyMetadata, XamDataChart, 'qv', ['AlignsGridLinesToPixels:xr:aag', [0, true], 'AutoExpandMarginExtraPadding:yr:aah', [1, DeviceUtils.g(2)], 'AutoExpandMarginMaximumValue:ys:aai', [1, 60], 'AutoMarginAndAngleUpdateMode:w6:aaj', [AutoMarginsAndAngleUpdateMode_$type, enumGetBox(AutoMarginsAndAngleUpdateMode_$type, 0)], 'ComputedPlotAreaMarginMode:w9:aak', [ComputedPlotAreaMarginMode_$type, enumGetBox(ComputedPlotAreaMarginMode_$type, 0)], 'DefaultAxisMajorStroke:aa5:aal', [Brush.$, null], 'DefaultAxisMinorStroke:aa6:aam', [Brush.$, null], 'DefaultAxisStroke:aa7:aan', [Brush.$, null], 'GridMode:xb:aao', [GridMode_$type, enumGetBox(GridMode_$type, 2)], 'HorizontalZoomable:xu:aap', [0, false], 'InitialCloseGridlinesThreshold:yw:aaq', [1, NaN], 'IsHorizontalZoomEnabled:xv:aar', [0, false], 'IsSquare:xx:aas', [0, false], 'IsVerticalZoomEnabled:xy:aat', [0, false], 'SeriesPlotAreaMarginHorizontalMode:xg:aau', [SeriesPlotAreaMarginHorizontalMode_$type, enumGetBox(SeriesPlotAreaMarginHorizontalMode_$type, 0)], 'SeriesPlotAreaMarginVerticalMode:xj:aav', [SeriesPlotAreaMarginVerticalMode_$type, enumGetBox(SeriesPlotAreaMarginVerticalMode_$type, 0)], 'ShouldAutoExpandMarginForInitialLabels:x1:aaw', [0, false], 'ShouldClipGridlines:x2:aax', [0, true], 'ShouldClipInitialCloseGridlines:x3:aay', [0, true], 'ShouldConsiderAutoRotationForInitialLabels:x4:aaz', [0, false], 'ShouldSuppressAxisLabelTruncation:x5:aa0', [0, false], 'SuppressAutoMarginAndAngleRecalculation:x6:aa1', [0, false], 'VerticalZoomable:x7:aa2', [0, false], 'WindowScaleHorizontal:y4:aa3', [1, NaN], 'WindowScaleVertical:y5:aa4', [1, NaN]]);
    return XamDataChart;
}(SeriesViewer));
export { XamDataChart };
/**
 * @hidden
 */
var LabelPanelArranger = /** @class */ /*@__PURE__*/ (function (_super) {
    __extends(LabelPanelArranger, _super);
    function LabelPanelArranger() {
        return _super !== null && _super.apply(this, arguments) || this;
    }
    LabelPanelArranger.e = function (a, b) {
        var e_101, _a;
        try {
            for (var _b = __values(fromEnum(a)), _c = _b.next(); !_c.done; _c = _b.next()) {
                var c = _c.value;
                var d = c.ad;
                var e = d.aj;
                e = LabelPanelArranger.a(c, d, e);
                var f = LabelPanelArranger.b(c);
                var g = 0;
                var h = 0;
                var i = 0;
                if (d.b8()) {
                    c.af.ac();
                    i = c.bh;
                }
                else {
                    i = c.bi(b);
                }
                g = i;
                h = i;
                if (c.ad.az != null && c.ad.az.visibility != 0) {
                    h = 0;
                    g = 0;
                }
                if (c.aq()) {
                    switch (f) {
                        case 0:
                            b.y = Math.max(0, b.top + h);
                            b.height = Math.max(0, b.height - h);
                            d.az.c = 0;
                            break;
                        case 4:
                            if (e != null && (c.bg - b.top < h && typeCast(HorizontalAxisLabelPanel.$, c) !== null)) {
                                d.az.c = 5;
                            }
                            else {
                                d.az.c = 4;
                            }
                            break;
                        case 5:
                            if (e != null && (b.bottom - c.bg < h && typeCast(HorizontalAxisLabelPanel.$, c) !== null)) {
                                if (d.az != null) {
                                    d.az.c = 4;
                                }
                            }
                            else {
                                if (d.az != null) {
                                    d.az.c = 5;
                                }
                            }
                            break;
                        case 1:
                        default:
                            if (d.az != null) {
                                d.az.c = 1;
                            }
                            b.height = Math.max(0, b.height - h);
                            break;
                    }
                }
                if (typeCast(VerticalAxisLabelPanel.$, c) !== null) {
                    switch (f) {
                        case 3:
                            b.width = Math.max(0, b.width - g);
                            d.az.c = 3;
                            break;
                        case 6:
                            if (e != null && c.bg - b.left < g) {
                                d.az.c = 7;
                            }
                            else {
                                d.az.c = 6;
                            }
                            break;
                        case 7:
                            if (e != null && b.right - c.bg < g) {
                                d.az.c = 6;
                            }
                            else {
                                d.az.c = 7;
                            }
                            break;
                        case 2:
                        default:
                            if (d.az != null) {
                                d.az.c = 2;
                            }
                            b.x = Math.max(0, b.left + g);
                            b.width = Math.max(0, b.width - g);
                            break;
                    }
                }
                if (c.ad.b9) {
                    if (d.az != null) {
                        d.az.c = f;
                    }
                }
            }
        }
        catch (e_101_1) {
            e_101 = { error: e_101_1 };
        }
        finally {
            try {
                if (_c && !_c.done && (_a = _b.return))
                    _a.call(_b);
            }
            finally {
                if (e_101)
                    throw e_101.error;
            }
        }
        return b;
    };
    LabelPanelArranger.a = function (a, b, c) {
        return b.ak();
    };
    LabelPanelArranger.b = function (a) {
        if (a == null) {
            return 1;
        }
        else {
            var b = a.ad;
            if (b != null && b.az != null) {
                var c = b.az.c;
                if (!a.ay(c)) {
                    return a.ai();
                }
                return c;
            }
            else {
                return a.ai();
            }
        }
    };
    LabelPanelArranger.c = function (a, b, c, d) {
        var e = a.ad;
        var f = e.aj;
        f = LabelPanelArranger.a(a, e, f);
        var g = LabelPanelArranger.b(a);
        var h;
        var i = a.bi(c);
        var j = Math.max(0, i);
        var k = Math.max(0, i);
        if (a.ad != null && a.ad.az != null && a.ad.az.visibility == 1) {
            return;
        }
        switch (g) {
            case 3:
                b.g = b.g - k;
                b.d = b.d - k;
                h = new Rect(0, b.g, c.top, k, c.height);
                d(a, h);
                break;
            case 2:
                h = new Rect(0, b.f, c.top, k, c.height);
                d(a, h);
                b.f = b.f + k;
                b.c = b.c + k;
                break;
            case 7:
                if (f != null) {
                    h = new Rect(0, b.f + a.bg, c.top, k, c.height);
                }
                else {
                    b.d = b.d - k;
                    h = new Rect(0, b.d, c.top, k, c.height);
                }
                d(a, h);
                break;
            case 6:
                if (f != null) {
                    h = new Rect(0, b.f + a.bg - k, c.top, k, c.height);
                }
                else {
                    h = new Rect(0, b.c, c.top, k, c.height);
                    b.c = b.c + k;
                }
                d(a, h);
                break;
            case 1:
                b.a = b.a - j;
                b.b = b.b - j;
                h = new Rect(0, c.left, b.a, c.width, j);
                d(a, h);
                break;
            case 0:
                h = new Rect(0, c.left, b.h, c.width, j);
                d(a, h);
                b.h = b.h + j;
                b.e = b.e + j;
                break;
            case 5:
                if (f != null) {
                    h = new Rect(0, c.left, b.h + a.bg, c.width, j);
                }
                else {
                    b.b = b.b - j;
                    h = new Rect(0, c.left, b.b, c.width, j);
                }
                d(a, h);
                break;
            case 4:
                if (f != null) {
                    h = new Rect(0, c.left, b.h + a.bg - j, c.width, j);
                }
                else {
                    h = new Rect(0, c.left, b.e, c.width, j);
                    b.e = b.e + j;
                }
                d(a, h);
                break;
        }
        if (a.ad.b9) {
            h = new Rect(0, c.left, c.top, c.width, c.height);
            d(a, h);
        }
    };
    LabelPanelArranger.d = function (a, b, c, d) {
        var e_102, _a, e_103, _b, e_104, _c;
        var e = new List$1(AxisLabelPanelBase.$, 0);
        var f = new List$1(AxisLabelPanelBase.$, 0);
        try {
            for (var _d = __values(fromEnum(a)), _e = _d.next(); !_e.done; _e = _d.next()) {
                var g = _e.value;
                var h = LabelPanelArranger.b(g);
                switch (h) {
                    case 1:
                    case 2:
                    case 0:
                    case 3:
                        f.add(g);
                        break;
                    case 5:
                    case 6:
                    case 4:
                    case 7:
                        e.add(g);
                        break;
                }
            }
        }
        catch (e_102_1) {
            e_102 = { error: e_102_1 };
        }
        finally {
            try {
                if (_e && !_e.done && (_a = _d.return))
                    _a.call(_d);
            }
            finally {
                if (e_102)
                    throw e_102.error;
            }
        }
        try {
            for (var _f = __values(fromEnum(f)), _g = _f.next(); !_g.done; _g = _f.next()) {
                var i = _g.value;
                LabelPanelArranger.c(i, b, c, d);
            }
        }
        catch (e_103_1) {
            e_103 = { error: e_103_1 };
        }
        finally {
            try {
                if (_g && !_g.done && (_b = _f.return))
                    _b.call(_f);
            }
            finally {
                if (e_103)
                    throw e_103.error;
            }
        }
        try {
            for (var _h = __values(fromEnum(e)), _j = _h.next(); !_j.done; _j = _h.next()) {
                var j = _j.value;
                LabelPanelArranger.c(j, b, c, d);
            }
        }
        catch (e_104_1) {
            e_104 = { error: e_104_1 };
        }
        finally {
            try {
                if (_j && !_j.done && (_c = _h.return))
                    _c.call(_h);
            }
            finally {
                if (e_104)
                    throw e_104.error;
            }
        }
    };
    LabelPanelArranger.$t = markType(LabelPanelArranger, 'LabelPanelArranger');
    return LabelPanelArranger;
}(Base));
export { LabelPanelArranger };
/**
 * @hidden
 */
var ChartContentManager = /** @class */ /*@__PURE__*/ (function (_super) {
    __extends(ChartContentManager, _super);
    function ChartContentManager(a) {
        var _this = _super.call(this) || this;
        _this.l = null;
        _this.r = new Dictionary$2(ChartContentType_$type, Dictionary$2.$.specialize(DependencyObject.$, ContentInfo.$), 0);
        _this.t = new List$1(Series.$, 0);
        _this.m = false;
        _this.v = null;
        _this.q = false;
        _this.o = false;
        _this.n = false;
        _this.p = false;
        _this.p = true;
        _this.o = true;
        _this.n = true;
        _this.r.addItem(0, new Dictionary$2(DependencyObject.$, ContentInfo.$, 0));
        _this.r.addItem(1, new Dictionary$2(DependencyObject.$, ContentInfo.$, 0));
        _this.r.addItem(2, new Dictionary$2(DependencyObject.$, ContentInfo.$, 0));
        _this.l = a;
        return _this;
    }
    Object.defineProperty(ChartContentManager.prototype, "u", {
        get: function () {
            return this.t;
        },
        set: function (a) {
            this.t = a;
        },
        enumerable: false,
        configurable: true
    });
    ChartContentManager.prototype.k = function (a, b, c) {
        var d = this.j(a, b);
        d.a = c;
        return d;
    };
    ChartContentManager.prototype.ad = function (a, b) {
        var c = this.r.item(a);
        if (c.containsKey(b)) {
            c.removeItem(b);
        }
        var d = typeCast(Series.$, b);
        if (d != null && this.u.contains(d)) {
            this.u.remove(d);
        }
    };
    ChartContentManager.prototype.aa = function (a) {
        var b = this.v;
        this.v = a;
        if (this.m && b == null && this.v != null) {
            this.v.setTimeout(runOn(this, this.w), 0);
        }
    };
    ChartContentManager.prototype.z = function () {
        if (!this.m) {
            this.m = true;
            if (this.v != null) {
                this.v.setTimeout(runOn(this, this.w), 0);
            }
            else {
            }
        }
    };
    ChartContentManager.prototype.ac = function (a, b, c, d) {
        var e = c;
        if (!e.c) {
            e.b = d;
        }
        else {
            if (!d) {
                e.b = false;
            }
        }
        if (!e.c) {
            e.c = true;
            this.z();
        }
    };
    ChartContentManager.prototype.j = function (a, b) {
        var c = this.r.item(a);
        var d = null;
        if (!((function () { var e = c.tryGetValue(b, d); d = e.p1; return e.ret; })())) {
            d = new ContentInfo();
            d.h = b;
            c.addItem(b, d);
            var e = typeCast(Series.$, b);
            if (e != null && !this.u.contains(e)) {
                if (e.isFragment) {
                    var f = e.bq();
                    var g = this.u.indexOf(f) + 1;
                    g += e.j8();
                    if (this.u.count <= g || f.kd() == 0 || g == -1) {
                        this.u.add(e);
                    }
                    else {
                        this.u.insert(g, e);
                    }
                }
                else {
                    this.u.add(e);
                }
            }
        }
        return d;
    };
    ChartContentManager.prototype.y = function () {
        this.w();
    };
    ChartContentManager.prototype.w = function () {
        var e_105, _a;
        if (this.l == null || this.r == null) {
            return;
        }
        if (!this.m) {
            return;
        }
        this.m = false;
        if (this.l != null) {
            this.l.ni();
        }
        try {
            for (var _b = __values(fromEnum(this.s())), _c = _b.next(); !_c.done; _c = _b.next()) {
                var a = _c.value;
                a.f();
            }
        }
        catch (e_105_1) {
            e_105 = { error: e_105_1 };
        }
        finally {
            try {
                if (_c && !_c.done && (_a = _b.return))
                    _a.call(_b);
            }
            finally {
                if (e_105)
                    throw e_105.error;
            }
        }
        if (!this.m) {
            this.l.qw();
        }
    };
    ChartContentManager.prototype._s = function () {
        var a, _a, _b, b, e_106_1, c, _c, _d, d, _e, _f, e, _g, _h, f, e_107_1, _j, _k, g, e_108_1;
        var e_106, _l, e_109, _m, e_110, _o, e_107, _p, e_108, _q;
        return __generator(this, function (_r) {
            switch (_r.label) {
                case 0:
                    a = null;
                    a = this.r.item(1);
                    _r.label = 1;
                case 1:
                    _r.trys.push([1, 6, 7, 8]);
                    _a = __values(fromEnum(a.values)), _b = _a.next();
                    _r.label = 2;
                case 2:
                    if (!!_b.done)
                        return [3 /*break*/, 5];
                    b = _b.value;
                    return [4 /*yield*/, b];
                case 3:
                    _r.sent();
                    _r.label = 4;
                case 4:
                    _b = _a.next();
                    return [3 /*break*/, 2];
                case 5: return [3 /*break*/, 8];
                case 6:
                    e_106_1 = _r.sent();
                    e_106 = { error: e_106_1 };
                    return [3 /*break*/, 8];
                case 7:
                    try {
                        if (_b && !_b.done && (_l = _a.return))
                            _l.call(_a);
                    }
                    finally {
                        if (e_106)
                            throw e_106.error;
                    }
                    return [7 /*endfinally*/];
                case 8:
                    a = this.r.item(0);
                    c = new List$1(ContentInfo.$, 0);
                    try {
                        for (_c = __values(fromEnum(this.u)), _d = _c.next(); !_d.done; _d = _c.next()) {
                            d = _d.value;
                            if (!d.eu) {
                                c.add(a.item(d));
                            }
                        }
                    }
                    catch (e_109_1) {
                        e_109 = { error: e_109_1 };
                    }
                    finally {
                        try {
                            if (_d && !_d.done && (_m = _c.return))
                                _m.call(_c);
                        }
                        finally {
                            if (e_109)
                                throw e_109.error;
                        }
                    }
                    try {
                        for (_e = __values(fromEnum(this.u)), _f = _e.next(); !_f.done; _f = _e.next()) {
                            e = _f.value;
                            if (e.eu) {
                                c.add(a.item(e));
                            }
                        }
                    }
                    catch (e_110_1) {
                        e_110 = { error: e_110_1 };
                    }
                    finally {
                        try {
                            if (_f && !_f.done && (_o = _e.return))
                                _o.call(_e);
                        }
                        finally {
                            if (e_110)
                                throw e_110.error;
                        }
                    }
                    _r.label = 9;
                case 9:
                    _r.trys.push([9, 14, 15, 16]);
                    _g = __values(fromEnum(c)), _h = _g.next();
                    _r.label = 10;
                case 10:
                    if (!!_h.done)
                        return [3 /*break*/, 13];
                    f = _h.value;
                    return [4 /*yield*/, f];
                case 11:
                    _r.sent();
                    _r.label = 12;
                case 12:
                    _h = _g.next();
                    return [3 /*break*/, 10];
                case 13: return [3 /*break*/, 16];
                case 14:
                    e_107_1 = _r.sent();
                    e_107 = { error: e_107_1 };
                    return [3 /*break*/, 16];
                case 15:
                    try {
                        if (_h && !_h.done && (_p = _g.return))
                            _p.call(_g);
                    }
                    finally {
                        if (e_107)
                            throw e_107.error;
                    }
                    return [7 /*endfinally*/];
                case 16:
                    a = this.r.item(2);
                    _r.label = 17;
                case 17:
                    _r.trys.push([17, 22, 23, 24]);
                    _j = __values(fromEnum(a.values)), _k = _j.next();
                    _r.label = 18;
                case 18:
                    if (!!_k.done)
                        return [3 /*break*/, 21];
                    g = _k.value;
                    return [4 /*yield*/, g];
                case 19:
                    _r.sent();
                    _r.label = 20;
                case 20:
                    _k = _j.next();
                    return [3 /*break*/, 18];
                case 21: return [3 /*break*/, 24];
                case 22:
                    e_108_1 = _r.sent();
                    e_108 = { error: e_108_1 };
                    return [3 /*break*/, 24];
                case 23:
                    try {
                        if (_k && !_k.done && (_q = _j.return))
                            _q.call(_j);
                    }
                    finally {
                        if (e_108)
                            throw e_108.error;
                    }
                    return [7 /*endfinally*/];
                case 24: return [2 /*return*/];
            }
        });
    };
    ChartContentManager.prototype.s = function () {
        var _this = this;
        return toEnum(function () { return _this._s(); });
    };
    ChartContentManager.prototype.x = function (a) {
        var e_111, _a, e_112, _b, e_113, _c;
        try {
            for (var _d = __values(fromEnum(this.r.item(1).values)), _e = _d.next(); !_e.done; _e = _d.next()) {
                var b = _e.value;
                b.h.hw(a);
            }
        }
        catch (e_111_1) {
            e_111 = { error: e_111_1 };
        }
        finally {
            try {
                if (_e && !_e.done && (_a = _d.return))
                    _a.call(_d);
            }
            finally {
                if (e_111)
                    throw e_111.error;
            }
        }
        try {
            for (var _f = __values(fromEnum(this.r.item(1).values)), _g = _f.next(); !_g.done; _g = _f.next()) {
                var c = _g.value;
                c.f();
            }
        }
        catch (e_112_1) {
            e_112 = { error: e_112_1 };
        }
        finally {
            try {
                if (_g && !_g.done && (_b = _f.return))
                    _b.call(_f);
            }
            finally {
                if (e_112)
                    throw e_112.error;
            }
        }
        try {
            for (var _h = __values(fromEnum(this.r.item(1).values)), _j = _h.next(); !_j.done; _j = _h.next()) {
                var d = _j.value;
                d.h.il();
            }
        }
        catch (e_113_1) {
            e_113 = { error: e_113_1 };
        }
        finally {
            try {
                if (_j && !_j.done && (_c = _h.return))
                    _c.call(_h);
            }
            finally {
                if (e_113)
                    throw e_113.error;
            }
        }
    };
    ChartContentManager.prototype.ae = function (a, b, c, d) {
        c.i = d;
    };
    ChartContentManager.prototype.ab = function (a, b) {
        if (!b.e) {
            b.e = true;
            this.z();
        }
    };
    ChartContentManager.$t = markType(ChartContentManager, 'ChartContentManager', DependencyObject.$);
    return ChartContentManager;
}(DependencyObject));
export { ChartContentManager };
/**
 * @hidden
 */
var ContentInfo = /** @class */ /*@__PURE__*/ (function (_super) {
    __extends(ContentInfo, _super);
    function ContentInfo() {
        var _this = _super !== null && _super.apply(this, arguments) || this;
        _this.h = null;
        _this.a = null;
        _this.b = false;
        _this.c = false;
        _this.i = null;
        _this.e = false;
        return _this;
    }
    Object.defineProperty(ContentInfo.prototype, "d", {
        get: function () {
            if (this.i.isEmpty) {
                return false;
            }
            if (this.i.width == 0 && this.i.height == 0) {
                return false;
            }
            return true;
        },
        enumerable: false,
        configurable: true
    });
    ContentInfo.prototype.g = function () {
        if (this.e && typeCast(Axis.$, this.h) !== null) {
            this.e = false;
            var a = this.c;
            this.c = true;
            var b = this.h.c2(true);
            if (!b) {
                this.c = a;
            }
        }
    };
    ContentInfo.prototype.f = function () {
        this.g();
        if (typeCast(Axis.$, this.h) !== null) {
            var a = typeCast(Axis.$, this.h);
            if (a.aj != null) {
                var b = a.aj;
                if (b.a6 != null && b.a6.e) {
                    b.a6.g();
                }
            }
        }
        if (this.c) {
            this.c = false;
            this.a(this.b);
            this.b = false;
        }
    };
    ContentInfo.$t = markType(ContentInfo, 'ContentInfo');
    return ContentInfo;
}(Base));
export { ContentInfo };
/**
 * @hidden
 */
var Series = /** @class */ /*@__PURE__*/ (function (_super) {
    __extends(Series, _super);
    function Series() {
        var _this = _super.call(this) || this;
        _this.cw = null;
        _this.kh = 0;
        _this.wn = null;
        _this.ey = false;
        _this.jz = null;
        _this.cd = null;
        _this.dr = null;
        _this.bb = null;
        _this.a9 = null;
        _this.dd = null;
        _this.sz = null;
        _this.hi = new Dictionary$2(String_$type, String_$type, 0);
        _this.hh = new Dictionary$2(String_$type, FastReflectionHelper.$, 0);
        _this.kj = null;
        _this.propertyChanged = null;
        _this.propertyUpdated = null;
        _this.d9 = false;
        _this.transitionOutCompleted = null;
        _this.renderRequested = null;
        _this.bu = 1;
        _this.ce = new SeriesLayerPropertyOverlayCollection();
        _this.b5 = null;
        _this.dw = false;
        _this.renderValid = null;
        _this.g2 = false;
        _this.g5 = false;
        _this.gl = false;
        _this.cv = null;
        _this.a1 = null;
        _this.dz = true;
        _this.hw = new Stack$1(String_$type);
        _this.gs = false;
        _this.gt = false;
        _this.d0 = false;
        _this.d1 = false;
        _this.as = null;
        _this.at = null;
        _this.d8 = false;
        _this.c3 = null;
        _this.db = null;
        _this.hz = null;
        _this.bi = null;
        _this.dq = null;
        _this.jw = null;
        _this.sw = null;
        _this.a4 = null;
        _this.c2 = 0;
        _this.c1 = 0;
        _this.ec = false;
        _this.dy = false;
        _this.h3 = DeviceUtils.g(1);
        _this.h7 = NaN;
        _this.h4 = NaN;
        _this.h5 = NaN;
        _this.h6 = NaN;
        _this.vl = null;
        _this.vn = null;
        _this.vo = BrushUtil.j(255, 255, 0, 0);
        _this.vm = BrushUtil.j(255, 255, 0, 0);
        _this.im = DeviceUtils.g(2);
        _this.bx = 1;
        _this.co = 1;
        _this.cn = 1;
        _this.h1 = 0.2;
        _this.h2 = 0.2;
        _this.d3 = false;
        _this.dx = false;
        _this.eh = false;
        _this.hv = null;
        _this.dv = false;
        _this.cx = 1;
        _this.ch = 1;
        _this.km = null;
        _this.eb = false;
        _this.br = new SeriesComponentsForView();
        _this.d2 = false;
        _this.k3 = null;
        _this.jy = null;
        _this._coercionMethods = null;
        _this.du = false;
        _this.b1 = 0;
        _this.b0 = 0;
        _this.dt = null;
        _this.wb = { $type: Point_$type, x: NaN, y: NaN };
        _this.h8 = NaN;
        _this.h9 = NaN;
        _this.hm = new Dictionary$2(SeriesLayer.$, Series.$, 0);
        _this.hs = new List$1(Series.$, 0);
        _this.b6 = null;
        _this.b9 = new SeriesLayerCollection();
        _this.b8 = new SeriesLayerCollection();
        _this.b7 = new SeriesLayerCollection();
        _this.hp = new HashSet$1(String_$type, 0);
        _this.bo = null;
        _this.bl = null;
        _this.hn = new Dictionary$2(String_$type, Number_$type, 0);
        _this.hj = new Dictionary$2(String_$type, Stack$1.$.specialize(Boolean_$type), 0);
        _this.a8 = null;
        DVContainer.instance.registerIfLoaded("AnnotationFactoryManager");
        DVContainer.instance.registerIfLoaded("InteractivityFactoryManager");
        DVContainer.instance.registerIfLoaded("VisualDataFactoryManager");
        _this.kh = Series.j1++;
        _this.g1 = true;
        _this.wn = Rect.empty;
        _this.cw = _this.ct();
        _this.cw.b9 = Rect.empty;
        _this.q3(_this.cw);
        _this.cw.q = true;
        _this.cw.a4();
        _this.cw.q = false;
        _this.ab = Series.$;
        _this.cd = new SeriesLayerManager();
        _this.cd.a = _this;
        _this.dq = function (a, b) {
            if (_this.dc == null || !_this.dc.e1) {
                _this.sv(b.oldRect, b.newRect);
            }
        };
        _this.bi = function (a, b) { return _this.rc(a, b.propertyName, b.oldValue, b.newValue); };
        _this.jw = function (a, b) {
            if (_this.dc != null) {
                _this.g1 = true;
                _this.dc.or();
            }
            _this.pd(b.action, b.position, b.count, b.propertyName);
        };
        _this.propertyUpdated = delegateCombine(_this.propertyUpdated, function (a, b) { return _this.rc(a, b.propertyName, b.oldValue, b.newValue); });
        var a = _this.b9;
        a.collectionResetting = delegateCombine(a.collectionResetting, runOn(_this, _this.ow));
        var b = _this.b9;
        b.collectionChanged = delegateCombine(b.collectionChanged, runOn(_this, _this.ov));
        var c = _this.b8;
        c.collectionResetting = delegateCombine(c.collectionResetting, runOn(_this, _this.os));
        var d = _this.b8;
        d.collectionChanged = delegateCombine(d.collectionChanged, runOn(_this, _this.or));
        var e = _this.b7;
        e.collectionResetting = delegateCombine(e.collectionResetting, runOn(_this, _this.oq));
        var f = _this.b7;
        f.collectionChanged = delegateCombine(f.collectionChanged, runOn(_this, _this.op));
        var g = _this.ce;
        g.collectionResetting = delegateCombine(g.collectionResetting, runOn(_this, _this.ou));
        var h = _this.ce;
        h.collectionChanged = delegateCombine(h.collectionChanged, runOn(_this, _this.ot));
        _this.sz = new Canvas();
        _this.dd = new DoubleAnimator(0, 1, _this.ke);
        var i = _this.dd;
        i.propertyChanged = delegateCombine(i.propertyChanged, runOn(_this, _this.ox));
        _this.g(Series.u8, ((function () {
            var $ret = new Binding(1, "Visibility");
            $ret.d = _this;
            return $ret;
        })()));
        _this.b2 = _this.b3();
        _this.cy = _this.cz();
        return _this;
    }
    Series.prototype.gd = function () {
        if (this.dc != null && this.dc.f1()) {
            return true;
        }
        return false;
    };
    Series.prototype.get_dataLegendKey = function () {
        if (!stringIsNullOrEmpty(this.name)) {
            return this.name;
        }
        return "Index___" + this.index.toString();
    };
    Object.defineProperty(Series.prototype, "dataLegendKey", {
        get: function () {
            return this.get_dataLegendKey();
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(Series.prototype, "group", {
        get: function () {
            if (this.bo != null && !stringIsNullOrEmpty(this.ml)) {
                return this.ml;
            }
            if (!stringIsNullOrEmpty(this.l5)) {
                return this.l5;
            }
            return this.me();
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(Series.prototype, "parentKey", {
        get: function () {
            return this.bo != null ? this.bo.dataLegendKey : this.dataLegendKey;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(Series.prototype, "parentTitle", {
        get: function () {
            if (this.bo != null) {
                return this.bo.title.toString();
            }
            if (this.title != null) {
                return this.title.toString();
            }
            return "SeriesNoTitle";
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(Series.prototype, "j0", {
        get: function () {
            return this.jz;
        },
        set: function (a) {
            this.jz = a;
            this.dd.u(this.jz);
        },
        enumerable: false,
        configurable: true
    });
    Series.prototype.provideRenderer = function (a) {
        this.j0 = a;
    };
    Series.prototype.ng = function () {
        return this.ba.a$u(this);
    };
    Series.prototype.j7 = function () {
        return this.bo.actualLayers.indexOf(this.b6);
    };
    Series.prototype.ov = function (a, b) {
        this.cd.h(this, this.b9, b);
    };
    Series.prototype.ow = function (a, b) {
        this.cd.j(this, this.b9, b);
    };
    Series.prototype.or = function (a, b) {
        this.cd.e(this, this.b9, b);
    };
    Series.prototype.os = function (a, b) {
        this.cd.f(this, this.b9, b);
    };
    Series.prototype.op = function (a, b) {
        this.cd.c(this, this.b9, b);
        if (this.dc != null) {
            this.dc.ok();
        }
    };
    Series.prototype.oq = function (a, b) {
        this.cd.d(this, this.b9, b);
        if (this.dc != null) {
            this.dc.ok();
        }
    };
    Series.prototype.ot = function (a, b) {
        var e_114, _a;
        switch (b.action) {
            case 0:
                if (b.newItems != null) {
                    for (var c = 0; c < b.newItems.count; c++) {
                        var d = b.newItems.item(c);
                        d.o = true;
                        this.qx(c + b.newStartingIndex, d);
                    }
                }
                break;
            case 1:
                if (b.oldItems != null) {
                    for (var e = 0; e < b.oldItems.count; e++) {
                        var f = b.oldItems.item(e);
                        this.qy(f, b.oldStartingIndex);
                    }
                }
                break;
            case 2:
                if (b.oldItems != null) {
                    for (var g = 0; g < b.oldItems.count; g++) {
                        var h = b.oldItems.item(g);
                        this.qy(h, b.oldStartingIndex);
                    }
                }
                if (b.newItems != null) {
                    for (var i = 0; i < b.newItems.count; i++) {
                        var j = b.newItems.item(i);
                        this.qx(i + b.newStartingIndex, j);
                    }
                }
                break;
            case 4:
                this.qs();
                var k = 0;
                try {
                    for (var _b = __values(fromEnum(this.ce)), _c = _b.next(); !_c.done; _c = _b.next()) {
                        var l = _c.value;
                        var m = l;
                        this.qx(k, m);
                        k++;
                    }
                }
                catch (e_114_1) {
                    e_114 = { error: e_114_1 };
                }
                finally {
                    try {
                        if (_c && !_c.done && (_a = _b.return))
                            _a.call(_b);
                    }
                    finally {
                        if (e_114)
                            throw e_114.error;
                    }
                }
                break;
        }
    };
    Series.prototype.qs = function () {
        var e_115, _a, e_116, _b, e_117, _c;
        var a = this.b5;
        if (a != null) {
            var b = new List$1(SeriesLayerPropertyOverlay.$, 0);
            var c = new List$1(SeriesLayerPropertyOverlay.$, 0);
            try {
                for (var _d = __values(fromEnum(a.m)), _e = _d.next(); !_e.done; _e = _d.next()) {
                    var d = _e.value;
                    if (d.o) {
                        b.add(d);
                    }
                }
            }
            catch (e_115_1) {
                e_115 = { error: e_115_1 };
            }
            finally {
                try {
                    if (_e && !_e.done && (_a = _d.return))
                        _a.call(_d);
                }
                finally {
                    if (e_115)
                        throw e_115.error;
                }
            }
            try {
                for (var _f = __values(fromEnum(b)), _g = _f.next(); !_g.done; _g = _f.next()) {
                    var e = _g.value;
                    a.m.remove(e);
                    if (e.k != null) {
                        c.add(e.k);
                    }
                }
            }
            catch (e_116_1) {
                e_116 = { error: e_116_1 };
            }
            finally {
                try {
                    if (_g && !_g.done && (_b = _f.return))
                        _b.call(_f);
                }
                finally {
                    if (e_116)
                        throw e_116.error;
                }
            }
            try {
                for (var _h = __values(fromEnum(c)), _j = _h.next(); !_j.done; _j = _h.next()) {
                    var f = _j.value;
                    a.m.add(f);
                }
            }
            catch (e_117_1) {
                e_117 = { error: e_117_1 };
            }
            finally {
                try {
                    if (_j && !_j.done && (_c = _h.return))
                        _c.call(_h);
                }
                finally {
                    if (e_117)
                        throw e_117.error;
                }
            }
        }
    };
    Series.prototype.qy = function (a, b) {
        var c = this.b5;
        if (c != null) {
            var d = c.m.indexOf(a);
            if (d >= 0) {
                var e = c.m._inner[d];
                c.m.removeAt(d);
                if (e.k != null) {
                    c.m.insert(d, a);
                }
            }
        }
    };
    Series.prototype.qx = function (a, b) {
        var e_118, _a;
        var c = this.b5;
        if (c != null) {
            var d = new Dictionary$2(String_$type, SeriesLayerPropertyOverlay.$, 0);
            try {
                for (var _b = __values(fromEnum(c.m)), _c = _b.next(); !_c.done; _c = _b.next()) {
                    var e = _c.value;
                    d.addItem(e.ad, b);
                }
            }
            catch (e_118_1) {
                e_118 = { error: e_118_1 };
            }
            finally {
                try {
                    if (_c && !_c.done && (_a = _b.return))
                        _a.call(_b);
                }
                finally {
                    if (e_118)
                        throw e_118.error;
                }
            }
            if (d.containsKey(b.ad)) {
                b.k = d.item(b.ad);
                c.m.remove(d.item(b.ad));
            }
            c.m.add(b);
        }
    };
    Series.prototype.ou = function (a, b) {
        this.qs();
    };
    Series.prototype.sp = function (a) {
    };
    Series.prototype.so = function (a) {
    };
    Series.prototype.sq = function (a) {
    };
    Series.prototype.ox = function (a, b) {
        this.jr = this.dd.o;
    };
    Object.defineProperty(Series.prototype, "ds", {
        get: function () {
            if (this.dr == null) {
                this.dr = new SRProvider(this.j0);
            }
            if (this.dr.l == null) {
                if (this.j0 != null) {
                    this.dr.l = this.j0;
                }
                else if (this.dc != null && this.dc.c9 != null && this.dc.c9.j != null && this.dc.c9.j.ae != null) {
                    this.dr.l = this.dc.c9.j.ae;
                }
            }
            return this.dr;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(Series.prototype, "bc", {
        get: function () {
            var _this = this;
            if (this.bb == null) {
                this.bb = DVContainer.instance.createInstance(ISeriesVisualDataManager_$type, function () { return _this.ds.q; });
            }
            return this.bb;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(Series.prototype, "ho", {
        get: function () {
            return this.ba.a$j;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(Series.prototype, "ba", {
        get: function () {
            var _this = this;
            if (this.a9 == null) {
                this.a9 = DVContainer.instance.createInstance(ISeriesInteractionManager_$type, function () { return _this.ds.n; });
                if (this.toolTip != null) {
                    this.a9.a$as(this, this.toolTip);
                }
            }
            return this.a9;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(Series.prototype, "fj", {
        get: function () {
            return DVContainer.instance.checkLoaded("InteractivityFactoryManager");
        },
        enumerable: false,
        configurable: true
    });
    Series.prototype.q3 = function (a) {
    };
    Series.prototype.q0 = function () {
        this.oy(this.a5, this.a5);
        if (this.dp == null && this.c4 != null && this.itemsSource != null) {
            this.dp = this.c4.getFastItemsSource(this.itemsSource);
        }
        this.cw.a7();
    };
    Series.prototype.q1 = function () {
        this.o6();
        if (this.dp != null && this.c4 != null && this.itemsSource != null) {
            this.dp = this.c4.releaseFastItemsSource(this.itemsSource);
        }
        this.cw.a8();
    };
    Series.prototype.cu = function () {
        return this.ct();
    };
    Series.prototype.ct = function () {
        return new SeriesView(this);
    };
    Series.prototype.hc = function () {
        return false;
    };
    Series.prototype.kr = function (a, b) {
        return null;
    };
    Series.prototype.mf = function (a) {
        return null;
    };
    Series.prototype.onLegendItemOver = function (a) {
    };
    Series.prototype.onLegendItemPointerUp = function (a) {
    };
    Series.prototype.onLegendItemPointerDown = function (a) {
    };
    Series.prototype.onLegendItemEnter = function (a) {
        if (this.ff && this.fj && this.dc != null && (this.dc.bd == 0 || this.dc.bd == 2) && this.by != 1) {
            this.ba.a$ab(this, a, { $type: Point_$type, x: NaN, y: NaN }, false, true, false, a == null, this == this.dc.bq, false);
        }
    };
    Series.prototype.onLegendItemLeave = function (a) {
        if (this.ff && this.fj && this.dc != null && (this.dc.bd == 0 || this.dc.bd == 2) && this.by != 1) {
            this.ba.a$ab(this, a, { $type: Point_$type, x: NaN, y: NaN }, false, true, true, a == null, this == this.dc.bq, a != null);
        }
    };
    Series.prototype.nf = function (a) {
        if (!this.hi.containsKey(a)) {
            var b = a.substr(0, 1).toUpperCase() + a.substr(1);
            this.hi.addItem(a, b);
        }
        return this.hi.item(a);
    };
    Series.prototype.ks = function (a, b, c) {
        var d = null;
        if (!this.hh.containsKey(b)) {
            d = new FastReflectionHelper(false, c);
            this.hh.addItem(b, d);
        }
        else {
            d = this.hh.item(b);
        }
        d.propertyName = c;
        var e = d.getPropertyValue(a);
        if (this.expectFunctions) {
            var func_ = e;
            var item_ = a;
            if ((typeof func_ === 'function')) {
                e = func_.apply(item_);
            }
        }
        return e;
    };
    Series.prototype.is = function (a) {
        return this.j4(a);
    };
    Series.prototype.j6 = function (a) {
        return -1;
    };
    Series.prototype.get_ft = function () {
        return false;
    };
    Object.defineProperty(Series.prototype, "ft", {
        get: function () {
            return this.get_ft();
        },
        enumerable: false,
        configurable: true
    });
    Series.prototype.a0 = function () {
        return null;
    };
    Series.prototype.j4 = function (a) {
        return -1;
    };
    Series.prototype.wz = function () {
        var a = 1;
        var b = 1;
        if (this.dc != null) {
            a = this.dc.b0;
            b = this.dc.b2;
        }
        return this.w0(a, b);
    };
    Series.prototype.w1 = function (a, b) {
        return this.w0(a, b);
    };
    Series.prototype.w0 = function (a, b) {
        return new Thickness(1, 0, 0, 0, 0);
    };
    Series.prototype.cl = function () {
        return 1;
    };
    Series.prototype.cm = function () {
        return 1;
    };
    Series.prototype.ko = function (a) {
        return null;
    };
    Series.prototype.p6 = function (a, b, c) {
    };
    Series.prototype.ak = function (a, b) {
        return null;
    };
    Series.prototype.kx = function (a, b) {
        return a.ko(b);
    };
    Series.prototype.dj = function (a, b, c, d) {
        return a.dh(b, c, d);
    };
    Series.prototype.dk = function (a, b, c, d) {
        return a.di(b, c, d);
    };
    Series.prototype.j3 = function () {
        return -1;
    };
    Series.prototype.j8 = function () {
        return -1;
    };
    Series.prototype.kd = function () {
        return -1;
    };
    Object.defineProperty(Series.prototype, "container", {
        get: function () {
            return this.dc;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(Series.prototype, "hasSubItems", {
        get: function () {
            return this.ej();
        },
        enumerable: false,
        configurable: true
    });
    Series.prototype.ej = function () {
        if (this.d3 && this.hv != null) {
            return true;
        }
        return false;
    };
    Series.prototype.forSubItems = function (a) {
        this.p4(a);
    };
    Series.prototype.p4 = function (a) {
        var e_119, _a;
        if (this.d3 && this.hv != null) {
            try {
                for (var _b = __values(fromEnum(this.hv)), _c = _b.next(); !_c.done; _c = _b.next()) {
                    var b = _c.value;
                    a(b);
                }
            }
            catch (e_119_1) {
                e_119 = { error: e_119_1 };
            }
            finally {
                try {
                    if (_c && !_c.done && (_a = _b.return))
                        _a.call(_b);
                }
                finally {
                    if (e_119)
                        throw e_119.error;
                }
            }
        }
    };
    Series.prototype.p5 = function (a) {
    };
    Object.defineProperty(Series.prototype, "ei", {
        get: function () {
            return this.b7.count > 0;
        },
        enumerable: false,
        configurable: true
    });
    Series.prototype.p3 = function (a) {
        for (var b = 0; b < this.hs.count; b++) {
            var c = this.hs._inner[b];
            if (!a(c)) {
                break;
            }
        }
    };
    Series.prototype.ne = function () {
        return null;
    };
    Series.prototype.v1 = function () {
        return this.vk;
    };
    Series.prototype.v2 = function () {
        return this.v0;
    };
    Series.prototype.resolveLegendIndex = function () {
        return this.index;
    };
    Series.prototype.bq = function () {
        return null;
    };
    Series.prototype.get_eu = function () {
        return false;
    };
    Object.defineProperty(Series.prototype, "eu", {
        get: function () {
            return this.get_eu();
        },
        enumerable: false,
        configurable: true
    });
    Series.prototype.get_er = function () {
        return false;
    };
    Object.defineProperty(Series.prototype, "er", {
        get: function () {
            return this.get_er();
        },
        enumerable: false,
        configurable: true
    });
    Series.prototype.get_eq = function () {
        return false;
    };
    Object.defineProperty(Series.prototype, "eq", {
        get: function () {
            return this.get_eq();
        },
        enumerable: false,
        configurable: true
    });
    Series.prototype.get_et = function () {
        return false;
    };
    Object.defineProperty(Series.prototype, "et", {
        get: function () {
            return this.get_et();
        },
        enumerable: false,
        configurable: true
    });
    Series.prototype.get_es = function () {
        return false;
    };
    Object.defineProperty(Series.prototype, "es", {
        get: function () {
            return this.get_es();
        },
        enumerable: false,
        configurable: true
    });
    Series.prototype.get_ev = function () {
        return false;
    };
    Object.defineProperty(Series.prototype, "ev", {
        get: function () {
            return this.get_ev();
        },
        enumerable: false,
        configurable: true
    });
    Series.prototype.get_isVertical = function () {
        return false;
    };
    Object.defineProperty(Series.prototype, "isVertical", {
        get: function () {
            return this.get_isVertical();
        },
        enumerable: false,
        configurable: true
    });
    Series.prototype.get_isFragment = function () {
        return false;
    };
    Object.defineProperty(Series.prototype, "isFragment", {
        get: function () {
            return this.get_isFragment();
        },
        enumerable: false,
        configurable: true
    });
    Series.prototype.get_ex = function () {
        return false;
    };
    Object.defineProperty(Series.prototype, "ex", {
        get: function () {
            return this.get_ex();
        },
        enumerable: false,
        configurable: true
    });
    Series.prototype.get_ew = function () {
        return false;
    };
    Object.defineProperty(Series.prototype, "ew", {
        get: function () {
            return this.get_ew();
        },
        enumerable: false,
        configurable: true
    });
    Series.prototype.get_em = function () {
        return false;
    };
    Object.defineProperty(Series.prototype, "em", {
        get: function () {
            return this.get_em();
        },
        enumerable: false,
        configurable: true
    });
    Series.prototype.get_f6 = function () {
        return false;
    };
    Object.defineProperty(Series.prototype, "f6", {
        get: function () {
            return this.get_f6();
        },
        enumerable: false,
        configurable: true
    });
    Series.prototype.get_fl = function () {
        return false;
    };
    Object.defineProperty(Series.prototype, "fl", {
        get: function () {
            return this.get_fl();
        },
        enumerable: false,
        configurable: true
    });
    Series.prototype.get_fk = function () {
        return false;
    };
    Object.defineProperty(Series.prototype, "fk", {
        get: function () {
            return this.get_fk();
        },
        enumerable: false,
        configurable: true
    });
    Series.prototype.get_f1 = function () {
        return false;
    };
    Object.defineProperty(Series.prototype, "f1", {
        get: function () {
            return this.get_f1();
        },
        enumerable: false,
        configurable: true
    });
    Series.prototype.get_e1 = function () {
        return false;
    };
    Object.defineProperty(Series.prototype, "e1", {
        get: function () {
            return this.get_e1();
        },
        enumerable: false,
        configurable: true
    });
    Series.prototype.get_ez = function () {
        return false;
    };
    Object.defineProperty(Series.prototype, "ez", {
        get: function () {
            return this.get_ez();
        },
        enumerable: false,
        configurable: true
    });
    Series.prototype.get_f7 = function () {
        return false;
    };
    Object.defineProperty(Series.prototype, "f7", {
        get: function () {
            return this.get_f7();
        },
        enumerable: false,
        configurable: true
    });
    Series.prototype.get_fs = function () {
        return false;
    };
    Object.defineProperty(Series.prototype, "fs", {
        get: function () {
            return this.get_fs();
        },
        enumerable: false,
        configurable: true
    });
    Series.prototype.get_fr = function () {
        return false;
    };
    Object.defineProperty(Series.prototype, "fr", {
        get: function () {
            return this.get_fr();
        },
        enumerable: false,
        configurable: true
    });
    Series.prototype.get_fp = function () {
        return false;
    };
    Object.defineProperty(Series.prototype, "fp", {
        get: function () {
            return this.get_fp();
        },
        enumerable: false,
        configurable: true
    });
    Series.prototype.get_fo = function () {
        return false;
    };
    Object.defineProperty(Series.prototype, "fo", {
        get: function () {
            return this.get_fo();
        },
        enumerable: false,
        configurable: true
    });
    Series.prototype.get_f4 = function () {
        return false;
    };
    Object.defineProperty(Series.prototype, "f4", {
        get: function () {
            return this.get_f4();
        },
        enumerable: false,
        configurable: true
    });
    Series.prototype.get_f2 = function () {
        return false;
    };
    Object.defineProperty(Series.prototype, "f2", {
        get: function () {
            return this.get_f2();
        },
        enumerable: false,
        configurable: true
    });
    Series.prototype.get_fz = function () {
        return false;
    };
    Object.defineProperty(Series.prototype, "fz", {
        get: function () {
            return this.get_fz();
        },
        enumerable: false,
        configurable: true
    });
    Series.prototype.get_fq = function () {
        return false;
    };
    Object.defineProperty(Series.prototype, "fq", {
        get: function () {
            return this.get_fq();
        },
        enumerable: false,
        configurable: true
    });
    Series.prototype.get_fx = function () {
        return false;
    };
    Object.defineProperty(Series.prototype, "fx", {
        get: function () {
            return this.get_fx();
        },
        enumerable: false,
        configurable: true
    });
    Series.prototype.get_fu = function () {
        return false;
    };
    Object.defineProperty(Series.prototype, "fu", {
        get: function () {
            return this.get_fu();
        },
        enumerable: false,
        configurable: true
    });
    Series.prototype.get_isStacked = function () {
        return false;
    };
    Object.defineProperty(Series.prototype, "isStacked", {
        get: function () {
            return this.get_isStacked();
        },
        enumerable: false,
        configurable: true
    });
    Series.prototype.get_e8 = function () {
        return false;
    };
    Object.defineProperty(Series.prototype, "e8", {
        get: function () {
            return this.get_e8();
        },
        enumerable: false,
        configurable: true
    });
    Series.prototype.get_fv = function () {
        return false;
    };
    Object.defineProperty(Series.prototype, "fv", {
        get: function () {
            return this.get_fv();
        },
        enumerable: false,
        configurable: true
    });
    Series.prototype.get_e0 = function () {
        return false;
    };
    Object.defineProperty(Series.prototype, "e0", {
        get: function () {
            return this.get_e0();
        },
        enumerable: false,
        configurable: true
    });
    Series.prototype.get_fd = function () {
        return false;
    };
    Object.defineProperty(Series.prototype, "fd", {
        get: function () {
            return this.get_fd();
        },
        enumerable: false,
        configurable: true
    });
    Series.prototype.get_fy = function () {
        return false;
    };
    Object.defineProperty(Series.prototype, "fy", {
        get: function () {
            return this.get_fy();
        },
        enumerable: false,
        configurable: true
    });
    Series.prototype.get_isValueOverlay = function () {
        return false;
    };
    Object.defineProperty(Series.prototype, "isValueOverlay", {
        get: function () {
            return this.get_isValueOverlay();
        },
        enumerable: false,
        configurable: true
    });
    Series.prototype.get_fg = function () {
        return this.bo != null;
    };
    Object.defineProperty(Series.prototype, "fg", {
        get: function () {
            return this.get_fg();
        },
        enumerable: false,
        configurable: true
    });
    Series.prototype.get_isSummarizationSupported = function () {
        return !this.isValueOverlay;
    };
    Object.defineProperty(Series.prototype, "isSummarizationSupported", {
        get: function () {
            return this.get_isSummarizationSupported();
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(Series.prototype, "isLayer", {
        get: function () {
            return this.bo != null;
        },
        enumerable: false,
        configurable: true
    });
    Series.prototype.bp = function () {
        return null;
    };
    Series.prototype.get_ek = function () {
        return false;
    };
    Object.defineProperty(Series.prototype, "ek", {
        get: function () {
            return this.get_ek();
        },
        enumerable: false,
        configurable: true
    });
    Series.prototype.get_fb = function () {
        return false;
    };
    Object.defineProperty(Series.prototype, "fb", {
        get: function () {
            return this.get_fb();
        },
        enumerable: false,
        configurable: true
    });
    Series.prototype.get_fa = function () {
        return false;
    };
    Object.defineProperty(Series.prototype, "fa", {
        get: function () {
            return this.get_fa();
        },
        enumerable: false,
        configurable: true
    });
    Series.prototype.get_e9 = function () {
        return false;
    };
    Object.defineProperty(Series.prototype, "e9", {
        get: function () {
            return this.get_e9();
        },
        enumerable: false,
        configurable: true
    });
    Series.prototype.get_fc = function () {
        return false;
    };
    Object.defineProperty(Series.prototype, "fc", {
        get: function () {
            return this.get_fc();
        },
        enumerable: false,
        configurable: true
    });
    Series.prototype.get_e3 = function () {
        return false;
    };
    Object.defineProperty(Series.prototype, "e3", {
        get: function () {
            return this.get_e3();
        },
        enumerable: false,
        configurable: true
    });
    Series.prototype.get_e4 = function () {
        return false;
    };
    Object.defineProperty(Series.prototype, "e4", {
        get: function () {
            return this.get_e4();
        },
        enumerable: false,
        configurable: true
    });
    Series.prototype.iq = function (a, b, c, d, e) {
        return Number.POSITIVE_INFINITY;
    };
    Series.prototype.ir = function (a, b, c, d, e, f, g) {
        return this.ba.a$m(this, a, b, c, d, e, f, g);
    };
    Series.prototype.get_he = function () {
        return false;
    };
    Object.defineProperty(Series.prototype, "he", {
        get: function () {
            return this.get_he();
        },
        enumerable: false,
        configurable: true
    });
    Series.prototype.i8 = function (a, b, c, d, e, f, g, h) {
        return this.ba.a$p(this, a, b, c, d, e, f, g, h);
    };
    Series.prototype.iw = function (a, b, c, d, e, f, g, h) {
        return this.ba.a$o(this, a, b, c, d, e, f, g, h);
    };
    Series.prototype.kc = function (a, b, c, d, e) {
        return this.ba.a$r(this, a, b, c, d, e);
    };
    Series.prototype.iv = function (a) {
        return (a ? 10 : 3);
    };
    Series.prototype.aj = function (a) {
        return null;
    };
    Series.prototype.al = function (a) {
        return null;
    };
    Series.prototype.gw = function (a, b) {
        return this.ba.a$f(this, a, b);
    };
    Series.prototype.an = function (a, b, c, d, e, f) {
        return this.ba.a$b(this, a, b, c, d, e, f);
    };
    Series.prototype.am = function (a, b, c, d, e, f) {
        return this.ba.a$a(this, a, b, c, d, e, f);
    };
    Series.prototype.gy = function (a, b, c) {
        return this.ba.a$g(this, a, b, c);
    };
    Series.prototype.gz = function (a, b) {
        return this.ba.a$h(this, a, b);
    };
    Series.prototype.ka = function (a, b, c, d, e) {
        return this.ba.a$q(this, a, b, c, d, e);
    };
    Series.prototype.iu = function (a, b) {
        return this.ba.a$n(this, a, b);
    };
    Series.prototype.kb = function (a, b) {
        return -1;
    };
    Series.prototype.j9 = function (a, b) {
        return -1;
    };
    Series.prototype.i6 = function (a, b, c) {
        return NaN;
    };
    Series.prototype.wh = function (a, b, c) {
        return { $type: Point_$type, x: NaN, y: NaN };
    };
    Series.prototype.ws = function (a) {
        return Rect.empty;
    };
    Series.prototype.ao = function (a) {
        var b = this.ws(a);
        if (!b.isEmpty) {
            var c = new Array(1);
            c[0] = b;
            return c;
        }
        return null;
    };
    Series.prototype.wt = function (a) {
        return this.ws(this.wm(a));
    };
    Series.prototype.ap = function (a) {
        return this.ao(this.wm(a));
    };
    Series.prototype.ar = function (a, b) {
        return null;
    };
    Series.prototype.wu = function (a) {
        return Rect.empty;
    };
    Series.prototype.wv = function (a) {
        return this.wu(this.wm(a));
    };
    Series.prototype.g0 = function (a, b) {
        return this.ba.a$i(this, a, b);
    };
    Series.prototype.wj = function (a, b, c, d, e, f, g, h, i) {
        return this.ba.a$au(this, a, b, c, d, e, f, g, h, i);
    };
    Series.prototype.i2 = function (a, b, c) {
        return this.i6(a, b, c);
    };
    Series.prototype.wd = function (a, b, c) {
        return this.wh(a, b, c);
    };
    Series.prototype.i4 = function (a, b, c) {
        return this.i6(a, b, c);
    };
    Series.prototype.wf = function (a, b, c) {
        return this.wh(a, b, c);
    };
    Series.prototype.wi = function (a, b, c) {
        var d = this.wm(a);
        return this.wh(d, b, c);
    };
    Series.prototype.i7 = function (a, b, c) {
        var d = this.wm(a);
        return this.i6(d, b, c);
    };
    Series.prototype.we = function (a, b, c) {
        var d = this.wm(a);
        return this.wd(d, b, c);
    };
    Series.prototype.i3 = function (a, b, c) {
        var d = this.wm(a);
        return this.i2(d, b, c);
    };
    Series.prototype.wg = function (a, b, c) {
        var d = this.wm(a);
        return this.wf(d, b, c);
    };
    Series.prototype.i5 = function (a, b, c) {
        var d = this.wm(a);
        return this.i4(d, b, c);
    };
    Series.prototype.j5 = function (a) {
        var b = this.wm(a);
        return this.j4(b);
    };
    Series.prototype.ix = function () {
        return 0;
    };
    Series.po = function (a, b, c) {
        if (b != null && b.c9.j.ae != null) {
            b.c9.j.ae.getExternal(a, b.c9.j.ae.rootWrapper, b.c9.j.ae.getExternal(b, null, null));
        }
        var d = a;
    };
    Series.prototype.it = function (a) {
        var b = this.wm(a);
        return this.is(b);
    };
    Series.prototype.kp = function (a) {
        var b = this.wm(a);
        return this.ko(b);
    };
    Series.prototype.o1 = function (a, b) {
        a.kj = b;
    };
    Series.prototype.k1 = function (a) {
        return a.kj;
    };
    Series.prototype.au = function (a) {
        if (a && this.as != null) {
            return this.as;
        }
        if (this.at != null) {
            return this.at;
        }
        return this.kj;
    };
    Series.prototype.ed = function (a, b, c, d, e) {
        return false;
    };
    Series.prototype.je = function (a) {
        var b = this.mg();
        if (b == null) {
            return NaN;
        }
        if (a.content == null) {
            return NaN;
        }
        if (a.content.item == null) {
            return NaN;
        }
        return FastItemColumn.i(this.kr(a.content.item, b));
    };
    Series.prototype.jd = function (a) {
        var b = this.mg();
        if (b == null) {
            return NaN;
        }
        if (a == null) {
            return NaN;
        }
        return FastItemColumn.i(this.kr(a, b));
    };
    Series.prototype.mg = function () {
        return null;
    };
    Series.prototype.i9 = function (a, b) {
        return NaN;
    };
    Series.prototype.aq = function (a) {
        return [NaN, NaN];
    };
    Series.prototype.wk = function (a) {
        return { $type: Point_$type, x: NaN, y: NaN };
    };
    Series.prototype.wl = function (a) {
        return { $type: Point_$type, x: NaN, y: NaN };
    };
    Series.prototype.raisePropertyChanged = function (a, b, c) {
        this.sd(a);
        if (this.propertyChanged != null) {
            this.propertyChanged(this, new PropertyChangedEventArgs(a));
        }
        c = this.k4(a, b, c);
        if (this.propertyUpdated != null) {
            if (a == Series.$$p[20] && b != null && c != null) {
                this.d9 = true;
            }
            this.propertyUpdated(this, new PropertyUpdatedEventArgs(a, b, c));
            if (a == Series.$$p[20] && b != null && c != null) {
                this.d9 = false;
            }
        }
        this.sf(a);
    };
    Series.prototype.k4 = function (a, b, c) {
        this.hp.add_1(a);
        if (this.ee) {
            c = this.kz(a, b, c);
        }
        return c;
    };
    Series.prototype.kz = function (a, b, c) {
        if (this.gn(a)) {
            return c;
        }
        for (var d = 0; d < this.hs.count; d++) {
            var e = this.hs._inner[d];
            var f = e.b6;
            var g = this.tr(a);
            if (g == null) {
                continue;
            }
            c = f.ai(this, e, g, c);
        }
        return c;
    };
    Series.prototype.tr = function (a) {
        if (Series.hg.containsKey(a) && Series.hg.item(a).containsKey(getInstanceType(this))) {
            return Series.hg.item(a).item(getInstanceType(this));
        }
        var b = DependencyProperty.h(a, getInstanceType(this));
        if (b == null) {
            return null;
        }
        if (!Series.hg.containsKey(a)) {
            Series.hg.addItem(a, new Dictionary$2(Type.$, DependencyProperty.$, 0));
        }
        Series.hg.item(a).addItem(getInstanceType(this), b);
        return b;
    };
    Series.prototype.get_hasMarkers = function () {
        return false;
    };
    Object.defineProperty(Series.prototype, "hasMarkers", {
        get: function () {
            return this.get_hasMarkers();
        },
        enumerable: false,
        configurable: true
    });
    Series.prototype.get_en = function () {
        return false;
    };
    Object.defineProperty(Series.prototype, "en", {
        get: function () {
            return this.get_en();
        },
        enumerable: false,
        configurable: true
    });
    Series.prototype.p9 = function () {
    };
    Series.prototype.qa = function () {
        this.p9();
    };
    Series.prototype.vs = function (a) {
        if (this.dc == null) {
            return this.ve;
        }
        var b = this.dc.vn(this.index + a);
        b = this.vy(b);
        return b;
    };
    Series.prototype.vy = function (a) {
        if (this.actualLayers != null && this.actualLayers.count > 0) {
            var b = true;
            for (var c = 0; c < this.actualLayers.count; c++) {
                var d = this.actualLayers._inner[c];
                if (!d.target.fw) {
                    b = false;
                }
            }
            if (!b) {
                return a;
            }
            a = BrushUtil.s(a, this.ib);
            return a;
        }
        return a;
    };
    Series.prototype.vv = function (a) {
        if (this.dc == null) {
            return this.ve;
        }
        var b = this.dc.vt(this.index + a);
        b = this.vy(b);
        return b;
    };
    Series.prototype.vt = function (a) {
        if (this.dc == null) {
            return this.ve;
        }
        var b = this.dc.vr(this.index + a);
        b = this.vy(b);
        return b;
    };
    Series.prototype.vu = function (a) {
        if (this.dc == null) {
            return this.vi;
        }
        var b = this.dc.vs(this.index + a);
        b = this.vy(b);
        return b;
    };
    Series.prototype.vq = function () {
        return null;
    };
    Series.prototype.vr = function () {
        return null;
    };
    Series.prototype.s3 = function () {
        return null;
    };
    Series.prototype.ip = function () {
        return NaN;
    };
    Series.prototype.wm = function (a) {
        var b = this.cw.b9;
        var c = this.cw.ca;
        var d = this.cw.getEffectiveViewport();
        var e = { $type: Point_$type, x: ViewportUtils.b(a.x, c, b, d), y: ViewportUtils.g(a.y, c, b, d) };
        return e;
    };
    Series.prototype.ww = function (a) {
        var b = this.wm({ $type: Point_$type, x: a.left, y: a.bottom });
        var c = this.wm({ $type: Point_$type, x: a.right, y: a.top });
        return new Rect(2, b, c);
    };
    Series.prototype.wc = function (a) {
        var b = this.dc != null ? this.dc.wk : this.cw.b9;
        var c = this.cw.ca;
        var d = this.cw.getEffectiveViewport();
        var e = ViewportUtils.e(a.x, c, b, d);
        var f = ViewportUtils.i(a.y, c, b, d);
        return { $type: Point_$type, x: e, y: f };
    };
    Series.prototype.ky = function (a, b) {
        var c = this.cw.c(a);
        var d = c != null ? c.item : null;
        if (d == null) {
            var e = this.wm(b);
            d = this.ko(e);
        }
        return d;
    };
    Series.prototype.ge = function (a) {
        return false;
    };
    Series.prototype.ay = function (a) {
        return new AxisRange(NaN, NaN);
    };
    Series.prototype.az = function (a) {
        return new AxisRange(NaN, NaN);
    };
    Series.prototype.wy = function () {
        return new Size(1, 0, 0);
    };
    Series.prototype.ax = function (a, b, c) {
        this.p0();
        if (!this.isVertical) {
            if (this.ih == 0 && this.ik == 0) {
                return a;
            }
            var d = new ScalerParams(0, c, this.dc.wz, b.ch, this.getEffectiveViewport());
            d.b = this.iz();
            var e = b.el(a.c, d);
            var f = b.el(a.b, d);
            if (b.ch) {
                f += this.ih;
                e -= this.ik;
            }
            else {
                f -= this.ik;
                e += this.ih;
            }
            var g = b.eo(e, d);
            var h = b.eo(f, d);
            return new AxisRange(g, h);
        }
        else {
            if (this.ii == 0 && this.ij == 0) {
                return a;
            }
            var i = new ScalerParams(0, c, this.dc.wz, b.ch, this.getEffectiveViewport());
            i.b = this.iz();
            var j = b.el(a.c, i);
            var k = b.el(a.b, i);
            if (!b.ch) {
                k += this.ij;
                j -= this.ii;
            }
            else {
                k -= this.ii;
                j += this.ij;
            }
            var l = b.eo(j, i);
            var m = b.eo(k, i);
            return new AxisRange(l, m);
        }
    };
    Series.prototype.p0 = function () {
        if (isNaN_(this.ik)) {
            var a = this.w1(1, 1);
            this.ik = a.top;
            if (isNaN_(this.ik)) {
                this.ik = 0;
            }
        }
        if (isNaN_(this.ih)) {
            var b = this.w1(1, 1);
            this.ih = b.bottom;
            if (isNaN_(this.ih)) {
                this.ih = 0;
            }
        }
        if (isNaN_(this.ii)) {
            var c = this.w1(1, 1);
            this.ii = c.left;
            if (isNaN_(this.ii)) {
                this.ii = 0;
            }
        }
        if (isNaN_(this.ij)) {
            var d = this.w1(1, 1);
            this.ij = d.right;
            if (isNaN_(this.ij)) {
                this.ij = 0;
            }
        }
    };
    Series.prototype.ru = function (a) {
        this.gs = false;
        if (this.dc != null) {
            this.dc.ar.ac(0, this, this.a1, a);
            if (this.renderRequested != null) {
                var b = new RenderRequestedEventArgs();
                b.animate = a;
                this.renderRequested(this, b);
                a = b.animate;
            }
        }
    };
    Series.prototype.pk = function (a) {
        this.rv(a);
        if (this.hf(this.cw.b9, this.cw.ca, this.cw)) {
            this.pv();
        }
        this.gs = false;
    };
    Object.defineProperty(Series.prototype, "bv", {
        get: function () {
            return this.bu;
        },
        set: function (a) {
            this.bu = a;
        },
        enumerable: false,
        configurable: true
    });
    Series.prototype.rv = function (a) {
        {
            this.rh();
        }
        if (this.g4 && !this.go()) {
            this.g3 = false;
        }
        if (this.g7 && !this.gp()) {
            this.g6 = false;
            this.q2();
        }
    };
    Object.defineProperty(Series.prototype, "cf", {
        get: function () {
            return this.ce;
        },
        enumerable: false,
        configurable: true
    });
    Series.prototype.get_eo = function () {
        return this.gc();
    };
    Object.defineProperty(Series.prototype, "eo", {
        get: function () {
            return this.get_eo();
        },
        enumerable: false,
        configurable: true
    });
    Series.prototype.gc = function () {
        return this.highlightedItemsSource != null;
    };
    Series.prototype.rh = function () {
        var a = false;
        if (this.bo != null) {
            a = true;
        }
        var b = this.bw;
        if (b == 0) {
            if (this.dc != null) {
                if (this.dc.bt != 0) {
                    b = this.dc.bt;
                }
            }
        }
        if (b == 0) {
            b = 1;
        }
        if (!this.eo || a) {
            b = 1;
        }
        if (this.bv != b) {
            if (this.bv == 1 && b != 1) {
                this.bv = b;
                this.pm();
            }
            else {
                this.bv = b;
                this.pi();
            }
        }
    };
    Series.prototype.pi = function () {
        if (!this.gu) {
            return;
        }
        if (this.b5 != null) {
            this.b5.au();
        }
    };
    Series.pp = function () {
        if (Series.hk == null) {
            Series.hk = new Dictionary$2(String_$type, String_$type, 0);
            Series.hl = new Dictionary$2(String_$type, String_$type, 0);
            Series.pb(Series.hk, Series.hl);
        }
    };
    Series.nx = function (a) {
        Series.pp();
        if (Series.hk.containsKey(a)) {
            return Series.hk.item(a);
        }
        return PlatformAPIHelper.q(a);
        return a;
    };
    Series.ny = function (a) {
        Series.pp();
        if (Series.hl.containsKey(a)) {
            return Series.hl.item(a);
        }
        return PlatformAPIHelper.r(a);
        return a;
    };
    Series.pb = function (a, b) {
        Series.hk.item("ItemsSource", "dataSource");
        Series.hl.item("dataSource", "ItemsSource");
        Series.hk.item("HighlightedItemsSource", "highlightedDataSource");
        Series.hl.item("highlightedDataSource", "HighlightedItemsSource");
    };
    Series.prototype.r4 = function (a, b) {
        var c = typeCast(Brush.$, b.value);
        if (c == null) {
            return;
        }
        b.value = BrushUtil.s(c, this.ib);
    };
    Series.prototype.r2 = function (a, b) {
        var c = typeCast(String_$type, b.value);
        if (c != null) {
            c += this.mj;
            b.value = c;
        }
    };
    Series.prototype.r1 = function (a, b) {
        if (this.highlightedItemsSource != null) {
            b.value = this.highlightedItemsSource;
            return;
        }
        b.value = this.itemsSource;
    };
    Series.prototype.r3 = function (a, b) {
        var c = this.ke / 1000;
        if (c != 0) {
            b.value = this.ke;
            return;
        }
        b.value = this.kf;
    };
    Series.prototype.get_gu = function () {
        return true;
    };
    Object.defineProperty(Series.prototype, "gu", {
        get: function () {
            return this.get_gu();
        },
        enumerable: false,
        configurable: true
    });
    Series.prototype.pm = function () {
        var e_120, _a;
        if (!this.gu) {
            return;
        }
        if (this.b5 == null || !this.cb.contains(this.b5)) {
            var a = new SeriesLayer();
            var b = this.ht();
            try {
                for (var _b = __values(fromEnum(b)), _c = _b.next(); !_c.done; _c = _b.next()) {
                    var c = _c.value;
                    a.m.add(c);
                }
            }
            catch (e_120_1) {
                e_120 = { error: e_120_1 };
            }
            finally {
                try {
                    if (_c && !_c.done && (_a = _b.return))
                        _a.call(_b);
                }
                finally {
                    if (e_120)
                        throw e_120.error;
                }
            }
            this.b5 = a;
            this.cb.add(a);
        }
        else {
            this.b5.at();
        }
    };
    Series.prototype.ht = function () {
        var e_121, _a, e_122, _b;
        var a = ((function () {
            var $ret = new SeriesLayerPropertyOverlay();
            $ret.ad = "ItemsSource";
            $ret.y = "HighlightedItemsSource";
            $ret.q = true;
            return $ret;
        })());
        a.valueResolving = delegateCombine(a.valueResolving, runOn(this, this.r1));
        var b = ((function () {
            var $ret = new SeriesLayerPropertyOverlay();
            $ret.ad = "ShouldAnimateOnDataSourceSwap";
            $ret.q = true;
            $ret.x = true;
            $ret.p = true;
            return $ret;
        })());
        var c = ((function () {
            var $ret = new SeriesLayerPropertyOverlay();
            $ret.ad = "TransitionDuration";
            $ret.y = "TransitionInDuration";
            $ret.q = true;
            $ret.p = true;
            return $ret;
        })());
        c.valueResolving = delegateCombine(c.valueResolving, runOn(this, this.r3));
        var d = ((function () {
            var $ret = new SeriesLayerPropertyOverlay();
            $ret.ad = "Title";
            $ret.p = true;
            $ret.q = true;
            return $ret;
        })());
        d.valueResolving = delegateCombine(d.valueResolving, runOn(this, this.r2));
        var e = ((function () {
            var $ret = new SeriesLayerPropertyOverlay();
            $ret.ad = "LegendItemVisibility";
            $ret.q = true;
            $ret.y = "HighlightedLegendItemVisibility";
            $ret.p = true;
            return $ret;
        })());
        e.valueResolving = delegateCombine(e.valueResolving, runOn(this, this.qb));
        var f = new List$1(SeriesLayerPropertyOverlay.$, 0);
        var g = this.hu();
        {
            f.add(a);
        }
        f.add(d);
        f.add(b);
        f.add(c);
        f.add(e);
        f.o(g);
        if (this.cf.count > 0) {
            var h = new Dictionary$2(String_$type, SeriesLayerPropertyOverlay.$, 0);
            try {
                for (var _c = __values(fromEnum(f)), _d = _c.next(); !_d.done; _d = _c.next()) {
                    var i = _d.value;
                    h.addItem(i.ad, i);
                }
            }
            catch (e_121_1) {
                e_121 = { error: e_121_1 };
            }
            finally {
                try {
                    if (_d && !_d.done && (_a = _c.return))
                        _a.call(_c);
                }
                finally {
                    if (e_121)
                        throw e_121.error;
                }
            }
            try {
                for (var _e = __values(fromEnum(this.cf)), _f = _e.next(); !_f.done; _f = _e.next()) {
                    var j = _f.value;
                    if (h.containsKey(j.ad)) {
                        j.k = h.item(j.ad);
                        f.remove(h.item(j.ad));
                    }
                    f.add(j);
                }
            }
            catch (e_122_1) {
                e_122 = { error: e_122_1 };
            }
            finally {
                try {
                    if (_f && !_f.done && (_b = _e.return))
                        _b.call(_e);
                }
                finally {
                    if (e_122)
                        throw e_122.error;
                }
            }
        }
        return f;
    };
    Series.prototype.qb = function (a, b) {
        if (this.w2 == 1) {
            b.value = enumGetBox(Visibility_$type, 1);
            return;
        }
        b.value = enumGetBox(Visibility_$type, this.legendItemVisibility);
    };
    Series.prototype.hu = function () {
        return new List$1(SeriesLayerPropertyOverlay.$, 0);
    };
    Object.defineProperty(Series.prototype, "fw", {
        get: function () {
            return this.dw;
        },
        enumerable: false,
        configurable: true
    });
    Series.prototype.qz = function () {
        if (!this.dw) {
            this.pg();
        }
        this.dw = true;
        if (this.renderValid != null) {
            this.renderValid(this, new RenderValidEventArgs());
        }
    };
    Series.prototype.o3 = function () {
        if (this.g2 && !this.g4) {
            this.dd.r = truncate(Math.max(this.ja(), this.jb()));
            this.o8();
        }
        if (this.g5 && !this.g7) {
            this.dd.r = truncate(Math.max(this.ja(), this.jc()));
            this.o8();
        }
    };
    Series.prototype.qq = function () {
        if (!this.d4()) {
            if (this.dc != null) {
                this.dc.p3(this);
            }
        }
    };
    Series.prototype.q2 = function () {
        if (this.gl) {
            if (this.bo != null) {
                this.bo.rr(this);
            }
            else if (this.dc != null) {
                this.dc.series.remove(this);
            }
        }
        if (this.bo != null) {
            if (this.bo.gk) {
                if (this.bo.highlightedItemsSource != null) {
                    this.bo.highlightedItemsSource = null;
                }
            }
        }
        if (this.transitionOutCompleted != null) {
            this.transitionOutCompleted(this, new TransitionOutCompletedEventArgs());
        }
    };
    Series.prototype.rr = function (a) {
        if (a.b6 != null) {
            if (this.cc.contains(a.b6)) {
                this.cc.remove(a.b6);
            }
            if (this.cb.contains(a.b6)) {
                this.cb.remove(a.b6);
            }
        }
    };
    Series.prototype.o8 = function () {
    };
    Series.prototype.rw = function (a, b) {
        if (this.cv == null) {
            this.cv = this.ct();
            this.cv.t = true;
            if (this.dc != null) {
                this.dc.am.o(this.cv);
                this.cv.a = this.dc.am;
            }
            this.cv.a4();
        }
        this.cv.b9 = a;
    };
    Series.prototype.rb = function () {
    };
    Series.prototype.rx = function () {
        if (this.cv == null) {
            this.cv = this.ct();
            this.cv.t = true;
            if (this.dc != null) {
                this.dc.am.o(this.cv);
                this.cv.a = this.dc.am;
            }
            this.cv.a4();
        }
    };
    Series.prototype.rt = function (a, b, c, d, e) {
        this.ba.a$z(this, a, b, d, e);
    };
    Series.prototype.bd = function () {
        return null;
    };
    Series.prototype.getEffectiveViewport1 = function (a) {
        if (this.dc == null) {
            return Rect.empty;
        }
        if (a.s) {
            return this.dc.wl;
        }
        if (a.t) {
            if (this.dc.wl.isEmpty) {
                return this.dc.wl;
            }
            var b = this.dc.wr(a.b9, this.dc.wz, this.dc.wl);
            return b;
        }
        return this.dc.wl;
    };
    Series.prototype.getMainContentViewport = function () {
        return this.wo(this.cw);
    };
    Series.prototype.wo = function (a) {
        if (this.dc == null || this.dc.wk.isEmpty) {
            return a.b9;
        }
        if (a.s) {
            return a.b9;
        }
        if (a.t) {
            if (this.dc.wl.isEmpty) {
                return a.b9;
            }
            if (this.dc.wk.equals1(this.dc.wz)) {
                return a.b9;
            }
            var b = this.dc.wr(a.b9, this.dc.wz, this.dc.wl);
            var c = this.dc.wp(a.b9, b, this.dc.wh);
            return c;
        }
        return this.dc.wk;
    };
    Series.prototype.wr = function (a) {
        if (!this.wx.equals1(a)) {
            return Rect.empty;
        }
        return this.getEffectiveViewport();
    };
    Series.prototype.wq = function (a) {
        if (this.dc == null || this.dc.wl.isEmpty) {
            return Rect.empty;
        }
        var b = this.dc.wl;
        var c = a.b9;
        var d = (b.left - c.left) / c.width;
        var e = (b.top - c.top) / c.height;
        var f = (b.right - c.left) / c.width;
        var g = (b.bottom - c.top) / c.height;
        return new Rect(0, d, e, f - d, g - e);
    };
    Series.prototype.getEffectiveViewport = function () {
        return this.getEffectiveViewport1(this.cw);
    };
    Series.prototype.rn = function () {
        this.ro(null);
    };
    Series.prototype.get_ef = function () {
        return false;
    };
    Object.defineProperty(Series.prototype, "ef", {
        get: function () {
            return this.get_ef();
        },
        enumerable: false,
        configurable: true
    });
    Series.prototype.get_el = function () {
        return this.by == 2 || this.by == 4;
    };
    Object.defineProperty(Series.prototype, "el", {
        get: function () {
            return this.get_el();
        },
        enumerable: false,
        configurable: true
    });
    Series.prototype.ro = function (a) {
        if (this.fj) {
            this.ba.a$ak(this, a);
        }
    };
    Series.prototype.rp = function (a) {
        if (this.fj) {
            this.ba.a$al(this, a, this.dc);
        }
    };
    Series.prototype.getViewInfo = function (a, b) {
        a = this.cw.b9;
        b = this.cw.ca;
        return {
            p0: a,
            p1: b
        };
    };
    Series.prototype.hf = function (a, b, c) {
        if (a.width == 0 || a.height == 0) {
            return false;
        }
        if (this.isFragment) {
            return true;
        }
        return this._visibility == 0;
    };
    Series.prototype.o7 = function (a, b) {
        if (a) {
            this.g1 = true;
        }
    };
    Series.prototype.d6 = function () {
        return this.d7(this.cw);
    };
    Series.prototype.d7 = function (a) {
        var b = a.b9;
        var c = a.ca;
        if (!this.hf(b, c, a)) {
            this.o7(true, a);
            return true;
        }
        return false;
    };
    Series.prototype.q4 = function (a, b) {
        this.cw.b9 = b;
        this.su(a, b);
        if (this.dc != null) {
            this.dc.ar.ae(0, this, this.a1, b);
            if (a.isEmpty || a.width == 0 || a.height == 0) {
                this.dc.ok();
            }
        }
    };
    Series.prototype.sv = function (a, b) {
    };
    Series.prototype.su = function (a, b) {
    };
    Object.defineProperty(Series.prototype, "g1", {
        get: function () {
            return this.dz;
        },
        set: function (a) {
            this.dz = a;
        },
        enumerable: false,
        configurable: true
    });
    Series.prototype.p2 = function (a) {
        a.pl(null);
    };
    Series.prototype.qo = function () {
        this.gt = false;
        this.g1 = true;
        if (this.dc != null) {
            this.dc.or();
        }
    };
    Series.prototype.ri = function (a) {
        this.hw.h(a);
        this.sl();
        this.hw.e();
    };
    Series.prototype.qi = function () {
        this.sl();
        this.q5();
    };
    Series.prototype.qn = function () {
        this.gt = false;
        this.g1 = true;
        if (this.dc != null) {
            this.dc.oq();
        }
    };
    Series.prototype.get_fh = function () {
        return true;
    };
    Object.defineProperty(Series.prototype, "fh", {
        get: function () {
            return this.get_fh();
        },
        enumerable: false,
        configurable: true
    });
    Series.prototype.get_isUsableInLegend = function () {
        return true;
    };
    Object.defineProperty(Series.prototype, "isUsableInLegend", {
        get: function () {
            return this.get_isUsableInLegend();
        },
        enumerable: false,
        configurable: true
    });
    Series.prototype.qv = function () {
        this.cw.a0();
    };
    Series.prototype.qp = function () {
        this.q5();
    };
    Series.prototype.q5 = function () {
        this.cw.bb();
        this.q7(false);
        this.sm();
        if (this.isStacked) {
            this.p5(function (a) {
                a.q5();
                if (a.ei) {
                    a.p3(function (b) {
                        b.q6();
                        return true;
                    });
                }
                return true;
            });
        }
        if (this.ei) {
            this.p3(function (a) {
                a.q6();
                return true;
            });
        }
    };
    Series.prototype.q6 = function () {
        this.cw.bb();
        this.q7(true);
        if (this.isStacked) {
            this.p5(function (a) {
                a.q6();
                if (a.ei) {
                    a.p3(function (b) {
                        b.q6();
                        return true;
                    });
                }
                return true;
            });
        }
        if (this.ei) {
            this.p3(function (a) {
                a.q6();
                return true;
            });
        }
    };
    Series.prototype.gb = function () {
        return false;
    };
    Series.prototype.q7 = function (a) {
        if (this.a1 == null || this.a1.c) {
            return;
        }
        var b = this.cw.b9;
        var c = this.cw.ca;
        var d = this.hf(b, c, this.cw);
        var e = this.dc != null && this.dc.fh && this.cv != null && this.hf(this.cv.b9, this.cv.ca, this.cv);
        if (d) {
            if (a) {
                this.gs = !this.gb();
                this.pk(false);
            }
            else {
                this.ru(false);
                this.gs = !this.gb();
            }
        }
        if (e) {
            if (!this.g1) {
                this.qn();
                this.gt = true;
            }
        }
    };
    Object.defineProperty(Series.prototype, "g3", {
        get: function () {
            return this.d0;
        },
        set: function (a) {
            this.d0 = a;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(Series.prototype, "g6", {
        get: function () {
            return this.d1;
        },
        set: function (a) {
            this.d1 = a;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(Series.prototype, "g4", {
        get: function () {
            if (this.g3 == false) {
                return false;
            }
            return this.jb() > 0;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(Series.prototype, "g7", {
        get: function () {
            if (this.g6 == false) {
                return false;
            }
            return this.jc() > 0;
        },
        enumerable: false,
        configurable: true
    });
    Series.prototype.v = function () {
        _super.prototype.v.call(this);
        this.raisePropertyChanged("Opacity", this._opacity, this._opacity);
    };
    Series.prototype.w = function (a, b) {
        _super.prototype.w.call(this, a, b);
        this.raisePropertyChanged("Visibility", enumGetBox(Visibility_$type, a), enumGetBox(Visibility_$type, b));
    };
    Series.prototype.qu = function () {
    };
    Series.prototype.qh = function () {
        if (this.dc != null) {
            this.dc.ok();
        }
    };
    Series.prototype.py = function () {
        if (this.dc != null) {
            for (var a = 0; a < this.dc.selectedSeriesItems.count; a++) {
                var b = this.dc.selectedSeriesItems._inner[a];
                b.g(this.dc);
            }
            for (var c = 0; c < this.dc.selectedSeriesItems.count; c++) {
                var d = this.dc.selectedSeriesItems._inner[c];
                if (d.series != null && d.series != this) {
                    continue;
                }
                if (d.item == null) {
                    this.pz();
                }
                else {
                    this.pu(d.item);
                }
            }
        }
    };
    Series.prototype.pq = function () {
        if (this.dc != null) {
            for (var a = 0; a < this.dc.focusedSeriesItems.count; a++) {
                var b = this.dc.focusedSeriesItems._inner[a];
                if (b.series != null && b.series != this) {
                    continue;
                }
                this.pt(b.item);
            }
        }
    };
    Series.prototype.rc = function (a, b, c, d) {
        switch (b) {
            case "SyncLink":
                if (typeCast(SyncLink.$, c) !== null) {
                    var e = c;
                    e.propertyUpdated = delegateRemove(e.propertyUpdated, this.bi);
                    this.rm(typeCast(IFastItemsSourceProvider_$type, c));
                }
                if (typeCast(SyncLink.$, d) !== null) {
                    var f = d;
                    f.propertyUpdated = delegateCombine(f.propertyUpdated, this.bi);
                    this.rl(typeCast(IFastItemsSourceProvider_$type, d));
                }
                if (this.index == -1) {
                    this.index = XamDataChart.y6(this);
                }
                break;
            case Series.$$p[41]:
                this.ci = this.ck();
                this.sk();
                this.pl(null);
                this.q5();
                break;
            case Series.$$p[67]:
                this.d3 = this.ha;
                this.pg();
                this.q5();
                break;
            case SeriesViewer.$$p[1]:
            case SeriesViewer.$$p[21]:
            case SeriesViewer.$$p[20]:
            case SeriesViewer.$$p[22]:
                this.pl(null);
                break;
            case "HighlightingMode":
                this.by = this.bz();
                break;
            case "SelectionMode":
                this.cq = this.cs();
                break;
            case "FocusMode":
                this.cp = this.cr();
                break;
            case "SeriesViewer":
                if (typeCast(SeriesViewer.$, c) !== null) {
                    this.j0 = null;
                    var g = c;
                    g.windowRectChanged = delegateRemove(g.windowRectChanged, this.dq);
                    var h = c.series;
                    h.collectionChanged = delegateRemove(h.collectionChanged, this.hz);
                    var i = c;
                    i.propertyUpdated = delegateRemove(i.propertyUpdated, this.bi);
                    c.ar.ad(0, this);
                    this.ro(c);
                    this.cw.at(c);
                }
                if (typeCast(SeriesViewer.$, d) !== null) {
                    this.j0 = d.c9.j.ae;
                    var j = d;
                    j.windowRectChanged = delegateCombine(j.windowRectChanged, this.dq);
                    var k = d.series;
                    k.collectionChanged = delegateCombine(k.collectionChanged, this.hz);
                    var l = d;
                    l.propertyUpdated = delegateCombine(l.propertyUpdated, this.bi);
                    this.a1 = d.ar.k(0, this, runOn(this, this.pk));
                    this.cw.ao(d);
                    this.by = this.bz();
                    this.cq = this.cs();
                    this.cp = this.cr();
                    this.vj = this.vx();
                    this.vf = this.vw();
                    this.sh();
                    this.pg();
                    if (this.f1) {
                        this.ie = this.jl();
                    }
                    this.pn();
                    this.kh = this.dc.i7();
                    this.py();
                    this.pq();
                }
                if (this.dc == null) {
                    this.externalObject._ensureTooltipDestroyed();
                    this.dd.w();
                    if (c != null) {
                        var m = c;
                        m.p3(this);
                    }
                }
                if (this.index != -1) {
                    this.ri(null);
                }
                if (this.index == -1 || d == null) {
                    this.index = XamDataChart.y6(this);
                }
                this.a5 = this.a6();
                this.oz(typeCast(SeriesViewer.$, c), typeCast(SeriesViewer.$, d));
                break;
            case Series.$$p[56]:
                if (this.cw != null) {
                    this.cw.ba();
                }
                break;
            case "HitTestMode":
                this.b2 = this.b3();
                break;
            case "ActualHitTestMode":
                if (this.dc != null) {
                    this.dc.q7();
                }
                break;
            case Series.$$p[26]:
                this.ru(true);
                break;
            case Series.$$p[19]:
            case Series.$$p[25]:
                this.qh();
                break;
            case "LegendItemBadgeTemplate":
            case "LegendItemTemplate":
            case Series.$$p[34]:
            case Series.$$p[33]:
                this.ri(b);
                this.q5();
                this.qh();
                break;
            case Series.$$p[38]:
                this.sj();
                break;
            case Series.$$p[27]:
                this.si();
                break;
            case Series.$$p[12]:
            case Series.$$p[13]:
                if (this.lw != null) {
                    this.as = new BindingFormatter();
                    this.as.j = this.lw;
                    this.as.d = this.ag;
                }
                else {
                    this.as = null;
                }
                break;
            case Series.$$p[14]:
            case Series.$$p[15]:
                if (this.lw != null) {
                    this.at = new BindingFormatter();
                    this.at.j = this.lz;
                    this.at.d = this.ah;
                }
                else {
                    this.at = null;
                }
                break;
            case Series.$$p[6]:
            case Series.$$p[16]:
            case Series.$$p[42]:
            case Series.$$p[17]:
            case Series.$$p[18]:
                this.pl(b);
                this.q5();
                break;
            case "Index":
                if (typeGetValue(c) != typeGetValue(d)) {
                    this.qu();
                    this.ci = this.ck();
                    this.sk();
                    this.sj();
                    this.pl(null);
                    this.q5();
                }
                break;
            case "RadiusX":
            case "RadiusY":
            case "RoundedCornersLocation":
                this.q5();
                break;
            case Series.$$p[10]:
                this.sh();
                this.q5();
                break;
            case Series.$$p[37]:
            case Series.$$p[36]:
            case Series.$$p[39]:
                this.q5();
                break;
            case Series.$$p[31]:
                this.qv();
                this.q5();
                break;
            case Series.$$p[68]:
            case Series.$$p[47]:
            case Series.$$p[46]:
            case Series.$$p[48]:
            case Series.$$p[49]:
                this.q5();
                break;
            case Series.$$p[55]:
                this.sk();
                if (this.be == 1) {
                    this.sm();
                }
                break;
            case Series.$$p[3]:
            case Series.$$p[4]:
                this.pg();
                this.q5();
                break;
            case Series.$$p[21]:
                this.vf = this.vw();
                break;
            case Series.$$p[45]:
                this.vj = this.vx();
                break;
            case Series.$$p[8]:
                this.vo = this.vj;
                this.q5();
                break;
            case Series.$$p[2]:
                this.vm = this.vf;
                this.q5();
                break;
            case Series.$$p[1]:
            case Series.$$p[7]:
            case Series.$$p[9]:
                this.safeActualBrush = this.vz(this.ve);
                this.vl = this.ve;
                this.vn = this.vi;
                this.im = this.ig;
                this.vh = this.vi;
                this.vg = this.ve;
                this.q5();
                this.cw.bx();
                if (this.toolTip != null && this.a9 != null) {
                    this.ba.a$as(this, this.toolTip);
                }
                break;
            case "Visibility":
                this.cw.by();
                break;
            case Series.$$p[22]:
                this.ru(true);
                break;
            case "ItemsSource":
                if (this.c4 != null) {
                    this.rl(this.c4);
                }
                break;
            case Series.$$p[20]:
                this.pg();
                if (c != d && d != null) {
                    if (!this.gh || !this.d9) {
                        this.g3 = true;
                    }
                    this.g6 = false;
                    this.gl = false;
                }
                this.qo();
                if (typeCast(IFastItemsSource_$type, c) != null) {
                    var n = c;
                    n.event = delegateRemove(n.event, this.jw);
                }
                if (typeCast(IFastItemsSource_$type, d) != null) {
                    var o = d;
                    o.event = delegateCombine(o.event, this.jw);
                }
                this.py();
                this.pq();
                break;
            case "Legend":
                if (d != null) {
                    if (a == this) {
                        d.seriesOwner = this;
                    }
                    else if (typeCast(XamDataChart.$, a) !== null) {
                        d.chartOwner = a;
                    }
                }
                this.a5 = this.a6();
                break;
            case "ActualLegend":
                if (this.a5 != null && this.a5.isItemwise) {
                    this.pg();
                    this.eh = true;
                }
                else {
                    this.eh = false;
                }
                if (c != null && c.isItemwise) {
                    c.clearLegendItemsForSeries(this);
                }
                this.ep = this.a5 == null ? false : this.a5.isFinancial;
                this.oy(typeCast(IChartLegend_$type, c), typeCast(IChartLegend_$type, d));
                this.pv();
                break;
            case "LegendItem":
                this.o0(typeCast(Control.$, c), typeCast(Control.$, d));
                break;
            case Series.$$p[35]:
                this.pg();
                this.cw.a5();
                this.qh();
                break;
            case Series.$$p[57]:
                if (this.a9 != null || this.fj) {
                    this.ba.a$as(this, this.toolTip);
                }
                break;
            case "CrosshairPoint":
                if (this.dc != null) {
                    this.ss(this.dc.v8);
                }
                if (this.dc != null) {
                    if (!this.d8) {
                        this.dc.qz(this, this.ko(this.dc.v8));
                    }
                }
                break;
            case Series.$$p[43]:
                this.ie = this.jl();
                break;
            case "ActualResolution":
                this.ru(false);
                this.qn();
                break;
            case Series.$$p[72]:
                this.ik = this.jv;
                if (this.dc != null) {
                    this.dc.oe();
                }
                break;
            case Series.$$p[69]:
                this.ih = this.js;
                if (this.dc != null) {
                    this.dc.oe();
                }
                break;
            case Series.$$p[58]:
            case Series.$$p[59]:
                var p = this.dd.f();
                this.dd.w();
                if (p) {
                    this.qq();
                }
                this.dd.r = this.ke;
                this.dd.b = this.de;
                this.ru(false);
                break;
            case "DiscreteLegendItemTemplate":
                this.ru(false);
                break;
            case "VisibilityProxy":
                if (c != d) {
                    this.ru(false);
                }
                this.qn();
                this.cw.by();
                break;
            case Series.$$p[32]:
                this.by = this.bz();
                this.ru(false);
                break;
            case Series.$$p[28]:
                this.ic = isNaN_(this.jg) ? 0.2 : this.jg;
                break;
            case Series.$$p[54]:
                this.pn();
                break;
            case "FinalValue":
                this.sr();
                break;
            case Series.$$p[73]:
                this.cy = this.cz();
                break;
        }
    };
    Series.prototype.vw = function () {
        if (this.vp != null) {
            return this.vp;
        }
        else {
            if (this.dc != null && this.dc.vk != null) {
                return this.dc.vk;
            }
            else {
                return BrushUtil.j(255, 255, 0, 0);
            }
        }
    };
    Series.prototype.vx = function () {
        if (this.v4 != null) {
            return this.v4;
        }
        else {
            if (this.dc != null && this.dc.v1 != null) {
                return this.dc.v1;
            }
            else {
                return BrushUtil.j(255, 255, 0, 0);
            }
        }
    };
    Series.prototype.vz = function (a) {
        if (this.gm) {
            return this.cw.b2(a);
        }
        return a;
    };
    Series.prototype.sk = function () {
        var a = this.ci;
        var b = this.jq;
        if (isNaN_(b)) {
            b = DeviceUtils.g(2);
        }
        if (a == 2) {
            b = 1;
        }
        if (this.ig != b) {
            this.ig = b;
        }
        this.im = this.ig;
    };
    Series.prototype.ss = function (a) {
        if (this.dc != null && this.dc.fa && this.by != 1 && this.dc.e7) {
            if (isNaN_(a.x) || isNaN_(a.y)) {
                this.ba.a$ab(this, null, a, false, false, false, false, this.dc.bq == this, true);
            }
            else {
                this.ba.a$ab(this, this.ko(a), a, false, false, false, false, this.dc.bq == this, false);
            }
        }
    };
    Series.prototype.pu = function (a) {
        if (this.dp == null) {
            return;
        }
        var b = this.dp.indexOf(a);
        if (b < 0) {
            return;
        }
        if (this.fj) {
            this.ba.a$x(this, a, b);
        }
    };
    Series.prototype.pz = function () {
        if (this.dp == null) {
            return;
        }
        if (this.fj) {
            this.ba.a$v(this);
        }
    };
    Series.prototype.px = function () {
        if (this.dp == null) {
            return;
        }
        if (this.fj) {
            this.ba.a$ao(this);
        }
    };
    Series.prototype.pt = function (a) {
        if (this.dp == null) {
            return;
        }
        var b = this.dp.indexOf(a);
        if (b < 0) {
            return;
        }
        if (this.fj) {
            this.ba.a$w(this, a, b);
        }
    };
    Series.prototype.ps = function (a) {
        if (this.dp == null) {
            return;
        }
        var b = this.dp.indexOf(a);
        if (b < 0) {
            return;
        }
        if (this.fj) {
            this.ba.a$an(this, a, b);
        }
    };
    Series.prototype.eg = function (a) {
        if (this.dp != null && this.dp.indexOf(a) >= 0) {
            return true;
        }
        return false;
    };
    Series.prototype.pr = function (a) {
        if (this.dp == null) {
            return;
        }
        var b = this.dp.indexOf(a);
        if (b < 0) {
            return;
        }
        if (this.fj) {
            this.ba.a$am(this, a, b);
        }
    };
    Series.prototype.pn = function () {
        var vwr_ = this.dc;
        if (vwr_ != null) {
            if (vwr_.e8) {
                var host_ = vwr_.jf;
                if (host_ != null) {
                    Series.po(this, this.dc, false);
                    this.externalObject.owner = (this.externalObject.owner) ? this.externalObject.owner : ((host_) ? host_.externalObject : null);
                }
            }
            else {
                Series.po(this, this.dc, false);
                this.externalObject.owner = (this.externalObject.owner) ? this.externalObject.owner : ((vwr_) ? vwr_.externalObject : null);
            }
        }
        if (this.dc != null && (this.externalObject.owner)) {
            var sv_ = this.dc;
            this.externalObject.owner._ensureDefaultTooltip(this.externalObject);
            ;
        }
    };
    Series.prototype.get_ff = function () {
        return false;
    };
    Object.defineProperty(Series.prototype, "ff", {
        get: function () {
            return this.get_ff();
        },
        enumerable: false,
        configurable: true
    });
    Series.prototype.ph = function (a) {
        a.d8 = true;
    };
    Object.defineProperty(Series.prototype, "c4", {
        get: function () {
            return this.c3;
        },
        set: function (a) {
            if (this.c4 != a) {
                var b = this.c4;
                this.c3 = a;
                this.raisePropertyChanged("SyncLink", b, this.c4);
            }
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(Series.prototype, "dc", {
        get: function () {
            return this.db;
        },
        set: function (a) {
            if (this.dc != a) {
                var b = this.dc;
                this.db = a;
                this.raisePropertyChanged("SeriesViewer", b, this.db);
            }
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(Series.prototype, "da", {
        get: function () {
            return typeCast(XamDataChart.$, this.dc);
        },
        set: function (a) {
            this.dc = a;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(Series.prototype, "itemsSource", {
        get: function () {
            return this.c(Series.t4);
        },
        set: function (a) {
            this.h(Series.t4, a);
        },
        enumerable: false,
        configurable: true
    });
    Series.prototype.pd = function (a, b, c, d) {
        this.pg();
        if (this.dc != null) {
            this.dc.q0();
        }
    };
    Object.defineProperty(Series.prototype, "legend", {
        get: function () {
            return this.c(Series.ua);
        },
        set: function (a) {
            this.h(Series.ua, a);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(Series.prototype, "sy", {
        get: function () {
            if (this.sw == null && this.a5 != null) {
                this.sw = this.sx();
            }
            return this.sw;
        },
        set: function (a) {
            if (this.sy != a) {
                var b = this.sy;
                this.sw = a;
                this.raisePropertyChanged("LegendItem", b, this.sw);
            }
        },
        enumerable: false,
        configurable: true
    });
    Series.prototype.k0 = function () {
        return this.sx();
    };
    Series.prototype.sx = function () {
        var _this = this;
        var a = typeCast(ContentControl.$, this.sw);
        var b = this.legendItemTemplate;
        if (b == null) {
            b = this.cw.bz(this.c2);
        }
        if (b != null) {
            if (a == null) {
                a = new ContentControl();
            }
            a.content = ((function () {
                var $ret = new DataContext();
                $ret.series = _this;
                $ret.item = null;
                return $ret;
            })());
            a.ah = b;
        }
        else {
            a = null;
        }
        return a;
    };
    Object.defineProperty(Series.prototype, "a5", {
        get: function () {
            return this.a4;
        },
        set: function (a) {
            if (this.a5 != a) {
                var b = this.a4;
                this.a4 = a;
                this.raisePropertyChanged("ActualLegend", b, this.a4);
            }
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(Series.prototype, "legendItemBadgeTemplate", {
        get: function () {
            return this.c(Series.t7);
        },
        set: function (a) {
            this.h(Series.t7, a);
        },
        enumerable: false,
        configurable: true
    });
    Series.prototype.s2 = function () {
        return this.legendItemBadgeTemplate;
    };
    Object.defineProperty(Series.prototype, "legendItemTemplate", {
        get: function () {
            return this.c(Series.t8);
        },
        set: function (a) {
            this.h(Series.t8, a);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(Series.prototype, "s1", {
        get: function () {
            return this.c(Series.to);
        },
        set: function (a) {
            this.h(Series.to, a);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(Series.prototype, "index", {
        get: function () {
            return typeGetValue(this.c(Series.tz));
        },
        set: function (a) {
            this.h(Series.tz, a);
        },
        enumerable: false,
        configurable: true
    });
    Series.prototype.st = function () {
        this.ri(null);
    };
    Series.prototype.pl = function (a) {
        this.ri(a);
    };
    Series.prototype.fi = function (a, b, c, d) {
        if (!BrushUtil.d(c, d)) {
            return true;
        }
        return false;
    };
    Series.prototype.sl = function () {
        this.qn();
        if (this.index < 0) {
            return;
        }
        if (this.vk != null) {
            this.sc("ActualBrush");
            var a = this.ve;
            this.cw.bk();
            this.cw.aq();
            var b = this.ve;
            var c = this.fi("ActualBrush", this.hw.f > 0 ? this.hw.d() : null, a, b);
            this.se("ActualBrush", c);
        }
        else {
            this.ve = this.dc == null ? null : this.dc.vn(this.index);
        }
        if (this.ci == 2) {
            this.sc("ActualOutline");
            var d = this.vi;
            this.cw.bl();
            this.vi = this.ve;
            var e = this.vi;
            var f = this.fi("ActualOutline", this.hw.f > 0 ? this.hw.d() : null, d, e);
            this.se("ActualOutline", f);
        }
        else {
            if (this.v0 != null) {
                this.sc("ActualOutline");
                var g = this.vi;
                this.cw.bl();
                this.cw.ar();
                var h = this.vi;
                var i = this.fi("ActualOutline", this.hw.f > 0 ? this.hw.d() : null, g, h);
                this.se("ActualOutline", i);
            }
            else {
                this.vi = this.dc == null ? null : this.dc.vt(this.index);
            }
        }
        if ((this.fx || this.fd) && this.fs) {
            this.ve = this.vi;
        }
        else if ((this.fx || this.fd) && this.ew) {
            this.vi = this.ve;
        }
        else if ((this.fx || this.fd) && this.fk) {
            this.vi = this.ve;
        }
        else if (this.f4 && this.legendItemBadgeShape == 2) {
            this.ve = this.vi;
        }
    };
    Series.prototype.d4 = function () {
        return this.dd.f();
    };
    Series.prototype.sb = function () {
        this.dd.v();
    };
    Object.defineProperty(Series.prototype, "ie", {
        get: function () {
            if (!this.dy) {
                this.dy = true;
                this.h3 = this.jl();
            }
            return this.h3;
        },
        set: function (a) {
            var b = this.h3;
            this.h3 = a;
            if (b != this.h3) {
                this.raisePropertyChanged("ActualResolution", b, this.h3);
            }
        },
        enumerable: false,
        configurable: true
    });
    Series.prototype.jl = function () {
        if (!isNaN_(this.jk)) {
            return this.jk;
        }
        return DeviceUtils.g(1);
    };
    Object.defineProperty(Series.prototype, "ik", {
        get: function () {
            return this.h7;
        },
        set: function (a) {
            this.h7 = a;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(Series.prototype, "ih", {
        get: function () {
            return this.h4;
        },
        set: function (a) {
            this.h4 = a;
        },
        enumerable: false,
        configurable: true
    });
    Series.prototype.r0 = function () {
        this.ik = NaN;
        this.ii = NaN;
        this.ij = NaN;
        this.ih = NaN;
    };
    Object.defineProperty(Series.prototype, "ii", {
        get: function () {
            return this.h5;
        },
        set: function (a) {
            this.h5 = a;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(Series.prototype, "ij", {
        get: function () {
            return this.h6;
        },
        set: function (a) {
            this.h6 = a;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(Series.prototype, "by", {
        get: function () {
            return this.bx;
        },
        set: function (a) {
            var b = this.bx;
            this.bx = a;
            if (b != this.bx) {
                this.raisePropertyChanged("ActualHighlightingMode", enumGetBox(SeriesHighlightingMode_$type, b), enumGetBox(SeriesHighlightingMode_$type, this.bx));
            }
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(Series.prototype, "cq", {
        get: function () {
            return this.co;
        },
        set: function (a) {
            var b = this.co;
            this.co = a;
            if (b != this.co) {
                this.raisePropertyChanged("ActualSelectionMode", enumGetBox(SeriesSelectionMode_$type, b), enumGetBox(SeriesSelectionMode_$type, this.co));
            }
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(Series.prototype, "cp", {
        get: function () {
            return this.cn;
        },
        set: function (a) {
            var b = this.cn;
            this.cn = a;
            if (b != this.cn) {
                this.raisePropertyChanged("ActualFocusMode", enumGetBox(SeriesSelectionMode_$type, b), enumGetBox(SeriesSelectionMode_$type, this.cn));
            }
        },
        enumerable: false,
        configurable: true
    });
    Series.prototype.get_gf = function () {
        return !this.ef;
    };
    Object.defineProperty(Series.prototype, "gf", {
        get: function () {
            return this.get_gf();
        },
        enumerable: false,
        configurable: true
    });
    Series.prototype.pw = function () {
    };
    Series.prototype.bz = function () {
        if (!this.ff) {
            return 1;
        }
        if (this.dc != null) {
            if (this.dc.by != 1 && this.dc.by != 0 && !this.e2) {
                return this.dc.by;
            }
        }
        if (this.fe) {
            return 2;
        }
        return 1;
    };
    Series.prototype.cs = function () {
        if (!this.ff) {
            return 1;
        }
        if (this.dc != null) {
            if (this.dc.cb != 1 && this.dc.cb != 0) {
                return this.dc.cb;
            }
        }
        return 1;
    };
    Series.prototype.cr = function () {
        if (!this.ff) {
            return 1;
        }
        if (this.dc != null) {
            if (this.dc.cb != 1 && this.dc.cb != 0) {
                return this.dc.b9;
            }
        }
        return 1;
    };
    Series.prototype.f0 = function (a) {
        switch (a) {
            case 2:
            case 4: return true;
        }
        return false;
    };
    Object.defineProperty(Series.prototype, "ib", {
        get: function () {
            return this.h1;
        },
        set: function (a) {
            var b = this.h1;
            this.h1 = a;
            if (b != this.h1) {
                this.raisePropertyChanged("ActualHighlightedValuesFadeOpacity", b, this.h1);
            }
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(Series.prototype, "ic", {
        get: function () {
            return this.h2;
        },
        set: function (a) {
            var b = this.h2;
            this.h2 = a;
            if (b != this.h2) {
                this.raisePropertyChanged("ActualHighlightingFadeOpacity", b, this.h2);
            }
        },
        enumerable: false,
        configurable: true
    });
    Series.prototype.pg = function () {
        this.dx = true;
    };
    Series.prototype.pv = function () {
        if (this.dx) {
            this.dx = false;
            if (this.d3) {
                if (this.eh) {
                    this.rj();
                }
            }
        }
    };
    Series.prototype.rj = function () {
        if (this.dc == null) {
            return;
        }
        if (this.a5 == null) {
            return;
        }
        if (this.a5.isItemwise) {
            var a = this.a5;
            this.a5.clearLegendItemsForSeries(this);
            if (this.legendItemVisibility == 0) {
                this.pc();
                a.renderItemwiseContent(this);
            }
        }
    };
    Series.prototype.gv = function (a) {
        return false;
    };
    Series.prototype.pc = function () {
        var _this = this;
        if (this.dp == null) {
            return;
        }
        var a = typeCast(IChartItemLegend_$type, this.a5);
        if (a == null || this.dp == null) {
            return;
        }
        this.hv = new List$1(UIElement.$, 0);
        var b = this.dp;
        var c = new List$1(SeriesPointOfInterest.$, 0);
        this.ed(c, false, false, 0, true);
        var _loop_7 = function (d) {
            var e = c._inner[d];
            var f = this_4.vt(e.c);
            var g = this_4.vs(e.c);
            var h = this_4.vu(e.c);
            var i = this_4.vv(e.c);
            var j = new ContentControl();
            var k = this_4.kt(e.c, true);
            var l = this_4.kv(e.c);
            var m = null;
            if (typeCast(Date_$type, k) !== null) {
                var n = k;
                m = (n.toString());
            }
            else {
                if (k != null) {
                    m = k.toString();
                }
            }
            var o = null;
            if (typeCast(Date_$type, l) !== null) {
                var p = l;
                o = (p.toString());
            }
            else {
                if (l != null) {
                    o = l.toString();
                }
                else {
                    o = m;
                }
            }
            if (this_4.ek) {
                g = f;
                i = h;
            }
            var q = this_4.ku(e.c);
            j.content = ((function () {
                var $ret = new DataContext();
                $ret.series = _this;
                $ret.item = q;
                $ret.itemBrush = g;
                $ret.outline = i;
                $ret.itemLabel = m;
                $ret.legendLabel = o;
                return $ret;
            })());
            var r = this_4.s1;
            if (r == null) {
                r = this_4.cw.bz(this_4.c1);
            }
            j.ah = r;
            this_4.hv.add(j);
        };
        var this_4 = this;
        for (var d = 0; d < c.count; d++) {
            _loop_7(d);
        }
    };
    Series.prototype.ku = function (a) {
        return this.dp.item(a);
    };
    Series.prototype.kt = function (a, b) {
        if (this.e0 || this.e8 || this.fu) {
            var c = this.a0();
            if (c != null) {
                if (!c.co()) {
                    return null;
                }
                if (c.cn) {
                    var d = a;
                    if (d < 0) {
                        return null;
                    }
                    var e = c;
                    var f = e.i$d(d);
                    var g = this.h0(f);
                    return g;
                }
                else {
                    if (c.ck) {
                        var h = a;
                        if (h < 0) {
                            h = 0;
                        }
                        var i = c;
                        var j = i.getDateTime(h);
                        return j;
                    }
                    else {
                        var k = a;
                        if (k < 0) {
                            return null;
                        }
                        var l = c.kv;
                        if (l == null || l.count == 0) {
                            return null;
                        }
                        var m = false;
                        if (c.b9 && c.cl) {
                            m = true;
                        }
                        if (!m) {
                            if (k >= l.count) {
                                k = l.count - 1;
                            }
                        }
                        var n = c.gf(k);
                        return n;
                    }
                }
            }
        }
        return null;
    };
    Series.prototype.kv = function (a) {
        return null;
    };
    Series.prototype.get_isColoredItemwise = function () {
        return this.d3;
    };
    Object.defineProperty(Series.prototype, "isColoredItemwise", {
        get: function () {
            return this.get_isColoredItemwise();
        },
        enumerable: false,
        configurable: true
    });
    Series.prototype.get_e7 = function () {
        return true;
    };
    Object.defineProperty(Series.prototype, "e7", {
        get: function () {
            return this.get_e7();
        },
        enumerable: false,
        configurable: true
    });
    Series.prototype.sh = function () {
        var a = (typeCast(XamDataChart.$, this.dc));
        if (a != null) {
            this.ia = isNaN_(this.il) ? a.xk.fp : this.il;
        }
    };
    Series.prototype.sj = function () {
        this.id = isNaN_(this.jh) ? this.jm() : this.jh;
    };
    Series.prototype.si = function () {
        this.ib = isNaN_(this.jf) ? 0.2 : this.jf;
    };
    Series.prototype.jm = function () {
        return 1;
    };
    Object.defineProperty(Series.prototype, "e5", {
        get: function () {
            return this.dv;
        },
        set: function (a) {
            this.dv = a;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(Series.prototype, "cy", {
        get: function () {
            return this.cx;
        },
        set: function (a) {
            this.cx = a;
        },
        enumerable: false,
        configurable: true
    });
    Series.prototype.cz = function () {
        if (this.c0 == 0) {
            return 1;
        }
        return this.c0;
    };
    Object.defineProperty(Series.prototype, "ci", {
        get: function () {
            return this.ch;
        },
        set: function (a) {
            this.ch = a;
        },
        enumerable: false,
        configurable: true
    });
    Series.prototype.ck = function () {
        if (this.cj == 0) {
            return 1;
        }
        return this.cj;
    };
    Series.prototype.a3 = function (a) {
        var _this = this;
        return ((function () {
            var $ret = new DataContext();
            $ret.series = _this;
            $ret.item = a;
            return $ret;
        })());
    };
    Series.prototype.c5 = function () {
        return 1;
    };
    Series.prototype.c8 = function () {
        return 1;
    };
    Series.prototype.rs = function () {
        this.cw.bg();
    };
    Series.prototype.rz = function () {
        this.eb = true;
        this.g6 = false;
        this.g3 = true;
        this.gl = false;
        this.ru(true);
    };
    Series.prototype.q9 = function () {
        this.g3 = false;
        this.g6 = true;
        this.gl = false;
        this.ru(true);
    };
    Series.prototype.q8 = function () {
        this.g6 = false;
        this.g3 = true;
        this.gl = false;
        this.ru(true);
    };
    Series.prototype.ra = function () {
        this.gl = true;
        if (!this.gp() || this.jc() == 0 || !this.hf(this.cw.b9, this.cw.ca, this.cw)) {
            this.q2();
        }
        this.g3 = false;
        this.g6 = true;
        this.ru(true);
    };
    Series.prototype.rq = function () {
        this.o4();
    };
    Series.prototype.o4 = function () {
    };
    Series.prototype.qd = function () {
    };
    Series._hr = function (a, b, c) {
        var d;
        return __generator(this, function (_a) {
            switch (_a.label) {
                case 0:
                    d = b;
                    _a.label = 1;
                case 1:
                    if (!(d < c))
                        return [3 /*break*/, 4];
                    return [4 /*yield*/, a(d)];
                case 2:
                    _a.sent();
                    _a.label = 3;
                case 3:
                    d++;
                    return [3 /*break*/, 1];
                case 4: return [2 /*return*/];
            }
        });
    };
    Series.hr = function (a, b, c) {
        return toEnum(function () { return Series._hr(a, b, c); });
    };
    Series.hq = function (a, b) {
        return Series.hr(a, 0, b);
    };
    Series.prototype.bs = function () {
        return this.br;
    };
    Series.prototype.r6 = function (a) {
        this.sn(a);
    };
    Series.prototype.ja = function () {
        return this.ke;
    };
    Series.prototype.jb = function () {
        return this.kf;
    };
    Series.prototype.jc = function () {
        return this.kg;
    };
    Series.prototype.get_g8 = function () {
        return this.d2;
    };
    Series.prototype.set_g8 = function (a) {
        this.d2 = a;
    };
    Object.defineProperty(Series.prototype, "g8", {
        get: function () {
            return this.get_g8();
        },
        set: function (a) {
            this.set_g8(a);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(Series.prototype, "gi", {
        get: function () {
            return this.g8;
        },
        enumerable: false,
        configurable: true
    });
    Series.prototype.o5 = function () {
        this.ba.a$y();
    };
    Series.prototype.dh = function (a, b, c) {
        return null;
    };
    Series.prototype.di = function (a, b, c) {
        return null;
    };
    Series.prototype.qw = function (a, b, c, d) {
        this.ba.a$ae(this, a, b, c, d);
    };
    Series.prototype.sa = function (a) {
        this.ba.a$ar(this, a);
    };
    Series.prototype.oz = function (a, b) {
        if (this.a5 != null && this.sy != null) {
            if (b == null && this.a5.containsChild(this.sy)) {
                this.a5.removeChild(this.sy);
            }
            if (b != null && !this.a5.containsChild(this.sy) && this.legendItemVisibility != 1) {
                this.a5.addChildInOrder(this.sy, this);
            }
        }
    };
    Series.prototype.o6 = function () {
        if (this.a5 == null || this.sy == null) {
            return;
        }
        this.a5.removeChild(this.sy);
    };
    Series.prototype.oy = function (a, b) {
        if (this.sy != null) {
            if (a != null && a.containsChild(this.sy)) {
                a.removeChild(this.sy);
            }
            if (this.dc != null && b != null && !b.containsChild(this.sy) && this.legendItemVisibility != 1) {
                b.addChildInOrder(this.sy, this);
            }
        }
    };
    Series.prototype.o0 = function (a, b) {
        if (this.a5 != null) {
            if (a != null && this.a5.containsChild(a)) {
                this.a5.removeChild(a);
            }
            if (this.dc != null && b != null && this.legendItemVisibility != 1) {
                this.a5.addChildInOrder(b, this);
            }
        }
    };
    Series.prototype.rm = function (a) {
        this.dp = a.releaseFastItemsSource(this.itemsSource);
    };
    Series.prototype.rl = function (a) {
        this.dp = a.getFastItemsSource(this.itemsSource);
    };
    Series.prototype.a6 = function () {
        if (this.legend != null) {
            return this.legend;
        }
        if (this.dc != null && this.dc.legend != null) {
            return this.dc.legend;
        }
        return null;
    };
    Series.prototype.go = function () {
        return false;
    };
    Series.prototype.gp = function () {
        return false;
    };
    Series.prototype.gg = function (a) {
        return (a && this.ja() > 0) || this.d4() || (this.g4 && this.go() && this.jb() > 0) || (this.g7 && this.gp() && this.jc() > 0);
    };
    Series.prototype.pe = function (a) {
        if (a != null) {
            a.b0(this);
        }
    };
    Series.prototype.rk = function (a) {
        if (a != null) {
            a.ct(this);
        }
    };
    Series.prototype.bt = function () {
        return this.cw.h();
    };
    Series.prototype.sn = function (a) {
        this.cw.bm(a);
    };
    Series.prototype.r9 = function (a, b) {
        this.ba.a$aq(this, a, b);
    };
    Series.prototype.get_hb = function () {
        return false;
    };
    Object.defineProperty(Series.prototype, "hb", {
        get: function () {
            return this.get_hb();
        },
        enumerable: false,
        configurable: true
    });
    Series.prototype.rd = function (a, b) {
        this.cw.a3(a, b);
    };
    Series.prototype.rf = function (a) {
        this.q4(this.wx, a);
    };
    Series.prototype.p8 = function (a) {
        if (this.dp != null) {
            this.dp.handleCollectionChanged(a);
        }
    };
    Series.prototype.ql = function (a, b, c) {
        this.p8(new NotifyCollectionChangedEventArgs(2, 2, c, b, a));
    };
    Series.prototype.qg = function () {
        this.p8(new NotifyCollectionChangedEventArgs(0, 4));
    };
    Series.prototype.qj = function (a, b) {
        this.p8(new NotifyCollectionChangedEventArgs(1, 0, b, a));
    };
    Series.prototype.qk = function (a, b) {
        this.p8(new NotifyCollectionChangedEventArgs(1, 1, b, a));
    };
    Series.prototype.sg = function () {
        this.ru(false);
    };
    Series.prototype.gx = function (a, b) {
        return false;
    };
    Series.prototype.get_coercionMethods = function () {
        return this._coercionMethods;
    };
    Series.prototype.set_coercionMethods = function (a) {
        this._coercionMethods = a;
    };
    Object.defineProperty(Series.prototype, "coercionMethods", {
        get: function () {
            return this.get_coercionMethods();
        },
        set: function (a) {
            this.set_coercionMethods(a);
        },
        enumerable: false,
        configurable: true
    });
    Series.prototype.get_expectFunctions = function () {
        return this.du;
    };
    Series.prototype.set_expectFunctions = function (a) {
        var b = this.du;
        this.du = a;
        if (b != this.du) {
            this.raisePropertyChanged("ExpectFunctions", b, this.du);
        }
    };
    Object.defineProperty(Series.prototype, "expectFunctions", {
        get: function () {
            return this.get_expectFunctions();
        },
        set: function (a) {
            this.set_expectFunctions(a);
        },
        enumerable: false,
        configurable: true
    });
    Series.prototype.a2 = function (a, b) {
        return null;
    };
    Object.defineProperty(Series.prototype, "b4", {
        get: function () {
            return this.b1;
        },
        set: function (a) {
            var b = this.b1;
            this.b1 = a;
            if (b != this.b1) {
                this.raisePropertyChanged("HitTestMode", enumGetBox(SeriesHitTestMode_$type, b), enumGetBox(SeriesHitTestMode_$type, this.b1));
            }
        },
        enumerable: false,
        configurable: true
    });
    Series.prototype.b3 = function () {
        return this.b4 == 0 ? 2 : this.b4;
    };
    Object.defineProperty(Series.prototype, "b2", {
        get: function () {
            return this.b0;
        },
        set: function (a) {
            var b = this.b0;
            this.b0 = a;
            if (b != this.b0) {
                this.raisePropertyChanged("ActualHitTestMode", enumGetBox(SeriesHitTestMode_$type, b), enumGetBox(SeriesHitTestMode_$type, this.b0));
            }
        },
        enumerable: false,
        configurable: true
    });
    Series.prototype.dl = function (a) {
        if (a == null) {
            return this.dp.registerColumn(null, null, false);
        }
        var b = null;
        var c = SeriesViewer.cu(a, this.coercionMethods);
        b = c.a;
        return this.dp.registerColumn(a, b, this.expectFunctions);
    };
    Series.prototype.dm = function (a) {
        if (a == null) {
            return this.dp.registerColumnInt(null, null, false);
        }
        var b = null;
        var c = SeriesViewer.cu(a, this.coercionMethods);
        b = c.a;
        return this.dp.registerColumnInt(a, b, this.expectFunctions);
    };
    Series.prototype.dn = function (a) {
        if (a == null) {
            return this.dp.registerColumnObject(null, null, false);
        }
        var b = null;
        var c = SeriesViewer.cu(a, this.coercionMethods);
        b = c.a;
        return this.dp.registerColumnObject(a, b, this.expectFunctions);
    };
    Object.defineProperty(Series.prototype, "wx", {
        get: function () {
            return this.cw != null ? this.cw.b9 : Rect.empty;
        },
        enumerable: false,
        configurable: true
    });
    Series.prototype.get_fn = function () {
        return false;
    };
    Object.defineProperty(Series.prototype, "fn", {
        get: function () {
            return this.get_fn();
        },
        enumerable: false,
        configurable: true
    });
    Series.prototype.get_fm = function () {
        return false;
    };
    Object.defineProperty(Series.prototype, "fm", {
        get: function () {
            return this.get_fm();
        },
        enumerable: false,
        configurable: true
    });
    Series.prototype.r8 = function (a) {
    };
    Series.prototype.r7 = function (a, b) {
    };
    Series.prototype.pa = function (a, b) {
        this.bc.copyVisualData(a, b);
    };
    Series.prototype.kn = function () {
        var a = this.bc.exportVisualData(this, this.wx);
        this.p1(a);
        this.cw.ax(a);
        this.bc.exportLayerVisualData(this, a);
        return a;
    };
    Series.prototype.p1 = function (a) {
    };
    Series.prototype.qe = function (a) {
        if (this.wb.x != a.x || this.wb.y != a.y) {
            this.wb = a;
            this.qt(a);
        }
    };
    Series.prototype.qt = function (a) {
    };
    Series.prototype.qf = function () {
    };
    Series.prototype.qm = function () {
    };
    Series.prototype.aw = function (a) {
        return null;
    };
    Series.prototype.ai = function () {
        return null;
    };
    Series.prototype.iz = function () {
        return NaN;
    };
    Series.i0 = function (a, b) {
        if (a == null || a.count == 0) {
            return NaN;
        }
        if (b != null && b.i$b != null) {
            if (b.i$b.count != a.count) {
                return NaN;
            }
            for (var c = 0; c < a.count; c++) {
                if (!isNaN_(a.item(b.i$b._inner[c])) && a.item(b.i$b._inner[c]) != 0) {
                    return a.item(b.i$b._inner[c]);
                }
            }
        }
        for (var d = 0; d < a.count; d++) {
            if (!isNaN_(a.item(d)) && a.item(d) != 0) {
                return a.item(d);
            }
        }
        return NaN;
    };
    Series.i1 = function (a, b) {
        if (a == null || a.count == 0) {
            return NaN;
        }
        if (b != null && b.i$b != null) {
            if (b.i$b.count != a.count) {
                return NaN;
            }
            for (var c = 0; c < a.count; c++) {
                if (!isNaN_(a.item(b.i$b._inner[c])) && a.item(b.i$b._inner[c]) != 0) {
                    return a.item(b.i$b._inner[c]);
                }
            }
        }
        for (var d = 0; d < a.count; d++) {
            if (!isNaN_(a.item(d)) && a.item(d) != 0) {
                return a.item(d);
            }
        }
        return NaN;
    };
    Series.prototype.qr = function () {
    };
    Object.defineProperty(Series.prototype, "io", {
        get: function () {
            return this.h8;
        },
        set: function (a) {
            var b = this.io;
            if (a != b) {
                this.h8 = a;
                this.raisePropertyChanged("FinalValue", b, this.io);
            }
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(Series.prototype, "jj", {
        get: function () {
            return this.h9;
        },
        set: function (a) {
            var b = this.jj;
            if (a != b) {
                this.h9 = a;
                this.raisePropertyChanged("PercentChange", b, this.jj);
            }
        },
        enumerable: false,
        configurable: true
    });
    Series.prototype.sr = function () {
        var a = this.iz();
        this.jj = (this.io - a) / a * 100;
    };
    Series.prototype.kq = function (a) {
        return null;
    };
    Object.defineProperty(Series.prototype, "ll", {
        get: function () {
            return !stringIsNullOrWhiteSpace(this.ds.bz) ? this.ds.bz : "Open";
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(Series.prototype, "k7", {
        get: function () {
            return !stringIsNullOrWhiteSpace(this.ds.bw) ? this.ds.bw : "Close";
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(Series.prototype, "la", {
        get: function () {
            return !stringIsNullOrWhiteSpace(this.ds.bx) ? this.ds.bx : "High";
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(Series.prototype, "lj", {
        get: function () {
            return !stringIsNullOrWhiteSpace(this.ds.by) ? this.ds.by : "Low";
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(Series.prototype, "lt", {
        get: function () {
            return !stringIsNullOrWhiteSpace(this.ds.b0) ? this.ds.b0 : "Volume";
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(Series.prototype, "ls", {
        get: function () {
            return !stringIsNullOrWhiteSpace(this.ds.b9) ? this.ds.b9 : "Value";
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(Series.prototype, "ln", {
        get: function () {
            return !stringIsNullOrWhiteSpace(this.ds.m) ? this.ds.m : "Radius";
        },
        enumerable: false,
        configurable: true
    });
    Series.prototype.sm = function () {
        this.s0 = this.s2();
        this.cw.bx();
    };
    Series.prototype.av = function () {
        var a = this.legendItemBadgeShape;
        if (a == 0) {
            a = this.bg();
        }
        var b = 0;
        if (a == 3) {
            if (this.fb || this.f7) {
                b = 6;
            }
            else if (this.e9) {
                b = 7;
            }
            else {
                b = 5;
            }
        }
        else if (a == 4) {
            if (this.hasMarkers && !this.fa) {
                b = 8;
            }
            else {
                b = 0;
            }
        }
        else if (a == 2) {
            if (this.hasMarkers && !this.eu) {
                b = 1;
            }
            else {
                b = 2;
            }
        }
        else if (a == 1) {
            b = 0;
        }
        else if (a == 5) {
            b = 3;
        }
        else if (a == 6) {
            b = 4;
        }
        else if (a == 7) {
            b = 9;
        }
        return b;
    };
    Series.prototype.bf = function (a) {
        return a;
    };
    Series.prototype.bg = function () {
        if (this.ew || this.ez || this.e1 || this.fr || this.fz || this.fb || this.e9 || this.fa || this.f4 || this.f7) {
            return this.bf(3);
        }
        else if (this.fl || this.f1 || this.fs || this.fk || this.isValueOverlay) {
            return this.bf(2);
        }
        else if (this.eu || this.fp || this.fo) {
            return this.bf(1);
        }
        else if (this.ek) {
            return this.bf(4);
        }
        return this.bf(1);
    };
    Series.prototype.bk = function () {
        return null;
    };
    Series.prototype.bm = function () {
        return this.bk();
    };
    Object.defineProperty(Series.prototype, "cc", {
        get: function () {
            return this.b9;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(Series.prototype, "cb", {
        get: function () {
            return this.b8;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(Series.prototype, "actualLayers", {
        get: function () {
            return this.b7;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(Series.prototype, "ee", {
        get: function () {
            return this.hs.count > 0;
        },
        enumerable: false,
        configurable: true
    });
    Series.prototype.r5 = function (a, b) {
        if (b != null) {
            a.legendItemVisibility = 1;
        }
        else {
            a.legendItemVisibility = 0;
        }
        a.bl = b;
    };
    Series.prototype.sd = function (a) {
        if (!this.hn.containsKey(a)) {
            this.hn.addItem(a, 0);
        }
        this.hn.item(a, this.hn.item(a) + 1);
    };
    Series.prototype.sf = function (a) {
        if (this.hn.containsKey(a)) {
            this.hn.item(a, this.hn.item(a) - 1);
            if (this.hn.item(a) == 0) {
                this.hn.removeItem(a);
            }
        }
    };
    Series.prototype.f5 = function (a) {
        if (this.hn.containsKey(a) && this.hn.item(a) > 0) {
            return true;
        }
        return false;
    };
    Series.prototype.sc = function (a) {
        if (!this.hj.containsKey(a)) {
            this.hj.addItem(a, new Stack$1(Boolean_$type));
        }
        this.hj.item(a).h(true);
    };
    Series.prototype.se = function (a, b) {
        if (this.hj.containsKey(a)) {
            this.hj.item(a).e();
            if (this.hj.item(a).f == 0) {
                this.hj.removeItem(a);
                var c = this.tr(a);
                if (b && this.ei && !this.f5(a) && !this.f5("Actual" + a)) {
                    {
                        if (c != null) {
                            this.sd(a);
                            this.k4(a, this.c(c), this.c(c));
                            this.sf(a);
                        }
                    }
                }
            }
        }
    };
    Series.prototype.gn = function (a) {
        if (this.hj.containsKey(a) && this.hj.item(a).d()) {
            return true;
        }
        return false;
    };
    Series.prototype.f3 = function () {
        return this.hj.count > 0;
    };
    Series.prototype.kw = function () {
        return null;
    };
    Series.prototype.bn = function (a, b) {
        if (this.hm.containsKey(b)) {
            return this.hm.item(b);
        }
        var c = this.bm();
        if (c == null) {
            return null;
        }
        c.bo = this;
        c.b6 = b;
        this.qc(c);
        this.ry(c);
        b.am(this, c);
        this.o2(a, c);
        this.hm.item(b, c);
        this.hs.insert(a, c);
        return c;
    };
    Series.prototype.qc = function (a) {
        if (this.k3 != null) {
            a.k3 = this.k3;
        }
        if (this.gq) {
            a.gq = true;
        }
    };
    Series.prototype.o2 = function (a, b) {
        this.cw.ap(a, b);
    };
    Series.prototype.pf = function (a) {
        this.cw.au(a);
    };
    Series.prototype.ry = function (a) {
        var e_123, _a;
        try {
            for (var _b = __values(fromEnum(this.hp)), _c = _b.next(); !_c.done; _c = _b.next()) {
                var b = _c.value;
                var c = this.tr(b);
                if (c == null) {
                    continue;
                }
                this.o9(a, c);
            }
        }
        catch (e_123_1) {
            e_123 = { error: e_123_1 };
        }
        finally {
            try {
                if (_c && !_c.done && (_a = _b.return))
                    _a.call(_b);
            }
            finally {
                if (e_123)
                    throw e_123.error;
            }
        }
    };
    Series.prototype.ga = function (a) {
        if (a.name == "ToolTip") {
            return true;
        }
        return false;
    };
    Series.prototype.gr = function (a) {
        if (a.name == "ToolTip" && this.gq) {
            return true;
        }
        return false;
    };
    Series.prototype.o9 = function (a, b) {
        var c = a.b6;
        if (c != null) {
            var d = this.c(b);
            if (this.gr(b)) {
                return;
            }
            if (this.ga(b)) {
                d = this.kk(b, d);
            }
            c.ai(this, a, b, d);
        }
    };
    Series.prototype.kk = function (a, b) {
        if (a.name == "ToolTip") {
            return null;
        }
        return b;
    };
    Series.prototype.pj = function (a) {
        if (this.hm.containsKey(a)) {
            var b = this.hm.item(a);
            this.hm.removeItem(a);
            a.ap(b);
            this.pf(b);
            this.hs.remove(b);
        }
    };
    Series.prototype.getDataLegendBadge = function () {
        var a = this.s2();
        if (a == null) {
            a = LegendTemplates.af(this);
        }
        return a;
    };
    Series.prototype.getDataLegendBadgeContext = function () {
        var _this = this;
        if (this.a8 == null) {
            this.a8 = ((function () {
                var $ret = new DataContext();
                $ret.series = _this;
                $ret.item = null;
                return $ret;
            })());
        }
        return this.a8;
    };
    Series.prototype.getDataLegendBadgeContextAtPosition = function (a, b) {
        var c = this.getDataLegendBadgeContext();
        var d = this.getDataLegendResolvedWorldPositionX(a);
        var e = this.getDataLegendResolvedWorldPositionY(b);
        var f = this.j4({ $type: Point_$type, x: d, y: e });
        if (this.dp == null || f < 0 || f > (this.dp.count - 1)) {
            return null;
        }
        if (this.d3) {
            c.itemBrush = this.vs(f);
            c.outline = this.vv(f);
        }
        return c;
    };
    Series.prototype.getDataLegendBadgeShapeAndMarker = function () {
        var a = this.av();
        if (a == 8) {
            return this.mc();
        }
        else if (a == 1) {
            if (this.be == 0) {
                return "Line";
            }
            return "LineWith" + this.mc();
        }
        else if (a == 3) {
            return "Bar";
        }
        else if (a == 4) {
            return "Column";
        }
        else if (a == 9) {
            return "None";
        }
        else if (a == 0) {
            return "Circle";
        }
        else if (a == 2) {
            return "Line";
        }
        else if (a == 5) {
            return "Square";
        }
        else if (a == 6) {
            if (this.be == 0) {
                return "Square";
            }
            else {
                return "TwoColumns";
            }
        }
        else if (a == 7) {
            if (this.be == 0) {
                return "Square";
            }
            else {
                return "TwoBars";
            }
        }
        return EnumUtil.getName(ActualLegendItemBadgeShape_$type, a);
    };
    Series.prototype.mc = function () {
        return null;
    };
    Series.prototype.md = function (a, b) {
        if (b == a.dc.sa) {
            return "Circle";
        }
        else if (b == a.dc.sb) {
            return "Diamond";
        }
        else if (b == a.dc.sc) {
            return "Hexagon";
        }
        else if (b == a.dc.sd) {
            return "Hexagram";
        }
        else if (b == a.dc.se) {
            return "Pentagon";
        }
        else if (b == a.dc.sf) {
            return "Pentagram";
        }
        else if (b == a.dc.sg) {
            return "Pyramid";
        }
        else if (b == a.dc.sh) {
            return "Square";
        }
        else if (b == a.dc.si) {
            return "Tetragram";
        }
        else if (b == a.dc.sj) {
            return "Triangle";
        }
        else if (b != null) {
            return "Custom";
        }
        else {
            return "None";
        }
    };
    Series.prototype.getDataLegendSeriesTitle = function () {
        return this.title == null ? null : this.title.toString();
    };
    Series.prototype.iy = function (a, b) {
        return FastItemColumn.i(this.kr(a, b));
    };
    Series.prototype.getDataLegendResolvedWorldPositionX = function (a) {
        if (isNaN_(a) || a < 0) {
            if (this.isVertical) {
                a = 1;
            }
            else {
                var b = this.a0();
                if (b != null) {
                    if (b.ch) {
                        a = 0;
                    }
                    else {
                        a = 1;
                    }
                }
                else {
                    a = 1;
                }
            }
        }
        return a;
    };
    Series.prototype.getDataLegendResolvedWorldPositionY = function (a) {
        if (isNaN_(a) || a < 0) {
            if (this.isVertical) {
                var b = this.a0();
                if (b != null) {
                    if (b.ch) {
                        a = 1;
                    }
                    else {
                        a = 0;
                    }
                }
                else {
                    a = 0;
                }
            }
            else {
                a = 0;
            }
        }
        return a;
    };
    Series.prototype.getDataLegendSeriesContextAt = function (a, b) {
        var c = new DataLegendSeriesValueInfo();
        c.l = this.i6({ $type: Point_$type, x: a, y: b }, false, false);
        c.a = 0;
        c.q = "Value";
        c.r = "Value";
        c.s = "";
        var d = new DataLegendSeriesContext();
        d.e = ((function () {
            var $ret = new List$1(DataLegendSeriesValueInfo.$, 0);
            $ret.add(c);
            return $ret;
        })());
        d.h = this.me();
        return d;
    };
    Series.prototype.me = function () {
        var a = "Category";
        if (this.fd) {
            a = "Geographic";
        }
        if (this.fv) {
            a = "Range";
        }
        if (this.fy) {
            a = "Shape";
        }
        if (this.fx) {
            a = "Scatter";
        }
        if (this.fq) {
            a = "Polar";
        }
        if (this.fu) {
            a = "Radial";
        }
        if (this.isStacked || this.isFragment) {
            a = "Stacked";
        }
        if (this.fc) {
            a = "Category";
        }
        if (this.e8) {
            if (this.fb) {
                a = "Financial";
            }
            else {
                a = getInstanceType(this).typeName.toString();
            }
        }
        if (this.fg) {
            a += " Highlight";
        }
        else if (this.isValueOverlay) {
            a += " Overlay";
        }
        else {
            a += " Series";
        }
        return a;
    };
    Series.prototype.getDataLegendAxisLabelFromCursorPosition = function (a, b) {
        if (this.e0 || this.e8 || this.fu) {
            var c = this.a0();
            if (c != null) {
                if (!c.co()) {
                    return null;
                }
                var d = this.getDataLegendResolvedWorldPositionX(a);
                var e = this.getDataLegendResolvedWorldPositionY(b);
                var f = { $type: Point_$type, x: d, y: e };
                if (c.cn) {
                    var g = this.j6(f);
                    if (g < 0) {
                        return null;
                    }
                    var h = c;
                    var i = h.i$d(g);
                    var j = this.h0(i);
                    return j;
                }
                else {
                    if (c.ck) {
                        var k = this.is(f);
                        if (k < 0) {
                            k = 0;
                        }
                        var l = c;
                        var m = l.getDateTime(k);
                        return m;
                    }
                    else {
                        var n = this.j4(f);
                        if (n < 0) {
                            return null;
                        }
                        var o = c.kv;
                        if (o == null || o.count == 0) {
                            return null;
                        }
                        var p = false;
                        if (c.b9 && c.cl) {
                            p = true;
                        }
                        if (!p) {
                            if (n >= o.count) {
                                n = o.count - 1;
                            }
                        }
                        var q = c.gf(n);
                        return q;
                    }
                }
            }
        }
        return null;
    };
    Series.prototype.h0 = function (ticks_) {
        var a = (new Date(ticks_));
        return a;
    };
    Series.prototype.v5 = function (a) {
        if (a == null) {
            return null;
        }
        if (this.b5 == null) {
            return a;
        }
        a = BrushUtil.s(a, this.ib);
        return a;
    };
    Series.prototype.cg = function () {
        var _this = this;
        var a = this.mg();
        if (a != null) {
            var b_1 = this.mf(a);
            if (b_1 != null) {
                var c = ((function () {
                    var $ret = new SeriesMatcher();
                    $ret.d = a;
                    $ret.c = b_1;
                    return $ret;
                })());
                if (this.f8(c)) {
                    return c;
                }
            }
        }
        if (this.name != null) {
            var d = ((function () {
                var $ret = new SeriesMatcher();
                $ret.e = _this.name;
                return $ret;
            })());
            if (this.f8(d)) {
                return d;
            }
        }
        var e = "Series Title";
        if (this.title != null && typeof this.title === 'string' && !Base.equalsStatic(this.title, e)) {
            var f = ((function () {
                var $ret = new SeriesMatcher();
                $ret.f = _this.title;
                return $ret;
            })());
            if (this.f8(f)) {
                return f;
            }
        }
        if (this.index != -1) {
            var g = ((function () {
                var $ret = new SeriesMatcher();
                $ret.b = _this.index;
                return $ret;
            })());
            return g;
        }
        return null;
    };
    Series.prototype.f8 = function (a) {
        if (this.dc != null) {
            var b = SeriesMatcherHelper.a(this.dc, a);
            if (b != null && b.length == 1) {
                return true;
            }
        }
        return false;
    };
    Series.$t = markType(Series, 'Series', Control.$, [INotifyPropertyChanged_$type, IProvidesViewport_$type, ILegendSeries_$type, ILegendSeriesInternal_$type, ILegendOwner_$type, ILegendTemplateProvider_$type, IDataLegendSeries_$type]);
    Series.j1 = 0;
    Series.u8 = DependencyProperty.i("VisibilityProxy", Visibility_$type, Series.$, new PropertyMetadata(2, enumGetBox(Visibility_$type, 0), function (a, b) { return a.raisePropertyChanged("VisibilityProxy", b.oldValue, b.newValue); }));
    Series.hg = new Dictionary$2(String_$type, Dictionary$2.$.specialize(Type.$, DependencyProperty.$), 0);
    Series.hk = null;
    Series.hl = null;
    Series.t4 = DependencyProperty.i("ItemsSource", IEnumerable_$type, Series.$, new PropertyMetadata(2, null, function (a, b) {
        var c = typeCast(Series.$, a);
        if (c.c4 != null) {
            c.c4.releaseFastItemsSource(b.oldValue);
        }
        a.raisePropertyChanged("ItemsSource", b.oldValue, b.newValue);
    }));
    Series.ua = DependencyProperty.i("Legend", IChartLegend_$type, Series.$, new PropertyMetadata(2, null, function (a, b) {
        var c = typeCast(Series.$, a);
        c.raisePropertyChanged("Legend", b.oldValue, b.newValue);
    }));
    Series.t7 = DependencyProperty.i("LegendItemBadgeTemplate", DataTemplate.$, Series.$, new PropertyMetadata(2, null, function (a, b) {
        var c = typeCast(Series.$, a);
        c.raisePropertyChanged("LegendItemBadgeTemplate", b.oldValue, b.newValue);
        if (c.sy != null) {
            c.sy = c.sx();
        }
    }));
    Series.t8 = DependencyProperty.i("LegendItemTemplate", DataTemplate.$, Series.$, new PropertyMetadata(2, null, function (a, b) {
        var c = typeCast(Series.$, a);
        c.raisePropertyChanged("LegendItemTemplate", b.oldValue, b.newValue);
        if (c.sy != null) {
            c.sy = c.sx();
        }
    }));
    Series.to = DependencyProperty.i("DiscreteLegendItemTemplate", DataTemplate.$, Series.$, new PropertyMetadata(2, null, function (a, b) {
        var c = typeCast(Series.$, a);
        c.raisePropertyChanged("DiscreteLegendItemTemplate", b.oldValue, b.newValue);
    }));
    Series.tz = DependencyProperty.i("Index", Number_$type, Series.$, new PropertyMetadata(2, -1, function (a, b) {
        var c = typeCast(Series.$, a);
        c.raisePropertyChanged("Index", b.oldValue, b.newValue);
        if (c.sy != null) {
            c.sy = c.sx();
        }
    }));
    Series.$$p = markDep(DependencyProperty, PropertyMetadata, Series, 'raisePropertyChanged', ['ActualAreaFillOpacity:ia:s4', [1, 1], 'ActualBrush:ve:s5', [Brush.$], 'ActualFocusBrush:vf:s6', [Brush.$], 'ActualLegendItemBadgeBrush:vg:s7', [Brush.$], 'ActualLegendItemBadgeOutline:vh:s8', [Brush.$], 'ActualLegendItemBadgeTemplate:s0:s9', [DataTemplate.$], 'ActualMarkerFillOpacity:id:ta', [1, 1], 'ActualOutline:vi:tb', [Brush.$], 'ActualSelectionBrush:vj:tc', [Brush.$], 'ActualThickness:ig:td', [1, DeviceUtils.g(2)], 'AreaFillOpacity:il:te', [1, NaN], 'AttachTooltipToRoot:d5:tf', [0, true], 'AutoCalloutLabelFormat:lw:tg', [2, null], 'AutoCalloutLabelFormatSpecifiers:ag:th', [Array_$type, null], 'AutoCalloutValueLabelFormat:lz:ti', [2, null], 'AutoCalloutValueLabelFormatSpecifiers:ah:tj', [Array_$type, null], 'Brush:vk:tk', [Brush.$, null], 'DashArray:v7:tl', [DoubleCollection.$], 'DashCap:v8:tm', [PenLineCap_$type, enumGetBox(PenLineCap_$type, 0)], 'DataLegendGroup:l5:tn', [2, null], 'FastItemsSource:dp:tp', [IFastItemsSource_$type], 'FocusBrush:vp:tq', [Brush.$, null], 'HighlightedItemsSource::ts', [IEnumerable_$type, null], 'HighlightedLegendItemVisibility:w2:tt', [Visibility_$type, enumGetBox(Visibility_$type, 0)], 'HighlightedTitleSuffix:mj:tu', [2, " - Highlighted"], 'HighlightedValuesDataLegendGroup:ml:tv', [2, null], 'HighlightedValuesDisplayMode:bw:tw', [SeriesHighlightedValuesDisplayMode_$type, enumGetBox(SeriesHighlightedValuesDisplayMode_$type, 0)], 'HighlightedValuesFadeOpacity:jf:tx', [1, NaN], 'HighlightingFadeOpacity:jg:ty', [1, NaN], 'IsActualLegendFinancial:ep:t0', [0, false], 'IsComponentHighlightingModeIgnored:e2:t1', [0, false], 'IsDropShadowEnabled:e6:t2', [0, false], 'IsHighlightingEnabled:fe:t3', [0, false], 'LegendItemBadgeMode:be:t5', [LegendItemBadgeMode_$type, enumGetBox(LegendItemBadgeMode_$type, 0)], 'LegendItemBadgeShape::t6', [LegendItemBadgeShape_$type, enumGetBox(LegendItemBadgeShape_$type, 0)], 'LegendItemVisibility::t9', [Visibility_$type, enumGetBox(Visibility_$type, 0)], 'LineCap:v9:ub', [PenLineCap_$type, enumGetBox(PenLineCap_$type, 0)], 'LineJoin:wa:uc', [PenLineJoin_$type, enumGetBox(PenLineJoin_$type, 0)], 'MarkerFillOpacity:jh:ud', [1, NaN], 'MiterLimit:ji:ue', [1, 10], 'MouseOverEnabled:f9:uf', [0, true], 'OutlineMode:cj:ug', [SeriesOutlineMode_$type, enumGetBox(SeriesOutlineMode_$type, 0)], 'Outline:v0:uh', [Brush.$, null], 'Resolution:jk:ui', [1, NaN], 'SafeActualBrush::uj', [Brush.$], 'SelectionBrush:v4:uk', [Brush.$, null], 'ShadowBlur:jn:ul', [1, NaN], 'ShadowColor:v6:um', [Color.$], 'ShadowOffsetX:jo:un', [1, NaN], 'ShadowOffsetY:jp:uo', [1, NaN], 'ShouldAnimateOnDataSourceSwap:gh:up', [0, false], 'ShouldHideAutoCallouts:gj:uq', [0, false], 'ShouldRemoveHighlightedDataOnLayerHidden:gk:ur', [0, false], 'ShouldShiftOpacityForSafeActualBrush:gm:us', [0, true], 'ShowDefaultTooltip:gq:ut', [0, false], 'Thickness:jq:uu', [1, DeviceUtils.g(2)], 'Title::uv', [4, "Series Title"], 'ToolTip::uw', [4, null], 'TransitionDuration:ke:ux', [1, 0], 'TransitionEasingFunction:de:uy', [Delegate_$type, null], 'TransitionInDuration:kf:uz', [1, 1000], 'TransitionInEasingFunction:df:u0', [Delegate_$type, null], 'TransitionInSpeedType:c6:u1', [TransitionInSpeedType_$type, enumGetBox(TransitionInSpeedType_$type, 0)], 'TransitionOutDuration:kg:u2', [1, 1000], 'TransitionOutEasingFunction:dg:u3', [Delegate_$type, null], 'TransitionOutSpeedType:c9:u4', [TransitionOutSpeedType_$type, enumGetBox(TransitionOutSpeedType_$type, 0)], 'TransitionProgress:jr:u5', [1, 0], 'UseItemWiseColors:ha:u6', [0, false], 'UseSingleShadow:hd:u7', [0, true], 'VisibleRangeMarginBottom:js:u9', [1, NaN], 'VisibleRangeMarginLeft:jt:va', [1, NaN], 'VisibleRangeMarginRight:ju:vb', [1, NaN], 'VisibleRangeMarginTop:jv:vc', [1, NaN], 'VisibleRangeMode:c0:vd', [SeriesVisibleRangeMode_$type, enumGetBox(SeriesVisibleRangeMode_$type, 0)]]);
    return Series;
}(Control));
export { Series };
/**
 * @hidden
 */
var MarkerSeries = /** @class */ /*@__PURE__*/ (function (_super) {
    __extends(MarkerSeries, _super);
    function MarkerSeries() {
        var _this = _super.call(this) || this;
        _this.xc = 1;
        _this.w7 = 1;
        _this.w3 = 1;
        _this.x6 = null;
        _this.xd = _this.xe();
        return _this;
    }
    MarkerSeries.prototype.hu = function () {
        var a = _super.prototype.hu.call(this);
        {
            var b = ((function () {
                var $ret = new SeriesLayerPropertyOverlay();
                $ret.r = true;
                $ret.ad = "MarkerBrush";
                $ret.p = true;
                $ret.y = "ActualMarkerBrush";
                $ret.q = true;
                return $ret;
            })());
            b.valueResolving = delegateCombine(b.valueResolving, runOn(this, this.r4));
            a.add(b);
        }
        {
            var c = ((function () {
                var $ret = new SeriesLayerPropertyOverlay();
                $ret.r = true;
                $ret.ad = "MarkerOutline";
                $ret.p = true;
                $ret.y = "ActualMarkerOutline";
                $ret.q = true;
                return $ret;
            })());
            c.valueResolving = delegateCombine(c.valueResolving, runOn(this, this.r4));
            a.add(c);
        }
        return a;
    };
    MarkerSeries.prototype.w0 = function (a, b) {
        if (this.fu || this.fq) {
            return new Thickness(1, 0, 0, 0, 0);
        }
        if (this.xd != 1 && this.xd != 13) {
            var c = this.xb.c8();
            var d = (c.width / 2) + (this.xo / 2);
            var e = (c.height / 2) + (this.xo / 2);
            var f = e;
            var g = e;
            var h = d;
            var i = d;
            if (a == 2 || a == 4) {
                h = 0;
            }
            if (a == 2 || a == 3) {
                i = 0;
            }
            if (b == 2 || b == 3) {
                f = 0;
            }
            if (b == 2 || b == 4) {
                g = 0;
            }
            return new Thickness(1, h, f, i, g);
        }
        return new Thickness(1, 0, 0, 0, 0);
    };
    MarkerSeries.prototype.q3 = function (a) {
        _super.prototype.q3.call(this, a);
        this.xb = a;
    };
    MarkerSeries.prototype.get_hasMarkers = function () {
        return true;
    };
    MarkerSeries.prototype.get_en = function () {
        return this.xd != 13 && this.xd != 1;
    };
    MarkerSeries.prototype.vq = function () {
        return this.ym;
    };
    MarkerSeries.prototype.vr = function () {
        return this.yn;
    };
    MarkerSeries.prototype.s3 = function () {
        return this.x6;
    };
    MarkerSeries.prototype.mc = function () {
        return this.md(this, this.x6);
    };
    Object.defineProperty(MarkerSeries.prototype, "xd", {
        get: function () {
            return this.xc;
        },
        set: function (a) {
            var b = this.xc;
            this.xc = a;
            if (b != a) {
                this.raisePropertyChanged("ActualMarkerType", enumGetBox(MarkerType_$type, b), enumGetBox(MarkerType_$type, this.xc));
            }
        },
        enumerable: false,
        configurable: true
    });
    MarkerSeries.prototype.xe = function () {
        if (this.xf == 1 || this.xf == 0) {
            if (this.fj && this.ba.a$d) {
                return 2;
            }
            if (this.xk()) {
                return 13;
            }
        }
        return this.xf;
    };
    MarkerSeries.prototype.xk = function () {
        return (this.ha && typeCast(IChartItemLegend_$type, this.legend) !== null) || this.xj();
    };
    MarkerSeries.prototype.xj = function () {
        var e_124, _a;
        if (this.dc == null) {
            return false;
        }
        if (this.dc.ew) {
            try {
                for (var _b = __values(fromEnum(this.dc.series)), _c = _b.next(); !_c.done; _c = _b.next()) {
                    var a = _c.value;
                    if (a.eq) {
                        if (a.gv(this)) {
                            return true;
                        }
                    }
                }
            }
            catch (e_124_1) {
                e_124 = { error: e_124_1 };
            }
            finally {
                try {
                    if (_c && !_c.done && (_a = _b.return))
                        _a.call(_b);
                }
                finally {
                    if (e_124)
                        throw e_124.error;
                }
            }
        }
        return false;
    };
    MarkerSeries.prototype.pw = function () {
        _super.prototype.pw.call(this);
        this.xd = this.xe();
    };
    Object.defineProperty(MarkerSeries.prototype, "xh", {
        get: function () {
            return this.xi || this.x5 == this.dc.sa;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(MarkerSeries.prototype, "w8", {
        get: function () {
            return this.w7;
        },
        set: function (a) {
            this.w7 = a;
        },
        enumerable: false,
        configurable: true
    });
    MarkerSeries.prototype.xa = function () {
        if (this.w9 == 0) {
            return 1;
        }
        return this.w9;
    };
    MarkerSeries.prototype.sp = function (a) {
        _super.prototype.sp.call(this, a);
        this.w9 = a;
    };
    Object.defineProperty(MarkerSeries.prototype, "w4", {
        get: function () {
            return this.w3;
        },
        set: function (a) {
            this.w3 = a;
        },
        enumerable: false,
        configurable: true
    });
    MarkerSeries.prototype.w6 = function () {
        if (this.w5 == 0) {
            return 1;
        }
        return this.w5;
    };
    MarkerSeries.prototype.so = function (a) {
        _super.prototype.so.call(this, a);
        this.w5 = a;
    };
    MarkerSeries.prototype.sq = function (a) {
        _super.prototype.sq.call(this, a);
        this.xo = a;
    };
    MarkerSeries.prototype.ip = function () {
        return this.xo;
    };
    Object.defineProperty(MarkerSeries, "x8", {
        get: function () {
            if (MarkerSeries.x4 == null) {
                MarkerSeries.x4 = new DataTemplate();
            }
            return MarkerSeries.x4;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(MarkerSeries.prototype, "yo", {
        get: function () {
            return this.c(MarkerSeries.yd);
        },
        set: function (a) {
            this.h(MarkerSeries.yd, a);
        },
        enumerable: false,
        configurable: true
    });
    MarkerSeries.prototype.xl = function () {
        return this.x6 != null && ((this.xd != 1 && this.xd != 0) || this.x7 != null);
    };
    MarkerSeries.prototype.qu = function () {
        _super.prototype.qu.call(this);
        this.w8 = this.xa();
        this.w4 = this.w6();
    };
    MarkerSeries.prototype.rc = function (a, b, c, d) {
        _super.prototype.rc.call(this, a, b, c, d);
        switch (b) {
            case MarkerSeries.$$p[10]:
                this.xd = this.xe();
                break;
            case "MarkerBrush":
            case MarkerSeries.$$p[6]:
            case MarkerSeries.$$p[8]:
            case MarkerSeries.$$p[9]:
                this.ri(b);
                this.q5();
                break;
            case "ActualMarkerType":
                this.ri(b);
                this.q5();
                if (this.xk()) {
                    var e = EnumUtil.getEnumValue(MarkerType_$type, c) == 13 && this.xd != 1 && this.xd != 13;
                    var f = this.xd == 13 && EnumUtil.getEnumValue(MarkerType_$type, c) != 1 && EnumUtil.getEnumValue(MarkerType_$type, c) != 13;
                    if (e || f) {
                        if (this.dc != null) {
                            this.dc.ob();
                        }
                        this.qn();
                    }
                }
                break;
            case MarkerSeries.$$p[5]:
                this.w8 = this.xa();
                this.ri(null);
                this.q5();
                break;
            case MarkerSeries.$$p[4]:
                this.w4 = this.w6();
                this.ri(null);
                this.q5();
                break;
            case MarkerSeries.$$p[2]:
                this.x6 = d;
                if (c == MarkerSeries.x8 || d == MarkerSeries.x8 || (c == null || d != null)) {
                    this.xb.cy();
                    var g = typeCast(MarkerSeriesView.$, this.cv);
                    if (g != null) {
                        g.cy();
                    }
                    this.ru(false);
                }
                if (this.ek) {
                    this.vg = this.vq();
                    this.vh = this.vr();
                }
                if (this.dc != null) {
                    this.dc.ob();
                }
                this.cw.bx();
                if (this.toolTip != null && this.fj) {
                    this.ba.a$as(this, this.toolTip);
                }
                this.qn();
                break;
            case MarkerSeries.$$p[11]:
                this.xb.c5(this.xn);
                this.ru(false);
                break;
            case MarkerSeries.$$p[0]:
            case MarkerSeries.$$p[1]:
                if (this.ek) {
                    this.vg = this.vq();
                    this.vh = this.vr();
                }
                break;
        }
    };
    MarkerSeries.xt = function (a) {
        switch (a) {
            case 3:
            case 13: return SeriesViewer.$$p[2];
            case 4: return SeriesViewer.$$p[48];
            case 5: return SeriesViewer.$$p[33];
            case 6: return SeriesViewer.$$p[42];
            case 7: return SeriesViewer.$$p[5];
            case 8: return SeriesViewer.$$p[25];
            case 9: return SeriesViewer.$$p[10];
            case 10: return SeriesViewer.$$p[45];
            case 11: return SeriesViewer.$$p[26];
            case 12: return SeriesViewer.$$p[11];
            case 0:
            case 1:
            default: return null;
        }
    };
    MarkerSeries.xg = function (a, b) {
        var c = 1;
        var d = 0;
        if (a != null && a.dc != null) {
            d = a.dc.bg;
        }
        if (a == null || a.dc == null) {
            c = 1;
            return c;
        }
        if (b != 2 && b != 0) {
            c = b;
        }
        else {
            if (d == 4) {
                c = 3;
            }
            else if (d == 5) {
                c = 4;
            }
            else if (d == 9) {
                c = 8;
            }
            else if (d == 11) {
                c = 10;
            }
            else if (d == 8) {
                c = 7;
            }
            else if (d == 7) {
                c = 6;
            }
            else if (d == 10) {
                c = 9;
            }
            else if (d == 12) {
                c = 11;
            }
            else if (d == 6) {
                c = 5;
            }
            else if (d == 13) {
                c = 12;
            }
            else if (d == 1) {
                c = 1;
            }
            else if (d == 0) {
                if (a.fm) {
                    c = 1;
                }
                else {
                    c = 3;
                }
            }
            else if (d == 3 || d == 2) {
                if (d == 2) {
                    if (a.fm) {
                        c = 1;
                        return c;
                    }
                }
                if (a.index < 0) {
                    c = 1;
                }
                else {
                    var e = [3, 4, 8, 10, 7, 6, 9, 11, 5, 12];
                    c = e[a.index % e.length];
                }
            }
        }
        return c;
    };
    MarkerSeries.prototype.vt = function (a) {
        if (this.dc == null) {
            return this.ve;
        }
        var b = this.dc.vr(this.index + a);
        if (this.xf == 13) {
            b = this.cw.b5();
        }
        else {
            if (this.w4 != 2) {
                if (this.dc != null) {
                    var c = b;
                    if (!isNaN_(this.id) && this.id != 1) {
                        c = BrushUtil.s(c, this.id);
                    }
                    b = c;
                }
            }
            else {
                return this.vu(a);
            }
        }
        b = this.vy(b);
        return b;
    };
    MarkerSeries.prototype.vu = function (a) {
        if (this.dc == null) {
            return this.ve;
        }
        var b = this.dc.vs(this.index + a);
        if (this.xf == 13) {
            b = this.cw.b5();
        }
        else {
            if (this.w8 == 2) {
                return this.vt(a);
            }
        }
        b = this.vy(b);
        return b;
    };
    MarkerSeries.prototype.sl = function () {
        _super.prototype.sl.call(this);
        if (this.index < 0) {
            return;
        }
        if (this.xb.ci()) {
            this.xb.cv();
            this.xb.cp();
        }
        else {
            var a = MarkerSeries.xg(this, this.xd);
            if (a == 1 && this.xk()) {
                a = 13;
            }
            var b = MarkerSeries.xt(a);
            if (b == null) {
                this.x5 = MarkerSeries.x8;
            }
            else {
                this.xb.cs(b);
            }
        }
        if (this.yo != null && this.xd != 13) {
            this.sc("ActualMarkerBrush");
            var c = this.ym;
            this.xb.ct();
            this.xb.cq();
            var d = this.ym;
            var e = this.fi("ActualMarkerBrush", this.hw.f > 0 ? this.hw.d() : null, c, d);
            this.se("ActualMarkerBrush", e);
        }
        else {
            if (this.xd == 13) {
                if (!BrushUtilCore.a(this.ym)) {
                    this.sc("ActualMarkerBrush");
                    var f = this.ym;
                    this.ym = this.cw.b5();
                    var g = this.ym;
                    var h = this.fi("ActualMarkerBrush", this.hw.f > 0 ? this.hw.d() : null, f, g);
                    this.se("ActualMarkerBrush", h);
                }
            }
            else {
                if (this.w4 != 2) {
                    if (this.dc != null) {
                        var i = this.dc.vr(this.index);
                        if (!isNaN_(this.id) && this.id != 1) {
                            i = BrushUtil.s(i, this.id);
                        }
                        this.ym = i;
                    }
                    else {
                        this.ym = null;
                    }
                }
            }
        }
        if (this.yp != null && this.xd != 13) {
            this.sc("ActualMarkerOutline");
            var j = this.yn;
            this.xb.cu();
            this.xb.cr();
            var k = this.yn;
            var l = this.fi("ActualMarkerOutline", this.hw.f > 0 ? this.hw.d() : null, j, k);
            this.se("ActualMarkerOutline", l);
        }
        else {
            if (this.xd == 13) {
                if (!BrushUtilCore.a(this.yn)) {
                    this.sc("ActualMarkerOutline");
                    var m = this.yn;
                    this.yn = this.cw.b5();
                    var n = this.yn;
                    var o = this.fi("ActualMarkerOutline", this.hw.f > 0 ? this.hw.d() : null, m, n);
                    this.se("ActualMarkerOutline", o);
                }
            }
            else {
                if (this.w8 == 2) {
                    this.yn = this.ym;
                }
                else {
                    this.yn = this.dc == null ? null : this.dc.vs(this.index);
                }
            }
        }
        if (this.w4 == 2 && this.yo == null && this.xd != 13) {
            if (this.yn != null) {
                var p = this.yn;
                if (!isNaN_(this.id) && this.id != 1) {
                    p = BrushUtil.s(p, this.id);
                }
                this.ym = p;
            }
            else {
                this.ym = null;
            }
        }
    };
    MarkerSeries.prototype.p1 = function (a) {
        _super.prototype.p1.call(this, a);
        this.bc.exportMarkerVisualData(this, a);
    };
    MarkerSeries.prototype.xm = function (a, b) {
        if (this.hasMarkers && this.xl()) {
            var c = this.wv(a);
            if (c.isEmpty) {
                return false;
            }
            var d = RectUtil.r(c, this.iv(b));
            if (d.containsPoint(a)) {
                return true;
            }
        }
        return false;
    };
    MarkerSeries.prototype.a2 = function (a, b) {
        var c = this.xb.ce(a);
        var d = null;
        if (c != null) {
            d = c.content;
        }
        return d;
    };
    MarkerSeries.$t = markType(MarkerSeries, 'MarkerSeries', Series.$);
    MarkerSeries.x4 = null;
    MarkerSeries.yd = DependencyProperty.i("MarkerBrush", Brush.$, MarkerSeries.$, new PropertyMetadata(1, function (a, b) {
        var c = (typeCast(MarkerSeries.$, a));
        c.raisePropertyChanged("MarkerBrush", b.oldValue, b.newValue);
    }));
    MarkerSeries.$$p = markDep(DependencyProperty, PropertyMetadata, MarkerSeries, 'raisePropertyChanged', ['ActualMarkerBrush:ym:x9', [Brush.$], 'ActualMarkerOutline:yn:ya', [Brush.$], 'ActualMarkerTemplate:x5:yb', [DataTemplate.$, null], 'IsCustomMarkerCircular:xi:yc', [0, false], 'MarkerFillMode:w5:ye', [MarkerFillMode_$type, enumGetBox(MarkerFillMode_$type, 0)], 'MarkerOutlineMode:w9:yf', [MarkerOutlineMode_$type, enumGetBox(MarkerOutlineMode_$type, 0)], 'MarkerOutline:yp:yg', [Brush.$], 'MarkerStyle:yq:yh', [Style.$], 'MarkerTemplate:x7:yi', [DataTemplate.$, null], 'MarkerThickness:xo:yj', [1, DeviceUtils.g(2)], 'MarkerType:xf:yk', [MarkerType_$type, enumGetBox(MarkerType_$type, 1)], 'UseLightweightMarkers:xn:yl', [0, false]]);
    return MarkerSeries;
}(Series));
export { MarkerSeries };
/**
 * @hidden
 */
var SyncLink = /** @class */ /*@__PURE__*/ (function (_super) {
    __extends(SyncLink, _super);
    function SyncLink() {
        var _this = _super.call(this) || this;
        _this.ak = null;
        _this.ah = new Dictionary$2(IEnumerable_$type, FastItemsSourceReference.$, 0);
        _this.av = null;
        _this.ad = null;
        _this.propertyChanged = null;
        _this.propertyUpdated = null;
        _this.propertyUpdated = delegateCombine(_this.propertyUpdated, function (a, b) { return _this.aq(a, b.propertyName, b.oldValue, b.newValue); });
        _this.ad = new ChartCollection();
        var a = _this.ad;
        a.collectionChanged = delegateCombine(a.collectionChanged, runOn(_this, _this.am));
        _this.av = new Rect(0, 0, 0, 1, 1);
        return _this;
    }
    SyncLink.prototype.aq = function (a, b, c, d) {
    };
    SyncLink.prototype.releaseFastItemsSource = function (a) {
        var _this = this;
        if (a != null) {
            var b_2 = null;
            if (((function () { var c = _this.ah.tryGetValue(a, b_2); b_2 = c.p1; return c.ret; })())) {
                --b_2.b;
                if (b_2.b == 0) {
                    this.ah.removeItem(a);
                }
            }
        }
        return null;
    };
    SyncLink.af = function (a) {
        return ((function () {
            var $ret = new FastItemsSource();
            $ret.e = a;
            return $ret;
        })());
    };
    SyncLink.prototype.getFastItemsSource = function (a) {
        var _this = this;
        if (SyncLink.aj == null) {
            SyncLink.aj = SyncLink.af;
        }
        var b = null;
        if (a != null) {
            var c_1 = null;
            if (!((function () { var d = _this.ah.tryGetValue(a, c_1); c_1 = d.p1; return d.ret; })())) {
                b = SyncLink.aj(a);
                c_1 = new FastItemsSourceReference(b);
                this.ah.addItem(a, c_1);
            }
            c_1.b++;
            b = c_1.a;
        }
        return b;
    };
    SyncLink.prototype.ag = function (a) {
        var _this = this;
        var b = null;
        if (a != null) {
            var c_2 = null;
            if (!((function () { var d = _this.ah.tryGetValue(a, c_2); c_2 = d.p1; return d.ret; })())) {
                return null;
            }
            b = c_2.a;
        }
        return b;
    };
    SyncLink.prototype.aw = function (a, b, c) {
        return this.ax(a, b, c, false);
    };
    SyncLink.prototype.ax = function (a, b, c, d) {
        if (!c.isEmpty) {
            c = new Rect(0, c.left, c.top, c.width, c.height);
            var e = a.ho;
            var f = a.hn;
            if (b == a) {
                if (!d) {
                    if (!b.fl()) {
                        c.x = b.w0.x;
                        c.width = b.w0.width;
                    }
                    if (!b.fm()) {
                        c.y = b.w0.y;
                        c.height = b.w0.height;
                    }
                }
            }
            else {
                var g = SyncManager.a(b);
                if (g == null || !g.synchronizeHorizontally) {
                    c.x = b.w0.x;
                    c.width = b.w0.width;
                }
                if (g == null || !g.synchronizeVertically) {
                    c.y = b.w0.y;
                    c.height = b.w0.height;
                }
            }
            var h = 0.5 * (c.left + c.right);
            var i = 0.5 * (c.top + c.bottom);
            var j = c.width;
            var k = c.height;
            var l = MathUtil.d(c.width, e, 1);
            var m = MathUtil.d(c.height, f, 1);
            var n = false;
            if (a.gg() && !a.wz.isEmpty) {
                var o = a.wz;
                var p = o.width / o.height;
                var q = l * o.width;
                var r = m * o.height;
                var s = q / r;
                if (s != p) {
                    if (r * p > q) {
                        q = r * p;
                        l = q / o.width;
                    }
                    else {
                        r = q / p;
                        m = r / o.height;
                    }
                }
            }
            else if (a.eu()) {
                var t = false;
                var u = false;
                if (Math.abs(l - a.wh.width) > e) {
                    t = true;
                }
                if (Math.abs(m - a.wh.height) > f) {
                    u = true;
                }
                var v = a.of(l, m, t, u);
                l = v.p0;
                m = v.p1;
                l = MathUtil.d(l, e, 1);
                m = MathUtil.d(m, f, 1);
            }
            else if (b.f8) {
                var w = 1.7976931348623157E+308;
                var x = -1.7976931348623157E+308;
                var y = 1.7976931348623157E+308;
                var z = -1.7976931348623157E+308;
                var aa = c.left;
                var ab = c.right;
                var ac = c.top;
                var ad = c.bottom;
                var ae = c.width;
                var af = c.height;
                if (b.cr == 1) {
                    if (aa < 0) {
                        aa = 0;
                        ab = aa + ae;
                    }
                    if (ab > 1) {
                        ab = 1;
                        aa = ab - ae;
                    }
                    if (ac < 0) {
                        ac = 0;
                        ad = ac + af;
                    }
                    if (ad > 1) {
                        ad = 1;
                        ac = ad - af;
                    }
                }
                var ag = new Rect(0, aa, ac, ab - aa, ad - ac);
                var ah = [w, x];
                var ai = [y, z];
                for (var aj = 0; aj < b.series.count; aj++) {
                    var ak = b.series._inner[aj];
                    if (ak.eu) {
                        continue;
                    }
                    {
                        var al = ak;
                        if (al.isVertical) {
                            if (c.height < 1) {
                                ai = this.ac(al, b, ag, ai);
                                y = ai[0];
                                z = ai[1];
                            }
                        }
                        else {
                            if (c.width < 1) {
                                ah = this.ab(al, b, ag, ah);
                                w = ah[0];
                                x = ah[1];
                            }
                        }
                    }
                }
                var am = (w == 1.7976931348623157E+308 || x == -1.7976931348623157E+308 || isNaN_(w) || isNaN_(x));
                var an = (y == 1.7976931348623157E+308 || z == -1.7976931348623157E+308 || isNaN_(y) || isNaN_(z));
                if (!am || !an) {
                    if (am) {
                        c = new Rect(0, y, c.top, z - y, c.height);
                    }
                    else if (an) {
                        c = new Rect(0, c.left, w, c.width, x - w);
                    }
                    else {
                        c = new Rect(0, y, w, z - y, x - w);
                    }
                    l = c.width;
                    m = c.height;
                    n = true;
                }
            }
            var ao = l != j;
            var ap = m != k;
            var aq = ao && !n ? h - 0.5 * l : c.left;
            var ar = ap && !n ? i - 0.5 * m : c.top;
            var as = ao && !n ? h + 0.5 * l : c.right;
            var at = ap && !n ? i + 0.5 * m : c.bottom;
            if (b.cr == 1) {
                if (aq < 0) {
                    aq = 0;
                    as = aq + l;
                }
                if (as > 1) {
                    as = 1;
                    aq = as - l;
                }
                if (ar < 0) {
                    ar = 0;
                    at = ar + m;
                }
                if (at > 1) {
                    at = 1;
                    ar = at - m;
                }
            }
            c = new Rect(0, aq, ar, as - aq, at - ar);
        }
        return c;
    };
    SyncLink.prototype.ab = function (a, b, c, d) {
        var e = a.ai();
        var f = d[0];
        var g = d[1];
        var h = null;
        for (var i = 0; i < e.length; i++) {
            if (e[i].cp) {
                h = e[i];
            }
        }
        if (h != null) {
            var j = new Rect(0, 0, 0, 1, 1);
            var k = new ScalerParams(0, j, j, h.ch, b.wr(j, b.wz, b.wl));
            k.b = a.iz();
            var l = a.az(c);
            var m = l == null || l.c == 1.7976931348623157E+308 || isNaN_(l.c);
            if (m) {
                return d;
            }
            var n = h.el(l.c, k);
            var o = h.el(l.b, k);
            if (h.ch) {
                var p = n;
                n = o;
                o = p;
            }
            g = Math.max(g, n);
            f = Math.min(f, o);
            if (a.cy == 2) {
                if (h.cj) {
                    var q = h;
                    var r = q.me;
                    r = h.d2(r, k);
                    var s = h.el(r, k);
                    g = Math.max(g, s);
                    f = Math.min(f, s);
                }
            }
        }
        d[0] = f;
        d[1] = g;
        return d;
    };
    SyncLink.prototype.ac = function (a, b, c, d) {
        var e = a.ai();
        var f = d[0];
        var g = d[1];
        var h = null;
        for (var i = 0; i < e.length; i++) {
            if (!e[i].cp) {
                h = e[i];
            }
        }
        if (h != null) {
            var j = new Rect(0, 0, 0, 1, 1);
            var k = new ScalerParams(0, j, j, h.ch, b.wr(j, b.wz, b.wl));
            k.b = a.iz();
            var l = a.az(c);
            var m = l == null || l.c == 1.7976931348623157E+308 || isNaN_(l.c);
            if (m) {
                return d;
            }
            var n = h.el(l.c, k);
            var o = h.el(l.b, k);
            if (h.ch) {
                var p = n;
                n = o;
                o = p;
            }
            g = Math.max(g, o);
            f = Math.min(f, n);
            if (a.cy == 2) {
                if (h.cj) {
                    var q = h;
                    var r = q.me;
                    r = h.d2(r, k);
                    var s = h.el(r, k);
                    g = Math.max(g, s);
                    f = Math.min(f, s);
                }
            }
        }
        d[0] = f;
        d[1] = g;
        return d;
    };
    Object.defineProperty(SyncLink.prototype, "ai", {
        get: function () {
            return this.ad;
        },
        enumerable: false,
        configurable: true
    });
    SyncLink.prototype.al = function (a) {
        this.ad.add(a);
    };
    SyncLink.prototype.as = function (a) {
        this.ad.remove(a);
    };
    SyncLink.prototype.ao = function () {
        var e_125, _a;
        try {
            for (var _b = __values(fromEnum(this.ad)), _c = _b.next(); !_c.done; _c = _b.next()) {
                var a = _c.value;
                if (a.w0.isEmpty) {
                    a.w0 = this.aw(null, a, this.av);
                }
            }
        }
        catch (e_125_1) {
            e_125 = { error: e_125_1 };
        }
        finally {
            try {
                if (_c && !_c.done && (_a = _b.return))
                    _a.call(_b);
            }
            finally {
                if (e_125)
                    throw e_125.error;
            }
        }
    };
    SyncLink.prototype.am = function (a, b) {
        var e_126, _a;
        if (b.newItems != null) {
            try {
                for (var _b = __values(fromEn(b.newItems)), _c = _b.next(); !_c.done; _c = _b.next()) {
                    var c = _c.value;
                    if (c.w0.isEmpty) {
                        c.w0 = this.aw(null, c, this.av);
                    }
                }
            }
            catch (e_126_1) {
                e_126 = { error: e_126_1 };
            }
            finally {
                try {
                    if (_c && !_c.done && (_a = _b.return))
                        _a.call(_b);
                }
                finally {
                    if (e_126)
                        throw e_126.error;
                }
            }
        }
    };
    SyncLink.prototype.an = function (a, b) {
        var e_127, _a;
        try {
            for (var _b = __values(fromEnum(this.ai)), _c = _b.next(); !_c.done; _c = _b.next()) {
                var c = _c.value;
                if (c == a) {
                    c.v8 = { $type: Point_$type, x: b.x, y: b.y };
                }
                else {
                    var d = { $type: Point_$type, x: b.x, y: b.y };
                    var e = SyncManager.a(c);
                    if (e == null || !e.synchronizeHorizontally) {
                        d.x = NaN;
                    }
                    if (e == null || !e.synchronizeVertically) {
                        d.y = NaN;
                    }
                    c.v8 = d;
                }
            }
        }
        catch (e_127_1) {
            e_127 = { error: e_127_1 };
        }
        finally {
            try {
                if (_c && !_c.done && (_a = _b.return))
                    _a.call(_b);
            }
            finally {
                if (e_127)
                    throw e_127.error;
            }
        }
    };
    SyncLink.prototype.ap = function (a, b) {
        var e_128, _a;
        try {
            for (var _b = __values(fromEnum(this.ai)), _c = _b.next(); !_c.done; _c = _b.next()) {
                var c = _c.value;
                c.ws = this.aw(a, c, b);
            }
        }
        catch (e_128_1) {
            e_128 = { error: e_128_1 };
        }
        finally {
            try {
                if (_c && !_c.done && (_a = _b.return))
                    _a.call(_b);
            }
            finally {
                if (e_128)
                    throw e_128.error;
            }
        }
    };
    SyncLink.prototype.at = function (a, b) {
        this.au(a, b, false);
    };
    SyncLink.prototype.au = function (a, b, c) {
        var e_129, _a;
        var d = b.isEmpty || isNaN_(b.x) || isNaN_(b.y) || isNaN_(b.width) || isNaN_(b.height);
        if (!d && !a.es) {
            try {
                for (var _b = __values(fromEnum(this.ai)), _c = _b.next(); !_c.done; _c = _b.next()) {
                    var e = _c.value;
                    e.es = true;
                    e.w0 = this.ax(a, e, b, c);
                    e.es = false;
                }
            }
            catch (e_129_1) {
                e_129 = { error: e_129_1 };
            }
            finally {
                try {
                    if (_c && !_c.done && (_a = _b.return))
                        _a.call(_b);
                }
                finally {
                    if (e_129)
                        throw e_129.error;
                }
            }
        }
    };
    SyncLink.prototype.ar = function (a, b, c) {
        if (this.propertyChanged != null) {
            this.propertyChanged(this, new PropertyChangedEventArgs(a));
        }
        if (this.propertyUpdated != null) {
            this.propertyUpdated(this, new PropertyUpdatedEventArgs(a, b, c));
        }
    };
    SyncLink.$t = markType(SyncLink, 'SyncLink', FrameworkElement.$, [INotifyPropertyChanged_$type, IFastItemsSourceProvider_$type]);
    SyncLink.aj = null;
    return SyncLink;
}(FrameworkElement));
export { SyncLink };
/**
 * @hidden
 */
var SyncLinkManager = /** @class */ /*@__PURE__*/ (function (_super) {
    __extends(SyncLinkManager, _super);
    function SyncLinkManager() {
        var _this = _super.call(this) || this;
        _this.d = null;
        _this.d = new Dictionary$2(String_$type, SyncLink.$, 0);
        return _this;
    }
    SyncLinkManager.instance = function () {
        if (SyncLinkManager.b == null) {
            SyncLinkManager.b = new SyncLinkManager();
        }
        return SyncLinkManager.b;
    };
    Object.defineProperty(SyncLinkManager.prototype, "e", {
        get: function () {
            return this.d.count;
        },
        enumerable: false,
        configurable: true
    });
    SyncLinkManager.prototype.getLink = function (a) {
        var _this = this;
        var b;
        if (((function () { var c = _this.d.tryGetValue(a, b); b = c.p1; return c.ret; })())) {
            return b;
        }
        b = new SyncLink();
        b.ak = a;
        this.d.addItem(a, b);
        return b;
    };
    SyncLinkManager.prototype.releaseLink = function (a) {
        if (a.ai.count == 0 && a.ak != null && this.d.containsKey(a.ak)) {
            this.d.removeItem(a.ak);
        }
    };
    SyncLinkManager.$t = markType(SyncLinkManager, 'SyncLinkManager');
    SyncLinkManager.b = null;
    return SyncLinkManager;
}(Base));
export { SyncLinkManager };
/**
 * @hidden
 */
var SyncManager = /** @class */ /*@__PURE__*/ (function (_super) {
    __extends(SyncManager, _super);
    function SyncManager() {
        return _super !== null && _super.apply(this, arguments) || this;
    }
    SyncManager.e = function (a) {
        var b = SyncManager.a(a);
        if (b == null) {
            return;
        }
        if (!a.fg) {
            return;
        }
        if (a.syncChannel != b.syncChannel) {
            return;
        }
        SyncManager.b(a, a.syncChannel, null);
    };
    SyncManager.c = function (a) {
        var b = SyncManager.a(a);
        if (b == null) {
            return;
        }
        if (a.fg && a.syncChannel == b.syncChannel) {
            return;
        }
        var c = null;
        if (a.fg) {
            c = a.syncChannel;
        }
        SyncManager.b(a, c, b.syncChannel);
    };
    SyncManager.b = function (a, b, c) {
        if (a != null) {
            if (stringIsNullOrEmpty(c)) {
                var d = a.actualSyncLink;
                a.actualSyncLink = null;
                a.actualSyncLink = new SyncLink();
                if (d != null) {
                    SyncLinkManager.instance().releaseLink(d);
                }
                a.syncChannel = null;
            }
            else {
                if (!stringIsNullOrEmpty(b)) {
                    var e = a.actualSyncLink;
                    a.actualSyncLink = null;
                    if (e != null) {
                        SyncLinkManager.instance().releaseLink(e);
                    }
                }
                a.actualSyncLink = SyncLinkManager.instance().getLink(c);
                a.syncChannel = c;
            }
        }
    };
    SyncManager.d = function (a, b) {
        a.syncSettings = b;
    };
    SyncManager.a = function (a) {
        return a.syncSettings;
    };
    SyncManager.$t = markType(SyncManager, 'SyncManager');
    return SyncManager;
}(Base));
export { SyncManager };
/**
 * @hidden
 */
export var ITrendLineManager_$type = /*@__PURE__*/ new Type(null, 'ITrendLineManager');
/**
 * @hidden
 */
var ChartCollection = /** @class */ /*@__PURE__*/ (function (_super) {
    __extends(ChartCollection, _super);
    function ChartCollection() {
        var _this = _super.call(this, SeriesViewer.$, 0) || this;
        _this.collectionResetting = null;
        return _this;
    }
    ChartCollection.prototype.p = function () {
        if (this.collectionResetting != null) {
            this.collectionResetting(this, null);
        }
        _super.prototype.p.call(this);
    };
    ChartCollection.$t = markType(ChartCollection, 'ChartCollection', ObservableCollection$1.$.specialize(SeriesViewer.$));
    return ChartCollection;
}(ObservableCollection$1));
export { ChartCollection };
/**
 * @hidden
 */
var SeriesCollection = /** @class */ /*@__PURE__*/ (function (_super) {
    __extends(SeriesCollection, _super);
    function SeriesCollection() {
        var _this = _super.call(this, Series.$, 0) || this;
        _this.collectionResetting = null;
        return _this;
    }
    SeriesCollection.prototype.p = function () {
        if (this.collectionResetting != null) {
            this.collectionResetting(this, null);
        }
        _super.prototype.p.call(this);
    };
    SeriesCollection.$t = markType(SeriesCollection, 'SeriesCollection', ObservableCollection$1.$.specialize(Series.$));
    return SeriesCollection;
}(ObservableCollection$1));
export { SeriesCollection };
/**
 * @hidden
 */
var PlotAreaMouseEventArgs = /** @class */ /*@__PURE__*/ (function (_super) {
    __extends(PlotAreaMouseEventArgs, _super);
    function PlotAreaMouseEventArgs(a, b, c) {
        var _this = _super.call(this) || this;
        _this._chartPosition = null;
        _this._plotAreaPosition = null;
        _this._isDuringManipulation = false;
        _this._viewer = null;
        _this.viewer = a;
        _this.chartPosition = b;
        _this.plotAreaPosition = c;
        return _this;
    }
    Object.defineProperty(PlotAreaMouseEventArgs.prototype, "chartPosition", {
        get: function () {
            return this._chartPosition;
        },
        set: function (a) {
            this._chartPosition = a;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(PlotAreaMouseEventArgs.prototype, "plotAreaPosition", {
        get: function () {
            return this._plotAreaPosition;
        },
        set: function (a) {
            this._plotAreaPosition = a;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(PlotAreaMouseEventArgs.prototype, "isDuringManipulation", {
        get: function () {
            return this._isDuringManipulation;
        },
        set: function (a) {
            this._isDuringManipulation = a;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(PlotAreaMouseEventArgs.prototype, "viewer", {
        get: function () {
            return this._viewer;
        },
        set: function (a) {
            this._viewer = a;
        },
        enumerable: false,
        configurable: true
    });
    PlotAreaMouseEventArgs.$t = markType(PlotAreaMouseEventArgs, 'PlotAreaMouseEventArgs', EventArgs.$);
    return PlotAreaMouseEventArgs;
}(EventArgs));
export { PlotAreaMouseEventArgs };
/**
 * @hidden
 */
var PlotAreaMouseButtonEventArgs = /** @class */ /*@__PURE__*/ (function (_super) {
    __extends(PlotAreaMouseButtonEventArgs, _super);
    function PlotAreaMouseButtonEventArgs(a, b, c) {
        var _this = _super.call(this) || this;
        _this._chartPosition = null;
        _this._plotAreaPosition = null;
        _this._manipulationOccurred = false;
        _this._viewer = null;
        _this.viewer = a;
        _this.chartPosition = b;
        _this.plotAreaPosition = c;
        return _this;
    }
    Object.defineProperty(PlotAreaMouseButtonEventArgs.prototype, "chartPosition", {
        get: function () {
            return this._chartPosition;
        },
        set: function (a) {
            this._chartPosition = a;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(PlotAreaMouseButtonEventArgs.prototype, "plotAreaPosition", {
        get: function () {
            return this._plotAreaPosition;
        },
        set: function (a) {
            this._plotAreaPosition = a;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(PlotAreaMouseButtonEventArgs.prototype, "manipulationOccurred", {
        get: function () {
            return this._manipulationOccurred;
        },
        set: function (a) {
            this._manipulationOccurred = a;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(PlotAreaMouseButtonEventArgs.prototype, "viewer", {
        get: function () {
            return this._viewer;
        },
        set: function (a) {
            this._viewer = a;
        },
        enumerable: false,
        configurable: true
    });
    PlotAreaMouseButtonEventArgs.$t = markType(PlotAreaMouseButtonEventArgs, 'PlotAreaMouseButtonEventArgs', EventArgs.$);
    return PlotAreaMouseButtonEventArgs;
}(EventArgs));
export { PlotAreaMouseButtonEventArgs };
/**
 * @hidden
 */
var ChartCursorEventArgs = /** @class */ /*@__PURE__*/ (function (_super) {
    __extends(ChartCursorEventArgs, _super);
    function ChartCursorEventArgs(a, b, c) {
        var _this = _super.call(this) || this;
        _this._item = null;
        _this._series = null;
        _this._seriesViewer = null;
        _this.seriesViewer = a;
        _this.series = b;
        _this.item = c;
        return _this;
    }
    ChartCursorEventArgs.prototype.toString = function () {
        return this.seriesViewer.name + ", " + this.series.name + ", " + (this.item != null ? this.item.toString() : "");
    };
    Object.defineProperty(ChartCursorEventArgs.prototype, "item", {
        get: function () {
            return this._item;
        },
        set: function (a) {
            this._item = a;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(ChartCursorEventArgs.prototype, "series", {
        get: function () {
            return this._series;
        },
        set: function (a) {
            this._series = a;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(ChartCursorEventArgs.prototype, "seriesViewer", {
        get: function () {
            return this._seriesViewer;
        },
        set: function (a) {
            this._seriesViewer = a;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(ChartCursorEventArgs.prototype, "chart", {
        get: function () {
            return typeCast(XamDataChart.$, this.seriesViewer);
        },
        enumerable: false,
        configurable: true
    });
    ChartCursorEventArgs.$t = markType(ChartCursorEventArgs, 'ChartCursorEventArgs', EventArgs.$);
    return ChartCursorEventArgs;
}(EventArgs));
export { ChartCursorEventArgs };
/**
 * @hidden
 */
var SeriesViewerSelectedSeriesItemsChangedEventArgs = /** @class */ /*@__PURE__*/ (function (_super) {
    __extends(SeriesViewerSelectedSeriesItemsChangedEventArgs, _super);
    function SeriesViewerSelectedSeriesItemsChangedEventArgs(a, b, c) {
        var _this = _super.call(this) || this;
        _this._oldItems = null;
        _this._newItems = null;
        _this._currentItems = null;
        _this.oldItems = a;
        _this.newItems = b;
        _this.currentItems = c;
        return _this;
    }
    Object.defineProperty(SeriesViewerSelectedSeriesItemsChangedEventArgs.prototype, "oldItems", {
        get: function () {
            return this._oldItems;
        },
        set: function (a) {
            this._oldItems = a;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(SeriesViewerSelectedSeriesItemsChangedEventArgs.prototype, "newItems", {
        get: function () {
            return this._newItems;
        },
        set: function (a) {
            this._newItems = a;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(SeriesViewerSelectedSeriesItemsChangedEventArgs.prototype, "currentItems", {
        get: function () {
            return this._currentItems;
        },
        set: function (a) {
            this._currentItems = a;
        },
        enumerable: false,
        configurable: true
    });
    SeriesViewerSelectedSeriesItemsChangedEventArgs.$t = markType(SeriesViewerSelectedSeriesItemsChangedEventArgs, 'SeriesViewerSelectedSeriesItemsChangedEventArgs', EventArgs.$);
    return SeriesViewerSelectedSeriesItemsChangedEventArgs;
}(EventArgs));
export { SeriesViewerSelectedSeriesItemsChangedEventArgs };
/**
 * @hidden
 */
var DataChartMouseButtonEventArgs = /** @class */ /*@__PURE__*/ (function (_super) {
    __extends(DataChartMouseButtonEventArgs, _super);
    function DataChartMouseButtonEventArgs(a, b, c, d, e) {
        var _this = _super.call(this) || this;
        _this.j = { $type: Point_$type, x: NaN, y: NaN };
        _this.i = null;
        _this.d = false;
        _this._item = null;
        _this._series = null;
        _this._plotAreaPosition = null;
        _this._chart = null;
        _this.chart = a;
        _this.series = b;
        _this.item = c;
        _this.i = d;
        _this.plotAreaPosition = e;
        return _this;
    }
    DataChartMouseButtonEventArgs.prototype.toString = function () {
        return this.chart.name + ", " + this.series.name + ", " + (this.item != null ? this.item.toString() : "") + ", " + this.getPosition(null).toString();
    };
    Object.defineProperty(DataChartMouseButtonEventArgs.prototype, "handled", {
        get: function () {
            return this.i.handled;
        },
        set: function (a) {
            this.i.handled = a;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(DataChartMouseButtonEventArgs.prototype, "cancelSelection", {
        get: function () {
            return this.d;
        },
        set: function (a) {
            this.d = a;
        },
        enumerable: false,
        configurable: true
    });
    DataChartMouseButtonEventArgs.prototype.getPosition = function (a) {
        return this.i.getPosition(a);
    };
    Object.defineProperty(DataChartMouseButtonEventArgs.prototype, "originalSource", {
        get: function () {
            return this.i.originalSource;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(DataChartMouseButtonEventArgs.prototype, "item", {
        get: function () {
            return this._item;
        },
        set: function (a) {
            this._item = a;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(DataChartMouseButtonEventArgs.prototype, "series", {
        get: function () {
            return this._series;
        },
        set: function (a) {
            this._series = a;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(DataChartMouseButtonEventArgs.prototype, "plotAreaPosition", {
        get: function () {
            return this._plotAreaPosition;
        },
        set: function (a) {
            this._plotAreaPosition = a;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(DataChartMouseButtonEventArgs.prototype, "chartPosition", {
        get: function () {
            if (isNaN_(this.j.x) && isNaN_(this.j.y)) {
                this.j.x = this.plotAreaPosition.x - this.chart.wz.left;
                this.j.y = this.plotAreaPosition.y - this.chart.wz.top;
            }
            return this.j;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(DataChartMouseButtonEventArgs.prototype, "chart", {
        get: function () {
            return this._chart;
        },
        set: function (a) {
            this._chart = a;
        },
        enumerable: false,
        configurable: true
    });
    DataChartMouseButtonEventArgs.$t = markType(DataChartMouseButtonEventArgs, 'DataChartMouseButtonEventArgs', EventArgs.$);
    return DataChartMouseButtonEventArgs;
}(EventArgs));
export { DataChartMouseButtonEventArgs };
/**
 * @hidden
 */
var ChartMouseEventArgs = /** @class */ /*@__PURE__*/ (function (_super) {
    __extends(ChartMouseEventArgs, _super);
    function ChartMouseEventArgs(a, b, c, d, e) {
        var _this = _super.call(this) || this;
        _this.f = null;
        _this._item = null;
        _this._series = null;
        _this._plotAreaPosition = null;
        _this.g = { $type: Point_$type, x: NaN, y: NaN };
        _this._chart = null;
        _this.chart = a;
        _this.series = b;
        _this.item = c;
        _this.f = d;
        _this.plotAreaPosition = e;
        return _this;
    }
    ChartMouseEventArgs.prototype.toString = function () {
        return this.chart.name + ", " + this.series.name + ", " + (this.item != null ? this.item.toString() : "") + ", " + this.getPosition(null).toString();
    };
    ChartMouseEventArgs.prototype.getPosition = function (a) {
        return this.f.getPosition(a);
    };
    Object.defineProperty(ChartMouseEventArgs.prototype, "originalSource", {
        get: function () {
            return this.f.originalSource;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(ChartMouseEventArgs.prototype, "item", {
        get: function () {
            return this._item;
        },
        set: function (a) {
            this._item = a;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(ChartMouseEventArgs.prototype, "series", {
        get: function () {
            return this._series;
        },
        set: function (a) {
            this._series = a;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(ChartMouseEventArgs.prototype, "plotAreaPosition", {
        get: function () {
            return this._plotAreaPosition;
        },
        set: function (a) {
            this._plotAreaPosition = a;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(ChartMouseEventArgs.prototype, "chartPosition", {
        get: function () {
            if (isNaN_(this.g.x) && isNaN_(this.g.y)) {
                this.g.x = this.plotAreaPosition.x - this.chart.wz.left;
                this.g.y = this.plotAreaPosition.y - this.chart.wz.top;
            }
            return this.g;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(ChartMouseEventArgs.prototype, "chart", {
        get: function () {
            return this._chart;
        },
        set: function (a) {
            this._chart = a;
        },
        enumerable: false,
        configurable: true
    });
    ChartMouseEventArgs.$t = markType(ChartMouseEventArgs, 'ChartMouseEventArgs', EventArgs.$);
    return ChartMouseEventArgs;
}(EventArgs));
export { ChartMouseEventArgs };
/**
 * @hidden
 */
var AxisComponentsForView = /** @class */ /*@__PURE__*/ (function (_super) {
    __extends(AxisComponentsForView, _super);
    function AxisComponentsForView() {
        var _this = _super !== null && _super.apply(this, arguments) || this;
        _this.a = null;
        return _this;
    }
    AxisComponentsForView.$t = markType(AxisComponentsForView, 'AxisComponentsForView');
    return AxisComponentsForView;
}(Base));
export { AxisComponentsForView };
/**
 * @hidden
 */
var AxisLabelPanelBaseView = /** @class */ /*@__PURE__*/ (function (_super) {
    __extends(AxisLabelPanelBaseView, _super);
    function AxisLabelPanelBaseView(a) {
        var _this = _super.call(this) || this;
        _this.a = null;
        _this.aw = null;
        _this.e = null;
        _this.av = Rect.empty;
        _this.c = null;
        _this.h = 0;
        _this.i = NaN;
        _this.a = a;
        return _this;
    }
    AxisLabelPanelBaseView.prototype.aa = function (a, b, c, d, e, f) {
        var g = typeCast(FrameworkElement.$, a);
        if (g != null) {
            g._visibility = 0;
            if (b.width == 0 && b.height == 0) {
                g._visibility = 1;
            }
            var h = b.height - (d + f);
            var i = b.width - (c + e);
            g.n = b.left + c;
            g.o = b.top + d;
            if (i < 0) {
                i = 0;
            }
            if (h < 0) {
                h = 0;
            }
            g.l = h;
            g.m = i;
            if (g.j != null) {
                var j = g.j;
                var k = j.j._inner[0];
                k.k = k.k + g.n;
                k.l = k.l + g.o;
            }
        }
    };
    AxisLabelPanelBaseView.prototype.z = function (a, b, c, d, e, f, g, h) {
        var i = Math.max(e, Math.max(f, Math.max(g, h)));
        var j = new Thickness(0, i);
        if (this.a.av) {
            j = new Thickness(0, Math.sqrt((i * i) / 2));
        }
        var k = c.d;
        if (isNaN_(k.left) || isNaN_(k.top) || isNaN_(k.right) || isNaN_(k.bottom)) {
            k = j;
        }
        if (k.left > j.left || k.top > j.top || k.right > j.right || k.bottom > j.bottom) {
            k = j;
        }
        var l = new Rect(0, d.left - k.left, d.top - k.top, d.width + k.left + k.right, d.height + k.top + k.bottom);
        var m = a.j;
        a.j = null;
        this.aa(a, l, e, f, g, h);
        a.j = m;
        a.width = a.m;
        a.height = a.l;
    };
    AxisLabelPanelBaseView.prototype.ae = function (a) {
        var b = a;
        b.j = null;
    };
    AxisLabelPanelBaseView.prototype.ah = function (a) {
    };
    AxisLabelPanelBaseView.prototype.ai = function (a, b) {
    };
    AxisLabelPanelBaseView.prototype.aj = function (a, b) {
        var c = typeCast(FrameworkElement.$, a);
        var d = 0;
        var e = 0;
        var f = new TransformGroup();
        var g = ((function () {
            var $ret = new RotateTransform();
            $ret.j = b;
            $ret.k = d;
            $ret.l = e;
            return $ret;
        })());
        f.j.add(g);
        c.j = f;
    };
    AxisLabelPanelBaseView.prototype.ar = function (a, b, c, d, e, f, g, h, i) {
        var j = Math.max(e, Math.max(f, Math.max(g, h)));
        var k = new Thickness(0, j);
        if (this.a.av) {
            k = new Thickness(0, Math.sqrt((j * j) / 2));
        }
        var l = c.d;
        if (isNaN_(l.left) || isNaN_(l.top) || isNaN_(l.right) || isNaN_(l.bottom)) {
            l = k;
        }
        if (l.left > k.left || l.top > k.top || l.right > k.right || l.bottom > k.bottom) {
            l = k;
        }
        var m = b.j;
        var n = new TransformGroup();
        var o = a.n + l.left;
        var p = a.o + l.top;
        n.j.add(m);
        a.j = n;
    };
    AxisLabelPanelBaseView.prototype.ad = function (a) {
        a.j = null;
    };
    AxisLabelPanelBaseView.prototype.x = function (a, b, c, d) {
        var e = a.al.length;
        var f = a.al;
        var g = a.al;
        while ((this.m(a) + c + d) > b && e > 0) {
            e--;
            f = f.substr(0, e) + "\u2026";
            a.al = f;
        }
        a.al = g;
        return f;
    };
    AxisLabelPanelBaseView.prototype.af = function () {
        var e_130, _a;
        if (this.e == null) {
            return;
        }
        var a = this.g();
        try {
            for (var _b = __values(fromEnum(a)), _c = _b.next(); !_c.done; _c = _b.next()) {
                var b = _c.value;
                var c = typeCast(FrameworkElement.$, b);
                if (c != null) {
                    this.a.cg(c);
                }
                this.a.b7(b);
            }
        }
        catch (e_130_1) {
            e_130 = { error: e_130_1 };
        }
        finally {
            try {
                if (_c && !_c.done && (_a = _b.return))
                    _a.call(_b);
            }
            finally {
                if (e_130)
                    throw e_130.error;
            }
        }
    };
    AxisLabelPanelBaseView.prototype.g = function () {
        var a = this.a.a1();
        var b = this.a.a0();
        if (!this.a.ad.c7) {
            return a;
        }
        else {
            return b;
        }
    };
    AxisLabelPanelBaseView.prototype.l = function (a) {
        if (this.a.ad != null && this.a.ad.bz) {
            return this.ax(a).height;
        }
        else {
            return this.h;
        }
    };
    AxisLabelPanelBaseView.prototype.n = function (a) {
        return this.l(a) + this.r() + this.o();
    };
    AxisLabelPanelBaseView.prototype.an = function () {
        this.aw = ((function () {
            var $ret = new Path();
            $ret.an = new GeometryGroup();
            $ret.ab = false;
            return $ret;
        })());
    };
    AxisLabelPanelBaseView.prototype.m = function (a) {
        if (this.a.ad != null && this.a.ad.bz) {
            return this.ax(a).width;
        }
        else {
            var b = a;
            if (b != null && b.al != null) {
                return this.e.f(b);
            }
            return 0;
        }
    };
    AxisLabelPanelBaseView.prototype.w = function (a) {
        var b = a;
        if (b != null && b.al != null) {
            return this.m(a) + this.p() + this.q();
        }
        return 0;
    };
    AxisLabelPanelBaseView.prototype.ax = function (a) {
        var b = a;
        if (b != null && b.al != null) {
            b.ag = true;
            var c = this.e.ah(b, this.h, true);
            return new Size(1, c.c, c.b);
        }
        return new Size(1, 0, 0);
    };
    AxisLabelPanelBaseView.prototype.ac = function () {
        this.a.bh = this.a.ad.er();
    };
    AxisLabelPanelBaseView.prototype.ak = function () {
        this.ag();
        this.a.c8(new Size(1, Number.POSITIVE_INFINITY, Number.POSITIVE_INFINITY));
    };
    AxisLabelPanelBaseView.prototype.f = function () {
        return this.e;
    };
    AxisLabelPanelBaseView.prototype.al = function (a) {
        this.e = a;
    };
    AxisLabelPanelBaseView.prototype.y = function () {
        if (this.a.c1.isEmpty) {
            return;
        }
        var a = this.a.bd;
        this.a.c6(new Size(1, this.a.c1.width, this.a.c1.height));
        if (this.a.bd != a) {
            this.a.ad.bg.oc();
            this.am();
        }
    };
    AxisLabelPanelBaseView.prototype.am = function () {
    };
    AxisLabelPanelBaseView.prototype.ap = function (a) {
        this.e.x(a);
    };
    AxisLabelPanelBaseView.prototype.ao = function () {
        var e_131, _a, e_132, _b;
        if (this.e == null) {
            return;
        }
        if (this.e.d) {
            if (this.a.ad.bi != null && this.a.ad.bi.hk != 1) {
                this.e.aa();
                this.e.ab(this.a.ad.bi.hk, this.a.ad.bi.hk);
            }
            this.ag();
            this.av = this.a.c1;
            var a = this.a.ad.bg.getFontBrush();
            if (this.a.ag != null && this.a.ag.textColor != null) {
                a = this.a.ag.textColor;
            }
            if (this.a.j != null) {
                this.e.aa();
                this.e.k(this.a.j);
            }
            var b = false;
            try {
                for (var _c = __values(fromEnum(this.g())), _d = _c.next(); !_d.done; _d = _c.next()) {
                    var c = _d.value;
                    var d = typeCast(TextBlock.$, c);
                    if (d != null) {
                        if (d.s != 0) {
                            b = true;
                            continue;
                        }
                        d.ao = a;
                        if (d.j != null) {
                            this.e.aa();
                            this.e.k(d.j);
                        }
                        this.ap(d);
                        if (d.j != null) {
                            this.e.z();
                        }
                    }
                }
            }
            catch (e_131_1) {
                e_131 = { error: e_131_1 };
            }
            finally {
                try {
                    if (_d && !_d.done && (_a = _c.return))
                        _a.call(_c);
                }
                finally {
                    if (e_131)
                        throw e_131.error;
                }
            }
            if (b) {
                try {
                    for (var _e = __values(fromEnum(this.a.ab)), _f = _e.next(); !_f.done; _f = _e.next()) {
                        var e = _f.value;
                        var f = typeCast(Rectangle.$, e);
                        if (f != null) {
                            if (f.s == 0) {
                                continue;
                            }
                            if (f.j != null) {
                                this.e.aa();
                                this.e.k(f.j);
                            }
                            this.e.w(f);
                            if (f.j != null) {
                                this.e.z();
                            }
                        }
                        var g = typeCast(TextBlock.$, e);
                        if (g != null) {
                            if (g.s == 0) {
                                continue;
                            }
                            if (g.j != null) {
                                this.e.aa();
                                this.e.k(g.j);
                            }
                            if (g.ao == null) {
                                g.ao = a;
                            }
                            this.e.x(g);
                            if (g.j != null) {
                                this.e.z();
                            }
                        }
                    }
                }
                catch (e_132_1) {
                    e_132 = { error: e_132_1 };
                }
                finally {
                    try {
                        if (_f && !_f.done && (_b = _e.return))
                            _b.call(_e);
                    }
                    finally {
                        if (e_132)
                            throw e_132.error;
                    }
                }
            }
            if (this.a.j != null) {
                this.e.z();
            }
            this.aq();
            a = this.at();
            this.e.ad(this.d());
            var h = this.a.ad.iv;
            if (h != null) {
                h.ao = a;
                if (h.j != null) {
                    this.e.aa();
                    this.e.k(h.j);
                }
                this.e.x(h);
                if (h.j != null) {
                    this.e.z();
                }
            }
            if (this.a.ad.bi != null && this.a.ad.bi.hk != 1) {
                this.e.z();
            }
        }
    };
    AxisLabelPanelBaseView.prototype.d = function () {
        var a = this.a.ad.bi.getFontInfo();
        if (this.a.ad.bf != null && this.a.ad.bf.textStyle != null) {
            a = this.a.ad.bf.h(this.a.ad.bi.c9.j.ae);
        }
        else {
            var b = this.a.ad.bi.de();
            if (b != null) {
                a = b;
            }
        }
        return a;
    };
    AxisLabelPanelBaseView.prototype.at = function () {
        var a = this.a.ad.bg.getFontBrush();
        if (this.a.ad.bf != null && this.a.ad.bf.textColor != null) {
            a = this.a.ad.bf.textColor;
        }
        else {
            var b = this.a.ad.bi.vo();
            if (b != null) {
                a = b;
            }
        }
        return a;
    };
    AxisLabelPanelBaseView.prototype.ag = function () {
        if (this.e == null) {
            return;
        }
        var a = this.a.ad.bi.getFontInfo();
        if (this.a.ag != null && this.a.ag.j) {
            a = this.a.ag.h(this.a.ad.bi.c9.j.ae);
        }
        if (this.c != a) {
            this.c = a;
            this.as();
        }
        this.e.ad(a);
    };
    AxisLabelPanelBaseView.prototype.as = function () {
        if (this.a.ad != null && this.a.ad.bi != null) {
            if (this.a.ag == null || this.a.ag.textStyle == null) {
                this.h = this.a.ad.bi.c9.a9;
                return;
            }
            if (this.h == 0) {
                this.h = this.a.ad.bi.c9.a9;
            }
            var a = this.h;
            var b = this.a.ad.bi.getFontInfo();
            if (this.a.ag != null && this.a.ag.textStyle != null) {
                b = this.a.ag.h(this.a.ad.bi.c9.j.ae);
            }
            var c = FontUtil.getCurrentFontHeight(this.a.ad.bi.c9.j.ae, b);
            this.h = c;
            if (a != this.h) {
                this.a.ad.bi.oc();
            }
        }
    };
    AxisLabelPanelBaseView.prototype.j = function () {
        if (this.a.ad.g8 == null) {
            return 0;
        }
        if (this.a.ad.bf != null && this.a.ad.bf.visibility == 1) {
            return 0;
        }
        if (!isNaN_(this.i)) {
            return this.i;
        }
        var a = this.d();
        if (this.a.ad.bi == null) {
            return this.h;
        }
        this.i = FontUtil.getCurrentFontHeight(this.a.ad.bi.c9.j.ae, a);
        return this.i;
    };
    AxisLabelPanelBaseView.prototype.k = function () {
        if (this.a.ad.bf != null && this.a.ad.bf.visibility == 1) {
            return 0;
        }
        if (this.e == null) {
            return 0;
        }
        var a = this.a.ad.iv;
        if (a != null && a.al != null) {
            this.e.ad(this.d());
            var b = this.e.f(a);
            this.ag();
            return b;
        }
        return 0;
    };
    AxisLabelPanelBaseView.prototype.aq = function () {
        if (this.a.ab.count == 0) {
            return;
        }
        if (this.a.ad.j3 == null) {
            this.aw._stroke = this.a.ad.bg.vl();
        }
        else {
            this.aw._stroke = this.a.ad.j3;
        }
        this.aw.ad = this.a.ad.fk;
        this.e.t(this.aw);
    };
    AxisLabelPanelBaseView.prototype.ab = function (a) {
    };
    AxisLabelPanelBaseView.prototype.ay = function () {
        return this.a.ad.bi.w2();
    };
    AxisLabelPanelBaseView.prototype.v = function () {
        if (this.a.ad.bf != null && !isNaN_(this.a.ad.bf.topMargin)) {
            return Math.max(0, this.a.ad.bf.topMargin);
        }
        else {
            return this.ay().top;
        }
    };
    AxisLabelPanelBaseView.prototype.s = function () {
        if (this.a.ad.bf != null && !isNaN_(this.a.ad.bf.bottomMargin)) {
            return Math.max(0, this.a.ad.bf.bottomMargin);
        }
        else {
            return this.ay().bottom;
        }
    };
    AxisLabelPanelBaseView.prototype.t = function () {
        if (this.a.ad.bf != null && !isNaN_(this.a.ad.bf.leftMargin)) {
            return Math.max(0, this.a.ad.bf.leftMargin);
        }
        else {
            return this.ay().left;
        }
    };
    AxisLabelPanelBaseView.prototype.u = function () {
        if (this.a.ad.bf != null && !isNaN_(this.a.ad.bf.rightMargin)) {
            return Math.max(0, this.a.ad.bf.rightMargin);
        }
        else {
            return this.ay().right;
        }
    };
    AxisLabelPanelBaseView.prototype.au = function () {
        return this.aw.an.d;
    };
    AxisLabelPanelBaseView.prototype.b = function () {
        var _this = this;
        var a = ((function () {
            var $ret = new PathRenderingInfo();
            $ret.e = _this.a.ad.j3;
            $ret.c = _this.a.ad.fk;
            return $ret;
        })());
        if (this.a.ad != null && typeCast(XamDataChart.$, this.a.ad.bg) !== null) {
            var b = this.a.ad.bg;
            if (b.xr && b.c0 != 2 && b.c0 != 1) {
                a.a = true;
            }
        }
        return a;
    };
    AxisLabelPanelBaseView.prototype.r = function () {
        if (this.a.ag == null) {
            return 0;
        }
        return Math.max(0, this.a.ag.topMargin);
    };
    AxisLabelPanelBaseView.prototype.p = function () {
        if (this.a.ag == null) {
            return 0;
        }
        return Math.max(0, this.a.ag.leftMargin);
    };
    AxisLabelPanelBaseView.prototype.q = function () {
        if (this.a.ag == null) {
            return 0;
        }
        return Math.max(0, this.a.ag.rightMargin);
    };
    AxisLabelPanelBaseView.prototype.o = function () {
        if (this.a.ag == null) {
            return 0;
        }
        return Math.max(0, this.a.ag.bottomMargin);
    };
    AxisLabelPanelBaseView.$t = markType(AxisLabelPanelBaseView, 'AxisLabelPanelBaseView');
    return AxisLabelPanelBaseView;
}(Base));
export { AxisLabelPanelBaseView };
/**
 * @hidden
 */
var AxisView = /** @class */ /*@__PURE__*/ (function (_super) {
    __extends(AxisView, _super);
    function AxisView(a) {
        var _this = _super.call(this) || this;
        _this.a = null;
        _this.bd = null;
        _this.be = null;
        _this.bg = null;
        _this.bf = null;
        _this.b = new AxisComponentsFromView();
        _this.h = null;
        _this.k = null;
        _this.j = null;
        _this._isDirty = false;
        _this.bh = null;
        _this.bb = Rect.empty;
        _this.a = a;
        _this.bh = new Rectangle();
        return _this;
    }
    AxisView.prototype.al = function () {
        this.bd = ((function () {
            var $ret = new Path();
            $ret.an = new GeometryGroup();
            return $ret;
        })());
        this.bg = ((function () {
            var $ret = new Path();
            $ret.an = new GeometryGroup();
            $ret.ab = false;
            $ret.stroke = null;
            return $ret;
        })());
        this.be = ((function () {
            var $ret = new Path();
            $ret.an = new GeometryGroup();
            $ret.ab = false;
            return $ret;
        })());
        this.bf = ((function () {
            var $ret = new Path();
            $ret.an = new GeometryGroup();
            $ret.ab = false;
            return $ret;
        })());
        this.a.j3 = AxisDefaults.axis_TickBrush;
        this.a.fj = AxisDefaults.axis_TickLength;
        this.a.fk = AxisDefaults.axis_TickStroke;
        this.a.et = AxisDefaults.axis_MajorStroke;
        this.a.ew = AxisDefaults.axis_MinorStroke;
        this.a.fi = AxisDefaults.axis_LineStroke;
    };
    AxisView.prototype.an = function (a) {
    };
    AxisView.prototype.a3 = function () {
        var a = new TextBlock();
        return a;
    };
    AxisView.prototype.aw = function (a) {
        a._visibility = 0;
        a.s = 0;
        if (a.x == null) {
            this.a.aw.ab.add(a);
        }
    };
    AxisView.prototype.ay = function (a) {
        a._visibility = 1;
    };
    AxisView.prototype.ax = function (a) {
        if (this.a.aw.ab.contains(a)) {
            this.a.aw.ab.remove(a);
        }
    };
    AxisView.prototype.bi = function () {
        var a = new Rectangle();
        return a;
    };
    AxisView.prototype.t = function (a) {
        if (a.x == null) {
            this.d.ab.add(a);
        }
        a._visibility = 0;
    };
    AxisView.prototype.v = function (a) {
        a._visibility = 1;
    };
    AxisView.prototype.u = function (a) {
        if (this.a.aw.ab.contains(a)) {
            this.a.aw.ab.remove(a);
        }
    };
    AxisView.prototype.ao = function () {
    };
    AxisView.prototype.p = function () {
        return true;
    };
    Object.defineProperty(AxisView.prototype, "index", {
        get: function () {
            if (this.a.bi != null && this.a.bi.fd) {
                return this.a.bi.series.count + 1;
            }
            var a = typeCast(XamDataChart.$, this.a.bg);
            var b = 0;
            if (a == null) {
                return 0;
            }
            if (a != null && a.xb == 1) {
                var c = 0;
                for (var d = 0; d < this.a.bi.series.count; d++) {
                    if (this.a.bi.series._inner[d].isStacked) {
                        c += this.a.bi.series._inner[d].kd();
                    }
                    else {
                        c++;
                    }
                }
                b = c;
            }
            return b + a.axes.indexOf(this.a);
        },
        enumerable: false,
        configurable: true
    });
    AxisView.prototype.ai = function () {
        this.d.cf();
        this.d.b3();
    };
    AxisView.prototype.ag = function () {
        this.d.ca();
    };
    AxisView.prototype.ac = function () {
        if (this.d != null) {
            this.d.ab.clear();
        }
        this.ae(this.bd.an.d);
        this.ae(this.bg.an.d);
        this.ae(this.be.an.d);
        this.ae(this.bf.an.d);
        this.aj();
    };
    AxisView.prototype.a1 = function (a) {
        this.bd._visibility = a;
        this.be._visibility = a;
        this.bg._visibility = a;
        this.bf._visibility = a;
    };
    AxisView.prototype.at = function () {
    };
    AxisView.prototype.ab = function (a) {
        this.a.cq = true;
        if (this.a.bi != null) {
            this.a.bi.oc();
        }
        this.a.ia();
    };
    AxisView.prototype.c = function () {
        this.b.a = this.bd;
        this.b.b = this.be;
        this.b.c = this.bf;
        this.b.d = this.bg;
        return this.b;
    };
    AxisView.prototype.ae = function (a) {
        if (a != null) {
            a.clear();
        }
    };
    AxisView.prototype.a4 = function () {
        return this.bd.an.d;
    };
    AxisView.prototype.e = function () {
        var _this = this;
        var a = ((function () {
            var $ret = new PathRenderingInfo();
            $ret.e = _this.a.j2;
            $ret.c = _this.a.fi;
            $ret.f = _this.a.j6;
            return $ret;
        })());
        if (typeCast(XamDataChart.$, this.a.bg) !== null) {
            var b = this.a.bg;
            if (b.xr && b.c0 != 2 && b.c0 != 1) {
                a.a = true;
            }
        }
        return a;
    };
    AxisView.prototype.a7 = function () {
        return this.bg.an.d;
    };
    AxisView.prototype.a5 = function () {
        return this.be.an.d;
    };
    AxisView.prototype.f = function () {
        var _this = this;
        var a = ((function () {
            var $ret = new PathRenderingInfo();
            $ret.e = _this.a.jz;
            $ret.c = _this.a.et;
            $ret.f = _this.a.j4;
            return $ret;
        })());
        if (typeCast(XamDataChart.$, this.a.bg) !== null) {
            var b = this.a.bg;
            if (b.xr && b.c0 != 2 && b.c0 != 1) {
                a.a = true;
            }
        }
        return a;
    };
    AxisView.prototype.a6 = function () {
        return this.bf.an.d;
    };
    AxisView.prototype.g = function () {
        var _this = this;
        var a = ((function () {
            var $ret = new PathRenderingInfo();
            $ret.e = _this.a.j0;
            $ret.c = _this.a.ew;
            $ret.f = _this.a.j5;
            return $ret;
        })());
        if (typeCast(XamDataChart.$, this.a.bg) !== null) {
            var b = this.a.bg;
            if (b.xr && b.c0 != 2 && b.c0 != 1) {
                a.a = true;
            }
        }
        return a;
    };
    Object.defineProperty(AxisView.prototype, "d", {
        get: function () {
            return this.a.aq().a;
        },
        enumerable: false,
        configurable: true
    });
    AxisView.prototype.az = function (a, b, c) {
        this.d.ad = a;
        this.d.c5 = b;
        this.d.c4 = c;
        this.aj();
    };
    AxisView.prototype.ad = function () {
        this.d.ab.clear();
        this.aj();
    };
    AxisView.prototype.av = function (a) {
        this.d.bw = a;
        this.aj();
    };
    AxisView.prototype.a0 = function (a, b) {
        this.d.a9 = a;
        this.d.ba = b;
        this.d.ar = false;
    };
    AxisView.prototype.au = function (a) {
        this.d.bg = a;
    };
    AxisView.prototype.aa = function () {
    };
    AxisView.prototype.s = function (a) {
        return null;
    };
    AxisView.prototype.z = function () {
    };
    AxisView.prototype.aq = function () {
    };
    AxisView.prototype.l = function () {
        return true;
    };
    AxisView.prototype.o = function () {
        return false;
    };
    AxisView.prototype.m = function () {
        return false;
    };
    AxisView.prototype.r = function (dataItem_) {
        if (this.a.au != null) {
            return this.a.au(dataItem_);
        }
        if (this.a.ai != null) {
            return this.a.ai.i(dataItem_);
        }
        return null;
    };
    AxisView.prototype.q = function (dataItem_) {
        if (this.o() && this.m()) {
            return this.r(dataItem_);
        }
        else {
            if (this.a.au != null) {
                return this.a.au(dataItem_);
            }
            if (this.a.ai != null) {
                return this.a.ai.i(dataItem_);
            }
        }
        var label_ = this.a.f2;
        var a = typeof dataItem_ === 'number' && typeof label_ === 'string';
        var labelValue_ = null;
        if (this.h != null) {
            labelValue_ = this.h.getPropertyValue(dataItem_);
            if ((labelValue_ === undefined)) {
                labelValue_ = label_;
            }
        }
        else {
            labelValue_ = a ? stringFormat(label_, dataItem_) : (typeof dataItem_[label_] != 'undefined') ? dataItem_[label_] : label_;
            ;
        }
        if (this.a.expectFunctions) {
            if ((typeof (labelValue_) == 'function')) {
                labelValue_ = labelValue_();
            }
        }
        return labelValue_;
    };
    AxisView.prototype.ak = function (a, b) {
        this.j = a;
        this.k = b;
    };
    Object.defineProperty(AxisView.prototype, "isDirty", {
        get: function () {
            return this._isDirty;
        },
        set: function (a) {
            this._isDirty = a;
        },
        enumerable: false,
        configurable: true
    });
    AxisView.prototype.aj = function () {
        if (this.a.bg == null || this.j == null) {
            return;
        }
        if (!this.isDirty) {
            this.isDirty = true;
            this.a.bg.al.r(this.j, this.k);
        }
    };
    AxisView.prototype.undirty = function (a) {
        this.isDirty = false;
        this.ar(a);
    };
    AxisView.prototype.ar = function (a) {
        if (this.j == null) {
            return;
        }
        if (this.j.d) {
            if (this.a.bi != null && this.a.bi.hk != 1) {
                this.j.aa();
                this.j.ab(this.a.bi.hk, this.a.bi.hk);
            }
            var b = this.a.bg.wn();
            if (a) {
                if (!this.j.e) {
                    this.j.l(b.left, b.top, b.width, b.height);
                }
            }
            if (a) {
                if (this.a.bi.vx != null && !this.a.kh.isEmpty) {
                    this.bh.o = this.a.kh.top;
                    this.bh.n = this.a.kh.left;
                    this.bh.width = this.a.kh.width;
                    this.bh.height = this.a.kh.height;
                    this.bh._fill = this.a.bi.vx;
                    this.j.w(this.bh);
                }
            }
            this.j.aa();
            this.j.af(this.a.kh);
            this.as();
            this.j.z();
            if (this.a.bi != null && this.a.bi.hk != 1) {
                this.j.z();
            }
        }
        if (this.k.d) {
            if (this.a.bi != null && this.a.bi.hk != 1) {
                this.k.aa();
                this.k.ab(this.a.bi.hk, this.a.bi.hk);
            }
            var c = this.bb;
            var d = this.a.bg.wn();
            if (!c.isEmpty && a) {
                if (!this.k.e) {
                    this.k.l(d.left, d.top, d.width, d.height);
                }
            }
            if (this.a.bi != null && this.a.bi.hk != 1) {
                this.k.z();
            }
        }
    };
    AxisView.prototype.postRender = function () {
        this.d.ck();
    };
    AxisView.prototype.as = function () {
        if (this.j.d) {
            this.bd._stroke = this.a.jy;
            this.bg._fill = this.a.j1;
            this.bf._stroke = this.a.jx;
            this.be._stroke = this.a.jw;
            this.bf.ad = this.a.ew;
            this.be.ad = this.a.et;
            this.bd.ad = this.a.fi;
            this.bf.ai = this.a.j5;
            this.be.ai = this.a.j4;
            this.bd.ai = this.a.j6;
            this.bb = this.a.kh;
            this.j.t(this.bd);
            this.j.t(this.bg);
            this.j.t(this.be);
            this.j.t(this.bf);
        }
    };
    AxisView.prototype.ah = function () {
        this.aj();
    };
    AxisView.prototype.af = function (a) {
        if (a != null) {
            a.al.u(this);
            a.c9.cq();
        }
    };
    AxisView.prototype.y = function (a) {
        if (a != null) {
            a.al.o(this);
            this.aj();
        }
    };
    AxisView.prototype.i = function () {
        if (this.a.bi == null || this.a.bi.c9.j.ae == null) {
            return null;
        }
        return FontUtil.getFont(this.a.bi.c9.j.ae);
    };
    AxisView.prototype.n = function () {
        return this.j == null;
    };
    AxisView.prototype.ap = function () {
        if (this.a.b9 || this.a.cm) {
            return;
        }
        if (this.a.g8 == null) {
            this.a.iv = null;
            this.a.cq = true;
            this.a.ia();
            return;
        }
        if (this.a.iv == null) {
            var a = new TextBlock();
            a.al = this.a.g8;
            a.dataContext = this.a.bf;
            this.a.iv = a;
        }
        else {
            this.a.iv.al = this.a.g8;
            this.a.iv.dataContext = this.a.bf;
        }
        this.a.cq = true;
        this.a.ia();
    };
    AxisView.prototype.x = function () {
        var a;
        var b = new AxisLabelSettings();
        if (this.a.b9) {
            a = "ui-angular-axis-labels";
            b.margin = 0;
        }
        else if (this.a.cp) {
            a = "ui-vertical-axis-labels";
            b.location = 2;
            b.leftMargin = 5;
            b.rightMargin = 5;
            b.topMargin = 2;
            b.bottomMargin = 2;
        }
        else if (this.a.a2 == 3) {
            a = "ui-radial-axis-labels";
            b.location = 5;
        }
        else {
            a = "ui-horizontal-axis-labels";
            b.location = 1;
            b.leftMargin = 2;
            b.rightMargin = 2;
            b.topMargin = 5;
            b.bottomMargin = 5;
        }
        this.w(b, a);
    };
    AxisView.prototype.a2 = function () {
        if (this.a.bi == null) {
            return;
        }
        var a = this.a.bi.xk;
        var b = a.fv;
        var c = a.fu;
        if (this.a.j2 == null) {
            if (b == null) {
                this.a.j2 = a.fs;
            }
            else if (b.color.l != 0) {
                this.a.j2 = b;
            }
        }
        if (this.a.jz == null) {
            if (c == null) {
                this.a.jz = a.fs;
            }
            else if (c.color.l != 0) {
                this.a.jz = c;
            }
        }
    };
    AxisView.prototype.w = function (a, b) {
        this.a.fn.startCSSQuery();
        var c = this.a.fn.getCssDefaultPropertyValue(b, "margin-top");
        var d = this.a.fn.getCssDefaultPropertyValue(b, "margin-right");
        var e = this.a.fn.getCssDefaultPropertyValue(b, "margin-bottom");
        var f = this.a.fn.getCssDefaultPropertyValue(b, "margin-left");
        var g = this.a.fn.getCssDefaultPropertyValue(b, "text-align");
        var h = this.a.fn.getCssDefaultPropertyValue(b, "vertical-align");
        var i = this.a.fn.getCssDefaultPropertyValue(b, "color");
        var j = FontUtil.getFontForClass(this.a.fn, b);
        this.a.fn.endCSSQuery();
        if (c != null) {
            a.topMargin = parseFloat(c);
        }
        if (d != null) {
            a.rightMargin = parseFloat(d);
        }
        if (e != null) {
            a.bottomMargin = parseFloat(e);
        }
        if (f != null) {
            a.leftMargin = parseFloat(f);
        }
        if (i != null) {
            if (a.textColor == null) {
                a.textColor = new Brush();
            }
            a.textColor._fill = i;
        }
        if (j != null) {
            a.g = j;
        }
        if (g != null) {
            switch (g) {
                case "right":
                    a.horizontalAlignment = 2;
                    break;
                case "left":
                    a.horizontalAlignment = 0;
                    break;
                default:
                    a.horizontalAlignment = 1;
                    break;
            }
        }
        if (h != null) {
            switch (h) {
                case "top":
                    a.verticalAlignment = 0;
                    break;
                case "bottom":
                    a.verticalAlignment = 2;
                    break;
                default:
                    a.verticalAlignment = 1;
                    break;
            }
        }
        this.a.az = a;
    };
    AxisView.prototype.preRender = function () {
        if (this.a.bi != null) {
            this.a.bi.nv();
        }
    };
    AxisView.prototype.isValid = function () {
        return this.a != null && !this.a.kh.isEmpty;
    };
    AxisView.prototype.a8 = function (a) {
        return { $type: Point_$type, x: a.n, y: a.o };
    };
    AxisView.prototype.a9 = function () {
        return { $type: Point_$type, x: this.a.aw.c1.left, y: this.a.aw.c1.top };
    };
    AxisView.prototype.bc = function () {
        var a = this.a.aw.c1;
        return a;
    };
    AxisView.prototype.ba = function (a) {
        return { $type: Point_$type, x: a.n, y: a.o };
    };
    AxisView.prototype.bj = function (a) {
        var b = this.a.aw.af.t();
        var c = this.a.aw.af.v();
        var d = this.a.aw.af.u();
        var e = this.a.aw.af.s();
        return new Thickness(1, b, c, d, e);
    };
    AxisView.prototype.am = function () {
        if (FastReflectionHelper.needsHelper(this.a.f2)) {
            this.h = new FastReflectionHelper(true, this.a.f2);
        }
        else {
            this.h = null;
        }
    };
    AxisView.$t = markType(AxisView, 'AxisView', Base.$, [ISchedulableRender_$type]);
    return AxisView;
}(Base));
export { AxisView };
/**
 * @hidden
 */
var CategoryAxisBaseView = /** @class */ /*@__PURE__*/ (function (_super) {
    __extends(CategoryAxisBaseView, _super);
    function CategoryAxisBaseView(a) {
        var _this = _super.call(this, a) || this;
        _this.bk = null;
        _this.bk = a;
        return _this;
    }
    CategoryAxisBaseView.prototype.s = function (a) {
        var b = 0;
        if (this.bk.categoryMode == 0) {
            b = truncate(Math.round(a));
        }
        else {
            b = truncate(Math.floor(a));
        }
        if (b < 0 || b > this.a.lk - 1) {
            return null;
        }
        var c = this.a.kv.item(b);
        var d = this.q(c);
        if (d == null) {
            return null;
        }
        return d.toString();
    };
    CategoryAxisBaseView.prototype.bl = function (a) {
        var b = 0;
        var c = false;
        for (var d = 0; d < a.count; d++) {
            var e = typeCast(FrameworkElement.$, a._inner[d]);
            if (e == null) {
                e = this.a.br.item(d);
                var f = a._inner[d] == null ? "" : a._inner[d].toString();
                var g = e.al;
                var h = 0;
                var i = 0;
                if (g != null) {
                    h = g.length;
                }
                if (f != null) {
                    i = f.length;
                }
                if (h != i) {
                    c = true;
                }
                e.al = f;
                b++;
            }
            else {
                this.d.ab.add(e);
            }
        }
        if (c) {
            this.a.cq = true;
        }
        this.a.hh();
        return b;
    };
    CategoryAxisBaseView.$t = markType(CategoryAxisBaseView, 'CategoryAxisBaseView', AxisView.$);
    return CategoryAxisBaseView;
}(AxisView));
export { CategoryAxisBaseView };
/**
 * @hidden
 */
var HorizontalAxisLabelPanelBaseView = /** @class */ /*@__PURE__*/ (function (_super) {
    __extends(HorizontalAxisLabelPanelBaseView, _super);
    function HorizontalAxisLabelPanelBaseView(a) {
        var _this = _super.call(this, a) || this;
        _this.az = null;
        _this.az = a;
        return _this;
    }
    HorizontalAxisLabelPanelBaseView.prototype.a1 = function () {
    };
    HorizontalAxisLabelPanelBaseView.prototype.a0 = function () {
        return false;
    };
    HorizontalAxisLabelPanelBaseView.prototype.a2 = function (a) {
        var b = this.a.bs();
        var c, d;
        c = this.az.dh();
        d = this.az.de();
        var e = this.a.ag != null ? this.a.ag.verticalAlignment : 1;
        var f = this.a.bd;
        var g = a.count;
        var h = this.a.c1;
        var i = this.az.dg();
        var j = i / 2;
        for (var k = 0; k < g; k++) {
            var l = a._inner[k];
            var m = l.height / 2;
            switch (e) {
                case 0:
                    l.y = h.top + c;
                    break;
                case 1:
                case 3:
                    l.y = (h.top + c + j) - m;
                    break;
                case 2:
                    l.y = (h.bottom - d) - l.height;
                    break;
            }
        }
    };
    HorizontalAxisLabelPanelBaseView.$t = markType(HorizontalAxisLabelPanelBaseView, 'HorizontalAxisLabelPanelBaseView', AxisLabelPanelBaseView.$);
    return HorizontalAxisLabelPanelBaseView;
}(AxisLabelPanelBaseView));
export { HorizontalAxisLabelPanelBaseView };
/**
 * @hidden
 */
var NumericAxisBaseView = /** @class */ /*@__PURE__*/ (function (_super) {
    __extends(NumericAxisBaseView, _super);
    function NumericAxisBaseView(a) {
        var _this = _super.call(this, a) || this;
        _this.bk = null;
        _this.bk = a;
        return _this;
    }
    NumericAxisBaseView.prototype.bl = function () {
    };
    NumericAxisBaseView.prototype.o = function () {
        return this.bk.ln;
    };
    NumericAxisBaseView.prototype.m = function () {
        if (this.bk.kt != null) {
            return true;
        }
        if (this.bk.ks != null) {
            return true;
        }
        return false;
    };
    NumericAxisBaseView.prototype.r = function (dataItem_) {
        if (this.bk.kt != null) {
            return this.bk.kt(dataItem_);
        }
        if (this.bk.ks != null) {
            return this.bk.ks.i(dataItem_);
        }
        return null;
    };
    NumericAxisBaseView.prototype.s = function (a) {
        var b = this.bk.k4.d(this.bk.kh, this.bk.bi.wh, this.bk.kc(), this.bk.kb());
        return this.bk.k4.w(b, a, -1, NaN);
    };
    NumericAxisBaseView.$t = markType(NumericAxisBaseView, 'NumericAxisBaseView', AxisView.$);
    return NumericAxisBaseView;
}(AxisView));
export { NumericAxisBaseView };
/**
 * @hidden
 */
var VerticalAxisLabelPanelView = /** @class */ /*@__PURE__*/ (function (_super) {
    __extends(VerticalAxisLabelPanelView, _super);
    function VerticalAxisLabelPanelView(a) {
        var _this = _super.call(this, a) || this;
        _this.az = null;
        _this.az = a;
        return _this;
    }
    VerticalAxisLabelPanelView.prototype.a0 = function () {
    };
    VerticalAxisLabelPanelView.prototype.d = function () {
        var a = this.a.ad.bi.getFontInfo();
        if (this.a.ad.bf != null && this.a.ad.bf.textStyle != null) {
            a = this.a.ad.bf.h(this.a.ad.bi.c9.j.ae);
        }
        else {
            var b = this.a.ad.bi.df();
            if (b != null) {
                a = b;
            }
        }
        return a;
    };
    VerticalAxisLabelPanelView.prototype.ay = function () {
        return this.a.ad.bi.w3();
    };
    VerticalAxisLabelPanelView.prototype.at = function () {
        var a = this.a.ad.bg.getFontBrush();
        if (this.a.ad.bf != null && this.a.ad.bf.textColor != null) {
            a = this.a.ad.bf.textColor;
        }
        else {
            var b = this.a.ad.bi.vp();
            if (b != null) {
                a = b;
            }
        }
        return a;
    };
    VerticalAxisLabelPanelView.prototype.a1 = function (a, b) {
        var c, d;
        c = this.az.db();
        d = this.az.dd();
        var e = this.a.ag != null ? this.a.ag.horizontalAlignment : 1;
        var f = this.a.bd;
        var g = this.az.de();
        var h = g / 2;
        var i = this.a.c1;
        for (var j = 0; j < a.count; j++) {
            var k = a._inner[j];
            var l = k.width / 2;
            switch (e) {
                case 0:
                    k.x = i.left + c;
                    break;
                case 1:
                case 3:
                    k.x = (i.left + c + h) - l;
                    break;
                case 2:
                    k.x = (i.right - d) - k.width;
                    break;
            }
        }
    };
    VerticalAxisLabelPanelView.$t = markType(VerticalAxisLabelPanelView, 'VerticalAxisLabelPanelView', AxisLabelPanelBaseView.$);
    return VerticalAxisLabelPanelView;
}(AxisLabelPanelBaseView));
export { VerticalAxisLabelPanelView };
/**
 * @hidden
 */
var XamDataChartView = /** @class */ /*@__PURE__*/ (function (_super) {
    __extends(XamDataChartView, _super);
    function XamDataChartView(a) {
        var _this = _super.call(this, a) || this;
        _this.fn = null;
        _this.fw = null;
        _this.fs = null;
        _this.ft = null;
        _this.fv = null;
        _this.fu = null;
        _this.fp = 0;
        _this.fq = 0;
        _this.fo = null;
        _this.fn = a;
        return _this;
    }
    XamDataChartView.prototype.fr = function (a) {
        this.p.al.s();
    };
    XamDataChartView.prototype.ds = function () {
        _super.prototype.ds.call(this);
        if (this.b.count == 0 && this.y != null) {
            if (this.p.hk != 1) {
                this.y.aa();
                this.y.ab(this.p.hk, this.p.hk);
            }
            if (!this.y.e) {
                this.y.l(0, 0, this.a8, this.a7);
            }
            if (this.p.hk != 1) {
                this.y.z();
            }
        }
    };
    XamDataChartView.prototype.d4 = function () {
        var e_133, _a;
        var a, b;
        var c = 1, d = 0;
        var e = false;
        var f = this.j.e();
        var g;
        var h = this.j.a7(c, g, a, b, d, e);
        c = h.p0;
        g = h.p1;
        a = h.p2;
        b = h.p3;
        d = h.p4;
        e = h.p5;
        if (isNaN_(this.p.ij)) {
            this.p.ij = g[0];
        }
        if (isNaN_(this.p.h9)) {
            this.p.h9 = g[1];
        }
        if (isNaN_(this.p.hr)) {
            this.p.hr = g[2];
        }
        if (isNaN_(this.p.h4)) {
            this.p.h4 = g[3];
        }
        this.fn.aa7 = f.i;
        this.fn.aa5 = AxisDefaults.axis_MajorBrush;
        this.fn.aa6 = AxisDefaults.axis_MinorBrush;
        this.fn.xr = e;
        this.fv = a;
        this.fu = b;
        this.fn.ag = f.a;
        this.fn.aj = f.f;
        this.fn.ah = f.b != null ? f.b : new BrushCollection();
        this.fn.ai = f.c != null ? f.c : new BrushCollection();
        if (this.fn.ah.count == 0) {
            for (var i = 0; i < f.a.count; i++) {
                this.fn.ah.add(f.a.item(i));
            }
        }
        if (f.c.count == 0) {
            for (var j = 0; j < f.f.count; j++) {
                this.fn.ai.add(f.f.item(j));
            }
        }
        this.ft = f.j;
        this.fw = f.k;
        this.fo = f.h;
        this.fs = f.i;
        this.fp = c;
        try {
            for (var _b = __values(fromEnum(this.fn.series)), _c = _b.next(); !_c.done; _c = _b.next()) {
                var k = _c.value;
                k.sh();
            }
        }
        catch (e_133_1) {
            e_133 = { error: e_133_1 };
        }
        finally {
            try {
                if (_c && !_c.done && (_a = _b.return))
                    _a.call(_b);
            }
            finally {
                if (e_133)
                    throw e_133.error;
            }
        }
        this.fq = d;
    };
    XamDataChartView.prototype.d1 = function () {
        this.fe.ad = Defaults.crosshairLineThickness;
        this.fd.ad = Defaults.crosshairLineThickness;
        this.fe._stroke = this.p.v4 != null ? this.p.v4 : this.ft;
        this.fd._stroke = this.p.vu != null ? this.p.vu : this.ft;
        _super.prototype.d1.call(this);
    };
    XamDataChartView.$t = markType(XamDataChartView, 'XamDataChartView', SeriesViewerView.$);
    return XamDataChartView;
}(SeriesViewerView));
export { XamDataChartView };
/**
 * @hidden
 */
var SeriesView = /** @class */ /*@__PURE__*/ (function (_super) {
    __extends(SeriesView, _super);
    function SeriesView(a) {
        var _this = _super.call(this) || this;
        _this.f = null;
        _this.v = false;
        _this.i = null;
        _this.d = null;
        _this._isDirty = false;
        _this.cb = null;
        _this.b1 = null;
        _this.ad = 0;
        _this.b6 = Rect.empty;
        _this.b0 = new Brush();
        _this.g = new SeriesComponentsFromView();
        _this.m = null;
        _this.n = null;
        _this.b7 = null;
        _this.b8 = null;
        _this.o = false;
        _this.a = null;
        _this.u = false;
        _this.q = false;
        _this.s = false;
        _this.al = null;
        _this.y = new List$1(ITrendLineManager_$type, 0);
        _this.p = false;
        _this.z = new List$1(FrameworkElement.$, 0);
        _this.x = new Dictionary$2(FontInfo.$, Tuple$2.$.specialize(Number_$type, FontInfo.$), 0);
        _this.ad = NaN;
        _this.u = true;
        _this.f = a;
        _this.t = false;
        _this.cb = new Rectangle();
        _this.v = false;
        return _this;
    }
    SeriesView.prototype.getDefaultTooltipTemplate = function () {
        return this.f.ba.a$t(this.f);
    };
    SeriesView.prototype.a1 = function () {
        if (this.f.fj) {
            this.f.ba.a$aa(this.f);
        }
    };
    SeriesView.prototype.k = function () {
        return new DOMExecutionContext(this.f.dc.c9.j.ae);
    };
    Object.defineProperty(SeriesView.prototype, "j", {
        get: function () {
            if (this.i == null) {
                this.i = this.k();
            }
            return this.i;
        },
        enumerable: false,
        configurable: true
    });
    SeriesView.prototype.ap = function (a, b) {
        Series.po(b, this.f.dc, false);
        b.dc = this.f.dc;
        b.c4 = this.f.c4;
        if (b.dc != null) {
            b.dc.nh(b);
        }
    };
    SeriesView.prototype.au = function (a) {
        Series.po(a, this.f.dc, true);
        a.o7(true, a.cw);
        a.dc = null;
        a.c4 = null;
        a.itemsSource = null;
        a.legend = null;
        if (a.dc != null) {
            a.dc.rd(a);
        }
    };
    SeriesView.prototype.a4 = function () {
        if (!this.t) {
            this.f.il = 0.8;
            this.f.c2 = 0;
            this.f.c1 = 1;
            this.d = new DataContext();
            this.d.series = this.f;
            this.f.df = EasingFunctions.cubicEase;
            this.an();
        }
    };
    SeriesView.prototype.getEffectiveViewport = function () {
        return this.f.getEffectiveViewport1(this);
    };
    SeriesView.prototype.bb = function () {
        this.a2();
    };
    SeriesView.prototype.as = function () {
    };
    SeriesView.prototype.getMainContentViewport = function () {
        return this.f.getMainContentViewport();
    };
    Object.defineProperty(SeriesView.prototype, "ae", {
        get: function () {
            if (this.f.dc != null) {
                return this.f.dc.c9.j.ae;
            }
            return null;
        },
        enumerable: false,
        configurable: true
    });
    SeriesView.prototype.l = function (a) {
        return FontUtil.getFontInfoFromString(this.ae, a);
    };
    Object.defineProperty(SeriesView.prototype, "isDirty", {
        get: function () {
            return this._isDirty;
        },
        set: function (a) {
            this._isDirty = a;
        },
        enumerable: false,
        configurable: true
    });
    SeriesView.prototype.get_index = function () {
        if (this.f == null || this.f.dc == null) {
            return 0;
        }
        if (this.f.dc.fd) {
            if (this.f.fd) {
                return this.f.dc.series.indexOf(this.f);
            }
            else {
                var a = this.f.dc.series.indexOf(this.f);
                if (a >= 0) {
                    return a;
                }
                for (var b = 0; b < this.f.dc.series.count; b++) {
                    if (this.f.dc.series._inner[b].fd) {
                        var c = this.f.dc.series._inner[b].bp();
                        if (c == this.f) {
                            return b;
                        }
                    }
                }
                return a;
            }
        }
        var d = typeCast(XamDataChart.$, this.f.da);
        var e = 0;
        if (d != null) {
            if (d.xb == 2 || d.xb == 0) {
                e = d.axes.count;
            }
        }
        var f = 0;
        for (var g = 0; g < this.f.dc.series.count; g++) {
            if (this.f.dc.series._inner[g] == this.f) {
                break;
            }
            if (this.f.dc.series._inner[g].isStacked) {
                f += this.f.dc.series._inner[g].kd();
            }
            else if (this.f.dc.series._inner[g].ei) {
                if (this.f.bo != null && this.f.bo == this.f.dc.series._inner[g]) {
                    f += 1;
                    for (var h = 0; h < this.f.dc.series._inner[g].actualLayers.count; h++) {
                        if (this.f.dc.series._inner[g].actualLayers._inner[h].target == this.f) {
                            return e + f + (h);
                        }
                    }
                }
                else {
                    f += this.f.dc.series._inner[g].actualLayers.count + 1;
                }
            }
            else {
                f++;
            }
        }
        return e + f;
    };
    Object.defineProperty(SeriesView.prototype, "index", {
        get: function () {
            return this.get_index();
        },
        enumerable: false,
        configurable: true
    });
    SeriesView.prototype.a2 = function () {
        if (this.f.dc == null) {
            return;
        }
        if (!this.isDirty) {
            this.isDirty = true;
            this.a.r(this.m, this.n);
        }
    };
    SeriesView.prototype.undirty = function (a) {
        this.isDirty = false;
        this.bh(a);
    };
    SeriesView.prototype.a6 = function () {
        this.a2();
    };
    SeriesView.prototype.b5 = function () {
        if (this.b1 == null) {
            this.b1 = ((function () {
                var $ret = new Brush();
                $ret.color = Color.u(0, 0, 0, 0);
                return $ret;
            })());
        }
        return this.b1;
    };
    SeriesView.prototype.b2 = function (a) {
        if (a != null) {
            var b = BrushUtil.p(a, 1);
            return b;
        }
        else {
            return null;
        }
    };
    SeriesView.prototype.ac = function () {
        if (!isNaN_(this.ad)) {
            return this.ad;
        }
        if (this.f.dc != null) {
            return this.f.dc.hk;
        }
        else {
            return 1;
        }
    };
    SeriesView.prototype.bh = function (a) {
        if (this.m == null) {
            return;
        }
        if (this.b6.isEmpty) {
            this.b6 = this.b9;
        }
        var b = this.b6;
        var c = this.f.dc.wn();
        var d = c.left;
        var e = c.top;
        var f = c.width;
        var g = c.height;
        var h = this.ac();
        if (this.s) {
            d = this.b9.left;
            e = this.b9.top;
            f = this.b9.width;
            g = this.b9.height;
        }
        if (this.m.d) {
            if (h != 1) {
                this.m.aa();
                this.m.ab(h, h);
            }
            if (a) {
                if (!this.m.e) {
                    this.m.l(d, e, f, g);
                }
            }
            if (a) {
                if (this.f.dc.vx != null && !this.b9.isEmpty) {
                    this.cb.o = this.b9.top;
                    this.cb.n = this.b9.left;
                    this.cb.width = this.b9.width;
                    this.cb.height = this.b9.height;
                    this.cb._fill = this.f.dc.vx;
                    this.m.w(this.cb);
                }
            }
            if (h != 1) {
                this.m.z();
            }
        }
        if (this.n != null && this.u) {
            if (this.n.d) {
                if (this.f.dc != null && h != 1) {
                    this.n.aa();
                    this.n.ab(h, h);
                }
                if (!b.isEmpty && a) {
                    if (!this.n.e) {
                        this.n.l(b.left, b.top, b.width, b.height);
                    }
                }
                this.bo(true);
                this.bj(this.n, true);
                this.bi(this.n, true);
                if (h != 1) {
                    this.n.z();
                }
            }
        }
        if (this.m.d && this.u) {
            if (h != 1) {
                this.m.aa();
                this.m.ab(h, h);
            }
            this.m.aa();
            if (!this.t && Rect.l_op_Inequality(this.f.wn, null) && !this.f.wn.isEmpty && (this.f.wn.width != 1 || this.f.wn.height != 1)) {
                this.m.af(new Rect(0, this.b9.left + this.b9.width * this.f.wn.left, this.b9.top + this.b9.height * this.f.wn.top, this.b9.width * this.f.wn.width, this.b9.height * this.f.wn.height));
            }
            else {
                this.m.af(this.b9);
            }
            this.bo(false);
            this.m.ae(this.f._opacity);
            if (this.f.e6 && this.f.e7 && !this.t) {
                if (this.f.hd) {
                    this.m.p(this.f.v6.colorString, 0, this.f.jo, this.f.jp);
                    var i = this.f.dc.c9.j.x;
                    var j = this.f.dc.c9.j.ak;
                    if (h != 1) {
                        i.aa();
                        i.ab(h, h);
                    }
                    if (!i.e) {
                        i.l(c.left, c.top, c.width, c.height);
                    }
                    this.bj(i, false);
                    this.bi(i, false);
                    this.m.n(j.getNativeElement(), 1, 0, 0, c.width, c.height);
                    if (h != 1) {
                        i.z();
                    }
                }
                else {
                    this.m.p(this.f.v6.colorString, this.f.jn, this.f.jo, this.f.jp);
                    this.bj(this.m, false);
                    this.bi(this.m, false);
                }
                this.m.m();
            }
            else {
                this.bj(this.m, false);
                this.bi(this.m, false);
            }
            this.m.ae(1);
            this.m.z();
            if (h != 1) {
                this.m.z();
            }
        }
    };
    SeriesView.prototype.br = function (a, b, c) {
        if (c) {
            this.bt(a, b);
        }
        else {
            this.bs(a, b);
        }
    };
    SeriesView.prototype.bu = function (a, b, c) {
        if (c) {
            this.bw(a, b);
        }
        else {
            this.bv(a, b);
        }
    };
    SeriesView.prototype.ai = function (a, b) {
        if (b) {
            return this.aj(a);
        }
        else {
            return this.ak(a);
        }
    };
    SeriesView.prototype.aj = function (a) {
        return null;
    };
    SeriesView.prototype.ak = function (a) {
        return null;
    };
    SeriesView.prototype.bs = function (a, b) {
    };
    SeriesView.prototype.bv = function (a, b) {
    };
    SeriesView.prototype.bt = function (a, b) {
    };
    SeriesView.prototype.bw = function (a, b) {
    };
    SeriesView.prototype.bo = function (a) {
        if (a) {
            this.bq();
        }
        else {
            this.bp();
        }
    };
    SeriesView.prototype.bp = function () {
    };
    SeriesView.prototype.bq = function () {
    };
    SeriesView.prototype.b4 = function (a) {
        return this.b3();
    };
    SeriesView.prototype.b3 = function () {
        var a = this.f.kh;
        var num_ = (a + 1) * 1000;
        var b = ((num_ & 0x3F) << 2);
        num_ = (num_ >> 6);
        var c = ((num_ & 0x3F) << 2);
        num_ = (num_ >> 6);
        var d = ((num_ & 0x3F) << 2);
        this.b0._fill = "rgb(" + b + "," + c + "," + d + ")";
        return this.b0;
    };
    SeriesView.prototype.bj = function (a, b) {
        this.b6 = this.b9;
    };
    SeriesView.prototype.bi = function (a, b) {
    };
    SeriesView.prototype.a9 = function () {
    };
    SeriesView.prototype.ay = function () {
    };
    SeriesView.prototype.az = function () {
    };
    SeriesView.prototype.h = function () {
        return this.g;
    };
    SeriesView.prototype.bm = function (a) {
    };
    SeriesView.prototype.w = function () {
        return true;
    };
    SeriesView.prototype.a8 = function () {
    };
    SeriesView.prototype.a7 = function () {
    };
    SeriesView.prototype.bk = function () {
        this.f.ve = null;
    };
    SeriesView.prototype.aq = function () {
        this.f.ve = this.f.vk;
    };
    SeriesView.prototype.bl = function () {
        this.f.vi = null;
    };
    SeriesView.prototype.ar = function () {
        this.f.vi = this.f.v0;
    };
    SeriesView.prototype.c = function (a) {
        if (typeCast(DataContext.$, a) !== null) {
            return a;
        }
        return null;
    };
    SeriesView.prototype.a3 = function (a, b) {
        this.m = a;
        this.n = b;
    };
    Object.defineProperty(SeriesView.prototype, "b9", {
        get: function () {
            return this.b7;
        },
        set: function (a) {
            this.b7 = a;
        },
        enumerable: false,
        configurable: true
    });
    SeriesView.prototype.get_ca = function () {
        if (this.s) {
            return this.b8;
        }
        else if (this.t) {
            return XamDataChart.wu;
        }
        else {
            return this.f.dc != null ? this.f.dc.wh : Rect.empty;
        }
    };
    Object.defineProperty(SeriesView.prototype, "ca", {
        get: function () {
            return this.get_ca();
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(SeriesView.prototype, "t", {
        get: function () {
            return this.o;
        },
        set: function (a) {
            this.o = a;
        },
        enumerable: false,
        configurable: true
    });
    SeriesView.prototype.at = function (a) {
        if (a != null) {
            this.a.u(this);
            if (this.f.cv != null) {
                this.f.cv.a.u(this.f.cv);
            }
        }
    };
    SeriesView.prototype.ao = function (a) {
        var e_134, _a;
        if (a != null) {
            if (this.f.hb) {
                this.m = this.f.dc.c9.z;
                a.c9.a.o(this);
                this.a = a.c9.a;
            }
            else {
                this.m = this.f.dc.c9.y;
                a.al.o(this);
                this.a = a.al;
            }
            if (this.f.cv != null) {
                a.am.o(this.f.cv);
                this.f.cv.a = a.am;
                this.f.cv.a2();
            }
            if (this.f.fj) {
                try {
                    for (var _b = __values(fromEnum(this.f.ba.a$j.keys)), _c = _b.next(); !_c.done; _c = _b.next()) {
                        var b = _c.value;
                        a.ak.o(this.f.ba.a$j.item(b));
                        this.f.ba.a$j.item(b).a = a.ak;
                        this.f.ba.a$j.item(b).a2();
                    }
                }
                catch (e_134_1) {
                    e_134 = { error: e_134_1 };
                }
                finally {
                    try {
                        if (_c && !_c.done && (_a = _b.return))
                            _a.call(_b);
                    }
                    finally {
                        if (e_134)
                            throw e_134.error;
                    }
                }
            }
            this.a2();
        }
    };
    SeriesView.prototype.postRender = function () {
        this.bc();
    };
    SeriesView.prototype.bc = function () {
    };
    SeriesView.prototype.b = function (a) {
        return null;
    };
    SeriesView.prototype.be = function (a) {
        this.f.cv.m = a.a;
    };
    SeriesView.prototype.ax = function (a) {
    };
    SeriesView.prototype.bx = function () {
        if (this.q) {
            return;
        }
        if (this.f.dc != null) {
            var a = (this.f.legend != null) ? this.f.legend : this.f.dc.legend;
            if (a != null && this.f.sy != null && a.containsChild(this.f.sy)) {
                a.removeChild(this.f.sy);
                var b = this.f.k0();
                b.content.actualItemBrush = this.f.ve;
                b.content.outline = this.f.vi;
                b.content.thickness = this.f.ig;
                a.addChildInOrder(this.f.sy, this.f);
            }
        }
    };
    SeriesView.prototype.a5 = function () {
        this.f.oy(this.f.a5, this.f.a5);
    };
    SeriesView.prototype.ba = function () {
        this.bx();
    };
    SeriesView.prototype.getViewInfo = function (a, b) {
        a = this.b9;
        b = this.ca;
        return {
            p0: a,
            p1: b
        };
    };
    SeriesView.prototype.r = function () {
        return this.m != null;
    };
    SeriesView.prototype.by = function () {
        this.u = this.f._visibility == 0;
        this.a2();
    };
    SeriesView.prototype.bg = function () {
        this.f.ba.a$ap(this.f);
    };
    SeriesView.prototype.an = function () {
        var a = new Color();
        a.colorString = "rgba(95,95,95,0.5)";
        this.f.v6 = a;
        this.f.jn = 5;
        this.f.jo = 5;
        this.f.jp = 5;
    };
    SeriesView.prototype.a0 = function () {
    };
    SeriesView.prototype.preRender = function () {
        if (this.f.dc != null && !this.t) {
            this.f.dc.nv();
        }
    };
    SeriesView.prototype.isValid = function () {
        return true;
    };
    SeriesView.prototype.bd = function (a) {
        this.m = a.a;
    };
    SeriesView.prototype.bz = function (type_) {
        var legendTemplates_ = TypeRegistrar.get("LegendTemplates");
        var a = (legendTemplates_.resolveLegendItemTemplate(type_));
        return a;
    };
    Object.defineProperty(SeriesView.prototype, "aa", {
        get: function () {
            return this.y;
        },
        enumerable: false,
        configurable: true
    });
    SeriesView.prototype.e = function () {
        var a = this.f.bd();
        if (a != null) {
            a.g$d = true;
            this.y.add(a);
            return a;
        }
        return null;
    };
    SeriesView.prototype.bf = function (a) {
        if (a != null) {
            this.y.remove(a);
        }
    };
    SeriesView.prototype.bn = function (a, b, c) {
        if (this.p) {
            this.z.add(a);
        }
        a.n = b;
        a.o = c;
    };
    SeriesView.prototype.av = function (a, b) {
        a.dataContext = b;
    };
    SeriesView.prototype.aw = function (a, b) {
        a.ag = true;
        var c = this.m.ah(a, this.ab(b), true);
    };
    SeriesView.prototype.cc = function (a, b) {
        this.m.ad(b);
        var c = new TextBlock();
        c.al = a;
        var d = this.m.ah(c, this.ab(b), true);
        return new Size(1, d.c, d.b);
    };
    SeriesView.prototype.ab = function (a) {
        if (this.x.containsKey(a)) {
            var b = this.x.item(a);
            if (b.d.j == a.j) {
                return b.c;
            }
        }
        var c = 20;
        var d = new Tuple$2(Number_$type, FontInfo.$, c, a);
        this.x.item(a, d);
        return c;
    };
    SeriesView.$t = markType(SeriesView, 'SeriesView', Base.$, [ISchedulableRender_$type, IProvidesViewport_$type]);
    return SeriesView;
}(Base));
export { SeriesView };
/**
 * @hidden
 */
var MarkerSeriesView = /** @class */ /*@__PURE__*/ (function (_super) {
    __extends(MarkerSeriesView, _super);
    function MarkerSeriesView(a) {
        var _this = _super.call(this, a) || this;
        _this.ch = null;
        _this.cm = 1;
        _this.co = Defaults.series_MarkerThickness;
        _this.cn = 3;
        _this.cl = null;
        _this.ck = false;
        _this.cd = new Marker();
        _this.c6 = null;
        _this.cd = new Marker();
        _this.cd.content = new DataContext();
        _this.ch = a;
        return _this;
    }
    MarkerSeriesView.prototype.a4 = function () {
        _super.prototype.a4.call(this);
        this.cl = new List$1(Marker.$, 0);
        this.c6 = ((function () {
            var $ret = new DataTemplate();
            $ret.render = MarkerTemplates.c;
            $ret.measure = MarkerTemplates.b;
            return $ret;
        })());
    };
    MarkerSeriesView.prototype.cy = function () {
        var e_135, _a;
        try {
            for (var _b = __values(fromEnum(this.cl)), _c = _b.next(); !_c.done; _c = _b.next()) {
                var a = _c.value;
                a.ah = this.ch.x6;
            }
        }
        catch (e_135_1) {
            e_135 = { error: e_135_1 };
        }
        finally {
            try {
                if (_c && !_c.done && (_a = _b.return))
                    _a.call(_b);
            }
            finally {
                if (e_135)
                    throw e_135.error;
            }
        }
        this.a2();
    };
    MarkerSeriesView.prototype.c8 = function () {
        if (this.m == null) {
            return new Size(1, 0, 0);
        }
        var a = new DataTemplatePassInfo();
        a.isHitTestRender = false;
        a.context = this.m.h();
        a.viewportTop = this.b9.top;
        a.viewportLeft = this.b9.left;
        a.viewportWidth = this.b9.width;
        a.viewportHeight = this.b9.height;
        a.passID = "TestMeasure";
        var b = new DataTemplateRenderInfo();
        b.isHitTestRender = false;
        b.passInfo = a;
        var c = new DataTemplateMeasureInfo();
        c.passInfo = a;
        var d = this.m.h();
        c.context = d;
        b.context = d;
        var e = 0;
        var f = 0;
        if (this.ch.x6 != null && this.ch.x6.passStarting != null) {
            this.ch.x6.passStarting(a);
        }
        var g = this.ch.x6;
        if (this.cl.count > 0) {
            var h = this.cl._inner[0];
            c.data = h.content;
            c.width = h.width;
            c.height = h.height;
            c.renderOffsetX = 0;
            c.renderOffsetY = 0;
            c.renderContext = this.m;
            g = h.ah;
        }
        var i = 0;
        var j = 0;
        if (g != null && g.measure != null) {
            g.measure(c);
            i = c.width;
            j = c.height;
        }
        if (this.ch.x6 != null && this.ch.x6.passCompleted != null) {
            this.ch.x6.passCompleted(a);
        }
        return new Size(1, i, j);
    };
    MarkerSeriesView.prototype.c5 = function (a) {
    };
    MarkerSeriesView.prototype.cg = function () {
        var _this = this;
        var a = new Marker();
        a.content = ((function () {
            var $ret = new DataContext();
            $ret.series = _this.f;
            return $ret;
        })());
        a.ah = this.ch.x6;
        this.cl.add(a);
        return a;
    };
    MarkerSeriesView.prototype.cx = function (a) {
        for (var b = this.cl.count - 1; b >= 0; b--) {
            var c = this.cl._inner[b];
            a(c);
        }
    };
    MarkerSeriesView.prototype.c1 = function (a) {
        a._visibility = 0;
    };
    MarkerSeriesView.prototype.c3 = function (a) {
        a._visibility = 1;
    };
    MarkerSeriesView.prototype.c2 = function (a) {
        this.cl.remove(a);
    };
    MarkerSeriesView.prototype.ci = function () {
        return this.ch.x7 != null;
    };
    MarkerSeriesView.prototype.cv = function () {
        this.ch.x5 = null;
    };
    MarkerSeriesView.prototype.cp = function () {
        this.ch.x5 = this.ch.x7;
    };
    MarkerSeriesView.prototype.c7 = function (a) {
        var b = a.n;
        var c = a.o;
        var d = a.m;
        var e = a.l;
        return new Rect(0, b - d / 2, c - d / 2, d, e);
    };
    MarkerSeriesView.prototype.cs = function (a) {
        if (this.ch.dc == null) {
            return;
        }
        switch (a) {
            case SeriesViewer.$$p[2]:
                this.ch.x5 = this.ch.dc.sa;
                break;
            case SeriesViewer.$$p[48]:
                this.ch.x5 = this.ch.dc.sj;
                break;
            case SeriesViewer.$$p[33]:
                this.ch.x5 = this.ch.dc.sg;
                break;
            case SeriesViewer.$$p[42]:
                this.ch.x5 = this.ch.dc.sh;
                break;
            case SeriesViewer.$$p[5]:
                this.ch.x5 = this.ch.dc.sb;
                break;
            case SeriesViewer.$$p[25]:
                this.ch.x5 = this.ch.dc.se;
                break;
            case SeriesViewer.$$p[10]:
                this.ch.x5 = this.ch.dc.sc;
                break;
            case SeriesViewer.$$p[45]:
                this.ch.x5 = this.ch.dc.si;
                break;
            case SeriesViewer.$$p[26]:
                this.ch.x5 = this.ch.dc.sf;
                break;
            case SeriesViewer.$$p[11]:
                this.ch.x5 = this.ch.dc.sd;
                break;
        }
    };
    MarkerSeriesView.prototype.ct = function () {
        this.ch.ym = null;
    };
    MarkerSeriesView.prototype.cq = function () {
        if (!isNaN_(this.f.id) && this.f.id != 1) {
            var a = BrushUtil.s(this.ch.yo, this.f.id);
            this.ch.ym = a;
        }
        else {
            this.ch.ym = this.ch.yo;
        }
    };
    MarkerSeriesView.prototype.cu = function () {
        this.ch.yn = null;
    };
    MarkerSeriesView.prototype.cr = function () {
        this.ch.yn = this.ch.yp;
    };
    MarkerSeriesView.prototype.c4 = function () {
        this.a2();
    };
    MarkerSeriesView.prototype.bv = function (a, b) {
        _super.prototype.bv.call(this, a, b);
        if (!this.ck) {
            var c = a;
            var d = c.content;
            if (d != null) {
                d.actualItemBrush = this.ch.ym;
                if (d.itemBrush != null) {
                    d.actualItemBrush = d.itemBrush;
                }
                d.outline = this.ch.yn;
                d.thickness = this.ch.xo;
            }
        }
    };
    MarkerSeriesView.prototype.bw = function (a, b) {
        _super.prototype.bw.call(this, a, b);
        var c = a;
        this.cd._visibility = c._visibility;
        this.cd.ah = c.ah;
        this.cd.width = c.width;
        this.cd.height = c.height;
        this.cd.m = c.m;
        this.cd.l = c.l;
        this.cd.n = c.n;
        this.cd.o = c.o;
        var d = this.b4(b);
        var e = this.cd.content;
        var f = c.content;
        e.item = f.item;
        e.series = f.series;
        e.thickness = f.thickness;
        if (e != null) {
            e.actualItemBrush = d;
            e.outline = d;
            e.thickness = this.cm + this.cn;
        }
    };
    MarkerSeriesView.prototype.b = function (a) {
        if (a >= 0 && a < this.cl.count) {
            return this.cl._inner[a].content;
        }
        return _super.prototype.b.call(this, a);
    };
    MarkerSeriesView.prototype.bi = function (a, b) {
        _super.prototype.bi.call(this, a, b);
        if (a.d) {
            var c = new DataTemplatePassInfo();
            c.isHitTestRender = b;
            c.context = a.h();
            c.viewportTop = this.b9.top;
            c.viewportLeft = this.b9.left;
            c.viewportWidth = this.b9.width;
            c.viewportHeight = this.b9.height;
            c.passID = "Markers";
            var d = new DataTemplateRenderInfo();
            d.isHitTestRender = b;
            d.passInfo = c;
            var e = new DataTemplateMeasureInfo();
            e.passInfo = c;
            var f = false;
            var g = a.h();
            e.context = g;
            d.context = g;
            var h = 0;
            var i = 0;
            if (this.ch.x6 != null && this.ch.x6.passStarting != null) {
                this.ch.x6.passStarting(c);
            }
            for (var j = 0; j < this.cl.count; j++) {
                var k = this.cl._inner[j];
                if (k._visibility == 1) {
                    continue;
                }
                this.bu(k, j, b);
                if (b) {
                    k = this.cd;
                }
                if (!f) {
                    e.data = k.content;
                    e.width = k.width;
                    e.height = k.height;
                    e.renderOffsetX = 0;
                    e.renderOffsetY = 0;
                    e.renderContext = a;
                    var l = k.ah;
                    if (l.measure != null) {
                        e.data = k.content;
                        l.measure(e);
                        f = e.isConstant;
                        if (f) {
                            h = e.width;
                            i = e.height;
                        }
                    }
                    d.availableWidth = e.width;
                    d.availableHeight = e.height;
                    d.renderOffsetX = e.renderOffsetX;
                    d.renderOffsetY = e.renderOffsetY;
                    d.renderContext = a;
                }
                else {
                    d.availableWidth = h;
                    d.availableHeight = i;
                }
                if (!isNaN_(k.width) && !isInfinity(k.width)) {
                    d.availableWidth = k.width;
                }
                if (!isNaN_(k.height) && !isInfinity(k.height)) {
                    d.availableHeight = k.height;
                }
                a.q(d, k);
                k.m = d.availableWidth;
                k.l = d.availableHeight;
                k.ai = d.renderOffsetX;
                k.aj = d.renderOffsetY;
            }
            if (this.ch.x6 != null && this.ch.x6.passCompleted != null) {
                this.ch.x6.passCompleted(c);
            }
        }
    };
    MarkerSeriesView.prototype.cz = function (a) {
        a.create = runOn(this, this.cg);
        a.destroy = runOn(this, this.c2);
        a.activate = runOn(this, this.c1);
        a.disactivate = runOn(this, this.c3);
    };
    MarkerSeriesView.prototype.c0 = function (a) {
        a.create = runOn(this, this.cg);
        a.destroy = runOn(this, this.c2);
        a.activate = runOn(this, this.c1);
        a.disactivate = runOn(this, this.c3);
    };
    MarkerSeriesView.prototype.ce = function (a) {
        var b = this.cf(a, 0);
        if (b == null) {
            b = this.cf(a, 3);
        }
        return b;
    };
    MarkerSeriesView.prototype.cf = function (a, b) {
        var c;
        var d;
        var e;
        var f;
        for (var g = this.cl.count - 1; g >= 0; g--) {
            var h = this.cl._inner[g];
            if (h._visibility == 1 || h._opacity == 0) {
                continue;
            }
            c = (h.m / 2) + b;
            d = (h.l / 2) + b;
            e = h.ai;
            f = h.aj;
            if (this.ch.xh) {
                if (this.cj(a.x, a.y, h.n + e, h.o + f, c)) {
                    return h;
                }
            }
            else {
                if ((h.n + e) - c <= a.x && (h.n + e) + c >= a.x && (h.o + f) - d <= a.y && (h.o + f) + d >= a.y) {
                    return h;
                }
            }
        }
        return null;
    };
    MarkerSeriesView.prototype.cj = function (a, b, c, d, e) {
        var f = e * e;
        var g = (a - c) * (a - c) + (b - d) * (b - d);
        return g < f;
    };
    MarkerSeriesView.$t = markType(MarkerSeriesView, 'MarkerSeriesView', SeriesView.$);
    return MarkerSeriesView;
}(SeriesView));
export { MarkerSeriesView };
/**
 * @hidden
 */
var ChartAxisRangeChangedEventArgs = /** @class */ /*@__PURE__*/ (function (_super) {
    __extends(ChartAxisRangeChangedEventArgs, _super);
    function ChartAxisRangeChangedEventArgs(a, b, c, d, e, f) {
        var _this = _super.call(this) || this;
        _this._chart = null;
        _this._axis = null;
        _this._oldMinimumValue = 0;
        _this._minimumValue = 0;
        _this._oldMaximumValue = 0;
        _this._maximumValue = 0;
        _this.chart = a;
        _this.axis = b;
        _this.oldMinimumValue = c;
        _this.minimumValue = d;
        _this.oldMaximumValue = e;
        _this.maximumValue = f;
        return _this;
    }
    Object.defineProperty(ChartAxisRangeChangedEventArgs.prototype, "chart", {
        get: function () {
            return this._chart;
        },
        set: function (a) {
            this._chart = a;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(ChartAxisRangeChangedEventArgs.prototype, "axis", {
        get: function () {
            return this._axis;
        },
        set: function (a) {
            this._axis = a;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(ChartAxisRangeChangedEventArgs.prototype, "oldMinimumValue", {
        get: function () {
            return this._oldMinimumValue;
        },
        set: function (a) {
            this._oldMinimumValue = a;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(ChartAxisRangeChangedEventArgs.prototype, "minimumValue", {
        get: function () {
            return this._minimumValue;
        },
        set: function (a) {
            this._minimumValue = a;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(ChartAxisRangeChangedEventArgs.prototype, "oldMaximumValue", {
        get: function () {
            return this._oldMaximumValue;
        },
        set: function (a) {
            this._oldMaximumValue = a;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(ChartAxisRangeChangedEventArgs.prototype, "maximumValue", {
        get: function () {
            return this._maximumValue;
        },
        set: function (a) {
            this._maximumValue = a;
        },
        enumerable: false,
        configurable: true
    });
    ChartAxisRangeChangedEventArgs.$t = markType(ChartAxisRangeChangedEventArgs, 'ChartAxisRangeChangedEventArgs', EventArgs.$);
    return ChartAxisRangeChangedEventArgs;
}(EventArgs));
export { ChartAxisRangeChangedEventArgs };
(function (v) { callStaticConstructors(); })(true);