package com.revenuecat.purchases.paywalls.components;

import W.b;
import com.google.android.gms.common.internal.ImagesContract;
import com.revenuecat.purchases.paywalls.components.ButtonComponent;
import g5.a;
import i5.g;
import j5.c;
import j5.d;
import k5.A;
import k5.P;
import k5.S;
import k5.a0;
import kotlin.jvm.internal.o;
import w4.InterfaceC3141c;

/* JADX INFO: loaded from: classes3.dex */
@InterfaceC3141c
public final class ActionSurrogate$$serializer implements A {
    public static final ActionSurrogate$$serializer INSTANCE;
    private static final /* synthetic */ S descriptor;

    static {
        ActionSurrogate$$serializer actionSurrogate$$serializer = new ActionSurrogate$$serializer();
        INSTANCE = actionSurrogate$$serializer;
        S s6 = new S("com.revenuecat.purchases.paywalls.components.ActionSurrogate", actionSurrogate$$serializer, 4);
        s6.k("type", false);
        s6.k("destination", true);
        s6.k(ImagesContract.URL, true);
        s6.k("sheet", true);
        descriptor = s6;
    }

    private ActionSurrogate$$serializer() {
    }

    @Override // k5.A
    public a[] childSerializers() {
        return new a[]{ActionTypeSurrogateDeserializer.INSTANCE, b.h0(DestinationSurrogateDeserializer.INSTANCE), b.h0(UrlSurrogate$$serializer.INSTANCE), b.h0(ButtonComponent$Destination$Sheet$$serializer.INSTANCE)};
    }

    @Override // g5.a
    public ActionSurrogate deserialize(c decoder) {
        o.h(decoder, "decoder");
        g descriptor2 = getDescriptor();
        j5.a aVarB = decoder.b(descriptor2);
        int i6 = 0;
        ActionTypeSurrogate actionTypeSurrogate = null;
        DestinationSurrogate destinationSurrogate = null;
        UrlSurrogate urlSurrogate = null;
        ButtonComponent.Destination.Sheet sheet = null;
        boolean z6 = true;
        while (z6) {
            int iK = aVarB.k(descriptor2);
            if (iK == -1) {
                z6 = false;
            } else if (iK == 0) {
                actionTypeSurrogate = (ActionTypeSurrogate) aVarB.p(descriptor2, 0, ActionTypeSurrogateDeserializer.INSTANCE, actionTypeSurrogate);
                i6 |= 1;
            } else if (iK == 1) {
                destinationSurrogate = (DestinationSurrogate) aVarB.r(descriptor2, 1, DestinationSurrogateDeserializer.INSTANCE, destinationSurrogate);
                i6 |= 2;
            } else if (iK == 2) {
                urlSurrogate = (UrlSurrogate) aVarB.r(descriptor2, 2, UrlSurrogate$$serializer.INSTANCE, urlSurrogate);
                i6 |= 4;
            } else {
                if (iK != 3) {
                    throw new g5.g(iK);
                }
                sheet = (ButtonComponent.Destination.Sheet) aVarB.r(descriptor2, 3, ButtonComponent$Destination$Sheet$$serializer.INSTANCE, sheet);
                i6 |= 8;
            }
        }
        aVarB.c(descriptor2);
        return new ActionSurrogate(i6, actionTypeSurrogate, destinationSurrogate, urlSurrogate, sheet, (a0) null);
    }

    @Override // g5.a
    public g getDescriptor() {
        return descriptor;
    }

    @Override // g5.a
    public void serialize(d encoder, ActionSurrogate value) {
        o.h(encoder, "encoder");
        o.h(value, "value");
        g descriptor2 = getDescriptor();
        j5.b bVarB = encoder.b(descriptor2);
        ActionSurrogate.write$Self$purchases_defaultsBc8Release(value, bVarB, descriptor2);
        bVarB.c(descriptor2);
    }

    @Override // k5.A
    public a[] typeParametersSerializers() {
        return P.f20015b;
    }
}
