package h0;

import E1.C0110q;
import E1.C0113u;
import O1.C0225a;
import a.AbstractC0386a;
import android.os.Bundle;
import android.os.Looper;
import android.util.Log;
import android.view.View;
import android.view.ViewGroup;
import androidx.fragment.app.FragmentContainerView;
import androidx.lifecycle.EnumC0510o;
import com.martsnew.tv.R;
import d5.AbstractC0844a;
import e0.C0853a;
import f.C0897e;
import g.C0968a;
import i0.AbstractC1048d;
import java.io.FileDescriptor;
import java.io.PrintWriter;
import java.util.ArrayDeque;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.LinkedHashSet;
import java.util.ListIterator;
import java.util.Map;
import java.util.concurrent.CopyOnWriteArrayList;
import java.util.concurrent.atomic.AtomicInteger;
import n4.u0;
import r0.C1482a;
import t0.C1532a;
import y5.AbstractActivityC1764i;

/* JADX INFO: loaded from: classes.dex */
public final class P {

    /* JADX INFO: renamed from: A, reason: collision with root package name */
    public final C1000H f13053A;

    /* JADX INFO: renamed from: B, reason: collision with root package name */
    public final d3.C f13054B;

    /* JADX INFO: renamed from: C, reason: collision with root package name */
    public C0897e f13055C;
    public C0897e D;

    /* JADX INFO: renamed from: E, reason: collision with root package name */
    public C0897e f13056E;

    /* JADX INFO: renamed from: F, reason: collision with root package name */
    public ArrayDeque f13057F;

    /* JADX INFO: renamed from: G, reason: collision with root package name */
    public boolean f13058G;
    public boolean H;

    /* JADX INFO: renamed from: I, reason: collision with root package name */
    public boolean f13059I;

    /* JADX INFO: renamed from: J, reason: collision with root package name */
    public boolean f13060J;

    /* JADX INFO: renamed from: K, reason: collision with root package name */
    public boolean f13061K;

    /* JADX INFO: renamed from: L, reason: collision with root package name */
    public ArrayList f13062L;

    /* JADX INFO: renamed from: M, reason: collision with root package name */
    public ArrayList f13063M;

    /* JADX INFO: renamed from: N, reason: collision with root package name */
    public ArrayList f13064N;

    /* JADX INFO: renamed from: O, reason: collision with root package name */
    public S f13065O;

    /* JADX INFO: renamed from: P, reason: collision with root package name */
    public final M4.k f13066P;

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    public boolean f13068b;

    /* JADX INFO: renamed from: e, reason: collision with root package name */
    public ArrayList f13071e;

    /* JADX INFO: renamed from: g, reason: collision with root package name */
    public d.x f13073g;

    /* JADX INFO: renamed from: n, reason: collision with root package name */
    public final ArrayList f13079n;

    /* JADX INFO: renamed from: o, reason: collision with root package name */
    public final C0853a f13080o;

    /* JADX INFO: renamed from: p, reason: collision with root package name */
    public final CopyOnWriteArrayList f13081p;

    /* JADX INFO: renamed from: q, reason: collision with root package name */
    public final C0996D f13082q;

    /* JADX INFO: renamed from: r, reason: collision with root package name */
    public final C0996D f13083r;

    /* JADX INFO: renamed from: s, reason: collision with root package name */
    public final C0996D f13084s;

    /* JADX INFO: renamed from: t, reason: collision with root package name */
    public final C0996D f13085t;

    /* JADX INFO: renamed from: u, reason: collision with root package name */
    public final C0999G f13086u;

    /* JADX INFO: renamed from: v, reason: collision with root package name */
    public int f13087v;

    /* JADX INFO: renamed from: w, reason: collision with root package name */
    public C1025z f13088w;

    /* JADX INFO: renamed from: x, reason: collision with root package name */
    public AbstractC0386a f13089x;

    /* JADX INFO: renamed from: y, reason: collision with root package name */
    public ComponentCallbacksC1023x f13090y;

    /* JADX INFO: renamed from: z, reason: collision with root package name */
    public ComponentCallbacksC1023x f13091z;

    /* JADX INFO: renamed from: a, reason: collision with root package name */
    public final ArrayList f13067a = new ArrayList();

    /* JADX INFO: renamed from: c, reason: collision with root package name */
    public final C2.a f13069c = new C2.a(16);

    /* JADX INFO: renamed from: d, reason: collision with root package name */
    public ArrayList f13070d = new ArrayList();

    /* JADX INFO: renamed from: f, reason: collision with root package name */
    public final LayoutInflaterFactory2C0995C f13072f = new LayoutInflaterFactory2C0995C(this);

    /* JADX INFO: renamed from: h, reason: collision with root package name */
    public C1001a f13074h = null;
    public boolean i = false;

    /* JADX INFO: renamed from: j, reason: collision with root package name */
    public final C0110q f13075j = new C0110q(1, this);

    /* JADX INFO: renamed from: k, reason: collision with root package name */
    public final AtomicInteger f13076k = new AtomicInteger();

    /* JADX INFO: renamed from: l, reason: collision with root package name */
    public final Map f13077l = Collections.synchronizedMap(new HashMap());

    /* JADX INFO: renamed from: m, reason: collision with root package name */
    public final Map f13078m = Collections.synchronizedMap(new HashMap());

    /* JADX WARN: Type inference failed for: r0v16, types: [h0.D] */
    /* JADX WARN: Type inference failed for: r0v17, types: [h0.D] */
    /* JADX WARN: Type inference failed for: r0v18, types: [h0.D] */
    /* JADX WARN: Type inference failed for: r0v19, types: [h0.D] */
    public P() {
        Collections.synchronizedMap(new HashMap());
        this.f13079n = new ArrayList();
        this.f13080o = new C0853a(this);
        this.f13081p = new CopyOnWriteArrayList();
        final int i = 0;
        this.f13082q = new L.a(this) { // from class: h0.D

            /* JADX INFO: renamed from: b, reason: collision with root package name */
            public final /* synthetic */ P f13035b;

            {
                this.f13035b = this;
            }

            @Override // L.a
            public final void a(Object obj) {
                switch (i) {
                    case u0.f15495q /* 0 */:
                        P p3 = this.f13035b;
                        if (p3.N()) {
                            p3.i(false);
                        }
                        break;
                    case 1:
                        Integer num = (Integer) obj;
                        P p4 = this.f13035b;
                        if (p4.N() && num.intValue() == 80) {
                            p4.m(false);
                            break;
                        }
                        break;
                    case 2:
                        B.d dVar = (B.d) obj;
                        P p8 = this.f13035b;
                        if (p8.N()) {
                            boolean z8 = dVar.f463a;
                            p8.n(false);
                        }
                        break;
                    default:
                        B.o oVar = (B.o) obj;
                        P p9 = this.f13035b;
                        if (p9.N()) {
                            boolean z9 = oVar.f507a;
                            p9.s(false);
                        }
                        break;
                }
            }
        };
        final int i5 = 1;
        this.f13083r = new L.a(this) { // from class: h0.D

            /* JADX INFO: renamed from: b, reason: collision with root package name */
            public final /* synthetic */ P f13035b;

            {
                this.f13035b = this;
            }

            @Override // L.a
            public final void a(Object obj) {
                switch (i5) {
                    case u0.f15495q /* 0 */:
                        P p3 = this.f13035b;
                        if (p3.N()) {
                            p3.i(false);
                        }
                        break;
                    case 1:
                        Integer num = (Integer) obj;
                        P p4 = this.f13035b;
                        if (p4.N() && num.intValue() == 80) {
                            p4.m(false);
                            break;
                        }
                        break;
                    case 2:
                        B.d dVar = (B.d) obj;
                        P p8 = this.f13035b;
                        if (p8.N()) {
                            boolean z8 = dVar.f463a;
                            p8.n(false);
                        }
                        break;
                    default:
                        B.o oVar = (B.o) obj;
                        P p9 = this.f13035b;
                        if (p9.N()) {
                            boolean z9 = oVar.f507a;
                            p9.s(false);
                        }
                        break;
                }
            }
        };
        final int i8 = 2;
        this.f13084s = new L.a(this) { // from class: h0.D

            /* JADX INFO: renamed from: b, reason: collision with root package name */
            public final /* synthetic */ P f13035b;

            {
                this.f13035b = this;
            }

            @Override // L.a
            public final void a(Object obj) {
                switch (i8) {
                    case u0.f15495q /* 0 */:
                        P p3 = this.f13035b;
                        if (p3.N()) {
                            p3.i(false);
                        }
                        break;
                    case 1:
                        Integer num = (Integer) obj;
                        P p4 = this.f13035b;
                        if (p4.N() && num.intValue() == 80) {
                            p4.m(false);
                            break;
                        }
                        break;
                    case 2:
                        B.d dVar = (B.d) obj;
                        P p8 = this.f13035b;
                        if (p8.N()) {
                            boolean z8 = dVar.f463a;
                            p8.n(false);
                        }
                        break;
                    default:
                        B.o oVar = (B.o) obj;
                        P p9 = this.f13035b;
                        if (p9.N()) {
                            boolean z9 = oVar.f507a;
                            p9.s(false);
                        }
                        break;
                }
            }
        };
        final int i9 = 3;
        this.f13085t = new L.a(this) { // from class: h0.D

            /* JADX INFO: renamed from: b, reason: collision with root package name */
            public final /* synthetic */ P f13035b;

            {
                this.f13035b = this;
            }

            @Override // L.a
            public final void a(Object obj) {
                switch (i9) {
                    case u0.f15495q /* 0 */:
                        P p3 = this.f13035b;
                        if (p3.N()) {
                            p3.i(false);
                        }
                        break;
                    case 1:
                        Integer num = (Integer) obj;
                        P p4 = this.f13035b;
                        if (p4.N() && num.intValue() == 80) {
                            p4.m(false);
                            break;
                        }
                        break;
                    case 2:
                        B.d dVar = (B.d) obj;
                        P p8 = this.f13035b;
                        if (p8.N()) {
                            boolean z8 = dVar.f463a;
                            p8.n(false);
                        }
                        break;
                    default:
                        B.o oVar = (B.o) obj;
                        P p9 = this.f13035b;
                        if (p9.N()) {
                            boolean z9 = oVar.f507a;
                            p9.s(false);
                        }
                        break;
                }
            }
        };
        this.f13086u = new C0999G(this);
        this.f13087v = -1;
        this.f13053A = new C1000H(this);
        this.f13054B = new d3.C(7);
        this.f13057F = new ArrayDeque();
        this.f13066P = new M4.k(24, this);
    }

    public static HashSet F(C1001a c1001a) {
        HashSet hashSet = new HashSet();
        for (int i = 0; i < c1001a.f13144a.size(); i++) {
            ComponentCallbacksC1023x componentCallbacksC1023x = ((X) c1001a.f13144a.get(i)).f13129b;
            if (componentCallbacksC1023x != null && c1001a.f13150g) {
                hashSet.add(componentCallbacksC1023x);
            }
        }
        return hashSet;
    }

    public static boolean L(int i) {
        return Log.isLoggable("FragmentManager", i);
    }

    public static boolean M(ComponentCallbacksC1023x componentCallbacksC1023x) {
        componentCallbacksC1023x.getClass();
        ArrayList arrayListR = componentCallbacksC1023x.f13267M.f13069c.r();
        int size = arrayListR.size();
        boolean zM = false;
        int i = 0;
        while (i < size) {
            Object obj = arrayListR.get(i);
            i++;
            ComponentCallbacksC1023x componentCallbacksC1023x2 = (ComponentCallbacksC1023x) obj;
            if (componentCallbacksC1023x2 != null) {
                zM = M(componentCallbacksC1023x2);
            }
            if (zM) {
                return true;
            }
        }
        return false;
    }

    public static boolean O(ComponentCallbacksC1023x componentCallbacksC1023x) {
        if (componentCallbacksC1023x == null) {
            return true;
        }
        if (componentCallbacksC1023x.f13275U) {
            return componentCallbacksC1023x.f13265K == null || O(componentCallbacksC1023x.f13268N);
        }
        return false;
    }

    public static boolean P(ComponentCallbacksC1023x componentCallbacksC1023x) {
        if (componentCallbacksC1023x == null) {
            return true;
        }
        P p3 = componentCallbacksC1023x.f13265K;
        return componentCallbacksC1023x.equals(p3.f13091z) && P(p3.f13090y);
    }

    public static void f0(ComponentCallbacksC1023x componentCallbacksC1023x) {
        if (L(2)) {
            Log.v("FragmentManager", "show: " + componentCallbacksC1023x);
        }
        if (componentCallbacksC1023x.f13272R) {
            componentCallbacksC1023x.f13272R = false;
            componentCallbacksC1023x.f13281b0 = !componentCallbacksC1023x.f13281b0;
        }
    }

    /* JADX WARN: Removed duplicated region for block: B:113:0x0224 A[PHI: r14
      0x0224: PHI (r14v20 int) = (r14v19 int), (r14v21 int) binds: [B:106:0x0214, B:111:0x0220] A[DONT_GENERATE, DONT_INLINE]] */
    /* JADX WARN: Removed duplicated region for block: B:66:0x016e  */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public final void A(ArrayList arrayList, ArrayList arrayList2, int i, int i5) {
        Object objPrevious;
        int i8;
        boolean z8;
        int i9;
        boolean z9;
        int i10;
        int i11;
        boolean z10;
        int i12;
        int i13;
        int i14 = i;
        boolean z11 = ((C1001a) arrayList.get(i14)).f13158p;
        ArrayList arrayList3 = this.f13064N;
        if (arrayList3 == null) {
            this.f13064N = new ArrayList();
        } else {
            arrayList3.clear();
        }
        ArrayList arrayList4 = this.f13064N;
        C2.a aVar = this.f13069c;
        arrayList4.addAll(aVar.t());
        ComponentCallbacksC1023x componentCallbacksC1023x = this.f13091z;
        int i15 = i14;
        boolean z12 = false;
        while (true) {
            int i16 = 1;
            if (i15 >= i5) {
                boolean z13 = z11;
                boolean z14 = z12;
                this.f13064N.clear();
                if (!z13 && this.f13087v >= 1) {
                    for (int i17 = i14; i17 < i5; i17++) {
                        ArrayList arrayList5 = ((C1001a) arrayList.get(i17)).f13144a;
                        int size = arrayList5.size();
                        int i18 = 0;
                        while (i18 < size) {
                            Object obj = arrayList5.get(i18);
                            i18++;
                            ComponentCallbacksC1023x componentCallbacksC1023x2 = ((X) obj).f13129b;
                            if (componentCallbacksC1023x2 != null && componentCallbacksC1023x2.f13265K != null) {
                                aVar.y(g(componentCallbacksC1023x2));
                            }
                        }
                    }
                }
                int i19 = i14;
                while (i19 < i5) {
                    C1001a c1001a = (C1001a) arrayList.get(i19);
                    if (((Boolean) arrayList2.get(i19)).booleanValue()) {
                        c1001a.d(-1);
                        ArrayList arrayList6 = c1001a.f13144a;
                        for (int size2 = arrayList6.size() - 1; size2 >= 0; size2--) {
                            X x8 = (X) arrayList6.get(size2);
                            ComponentCallbacksC1023x componentCallbacksC1023x3 = x8.f13129b;
                            if (componentCallbacksC1023x3 != null) {
                                componentCallbacksC1023x3.D = c1001a.f13163u;
                                if (componentCallbacksC1023x3.f13280a0 != null) {
                                    componentCallbacksC1023x3.k().f13246a = true;
                                }
                                int i20 = c1001a.f13149f;
                                int i21 = 8194;
                                int i22 = 4097;
                                if (i20 != 4097) {
                                    if (i20 != 8194) {
                                        i21 = 4100;
                                        i22 = 8197;
                                        if (i20 != 8197) {
                                            i21 = i20 != 4099 ? i20 != 4100 ? 0 : i22 : 4099;
                                        }
                                    }
                                }
                                if (componentCallbacksC1023x3.f13280a0 != null || i21 != 0) {
                                    componentCallbacksC1023x3.k();
                                    componentCallbacksC1023x3.f13280a0.f13251f = i21;
                                }
                                componentCallbacksC1023x3.k();
                                componentCallbacksC1023x3.f13280a0.getClass();
                            }
                            int i23 = x8.f13128a;
                            P p3 = c1001a.f13160r;
                            switch (i23) {
                                case 1:
                                    componentCallbacksC1023x3.c0(x8.f13131d, x8.f13132e, x8.f13133f, x8.f13134g);
                                    p3.b0(componentCallbacksC1023x3, true);
                                    p3.W(componentCallbacksC1023x3);
                                    break;
                                case 2:
                                default:
                                    throw new IllegalArgumentException("Unknown cmd: " + x8.f13128a);
                                case 3:
                                    componentCallbacksC1023x3.c0(x8.f13131d, x8.f13132e, x8.f13133f, x8.f13134g);
                                    p3.a(componentCallbacksC1023x3);
                                    break;
                                case 4:
                                    componentCallbacksC1023x3.c0(x8.f13131d, x8.f13132e, x8.f13133f, x8.f13134g);
                                    p3.getClass();
                                    f0(componentCallbacksC1023x3);
                                    break;
                                case 5:
                                    componentCallbacksC1023x3.c0(x8.f13131d, x8.f13132e, x8.f13133f, x8.f13134g);
                                    p3.b0(componentCallbacksC1023x3, true);
                                    p3.K(componentCallbacksC1023x3);
                                    break;
                                case Z.g.STRING_SET_FIELD_NUMBER /* 6 */:
                                    componentCallbacksC1023x3.c0(x8.f13131d, x8.f13132e, x8.f13133f, x8.f13134g);
                                    p3.c(componentCallbacksC1023x3);
                                    break;
                                case Z.g.DOUBLE_FIELD_NUMBER /* 7 */:
                                    componentCallbacksC1023x3.c0(x8.f13131d, x8.f13132e, x8.f13133f, x8.f13134g);
                                    p3.b0(componentCallbacksC1023x3, true);
                                    p3.h(componentCallbacksC1023x3);
                                    break;
                                case Z.g.BYTES_FIELD_NUMBER /* 8 */:
                                    p3.d0(null);
                                    break;
                                case 9:
                                    p3.d0(componentCallbacksC1023x3);
                                    break;
                                case 10:
                                    p3.c0(componentCallbacksC1023x3, x8.f13135h);
                                    break;
                            }
                        }
                    } else {
                        c1001a.d(1);
                        ArrayList arrayList7 = c1001a.f13144a;
                        int size3 = arrayList7.size();
                        int i24 = 0;
                        while (i24 < size3) {
                            X x9 = (X) arrayList7.get(i24);
                            ComponentCallbacksC1023x componentCallbacksC1023x4 = x9.f13129b;
                            if (componentCallbacksC1023x4 != null) {
                                componentCallbacksC1023x4.D = c1001a.f13163u;
                                if (componentCallbacksC1023x4.f13280a0 != null) {
                                    componentCallbacksC1023x4.k().f13246a = false;
                                }
                                int i25 = c1001a.f13149f;
                                if (componentCallbacksC1023x4.f13280a0 != null || i25 != 0) {
                                    componentCallbacksC1023x4.k();
                                    componentCallbacksC1023x4.f13280a0.f13251f = i25;
                                }
                                componentCallbacksC1023x4.k();
                                componentCallbacksC1023x4.f13280a0.getClass();
                            }
                            int i26 = x9.f13128a;
                            P p4 = c1001a.f13160r;
                            switch (i26) {
                                case 1:
                                    i8 = i19;
                                    componentCallbacksC1023x4.c0(x9.f13131d, x9.f13132e, x9.f13133f, x9.f13134g);
                                    p4.b0(componentCallbacksC1023x4, false);
                                    p4.a(componentCallbacksC1023x4);
                                    i24++;
                                    i19 = i8;
                                    break;
                                case 2:
                                default:
                                    throw new IllegalArgumentException("Unknown cmd: " + x9.f13128a);
                                case 3:
                                    i8 = i19;
                                    componentCallbacksC1023x4.c0(x9.f13131d, x9.f13132e, x9.f13133f, x9.f13134g);
                                    p4.W(componentCallbacksC1023x4);
                                    i24++;
                                    i19 = i8;
                                    break;
                                case 4:
                                    i8 = i19;
                                    componentCallbacksC1023x4.c0(x9.f13131d, x9.f13132e, x9.f13133f, x9.f13134g);
                                    p4.K(componentCallbacksC1023x4);
                                    i24++;
                                    i19 = i8;
                                    break;
                                case 5:
                                    i8 = i19;
                                    componentCallbacksC1023x4.c0(x9.f13131d, x9.f13132e, x9.f13133f, x9.f13134g);
                                    p4.b0(componentCallbacksC1023x4, false);
                                    f0(componentCallbacksC1023x4);
                                    i24++;
                                    i19 = i8;
                                    break;
                                case Z.g.STRING_SET_FIELD_NUMBER /* 6 */:
                                    i8 = i19;
                                    componentCallbacksC1023x4.c0(x9.f13131d, x9.f13132e, x9.f13133f, x9.f13134g);
                                    p4.h(componentCallbacksC1023x4);
                                    i24++;
                                    i19 = i8;
                                    break;
                                case Z.g.DOUBLE_FIELD_NUMBER /* 7 */:
                                    i8 = i19;
                                    componentCallbacksC1023x4.c0(x9.f13131d, x9.f13132e, x9.f13133f, x9.f13134g);
                                    p4.b0(componentCallbacksC1023x4, false);
                                    p4.c(componentCallbacksC1023x4);
                                    i24++;
                                    i19 = i8;
                                    break;
                                case Z.g.BYTES_FIELD_NUMBER /* 8 */:
                                    p4.d0(componentCallbacksC1023x4);
                                    i8 = i19;
                                    i24++;
                                    i19 = i8;
                                    break;
                                case 9:
                                    p4.d0(null);
                                    i8 = i19;
                                    i24++;
                                    i19 = i8;
                                    break;
                                case 10:
                                    p4.c0(componentCallbacksC1023x4, x9.i);
                                    i8 = i19;
                                    i24++;
                                    i19 = i8;
                                    break;
                            }
                        }
                    }
                    i19++;
                }
                boolean zBooleanValue = ((Boolean) arrayList2.get(i5 - 1)).booleanValue();
                ArrayList arrayList8 = this.f13079n;
                if (z14 && !arrayList8.isEmpty()) {
                    LinkedHashSet<ComponentCallbacksC1023x> linkedHashSet = new LinkedHashSet();
                    int size4 = arrayList.size();
                    int i27 = 0;
                    while (i27 < size4) {
                        Object obj2 = arrayList.get(i27);
                        i27++;
                        linkedHashSet.addAll(F((C1001a) obj2));
                    }
                    if (this.f13074h == null) {
                        int size5 = arrayList8.size();
                        int i28 = 0;
                        while (i28 < size5) {
                            Object obj3 = arrayList8.get(i28);
                            i28++;
                            K k8 = (K) obj3;
                            for (ComponentCallbacksC1023x componentCallbacksC1023x5 : linkedHashSet) {
                                k8.getClass();
                            }
                        }
                        int size6 = arrayList8.size();
                        int i29 = 0;
                        while (i29 < size6) {
                            Object obj4 = arrayList8.get(i29);
                            i29++;
                            K k9 = (K) obj4;
                            for (ComponentCallbacksC1023x componentCallbacksC1023x6 : linkedHashSet) {
                                k9.getClass();
                            }
                        }
                    }
                }
                for (int i30 = i14; i30 < i5; i30++) {
                    C1001a c1001a2 = (C1001a) arrayList.get(i30);
                    if (zBooleanValue) {
                        for (int size7 = c1001a2.f13144a.size() - 1; size7 >= 0; size7--) {
                            ComponentCallbacksC1023x componentCallbacksC1023x7 = ((X) c1001a2.f13144a.get(size7)).f13129b;
                            if (componentCallbacksC1023x7 != null) {
                                g(componentCallbacksC1023x7).k();
                            }
                        }
                    } else {
                        ArrayList arrayList9 = c1001a2.f13144a;
                        int size8 = arrayList9.size();
                        int i31 = 0;
                        while (i31 < size8) {
                            Object obj5 = arrayList9.get(i31);
                            i31++;
                            ComponentCallbacksC1023x componentCallbacksC1023x8 = ((X) obj5).f13129b;
                            if (componentCallbacksC1023x8 != null) {
                                g(componentCallbacksC1023x8).k();
                            }
                        }
                    }
                }
                R(this.f13087v, true);
                for (C1013m c1013m : f(arrayList, i14, i5)) {
                    c1013m.f13217e = zBooleanValue;
                    synchronized (c1013m.f13214b) {
                        try {
                            c1013m.l();
                            ArrayList arrayList10 = c1013m.f13214b;
                            ListIterator listIterator = arrayList10.listIterator(arrayList10.size());
                            while (true) {
                                if (listIterator.hasPrevious()) {
                                    objPrevious = listIterator.previous();
                                    b0 b0Var = (b0) objPrevious;
                                    View view = b0Var.f13181c.X;
                                    P6.g.d(view, "operation.fragment.mView");
                                    char c3 = 4;
                                    if (view.getAlpha() != 0.0f || view.getVisibility() != 0) {
                                        int visibility = view.getVisibility();
                                        if (visibility == 0) {
                                            c3 = 2;
                                        } else if (visibility != 4) {
                                            if (visibility != 8) {
                                                throw new IllegalArgumentException("Unknown visibility " + visibility);
                                            }
                                            c3 = 3;
                                        }
                                    }
                                    if (b0Var.f13179a != 2 || c3 == 2) {
                                    }
                                } else {
                                    objPrevious = null;
                                }
                            }
                            c1013m.f13218f = false;
                        } catch (Throwable th) {
                            throw th;
                        }
                    }
                    c1013m.e();
                }
                while (i14 < i5) {
                    C1001a c1001a3 = (C1001a) arrayList.get(i14);
                    if (((Boolean) arrayList2.get(i14)).booleanValue() && c1001a3.f13162t >= 0) {
                        c1001a3.f13162t = -1;
                    }
                    if (c1001a3.f13159q != null) {
                        for (int i32 = 0; i32 < c1001a3.f13159q.size(); i32++) {
                            ((Runnable) c1001a3.f13159q.get(i32)).run();
                        }
                        c1001a3.f13159q = null;
                    }
                    i14++;
                }
                if (z14) {
                    for (int i33 = 0; i33 < arrayList8.size(); i33++) {
                        ((K) arrayList8.get(i33)).a();
                    }
                    return;
                }
                return;
            }
            C1001a c1001a4 = (C1001a) arrayList.get(i15);
            if (((Boolean) arrayList2.get(i15)).booleanValue()) {
                z8 = z11;
                i9 = i15;
                z9 = z12;
                int i34 = 1;
                ArrayList arrayList11 = this.f13064N;
                ArrayList arrayList12 = c1001a4.f13144a;
                int size9 = arrayList12.size() - 1;
                while (size9 >= 0) {
                    X x10 = (X) arrayList12.get(size9);
                    int i35 = x10.f13128a;
                    if (i35 != i34) {
                        if (i35 != 3) {
                            switch (i35) {
                                case Z.g.STRING_SET_FIELD_NUMBER /* 6 */:
                                    arrayList11.add(x10.f13129b);
                                    break;
                                case Z.g.BYTES_FIELD_NUMBER /* 8 */:
                                    componentCallbacksC1023x = null;
                                    break;
                                case 9:
                                    componentCallbacksC1023x = x10.f13129b;
                                    break;
                                case 10:
                                    x10.i = x10.f13135h;
                                    break;
                            }
                        }
                        size9--;
                        i34 = 1;
                    }
                    arrayList11.remove(x10.f13129b);
                    size9--;
                    i34 = 1;
                }
            } else {
                ArrayList arrayList13 = this.f13064N;
                int i36 = 0;
                while (true) {
                    ArrayList arrayList14 = c1001a4.f13144a;
                    if (i36 < arrayList14.size()) {
                        X x11 = (X) arrayList14.get(i36);
                        boolean z15 = z11;
                        int i37 = x11.f13128a;
                        if (i37 != i16) {
                            i10 = i15;
                            if (i37 != 2) {
                                if (i37 == 3 || i37 == 6) {
                                    arrayList13.remove(x11.f13129b);
                                    ComponentCallbacksC1023x componentCallbacksC1023x9 = x11.f13129b;
                                    if (componentCallbacksC1023x9 == componentCallbacksC1023x) {
                                        arrayList14.add(i36, new X(9, componentCallbacksC1023x9));
                                        i36++;
                                        z10 = z12;
                                        componentCallbacksC1023x = null;
                                    }
                                    i11 = 1;
                                } else if (i37 == 7) {
                                    i11 = 1;
                                } else if (i37 == 8) {
                                    arrayList14.add(i36, new X(9, componentCallbacksC1023x, 0));
                                    x11.f13130c = true;
                                    i36++;
                                    componentCallbacksC1023x = x11.f13129b;
                                }
                                z10 = z12;
                                i11 = 1;
                            } else {
                                ComponentCallbacksC1023x componentCallbacksC1023x10 = x11.f13129b;
                                int i38 = componentCallbacksC1023x10.f13270P;
                                int size10 = arrayList13.size() - 1;
                                boolean z16 = false;
                                while (size10 >= 0) {
                                    int i39 = size10;
                                    ComponentCallbacksC1023x componentCallbacksC1023x11 = (ComponentCallbacksC1023x) arrayList13.get(size10);
                                    boolean z17 = z12;
                                    if (componentCallbacksC1023x11.f13270P != i38) {
                                        i12 = i38;
                                    } else if (componentCallbacksC1023x11 == componentCallbacksC1023x10) {
                                        i12 = i38;
                                        z16 = true;
                                    } else {
                                        if (componentCallbacksC1023x11 == componentCallbacksC1023x) {
                                            i12 = i38;
                                            i13 = 0;
                                            arrayList14.add(i36, new X(9, componentCallbacksC1023x11, 0));
                                            i36++;
                                            componentCallbacksC1023x = null;
                                        } else {
                                            i12 = i38;
                                            i13 = 0;
                                        }
                                        X x12 = new X(3, componentCallbacksC1023x11, i13);
                                        x12.f13131d = x11.f13131d;
                                        x12.f13133f = x11.f13133f;
                                        x12.f13132e = x11.f13132e;
                                        x12.f13134g = x11.f13134g;
                                        arrayList14.add(i36, x12);
                                        arrayList13.remove(componentCallbacksC1023x11);
                                        i36++;
                                        componentCallbacksC1023x = componentCallbacksC1023x;
                                    }
                                    size10 = i39 - 1;
                                    i38 = i12;
                                    z12 = z17;
                                }
                                z10 = z12;
                                i11 = 1;
                                if (z16) {
                                    arrayList14.remove(i36);
                                    i36--;
                                } else {
                                    x11.f13128a = 1;
                                    x11.f13130c = true;
                                    arrayList13.add(componentCallbacksC1023x10);
                                }
                            }
                            i36 += i11;
                            i16 = i11;
                            z11 = z15;
                            i15 = i10;
                            z12 = z10;
                        } else {
                            i10 = i15;
                            i11 = i16;
                        }
                        z10 = z12;
                        arrayList13.add(x11.f13129b);
                        i36 += i11;
                        i16 = i11;
                        z11 = z15;
                        i15 = i10;
                        z12 = z10;
                    } else {
                        z8 = z11;
                        i9 = i15;
                        z9 = z12;
                    }
                }
            }
            z12 = z9 || c1001a4.f13150g;
            i15 = i9 + 1;
            z11 = z8;
        }
    }

    public final int B(int i, String str, boolean z8) {
        if (this.f13070d.isEmpty()) {
            return -1;
        }
        if (str == null && i < 0) {
            if (z8) {
                return 0;
            }
            return this.f13070d.size() - 1;
        }
        int size = this.f13070d.size() - 1;
        while (size >= 0) {
            C1001a c1001a = (C1001a) this.f13070d.get(size);
            if ((str != null && str.equals(c1001a.i)) || (i >= 0 && i == c1001a.f13162t)) {
                break;
            }
            size--;
        }
        if (size < 0) {
            return size;
        }
        if (!z8) {
            if (size == this.f13070d.size() - 1) {
                return -1;
            }
            return size + 1;
        }
        while (size > 0) {
            C1001a c1001a2 = (C1001a) this.f13070d.get(size - 1);
            if ((str == null || !str.equals(c1001a2.i)) && (i < 0 || i != c1001a2.f13162t)) {
                break;
            }
            size--;
        }
        return size;
    }

    public final ComponentCallbacksC1023x C(int i) {
        C2.a aVar = this.f13069c;
        ArrayList arrayList = (ArrayList) aVar.f1157r;
        for (int size = arrayList.size() - 1; size >= 0; size--) {
            ComponentCallbacksC1023x componentCallbacksC1023x = (ComponentCallbacksC1023x) arrayList.get(size);
            if (componentCallbacksC1023x != null && componentCallbacksC1023x.f13269O == i) {
                return componentCallbacksC1023x;
            }
        }
        for (W w4 : ((HashMap) aVar.f1158s).values()) {
            if (w4 != null) {
                ComponentCallbacksC1023x componentCallbacksC1023x2 = w4.f13125c;
                if (componentCallbacksC1023x2.f13269O == i) {
                    return componentCallbacksC1023x2;
                }
            }
        }
        return null;
    }

    public final ComponentCallbacksC1023x D(String str) {
        C2.a aVar = this.f13069c;
        if (str != null) {
            ArrayList arrayList = (ArrayList) aVar.f1157r;
            for (int size = arrayList.size() - 1; size >= 0; size--) {
                ComponentCallbacksC1023x componentCallbacksC1023x = (ComponentCallbacksC1023x) arrayList.get(size);
                if (componentCallbacksC1023x != null && str.equals(componentCallbacksC1023x.f13271Q)) {
                    return componentCallbacksC1023x;
                }
            }
        }
        if (str == null) {
            aVar.getClass();
            return null;
        }
        for (W w4 : ((HashMap) aVar.f1158s).values()) {
            if (w4 != null) {
                ComponentCallbacksC1023x componentCallbacksC1023x2 = w4.f13125c;
                if (str.equals(componentCallbacksC1023x2.f13271Q)) {
                    return componentCallbacksC1023x2;
                }
            }
        }
        return null;
    }

    public final void E() {
        for (C1013m c1013m : e()) {
            if (c1013m.f13218f) {
                if (L(2)) {
                    Log.v("FragmentManager", "SpecialEffectsController: Forcing postponed operations");
                }
                c1013m.f13218f = false;
                c1013m.e();
            }
        }
    }

    public final int G() {
        return this.f13070d.size() + (this.f13074h != null ? 1 : 0);
    }

    public final ViewGroup H(ComponentCallbacksC1023x componentCallbacksC1023x) {
        ViewGroup viewGroup = componentCallbacksC1023x.f13277W;
        if (viewGroup != null) {
            return viewGroup;
        }
        if (componentCallbacksC1023x.f13270P <= 0 || !this.f13089x.w()) {
            return null;
        }
        View viewV = this.f13089x.v(componentCallbacksC1023x.f13270P);
        if (viewV instanceof ViewGroup) {
            return (ViewGroup) viewV;
        }
        return null;
    }

    public final C1000H I() {
        ComponentCallbacksC1023x componentCallbacksC1023x = this.f13090y;
        return componentCallbacksC1023x != null ? componentCallbacksC1023x.f13265K.I() : this.f13053A;
    }

    public final d3.C J() {
        ComponentCallbacksC1023x componentCallbacksC1023x = this.f13090y;
        return componentCallbacksC1023x != null ? componentCallbacksC1023x.f13265K.J() : this.f13054B;
    }

    public final void K(ComponentCallbacksC1023x componentCallbacksC1023x) {
        if (L(2)) {
            Log.v("FragmentManager", "hide: " + componentCallbacksC1023x);
        }
        if (componentCallbacksC1023x.f13272R) {
            return;
        }
        componentCallbacksC1023x.f13272R = true;
        componentCallbacksC1023x.f13281b0 = true ^ componentCallbacksC1023x.f13281b0;
        e0(componentCallbacksC1023x);
    }

    public final boolean N() {
        ComponentCallbacksC1023x componentCallbacksC1023x = this.f13090y;
        if (componentCallbacksC1023x == null) {
            return true;
        }
        return componentCallbacksC1023x.f13266L != null && componentCallbacksC1023x.f13257A && componentCallbacksC1023x.q().N();
    }

    public final boolean Q() {
        return this.H || this.f13059I;
    }

    public final void R(int i, boolean z8) {
        HashMap map;
        C1025z c1025z;
        if (this.f13088w == null && i != -1) {
            throw new IllegalStateException("No activity");
        }
        if (z8 || i != this.f13087v) {
            this.f13087v = i;
            C2.a aVar = this.f13069c;
            ArrayList arrayList = (ArrayList) aVar.f1157r;
            int size = arrayList.size();
            int i5 = 0;
            while (true) {
                map = (HashMap) aVar.f1158s;
                if (i5 >= size) {
                    break;
                }
                Object obj = arrayList.get(i5);
                i5++;
                W w4 = (W) map.get(((ComponentCallbacksC1023x) obj).f13297u);
                if (w4 != null) {
                    w4.k();
                }
            }
            for (W w6 : map.values()) {
                if (w6 != null) {
                    w6.k();
                    ComponentCallbacksC1023x componentCallbacksC1023x = w6.f13125c;
                    if (componentCallbacksC1023x.f13258B && !componentCallbacksC1023x.z()) {
                        if (componentCallbacksC1023x.D && !((HashMap) aVar.f1159t).containsKey(componentCallbacksC1023x.f13297u)) {
                            aVar.L(componentCallbacksC1023x.f13297u, w6.o());
                        }
                        aVar.z(w6);
                    }
                }
            }
            g0();
            if (this.f13058G && (c1025z = this.f13088w) != null && this.f13087v == 7) {
                c1025z.f13309x.invalidateOptionsMenu();
                this.f13058G = false;
            }
        }
    }

    public final void S() {
        if (this.f13088w == null) {
            return;
        }
        this.H = false;
        this.f13059I = false;
        this.f13065O.f13106g = false;
        for (ComponentCallbacksC1023x componentCallbacksC1023x : this.f13069c.t()) {
            if (componentCallbacksC1023x != null) {
                componentCallbacksC1023x.f13267M.S();
            }
        }
    }

    public final boolean T() {
        return U(-1, 0);
    }

    public final boolean U(int i, int i5) {
        z(false);
        y(true);
        ComponentCallbacksC1023x componentCallbacksC1023x = this.f13091z;
        if (componentCallbacksC1023x != null && i < 0 && componentCallbacksC1023x.n().T()) {
            return true;
        }
        boolean zV = V(this.f13062L, this.f13063M, null, i, i5);
        if (zV) {
            this.f13068b = true;
            try {
                X(this.f13062L, this.f13063M);
            } finally {
                d();
            }
        }
        i0();
        if (this.f13061K) {
            this.f13061K = false;
            g0();
        }
        ((HashMap) this.f13069c.f1158s).values().removeAll(Collections.singleton(null));
        return zV;
    }

    public final boolean V(ArrayList arrayList, ArrayList arrayList2, String str, int i, int i5) {
        int iB = B(i, str, (i5 & 1) != 0);
        if (iB < 0) {
            return false;
        }
        for (int size = this.f13070d.size() - 1; size >= iB; size--) {
            arrayList.add((C1001a) this.f13070d.remove(size));
            arrayList2.add(Boolean.TRUE);
        }
        return true;
    }

    public final void W(ComponentCallbacksC1023x componentCallbacksC1023x) {
        if (L(2)) {
            Log.v("FragmentManager", "remove: " + componentCallbacksC1023x + " nesting=" + componentCallbacksC1023x.f13264J);
        }
        boolean z8 = componentCallbacksC1023x.z();
        if (componentCallbacksC1023x.f13273S && z8) {
            return;
        }
        C2.a aVar = this.f13069c;
        synchronized (((ArrayList) aVar.f1157r)) {
            ((ArrayList) aVar.f1157r).remove(componentCallbacksC1023x);
        }
        componentCallbacksC1023x.f13257A = false;
        if (M(componentCallbacksC1023x)) {
            this.f13058G = true;
        }
        componentCallbacksC1023x.f13258B = true;
        e0(componentCallbacksC1023x);
    }

    public final void X(ArrayList arrayList, ArrayList arrayList2) {
        if (arrayList.isEmpty()) {
            return;
        }
        if (arrayList.size() != arrayList2.size()) {
            throw new IllegalStateException("Internal error with the back stack records");
        }
        int size = arrayList.size();
        int i = 0;
        int i5 = 0;
        while (i < size) {
            if (!((C1001a) arrayList.get(i)).f13158p) {
                if (i5 != i) {
                    A(arrayList, arrayList2, i5, i);
                }
                i5 = i + 1;
                if (((Boolean) arrayList2.get(i)).booleanValue()) {
                    while (i5 < size && ((Boolean) arrayList2.get(i5)).booleanValue() && !((C1001a) arrayList.get(i5)).f13158p) {
                        i5++;
                    }
                }
                A(arrayList, arrayList2, i, i5);
                i = i5 - 1;
            }
            i++;
        }
        if (i5 != size) {
            A(arrayList, arrayList2, i5, size);
        }
    }

    public final void Y(Bundle bundle) {
        C0853a c0853a;
        int i;
        Bundle bundle2;
        W w4;
        Bundle bundle3;
        Bundle bundle4;
        for (String str : bundle.keySet()) {
            if (str.startsWith("result_") && (bundle4 = bundle.getBundle(str)) != null) {
                bundle4.setClassLoader(this.f13088w.f13306u.getClassLoader());
                this.f13078m.put(str.substring(7), bundle4);
            }
        }
        HashMap map = new HashMap();
        for (String str2 : bundle.keySet()) {
            if (str2.startsWith("fragment_") && (bundle3 = bundle.getBundle(str2)) != null) {
                bundle3.setClassLoader(this.f13088w.f13306u.getClassLoader());
                map.put(str2.substring(9), bundle3);
            }
        }
        C2.a aVar = this.f13069c;
        HashMap map2 = (HashMap) aVar.f1159t;
        map2.clear();
        map2.putAll(map);
        Q q8 = (Q) bundle.getParcelable("state");
        if (q8 == null) {
            return;
        }
        HashMap map3 = (HashMap) aVar.f1158s;
        map3.clear();
        ArrayList arrayList = q8.f13092q;
        int size = arrayList.size();
        int i5 = 0;
        while (true) {
            c0853a = this.f13080o;
            if (i5 >= size) {
                break;
            }
            Object obj = arrayList.get(i5);
            i5++;
            Bundle bundleL = aVar.L((String) obj, null);
            if (bundleL != null) {
                ComponentCallbacksC1023x componentCallbacksC1023x = (ComponentCallbacksC1023x) this.f13065O.f13101b.get(((U) bundleL.getParcelable("state")).f13112r);
                if (componentCallbacksC1023x != null) {
                    if (L(2)) {
                        i = 2;
                        Log.v("FragmentManager", "restoreSaveState: re-attaching retained " + componentCallbacksC1023x);
                    } else {
                        i = 2;
                    }
                    w4 = new W(c0853a, aVar, componentCallbacksC1023x, bundleL);
                    bundle2 = bundleL;
                } else {
                    i = 2;
                    bundle2 = bundleL;
                    w4 = new W(this.f13080o, this.f13069c, this.f13088w.f13306u.getClassLoader(), I(), bundleL);
                }
                ComponentCallbacksC1023x componentCallbacksC1023x2 = w4.f13125c;
                componentCallbacksC1023x2.f13294r = bundle2;
                componentCallbacksC1023x2.f13265K = this;
                if (L(i)) {
                    Log.v("FragmentManager", "restoreSaveState: active (" + componentCallbacksC1023x2.f13297u + "): " + componentCallbacksC1023x2);
                }
                w4.m(this.f13088w.f13306u.getClassLoader());
                aVar.y(w4);
                w4.f13127e = this.f13087v;
            }
        }
        S s8 = this.f13065O;
        s8.getClass();
        ArrayList arrayList2 = new ArrayList(s8.f13101b.values());
        int size2 = arrayList2.size();
        int i8 = 0;
        while (i8 < size2) {
            Object obj2 = arrayList2.get(i8);
            i8++;
            ComponentCallbacksC1023x componentCallbacksC1023x3 = (ComponentCallbacksC1023x) obj2;
            if (map3.get(componentCallbacksC1023x3.f13297u) == null) {
                if (L(2)) {
                    Log.v("FragmentManager", "Discarding retained Fragment " + componentCallbacksC1023x3 + " that was not found in the set of active Fragments " + q8.f13092q);
                }
                this.f13065O.h(componentCallbacksC1023x3);
                componentCallbacksC1023x3.f13265K = this;
                W w6 = new W(c0853a, aVar, componentCallbacksC1023x3);
                w6.f13127e = 1;
                w6.k();
                componentCallbacksC1023x3.f13258B = true;
                w6.k();
            }
        }
        ArrayList arrayList3 = q8.f13093r;
        ((ArrayList) aVar.f1157r).clear();
        if (arrayList3 != null) {
            int size3 = arrayList3.size();
            int i9 = 0;
            while (i9 < size3) {
                Object obj3 = arrayList3.get(i9);
                i9++;
                String str3 = (String) obj3;
                ComponentCallbacksC1023x componentCallbacksC1023xM = aVar.m(str3);
                if (componentCallbacksC1023xM == null) {
                    throw new IllegalStateException(I1.a.p("No instantiated fragment for (", str3, ")"));
                }
                if (L(2)) {
                    Log.v("FragmentManager", "restoreSaveState: added (" + str3 + "): " + componentCallbacksC1023xM);
                }
                aVar.c(componentCallbacksC1023xM);
            }
        }
        if (q8.f13094s != null) {
            this.f13070d = new ArrayList(q8.f13094s.length);
            int i10 = 0;
            while (true) {
                C1002b[] c1002bArr = q8.f13094s;
                if (i10 >= c1002bArr.length) {
                    break;
                }
                C1002b c1002b = c1002bArr[i10];
                c1002b.getClass();
                C1001a c1001a = new C1001a(this);
                c1002b.a(c1001a);
                c1001a.f13162t = c1002b.f13175w;
                int i11 = 0;
                while (true) {
                    ArrayList arrayList4 = c1002b.f13170r;
                    if (i11 >= arrayList4.size()) {
                        break;
                    }
                    String str4 = (String) arrayList4.get(i11);
                    if (str4 != null) {
                        ((X) c1001a.f13144a.get(i11)).f13129b = aVar.m(str4);
                    }
                    i11++;
                }
                c1001a.d(1);
                if (L(2)) {
                    StringBuilder sbO = AbstractC0844a.o(i10, "restoreAllState: back stack #", " (index ");
                    sbO.append(c1001a.f13162t);
                    sbO.append("): ");
                    sbO.append(c1001a);
                    Log.v("FragmentManager", sbO.toString());
                    PrintWriter printWriter = new PrintWriter(new Z());
                    c1001a.i("  ", printWriter, false);
                    printWriter.close();
                }
                this.f13070d.add(c1001a);
                i10++;
            }
        } else {
            this.f13070d = new ArrayList();
        }
        this.f13076k.set(q8.f13095t);
        String str5 = q8.f13096u;
        if (str5 != null) {
            ComponentCallbacksC1023x componentCallbacksC1023xM2 = aVar.m(str5);
            this.f13091z = componentCallbacksC1023xM2;
            r(componentCallbacksC1023xM2);
        }
        ArrayList arrayList5 = q8.f13097v;
        if (arrayList5 != null) {
            for (int i12 = 0; i12 < arrayList5.size(); i12++) {
                this.f13077l.put((String) arrayList5.get(i12), (C1003c) q8.f13098w.get(i12));
            }
        }
        this.f13057F = new ArrayDeque(q8.f13099x);
    }

    public final Bundle Z() {
        int i;
        ArrayList arrayList;
        C1002b[] c1002bArr;
        Bundle bundle = new Bundle();
        E();
        w();
        z(true);
        this.H = true;
        this.f13065O.f13106g = true;
        C2.a aVar = this.f13069c;
        aVar.getClass();
        HashMap map = (HashMap) aVar.f1158s;
        ArrayList arrayList2 = new ArrayList(map.size());
        for (W w4 : map.values()) {
            if (w4 != null) {
                ComponentCallbacksC1023x componentCallbacksC1023x = w4.f13125c;
                aVar.L(componentCallbacksC1023x.f13297u, w4.o());
                arrayList2.add(componentCallbacksC1023x.f13297u);
                if (L(2)) {
                    Log.v("FragmentManager", "Saved state of " + componentCallbacksC1023x + ": " + componentCallbacksC1023x.f13294r);
                }
            }
        }
        HashMap map2 = (HashMap) this.f13069c.f1159t;
        if (!map2.isEmpty()) {
            C2.a aVar2 = this.f13069c;
            synchronized (((ArrayList) aVar2.f1157r)) {
                try {
                    if (((ArrayList) aVar2.f1157r).isEmpty()) {
                        arrayList = null;
                    } else {
                        arrayList = new ArrayList(((ArrayList) aVar2.f1157r).size());
                        ArrayList arrayList3 = (ArrayList) aVar2.f1157r;
                        int size = arrayList3.size();
                        int i5 = 0;
                        while (i5 < size) {
                            Object obj = arrayList3.get(i5);
                            i5++;
                            ComponentCallbacksC1023x componentCallbacksC1023x2 = (ComponentCallbacksC1023x) obj;
                            arrayList.add(componentCallbacksC1023x2.f13297u);
                            if (L(2)) {
                                Log.v("FragmentManager", "saveAllState: adding fragment (" + componentCallbacksC1023x2.f13297u + "): " + componentCallbacksC1023x2);
                            }
                        }
                    }
                } finally {
                }
            }
            int size2 = this.f13070d.size();
            if (size2 > 0) {
                c1002bArr = new C1002b[size2];
                for (i = 0; i < size2; i++) {
                    c1002bArr[i] = new C1002b((C1001a) this.f13070d.get(i));
                    if (L(2)) {
                        StringBuilder sbO = AbstractC0844a.o(i, "saveAllState: adding back stack #", ": ");
                        sbO.append(this.f13070d.get(i));
                        Log.v("FragmentManager", sbO.toString());
                    }
                }
            } else {
                c1002bArr = null;
            }
            Q q8 = new Q();
            q8.f13096u = null;
            ArrayList arrayList4 = new ArrayList();
            q8.f13097v = arrayList4;
            ArrayList arrayList5 = new ArrayList();
            q8.f13098w = arrayList5;
            q8.f13092q = arrayList2;
            q8.f13093r = arrayList;
            q8.f13094s = c1002bArr;
            q8.f13095t = this.f13076k.get();
            ComponentCallbacksC1023x componentCallbacksC1023x3 = this.f13091z;
            if (componentCallbacksC1023x3 != null) {
                q8.f13096u = componentCallbacksC1023x3.f13297u;
            }
            arrayList4.addAll(this.f13077l.keySet());
            arrayList5.addAll(this.f13077l.values());
            q8.f13099x = new ArrayList(this.f13057F);
            bundle.putParcelable("state", q8);
            for (String str : this.f13078m.keySet()) {
                bundle.putBundle(AbstractC0844a.x("result_", str), (Bundle) this.f13078m.get(str));
            }
            for (String str2 : map2.keySet()) {
                bundle.putBundle(AbstractC0844a.x("fragment_", str2), (Bundle) map2.get(str2));
            }
        } else if (L(2)) {
            Log.v("FragmentManager", "saveAllState: no fragments!");
            return bundle;
        }
        return bundle;
    }

    public final W a(ComponentCallbacksC1023x componentCallbacksC1023x) {
        String str = componentCallbacksC1023x.f13283d0;
        if (str != null) {
            AbstractC1048d.c(componentCallbacksC1023x, str);
        }
        if (L(2)) {
            Log.v("FragmentManager", "add: " + componentCallbacksC1023x);
        }
        W wG = g(componentCallbacksC1023x);
        componentCallbacksC1023x.f13265K = this;
        C2.a aVar = this.f13069c;
        aVar.y(wG);
        if (!componentCallbacksC1023x.f13273S) {
            aVar.c(componentCallbacksC1023x);
            componentCallbacksC1023x.f13258B = false;
            if (componentCallbacksC1023x.X == null) {
                componentCallbacksC1023x.f13281b0 = false;
            }
            if (M(componentCallbacksC1023x)) {
                this.f13058G = true;
            }
        }
        return wG;
    }

    public final void a0() {
        synchronized (this.f13067a) {
            try {
                if (this.f13067a.size() == 1) {
                    this.f13088w.f13307v.removeCallbacks(this.f13066P);
                    this.f13088w.f13307v.post(this.f13066P);
                    i0();
                }
            } catch (Throwable th) {
                throw th;
            }
        }
    }

    public final void b(C1025z c1025z, AbstractC0386a abstractC0386a, ComponentCallbacksC1023x componentCallbacksC1023x) {
        if (this.f13088w != null) {
            throw new IllegalStateException("Already attached");
        }
        this.f13088w = c1025z;
        this.f13089x = abstractC0386a;
        this.f13090y = componentCallbacksC1023x;
        CopyOnWriteArrayList copyOnWriteArrayList = this.f13081p;
        if (componentCallbacksC1023x != null) {
            copyOnWriteArrayList.add(new I(componentCallbacksC1023x));
        } else if (c1025z != null) {
            copyOnWriteArrayList.add(c1025z);
        }
        if (this.f13090y != null) {
            i0();
        }
        if (c1025z != null) {
            d.x xVarG = c1025z.f13309x.g();
            this.f13073g = xVarG;
            xVarG.a(componentCallbacksC1023x != null ? componentCallbacksC1023x : c1025z, this.f13075j);
        }
        if (componentCallbacksC1023x != null) {
            S s8 = componentCallbacksC1023x.f13265K.f13065O;
            HashMap map = s8.f13102c;
            S s9 = (S) map.get(componentCallbacksC1023x.f13297u);
            if (s9 == null) {
                s9 = new S(s8.f13104e);
                map.put(componentCallbacksC1023x.f13297u, s9);
            }
            this.f13065O = s9;
        } else if (c1025z != null) {
            androidx.lifecycle.Z zR = c1025z.f13309x.r();
            C0113u c0113u = S.f13100h;
            P6.g.e(zR, "store");
            C1482a c1482a = C1482a.f16347b;
            P6.g.e(c1482a, "defaultCreationExtras");
            C2.a aVar = new C2.a(zR, c0113u, c1482a);
            P6.d dVarA = P6.n.a(S.class);
            String strB = dVarA.b();
            if (strB == null) {
                throw new IllegalArgumentException("Local and anonymous classes can not be ViewModels");
            }
            this.f13065O = (S) aVar.v(dVarA, "androidx.lifecycle.ViewModelProvider.DefaultKey:".concat(strB));
        } else {
            this.f13065O = new S(false);
        }
        this.f13065O.f13106g = Q();
        this.f13069c.f1160u = this.f13065O;
        C1025z c1025z2 = this.f13088w;
        if (c1025z2 != null && componentCallbacksC1023x == null) {
            C0225a c0225aH = c1025z2.h();
            c0225aH.t("android:support:fragments", new C0997E(0, this));
            Bundle bundleH = c0225aH.h("android:support:fragments");
            if (bundleH != null) {
                Y(bundleH);
            }
        }
        C1025z c1025z3 = this.f13088w;
        if (c1025z3 != null) {
            AbstractActivityC1764i abstractActivityC1764i = c1025z3.f13309x;
            String strX = AbstractC0844a.x("FragmentManager:", componentCallbacksC1023x != null ? I1.a.r(new StringBuilder(), componentCallbacksC1023x.f13297u, ":") : "");
            String strL = AbstractC0844a.l(strX, "StartActivityForResult");
            C0968a c0968a = new C0968a(2);
            C0998F c0998f = new C0998F(this, 1);
            d.g gVar = abstractActivityC1764i.f11289A;
            this.f13055C = gVar.c(strL, c0968a, c0998f);
            this.D = gVar.c(AbstractC0844a.l(strX, "StartIntentSenderForResult"), new C0968a(3), new C0998F(this, 2));
            this.f13056E = gVar.c(AbstractC0844a.l(strX, "RequestPermissions"), new C0968a(0), new C0998F(this, 0));
        }
        C1025z c1025z4 = this.f13088w;
        if (c1025z4 != null) {
            c1025z4.f13309x.J(this.f13082q);
        }
        C1025z c1025z5 = this.f13088w;
        if (c1025z5 != null) {
            c1025z5.f13309x.f11291C.add(this.f13083r);
        }
        C1025z c1025z6 = this.f13088w;
        if (c1025z6 != null) {
            c1025z6.f13309x.f11292E.add(this.f13084s);
        }
        C1025z c1025z7 = this.f13088w;
        if (c1025z7 != null) {
            c1025z7.f13309x.f11293F.add(this.f13085t);
        }
        C1025z c1025z8 = this.f13088w;
        if (c1025z8 == null || componentCallbacksC1023x != null) {
            return;
        }
        AbstractActivityC1764i abstractActivityC1764i2 = c1025z8.f13309x;
        C0999G c0999g = this.f13086u;
        A1.y yVar = abstractActivityC1764i2.f11296s;
        ((CopyOnWriteArrayList) yVar.f364s).add(c0999g);
        ((Runnable) yVar.f363r).run();
    }

    public final void b0(ComponentCallbacksC1023x componentCallbacksC1023x, boolean z8) {
        ViewGroup viewGroupH = H(componentCallbacksC1023x);
        if (viewGroupH == null || !(viewGroupH instanceof FragmentContainerView)) {
            return;
        }
        ((FragmentContainerView) viewGroupH).setDrawDisappearingViewsLast(!z8);
    }

    public final void c(ComponentCallbacksC1023x componentCallbacksC1023x) {
        if (L(2)) {
            Log.v("FragmentManager", "attach: " + componentCallbacksC1023x);
        }
        if (componentCallbacksC1023x.f13273S) {
            componentCallbacksC1023x.f13273S = false;
            if (componentCallbacksC1023x.f13257A) {
                return;
            }
            this.f13069c.c(componentCallbacksC1023x);
            if (L(2)) {
                Log.v("FragmentManager", "add from attach: " + componentCallbacksC1023x);
            }
            if (M(componentCallbacksC1023x)) {
                this.f13058G = true;
            }
        }
    }

    public final void c0(ComponentCallbacksC1023x componentCallbacksC1023x, EnumC0510o enumC0510o) {
        if (componentCallbacksC1023x.equals(this.f13069c.m(componentCallbacksC1023x.f13297u)) && (componentCallbacksC1023x.f13266L == null || componentCallbacksC1023x.f13265K == this)) {
            componentCallbacksC1023x.f13284e0 = enumC0510o;
            return;
        }
        throw new IllegalArgumentException("Fragment " + componentCallbacksC1023x + " is not an active fragment of FragmentManager " + this);
    }

    public final void d() {
        this.f13068b = false;
        this.f13063M.clear();
        this.f13062L.clear();
    }

    public final void d0(ComponentCallbacksC1023x componentCallbacksC1023x) {
        if (componentCallbacksC1023x != null) {
            if (!componentCallbacksC1023x.equals(this.f13069c.m(componentCallbacksC1023x.f13297u)) || (componentCallbacksC1023x.f13266L != null && componentCallbacksC1023x.f13265K != this)) {
                throw new IllegalArgumentException("Fragment " + componentCallbacksC1023x + " is not an active fragment of FragmentManager " + this);
            }
        }
        ComponentCallbacksC1023x componentCallbacksC1023x2 = this.f13091z;
        this.f13091z = componentCallbacksC1023x;
        r(componentCallbacksC1023x2);
        r(this.f13091z);
    }

    public final HashSet e() {
        C1013m c1013m;
        HashSet hashSet = new HashSet();
        ArrayList arrayListQ = this.f13069c.q();
        int size = arrayListQ.size();
        int i = 0;
        while (i < size) {
            Object obj = arrayListQ.get(i);
            i++;
            ViewGroup viewGroup = ((W) obj).f13125c.f13277W;
            if (viewGroup != null) {
                P6.g.e(J(), "factory");
                Object tag = viewGroup.getTag(R.id.special_effects_controller_view_tag);
                if (tag instanceof C1013m) {
                    c1013m = (C1013m) tag;
                } else {
                    c1013m = new C1013m(viewGroup);
                    viewGroup.setTag(R.id.special_effects_controller_view_tag, c1013m);
                }
                hashSet.add(c1013m);
            }
        }
        return hashSet;
    }

    public final void e0(ComponentCallbacksC1023x componentCallbacksC1023x) {
        ViewGroup viewGroupH = H(componentCallbacksC1023x);
        if (viewGroupH != null) {
            C1021v c1021v = componentCallbacksC1023x.f13280a0;
            if ((c1021v == null ? 0 : c1021v.f13250e) + (c1021v == null ? 0 : c1021v.f13249d) + (c1021v == null ? 0 : c1021v.f13248c) + (c1021v == null ? 0 : c1021v.f13247b) > 0) {
                if (viewGroupH.getTag(R.id.visible_removing_fragment_view_tag) == null) {
                    viewGroupH.setTag(R.id.visible_removing_fragment_view_tag, componentCallbacksC1023x);
                }
                ComponentCallbacksC1023x componentCallbacksC1023x2 = (ComponentCallbacksC1023x) viewGroupH.getTag(R.id.visible_removing_fragment_view_tag);
                C1021v c1021v2 = componentCallbacksC1023x.f13280a0;
                boolean z8 = c1021v2 != null ? c1021v2.f13246a : false;
                if (componentCallbacksC1023x2.f13280a0 == null) {
                    return;
                }
                componentCallbacksC1023x2.k().f13246a = z8;
            }
        }
    }

    public final HashSet f(ArrayList arrayList, int i, int i5) {
        ViewGroup viewGroup;
        HashSet hashSet = new HashSet();
        while (i < i5) {
            ArrayList arrayList2 = ((C1001a) arrayList.get(i)).f13144a;
            int size = arrayList2.size();
            int i8 = 0;
            while (i8 < size) {
                Object obj = arrayList2.get(i8);
                i8++;
                ComponentCallbacksC1023x componentCallbacksC1023x = ((X) obj).f13129b;
                if (componentCallbacksC1023x != null && (viewGroup = componentCallbacksC1023x.f13277W) != null) {
                    hashSet.add(C1013m.i(viewGroup, this));
                }
            }
            i++;
        }
        return hashSet;
    }

    public final W g(ComponentCallbacksC1023x componentCallbacksC1023x) {
        String str = componentCallbacksC1023x.f13297u;
        C2.a aVar = this.f13069c;
        W w4 = (W) ((HashMap) aVar.f1158s).get(str);
        if (w4 != null) {
            return w4;
        }
        W w6 = new W(this.f13080o, aVar, componentCallbacksC1023x);
        w6.m(this.f13088w.f13306u.getClassLoader());
        w6.f13127e = this.f13087v;
        return w6;
    }

    public final void g0() {
        ArrayList arrayListQ = this.f13069c.q();
        int size = arrayListQ.size();
        int i = 0;
        while (i < size) {
            Object obj = arrayListQ.get(i);
            i++;
            W w4 = (W) obj;
            ComponentCallbacksC1023x componentCallbacksC1023x = w4.f13125c;
            if (componentCallbacksC1023x.f13278Y) {
                if (this.f13068b) {
                    this.f13061K = true;
                } else {
                    componentCallbacksC1023x.f13278Y = false;
                    w4.k();
                }
            }
        }
    }

    public final void h(ComponentCallbacksC1023x componentCallbacksC1023x) {
        if (L(2)) {
            Log.v("FragmentManager", "detach: " + componentCallbacksC1023x);
        }
        if (componentCallbacksC1023x.f13273S) {
            return;
        }
        componentCallbacksC1023x.f13273S = true;
        if (componentCallbacksC1023x.f13257A) {
            if (L(2)) {
                Log.v("FragmentManager", "remove from detach: " + componentCallbacksC1023x);
            }
            C2.a aVar = this.f13069c;
            synchronized (((ArrayList) aVar.f1157r)) {
                ((ArrayList) aVar.f1157r).remove(componentCallbacksC1023x);
            }
            componentCallbacksC1023x.f13257A = false;
            if (M(componentCallbacksC1023x)) {
                this.f13058G = true;
            }
            e0(componentCallbacksC1023x);
        }
    }

    public final void h0(RuntimeException runtimeException) {
        Log.e("FragmentManager", runtimeException.getMessage());
        Log.e("FragmentManager", "Activity state:");
        PrintWriter printWriter = new PrintWriter(new Z());
        C1025z c1025z = this.f13088w;
        if (c1025z == null) {
            try {
                v("  ", null, printWriter, new String[0]);
                throw runtimeException;
            } catch (Exception e8) {
                Log.e("FragmentManager", "Failed dumping state", e8);
                throw runtimeException;
            }
        }
        try {
            c1025z.f13309x.dump("  ", null, printWriter, new String[0]);
            throw runtimeException;
        } catch (Exception e9) {
            Log.e("FragmentManager", "Failed dumping state", e9);
            throw runtimeException;
        }
    }

    public final void i(boolean z8) {
        if (z8 && this.f13088w != null) {
            h0(new IllegalStateException("Do not call dispatchConfigurationChanged() on host. Host implements OnConfigurationChangedProvider and automatically dispatches configuration changes to fragments."));
            throw null;
        }
        for (ComponentCallbacksC1023x componentCallbacksC1023x : this.f13069c.t()) {
            if (componentCallbacksC1023x != null) {
                componentCallbacksC1023x.f13276V = true;
                if (z8) {
                    componentCallbacksC1023x.f13267M.i(true);
                }
            }
        }
    }

    public final void i0() {
        synchronized (this.f13067a) {
            try {
                if (!this.f13067a.isEmpty()) {
                    this.f13075j.e(true);
                    if (L(3)) {
                        Log.d("FragmentManager", "FragmentManager " + this + " enabling OnBackPressedCallback, caused by non-empty pending actions");
                    }
                    return;
                }
                boolean z8 = G() > 0 && P(this.f13090y);
                if (L(3)) {
                    Log.d("FragmentManager", "OnBackPressedCallback for FragmentManager " + this + " enabled state is " + z8);
                }
                this.f13075j.e(z8);
            } catch (Throwable th) {
                throw th;
            }
        }
    }

    public final boolean j() {
        if (this.f13087v < 1) {
            return false;
        }
        for (ComponentCallbacksC1023x componentCallbacksC1023x : this.f13069c.t()) {
            if (componentCallbacksC1023x != null) {
                if (!componentCallbacksC1023x.f13272R ? componentCallbacksC1023x.f13267M.j() : false) {
                    return true;
                }
            }
        }
        return false;
    }

    public final boolean k() {
        if (this.f13087v < 1) {
            return false;
        }
        ArrayList arrayList = null;
        boolean z8 = false;
        for (ComponentCallbacksC1023x componentCallbacksC1023x : this.f13069c.t()) {
            if (componentCallbacksC1023x != null && O(componentCallbacksC1023x)) {
                if (!componentCallbacksC1023x.f13272R ? componentCallbacksC1023x.f13267M.k() : false) {
                    if (arrayList == null) {
                        arrayList = new ArrayList();
                    }
                    arrayList.add(componentCallbacksC1023x);
                    z8 = true;
                }
            }
        }
        if (this.f13071e != null) {
            for (int i = 0; i < this.f13071e.size(); i++) {
                ComponentCallbacksC1023x componentCallbacksC1023x2 = (ComponentCallbacksC1023x) this.f13071e.get(i);
                if (arrayList == null || !arrayList.contains(componentCallbacksC1023x2)) {
                    componentCallbacksC1023x2.getClass();
                }
            }
        }
        this.f13071e = arrayList;
        return z8;
    }

    public final void l() {
        boolean z8;
        this.f13060J = true;
        z(true);
        w();
        C1025z c1025z = this.f13088w;
        boolean z9 = c1025z != null;
        C2.a aVar = this.f13069c;
        if (z9) {
            z8 = ((S) aVar.f1160u).f13105f;
        } else {
            z8 = AbstractC0844a.w(c1025z.f13306u) ? !r1.isChangingConfigurations() : true;
        }
        if (z8) {
            Iterator it = this.f13077l.values().iterator();
            while (it.hasNext()) {
                ArrayList arrayList = ((C1003c) it.next()).f13190q;
                int size = arrayList.size();
                int i = 0;
                while (i < size) {
                    Object obj = arrayList.get(i);
                    i++;
                    ((S) aVar.f1160u).f((String) obj, false);
                }
            }
        }
        u(-1);
        C1025z c1025z2 = this.f13088w;
        if (c1025z2 != null) {
            c1025z2.f13309x.f11291C.remove(this.f13083r);
        }
        C1025z c1025z3 = this.f13088w;
        if (c1025z3 != null) {
            c1025z3.f13309x.f11290B.remove(this.f13082q);
        }
        C1025z c1025z4 = this.f13088w;
        if (c1025z4 != null) {
            c1025z4.f13309x.f11292E.remove(this.f13084s);
        }
        C1025z c1025z5 = this.f13088w;
        if (c1025z5 != null) {
            c1025z5.f13309x.f11293F.remove(this.f13085t);
        }
        C1025z c1025z6 = this.f13088w;
        if ((c1025z6 != null) && this.f13090y == null) {
            AbstractActivityC1764i abstractActivityC1764i = c1025z6.f13309x;
            C0999G c0999g = this.f13086u;
            A1.y yVar = abstractActivityC1764i.f11296s;
            ((CopyOnWriteArrayList) yVar.f364s).remove(c0999g);
            if (((HashMap) yVar.f365t).remove(c0999g) != null) {
                throw new ClassCastException();
            }
            ((Runnable) yVar.f363r).run();
        }
        this.f13088w = null;
        this.f13089x = null;
        this.f13090y = null;
        if (this.f13073g != null) {
            Iterator it2 = this.f13075j.f11308b.iterator();
            while (it2.hasNext()) {
                ((d.c) it2.next()).cancel();
            }
            this.f13073g = null;
        }
        C0897e c0897e = this.f13055C;
        if (c0897e != null) {
            c0897e.b();
            this.D.b();
            this.f13056E.b();
        }
    }

    public final void m(boolean z8) {
        if (z8 && this.f13088w != null) {
            h0(new IllegalStateException("Do not call dispatchLowMemory() on host. Host implements OnTrimMemoryProvider and automatically dispatches low memory callbacks to fragments."));
            throw null;
        }
        for (ComponentCallbacksC1023x componentCallbacksC1023x : this.f13069c.t()) {
            if (componentCallbacksC1023x != null) {
                componentCallbacksC1023x.f13276V = true;
                if (z8) {
                    componentCallbacksC1023x.f13267M.m(true);
                }
            }
        }
    }

    public final void n(boolean z8) {
        if (z8 && this.f13088w != null) {
            h0(new IllegalStateException("Do not call dispatchMultiWindowModeChanged() on host. Host implements OnMultiWindowModeChangedProvider and automatically dispatches multi-window mode changes to fragments."));
            throw null;
        }
        for (ComponentCallbacksC1023x componentCallbacksC1023x : this.f13069c.t()) {
            if (componentCallbacksC1023x != null && z8) {
                componentCallbacksC1023x.f13267M.n(true);
            }
        }
    }

    public final void o() {
        ArrayList arrayListR = this.f13069c.r();
        int size = arrayListR.size();
        int i = 0;
        while (i < size) {
            Object obj = arrayListR.get(i);
            i++;
            ComponentCallbacksC1023x componentCallbacksC1023x = (ComponentCallbacksC1023x) obj;
            if (componentCallbacksC1023x != null) {
                componentCallbacksC1023x.M(componentCallbacksC1023x.y());
                componentCallbacksC1023x.f13267M.o();
            }
        }
    }

    public final boolean p() {
        if (this.f13087v >= 1) {
            for (ComponentCallbacksC1023x componentCallbacksC1023x : this.f13069c.t()) {
                if (componentCallbacksC1023x != null) {
                    if (!componentCallbacksC1023x.f13272R ? componentCallbacksC1023x.f13267M.p() : false) {
                        return true;
                    }
                }
            }
        }
        return false;
    }

    public final void q() {
        if (this.f13087v < 1) {
            return;
        }
        for (ComponentCallbacksC1023x componentCallbacksC1023x : this.f13069c.t()) {
            if (componentCallbacksC1023x != null && !componentCallbacksC1023x.f13272R) {
                componentCallbacksC1023x.f13267M.q();
            }
        }
    }

    public final void r(ComponentCallbacksC1023x componentCallbacksC1023x) {
        if (componentCallbacksC1023x != null) {
            if (componentCallbacksC1023x.equals(this.f13069c.m(componentCallbacksC1023x.f13297u))) {
                componentCallbacksC1023x.f13265K.getClass();
                boolean zP = P(componentCallbacksC1023x);
                Boolean bool = componentCallbacksC1023x.f13302z;
                if (bool == null || bool.booleanValue() != zP) {
                    componentCallbacksC1023x.f13302z = Boolean.valueOf(zP);
                    componentCallbacksC1023x.P(zP);
                    P p3 = componentCallbacksC1023x.f13267M;
                    p3.i0();
                    p3.r(p3.f13091z);
                }
            }
        }
    }

    public final void s(boolean z8) {
        if (z8 && this.f13088w != null) {
            h0(new IllegalStateException("Do not call dispatchPictureInPictureModeChanged() on host. Host implements OnPictureInPictureModeChangedProvider and automatically dispatches picture-in-picture mode changes to fragments."));
            throw null;
        }
        for (ComponentCallbacksC1023x componentCallbacksC1023x : this.f13069c.t()) {
            if (componentCallbacksC1023x != null && z8) {
                componentCallbacksC1023x.f13267M.s(true);
            }
        }
    }

    public final boolean t() {
        if (this.f13087v < 1) {
            return false;
        }
        boolean z8 = false;
        for (ComponentCallbacksC1023x componentCallbacksC1023x : this.f13069c.t()) {
            if (componentCallbacksC1023x != null && O(componentCallbacksC1023x)) {
                if (!componentCallbacksC1023x.f13272R ? componentCallbacksC1023x.f13267M.t() : false) {
                    z8 = true;
                }
            }
        }
        return z8;
    }

    public final String toString() {
        StringBuilder sb = new StringBuilder(128);
        sb.append("FragmentManager{");
        sb.append(Integer.toHexString(System.identityHashCode(this)));
        sb.append(" in ");
        ComponentCallbacksC1023x componentCallbacksC1023x = this.f13090y;
        if (componentCallbacksC1023x != null) {
            sb.append(componentCallbacksC1023x.getClass().getSimpleName());
            sb.append("{");
            sb.append(Integer.toHexString(System.identityHashCode(this.f13090y)));
            sb.append("}");
        } else {
            C1025z c1025z = this.f13088w;
            if (c1025z != null) {
                sb.append(c1025z.getClass().getSimpleName());
                sb.append("{");
                sb.append(Integer.toHexString(System.identityHashCode(this.f13088w)));
                sb.append("}");
            } else {
                sb.append("null");
            }
        }
        sb.append("}}");
        return sb.toString();
    }

    public final void u(int i) {
        try {
            this.f13068b = true;
            for (W w4 : ((HashMap) this.f13069c.f1158s).values()) {
                if (w4 != null) {
                    w4.f13127e = i;
                }
            }
            R(i, false);
            Iterator it = e().iterator();
            while (it.hasNext()) {
                ((C1013m) it.next()).h();
            }
            this.f13068b = false;
            z(true);
        } catch (Throwable th) {
            this.f13068b = false;
            throw th;
        }
    }

    public final void v(String str, FileDescriptor fileDescriptor, PrintWriter printWriter, String[] strArr) {
        int size;
        String str2;
        String strL = AbstractC0844a.l(str, "    ");
        C2.a aVar = this.f13069c;
        aVar.getClass();
        String str3 = str + "    ";
        HashMap map = (HashMap) aVar.f1158s;
        if (!map.isEmpty()) {
            printWriter.print(str);
            printWriter.println("Active Fragments:");
            for (W w4 : map.values()) {
                printWriter.print(str);
                if (w4 != null) {
                    ComponentCallbacksC1023x componentCallbacksC1023x = w4.f13125c;
                    printWriter.println(componentCallbacksC1023x);
                    componentCallbacksC1023x.getClass();
                    printWriter.print(str3);
                    printWriter.print("mFragmentId=#");
                    printWriter.print(Integer.toHexString(componentCallbacksC1023x.f13269O));
                    printWriter.print(" mContainerId=#");
                    printWriter.print(Integer.toHexString(componentCallbacksC1023x.f13270P));
                    printWriter.print(" mTag=");
                    printWriter.println(componentCallbacksC1023x.f13271Q);
                    printWriter.print(str3);
                    printWriter.print("mState=");
                    printWriter.print(componentCallbacksC1023x.f13293q);
                    printWriter.print(" mWho=");
                    printWriter.print(componentCallbacksC1023x.f13297u);
                    printWriter.print(" mBackStackNesting=");
                    printWriter.println(componentCallbacksC1023x.f13264J);
                    printWriter.print(str3);
                    printWriter.print("mAdded=");
                    printWriter.print(componentCallbacksC1023x.f13257A);
                    printWriter.print(" mRemoving=");
                    printWriter.print(componentCallbacksC1023x.f13258B);
                    printWriter.print(" mFromLayout=");
                    printWriter.print(componentCallbacksC1023x.f13260E);
                    printWriter.print(" mInLayout=");
                    printWriter.println(componentCallbacksC1023x.f13261F);
                    printWriter.print(str3);
                    printWriter.print("mHidden=");
                    printWriter.print(componentCallbacksC1023x.f13272R);
                    printWriter.print(" mDetached=");
                    printWriter.print(componentCallbacksC1023x.f13273S);
                    printWriter.print(" mMenuVisible=");
                    printWriter.print(componentCallbacksC1023x.f13275U);
                    printWriter.print(" mHasMenu=");
                    printWriter.println(false);
                    printWriter.print(str3);
                    printWriter.print("mRetainInstance=");
                    printWriter.print(componentCallbacksC1023x.f13274T);
                    printWriter.print(" mUserVisibleHint=");
                    printWriter.println(componentCallbacksC1023x.f13279Z);
                    if (componentCallbacksC1023x.f13265K != null) {
                        printWriter.print(str3);
                        printWriter.print("mFragmentManager=");
                        printWriter.println(componentCallbacksC1023x.f13265K);
                    }
                    if (componentCallbacksC1023x.f13266L != null) {
                        printWriter.print(str3);
                        printWriter.print("mHost=");
                        printWriter.println(componentCallbacksC1023x.f13266L);
                    }
                    if (componentCallbacksC1023x.f13268N != null) {
                        printWriter.print(str3);
                        printWriter.print("mParentFragment=");
                        printWriter.println(componentCallbacksC1023x.f13268N);
                    }
                    if (componentCallbacksC1023x.f13298v != null) {
                        printWriter.print(str3);
                        printWriter.print("mArguments=");
                        printWriter.println(componentCallbacksC1023x.f13298v);
                    }
                    if (componentCallbacksC1023x.f13294r != null) {
                        printWriter.print(str3);
                        printWriter.print("mSavedFragmentState=");
                        printWriter.println(componentCallbacksC1023x.f13294r);
                    }
                    if (componentCallbacksC1023x.f13295s != null) {
                        printWriter.print(str3);
                        printWriter.print("mSavedViewState=");
                        printWriter.println(componentCallbacksC1023x.f13295s);
                    }
                    if (componentCallbacksC1023x.f13296t != null) {
                        printWriter.print(str3);
                        printWriter.print("mSavedViewRegistryState=");
                        printWriter.println(componentCallbacksC1023x.f13296t);
                    }
                    Object objM = componentCallbacksC1023x.f13299w;
                    if (objM == null) {
                        P p3 = componentCallbacksC1023x.f13265K;
                        objM = (p3 == null || (str2 = componentCallbacksC1023x.f13300x) == null) ? null : p3.f13069c.m(str2);
                    }
                    if (objM != null) {
                        printWriter.print(str3);
                        printWriter.print("mTarget=");
                        printWriter.print(objM);
                        printWriter.print(" mTargetRequestCode=");
                        printWriter.println(componentCallbacksC1023x.f13301y);
                    }
                    printWriter.print(str3);
                    printWriter.print("mPopDirection=");
                    C1021v c1021v = componentCallbacksC1023x.f13280a0;
                    printWriter.println(c1021v == null ? false : c1021v.f13246a);
                    C1021v c1021v2 = componentCallbacksC1023x.f13280a0;
                    if ((c1021v2 == null ? 0 : c1021v2.f13247b) != 0) {
                        printWriter.print(str3);
                        printWriter.print("getEnterAnim=");
                        C1021v c1021v3 = componentCallbacksC1023x.f13280a0;
                        printWriter.println(c1021v3 == null ? 0 : c1021v3.f13247b);
                    }
                    C1021v c1021v4 = componentCallbacksC1023x.f13280a0;
                    if ((c1021v4 == null ? 0 : c1021v4.f13248c) != 0) {
                        printWriter.print(str3);
                        printWriter.print("getExitAnim=");
                        C1021v c1021v5 = componentCallbacksC1023x.f13280a0;
                        printWriter.println(c1021v5 == null ? 0 : c1021v5.f13248c);
                    }
                    C1021v c1021v6 = componentCallbacksC1023x.f13280a0;
                    if ((c1021v6 == null ? 0 : c1021v6.f13249d) != 0) {
                        printWriter.print(str3);
                        printWriter.print("getPopEnterAnim=");
                        C1021v c1021v7 = componentCallbacksC1023x.f13280a0;
                        printWriter.println(c1021v7 == null ? 0 : c1021v7.f13249d);
                    }
                    C1021v c1021v8 = componentCallbacksC1023x.f13280a0;
                    if ((c1021v8 == null ? 0 : c1021v8.f13250e) != 0) {
                        printWriter.print(str3);
                        printWriter.print("getPopExitAnim=");
                        C1021v c1021v9 = componentCallbacksC1023x.f13280a0;
                        printWriter.println(c1021v9 == null ? 0 : c1021v9.f13250e);
                    }
                    if (componentCallbacksC1023x.f13277W != null) {
                        printWriter.print(str3);
                        printWriter.print("mContainer=");
                        printWriter.println(componentCallbacksC1023x.f13277W);
                    }
                    if (componentCallbacksC1023x.X != null) {
                        printWriter.print(str3);
                        printWriter.print("mView=");
                        printWriter.println(componentCallbacksC1023x.X);
                    }
                    if (componentCallbacksC1023x.o() != null) {
                        androidx.lifecycle.Z zR = componentCallbacksC1023x.r();
                        C0113u c0113u = C1532a.f16945c;
                        P6.g.e(zR, "store");
                        C1482a c1482a = C1482a.f16347b;
                        P6.g.e(c1482a, "defaultCreationExtras");
                        C2.a aVar2 = new C2.a(zR, c0113u, c1482a);
                        P6.d dVarA = P6.n.a(C1532a.class);
                        String strB = dVarA.b();
                        if (strB == null) {
                            throw new IllegalArgumentException("Local and anonymous classes can not be ViewModels");
                        }
                        q.j jVar = ((C1532a) aVar2.v(dVarA, "androidx.lifecycle.ViewModelProvider.DefaultKey:".concat(strB))).f16946b;
                        if (jVar.k() > 0) {
                            printWriter.print(str3);
                            printWriter.println("Loaders:");
                            if (jVar.k() > 0) {
                                if (jVar.l(0) != null) {
                                    throw new ClassCastException();
                                }
                                printWriter.print(str3);
                                printWriter.print("  #");
                                printWriter.print(jVar.h(0));
                                printWriter.print(": ");
                                throw null;
                            }
                        }
                    }
                    printWriter.print(str3);
                    printWriter.println("Child " + componentCallbacksC1023x.f13267M + ":");
                    componentCallbacksC1023x.f13267M.v(AbstractC0844a.l(str3, "  "), fileDescriptor, printWriter, strArr);
                } else {
                    printWriter.println("null");
                }
            }
        }
        ArrayList arrayList = (ArrayList) aVar.f1157r;
        int size2 = arrayList.size();
        if (size2 > 0) {
            printWriter.print(str);
            printWriter.println("Added Fragments:");
            for (int i = 0; i < size2; i++) {
                ComponentCallbacksC1023x componentCallbacksC1023x2 = (ComponentCallbacksC1023x) arrayList.get(i);
                printWriter.print(str);
                printWriter.print("  #");
                printWriter.print(i);
                printWriter.print(": ");
                printWriter.println(componentCallbacksC1023x2.toString());
            }
        }
        ArrayList arrayList2 = this.f13071e;
        if (arrayList2 != null && (size = arrayList2.size()) > 0) {
            printWriter.print(str);
            printWriter.println("Fragments Created Menus:");
            for (int i5 = 0; i5 < size; i5++) {
                ComponentCallbacksC1023x componentCallbacksC1023x3 = (ComponentCallbacksC1023x) this.f13071e.get(i5);
                printWriter.print(str);
                printWriter.print("  #");
                printWriter.print(i5);
                printWriter.print(": ");
                printWriter.println(componentCallbacksC1023x3.toString());
            }
        }
        int size3 = this.f13070d.size();
        if (size3 > 0) {
            printWriter.print(str);
            printWriter.println("Back Stack:");
            for (int i8 = 0; i8 < size3; i8++) {
                C1001a c1001a = (C1001a) this.f13070d.get(i8);
                printWriter.print(str);
                printWriter.print("  #");
                printWriter.print(i8);
                printWriter.print(": ");
                printWriter.println(c1001a.toString());
                c1001a.i(strL, printWriter, true);
            }
        }
        printWriter.print(str);
        printWriter.println("Back Stack Index: " + this.f13076k.get());
        synchronized (this.f13067a) {
            try {
                int size4 = this.f13067a.size();
                if (size4 > 0) {
                    printWriter.print(str);
                    printWriter.println("Pending Actions:");
                    for (int i9 = 0; i9 < size4; i9++) {
                        Object obj = (L) this.f13067a.get(i9);
                        printWriter.print(str);
                        printWriter.print("  #");
                        printWriter.print(i9);
                        printWriter.print(": ");
                        printWriter.println(obj);
                    }
                }
            } catch (Throwable th) {
                throw th;
            }
        }
        printWriter.print(str);
        printWriter.println("FragmentManager misc state:");
        printWriter.print(str);
        printWriter.print("  mHost=");
        printWriter.println(this.f13088w);
        printWriter.print(str);
        printWriter.print("  mContainer=");
        printWriter.println(this.f13089x);
        if (this.f13090y != null) {
            printWriter.print(str);
            printWriter.print("  mParent=");
            printWriter.println(this.f13090y);
        }
        printWriter.print(str);
        printWriter.print("  mCurState=");
        printWriter.print(this.f13087v);
        printWriter.print(" mStateSaved=");
        printWriter.print(this.H);
        printWriter.print(" mStopped=");
        printWriter.print(this.f13059I);
        printWriter.print(" mDestroyed=");
        printWriter.println(this.f13060J);
        if (this.f13058G) {
            printWriter.print(str);
            printWriter.print("  mNeedMenuInvalidate=");
            printWriter.println(this.f13058G);
        }
    }

    public final void w() {
        Iterator it = e().iterator();
        while (it.hasNext()) {
            ((C1013m) it.next()).h();
        }
    }

    public final void x(L l8, boolean z8) {
        if (!z8) {
            if (this.f13088w == null) {
                if (!this.f13060J) {
                    throw new IllegalStateException("FragmentManager has not been attached to a host.");
                }
                throw new IllegalStateException("FragmentManager has been destroyed");
            }
            if (Q()) {
                throw new IllegalStateException("Can not perform this action after onSaveInstanceState");
            }
        }
        synchronized (this.f13067a) {
            try {
                if (this.f13088w == null) {
                    if (!z8) {
                        throw new IllegalStateException("Activity has been destroyed");
                    }
                } else {
                    this.f13067a.add(l8);
                    a0();
                }
            } catch (Throwable th) {
                throw th;
            }
        }
    }

    public final void y(boolean z8) {
        if (this.f13068b) {
            throw new IllegalStateException("FragmentManager is already executing transactions");
        }
        if (this.f13088w == null) {
            if (!this.f13060J) {
                throw new IllegalStateException("FragmentManager has not been attached to a host.");
            }
            throw new IllegalStateException("FragmentManager has been destroyed");
        }
        if (Looper.myLooper() != this.f13088w.f13307v.getLooper()) {
            throw new IllegalStateException("Must be called from main thread of fragment host");
        }
        if (!z8 && Q()) {
            throw new IllegalStateException("Can not perform this action after onSaveInstanceState");
        }
        if (this.f13062L == null) {
            this.f13062L = new ArrayList();
            this.f13063M = new ArrayList();
        }
    }

    public final boolean z(boolean z8) {
        boolean zA;
        C1001a c1001a;
        y(z8);
        if (!this.i && (c1001a = this.f13074h) != null) {
            c1001a.f13161s = false;
            c1001a.e();
            if (L(3)) {
                Log.d("FragmentManager", "Reversing mTransitioningOp " + this.f13074h + " as part of execPendingActions for actions " + this.f13067a);
            }
            this.f13074h.g(false, false);
            this.f13067a.add(0, this.f13074h);
            ArrayList arrayList = this.f13074h.f13144a;
            int size = arrayList.size();
            int i = 0;
            while (i < size) {
                Object obj = arrayList.get(i);
                i++;
                ComponentCallbacksC1023x componentCallbacksC1023x = ((X) obj).f13129b;
                if (componentCallbacksC1023x != null) {
                    componentCallbacksC1023x.f13259C = false;
                }
            }
            this.f13074h = null;
        }
        boolean z9 = false;
        while (true) {
            ArrayList arrayList2 = this.f13062L;
            ArrayList arrayList3 = this.f13063M;
            synchronized (this.f13067a) {
                if (this.f13067a.isEmpty()) {
                    zA = false;
                } else {
                    try {
                        int size2 = this.f13067a.size();
                        zA = false;
                        for (int i5 = 0; i5 < size2; i5++) {
                            zA |= ((L) this.f13067a.get(i5)).a(arrayList2, arrayList3);
                        }
                    } finally {
                    }
                }
            }
            if (!zA) {
                break;
            }
            z9 = true;
            this.f13068b = true;
            try {
                X(this.f13062L, this.f13063M);
            } finally {
                d();
            }
        }
        i0();
        if (this.f13061K) {
            this.f13061K = false;
            g0();
        }
        ((HashMap) this.f13069c.f1158s).values().removeAll(Collections.singleton(null));
        return z9;
    }
}
