/*
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 } from "igniteui-angular-core";
import { ArgumentNullException } from "igniteui-angular-core";
/**
 * @hidden
 */
export let LinkedListNode = /*@__PURE__*/ (() => {
    class LinkedListNode extends Base {
        constructor() {
            super(...arguments);
            this.a = null;
            this.c = null;
            this.d = null;
        }
        get b() {
            return this.a;
        }
        get e() {
            return this.c;
        }
        get f() {
            return this.d;
        }
        g(a) {
            if (a == null) {
                throw new ArgumentNullException(1);
            }
            this.m();
            if (a.c == null) {
                this.l(a.a);
            }
            else {
                a.c.d = this;
                this.c = a.c;
                a.c = this;
                this.d = a;
                this.a = a.a;
            }
        }
        h(a) {
            if (a == null) {
                throw new ArgumentNullException(1);
            }
            this.m();
            if (a.d == null) {
                this.j(a.a);
            }
            else {
                a.d.c = this;
                this.d = a.d;
                a.d = this;
                this.c = a;
                this.a = a.a;
            }
        }
        i() {
            this.j(this.a);
        }
        j(a) {
            if (a == null) {
                throw new ArgumentNullException(1);
            }
            if (a != this.a || a.c != this) {
                this.m();
                this.a = a;
                if (a.c == null) {
                    a.c = a.d = this;
                }
                else {
                    this.c = a.c;
                    a.c = this;
                    this.c.d = this;
                }
            }
        }
        k() {
            this.l(this.b);
        }
        l(a) {
            if (a == null) {
                throw new ArgumentNullException(1);
            }
            if (a != this.a || a.d != this) {
                this.m();
                this.a = a;
                if (a.d == null) {
                    a.c = a.d = this;
                }
                else {
                    this.d = a.d;
                    a.d = this;
                    this.d.c = this;
                }
            }
        }
        m() {
            if (this.a != null) {
                let a = this.a;
                if (this.d != null) {
                    this.d.c = this.c;
                }
                if (this.c != null) {
                    this.c.d = this.d;
                }
                if (a.c == this) {
                    a.c = this.c;
                }
                if (a.d == this) {
                    a.d = this.d;
                }
                this.c = null;
                this.d = null;
                this.a = null;
            }
        }
    }
    LinkedListNode.$t = markType(LinkedListNode, 'LinkedListNode');
    return LinkedListNode;
})();
/**
 * @hidden
 */
export let LinkedList = /*@__PURE__*/ (() => {
    class LinkedList extends Base {
        constructor() {
            super(...arguments);
            this.a = null;
            this.b = null;
        }
        get c() {
            return this.a;
        }
        set c(a) {
            this.a = a;
        }
        get d() {
            return this.b;
        }
        set d(a) {
            this.b = a;
        }
        e(a = false) {
            if (a) {
                while (this.b != null) {
                    this.b.m();
                }
            }
            else {
                this.a = this.b = null;
            }
        }
    }
    LinkedList.$t = markType(LinkedList, 'LinkedList');
    return LinkedList;
})();
