/*
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 * as tslib_1 from "tslib";
import { XYChart } from "./XYChart";
import { typeCast, runOn, delegateCombine, enumGetBox, markType, TypeRegistrar, getInstanceType } from "igniteui-react-core";
import { CategoryChartType_$type } from "./CategoryChartType";
import { CategorySeriesMarkerCollisionAvoidance_$type } from "./CategorySeriesMarkerCollisionAvoidance";
import { CategoryTransitionInMode_$type } from "./CategoryTransitionInMode";
import { TransitionInSpeedType_$type } from "./TransitionInSpeedType";
import { CategoryXAxis } from "./CategoryXAxis";
import { List$1 } from "igniteui-react-core";
import { DataSeriesType_$type } from "igniteui-react-core";
import { NumericYAxis } from "./NumericYAxis";
import { IDataSeriesAdapterRule_$type } from "igniteui-react-core";
import { SimpleCategorySeriesRule } from "igniteui-react-core";
import { SubCollectionsRule } from "igniteui-react-core";
import { Series } from "./Series";
import { HorizontalAnchoredCategorySeries } from "./HorizontalAnchoredCategorySeries";
import { ArrayExtension } from "igniteui-react-core";
import { Brush } from "igniteui-react-core";
import { AxisLabelSettings } from "./AxisLabelSettings";
import { stringIsNullOrEmpty } from "igniteui-react-core";
/**
 * @hidden
 */
var CategoryChart = /** @class */ /*@__PURE__*/ (function (_super) {
    tslib_1.__extends(CategoryChart, _super);
    function CategoryChart() {
        var _this = _super.call(this) || this;
        _this.qj = 1000;
        _this.pj = null;
        _this.o3 = 9;
        _this.o5 = 1;
        _this.pn = false;
        _this.o7 = 0;
        _this.ph = 0;
        _this.pw = 0;
        _this.px = 0;
        _this.pv = 0;
        _this.py = 0;
        _this.pz = NaN;
        _this.pp = false;
        _this.qk = 10;
        _this.p1 = NaN;
        _this.p0 = NaN;
        _this.p2 = 0;
        _this.oz = null;
        _this.o0 = null;
        _this.po = true;
        _this.pl = false;
        _this.pm = false;
        _this.f6();
        return _this;
    }
    CategoryChart.prototype.gj = function () {
        _super.prototype.gj.call(this);
        if (this.dataChart == null) {
            return;
        }
        var a = this.dataChart.b1.i.e();
        this.o1 = a.d;
        this.o2 = a.e;
        if (this.ob == null) {
            this.ob = a.k;
        }
        if (this.oi == null) {
            this.oi = a.k;
        }
    };
    CategoryChart.prototype.gl = function (a, b) {
        _super.prototype.gl.call(this, a, b);
        a.fj = this.ql;
        a.bv = this.pk;
    };
    CategoryChart.prototype.g4 = function (a, b, c) {
        var _this = this;
        _super.prototype.g4.call(this, a, b, c);
        switch (a) {
            case "TransitionInDuration":
                this.ra(function (d) { return d.fj = _this.ql; });
                break;
            case "TransitionInEasingFunction":
                this.ra(function (d) { return d.bv = _this.pk; });
                break;
        }
    };
    Object.defineProperty(CategoryChart.prototype, "ql", {
        get: function () {
            return this.qj;
        },
        set: function (a) {
            var b = this.ql;
            if (a != b) {
                this.qj = a;
                this.g3("TransitionInDuration", b, this.ql);
            }
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(CategoryChart.prototype, "pk", {
        get: function () {
            return this.pj;
        },
        set: function (a) {
            var b = this.pk;
            if (a != b) {
                this.pj = a;
                this.g3("TransitionInEasingFunction", b, this.pk);
            }
        },
        enumerable: true,
        configurable: true
    });
    CategoryChart.prototype.qo = function () {
        var cvd_ = this.dj();
        cvd_.scaleByViewport();
        return (cvd_.serialize());
    };
    CategoryChart.prototype.ge = function (a) {
        _super.prototype.ge.call(this, a);
        a.cw = this.bg;
    };
    CategoryChart.prototype.gk = function (a, b) {
        _super.prototype.gk.call(this, a, b);
        var c = typeCast(HorizontalAnchoredCategorySeries.$, a);
        if (c == null) {
            return;
        }
        c.pd = this.o6;
        c.ob = this.ps;
        c.nu = this.o8;
        c.bp = this.pi;
        c.trendLineBrush = ArrayExtension.getModulus$1(Brush.$, this.o, b);
        c.trendLineType = this.av;
        c.trendLineThickness = this.c6;
        c.mb = this.ai(a, b);
        if (a.cz) {
            a.jq(ArrayExtension.getModulus$1(Brush.$, this.o1, b), ArrayExtension.getModulus$1(Brush.$, this.o2, b));
        }
    };
    CategoryChart.prototype.o9 = function () {
        return new CategoryXAxis();
    };
    CategoryChart.prototype.pd = function () {
        return new NumericYAxis();
    };
    CategoryChart.prototype.f3 = function () {
        this.xAxis = this.o9();
        this.xAxis.name = "xAxis";
        var a = this.xAxis;
        a.propertyChanged = delegateCombine(a.propertyChanged, runOn(this, this.rc));
        this.yAxis = this.pd();
        this.yAxis.name = "yAxis";
        var b = this.yAxis;
        b.propertyChanged = delegateCombine(b.propertyChanged, runOn(this, this.rd));
        if (this.xAxis.ay == null) {
            this.xAxis.ay = new AxisLabelSettings();
        }
        if (this.yAxis.ay == null) {
            this.yAxis.ay = new AxisLabelSettings();
        }
    };
    CategoryChart.prototype.nh = function (a) {
        _super.prototype.nh.call(this, a);
        a.jw = this.pt;
    };
    Object.defineProperty(CategoryChart.prototype, "o4", {
        get: function () {
            return this.o3;
        },
        set: function (a) {
            if (a != this.o3) {
                var b = this.o4;
                this.o3 = a;
                this.g3("ChartType", enumGetBox(CategoryChartType_$type, b), enumGetBox(CategoryChartType_$type, this.o4));
            }
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(CategoryChart.prototype, "o6", {
        get: function () {
            return this.o5;
        },
        set: function (a) {
            var b = this.o6;
            if (a != b) {
                this.o5 = a;
                this.g3("MarkerCollisionAvoidance", enumGetBox(CategorySeriesMarkerCollisionAvoidance_$type, b), enumGetBox(CategorySeriesMarkerCollisionAvoidance_$type, this.o6));
            }
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(CategoryChart.prototype, "ps", {
        get: function () {
            return this.pn;
        },
        set: function (a) {
            var b = this.ps;
            if (a != b) {
                this.pn = a;
                this.g3("IsTransitionInEnabled", b, this.ps);
            }
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(CategoryChart.prototype, "o8", {
        get: function () {
            return this.o7;
        },
        set: function (a) {
            var b = this.o8;
            if (a != b) {
                this.o7 = a;
                this.g3("TransitionInMode", enumGetBox(CategoryTransitionInMode_$type, b), enumGetBox(CategoryTransitionInMode_$type, this.o8));
            }
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(CategoryChart.prototype, "pi", {
        get: function () {
            return this.ph;
        },
        set: function (a) {
            var b = this.pi;
            if (a != b) {
                this.ph = a;
                this.g3("TransitionInSpeedType", enumGetBox(TransitionInSpeedType_$type, b), enumGetBox(TransitionInSpeedType_$type, this.pi));
            }
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(CategoryChart.prototype, "qa", {
        get: function () {
            return this.pw;
        },
        set: function (a) {
            var b = this.qa;
            if (a != b) {
                this.pw = a;
                this.g3("XAxisInterval", b, this.qa);
            }
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(CategoryChart.prototype, "qb", {
        get: function () {
            return this.px;
        },
        set: function (a) {
            var b = this.qb;
            if (a != b) {
                this.px = a;
                this.g3("XAxisMinorInterval", b, this.qb);
            }
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(CategoryChart.prototype, "p9", {
        get: function () {
            return this.pv;
        },
        set: function (a) {
            var b = this.p9;
            if (a != b) {
                this.pv = a;
                this.g3("XAxisGap", b, this.p9);
            }
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(CategoryChart.prototype, "qc", {
        get: function () {
            return this.py;
        },
        set: function (a) {
            var b = this.qc;
            if (a != b) {
                this.py = a;
                this.g3("XAxisOverlap", b, this.qc);
            }
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(CategoryChart.prototype, "qf", {
        get: function () {
            return this.pz;
        },
        set: function (a) {
            var b = this.qf;
            if (a != b) {
                this.pz = a;
                this.g3("YAxisInterval", b, this.qf);
            }
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(CategoryChart.prototype, "pu", {
        get: function () {
            return this.pp;
        },
        set: function (a) {
            var b = this.pu;
            if (a != b) {
                this.pp = a;
                this.g3("YAxisIsLogarithmic", b, this.pu);
            }
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(CategoryChart.prototype, "qm", {
        get: function () {
            return this.qk;
        },
        set: function (a) {
            var b = this.qm;
            if (a != b) {
                this.qk = a;
                this.g3("YAxisLogarithmBase", b, this.qm);
            }
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(CategoryChart.prototype, "qh", {
        get: function () {
            return this.p1;
        },
        set: function (a) {
            var b = this.qh;
            if (a != b) {
                this.p1 = a;
                this.g3("YAxisMinimumValue", b, this.qh);
            }
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(CategoryChart.prototype, "qg", {
        get: function () {
            return this.p0;
        },
        set: function (a) {
            var b = this.qg;
            if (a != b) {
                this.p0 = a;
                this.g3("YAxisMaximumValue", b, this.qg);
            }
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(CategoryChart.prototype, "qi", {
        get: function () {
            return this.p2;
        },
        set: function (a) {
            var b = this.qi;
            if (a != b) {
                this.p2 = a;
                this.g3("YAxisMinorInterval", b, this.qi);
            }
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(CategoryChart.prototype, "p8", {
        get: function () {
            return this.xAxis.lj;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(CategoryChart.prototype, "p7", {
        get: function () {
            return this.xAxis.li;
        },
        enumerable: true,
        configurable: true
    });
    CategoryChart.prototype.p4 = function () {
        return this.p8;
    };
    CategoryChart.prototype.p6 = function () {
        return this.qe;
    };
    CategoryChart.prototype.p3 = function () {
        return this.p7;
    };
    CategoryChart.prototype.p5 = function () {
        return this.qd;
    };
    Object.defineProperty(CategoryChart.prototype, "qe", {
        get: function () {
            return this.yAxis.kc;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(CategoryChart.prototype, "qd", {
        get: function () {
            return this.yAxis.kb;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(CategoryChart.prototype, "o1", {
        get: function () {
            return this.oz;
        },
        set: function (a) {
            var b = this.o1;
            if (a != b) {
                this.oz = a;
                this.g3("NegativeBrushes", b, this.o1);
            }
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(CategoryChart.prototype, "o2", {
        get: function () {
            return this.o0;
        },
        set: function (a) {
            var b = this.o2;
            if (a != b) {
                this.o0 = a;
                this.g3("NegativeOutlines", b, this.o2);
            }
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(CategoryChart.prototype, "pt", {
        get: function () {
            return this.po;
        },
        set: function (a) {
            var b = this.pt;
            if (a != b) {
                this.po = a;
                this.g3("YAxisAbbreviateLargeNumbers", b, this.pt);
            }
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(CategoryChart.prototype, "pq", {
        get: function () {
            return this.pl;
        },
        set: function (a) {
            var b = this.pq;
            if (a != b) {
                this.pl = a;
                this.g3("IsCategoryHighlightingEnabled", b, this.pq);
            }
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(CategoryChart.prototype, "pr", {
        get: function () {
            return this.pm;
        },
        set: function (a) {
            var b = this.pr;
            if (a != b) {
                this.pm = a;
                this.g3("IsItemHighlightingEnabled", b, this.pr);
            }
        },
        enumerable: true,
        configurable: true
    });
    CategoryChart.prototype.get_b5 = function () {
        var a = new List$1(DataSeriesType_$type, 0);
        if (TypeRegistrar.isRegistered("AreaSeries")) {
            a.add(2);
        }
        if (TypeRegistrar.isRegistered("ColumnSeries")) {
            a.add(1);
        }
        if (TypeRegistrar.isRegistered("LineSeries")) {
            a.add(0);
        }
        if (TypeRegistrar.isRegistered("PointSeries")) {
            a.add(10);
        }
        if (TypeRegistrar.isRegistered("SplineSeries")) {
            a.add(6);
        }
        if (TypeRegistrar.isRegistered("SplineAreaSeries")) {
            a.add(7);
        }
        if (TypeRegistrar.isRegistered("StepAreaSeries")) {
            a.add(5);
        }
        if (TypeRegistrar.isRegistered("StepLineSeries")) {
            a.add(4);
        }
        if (TypeRegistrar.isRegistered("WaterfallSeries")) {
            a.add(8);
        }
        return a;
    };
    Object.defineProperty(CategoryChart.prototype, "b5", {
        get: function () {
            return this.get_b5();
        },
        enumerable: true,
        configurable: true
    });
    CategoryChart.prototype.rc = function (a, b) {
        switch (b.propertyName) {
            case "ActualMinimum":
                this.ha("XAxisActualMinimum");
                break;
            case "ActualMaximum":
                this.ha("XAxisActualMaximum");
                break;
        }
    };
    CategoryChart.prototype.rd = function (a, b) {
        switch (b.propertyName) {
            case "ActualMinimumValue":
                this.ha("YAxisActualMinimum");
                break;
            case "ActualMaximumValue":
                this.ha("YAxisActualMaximum");
                break;
        }
    };
    CategoryChart.prototype.hl = function () {
        _super.prototype.hl.call(this);
        this.xAxis.e9 = this.kt == null ? XYChart.k3(this.xAxis, this.v.dataSeries) : this.kt;
        this.xAxis.itemsSource = this.dataChart != null && this.dataChart.series.count > 0 ? this.dataChart.series._inner[0].itemsSource : null;
    };
    Object.defineProperty(CategoryChart.prototype, "xAxis", {
        get: function () {
            return this._xAxis;
        },
        set: function (a) {
            this._xAxis = a;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(CategoryChart.prototype, "yAxis", {
        get: function () {
            return this._yAxis;
        },
        set: function (a) {
            this._yAxis = a;
        },
        enumerable: true,
        configurable: true
    });
    CategoryChart.prototype.pc = function (a, b) {
        switch (a) {
            case 2: return this.ar(1);
            case 3: return this.ar(10);
            case 0: return this.ar(0);
            case 1: return this.ar(2);
            case 6: return this.ar(6);
            case 7: return this.ar(7);
            case 4: return this.ar(4);
            case 5: return this.ar(5);
            case 8: return this.ar(8);
            case 9: return this.pb(b);
            default: return this.ar(1);
        }
    };
    CategoryChart.prototype.pb = function (a) {
        return this.ar(a);
    };
    CategoryChart.prototype.u = function (a) {
        switch (this.o4) {
            case 1: return 2;
            case 0: return 0;
            case 3: return 10;
            case 6: return 6;
            case 7: return 7;
            case 5: return 5;
            case 4: return 4;
            case 8: return 8;
            case 9: return a.suggestedSeries;
            default:
            case 2: return 1;
        }
    };
    CategoryChart.prototype.aq = function (a, b) {
        var c = this.pc(this.o4, a.suggestedSeries);
        c.pq = a.findMatchingHint(0).path;
        c.xAxis = this.xAxis;
        c.yAxis = this.yAxis;
        return c;
    };
    CategoryChart.prototype.hj = function (a) {
        if (a.suggestedSecondaryAxis == 2) {
            this.yAxis.j1 = true;
            this.yAxis.ko = 10;
        }
    };
    CategoryChart.prototype.hm = function () {
        this.yAxis.j1 = this.pu;
        this.yAxis.ko = this.qm;
    };
    CategoryChart.prototype.get_b4 = function () {
        return ((function () {
            var $ret = new List$1(IDataSeriesAdapterRule_$type, 0);
            $ret.add(new SimpleCategorySeriesRule());
            $ret.add(new SubCollectionsRule());
            return $ret;
        })());
    };
    Object.defineProperty(CategoryChart.prototype, "b4", {
        get: function () {
            return this.get_b4();
        },
        enumerable: true,
        configurable: true
    });
    CategoryChart.prototype.f1 = function (a, b) {
        var c = typeCast(HorizontalAnchoredCategorySeries.$, a);
        if (c != null) {
            c.pd = this.o6;
            c.mb = this.ai(a, b);
        }
    };
    CategoryChart.prototype.ra = function (a) {
        this.rb(function (b, c) { return a(b); });
    };
    CategoryChart.prototype.rb = function (a) {
        if (this.dataChart == null) {
            return;
        }
        for (var b = 0; b < this.dataChart.series.count; b++) {
            var c = typeCast(HorizontalAnchoredCategorySeries.$, this.dataChart.series._inner[b]);
            if (c == null) {
                continue;
            }
            a(c, b);
        }
    };
    CategoryChart.prototype.id = function () {
        return this.xAxis;
    };
    CategoryChart.prototype.ie = function () {
        return this.yAxis;
    };
    CategoryChart.prototype.pf = function () {
        return this.ar(30);
    };
    CategoryChart.prototype.pg = function () {
        return this.ar(31);
    };
    CategoryChart.prototype.b1 = function (a, b) {
        var c = _super.prototype.b1.call(this, a, b);
        if (c != null) {
            var d = new List$1(Series.$, 0);
            if (this.pl) {
                d.add(this.pf());
            }
            if (this.pm) {
                d.add(this.pg());
            }
            for (var e = 0; e < d.count; e++) {
                var f = d._inner[e];
                f.name = a + getInstanceType(f).typeName;
                c.add(f);
            }
        }
        return c;
    };
    CategoryChart.prototype.hq = function (a, b, c) {
        _super.prototype.hq.call(this, a, b, c);
        if (this.v.dataSeries.count > 0) {
            if (stringIsNullOrEmpty(this.ea)) {
                this.ac.setXMemberPath(a, c.getMemberPathFor(16));
            }
            if (stringIsNullOrEmpty(this.ec)) {
                this.ac.setYMemberPath(a, c.getMemberPathFor(0));
            }
            if (stringIsNullOrEmpty(this.d6)) {
                this.ac.setLabelMemberPath(a, c.getMemberPathFor(0));
            }
            if (stringIsNullOrEmpty(this.d3)) {
                this.ac.setContentMemberPath(a, c.getMemberPathFor(0));
            }
        }
    };
    CategoryChart.prototype.g3 = function (a, b, c) {
        var _this = this;
        _super.prototype.g3.call(this, a, b, c);
        switch (a) {
            case "ChartType":
                this.hl();
                break;
            case "MarkerCollisionAvoidance":
                this.ra(function (d) { return d.pd = _this.o6; });
                break;
            case "IsTransitionInEnabled":
                this.ra(function (d) { return d.ob = _this.ps; });
                break;
            case "TransitionInMode":
                this.ra(function (d) { return d.nu = _this.o8; });
                break;
            case "TransitionInSpeedType":
                this.ra(function (d) { return d.bp = _this.pi; });
                break;
            case "XAxisInterval":
                this.xAxis.le = this.qa;
                break;
            case "XAxisMinorInterval":
                this.xAxis.lf = this.qb;
                break;
            case "XAxisGap":
                this.xAxis.jw = this.p9;
                break;
            case "XAxisOverlap":
                this.xAxis.j3 = this.qc;
                break;
            case "YAxisInterval":
                this.yAxis.kg = this.qf;
                break;
            case "YAxisIsLogarithmic":
                this.yAxis.j1 = this.pu;
                break;
            case "YAxisLogarithmBase":
                this.yAxis.ko = this.qm;
                break;
            case "YAxisMinimumValue":
                this.yAxis.kk = this.qh;
                break;
            case "YAxisMaximumValue":
                this.yAxis.kj = this.qg;
                break;
            case "YAxisMinorInterval":
                this.yAxis.kl = this.qi;
                break;
            case "NegativeBrushes":
            case "NegativeOutlines":
                this.rb(function (d, e) {
                    if (d.cz) {
                        d.jq(ArrayExtension.getModulus$1(Brush.$, _this.o1, e), ArrayExtension.getModulus$1(Brush.$, _this.o2, e));
                    }
                });
                break;
            case "YAxisAbbreviateLargeNumbers":
                this.nn(function (d) { return d.jw = _this.pt; });
                break;
            case "IsCategoryHighlightingEnabled":
            case "IsItemHighlightingEnabled":
                this.hl();
                break;
        }
    };
    CategoryChart.$t = markType(CategoryChart, 'CategoryChart', XYChart.$);
    return CategoryChart;
}(XYChart));
export { CategoryChart };
//# sourceMappingURL=CategoryChart.js.map
