/*
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 { Base, markType, PointUtil } from "igniteui-angular-core";
import { ScalerParams } from "./ScalerParams";
/**
 * @hidden
 */
export let ErrorBarsHelper = /*@__PURE__*/ (() => {
    class ErrorBarsHelper extends Base {
        constructor(a, b) {
            super();
            this.b = null;
            this.a = null;
            this.b = a;
            this.a = b;
        }
        c(a) {
            let b = a.getCalculatorType();
            if (b == 1 || b == 2) {
                return false;
            }
            else {
                return true;
            }
        }
        i(a, b) {
            if (a.hasConstantPosition()) {
                b = a.getPosition();
            }
            return {
                p1: b
            };
        }
        k(a, b, c, d, e) {
            let f;
            let g;
            let h;
            let i = this.a.getViewInfo(g, f);
            g = i.p0;
            f = i.p1;
            h = this.a.getEffectiveViewport();
            let j = new ScalerParams(0, f, g, c.df, h);
            let k = c.ft(a, j);
            let l = b.getIndependentValue();
            d = Math.abs(Math.round(c.ft(a + l, j) - k));
            e = Math.abs(Math.round(c.ft(a - l, j) - k));
            return {
                p3: d,
                p4: e
            };
        }
        j(a, b, c, d, e) {
            let f;
            let g;
            let h = this.a.getViewInfo(g, f);
            g = h.p0;
            f = h.p1;
            let i = new ScalerParams(1, f, g, c.df);
            let j = c.fw(a, i);
            let k = b.getIndependentValue();
            d = Math.abs(Math.round(c.ft(j + k, i) - a));
            e = Math.abs(Math.round(c.ft(j - k, i) - a));
            return {
                p3: d,
                p4: e
            };
        }
        g(a, b, c, d, e) {
            let f;
            let g;
            let h = this.a.getViewInfo(g, f);
            g = h.p0;
            f = h.p1;
            let i = new ScalerParams(1, f, g, c.df);
            let j = c.fw(a, i);
            let k = b.getDependentValue(j);
            d = Math.abs(Math.round(c.ft(j + k, i) - a));
            e = Math.abs(Math.round(c.ft(j - k, i) - a));
            return {
                p3: d,
                p4: e
            };
        }
        f(a, b, c, d, e, f) {
            let g;
            let h;
            let i = this.a.getViewInfo(h, g);
            h = i.p0;
            g = i.p1;
            let j = new ScalerParams(1, g, h, c.df);
            let k = new ScalerParams(1, g, h, d.df);
            let l = c.fw(a, j);
            let m = b.getDependentValue(l);
            e = Math.abs(Math.round(c.ft(l + m, k) - a));
            f = Math.abs(Math.round(c.ft(l - m, k) - a));
            return {
                p4: e,
                p5: f
            };
        }
        h(a, b, c, d, e) {
            let f;
            let g;
            let h = this.a.getViewInfo(g, f);
            g = h.p0;
            f = h.p1;
            let i = new ScalerParams(1, f, g, c.df);
            let j = c.fw(a, i);
            d = Math.abs(Math.round(c.ft(j + b, i) - a));
            e = Math.abs(Math.round(c.ft(j - b, i) - a));
            return {
                p3: d,
                p4: e
            };
        }
        e(a, b, c, d) {
        }
        d(a, b, c, d) {
        }
        l(a, b, c, d) {
            let e = PointUtil.create();
            if (a.getCalculatorType() == 3) {
                let f;
                let g;
                let h;
                let i = this.a.getViewInfo(g, f);
                g = i.p0;
                f = i.p1;
                h = this.a.getEffectiveViewport();
                let j = new ScalerParams(0, f, g, b.df, h);
                e.x = Math.round(b.ft(d, j));
                e.y = Math.round(c.y);
            }
            else {
                e.x = Math.round(c.x);
                e.y = Math.round(c.y);
            }
            return e;
        }
        m(a, b, c, d) {
            let e = PointUtil.create();
            if (a.getCalculatorType() == 3) {
                let f;
                let g;
                let h;
                let i = this.a.getViewInfo(g, f);
                g = i.p0;
                f = i.p1;
                h = this.a.getEffectiveViewport();
                let j = new ScalerParams(0, f, g, b.df, h);
                e.x = Math.round(c.x);
                e.y = Math.round(b.ft(d, j));
            }
            else {
                e.x = Math.round(c.x);
                e.y = Math.round(c.y);
            }
            return e;
        }
    }
    ErrorBarsHelper.$t = markType(ErrorBarsHelper, 'ErrorBarsHelper');
    return ErrorBarsHelper;
})();
