package q2;

import T0.C0606q;
import android.os.Bundle;
import android.os.Parcelable;
import e4.C;
import i5.k;
import java.util.Arrays;
import kotlin.jvm.internal.D;
import kotlin.jvm.internal.o;
import n2.AbstractC2612c;
import n2.AbstractC2613d;
import r2.AbstractC2876a;
import r2.AbstractC2881f;
import r2.AbstractC2883h;
import r2.C2877b;
import r2.C2878c;
import r2.C2879d;
import r2.C2880e;
import r2.i;
import r2.q;

/* JADX INFO: renamed from: q2.f, reason: case insensitive filesystem */
/* JADX INFO: loaded from: classes.dex */
public final class C2843f extends W.a {

    /* JADX INFO: renamed from: g, reason: collision with root package name */
    public final Bundle f23617g;

    /* JADX INFO: renamed from: h, reason: collision with root package name */
    public final C2841d f23618h;

    /* JADX INFO: renamed from: i, reason: collision with root package name */
    public String f23619i = "";

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

    /* JADX INFO: renamed from: k, reason: collision with root package name */
    public final C0606q f23621k;

    public C2843f(Bundle bundle, C2841d c2841d) {
        this.f23617g = bundle;
        this.f23618h = c2841d;
        this.f23621k = c2841d.f23614a;
    }

    @Override // W.a, j5.c
    public final short A() {
        Bundle source = this.f23617g;
        o.h(source, "source");
        return (short) AbstractC2612c.n(source, this.f23619i);
    }

    @Override // W.a, j5.c
    public final float B() {
        Bundle bundle = this.f23617g;
        String key = this.f23619i;
        o.h(key, "key");
        float f6 = bundle.getFloat(key, Float.MIN_VALUE);
        if (f6 != Float.MIN_VALUE || bundle.getFloat(key, Float.MAX_VALUE) != Float.MAX_VALUE) {
            return f6;
        }
        AbstractC2613d.i(key);
        throw null;
    }

    @Override // W.a, j5.c
    public final int D(i5.g enumDescriptor) {
        o.h(enumDescriptor, "enumDescriptor");
        Bundle source = this.f23617g;
        o.h(source, "source");
        return AbstractC2612c.n(source, this.f23619i);
    }

    @Override // W.a, j5.c
    public final double F() {
        Bundle bundle = this.f23617g;
        String key = this.f23619i;
        o.h(key, "key");
        double d6 = bundle.getDouble(key, Double.MIN_VALUE);
        if (d6 != Double.MIN_VALUE || bundle.getDouble(key, Double.MAX_VALUE) != Double.MAX_VALUE) {
            return d6;
        }
        AbstractC2613d.i(key);
        throw null;
    }

    @Override // j5.a
    public final C0606q a() {
        return this.f23621k;
    }

    @Override // W.a, j5.c
    public final j5.a b(i5.g descriptor) {
        o.h(descriptor, "descriptor");
        if (o.c(this.f23619i, "")) {
            return this;
        }
        Bundle source = this.f23617g;
        o.h(source, "source");
        return new C2843f(AbstractC2612c.o(source, this.f23619i), this.f23618h);
    }

    @Override // W.a, j5.c
    public final boolean f() {
        Bundle bundle = this.f23617g;
        String key = this.f23619i;
        o.h(key, "key");
        boolean z6 = bundle.getBoolean(key, false);
        if (z6 || !bundle.getBoolean(key, true)) {
            return z6;
        }
        AbstractC2613d.i(key);
        throw null;
    }

    @Override // W.a, j5.c
    public final char h() {
        Bundle bundle = this.f23617g;
        String key = this.f23619i;
        o.h(key, "key");
        char c6 = bundle.getChar(key, (char) 0);
        if (c6 != 0 || bundle.getChar(key, (char) 65535) != 65535) {
            return c6;
        }
        AbstractC2613d.i(key);
        throw null;
    }

    @Override // j5.a
    public final int k(i5.g descriptor) {
        o.h(descriptor, "descriptor");
        boolean zC = o.c(descriptor.e(), k.f19101k);
        Bundle bundle = this.f23617g;
        int size = (zC || o.c(descriptor.e(), k.l)) ? bundle.size() : descriptor.f();
        while (true) {
            int i6 = this.f23620j;
            if (i6 < size && descriptor.j(i6)) {
                String key = descriptor.g(this.f23620j);
                o.h(key, "key");
                if (bundle.containsKey(key)) {
                    break;
                }
                this.f23620j++;
            } else {
                break;
            }
        }
        int i7 = this.f23620j;
        if (i7 >= size) {
            return -1;
        }
        this.f23619i = descriptor.g(i7);
        int i8 = this.f23620j;
        this.f23620j = i8 + 1;
        return i8;
    }

    @Override // W.a, j5.c
    public final int m() {
        Bundle source = this.f23617g;
        o.h(source, "source");
        return AbstractC2612c.n(source, this.f23619i);
    }

    @Override // W.a, j5.c
    public final String q() {
        Bundle bundle = this.f23617g;
        String key = this.f23619i;
        o.h(key, "key");
        String string = bundle.getString(key);
        if (string != null) {
            return string;
        }
        AbstractC2613d.i(key);
        throw null;
    }

    @Override // W.a, j5.c
    public final long s() {
        Bundle bundle = this.f23617g;
        String key = this.f23619i;
        o.h(key, "key");
        long j4 = bundle.getLong(key, Long.MIN_VALUE);
        if (j4 != Long.MIN_VALUE || bundle.getLong(key, Long.MAX_VALUE) != Long.MAX_VALUE) {
            return j4;
        }
        AbstractC2613d.i(key);
        throw null;
    }

    @Override // W.a, j5.c
    public final Object u(g5.a deserializer) {
        Object objA;
        Object stringArray;
        o.h(deserializer, "deserializer");
        i5.g descriptor = deserializer.getDescriptor();
        Object obj = null;
        if (o.c(descriptor, AbstractC2840c.f23599a)) {
            C2878c c2878c = C2878c.f23916a;
            objA = C2878c.a(this);
        } else if (o.c(descriptor, AbstractC2840c.f23600b)) {
            objA = C2880e.f23919c.a(this);
        } else if (o.c(descriptor, AbstractC2840c.f23601c)) {
            objA = C2879d.f23918c.b(this);
        } else if (o.c(descriptor, AbstractC2840c.f23602d)) {
            objA = AbstractC2881f.a(this);
        } else if (o.c(descriptor, AbstractC2840c.f23607i) || o.c(descriptor, AbstractC2840c.f23608j)) {
            objA = AbstractC2876a.a(this);
        } else if (o.c(descriptor, AbstractC2840c.f23609k) || o.c(descriptor, AbstractC2840c.l)) {
            objA = C2877b.f23914a.deserialize(this);
        } else if (o.c(descriptor, AbstractC2840c.f23603e)) {
            Parcelable[] parcelableArrA = AbstractC2883h.a(this);
            Object objDeserialize = deserializer.deserialize(C2838a.f23588g);
            o.e(objDeserialize);
            objA = Arrays.copyOf(parcelableArrA, parcelableArrA.length, C.D(D.a(objDeserialize.getClass())));
        } else {
            objA = o.c(descriptor, AbstractC2840c.f23604f) ? AbstractC2883h.a(this) : (o.c(descriptor, AbstractC2840c.f23605g) || o.c(descriptor, AbstractC2840c.f23606h)) ? i.f23924a.deserialize(this) : (o.c(descriptor, AbstractC2840c.f23610m) || o.c(descriptor, AbstractC2840c.f23611n) || o.c(descriptor, AbstractC2840c.f23612o)) ? q.f23939a.deserialize(this) : null;
        }
        if (objA == null) {
            i5.g descriptor2 = deserializer.getDescriptor();
            boolean zC = o.c(descriptor2, AbstractC2839b.f23590a);
            Bundle bundle = this.f23617g;
            if (zC) {
                String key = this.f23619i;
                o.h(key, "key");
                stringArray = bundle.getIntegerArrayList(key);
                if (stringArray == null) {
                    AbstractC2613d.i(key);
                    throw null;
                }
            } else if (o.c(descriptor2, AbstractC2839b.f23591b)) {
                String key2 = this.f23619i;
                o.h(key2, "key");
                stringArray = bundle.getStringArrayList(key2);
                if (stringArray == null) {
                    AbstractC2613d.i(key2);
                    throw null;
                }
            } else if (o.c(descriptor2, AbstractC2839b.f23592c)) {
                String key3 = this.f23619i;
                o.h(key3, "key");
                stringArray = bundle.getBooleanArray(key3);
                if (stringArray == null) {
                    AbstractC2613d.i(key3);
                    throw null;
                }
            } else if (o.c(descriptor2, AbstractC2839b.f23593d)) {
                String key4 = this.f23619i;
                o.h(key4, "key");
                stringArray = bundle.getCharArray(key4);
                if (stringArray == null) {
                    AbstractC2613d.i(key4);
                    throw null;
                }
            } else if (o.c(descriptor2, AbstractC2839b.f23594e)) {
                String key5 = this.f23619i;
                o.h(key5, "key");
                stringArray = bundle.getDoubleArray(key5);
                if (stringArray == null) {
                    AbstractC2613d.i(key5);
                    throw null;
                }
            } else if (o.c(descriptor2, AbstractC2839b.f23595f)) {
                String key6 = this.f23619i;
                o.h(key6, "key");
                stringArray = bundle.getFloatArray(key6);
                if (stringArray == null) {
                    AbstractC2613d.i(key6);
                    throw null;
                }
            } else if (o.c(descriptor2, AbstractC2839b.f23596g)) {
                String key7 = this.f23619i;
                o.h(key7, "key");
                stringArray = bundle.getIntArray(key7);
                if (stringArray == null) {
                    AbstractC2613d.i(key7);
                    throw null;
                }
            } else if (o.c(descriptor2, AbstractC2839b.f23597h)) {
                String key8 = this.f23619i;
                o.h(key8, "key");
                stringArray = bundle.getLongArray(key8);
                if (stringArray == null) {
                    AbstractC2613d.i(key8);
                    throw null;
                }
            } else if (o.c(descriptor2, AbstractC2839b.f23598i)) {
                String key9 = this.f23619i;
                o.h(key9, "key");
                stringArray = bundle.getStringArray(key9);
                if (stringArray == null) {
                    AbstractC2613d.i(key9);
                    throw null;
                }
            }
            obj = stringArray;
        } else {
            obj = objA;
        }
        return obj == null ? deserializer.deserialize(this) : obj;
    }

    @Override // W.a, j5.c
    public final boolean v() {
        Bundle source = this.f23617g;
        o.h(source, "source");
        String key = this.f23619i;
        o.h(key, "key");
        return !(source.containsKey(key) && source.get(key) == null);
    }

    @Override // W.a, j5.c
    public final byte z() {
        Bundle source = this.f23617g;
        o.h(source, "source");
        return (byte) AbstractC2612c.n(source, this.f23619i);
    }
}
