/*
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 { 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
 */
export class RadialAxisLabelPanel extends HorizontalAxisLabelPanelBase {
    constructor() {
        super(...arguments);
        this.dh = null;
        this.de = 0;
        this.dd = new List$1(Number_$type, 0);
    }
    ad() {
        return new RadialAxisLabelPanelView(this);
    }
    b8(a) {
        super.b8(a);
        this.da = a;
    }
    get dc() {
        return this.ac.aw != null && (this.ac.aw.c != 5 && this.ac.aw.c != 4);
    }
    get db() {
        return !this.dc;
    }
    cv() {
        return this.am && (!this.ap || this.bd() == -180);
    }
    cw() {
        return !this.aq;
    }
    bt(a) {
        super.bt(a);
        if (this.de % 360 == 0 || this.dc) {
            this.da.a3();
        }
        else {
            this.da.a2(a);
        }
    }
    bd() {
        let a = super.bd();
        if (this.db) {
            a -= (this.de * 180) / Math.PI;
        }
        return a;
    }
    cu() {
        return this.bd() % 360 != 0;
    }
    ct() {
        if (this.dc) {
            return true;
        }
        let a = this.de * 180 / Math.PI;
        if (a < 30 || a > 330 || (a > 150 && a < 210)) {
            return true;
        }
        return false;
    }
    cb(a, b) {
        let c = b * Math.PI / 180;
        let 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);
    }
    dg() {
        let a = 1.7976931348623157E+308;
        for (let b of fromEnum(this.a2)) {
            a = Math.min(b.c, a);
        }
        return a;
    }
    df() {
        let a = -1.7976931348623157E+308;
        for (let b of fromEnum(this.a2)) {
            a = Math.max(b.c, a);
        }
        return a;
    }
    c8(a, b) {
        let c;
        if (this.ac.b8) {
            c = this.dg();
        }
        else {
            c = this.df();
        }
        let d = new List$1(Number_$type, 0);
        let e = new List$1(Boolean_$type, 0);
        for (let f = 0; f < this.a2.count; f++) {
            let g = this.a2._inner[f];
            if (g.c == c && !g.a) {
                d.add(this.a2.indexOf(g));
            }
        }
        this.dd = d;
        let h = new List$1(Rect.$, 0);
        for (let i = 0; i < a.count; i++) {
            let j = a._inner[i];
            let k = this.a2._inner[i].a;
            if (!this.dd.contains(i)) {
                h.add(j);
                e.add(k);
            }
        }
        this.am = this.al(h, e);
    }
    ao(a, b) {
        if (this.dd.contains(a)) {
            return false;
        }
        else {
            return super.ao(a, b);
        }
    }
    c9() {
        this.dd = new List$1(Number_$type, 0);
        super.c9();
    }
    ah() {
        return 5;
    }
    as(a) {
        return a == 5 || a == 4 || a == 1 || a == 0;
    }
    b0() {
    }
}
RadialAxisLabelPanel.$t = markType(RadialAxisLabelPanel, 'RadialAxisLabelPanel', HorizontalAxisLabelPanelBase.$);
/**
 * @hidden
 */
export class RadialAxisLabelPanelView extends HorizontalAxisLabelPanelBaseView {
    constructor(a) {
        super(a);
        this.a1 = null;
        this.a1 = a;
    }
    a4(a, b, c) {
        let d = this.m(a);
        let e = this.l(a);
        let f = new TransformGroup();
        f.j.add(((() => {
            let $ret = new RotateTransform();
            $ret.j = b;
            $ret.k = d / 2;
            $ret.l = e / 2;
            return $ret;
        })()));
        f.j.add(((() => {
            let $ret = new TranslateTransform();
            $ret.j = d / -2;
            $ret.k = d / 2 * c;
            return $ret;
        })()));
        a.j = f;
    }
    a3() {
        this.a.j = null;
    }
    a2(a) {
        let b = ViewportUtils.f(0.5, this.a.cp, this.a.co);
        this.a.j = ((() => {
            let $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;
        })());
    }
    al() {
        super.al();
        this.a.cq(new Size(1, this.a.cn.width, this.a.cn.height));
    }
}
RadialAxisLabelPanelView.$t = markType(RadialAxisLabelPanelView, 'RadialAxisLabelPanelView', HorizontalAxisLabelPanelBaseView.$);
//# sourceMappingURL=RadialAxisLabelPanel_combined.js.map