/*
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 { AnnotationLayer } from "./AnnotationLayer";
import { Series } from "./Series";
import { DependencyProperty } from "igniteui-angular-core/ES2015/DependencyProperty";
import { FinalValueSelectionMode_$type } from "./FinalValueSelectionMode";
import { Brush } from "igniteui-angular-core/ES2015/Brush";
import { Thickness } from "igniteui-angular-core/ES2015/Thickness";
import { FinalValueLayerFrame } from "./FinalValueLayerFrame";
import { List$1 } from "igniteui-angular-core/ES2015/List$1";
import { Axis } from "./Axis";
import { Dictionary$2 } from "igniteui-angular-core/ES2015/Dictionary$2";
import { Pool$1 } from "igniteui-angular-core/ES2015/Pool$1";
import { AxisAnnotation } from "./AxisAnnotation";
import { Type, enumGetBox, fromEnum, Point_$type, markType } from "igniteui-angular-core/ES2015/type";
import { AxisAnnotationFrameManager } from "./AxisAnnotationFrameManager";
import { PropertyMetadata } from "igniteui-angular-core/ES2015/PropertyMetadata";
import { AnnotationLayerView } from "./AnnotationLayerView";
import { BrushUtil } from "igniteui-angular-core/ES2015/BrushUtil";
/**
 * @hidden
 */
export class FinalValueLayer extends AnnotationLayer {
    constructor() {
        super();
        this.axisAnnotationFormatLabel = null;
        this.m0 = null;
        this.mz = null;
        let a = new FinalValueLayerFrame();
        let b = new FinalValueLayerFrame();
        let c = new FinalValueLayerFrame();
        let d = this.ff / 1000;
        this.lu = a;
        this.lt = b;
        this.lv = c;
        this.ab = FinalValueLayer.$;
    }
    bf() {
        return new FinalValueLayerView(this);
    }
    im(a) {
        super.im(a);
        this.mv = a;
    }
    get nz() {
        return new Thickness(1, this.m2, this.m4, this.m3, this.m1);
    }
    my() {
        return this.axisAnnotationFormatLabel != null;
    }
    mb(a, b) {
        if (this.mx == null || this.mx == a) {
            if (!this.aq.c) {
                this.i5(b);
            }
        }
    }
    md(a, b) {
        super.md(a, b);
        let c = a;
        c.f.clear();
        c.q.clear();
        c.p.clear();
        c.aa.clear();
        c.o.clear();
        c.z.clear();
        c.g.clear();
        c.h.clear();
        c.j.clear();
        c.l.clear();
        c.k.clear();
        c.i.clear();
        c.m.clear();
        c.n.clear();
        c.r.clear();
        c.s.clear();
        c.u.clear();
        c.w.clear();
        c.v.clear();
        c.t.clear();
        c.x.clear();
        c.y.clear();
        if (this.ly(this.mx)) {
            this.ni(this.mx, c);
        }
        else {
            for (let d of fromEnum(this.bs.series)) {
                if (this.ly(d)) {
                    this.ni(d, c);
                }
            }
        }
    }
    ly(a) {
        if (!super.ly(a)) {
            return false;
        }
        return true;
    }
    ig() {
        super.ig();
        if (!this.aq.c && !this.ca()) {
            return;
        }
        if (this.ca()) {
            this.nj(this.lv, false);
        }
        else {
            this.nj(this.lt, false);
        }
    }
    ny(a) {
        let b = NaN;
        let c = NaN;
        let d = this.mw;
        if (d == 0) {
            d = 1;
        }
        let e = false;
        if (d == 2) {
            e = true;
        }
        if (a.isVertical) {
            let f = a.ap();
            if (f != null) {
                if (d == 1 || d == 2) {
                    if (f.b8) {
                        c = a.lg({ $type: Point_$type, x: this.lq.right, y: this.lq.bottom }).y;
                    }
                    else {
                        c = a.lg({ $type: Point_$type, x: this.lq.right, y: this.lq.top }).y;
                    }
                }
                else {
                    if (f.b8) {
                        c = 1;
                    }
                    else {
                        c = 0;
                    }
                }
            }
            return a.ld({ $type: Point_$type, x: 0, y: c }, e, true);
        }
        else {
            let g = a.ap();
            if (g != null) {
                if (d == 1 || d == 2) {
                    if (g.b8) {
                        b = a.lg({ $type: Point_$type, x: this.lq.left, y: this.lq.top }).x;
                    }
                    else {
                        b = a.lg({ $type: Point_$type, x: this.lq.right, y: this.lq.top }).x;
                    }
                }
                else {
                    if (g.b8) {
                        b = 0;
                    }
                    else {
                        b = 1;
                    }
                }
            }
            if (a.cr) {
                return a.ld({ $type: Point_$type, x: b, y: 0 }, e, true);
            }
            else {
                return a.ld({ $type: Point_$type, x: b, y: 0 }, e, true);
            }
        }
    }
    ni(a, b) {
        let c = this.ny(a);
        let d = this.lg(c);
        let e = this.kv;
        if (e == null) {
            e = this.kx;
        }
        if (e == null) {
            e = a.kv;
            if (e != null) {
                e = this.mv.b2(e);
            }
        }
        AxisAnnotationFrameManager.c(b, c, a, this.bs, this.getEffectiveViewport(), e, this.nv, this.nx, this.nw, this.nz, this.m5, this.nv, this.nx, this.nw, this.nz, this.m5, a.isVertical, !a.isVertical);
    }
    nj(a, b) {
        let c = false;
        if (this.mz == null) {
            c = true;
            this.m0 = new List$1(Axis.$, 0);
            this.mz = new Dictionary$2(Axis.$, Pool$1.$.specialize(AxisAnnotation.$), 0);
        }
        AxisAnnotationFrameManager.d(this, a, c, this.mz, this.m0, b, this.m6, this.m6, this.axisAnnotationFormatLabel, this.axisAnnotationFormatLabel);
    }
    mg(a, b) {
        super.mg(a, b);
        if (this.ca()) {
            this.nj(this.lv, true);
        }
        else {
            this.nj(this.lt, false);
        }
    }
    c7() {
        return true;
    }
    is(a, b, c, d) {
        super.is(a, b, c, d);
        switch (b) {
            case FinalValueLayer.$$p[10]:
                this.i5(true);
                break;
            case FinalValueLayer.$$p[0]:
            case FinalValueLayer.$$p[2]:
            case FinalValueLayer.$$p[4]:
            case FinalValueLayer.$$p[6]:
            case FinalValueLayer.$$p[5]:
            case FinalValueLayer.$$p[3]:
            case FinalValueLayer.$$p[7]:
            case FinalValueLayer.$$p[8]:
            case FinalValueLayer.$$p[9]:
                this.i5(true);
                break;
            case "SeriesViewer":
                let e = this.m0;
                let f = this.mz;
                if (f != null) {
                    for (let g of fromEnum(f)) {
                        let h = g.value;
                        h.c((i) => g.key.ak.remove(i));
                        h.clear();
                    }
                    e.clear();
                    f.clear();
                }
                break;
        }
    }
}
FinalValueLayer.$t = markType(FinalValueLayer, 'FinalValueLayer', AnnotationLayer.$);
Type.dep(DependencyProperty, PropertyMetadata, FinalValueLayer, 'raisePropertyChanged', ['AxisAnnotationBackground:nv:nk', [Brush.$, null], 'AxisAnnotationInterpolatedValuePrecision:m6:nl', [1, -1], 'AxisAnnotationOutline:nw:nm', [Brush.$, null], 'AxisAnnotationPaddingBottom:m1:nn', [1, NaN], 'AxisAnnotationPaddingLeft:m2:no', [1, NaN], 'AxisAnnotationPaddingRight:m3:np', [1, NaN], 'AxisAnnotationPaddingTop:m4:nq', [1, NaN], 'AxisAnnotationStrokeThickness:m5:nr', [1, NaN], 'AxisAnnotationTextColor:nx:ns', [Brush.$, null], 'FinalValueSelectionMode:mw:nt', [FinalValueSelectionMode_$type, enumGetBox(FinalValueSelectionMode_$type, 0)], 'TargetSeries:mx:nu', [Series.$, null]]);
/**
 * @hidden
 */
export class FinalValueLayerView extends AnnotationLayerView {
    constructor(a) {
        super(a);
        this.b1 = null;
        this.b1 = a;
    }
    ap() {
        super.ap();
    }
    b2(a) {
        if (a == null) {
            return a;
        }
        return BrushUtil.h(a, 0.1);
    }
    ai(a) {
        super.ai(a);
    }
}
FinalValueLayerView.$t = markType(FinalValueLayerView, 'FinalValueLayerView', AnnotationLayerView.$);
//# sourceMappingURL=FinalValueLayer_combined.js.map