/*
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 { INotifyPropertyChanged_$type, PropertyChangedEventArgs, Base, fromEnum, String_$type, runOn, delegateCombine, EnumUtil, typeCast, delegateRemove, enumGetBox, markType, getInstanceType } from "igniteui-react-core/ES2015/type";
import { ArrayExtension } from "igniteui-react-core/ES2015/ArrayExtension";
import { List$1 } from "igniteui-react-core/ES2015/List$1";
import { Brush } from "igniteui-react-core/ES2015/Brush";
import { XamDataChart } from "./XamDataChart";
import { DataSeriesType_$type } from "igniteui-react-core/ES2015/DataSeriesType";
import { MarkerType_$type } from "./MarkerType";
import { Color } from "igniteui-react-core/ES2015/Color";
import { ColorUtil } from "igniteui-react-core/ES2015/ColorUtil";
import { Rect } from "igniteui-react-core/ES2015/Rect";
import { HorizontalAlignment_$type } from "igniteui-react-core/ES2015/HorizontalAlignment";
import { UnknownValuePlotting_$type } from "igniteui-react-core/ES2015/UnknownValuePlotting";
import { TrendLineType_$type } from "igniteui-react-core/ES2015/TrendLineType";
import { DeviceUtils } from "igniteui-react-core/ES2015/DeviceUtils";
import { DataSeriesAdapter } from "igniteui-react-core/ES2015/DataSeriesAdapter";
import { ObservableCollection$1 } from "igniteui-react-core/ES2015/ObservableCollection$1";
import { BrushCollectionUtil } from "igniteui-react-core/ES2015/BrushCollectionUtil";
import { ChartSeriesEventArgs } from "./ChartSeriesEventArgs";
import { DomainChartSeriesPointerEventArgs } from "./DomainChartSeriesPointerEventArgs";
import { IUnknownValuePlotting_$type } from "igniteui-react-core/ES2015/IUnknownValuePlotting";
import { ITrendLineSeries_$type } from "./ITrendLineSeries";
import { Random } from "igniteui-react-core/ES2015/Random";
import { isNaN_ } from "igniteui-react-core/ES2015/number";
import { stringIsNullOrEmpty, stringEmpty } from "igniteui-react-core/ES2015/string";
export class DomainChart extends Base {
    constructor() {
        super();
        this.cm = null;
        this.cl = null;
        this.a6 = null;
        this.bh = NaN;
        this.ck = null;
        this.bq = 0;
        this.br = 0;
        this.bs = 0;
        this.bp = 0;
        this.bl = 0;
        this.bn = 0;
        this.bm = 0;
        this.bk = 0;
        this.f8 = null;
        this.f9 = null;
        this.bg = NaN;
        this.bt = NaN;
        this.bj = NaN;
        this.bf = NaN;
        this.cf = 0;
        this.an = null;
        this.cb = null;
        this.a4 = false;
        this.aa = null;
        this.cv = null;
        this.cx = null;
        this.al = null;
        this.a8 = null;
        this.propertyChanged = null;
        this.ce = 0;
        this.az = false;
        this.a5 = null;
        this.seriesAdded = null;
        this.seriesRemoved = null;
        this.seriesPointerEnter = null;
        this.seriesPointerLeave = null;
        this.seriesPointerMove = null;
        this.seriesPointerDown = null;
        this.seriesPointerUp = null;
        this.ar = false;
        this.bc = null;
        this.b = null;
        this.a = null;
        this.e = null;
        this.h = null;
        this.y = null;
        this.as = true;
        this.at = true;
        this.gh = new Rect(0, 0, 0, 1, 1);
        this.cw = null;
        this.cu = null;
        this.f5 = 1;
        this.f4 = 1;
        this.aj = 0;
        this.bi = 1;
        this.bo = 1;
        this.ae = null;
        this.f = null;
        this.g = null;
        this.cd = 400;
        this.aq = false;
        this.i = null;
        this.ah = 0;
        this.bu = 1.5;
        this.ap = true;
        this.cg = 7;
        this.ez();
        this.em();
    }
    provideContainer(a) {
        if (a == null) {
            this.dataChart.provideContainer(null);
            return;
        }
        this.cm = a;
        let b = ((() => {
            let $ret = new XamDataChart();
            $ret.cq = true;
            return $ret;
        })());
        b.provideContainer(a);
        this.dataChart = b;
        this.e0();
    }
    destroy() {
        this.provideContainer(null);
    }
    e0() {
        if (this.dataChart == null) {
            return;
        }
        let a = this.dataChart.bk.i.e();
        this.j = a.a;
        this.n = a.f;
        this.l = a.b;
        this.m = a.c;
        this.o = a.g;
        this.b4 = DeviceUtils.g(1);
        this.e1();
    }
    e1() {
    }
    ex(a) {
        if (a == null) {
            return;
        }
        a.eq = this.b8;
        a.eo = this.b6;
        a.ep = this.b7;
        a.en = this.b5;
        a.ma = this.gf;
        a.ek = this.b1;
        a.em = this.b3;
        a.el = this.b2;
        a.ej = this.b0;
        a.l9 = this.ge;
        if (!isNaN_(this.bx)) {
            a.eh = this.bx;
        }
    }
    eu() {
    }
    e3(a, b) {
        a.fc = this.ci;
        a.bu = this.ao;
    }
    fk(a, b, c) {
        switch (a) {
            case "TitleTopMargin":
                if (this.dataChart != null) {
                    this.dataChart.eq = this.b8;
                }
                break;
            case "TitleLeftMargin":
                if (this.dataChart != null) {
                    this.dataChart.eo = this.b6;
                }
                break;
            case "PixelScalingRatio":
                if (this.dataChart != null) {
                    this.fe((d) => d.eh = this.bx);
                }
                break;
            case "TitleRightMargin":
                if (this.dataChart != null) {
                    this.dataChart.ep = this.b7;
                }
                break;
            case "TitleBottomMargin":
                if (this.dataChart != null) {
                    this.dataChart.en = this.b5;
                }
                break;
            case "TitleTextColor":
                if (this.dataChart != null) {
                    this.dataChart.ma = this.gf;
                }
                break;
            case "SubtitleLeftMargin":
                if (this.dataChart != null) {
                    this.dataChart.ek = this.b1;
                }
                break;
            case "SubtitleTopMargin":
                if (this.dataChart != null) {
                    this.dataChart.em = this.b3;
                }
                break;
            case "SubtitleRightMargin":
                if (this.dataChart != null) {
                    this.dataChart.el = this.b2;
                }
                break;
            case "SubtitleBottomMargin":
                if (this.dataChart != null) {
                    this.dataChart.ej = this.b0;
                }
                break;
            case "SubtitleTextColor":
                if (this.dataChart != null) {
                    this.dataChart.l9 = this.ge;
                }
                break;
            case "LeftMargin":
                if (this.dataChart != null) {
                    this.dataChart.eg = this.bw;
                }
                break;
            case "TopMargin":
                if (this.dataChart != null) {
                    this.dataChart.er = this.b9;
                }
                break;
            case "RightMargin":
                if (this.dataChart != null) {
                    this.dataChart.ei = this.bz;
                }
                break;
            case "BottomMargin":
                if (this.dataChart != null) {
                    this.dataChart.ec = this.bv;
                }
                break;
            case "TransitionDuration":
                this.eq((d) => d.fc = this.ci);
                break;
            case "TransitionEasingFunction":
                this.eq((d) => d.bu = this.ao);
                break;
        }
    }
    get tooltipTemplate() {
        return ArrayExtension.getModulus$1(Base.$, this.tooltipTemplates, 0);
    }
    set tooltipTemplate(a) {
        this.tooltipTemplates = a == null ? null : new List$1(Base.$, 1, [a]);
    }
    get tooltipTemplates() {
        return this.a6;
    }
    set tooltipTemplates(a) {
        let b = this.tooltipTemplates;
        if (a != b) {
            this.a6 = a;
            this.fj("TooltipTemplates", b, this.tooltipTemplates);
        }
    }
    get bx() {
        return this.bh;
    }
    set bx(a) {
        let b = this.bh;
        if (a != b) {
            this.bh = a;
            this.fj("PixelScalingRatio", b, this.bx);
        }
    }
    get toolTip() {
        return this.ck;
    }
    set toolTip(a) {
        let b = this.toolTip;
        if (b != a) {
            this.ck = a;
            this.fj("ToolTip", b, this.toolTip);
        }
    }
    get b6() {
        return this.bq;
    }
    set b6(a) {
        let b = this.b6;
        if (a != b) {
            this.bq = a;
            this.fj("TitleLeftMargin", b, this.b6);
        }
    }
    get b7() {
        return this.br;
    }
    set b7(a) {
        let b = this.b7;
        if (a != b) {
            this.br = a;
            this.fj("TitleRightMargin", b, this.b7);
        }
    }
    get b8() {
        return this.bs;
    }
    set b8(a) {
        let b = this.b8;
        if (a != b) {
            this.bs = a;
            this.fj("TitleTopMargin", b, this.b8);
        }
    }
    get b5() {
        return this.bp;
    }
    set b5(a) {
        let b = this.b5;
        if (a != b) {
            this.bp = a;
            this.fj("TitleBottomMargin", b, this.b5);
        }
    }
    get b1() {
        return this.bl;
    }
    set b1(a) {
        let b = this.b1;
        if (a != b) {
            this.bl = a;
            this.fj("SubtitleLeftMargin", b, this.b1);
        }
    }
    get b3() {
        return this.bn;
    }
    set b3(a) {
        let b = this.b3;
        if (a != b) {
            this.bn = a;
            this.fj("SubtitleTopMargin", b, this.b3);
        }
    }
    get b2() {
        return this.bm;
    }
    set b2(a) {
        let b = this.b2;
        if (a != b) {
            this.bm = a;
            this.fj("SubtitleRightMargin", b, this.b2);
        }
    }
    get b0() {
        return this.bk;
    }
    set b0(a) {
        let b = this.b0;
        if (a != b) {
            this.bk = a;
            this.fj("SubtitleBottomMargin", b, this.b0);
        }
    }
    get ge() {
        return this.f8;
    }
    set ge(a) {
        let b = this.ge;
        if (a != b) {
            this.f8 = a;
            this.fj("SubtitleTextColor", b, this.ge);
        }
    }
    get gf() {
        return this.f9;
    }
    set gf(a) {
        let b = this.gf;
        if (a != b) {
            this.f9 = a;
            this.fj("TitleTextColor", b, this.gf);
        }
    }
    get_bw() {
        return this.bg;
    }
    set_bw(a) {
        let b = this.bw;
        if (a != b) {
            this.bg = a;
            this.fj("LeftMargin", b, this.bw);
        }
    }
    get bw() {
        return this.get_bw();
    }
    set bw(a) {
        this.set_bw(a);
    }
    get b9() {
        return this.bt;
    }
    set b9(a) {
        let b = this.b9;
        if (a != b) {
            this.bt = a;
            this.fj("TopMargin", b, this.b9);
        }
    }
    get bz() {
        return this.bj;
    }
    set bz(a) {
        let b = this.bz;
        if (a != b) {
            this.bj = a;
            this.fj("RightMargin", b, this.bz);
        }
    }
    get bv() {
        return this.bf;
    }
    set bv(a) {
        let b = this.bv;
        if (a != b) {
            this.bf = a;
            this.fj("BottomMargin", b, this.bv);
        }
    }
    get ci() {
        return this.cf;
    }
    set ci(a) {
        let b = this.ci;
        if (a != b) {
            this.cf = a;
            this.fj("TransitionDuration", b, this.ci);
        }
    }
    get ao() {
        return this.an;
    }
    set ao(a) {
        let b = this.ao;
        if (a != b) {
            this.an = a;
            this.fj("TransitionEasingFunction", b, this.ao);
        }
    }
    ey(a) {
        if (this.dataChart == null) {
            return;
        }
        a.gt = this.d4;
        a.gh = this.dt;
    }
    e4(a, b) {
        this.e5(a, b);
    }
    ev() {
    }
    e5(a, b) {
        if (a == null) {
            return;
        }
        let toolTipTemplate_ = ArrayExtension.getModulus$1(Base.$, this.tooltipTemplates, b);
        if (toolTipTemplate_ == null) {
            a.da = true;
        }
        else {
            let series_ = a;
            a.da = false;
            series_.externalObject.tooltipTemplate = toolTipTemplate_;
        }
    }
    f3(a, b, c) {
    }
    co(a) {
        return a;
        return null;
    }
    cc(a) {
        return null;
    }
    fl(a, b, c) {
        switch (a) {
            case "SubtitleTextStyle":
                if (this.dataChart != null) {
                    this.dataChart.gh = this.dt;
                }
                break;
            case "TitleTextStyle":
                if (this.dataChart != null) {
                    this.dataChart.gt = this.d4;
                }
                break;
            case "TooltipTemplate":
                if (this.a4) {
                    return;
                }
                this.a4 = true;
                this.tooltipTemplate = this.co(this.tooltipTemplate);
                this.a4 = false;
                if (this.dataChart != null) {
                    this.dataChart.e5 = this.tooltipTemplate;
                }
                this.toolTip = this.tooltipTemplate;
                break;
            case "ToolTip":
                this.er((d, e) => this.e5(d, e));
                break;
            case "TooltipTemplates":
                if (this.tooltipTemplates == null) {
                    break;
                }
                this.a4 = true;
                this.er((d, e) => {
                    let f = this.co(ArrayExtension.getModulus$1(Base.$, this.tooltipTemplates, e));
                    let series_ = d;
                    let templ_ = f;
                    series_.externalObject.tooltipTemplate = templ_;
                });
                this.a4 = false;
                break;
        }
    }
    get ab() {
        return this.aa;
    }
    set ab(a) {
        let b = this.ab;
        if (a != b) {
            this.aa = a;
            this.fj("Widget", b, this.ab);
        }
    }
    get dt() {
        return this.cv;
    }
    set dt(a) {
        let b = this.dt;
        if (a != b) {
            this.cv = a;
            this.fj("SubtitleTextStyle", b, this.dt);
        }
    }
    get d4() {
        return this.cx;
    }
    set d4(a) {
        let b = this.d4;
        if (a != b) {
            this.cx = a;
            this.fj("TitleTextStyle", b, this.d4);
        }
    }
    get dataChart() {
        return this.al;
    }
    set dataChart(a) {
        let b = this.dataChart;
        if (b != a) {
            this.al = a;
            this.fj("DataChart", b, this.dataChart);
        }
    }
    ez() {
        this.a8 = new List$1(MarkerType_$type, 0);
        this.s = new DataSeriesAdapter().e;
        if (this.d != null) {
            this.s.includedProperties = this.d;
        }
        if (this.c != null) {
            this.s.excludedProperties = this.c;
        }
        this.s.supportedSeriesTypes = this.ba.toArray();
        this.s.rules.clear();
        for (let a of fromEnum(this.a9)) {
            this.s.rules.add(a);
        }
        let b = new List$1(String_$type, 0);
        for (let c of fromEnum(this.s.rules)) {
            b.add(getInstanceType(c).typeName);
        }
        let d = this.s.dataSeries;
        d.collectionChanged = delegateCombine(d.collectionChanged, runOn(this, this.fh));
    }
    a0(a) {
        return a != 24 && this.ba.contains(a);
    }
    notifyResized() {
        this.fe((a) => a.notifyContainerResized());
    }
    fd() {
        this.fe((a) => {
            for (let b = 0; b < a.series.count; b++) {
                a.series._inner[b].ia();
            }
        });
    }
    ep() {
        if (this.dataChart == null) {
            return;
        }
        if (this.az) {
            this.fz();
        }
        this.dataChart.flush();
    }
    es() {
        if (this.dataChart == null) {
            return;
        }
        this.dataChart.hk();
    }
    fo(a) {
        if (this.propertyChanged != null) {
            this.propertyChanged(this, new PropertyChangedEventArgs(a));
        }
    }
    eq(a) {
        this.er((b, c) => a(b));
    }
    er(a) {
        if (this.dataChart == null) {
            return;
        }
        for (let b = 0; b < this.dataChart.series.count; b++) {
            a(this.dataChart.series._inner[b], b);
        }
    }
    fe(a) {
        this.ff(a, true);
    }
    ff(a, b) {
        this.fg(a, b, null);
    }
    fg(a, b, c) {
        if (this.dataChart == null) {
            return;
        }
        a(this.dataChart);
    }
    a1(a) {
        if (!this.a0(a.suggestedSeries)) {
            return false;
        }
        let b = a.data;
        if (b == null) {
            return false;
        }
        return true;
    }
    ax() {
        if (this.dataChart == null) {
            return false;
        }
        return true;
    }
    c5(a) {
        let b = "series_" + (this.dataChart.series.count + 1) + "_" + EnumUtil.getName(DataSeriesType_$type, a.suggestedSeries);
        return b;
    }
    c6(a, b) {
        if (stringIsNullOrEmpty(a.title)) {
            let c = EnumUtil.getName(DataSeriesType_$type, b);
            return c + (this.dataChart.series.count + 1);
        }
        else {
            return a.title;
        }
    }
    c4() {
        return stringEmpty();
    }
    fz() {
        if (this.dataChart == null) {
            return;
        }
        this.az = false;
        this.f1();
        if (this.itemsSource == null) {
            return;
        }
        let a = new List$1(MarkerType_$type, 0);
        for (let b of fromEnum(this.s.dataSeries)) {
            a.add(this.ac(b.suggestedMarker));
        }
        this.a8 = a;
        let c = 0;
        for (let d of fromEnum(this.s.dataSeries)) {
            if (!this.a1(d)) {
                continue;
            }
            if (d.index < 0) {
                d.index = c;
            }
            this.fx(d);
            this.fy(d);
            c++;
        }
        this.er(runOn(this, this.e2));
    }
    f1() {
        this.f0();
        if (this.dataChart.series.count == 0) {
            return;
        }
        this.eq(runOn(this, this.fv));
        for (let a of fromEnum(this.dataChart.series)) {
            a.itemsSource = null;
            a.ay = null;
            this.f2(a);
        }
        this.dataChart.series.clear();
    }
    f2(a) {
        a.itemsSource = null;
        a.ay = null;
    }
    fh(a, b) {
        if (this.dataChart == null) {
            return;
        }
        let c = b.oldItems == null ? "null" : b.oldItems.count.toString();
        let d = b.newItems == null ? "null" : b.newItems.count.toString();
        if (this.az) {
            return;
        }
        let e = this.fn(runOn(this, this.fz), this.az);
        this.az = e.p1;
    }
    ga(a) {
        return ArrayExtension.getModulus$1(Brush.$, this.j, a);
    }
    gd(a) {
        return ArrayExtension.getModulus$1(Brush.$, this.n, a);
    }
    gb(a) {
        return ArrayExtension.getModulus$1(Brush.$, this.l, a);
    }
    gc(a) {
        return ArrayExtension.getModulus$1(Brush.$, this.m, a);
    }
    gg(a) {
        let b = new Color();
        if (this.j == null || this.j.count == 0) {
            b = ArrayExtension.getModulus$1(Color.$, this.a7, a);
        }
        else {
            let c = ArrayExtension.getModulus$1(Brush.$, this.j, a);
            if (c == null) {
                b = ArrayExtension.getModulus$1(Color.$, this.a7, a);
            }
            else {
                b = ColorUtil.j(c);
            }
        }
        return b;
    }
    be(a) {
        let b = new ObservableCollection$1(Color.$, 0);
        b.add(ColorUtil.o(a, 0.5));
        b.add(a);
        return b;
    }
    k(a) {
        let b = this.be(a);
        let c = BrushCollectionUtil.a(b);
        return c;
    }
    get a7() {
        if (this.a5 != null) {
            return this.a5;
        }
        this.a5 = new List$1(Color.$, 0);
        this.a5.add(ColorUtil.k("#FF7446B9"));
        this.a5.add(ColorUtil.k("#FF9FB328"));
        this.a5.add(ColorUtil.k("#FFF96232"));
        this.a5.add(ColorUtil.k("#FF2E9CA6"));
        this.a5.add(ColorUtil.k("#FFDC3F76"));
        this.a5.add(ColorUtil.k("#FFFF9800"));
        this.a5.add(ColorUtil.k("#FF3F51B5"));
        this.a5.add(ColorUtil.k("#FF439C47"));
        this.a5.add(ColorUtil.k("#FF795548"));
        this.a5.add(ColorUtil.k("#FF494747"));
        return this.a5;
    }
    cn() {
        if (this.dataChart == null) {
            return null;
        }
        return this.dataChart.n8();
    }
    e6(a, b) {
    }
    e7(a, b, c) {
    }
    ac(a) {
        if (a == 2) {
            return 3;
        }
        else if (a == 6) {
            return 7;
        }
        else if (a == 8) {
            return 9;
        }
        else if (a == 11) {
            return 12;
        }
        else if (a == 1) {
            return 1;
        }
        else if (a == 7) {
            return 8;
        }
        else if (a == 10) {
            return 11;
        }
        else if (a == 4) {
            return 5;
        }
        else if (a == 5) {
            return 6;
        }
        else if (a == 9) {
            return 10;
        }
        else if (a == 3) {
            return 4;
        }
        return 2;
    }
    fc(source_, a, b, c) {
        if (this.s != null) {
            this.s.notifySetItem(source_, a, b, c);
        }
        if (this.dataChart != null) {
            this.dataChart.hw(source_, a, b, c);
        }
    }
    e8(source_) {
        if (this.s != null) {
            this.s.notifyClearItems(source_);
        }
        if (this.dataChart != null) {
            this.dataChart.hr(source_);
        }
    }
    e9(source_, a, b) {
        if (this.s != null) {
            this.s.notifyInsertItem(source_, a, b);
        }
        if (this.dataChart != null) {
            this.dataChart.hu(source_, a, b);
        }
    }
    fa(source_, a, b) {
        if (this.s != null) {
            this.s.notifyRemoveItem(source_, a, b);
        }
        if (this.dataChart != null) {
            this.dataChart.hv(source_, a, b);
        }
    }
    fp(a) {
        if (this.seriesAdded != null && a != null) {
            this.seriesAdded(this, new ChartSeriesEventArgs(a));
        }
    }
    fv(a) {
        if (this.seriesRemoved != null && a != null) {
            this.seriesRemoved(this, new ChartSeriesEventArgs(a));
        }
    }
    fr(a, b) {
        if (this.seriesPointerEnter != null && a != null) {
            this.seriesPointerEnter(this, new DomainChartSeriesPointerEventArgs(a, b));
        }
    }
    fs(a, b) {
        if (this.seriesPointerLeave != null && a != null) {
            this.seriesPointerLeave(this, new DomainChartSeriesPointerEventArgs(a, b));
        }
    }
    ft(a, b) {
        if (this.seriesPointerMove != null && a != null) {
            this.seriesPointerMove(this, new DomainChartSeriesPointerEventArgs(a, b));
        }
    }
    fq(a, b) {
        if (this.seriesPointerDown != null && a != null) {
            this.seriesPointerDown(this, new DomainChartSeriesPointerEventArgs(a, b));
        }
    }
    fu(a, b) {
        if (this.seriesPointerUp != null && a != null) {
            this.seriesPointerUp(this, new DomainChartSeriesPointerEventArgs(a, b));
        }
    }
    fn(a, b) {
        if (!b) {
            b = true;
            if (this.cm != null) {
                this.cm.setTimeout(a, 0);
            }
            else {
                window.setTimeout(a, 0);
            }
        }
        return {
            p1: b
        };
    }
    get_a2() {
        return true;
    }
    get a2() {
        return this.get_a2();
    }
    ew(a) {
        let b = a == this.dataChart;
        if (b) {
            a.m3 = this.j;
        }
        if (b) {
            a.m6 = this.n;
        }
        a.m4 = this.l;
        a.m5 = this.m;
        a.ay = this.legend;
        a.nl = this.ay;
        a.nn = this.a3 && this.a2;
        a.seriesMouseEnter = delegateCombine(a.seriesMouseEnter, (c, d) => this.fr(d.series, d.item));
        a.seriesMouseLeave = delegateCombine(a.seriesMouseLeave, (c, d) => this.fs(d.series, d.item));
        a.seriesMouseMove = delegateCombine(a.seriesMouseMove, (c, d) => this.ft(d.series, d.item));
        a.seriesMouseLeftButtonDown = delegateCombine(a.seriesMouseLeftButtonDown, (c, d) => this.fq(d.series, d.item));
        a.seriesMouseLeftButtonUp = delegateCombine(a.seriesMouseLeftButtonUp, (c, d) => this.fu(d.series, d.item));
        if (b) {
            a.my = this.gj;
        }
        if (b) {
            a.gm = this.dx;
        }
        a.lt = this.f7;
        if (b) {
            a.ga = this.dl;
        }
        a.ls = this.f6;
        a.nh = this.au;
        a.ca = this.av;
        a.eg = this.bw;
        a.ei = this.bz;
        a.er = this.b9;
        a.ec = this.bv;
        if (a == this.dataChart) {
            this.fz();
        }
        this.ex(a);
        this.ey(a);
    }
    e2(a, b) {
        if (!isNaN_(this.by)) {
            a.eo = this.by;
        }
        a.es = this.b4;
        a.ay = this.legend;
        if (typeCast(IUnknownValuePlotting_$type, a) !== null) {
            a.unknownValuePlotting = this.ak;
        }
        this.ek(a, b);
        this.el(a, b);
        this.e3(a, b);
        this.e4(a, b);
        this.fp(a);
    }
    get aw() {
        return this.ar;
    }
    eo() {
        if (!this.ar) {
            this.ar = true;
            this.et();
        }
    }
    et() {
        this.eu();
        this.ev();
    }
    el(a, b) {
        let c = typeCast(ITrendLineSeries_$type, a);
        if (c != null) {
            c.trendLineBrush = ArrayExtension.getModulus$1(Brush.$, this.o, b);
            c.trendLineThickness = this.ca;
            c.trendLineType = this.ai;
            c.trendLinePeriod = this.cj;
        }
    }
    ad(a, b) {
        if (this.af == null || this.af.count == 0) {
            if (this.a8 == null || this.a8.count == 0) {
                return a != null && a.cx ? 1 : 2;
            }
            let c = ArrayExtension.getModulus$1(MarkerType_$type, this.a8, b);
            return c == 2 && a != null && a.cx ? 1 : c;
        }
        return ArrayExtension.getModulus$1(MarkerType_$type, this.af, b);
    }
    fj(a, b, c) {
        if (this.propertyChanged != null) {
            this.propertyChanged(this, new PropertyChangedEventArgs(a));
        }
        switch (a) {
            case "DataChart":
                this.fw(typeCast(XamDataChart.$, b));
                this.ew(typeCast(XamDataChart.$, c));
                break;
            case "ItemsSource":
                this.s.itemsSource = this.itemsSource;
                break;
            case "IncludedProperties":
                this.s.includedProperties = this.d;
                break;
            case "ExcludedProperties":
                this.s.excludedProperties = this.c;
                break;
            case "Brushes":
                this.fg((d) => d.m3 = this.j, true, a);
                break;
            case "Outlines":
                this.fg((d) => d.m6 = this.n, true, a);
                break;
            case "Legend":
                this.fe((d) => d.ay = this.legend);
                break;
            case "IsHorizontalZoomEnabled":
                this.fe((d) => d.nl = this.ay);
                break;
            case "IsVerticalZoomEnabled":
                this.fe((d) => d.nn = this.a3);
                break;
            case "WindowRect":
                this.ff((d) => d.my = this.gj, false);
                break;
            case "Title":
                this.ff((d) => d.gm = this.dx, false);
                break;
            case "Subtitle":
                this.ff((d) => d.ga = this.dl, false);
                break;
            case "TitleAlignment":
                this.fe((d) => d.lt = this.f7);
                break;
            case "SubtitleAlignment":
                this.fe((d) => d.ls = this.f6);
                break;
            case "UnknownValuePlotting":
                this.eq((d) => {
                    if (typeCast(IUnknownValuePlotting_$type, d) !== null) {
                        d.unknownValuePlotting = this.ak;
                    }
                });
                break;
            case "Thickness":
                this.eq((d) => d.es = this.b4);
                break;
            case "Resolution":
                if (!isNaN_(this.by)) {
                    this.eq((d) => d.eo = this.by);
                }
                break;
            case "TrendLineBrushes":
            case "TrendLineType":
            case "TrendLineThickness":
            case "TrendLinePeriod":
                this.er((d, e) => this.el(d, e));
                break;
            case "MarkerMaxCount":
                this.er((d, e) => this.ek(d, e));
                break;
            case "MarkerTypes":
                let d = typeCast(ObservableCollection$1.$.specialize(MarkerType_$type), b);
                if (d != null) {
                    d.collectionChanged = delegateRemove(d.collectionChanged, runOn(this, this.fi));
                }
                let e = typeCast(ObservableCollection$1.$.specialize(MarkerType_$type), c);
                if (e != null) {
                    e.collectionChanged = delegateCombine(e.collectionChanged, runOn(this, this.fi));
                }
                this.er((f, g) => this.ek(f, g));
                break;
            case "MarkerBrushes":
                this.fe((f) => f.m4 = this.l);
                break;
            case "MarkerOutlines":
                this.fe((f) => f.m5 = this.m);
                break;
            case "AlignsGridLinesToPixels":
                this.fe((f) => f.nh = this.au);
                break;
            case "AnimateSeriesWhenAxisRangeChanges":
                this.fe((f) => f.ca = this.av);
                break;
        }
        this.fk(a, b, c);
        this.fl(a, b, c);
    }
    fi(a, b) {
        this.er((c, d) => this.ek(c, d));
    }
    get itemsSource() {
        return this.bc;
    }
    set itemsSource(a) {
        let b = this.itemsSource;
        if (b != a) {
            this.bc = a;
            this.fj("ItemsSource", b, this.itemsSource);
        }
    }
    get d() {
        return this.b;
    }
    set d(a) {
        let b = this.b;
        this.b = a;
        if (b != this.b) {
            this.fj("IncludedProperties", b, this.b);
        }
    }
    get c() {
        return this.a;
    }
    set c(a) {
        let b = this.a;
        this.a = a;
        if (b != this.a) {
            this.fj("ExcludedProperties", b, this.a);
        }
    }
    get j() {
        return this.e;
    }
    set j(a) {
        let b = this.j;
        if (a != b) {
            this.e = a;
            this.fj("Brushes", b, this.j);
        }
    }
    get n() {
        return this.h;
    }
    set n(a) {
        let b = this.n;
        if (a != b) {
            this.h = a;
            this.fj("Outlines", b, this.n);
        }
    }
    get legend() {
        return this.y;
    }
    set legend(a) {
        let b = this.legend;
        if (a != b) {
            this.y = a;
            this.fj("Legend", b, this.legend);
        }
    }
    get_ay() {
        return this.as;
    }
    set_ay(a) {
        let b = this.ay;
        if (a != b) {
            this.as = a;
            this.fj("IsHorizontalZoomEnabled", b, this.ay);
        }
    }
    get ay() {
        return this.get_ay();
    }
    set ay(a) {
        this.set_ay(a);
    }
    get_a3() {
        return this.at;
    }
    set_a3(a) {
        let b = this.a3;
        if (a != b) {
            this.at = a;
            this.fj("IsVerticalZoomEnabled", b, this.a3);
        }
    }
    get a3() {
        return this.get_a3();
    }
    set a3(a) {
        this.set_a3(a);
    }
    get gj() {
        return this.gh;
    }
    set gj(a) {
        let b = this.gj;
        if (Rect.l_op_Inequality(a, b)) {
            this.gh = a;
            this.fj("WindowRect", b, this.gj);
        }
    }
    get gi() {
        return this.dataChart != null ? this.dataChart.mx : Rect.empty;
    }
    get dx() {
        return this.cw;
    }
    set dx(a) {
        let b = this.dx;
        if (a != b) {
            this.cw = a;
            this.fj("Title", b, this.dx);
        }
    }
    get dl() {
        return this.cu;
    }
    set dl(a) {
        let b = this.dl;
        if (a != b) {
            this.cu = a;
            this.fj("Subtitle", b, this.dl);
        }
    }
    get f7() {
        return this.f5;
    }
    set f7(a) {
        let b = this.f7;
        if (b != a) {
            this.f5 = a;
            this.fj("TitleAlignment", enumGetBox(HorizontalAlignment_$type, b), enumGetBox(HorizontalAlignment_$type, this.f7));
        }
    }
    get f6() {
        return this.f4;
    }
    set f6(a) {
        let b = this.f6;
        if (b != a) {
            this.f4 = a;
            this.fj("SubtitleAlignment", enumGetBox(HorizontalAlignment_$type, b), enumGetBox(HorizontalAlignment_$type, this.f6));
        }
    }
    get ak() {
        return this.aj;
    }
    set ak(a) {
        let b = this.ak;
        if (a != b) {
            this.aj = a;
            this.fj("UnknownValuePlotting", enumGetBox(UnknownValuePlotting_$type, b), enumGetBox(UnknownValuePlotting_$type, this.ak));
        }
    }
    get_by() {
        return this.bi;
    }
    set_by(a) {
        let b = this.by;
        if (a != b) {
            this.bi = a;
            this.fj("Resolution", b, this.by);
        }
    }
    get by() {
        return this.get_by();
    }
    set by(a) {
        this.set_by(a);
    }
    get b4() {
        return this.bo;
    }
    set b4(a) {
        let b = this.b4;
        if (a != b) {
            this.bo = a;
            this.fj("Thickness", b, this.b4);
        }
    }
    get af() {
        return this.ae;
    }
    set af(a) {
        let b = this.af;
        if (a != b) {
            this.ae = a;
            this.fj("MarkerTypes", b, this.af);
        }
    }
    get l() {
        return this.f;
    }
    set l(a) {
        let b = this.l;
        if (a != b) {
            this.f = a;
            this.fj("MarkerBrushes", b, this.l);
        }
    }
    get m() {
        return this.g;
    }
    set m(a) {
        let b = this.m;
        if (!Base.equalsStatic(a, b)) {
            this.g = a;
            this.fj("MarkerOutlines", b, this.m);
        }
    }
    get ch() {
        return this.cd;
    }
    set ch(a) {
        let b = this.cd;
        if (a != b) {
            this.cd = a;
            this.fj("MarkerMaxCount", b, this.cd);
        }
    }
    get av() {
        return this.aq;
    }
    set av(a) {
        let b = this.aq;
        if (a != b) {
            this.aq = a;
            this.fj("AnimateSeriesWhenAxisRangeChanges", b, this.aq);
        }
    }
    get o() {
        return this.i;
    }
    set o(a) {
        let b = this.o;
        if (a != b) {
            this.i = a;
            this.fj("TrendLineBrushes", b, this.o);
        }
    }
    get ai() {
        return this.ah;
    }
    set ai(a) {
        let b = this.ai;
        if (a != b) {
            this.ah = a;
            this.fj("TrendLineType", enumGetBox(TrendLineType_$type, b), enumGetBox(TrendLineType_$type, this.ai));
        }
    }
    get ca() {
        return this.bu;
    }
    set ca(a) {
        let b = this.ca;
        if (a != b) {
            this.bu = a;
            this.fj("TrendLineThickness", b, this.ca);
        }
    }
    get au() {
        return this.ap;
    }
    set au(a) {
        let b = this.au;
        if (a != b) {
            this.ap = a;
            this.fj("AlignsGridLinesToPixels", b, this.au);
        }
    }
    get cj() {
        return this.cg;
    }
    set cj(a) {
        let b = this.cj;
        if (a != b) {
            this.cg = a;
            this.fj("TrendLinePeriod", b, this.cj);
        }
    }
}
DomainChart.ct = new Random(0);
DomainChart.$t = markType(DomainChart, 'DomainChart', Base.$, [INotifyPropertyChanged_$type]);
/*<BeginStatics Name="Infragistics.Controls.Charts.DomainChart" />*/
/*<EndStatics Name="Infragistics.Controls.Charts.DomainChart" />*/
