/*
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, typeCast, markType } from "igniteui-angular-core";
import { BorderStyleInfo } from "./BorderStyleInfo";
import { ColorInfo } from "./ColorInfo";
import { ExcelUtils } from "./ExcelUtils";
/**
 * @hidden
 */
export class BorderInfo extends Base {
    constructor() {
        super(...arguments);
        this.h = new BorderStyleInfo();
        this.j = new BorderStyleInfo();
        this.l = new BorderStyleInfo();
        this.b = new BorderStyleInfo();
        this.d = new BorderStyleInfo();
        this.f = new BorderStyleInfo();
        this.n = new BorderStyleInfo();
        this.p = false;
        this.r = false;
        this.u = false;
    }
    equals(a) {
        if (Base.referenceEquals(this, a)) {
            return true;
        }
        let b = typeCast(BorderInfo.$, a);
        if (b == null) {
            return false;
        }
        return this.p == b.p && this.r == b.r && this.u == b.u && Base.equalsStatic(this.b, b.b) && Base.equalsStatic(this.d, b.d) && Base.equalsStatic(this.f, b.f) && Base.equalsStatic(this.h, b.h) && Base.equalsStatic(this.j, b.j) && Base.equalsStatic(this.l, b.l) && Base.equalsStatic(this.n, b.n);
    }
    getHashCode() {
        let a = Base.getHashCodeStatic(this.p) ^ Base.getHashCodeStatic(this.r) ^ Base.getHashCodeStatic(this.u);
        if (this.b != null) {
            a ^= this.b.getHashCode();
        }
        if (this.d != null) {
            a ^= this.d.getHashCode();
        }
        if (this.f != null) {
            a ^= this.f.getHashCode();
        }
        if (this.h != null) {
            a ^= this.h.getHashCode();
        }
        if (this.j != null) {
            a ^= this.j.getHashCode();
        }
        if (this.l != null) {
            a ^= this.l.getHashCode();
        }
        if (this.n != null) {
            a ^= this.n.getHashCode();
        }
        return a;
    }
    get i() {
        return this.h;
    }
    get k() {
        return this.j;
    }
    get m() {
        return this.l;
    }
    get c() {
        return this.b;
    }
    get e() {
        return this.d;
    }
    get g() {
        return this.f;
    }
    get o() {
        return this.n;
    }
    get q() {
        return this.p;
    }
    set q(a) {
        this.p = a;
    }
    get s() {
        return this.r;
    }
    set s(a) {
        this.r = a;
    }
    get v() {
        return this.u;
    }
    set v(a) {
        this.u = a;
    }
    x(a, b) {
        if (this.c != null && this.c.f == false) {
            a.bottomBorderColorInfo = this.c.d.c(b);
            a.bottomBorderStyle = this.c.a;
        }
        if (this.m != null && this.m.f == false) {
            a.topBorderColorInfo = this.m.d.c(b);
            a.topBorderStyle = this.m.a;
        }
        if (this.i != null && this.i.f == false) {
            a.leftBorderColorInfo = this.i.d.c(b);
            a.leftBorderStyle = this.i.a;
        }
        if (this.k != null && this.k.f == false) {
            a.rightBorderColorInfo = this.k.d.c(b);
            a.rightBorderStyle = this.k.a;
        }
        if (this.e != null && this.e.f == false) {
            a.diagonalBorderColorInfo = this.e.d.c(b);
            a.diagonalBorderStyle = this.e.a;
        }
        let c = 1;
        if (this.q) {
            c |= 3;
        }
        if (this.s) {
            c |= 5;
        }
        a.diagonalBorders = c;
    }
    static a(a, b) {
        let c = new BorderInfo();
        let d = b._b1 == 2;
        BorderInfo.y(a, c.c, d ? b.bottomBorderStyle : b._al, b.bottomBorderColorInfo, b._bf);
        BorderInfo.y(a, c.m, d ? b.topBorderStyle : b._ap, b.topBorderColorInfo, b._bm);
        BorderInfo.y(a, c.i, d ? b.leftBorderStyle : b._an, b.leftBorderColorInfo, b._bk);
        BorderInfo.y(a, c.k, d ? b.rightBorderStyle : b._ao, b.rightBorderColorInfo, b._bl);
        BorderInfo.y(a, c.e, d ? b.diagonalBorderStyle : b._am, b.diagonalBorderColorInfo, b._bg);
        let e = d ? b.diagonalBorders : b._aw;
        if (ExcelUtils.az(e)) {
            c.q = true;
        }
        if (ExcelUtils.a0(e)) {
            c.s = true;
        }
        return c;
    }
    static y(a, b, c, d, e) {
        let f = (c == -1 || c == 0) ? d : e;
        b.a = c;
        b.d = ColorInfo.a(a, f, 0);
    }
}
BorderInfo.$t = markType(BorderInfo, 'BorderInfo');
//# sourceMappingURL=BorderInfo.js.map