package o;

import android.os.Build;
import android.os.IBinder;
import android.os.Looper;
import android.os.Messenger;
import android.os.RemoteException;
import android.view.View;
import android.view.autofill.AutofillId;
import android.view.contentcapture.ContentCaptureSession;
import android.widget.EditText;
import androidx.work.impl.WorkDatabase_Impl;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.atomic.AtomicInteger;

/* compiled from: r8-map-id-3b7cc9102578c509342fa2f0fabed2bfc72239cd258d579fc679bfcbc198b048 */
/* renamed from: o.ym0, reason: case insensitive filesystem */
/* loaded from: classes.dex */
public final class C3031ym0 implements InterfaceC1489ia0, InterfaceC2956xx, InterfaceC2904xT {

    /* renamed from: o, reason: collision with root package name */
    public static final BU f811o = new BU();
    public static final AU p = new AU();
    public final /* synthetic */ int l;
    public Object m;
    public final Object n;

    public /* synthetic */ C3031ym0(int i, Object obj, Object obj2) {
        this.l = i;
        this.m = obj;
        this.n = obj2;
    }

    public void a(AbstractC1904ms0 abstractC1904ms0) {
        boolean z;
        LQ lq = (LQ) this.m;
        synchronized (lq.a) {
            z = lq.f == AbstractC1186fM.k;
            lq.f = abstractC1904ms0;
        }
        if (z) {
            W8 w8B0 = W8.b0();
            RunnableC2017o3 runnableC2017o3 = lq.j;
            C0120Eq c0120Eq = w8B0.f;
            if (c0120Eq.h == null) {
                synchronized (c0120Eq.f) {
                    try {
                        if (c0120Eq.h == null) {
                            c0120Eq.h = C0120Eq.b0(Looper.getMainLooper());
                        }
                    } finally {
                    }
                }
            }
            c0120Eq.h.post(runnableC2017o3);
        }
        if (abstractC1904ms0 instanceof BU) {
            ((C2595u70) this.n).i((BU) abstractC1904ms0);
        } else if (abstractC1904ms0 instanceof C3095zU) {
            ((C2595u70) this.n).j(((C3095zU) abstractC1904ms0).j);
        }
    }

    public AutofillId b(long j) {
        if (Build.VERSION.SDK_INT < 29) {
            return null;
        }
        ContentCaptureSession contentCaptureSessionK = S2.k(this.m);
        G0 g0O = IJ.o((View) this.n);
        Objects.requireNonNull(g0O);
        return R8.d(contentCaptureSessionK, AbstractC2440sc.e(g0O.m), j);
    }

    public List c(String str) {
        List listT0;
        synchronized (this.m) {
            try {
                LinkedHashMap linkedHashMap = (LinkedHashMap) this.n;
                LinkedHashMap linkedHashMap2 = new LinkedHashMap();
                for (Map.Entry entry : linkedHashMap.entrySet()) {
                    if (F3.c(((C2366rm0) entry.getKey()).a, str)) {
                        linkedHashMap2.put(entry.getKey(), entry.getValue());
                    }
                }
                Iterator it = linkedHashMap2.keySet().iterator();
                while (it.hasNext()) {
                    ((LinkedHashMap) this.n).remove((C2366rm0) it.next());
                }
                listT0 = AbstractC3117zi.t0(linkedHashMap2.values());
            } catch (Throwable th) {
                throw th;
            }
        }
        return listT0;
    }

    @Override // o.InterfaceC1489ia0
    public StackTraceElement[] d(StackTraceElement[] stackTraceElementArr) {
        if (stackTraceElementArr.length <= 1024) {
            return stackTraceElementArr;
        }
        InterfaceC1489ia0[] interfaceC1489ia0Arr = (InterfaceC1489ia0[]) this.m;
        StackTraceElement[] stackTraceElementArrD = stackTraceElementArr;
        for (int i = 0; i < 1; i++) {
            InterfaceC1489ia0 interfaceC1489ia0 = interfaceC1489ia0Arr[i];
            if (stackTraceElementArrD.length <= 1024) {
                break;
            }
            stackTraceElementArrD = interfaceC1489ia0.d(stackTraceElementArr);
        }
        return stackTraceElementArrD.length > 1024 ? ((BP) this.n).d(stackTraceElementArrD) : stackTraceElementArrD;
    }

    public C2627ua0 e(C2366rm0 c2366rm0) {
        C2627ua0 c2627ua0;
        synchronized (this.m) {
            c2627ua0 = (C2627ua0) ((LinkedHashMap) this.n).remove(c2366rm0);
        }
        return c2627ua0;
    }

    public C2627ua0 f(C2366rm0 c2366rm0) {
        C2627ua0 c2627ua0;
        synchronized (this.m) {
            try {
                LinkedHashMap linkedHashMap = (LinkedHashMap) this.n;
                Object c2627ua02 = linkedHashMap.get(c2366rm0);
                if (c2627ua02 == null) {
                    c2627ua02 = new C2627ua0(c2366rm0);
                    linkedHashMap.put(c2366rm0, c2627ua02);
                }
                c2627ua0 = (C2627ua0) c2627ua02;
            } catch (Throwable th) {
                throw th;
            }
        }
        return c2627ua0;
    }

    public void g(C2845wo0 c2845wo0) {
        ArrayList arrayList = c2845wo0.a;
        int size = arrayList.size();
        int i = 0;
        while (i < size) {
            Object obj = arrayList.get(i);
            i++;
            ((HashMap) this.m).put(Integer.valueOf(((Qo0) obj).l).toString(), c2845wo0);
        }
    }

    @Override // o.CZ
    public Object get() {
        return new C1457i70((C3017yf0) ((CZ) this.m).get(), (C2643ui0) ((BZ) this.n).get());
    }

    public InterfaceC1991no0 h(C2062oc0 c2062oc0, InterfaceC1991no0 interfaceC1991no0) {
        AbstractC2378rs0.y0(c2062oc0);
        if (!(interfaceC1991no0 instanceof C2181po0)) {
            return interfaceC1991no0;
        }
        C2181po0 c2181po0 = (C2181po0) interfaceC1991no0;
        ArrayList arrayList = c2181po0.m;
        String str = c2181po0.l;
        HashMap map = (HashMap) this.m;
        return (map.containsKey(str) ? (C2845wo0) map.get(str) : (C2845wo0) this.n).a(str, c2062oc0, arrayList);
    }

    /* JADX WARN: Removed duplicated region for block: B:33:0x008a  */
    @Override // o.InterfaceC2904xT
    /*
        Code decompiled incorrectly, please refer to instructions dump.
        To view partially-correct add '--show-bad-code' argument
    */
    public o.Kl0 i(android.view.View r17, o.Kl0 r18) {
        /*
            r16 = this;
            r0 = r16
            r1 = r17
            r2 = r18
            java.lang.Object r3 = r0.m
            o.pe r3 = (o.C2160pe) r3
            java.lang.Object r4 = r0.n
            o.St r4 = (o.C0486St) r4
            int r5 = r4.a
            int r6 = r4.b
            int r4 = r4.c
            o.Hl0 r7 = r2.a
            r8 = 519(0x207, float:7.27E-43)
            o.LH r8 = r7.g(r8)
            r9 = 32
            o.LH r7 = r7.g(r9)
            java.lang.Object r9 = r3.m
            com.google.android.material.bottomsheet.BottomSheetBehavior r9 = (com.google.android.material.bottomsheet.BottomSheetBehavior) r9
            int r10 = r8.b
            int r11 = r8.c
            int r12 = r8.a
            r9.w = r10
            boolean r10 = o.Co0.H(r1)
            int r13 = r1.getPaddingBottom()
            int r14 = r1.getPaddingLeft()
            int r15 = r1.getPaddingRight()
            boolean r0 = r9.f25o
            if (r0 == 0) goto L49
            int r13 = r2.a()
            r9.v = r13
            int r13 = r13 + r4
        L49:
            boolean r4 = r9.p
            if (r4 == 0) goto L54
            if (r10 == 0) goto L51
            r4 = r6
            goto L52
        L51:
            r4 = r5
        L52:
            int r14 = r4 + r12
        L54:
            boolean r4 = r9.q
            if (r4 == 0) goto L5e
            if (r10 == 0) goto L5b
            goto L5c
        L5b:
            r5 = r6
        L5c:
            int r15 = r5 + r11
        L5e:
            android.view.ViewGroup$LayoutParams r4 = r1.getLayoutParams()
            android.view.ViewGroup$MarginLayoutParams r4 = (android.view.ViewGroup.MarginLayoutParams) r4
            boolean r5 = r9.s
            r6 = 1
            if (r5 == 0) goto L71
            int r5 = r4.leftMargin
            if (r5 == r12) goto L71
            r4.leftMargin = r12
            r5 = r6
            goto L72
        L71:
            r5 = 0
        L72:
            boolean r10 = r9.t
            if (r10 == 0) goto L7d
            int r10 = r4.rightMargin
            if (r10 == r11) goto L7d
            r4.rightMargin = r11
            r5 = r6
        L7d:
            boolean r10 = r9.u
            if (r10 == 0) goto L8a
            int r10 = r4.topMargin
            int r8 = r8.b
            if (r10 == r8) goto L8a
            r4.topMargin = r8
            goto L8b
        L8a:
            r6 = r5
        L8b:
            if (r6 == 0) goto L90
            r1.setLayoutParams(r4)
        L90:
            int r4 = r1.getPaddingTop()
            r1.setPadding(r14, r4, r15, r13)
            boolean r1 = r3.l
            if (r1 == 0) goto L9f
            int r3 = r7.d
            r9.m = r3
        L9f:
            if (r0 != 0) goto La5
            if (r1 == 0) goto La4
            goto La5
        La4:
            return r2
        La5:
            r9.I()
            return r2
        */
        throw new UnsupportedOperationException("Method not decompiled: o.C3031ym0.i(android.view.View, o.Kl0):o.Kl0");
    }

    public String toString() {
        switch (this.l) {
            case 7:
                String str = "[ ";
                if (((R90) this.m) != null) {
                    for (int i = 0; i < 9; i++) {
                        str = str + ((R90) this.m).s[i] + " ";
                    }
                }
                return str + "] " + ((R90) this.m);
            default:
                return super.toString();
        }
    }

    public C3031ym0(IBinder iBinder) throws RemoteException {
        this.l = 14;
        String interfaceDescriptor = iBinder.getInterfaceDescriptor();
        if (Objects.equals(interfaceDescriptor, "android.os.IMessenger")) {
            this.m = new Messenger(iBinder);
            this.n = null;
        } else {
            if (!Objects.equals(interfaceDescriptor, "com.google.android.gms.iid.IMessengerCompat")) {
                "Invalid interface descriptor: ".concat(String.valueOf(interfaceDescriptor));
                throw new RemoteException();
            }
            this.n = new C3132zp0(iBinder);
            this.m = null;
        }
    }

    public C3031ym0(C2851wr0 c2851wr0, String str) {
        this.l = 13;
        this.m = str;
        this.n = c2851wr0;
    }

    public C3031ym0(WorkDatabase_Impl workDatabase_Impl) {
        this.l = 0;
        this.m = workDatabase_Impl;
        this.n = new C2945xr(workDatabase_Impl, 3);
    }

    public C3031ym0(InterfaceC1489ia0[] interfaceC1489ia0Arr) {
        this.l = 5;
        this.m = interfaceC1489ia0Arr;
        this.n = new BP(0);
    }

    public C3031ym0(int i) {
        this.l = i;
        switch (i) {
            case 6:
                this.m = new AtomicInteger();
                this.n = new AtomicInteger();
                break;
            case 10:
                this.m = new Object();
                this.n = new LinkedHashMap();
                break;
            case 12:
                this.m = new HashMap();
                this.n = new C2845wo0(6);
                C2845wo0 c2845wo0 = new C2845wo0(0);
                Qo0 qo0 = Qo0.q;
                ArrayList arrayList = c2845wo0.a;
                arrayList.add(qo0);
                arrayList.add(Qo0.r);
                arrayList.add(Qo0.s);
                arrayList.add(Qo0.t);
                arrayList.add(Qo0.u);
                arrayList.add(Qo0.v);
                arrayList.add(Qo0.w);
                g(c2845wo0);
                C2845wo0 c2845wo02 = new C2845wo0(1);
                Qo0 qo02 = Qo0.H;
                ArrayList arrayList2 = c2845wo02.a;
                arrayList2.add(qo02);
                arrayList2.add(Qo0.U);
                arrayList2.add(Qo0.V);
                arrayList2.add(Qo0.W);
                arrayList2.add(Qo0.X);
                arrayList2.add(Qo0.Z);
                arrayList2.add(Qo0.a0);
                arrayList2.add(Qo0.f0);
                g(c2845wo02);
                C2845wo0 c2845wo03 = new C2845wo0(2);
                Qo0 qo03 = Qo0.f302o;
                ArrayList arrayList3 = c2845wo03.a;
                arrayList3.add(qo03);
                arrayList3.add(Qo0.x);
                arrayList3.add(Qo0.y);
                arrayList3.add(Qo0.z);
                arrayList3.add(Qo0.E);
                arrayList3.add(Qo0.B);
                arrayList3.add(Qo0.F);
                arrayList3.add(Qo0.J);
                arrayList3.add(Qo0.Y);
                arrayList3.add(Qo0.k0);
                arrayList3.add(Qo0.n0);
                arrayList3.add(Qo0.q0);
                arrayList3.add(Qo0.r0);
                g(c2845wo03);
                C2845wo0 c2845wo04 = new C2845wo0(3);
                Qo0 qo04 = Qo0.n;
                ArrayList arrayList4 = c2845wo04.a;
                arrayList4.add(qo04);
                arrayList4.add(Qo0.e0);
                arrayList4.add(Qo0.h0);
                g(c2845wo04);
                C2845wo0 c2845wo05 = new C2845wo0(4);
                Qo0 qo05 = Qo0.K;
                ArrayList arrayList5 = c2845wo05.a;
                arrayList5.add(qo05);
                arrayList5.add(Qo0.L);
                arrayList5.add(Qo0.M);
                arrayList5.add(Qo0.N);
                arrayList5.add(Qo0.O);
                arrayList5.add(Qo0.P);
                arrayList5.add(Qo0.Q);
                arrayList5.add(Qo0.v0);
                g(c2845wo05);
                C2845wo0 c2845wo06 = new C2845wo0(5);
                Qo0 qo06 = Qo0.m;
                ArrayList arrayList6 = c2845wo06.a;
                arrayList6.add(qo06);
                arrayList6.add(Qo0.G);
                arrayList6.add(Qo0.b0);
                arrayList6.add(Qo0.c0);
                arrayList6.add(Qo0.d0);
                arrayList6.add(Qo0.i0);
                arrayList6.add(Qo0.j0);
                arrayList6.add(Qo0.l0);
                arrayList6.add(Qo0.m0);
                arrayList6.add(Qo0.p0);
                g(c2845wo06);
                C2845wo0 c2845wo07 = new C2845wo0(7);
                Qo0 qo07 = Qo0.p;
                ArrayList arrayList7 = c2845wo07.a;
                arrayList7.add(qo07);
                arrayList7.add(Qo0.A);
                arrayList7.add(Qo0.C);
                arrayList7.add(Qo0.D);
                arrayList7.add(Qo0.I);
                arrayList7.add(Qo0.R);
                arrayList7.add(Qo0.S);
                arrayList7.add(Qo0.T);
                arrayList7.add(Qo0.g0);
                arrayList7.add(Qo0.o0);
                arrayList7.add(Qo0.s0);
                arrayList7.add(Qo0.t0);
                arrayList7.add(Qo0.u0);
                g(c2845wo07);
                break;
            default:
                this.m = new LQ();
                this.n = new C2595u70();
                a(p);
                break;
        }
    }

    public C3031ym0(ExecutorService executorService) {
        this.l = 8;
        this.n = new C1839m9(0);
        this.m = executorService;
    }

    public C3031ym0(IY iy) {
        this.l = 7;
        this.n = iy;
    }

    public C3031ym0(EditText editText) {
        this.l = 4;
        this.m = editText;
        C0151Fv c0151Fv = new C0151Fv(editText);
        this.n = c0151Fv;
        editText.addTextChangedListener(c0151Fv);
        if (C2478sv.b == null) {
            synchronized (C2478sv.a) {
                try {
                    if (C2478sv.b == null) {
                        C2478sv c2478sv = new C2478sv();
                        try {
                            C2478sv.c = Class.forName("android.text.DynamicLayout$ChangeWatcher", false, C2478sv.class.getClassLoader());
                        } catch (Throwable unused) {
                        }
                        C2478sv.b = c2478sv;
                    }
                } finally {
                }
            }
        }
        editText.setEditableFactory(C2478sv.b);
    }

    public C3031ym0(C0247Jn c0247Jn) {
        this.l = 3;
        C0758as c0758as = androidx.compose.foundation.gestures.a.c;
        this.m = c0247Jn;
        this.n = c0758as;
    }
}
