package l5;

import k5.W;
import k5.n0;

/* JADX INFO: loaded from: classes3.dex */
public final class t implements g5.a {

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

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    public static final W f20363b = W.a.L("kotlinx.serialization.json.JsonLiteral", i5.e.f19086r);

    @Override // g5.a
    public final Object deserialize(j5.c decoder) {
        kotlin.jvm.internal.o.h(decoder, "decoder");
        m mVarL = W.d.j(decoder).l();
        if (mVarL instanceof s) {
            return (s) mVarL;
        }
        throw m5.l.c(-1, mVarL.toString(), "Unexpected JSON element, expected JsonLiteral, had " + kotlin.jvm.internal.D.a(mVarL.getClass()));
    }

    @Override // g5.a
    public final i5.g getDescriptor() {
        return f20363b;
    }

    @Override // g5.a
    public final void serialize(j5.d encoder, Object obj) {
        s value = (s) obj;
        kotlin.jvm.internal.o.h(encoder, "encoder");
        kotlin.jvm.internal.o.h(value, "value");
        W.d.i(encoder);
        boolean z6 = value.f20359a;
        String str = value.f20361c;
        if (z6) {
            encoder.F(str);
            return;
        }
        i5.g gVar = value.f20360b;
        if (gVar != null) {
            encoder.e(gVar).F(str);
            return;
        }
        Long lC0 = S4.w.C0(str);
        if (lC0 != null) {
            encoder.D(lC0.longValue());
            return;
        }
        w4.v vVarU = A4.g.U(str);
        if (vVarU != null) {
            encoder.e(n0.f20077b).D(vVarU.f25486a);
            return;
        }
        Double dR0 = S4.v.r0(str);
        if (dR0 != null) {
            encoder.h(dR0.doubleValue());
            return;
        }
        Boolean bool = str.equals("true") ? Boolean.TRUE : str.equals("false") ? Boolean.FALSE : null;
        if (bool != null) {
            encoder.k(bool.booleanValue());
        } else {
            encoder.F(str);
        }
    }
}
