package defpackage;

import androidx.media3.container.NalUnitUtil;
import kotlin.Metadata;

/* JADX INFO: loaded from: classes3.dex */
@Metadata(d1 = {"\u0000\n\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\b\u0002\u0018\u00002\u00020\u0001¨\u0006\u0002"}, d2 = {"Lg05;", "Lcr;", "kotlinx-serialization-json"}, k = 1, mv = {2, 0, 0}, xi = NalUnitUtil.H265_NAL_UNIT_TYPE_UNSPECIFIED)
@vx8
final class g05 extends cr {
    public wy4 g;

    /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
    public g05(dy4 dy4Var, sq3 sq3Var) {
        super(dy4Var, sq3Var);
        cr4.g(dy4Var, "json");
        cr4.g(sq3Var, "nodeConsumer");
        this.a.add("primitive");
    }

    @Override // defpackage.cr
    public final wy4 az() {
        wy4 wy4Var = this.g;
        if (wy4Var != null) {
            return wy4Var;
        }
        throw new IllegalArgumentException("Primitive element has not been recorded. Is call to .encodeXxx is missing in serializer?");
    }

    @Override // defpackage.cr
    public final void ba(wy4 wy4Var, String str) {
        cr4.g(str, "key");
        cr4.g(wy4Var, "element");
        if (str != "primitive") {
            throw new IllegalArgumentException("This output can only consume primitives with 'primitive' tag");
        }
        if (this.g != null) {
            throw new IllegalArgumentException("Primitive element was already recorded. Does call to .encodeXxx happen more than once?");
        }
        this.g = wy4Var;
        this.c.invoke(wy4Var);
    }
}
