/*
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 { Series } from "./Series";
import { DependencyProperty } from "igniteui-react-core";
import { Point_$type, Boolean_$type, runOn, delegateRemove, typeCast, delegateCombine, fromEnum, fromEn, markType, markDep } from "igniteui-react-core";
import { SeriesView } from "./SeriesView";
import { XamDataChart } from "./XamDataChart";
import { Tuple$2 } from "igniteui-react-core";
import { PropertyMetadata } from "igniteui-react-core";
import { isNaN_ } from "igniteui-react-core";
/**
 * @hidden
 */
export let AnnotationLayer = /*@__PURE__*/ (() => {
    class AnnotationLayer extends Series {
        constructor() {
            super();
            this.pc = null;
            this.ob = null;
            this.oa = null;
            this.oc = null;
            this.pa = { $type: Point_$type, x: NaN, y: NaN };
            this.od = false;
            this.pc = { $type: Point_$type, x: NaN, y: NaN };
        }
        bp() {
            return new AnnotationLayerView(this);
        }
        kk(a) {
            super.kk(a);
            this.n9 = a;
        }
        oh(a) {
            if (a == null) {
                return false;
            }
            if (a.cx) {
                return false;
            }
            if (a.dm) {
                return false;
            }
            if (a == this) {
                return false;
            }
            return a.ec(a.bs.bu, a.bs.bv, a.bs);
        }
        get_c1() {
            return this.oe;
        }
        bj() {
            if (this.bk == 0) {
                return 1;
            }
            else {
                return super.bj();
            }
        }
        get_db() {
            return this.oj || this.ok;
        }
        get_isUsableInLegend() {
            return this.ok;
        }
        kp(a, b, c, d) {
            super.kp(a, b, c, d);
            switch (b) {
                case "SeriesViewer":
                    let e = c;
                    let f = d;
                    if (e != null) {
                        this.o3(e.series);
                        let g = e.series;
                        g.collectionChanged = delegateRemove(g.collectionChanged, runOn(this, this.o0));
                        if (typeCast(XamDataChart.$, e) !== null) {
                            let h = e;
                            this.o2(h.axes);
                            let i = h.axes;
                            i.collectionChanged = delegateRemove(i.collectionChanged, runOn(this, this.oq));
                        }
                    }
                    if (f != null) {
                        this.oy(f.series);
                        let j = f.series;
                        j.collectionChanged = delegateCombine(j.collectionChanged, runOn(this, this.o0));
                        if (typeCast(XamDataChart.$, f) !== null) {
                            let k = f;
                            this.ox(k.axes);
                            let l = k.axes;
                            l.collectionChanged = delegateCombine(l.collectionChanged, runOn(this, this.oq));
                        }
                    }
                    break;
                case AnnotationLayer.$$p[3]:
                case AnnotationLayer.$$p[2]:
                    if (this.db) {
                        if (this.gi == -1) {
                            this.gi = XamDataChart.qw(this);
                        }
                    }
                    else {
                        this.gi = -1;
                        this.m9 = null;
                        this.na = null;
                    }
                    if (this.b6 != null) {
                        this.b6.j5();
                    }
                    this.k3(true);
                    break;
                case "TransitionProgress":
                    this.oc.c(this.fw, this.ob, this.oa);
                    if (this.cp(this.bs)) {
                        return;
                    }
                    if (this.fw == 1) {
                        this.oz(this.oa, this.bs);
                    }
                    else {
                        this.oz(this.oc, this.bs);
                    }
                    if (this.b6 != null) {
                        this.b6.k7(this);
                    }
                    break;
                case AnnotationLayer.$$p[1]:
                    if (this.b6 != null) {
                        this.b6.j3();
                    }
                    break;
                case AnnotationLayer.$$p[0]:
                    this.pc = this.pb;
                    this.ke(this.pb);
                    break;
                case "ShouldRenderAsOverlay":
                    if (this.b6 != null) {
                        this.bs.ak(this.b6);
                        this.bs.ag(this.b6);
                    }
                    break;
            }
        }
        o3(a) {
            for (let b of fromEnum(a)) {
                if (!(b == this)) {
                    b.renderRequested = delegateRemove(b.renderRequested, runOn(this, this.o1));
                }
            }
            this.k3(true);
        }
        o2(a) {
            for (let b of fromEnum(a)) {
                b.renderRequested = delegateRemove(b.renderRequested, runOn(this, this.or));
            }
            this.k3(true);
        }
        oy(a) {
            for (let b of fromEnum(a)) {
                if (!(b == this)) {
                    b.renderRequested = delegateCombine(b.renderRequested, runOn(this, this.o1));
                }
            }
            this.k3(true);
        }
        ox(a) {
            for (let b of fromEnum(a)) {
                b.renderRequested = delegateCombine(b.renderRequested, runOn(this, this.or));
            }
            this.k3(true);
        }
        of(a) {
            if (a == null) {
                return false;
            }
            return true;
        }
        or(a, b) {
            if (this.of(a)) {
                this.ot(a, b.animate);
            }
        }
        og(a) {
            if (a == null) {
                return false;
            }
            if (a.cx) {
                return false;
            }
            return true;
        }
        o1(a, b) {
            if (this.og(a)) {
                this.ou(a, b.animate);
            }
        }
        ot(a, b) {
        }
        ou(a, b) {
        }
        o0(a, b) {
            this.ov(b);
        }
        oq(a, b) {
            this.os(b);
        }
        o8() {
            if (this.m9 != null) {
                return this.m9;
            }
            return this.nb;
        }
        o9() {
            if (this.na != null) {
                return this.na;
            }
            return this.ng;
        }
        os(a) {
            if (a.oldItems != null) {
                for (let b of fromEn(a.oldItems)) {
                    b.renderRequested = delegateRemove(b.renderRequested, runOn(this, this.or));
                }
            }
            if (a.newItems != null) {
                for (let c of fromEn(a.newItems)) {
                    c.renderRequested = delegateCombine(c.renderRequested, runOn(this, this.or));
                }
            }
            this.k3(true);
        }
        ov(a) {
            if (a.oldItems != null) {
                for (let b of fromEn(a.oldItems)) {
                    b.renderRequested = delegateRemove(b.renderRequested, runOn(this, this.o1));
                }
            }
            if (a.newItems != null) {
                for (let c of fromEn(a.newItems)) {
                    c.renderRequested = delegateCombine(c.renderRequested, runOn(this, this.o1));
                }
            }
            this.k3(true);
        }
        lo(a, b) {
            this.k3(false);
        }
        ln(a, b) {
            this.k3(true);
        }
        k4(a) {
            super.k4(a);
            if (this.cp(this.bs)) {
                return;
            }
            if (this.dr(a) && !this.dv) {
                let b = this.ob;
                if (this.cn()) {
                    if (this.b7.g) {
                        this.b7.t();
                    }
                    this.ob = this.oc;
                    this.oc = b;
                }
                else {
                    this.ob = this.oa;
                    this.oa = b;
                }
                this.ow(this.oa, this.bs);
                this.lb();
            }
            else {
                if (!this.dv) {
                    this.ow(this.oa, this.bs);
                }
                this.oz(this.oa, this.bs);
            }
        }
        get_cx() {
            return true;
        }
        ow(a, b) {
        }
        oz(a, b) {
            this.n9.b1();
        }
        op(a) {
            let b = { $type: Point_$type, x: this.pa.x, y: this.pa.y };
            if (a.isVertical) {
                if (isNaN_(this.pa.y)) {
                    return new Tuple$2(Boolean_$type, Point_$type, false, b);
                }
                if (isNaN_(this.pa.x)) {
                    b.x = 0;
                    return new Tuple$2(Boolean_$type, Point_$type, true, b);
                }
            }
            else {
                if (isNaN_(this.pa.x)) {
                    return new Tuple$2(Boolean_$type, Point_$type, false, b);
                }
                if (isNaN_(this.pa.y)) {
                    b.y = 0;
                    return new Tuple$2(Boolean_$type, Point_$type, true, b);
                }
            }
            return new Tuple$2(Boolean_$type, Point_$type, true, b);
        }
        ke(a) {
            super.ke(a);
            if (isNaN_(this.pc.x) && isNaN_(this.pc.y)) {
                if (isNaN_(a.x) && isNaN_(a.y)) {
                    this.n9.b0();
                    return;
                }
                else {
                    this.n9.b2();
                    this.pa = a;
                }
            }
            else {
                this.n9.b2();
                this.pa = this.pc;
            }
            this.k3(true);
        }
        ec(a, b, c) {
            let d = super.ec(a, b, c);
            if (!this.bs.t()) {
                d = false;
                return d;
            }
            return d;
        }
        get_d8() {
            return this.oi;
        }
        get oi() {
            return this.od;
        }
        set oi(a) {
            let b = this.od;
            this.od = a;
            this.raisePropertyChanged("ShouldRenderAsOverlay", b, this.od);
        }
    }
    AnnotationLayer.$t = /*@__PURE__*/ markType(AnnotationLayer, 'AnnotationLayer', Series.$);
    AnnotationLayer.$$p = /*@__PURE__*/ markDep(DependencyProperty, PropertyMetadata, AnnotationLayer, 'raisePropertyChanged', ['CursorPosition:pb:o4', [Point_$type, { $type: Point_$type, x: NaN, y: NaN }], 'IsDefaultCrosshairDisabled:oe:o5', [0, true], 'UseIndex:oj:o6', [0, false], 'UseLegend:ok:o7', [0, false]]);
    return AnnotationLayer;
})();
/**
 * @hidden
 */
export let AnnotationLayerView = /*@__PURE__*/ (() => {
    class AnnotationLayerView extends SeriesView {
        constructor(a) {
            super(a);
            this.bx = null;
            this.by = false;
            this.bz = -1;
            this.bx = a;
        }
        b3() {
            if (this.by) {
                this.by = false;
                this.bz = -1;
                this.bx.pa = { $type: Point_$type, x: NaN, y: NaN };
                this.bx.k3(true);
            }
        }
        b0() {
            this.by = true;
            if (this.e.f5 != null) {
                this.e.f5.setTimeout(runOn(this, this.b3), 300);
            }
            else {
                this.bz = window.setTimeout(runOn(this, this.b3), 300);
            }
        }
        b2() {
            if (this.by == true) {
                this.by = false;
                if (this.bz != -1) {
                    window.clearTimeout(this.bz);
                    this.bz = -1;
                }
            }
        }
        b1() {
            this.aq();
        }
    }
    AnnotationLayerView.$t = /*@__PURE__*/ markType(AnnotationLayerView, 'AnnotationLayerView', SeriesView.$);
    return AnnotationLayerView;
})();
//# sourceMappingURL=AnnotationLayer_combined.js.map
