/*
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 { HorizontalAxisLabelPanelBase } from "./HorizontalAxisLabelPanelBase";
import { Number_$type, fromEnum, Boolean_$type, markType } from "igniteui-angular-core";
import { Size } from "igniteui-angular-core";
import { List$1 } from "igniteui-angular-core";
import { Rect } from "igniteui-angular-core";
import { HorizontalAxisLabelPanelBaseView } from "./HorizontalAxisLabelPanelBaseView";
import { TransformGroup } from "igniteui-angular-core";
import { RotateTransform } from "igniteui-angular-core";
import { TranslateTransform } from "igniteui-angular-core";
import { ViewportUtils } from "./ViewportUtils";
/**
 * @hidden
 */
var RadialAxisLabelPanel = /** @class */ (function (_super) {
    tslib_1.__extends(RadialAxisLabelPanel, _super);
    function RadialAxisLabelPanel() {
        var _this = _super !== null && _super.apply(this, arguments) || this;
        _this.dh = null;
        _this.de = 0;
        _this.dd = new List$1(Number_$type, 0);
        return _this;
    }
    RadialAxisLabelPanel.prototype.ad = function () {
        return new RadialAxisLabelPanelView(this);
    };
    RadialAxisLabelPanel.prototype.b8 = function (a) {
        _super.prototype.b8.call(this, a);
        this.da = a;
    };
    Object.defineProperty(RadialAxisLabelPanel.prototype, "dc", {
        get: function () {
            return this.ac.aw != null && (this.ac.aw.c != 5 && this.ac.aw.c != 4);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(RadialAxisLabelPanel.prototype, "db", {
        get: function () {
            return !this.dc;
        },
        enumerable: true,
        configurable: true
    });
    RadialAxisLabelPanel.prototype.cv = function () {
        return this.am && (!this.ap || this.bd() == -180);
    };
    RadialAxisLabelPanel.prototype.cw = function () {
        return !this.aq;
    };
    RadialAxisLabelPanel.prototype.bt = function (a) {
        _super.prototype.bt.call(this, a);
        if (this.de % 360 == 0 || this.dc) {
            this.da.a3();
        }
        else {
            this.da.a2(a);
        }
    };
    RadialAxisLabelPanel.prototype.bd = function () {
        var a = _super.prototype.bd.call(this);
        if (this.db) {
            a -= (this.de * 180) / Math.PI;
        }
        return a;
    };
    RadialAxisLabelPanel.prototype.cu = function () {
        return this.bd() % 360 != 0;
    };
    RadialAxisLabelPanel.prototype.ct = function () {
        if (this.dc) {
            return true;
        }
        var a = this.de * 180 / Math.PI;
        if (a < 30 || a > 330 || (a > 150 && a < 210)) {
            return true;
        }
        return false;
    };
    RadialAxisLabelPanel.prototype.cb = function (a, b) {
        var c = b * Math.PI / 180;
        var d = Math.abs(Math.sin(c));
        if (this.ac.aw != null && this.ac.aw.c == 4) {
            d = d * -1;
        }
        this.da.a4(a, b, d);
    };
    RadialAxisLabelPanel.prototype.dg = function () {
        var e_1, _a;
        var a = 1.7976931348623157E+308;
        try {
            for (var _b = tslib_1.__values(fromEnum(this.a2)), _c = _b.next(); !_c.done; _c = _b.next()) {
                var b = _c.value;
                a = Math.min(b.c, a);
            }
        }
        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; }
        }
        return a;
    };
    RadialAxisLabelPanel.prototype.df = function () {
        var e_2, _a;
        var a = -1.7976931348623157E+308;
        try {
            for (var _b = tslib_1.__values(fromEnum(this.a2)), _c = _b.next(); !_c.done; _c = _b.next()) {
                var b = _c.value;
                a = Math.max(b.c, a);
            }
        }
        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; }
        }
        return a;
    };
    RadialAxisLabelPanel.prototype.c8 = function (a, b) {
        var c;
        if (this.ac.b8) {
            c = this.dg();
        }
        else {
            c = this.df();
        }
        var d = new List$1(Number_$type, 0);
        var e = new List$1(Boolean_$type, 0);
        for (var f = 0; f < this.a2.count; f++) {
            var g = this.a2._inner[f];
            if (g.c == c && !g.a) {
                d.add(this.a2.indexOf(g));
            }
        }
        this.dd = d;
        var h = new List$1(Rect.$, 0);
        for (var i = 0; i < a.count; i++) {
            var j = a._inner[i];
            var k = this.a2._inner[i].a;
            if (!this.dd.contains(i)) {
                h.add(j);
                e.add(k);
            }
        }
        this.am = this.al(h, e);
    };
    RadialAxisLabelPanel.prototype.ao = function (a, b) {
        if (this.dd.contains(a)) {
            return false;
        }
        else {
            return _super.prototype.ao.call(this, a, b);
        }
    };
    RadialAxisLabelPanel.prototype.c9 = function () {
        this.dd = new List$1(Number_$type, 0);
        _super.prototype.c9.call(this);
    };
    RadialAxisLabelPanel.prototype.ah = function () {
        return 5;
    };
    RadialAxisLabelPanel.prototype.as = function (a) {
        return a == 5 || a == 4 || a == 1 || a == 0;
    };
    RadialAxisLabelPanel.prototype.b0 = function () {
    };
    RadialAxisLabelPanel.$t = markType(RadialAxisLabelPanel, 'RadialAxisLabelPanel', HorizontalAxisLabelPanelBase.$);
    return RadialAxisLabelPanel;
}(HorizontalAxisLabelPanelBase));
export { RadialAxisLabelPanel };
/**
 * @hidden
 */
var RadialAxisLabelPanelView = /** @class */ (function (_super) {
    tslib_1.__extends(RadialAxisLabelPanelView, _super);
    function RadialAxisLabelPanelView(a) {
        var _this = _super.call(this, a) || this;
        _this.a1 = null;
        _this.a1 = a;
        return _this;
    }
    RadialAxisLabelPanelView.prototype.a4 = function (a, b, c) {
        var d = this.m(a);
        var e = this.l(a);
        var f = new TransformGroup();
        f.j.add(((function () {
            var $ret = new RotateTransform();
            $ret.j = b;
            $ret.k = d / 2;
            $ret.l = e / 2;
            return $ret;
        })()));
        f.j.add(((function () {
            var $ret = new TranslateTransform();
            $ret.j = d / -2;
            $ret.k = d / 2 * c;
            return $ret;
        })()));
        a.j = f;
    };
    RadialAxisLabelPanelView.prototype.a3 = function () {
        this.a.j = null;
    };
    RadialAxisLabelPanelView.prototype.a2 = function (a) {
        var _this = this;
        var b = ViewportUtils.f(0.5, this.a.cp, this.a.co);
        this.a.j = ((function () {
            var $ret = new RotateTransform();
            $ret.j = (_this.a1.de * 180) / Math.PI;
            $ret.k = _this.a1.dh.x;
            $ret.l = (_this.a1.dh.y * a.height) + b;
            return $ret;
        })());
    };
    RadialAxisLabelPanelView.prototype.al = function () {
        _super.prototype.al.call(this);
        this.a.cq(new Size(1, this.a.cn.width, this.a.cn.height));
    };
    RadialAxisLabelPanelView.$t = markType(RadialAxisLabelPanelView, 'RadialAxisLabelPanelView', HorizontalAxisLabelPanelBaseView.$);
    return RadialAxisLabelPanelView;
}(HorizontalAxisLabelPanelBaseView));
export { RadialAxisLabelPanelView };
//# sourceMappingURL=RadialAxisLabelPanel_combined.js.map