/*
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.rt = 1000;
        _this.qt = null;
        _this.qd = 9;
        _this.qf = 1;
        _this.qx = false;
        _this.qh = 0;
        _this.qr = 0;
        _this.q6 = 0;
        _this.q7 = 0;
        _this.q5 = 0;
        _this.q8 = 0;
        _this.q9 = NaN;
        _this.qz = false;
        _this.ru = 10;
        _this.rb = NaN;
        _this.ra = NaN;
        _this.rc = 0;
        _this.p9 = null;
        _this.qa = null;
        _this.qy = true;
        _this.qv = false;
        _this.qw = false;
        _this.hf();
        return _this;
    }
    CategoryChart.prototype.hs = function () {
        _super.prototype.hs.call(this);
        if (this.dataChart == null) {
            return;
        }
        var a = this.dataChart.b8.j.e();
        this.qb = a.d;
        this.qc = a.e;
        if (this.pl == null) {
            this.pl = a.k;
        }
        if (this.ps == null) {
            this.ps = a.k;
        }
    };
    CategoryChart.prototype.hu = function (a, b) {
        _super.prototype.hu.call(this, a, b);
        a.gk = this.rv;
        a.b9 = this.qu;
    };
    CategoryChart.prototype.ie = function (a, b, c) {
        var _this = this;
        _super.prototype.ie.call(this, a, b, c);
        switch (a) {
            case "TransitionInDuration":
                this.sk(function (d) { return d.gk = _this.rv; });
                break;
            case "TransitionInEasingFunction":
                this.sk(function (d) { return d.b9 = _this.qu; });
                break;
        }
    };
    Object.defineProperty(CategoryChart.prototype, "rv", {
        get: function () {
            return this.rt;
        },
        set: function (a) {
            var b = this.rv;
            if (a != b) {
                this.rt = a;
                this.id("TransitionInDuration", b, this.rv);
            }
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(CategoryChart.prototype, "qu", {
        get: function () {
            return this.qt;
        },
        set: function (a) {
            var b = this.qu;
            if (a != b) {
                this.qt = a;
                this.id("TransitionInEasingFunction", b, this.qu);
            }
        },
        enumerable: true,
        configurable: true
    });
    CategoryChart.prototype.ry = function () {
        var cvd_ = this.ee();
        cvd_.scaleByViewport();
        return (cvd_.serialize());
    };
    CategoryChart.prototype.hn = function (a) {
        _super.prototype.hn.call(this, a);
        a.c3 = this.bv;
    };
    CategoryChart.prototype.ht = function (a, b) {
        _super.prototype.ht.call(this, a, b);
        var c = typeCast(HorizontalAnchoredCategorySeries.$, a);
        if (c == null) {
            return;
        }
        c.ro = this.qg;
        c.ql = this.q2;
        c.p5 = this.qi;
        c.b3 = this.qs;
        c.trendLineBrush = ArrayExtension.getModulus$1(Brush.$, this.o, b);
        c.trendLineType = this.a9;
        c.trendLineThickness = this.d1;
        c.oi = this.aq(a, b);
        if (a.de) {
            a.k8(ArrayExtension.getModulus$1(Brush.$, this.qb, b), ArrayExtension.getModulus$1(Brush.$, this.qc, b));
        }
    };
    CategoryChart.prototype.qj = function () {
        return new CategoryXAxis();
    };
    CategoryChart.prototype.qn = function () {
        return new NumericYAxis();
    };
    CategoryChart.prototype.hc = function () {
        this.xAxis = this.qj();
        this.xAxis.name = "xAxis";
        var a = this.xAxis;
        a.propertyChanged = delegateCombine(a.propertyChanged, runOn(this, this.sm));
        this.yAxis = this.qn();
        this.yAxis.name = "yAxis";
        var b = this.yAxis;
        b.propertyChanged = delegateCombine(b.propertyChanged, runOn(this, this.sn));
        if (this.xAxis.ay == null) {
            this.xAxis.ay = new AxisLabelSettings();
        }
        if (this.yAxis.ay == null) {
            this.yAxis.ay = new AxisLabelSettings();
        }
    };
    CategoryChart.prototype.or = function (a) {
        _super.prototype.or.call(this, a);
        a.jx = this.q3;
    };
    Object.defineProperty(CategoryChart.prototype, "qe", {
        get: function () {
            return this.qd;
        },
        set: function (a) {
            if (a != this.qd) {
                var b = this.qe;
                this.qd = a;
                this.id("ChartType", enumGetBox(CategoryChartType_$type, b), enumGetBox(CategoryChartType_$type, this.qe));
            }
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(CategoryChart.prototype, "qg", {
        get: function () {
            return this.qf;
        },
        set: function (a) {
            var b = this.qg;
            if (a != b) {
                this.qf = a;
                this.id("MarkerCollisionAvoidance", enumGetBox(CategorySeriesMarkerCollisionAvoidance_$type, b), enumGetBox(CategorySeriesMarkerCollisionAvoidance_$type, this.qg));
            }
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(CategoryChart.prototype, "q2", {
        get: function () {
            return this.qx;
        },
        set: function (a) {
            var b = this.q2;
            if (a != b) {
                this.qx = a;
                this.id("IsTransitionInEnabled", b, this.q2);
            }
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(CategoryChart.prototype, "qi", {
        get: function () {
            return this.qh;
        },
        set: function (a) {
            var b = this.qi;
            if (a != b) {
                this.qh = a;
                this.id("TransitionInMode", enumGetBox(CategoryTransitionInMode_$type, b), enumGetBox(CategoryTransitionInMode_$type, this.qi));
            }
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(CategoryChart.prototype, "qs", {
        get: function () {
            return this.qr;
        },
        set: function (a) {
            var b = this.qs;
            if (a != b) {
                this.qr = a;
                this.id("TransitionInSpeedType", enumGetBox(TransitionInSpeedType_$type, b), enumGetBox(TransitionInSpeedType_$type, this.qs));
            }
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(CategoryChart.prototype, "rk", {
        get: function () {
            return this.q6;
        },
        set: function (a) {
            var b = this.rk;
            if (a != b) {
                this.q6 = a;
                this.id("XAxisInterval", b, this.rk);
            }
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(CategoryChart.prototype, "rl", {
        get: function () {
            return this.q7;
        },
        set: function (a) {
            var b = this.rl;
            if (a != b) {
                this.q7 = a;
                this.id("XAxisMinorInterval", b, this.rl);
            }
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(CategoryChart.prototype, "rj", {
        get: function () {
            return this.q5;
        },
        set: function (a) {
            var b = this.rj;
            if (a != b) {
                this.q5 = a;
                this.id("XAxisGap", b, this.rj);
            }
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(CategoryChart.prototype, "rm", {
        get: function () {
            return this.q8;
        },
        set: function (a) {
            var b = this.rm;
            if (a != b) {
                this.q8 = a;
                this.id("XAxisOverlap", b, this.rm);
            }
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(CategoryChart.prototype, "rp", {
        get: function () {
            return this.q9;
        },
        set: function (a) {
            var b = this.rp;
            if (a != b) {
                this.q9 = a;
                this.id("YAxisInterval", b, this.rp);
            }
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(CategoryChart.prototype, "q4", {
        get: function () {
            return this.qz;
        },
        set: function (a) {
            var b = this.q4;
            if (a != b) {
                this.qz = a;
                this.id("YAxisIsLogarithmic", b, this.q4);
            }
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(CategoryChart.prototype, "rw", {
        get: function () {
            return this.ru;
        },
        set: function (a) {
            var b = this.rw;
            if (a != b) {
                this.ru = a;
                this.id("YAxisLogarithmBase", b, this.rw);
            }
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(CategoryChart.prototype, "rr", {
        get: function () {
            return this.rb;
        },
        set: function (a) {
            var b = this.rr;
            if (a != b) {
                this.rb = a;
                this.id("YAxisMinimumValue", b, this.rr);
            }
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(CategoryChart.prototype, "rq", {
        get: function () {
            return this.ra;
        },
        set: function (a) {
            var b = this.rq;
            if (a != b) {
                this.ra = a;
                this.id("YAxisMaximumValue", b, this.rq);
            }
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(CategoryChart.prototype, "rs", {
        get: function () {
            return this.rc;
        },
        set: function (a) {
            var b = this.rs;
            if (a != b) {
                this.rc = a;
                this.id("YAxisMinorInterval", b, this.rs);
            }
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(CategoryChart.prototype, "ri", {
        get: function () {
            return this.xAxis.lk;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(CategoryChart.prototype, "rh", {
        get: function () {
            return this.xAxis.lj;
        },
        enumerable: true,
        configurable: true
    });
    CategoryChart.prototype.re = function () {
        return this.ri;
    };
    CategoryChart.prototype.rg = function () {
        return this.ro;
    };
    CategoryChart.prototype.rd = function () {
        return this.rh;
    };
    CategoryChart.prototype.rf = function () {
        return this.rn;
    };
    Object.defineProperty(CategoryChart.prototype, "ro", {
        get: function () {
            return this.yAxis.kd;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(CategoryChart.prototype, "rn", {
        get: function () {
            return this.yAxis.kc;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(CategoryChart.prototype, "qb", {
        get: function () {
            return this.p9;
        },
        set: function (a) {
            var b = this.qb;
            if (a != b) {
                this.p9 = a;
                this.id("NegativeBrushes", b, this.qb);
            }
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(CategoryChart.prototype, "qc", {
        get: function () {
            return this.qa;
        },
        set: function (a) {
            var b = this.qc;
            if (a != b) {
                this.qa = a;
                this.id("NegativeOutlines", b, this.qc);
            }
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(CategoryChart.prototype, "q3", {
        get: function () {
            return this.qy;
        },
        set: function (a) {
            var b = this.q3;
            if (a != b) {
                this.qy = a;
                this.id("YAxisAbbreviateLargeNumbers", b, this.q3);
            }
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(CategoryChart.prototype, "q0", {
        get: function () {
            return this.qv;
        },
        set: function (a) {
            var b = this.q0;
            if (a != b) {
                this.qv = a;
                this.id("IsCategoryHighlightingEnabled", b, this.q0);
            }
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(CategoryChart.prototype, "q1", {
        get: function () {
            return this.qw;
        },
        set: function (a) {
            var b = this.q1;
            if (a != b) {
                this.qw = a;
                this.id("IsItemHighlightingEnabled", b, this.q1);
            }
        },
        enumerable: true,
        configurable: true
    });
    CategoryChart.prototype.get_cl = 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, "cl", {
        get: function () {
            return this.get_cl();
        },
        enumerable: true,
        configurable: true
    });
    CategoryChart.prototype.sm = function (a, b) {
        switch (b.propertyName) {
            case "ActualMinimum":
                this.il("XAxisActualMinimum");
                break;
            case "ActualMaximum":
                this.il("XAxisActualMaximum");
                break;
        }
    };
    CategoryChart.prototype.sn = function (a, b) {
        switch (b.propertyName) {
            case "ActualMinimumValue":
                this.il("YAxisActualMinimum");
                break;
            case "ActualMaximumValue":
                this.il("YAxisActualMaximum");
                break;
        }
    };
    CategoryChart.prototype.ix = function () {
        _super.prototype.ix.call(this);
        this.xAxis.fa = this.l3 == null ? XYChart.md(this.xAxis, this.x.dataSeries) : this.l3;
        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.qm = function (a, b) {
        switch (a) {
            case 2: return this.az(1);
            case 3: return this.az(10);
            case 0: return this.az(0);
            case 1: return this.az(2);
            case 6: return this.az(6);
            case 7: return this.az(7);
            case 4: return this.az(4);
            case 5: return this.az(5);
            case 8: return this.az(8);
            case 9: return this.ql(b);
            default: return this.az(1);
        }
    };
    CategoryChart.prototype.ql = function (a) {
        return this.az(a);
    };
    CategoryChart.prototype.w = function (a) {
        switch (this.qe) {
            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.ay = function (a, b) {
        var c = this.qm(this.qe, a.suggestedSeries);
        c.r2 = a.findMatchingHint(0).path;
        c.xAxis = this.xAxis;
        c.yAxis = this.yAxis;
        return c;
    };
    CategoryChart.prototype.iv = function (a) {
        if (a.suggestedSecondaryAxis == 2) {
            this.yAxis.j2 = true;
            this.yAxis.kp = 10;
        }
    };
    CategoryChart.prototype.iy = function () {
        this.yAxis.j2 = this.q4;
        this.yAxis.kp = this.rw;
    };
    CategoryChart.prototype.get_ck = 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, "ck", {
        get: function () {
            return this.get_ck();
        },
        enumerable: true,
        configurable: true
    });
    CategoryChart.prototype.ha = function (a, b) {
        var c = typeCast(HorizontalAnchoredCategorySeries.$, a);
        if (c != null) {
            c.ro = this.qg;
            c.oi = this.aq(a, b);
        }
    };
    CategoryChart.prototype.sk = function (a) {
        this.sl(function (b, c) { return a(b); });
    };
    CategoryChart.prototype.sl = 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.jp = function () {
        return this.xAxis;
    };
    CategoryChart.prototype.jq = function () {
        return this.yAxis;
    };
    CategoryChart.prototype.qp = function () {
        return this.az(30);
    };
    CategoryChart.prototype.qq = function () {
        return this.az(31);
    };
    CategoryChart.prototype.ch = function (a, b) {
        var c = _super.prototype.ch.call(this, a, b);
        if (c != null) {
            var d = new List$1(Series.$, 0);
            if (this.qv) {
                d.add(this.qp());
            }
            if (this.qw) {
                d.add(this.qq());
            }
            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.i2 = function (a, b, c) {
        _super.prototype.i2.call(this, a, b, c);
        if (this.x.dataSeries.count > 0) {
            if (stringIsNullOrEmpty(this.e6)) {
                this.ae.setXMemberPath(a, c.getMemberPathFor(16));
            }
            if (stringIsNullOrEmpty(this.e8)) {
                this.ae.setYMemberPath(a, c.getMemberPathFor(0));
            }
            if (stringIsNullOrEmpty(this.e2)) {
                this.ae.setLabelMemberPath(a, c.getMemberPathFor(0));
            }
            if (stringIsNullOrEmpty(this.ez)) {
                this.ae.setContentMemberPath(a, c.getMemberPathFor(0));
            }
        }
    };
    CategoryChart.prototype.id = function (a, b, c) {
        var _this = this;
        _super.prototype.id.call(this, a, b, c);
        switch (a) {
            case "ChartType":
                this.ix();
                break;
            case "MarkerCollisionAvoidance":
                this.sk(function (d) { return d.ro = _this.qg; });
                break;
            case "IsTransitionInEnabled":
                this.sk(function (d) { return d.ql = _this.q2; });
                break;
            case "TransitionInMode":
                this.sk(function (d) { return d.p5 = _this.qi; });
                break;
            case "TransitionInSpeedType":
                this.sk(function (d) { return d.b3 = _this.qs; });
                break;
            case "XAxisInterval":
                this.xAxis.lf = this.rk;
                break;
            case "XAxisMinorInterval":
                this.xAxis.lg = this.rl;
                break;
            case "XAxisGap":
                this.xAxis.jx = this.rj;
                break;
            case "XAxisOverlap":
                this.xAxis.j4 = this.rm;
                break;
            case "YAxisInterval":
                this.yAxis.kh = this.rp;
                break;
            case "YAxisIsLogarithmic":
                this.yAxis.j2 = this.q4;
                break;
            case "YAxisLogarithmBase":
                this.yAxis.kp = this.rw;
                break;
            case "YAxisMinimumValue":
                this.yAxis.kl = this.rr;
                break;
            case "YAxisMaximumValue":
                this.yAxis.kk = this.rq;
                break;
            case "YAxisMinorInterval":
                this.yAxis.km = this.rs;
                break;
            case "NegativeBrushes":
            case "NegativeOutlines":
                this.sl(function (d, e) {
                    if (d.de) {
                        d.k8(ArrayExtension.getModulus$1(Brush.$, _this.qb, e), ArrayExtension.getModulus$1(Brush.$, _this.qc, e));
                    }
                });
                break;
            case "YAxisAbbreviateLargeNumbers":
                this.ox(function (d) { return d.jx = _this.q3; });
                break;
            case "IsCategoryHighlightingEnabled":
            case "IsItemHighlightingEnabled":
                this.ix();
                break;
        }
    };
    CategoryChart.$t = markType(CategoryChart, 'CategoryChart', XYChart.$);
    return CategoryChart;
}(XYChart));
export { CategoryChart };
//# sourceMappingURL=CategoryChart.js.map
