package a.i.b.a.c.e;

import a.i.b.a.c.e.a.aa;
import a.i.b.a.c.e.a.ae;
import a.i.b.a.c.e.a.ag;
import a.i.b.a.c.e.a.g;
import a.i.b.a.c.e.a.o;
import a.i.b.a.c.e.a.p;
import a.i.b.a.c.g.e;
import a.i.b.a.c.g.i;
import a.i.b.a.c.g.i.a;
import a.i.b.a.c.g.i.b;
import a.i.b.a.c.g.q;
import a.i.b.a.c.g.w;
import com.tencent.matrix.trace.core.AppMethodBeat;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

public final class a$o$a extends b<o, a$o$a> implements p {
    private int BsD;
    private int BsW = 6;
    private ag BtC = ag.efM();
    private List<Integer> BtD = Collections.emptyList();
    private List<a$ai> BtO = Collections.emptyList();
    private List<ae> Btp = Collections.emptyList();
    private int Buf;
    private int Bus = 6;
    private aa But = aa.eeX();
    private int Buu;
    private aa Buv = aa.eeX();
    private int Buw;
    private g Bux = g.edH();

    public final /* synthetic */ a a(i iVar) {
        AppMethodBeat.i(120652);
        a$o$a e = e((o) iVar);
        AppMethodBeat.o(120652);
        return e;
    }

    public final /* synthetic */ a.i.b.a.c.g.a.a c(e eVar, a.i.b.a.c.g.g gVar) {
        AppMethodBeat.i(120654);
        a$o$a m = m(eVar, gVar);
        AppMethodBeat.o(120654);
        return m;
    }

    public final /* synthetic */ Object clone() {
        AppMethodBeat.i(120658);
        a$o$a eer = eer();
        AppMethodBeat.o(120658);
        return eer;
    }

    public final /* synthetic */ q.a d(e eVar, a.i.b.a.c.g.g gVar) {
        AppMethodBeat.i(120656);
        a$o$a m = m(eVar, gVar);
        AppMethodBeat.o(120656);
        return m;
    }

    public final /* synthetic */ a ecK() {
        AppMethodBeat.i(120653);
        a$o$a eer = eer();
        AppMethodBeat.o(120653);
        return eer;
    }

    public final /* synthetic */ a.i.b.a.c.g.a.a ecL() {
        AppMethodBeat.i(120655);
        a$o$a eer = eer();
        AppMethodBeat.o(120655);
        return eer;
    }

    public final /* synthetic */ b edA() {
        AppMethodBeat.i(120649);
        a$o$a eer = eer();
        AppMethodBeat.o(120649);
        return eer;
    }

    private a$o$a() {
        AppMethodBeat.i(120636);
        AppMethodBeat.o(120636);
    }

    private o ees() {
        int i = 1;
        AppMethodBeat.i(120638);
        o oVar = new o(this, (byte) 0);
        int i2 = this.BsD;
        if ((i2 & 1) != 1) {
            i = 0;
        }
        o.a(oVar, this.BsW);
        if ((i2 & 2) == 2) {
            i |= 2;
        }
        o.b(oVar, this.Bus);
        if ((i2 & 4) == 4) {
            i |= 4;
        }
        o.c(oVar, this.Buf);
        if ((i2 & 8) == 8) {
            i |= 8;
        }
        o.a(oVar, this.But);
        if ((i2 & 16) == 16) {
            i |= 16;
        }
        o.d(oVar, this.Buu);
        if ((this.BsD & 32) == 32) {
            this.Btp = Collections.unmodifiableList(this.Btp);
            this.BsD &= -33;
        }
        o.a(oVar, this.Btp);
        if ((i2 & 64) == 64) {
            i |= 32;
        }
        o.b(oVar, this.Buv);
        if ((i2 & 128) == 128) {
            i |= 64;
        }
        o.e(oVar, this.Buw);
        if ((this.BsD & 256) == 256) {
            this.BtO = Collections.unmodifiableList(this.BtO);
            this.BsD &= -257;
        }
        o.b(oVar, this.BtO);
        if ((i2 & com.tencent.mm.plugin.appbrand.jsapi.container.b.CTRL_INDEX) == com.tencent.mm.plugin.appbrand.jsapi.container.b.CTRL_INDEX) {
            i |= 128;
        }
        o.a(oVar, this.BtC);
        if ((this.BsD & 1024) == 1024) {
            this.BtD = Collections.unmodifiableList(this.BtD);
            this.BsD &= -1025;
        }
        o.c(oVar, this.BtD);
        if ((i2 & 2048) == 2048) {
            i |= 256;
        }
        o.a(oVar, this.Bux);
        o.f(oVar, i);
        AppMethodBeat.o(120638);
        return oVar;
    }

    public final a$o$a e(o oVar) {
        AppMethodBeat.i(120639);
        if (oVar == o.eek()) {
            AppMethodBeat.o(120639);
        } else {
            if (oVar.ecY()) {
                Tk(oVar.BsW);
            }
            if (oVar.eel()) {
                Tl(oVar.Bus);
            }
            if (oVar.edW()) {
                Tm(oVar.Buf);
            }
            if (oVar.eem()) {
                b(oVar.But);
            }
            if (oVar.een()) {
                Tn(oVar.Buu);
            }
            if (!o.a(oVar).isEmpty()) {
                if (this.Btp.isEmpty()) {
                    this.Btp = o.a(oVar);
                    this.BsD &= -33;
                } else {
                    edp();
                    this.Btp.addAll(o.a(oVar));
                }
            }
            if (oVar.eeo()) {
                c(oVar.Buv);
            }
            if (oVar.eep()) {
                To(oVar.Buw);
            }
            if (!o.b(oVar).isEmpty()) {
                if (this.BtO.isEmpty()) {
                    this.BtO = o.b(oVar);
                    this.BsD &= -257;
                } else {
                    edF();
                    this.BtO.addAll(o.b(oVar));
                }
            }
            if (oVar.edl()) {
                b(oVar.BtC);
            }
            if (!o.c(oVar).isEmpty()) {
                if (this.BtD.isEmpty()) {
                    this.BtD = o.c(oVar);
                    this.BsD &= -1025;
                } else {
                    edz();
                    this.BtD.addAll(o.c(oVar));
                }
            }
            if (oVar.eeq()) {
                e(oVar.Bux);
            }
            a(oVar);
            this.BsB = this.BsB.a(o.d(oVar));
            AppMethodBeat.o(120639);
        }
        return this;
    }

    /* JADX WARNING: Removed duplicated region for block: B:16:0x0027  */
    private a.i.b.a.c.e.a$o$a m(a.i.b.a.c.g.e r5, a.i.b.a.c.g.g r6) {
        /*
        r4 = this;
        r3 = 120641; // 0x1d741 float:1.69054E-40 double:5.96046E-319;
        com.tencent.matrix.trace.core.AppMethodBeat.i(r3);
        r2 = 0;
        r0 = a.i.b.a.c.e.a.o.BsC;	 Catch:{ k -> 0x0016 }
        r0 = r0.a(r5, r6);	 Catch:{ k -> 0x0016 }
        r0 = (a.i.b.a.c.e.a.o) r0;	 Catch:{ k -> 0x0016 }
        r4.e(r0);
        com.tencent.matrix.trace.core.AppMethodBeat.o(r3);
        return r4;
    L_0x0016:
        r0 = move-exception;
        r1 = r0;
        r0 = r1.BzY;	 Catch:{ all -> 0x002e }
        r0 = (a.i.b.a.c.e.a.o) r0;	 Catch:{ all -> 0x002e }
        r2 = 120641; // 0x1d741 float:1.69054E-40 double:5.96046E-319;
        com.tencent.matrix.trace.core.AppMethodBeat.o(r2);	 Catch:{ all -> 0x0023 }
        throw r1;	 Catch:{ all -> 0x0023 }
    L_0x0023:
        r1 = move-exception;
        r2 = r0;
    L_0x0025:
        if (r2 == 0) goto L_0x002a;
    L_0x0027:
        r4.e(r2);
    L_0x002a:
        com.tencent.matrix.trace.core.AppMethodBeat.o(r3);
        throw r1;
    L_0x002e:
        r0 = move-exception;
        r1 = r0;
        goto L_0x0025;
        */
        throw new UnsupportedOperationException("Method not decompiled: a.i.b.a.c.e.a$o$a.m(a.i.b.a.c.g.e, a.i.b.a.c.g.g):a.i.b.a.c.e.a$o$a");
    }

    private a$o$a Tk(int i) {
        this.BsD |= 1;
        this.BsW = i;
        return this;
    }

    private a$o$a Tl(int i) {
        this.BsD |= 2;
        this.Bus = i;
        return this;
    }

    private a$o$a Tm(int i) {
        this.BsD |= 4;
        this.Buf = i;
        return this;
    }

    private a$o$a b(aa aaVar) {
        AppMethodBeat.i(120642);
        if ((this.BsD & 8) != 8 || this.But == aa.eeX()) {
            this.But = aaVar;
        } else {
            this.But = aa.f(this.But).j(aaVar).eft();
        }
        this.BsD |= 8;
        AppMethodBeat.o(120642);
        return this;
    }

    private a$o$a Tn(int i) {
        this.BsD |= 16;
        this.Buu = i;
        return this;
    }

    private void edp() {
        AppMethodBeat.i(120643);
        if ((this.BsD & 32) != 32) {
            this.Btp = new ArrayList(this.Btp);
            this.BsD |= 32;
        }
        AppMethodBeat.o(120643);
    }

    private a$o$a c(aa aaVar) {
        AppMethodBeat.i(120644);
        if ((this.BsD & 64) != 64 || this.Buv == aa.eeX()) {
            this.Buv = aaVar;
        } else {
            this.Buv = aa.f(this.Buv).j(aaVar).eft();
        }
        this.BsD |= 64;
        AppMethodBeat.o(120644);
        return this;
    }

    private a$o$a To(int i) {
        this.BsD |= 128;
        this.Buw = i;
        return this;
    }

    private void edF() {
        AppMethodBeat.i(120645);
        if ((this.BsD & 256) != 256) {
            this.BtO = new ArrayList(this.BtO);
            this.BsD |= 256;
        }
        AppMethodBeat.o(120645);
    }

    private a$o$a b(ag agVar) {
        AppMethodBeat.i(120646);
        if ((this.BsD & com.tencent.mm.plugin.appbrand.jsapi.container.b.CTRL_INDEX) != com.tencent.mm.plugin.appbrand.jsapi.container.b.CTRL_INDEX || this.BtC == ag.efM()) {
            this.BtC = agVar;
        } else {
            this.BtC = ag.d(this.BtC).g(agVar).efP();
        }
        this.BsD |= com.tencent.mm.plugin.appbrand.jsapi.container.b.CTRL_INDEX;
        AppMethodBeat.o(120646);
        return this;
    }

    private void edz() {
        AppMethodBeat.i(120647);
        if ((this.BsD & 1024) != 1024) {
            this.BtD = new ArrayList(this.BtD);
            this.BsD |= 1024;
        }
        AppMethodBeat.o(120647);
    }

    private a$o$a e(g gVar) {
        AppMethodBeat.i(120648);
        if ((this.BsD & 2048) != 2048 || this.Bux == g.edH()) {
            this.Bux = gVar;
        } else {
            this.Bux = g.a(this.Bux).d(gVar).edK();
        }
        this.BsD |= 2048;
        AppMethodBeat.o(120648);
        return this;
    }

    private a$o$a eer() {
        AppMethodBeat.i(120637);
        a$o$a e = new a$o$a().e(ees());
        AppMethodBeat.o(120637);
        return e;
    }

    public final boolean isInitialized() {
        boolean z;
        AppMethodBeat.i(120640);
        if ((this.BsD & 4) == 4) {
            z = true;
        } else {
            z = false;
        }
        if (z) {
            if ((this.BsD & 8) == 8) {
                z = true;
            } else {
                z = false;
            }
            if (!z || this.But.isInitialized()) {
                int i = 0;
                while (i < this.Btp.size()) {
                    if (((ae) this.Btp.get(i)).isInitialized()) {
                        i++;
                    } else {
                        AppMethodBeat.o(120640);
                        return false;
                    }
                }
                if ((this.BsD & 64) == 64) {
                    z = true;
                } else {
                    z = false;
                }
                if (!z || this.Buv.isInitialized()) {
                    i = 0;
                    while (i < this.BtO.size()) {
                        if (((a$ai) this.BtO.get(i)).isInitialized()) {
                            i++;
                        } else {
                            AppMethodBeat.o(120640);
                            return false;
                        }
                    }
                    if ((this.BsD & com.tencent.mm.plugin.appbrand.jsapi.container.b.CTRL_INDEX) == com.tencent.mm.plugin.appbrand.jsapi.container.b.CTRL_INDEX) {
                        z = true;
                    } else {
                        z = false;
                    }
                    if (!z || this.BtC.isInitialized()) {
                        if ((this.BsD & 2048) == 2048) {
                            z = true;
                        } else {
                            z = false;
                        }
                        if (z && !this.Bux.isInitialized()) {
                            AppMethodBeat.o(120640);
                            return false;
                        } else if (this.BzI.isInitialized()) {
                            AppMethodBeat.o(120640);
                            return true;
                        } else {
                            AppMethodBeat.o(120640);
                            return false;
                        }
                    }
                    AppMethodBeat.o(120640);
                    return false;
                }
                AppMethodBeat.o(120640);
                return false;
            }
            AppMethodBeat.o(120640);
            return false;
        }
        AppMethodBeat.o(120640);
        return false;
    }

    public final /* synthetic */ q ecE() {
        AppMethodBeat.i(120650);
        o eek = o.eek();
        AppMethodBeat.o(120650);
        return eek;
    }

    public final /* synthetic */ i ecJ() {
        AppMethodBeat.i(120651);
        o eek = o.eek();
        AppMethodBeat.o(120651);
        return eek;
    }

    public final /* synthetic */ q ecM() {
        AppMethodBeat.i(120657);
        o ees = ees();
        if (ees.isInitialized()) {
            AppMethodBeat.o(120657);
            return ees;
        }
        w wVar = new w();
        AppMethodBeat.o(120657);
        throw wVar;
    }

    static /* synthetic */ a$o$a eet() {
        AppMethodBeat.i(120659);
        a$o$a a_o_a = new a$o$a();
        AppMethodBeat.o(120659);
        return a_o_a;
    }
}
