package com.revenuecat.purchases.ui.revenuecatui.components.text;

import A2.c;
import B.H0;
import J4.a;
import X0.AbstractC0808v;
import X0.I;
import androidx.compose.runtime.MutableState;
import androidx.compose.runtime.SnapshotStateKt;
import androidx.compose.runtime.SnapshotStateKt__SnapshotStateKt;
import androidx.compose.runtime.Stable;
import androidx.compose.runtime.State;
import com.revenuecat.purchases.Package;
import com.revenuecat.purchases.models.SubscriptionOption;
import com.revenuecat.purchases.paywalls.components.CountdownComponent;
import com.revenuecat.purchases.paywalls.components.common.LocaleId;
import com.revenuecat.purchases.paywalls.components.properties.Size;
import com.revenuecat.purchases.ui.revenuecatui.CustomVariableValue;
import com.revenuecat.purchases.ui.revenuecatui.components.LocalizedTextPartial;
import com.revenuecat.purchases.ui.revenuecatui.components.countdown.CountdownTime;
import com.revenuecat.purchases.ui.revenuecatui.components.properties.ColorStyles;
import com.revenuecat.purchases.ui.revenuecatui.components.properties.FontSpec;
import com.revenuecat.purchases.ui.revenuecatui.components.state.PackageAwareDelegate;
import com.revenuecat.purchases.ui.revenuecatui.components.style.TextComponentStyle;
import com.revenuecat.purchases.ui.revenuecatui.helpers.NonEmptyMap;
import f1.C2023k;
import i0.InterfaceC2240d;
import java.util.Map;
import kotlin.jvm.internal.h;
import kotlin.jvm.internal.o;
import kotlin.jvm.internal.p;
import x4.z;

/* JADX INFO: loaded from: classes3.dex */
@Stable
public final class TextComponentState {
    public static final int $stable = 0;
    private final State applicablePackage$delegate;
    private final State backgroundColor$delegate;
    private final State color$delegate;
    private final MutableState countdownTime$delegate;
    private final a customVariablesProvider;
    private final State fontFamily$delegate;
    private final State fontSize$delegate;
    private final State fontSpec$delegate;
    private final State fontWeight$delegate;
    private final State horizontalAlignment$delegate;
    private final State localeId$delegate;
    private final a localeProvider;
    private final State localizedVariableKeys$delegate;
    private final State margin$delegate;
    private final PackageAwareDelegate packageAwareDelegate;
    private final State padding$delegate;
    private final State presentedPartial$delegate;
    private final a selectedOfferEligibilityProvider;
    private final a selectedPackageInfoProvider;
    private final a selectedTabIndexProvider;
    private final State size$delegate;
    private final TextComponentStyle style;
    private final State subscriptionOption$delegate;
    private final State text$delegate;
    private final State textAlign$delegate;
    private final State visible$delegate;
    private final MutableState windowSize$delegate;

    /* JADX INFO: renamed from: com.revenuecat.purchases.ui.revenuecatui.components.text.TextComponentState$1, reason: invalid class name */
    public static final class AnonymousClass1 extends p implements a {
        public static final AnonymousClass1 INSTANCE = new AnonymousClass1();

        public AnonymousClass1() {
            super(0);
        }

        @Override // J4.a
        public final Map<String, CustomVariableValue> invoke() {
            return z.f26066a;
        }
    }

    public TextComponentState(c initialWindowSize, TextComponentStyle style, a localeProvider, a selectedPackageInfoProvider, a selectedTabIndexProvider, a selectedOfferEligibilityProvider, a customVariablesProvider) {
        o.h(initialWindowSize, "initialWindowSize");
        o.h(style, "style");
        o.h(localeProvider, "localeProvider");
        o.h(selectedPackageInfoProvider, "selectedPackageInfoProvider");
        o.h(selectedTabIndexProvider, "selectedTabIndexProvider");
        o.h(selectedOfferEligibilityProvider, "selectedOfferEligibilityProvider");
        o.h(customVariablesProvider, "customVariablesProvider");
        this.style = style;
        this.localeProvider = localeProvider;
        this.selectedPackageInfoProvider = selectedPackageInfoProvider;
        this.selectedTabIndexProvider = selectedTabIndexProvider;
        this.selectedOfferEligibilityProvider = selectedOfferEligibilityProvider;
        this.customVariablesProvider = customVariablesProvider;
        this.windowSize$delegate = SnapshotStateKt__SnapshotStateKt.mutableStateOf$default(initialWindowSize, null, 2, null);
        this.packageAwareDelegate = new PackageAwareDelegate(style, selectedPackageInfoProvider, selectedTabIndexProvider, selectedOfferEligibilityProvider);
        this.countdownTime$delegate = SnapshotStateKt__SnapshotStateKt.mutableStateOf$default(null, null, 2, null);
        this.localeId$delegate = SnapshotStateKt.derivedStateOf(new TextComponentState$localeId$2(this));
        this.applicablePackage$delegate = SnapshotStateKt.derivedStateOf(new TextComponentState$applicablePackage$2(this));
        this.subscriptionOption$delegate = SnapshotStateKt.derivedStateOf(new TextComponentState$subscriptionOption$2(this));
        this.presentedPartial$delegate = SnapshotStateKt.derivedStateOf(new TextComponentState$presentedPartial$2(this));
        this.visible$delegate = SnapshotStateKt.derivedStateOf(new TextComponentState$visible$2(this));
        this.text$delegate = SnapshotStateKt.derivedStateOf(new TextComponentState$text$2(this));
        this.localizedVariableKeys$delegate = SnapshotStateKt.derivedStateOf(new TextComponentState$localizedVariableKeys$2(this));
        this.color$delegate = SnapshotStateKt.derivedStateOf(new TextComponentState$color$2(this));
        this.fontSize$delegate = SnapshotStateKt.derivedStateOf(new TextComponentState$fontSize$2(this));
        this.fontWeight$delegate = SnapshotStateKt.derivedStateOf(new TextComponentState$fontWeight$2(this));
        this.fontSpec$delegate = SnapshotStateKt.derivedStateOf(new TextComponentState$fontSpec$2(this));
        this.fontFamily$delegate = SnapshotStateKt.derivedStateOf(new TextComponentState$fontFamily$2(this));
        this.textAlign$delegate = SnapshotStateKt.derivedStateOf(new TextComponentState$textAlign$2(this));
        this.horizontalAlignment$delegate = SnapshotStateKt.derivedStateOf(new TextComponentState$horizontalAlignment$2(this));
        this.backgroundColor$delegate = SnapshotStateKt.derivedStateOf(new TextComponentState$backgroundColor$2(this));
        this.size$delegate = SnapshotStateKt.derivedStateOf(new TextComponentState$size$2(this));
        this.padding$delegate = SnapshotStateKt.derivedStateOf(new TextComponentState$padding$2(this));
        this.margin$delegate = SnapshotStateKt.derivedStateOf(new TextComponentState$margin$2(this));
    }

    /* JADX INFO: Access modifiers changed from: private */
    public final FontSpec getFontSpec() {
        return (FontSpec) this.fontSpec$delegate.getValue();
    }

    /* JADX INFO: Access modifiers changed from: private */
    /* JADX INFO: renamed from: getLocaleId-uqtKvyA, reason: not valid java name */
    public final String m806getLocaleIduqtKvyA() {
        return ((LocaleId) this.localeId$delegate.getValue()).m577unboximpl();
    }

    /* JADX INFO: Access modifiers changed from: private */
    public final LocalizedTextPartial getPresentedPartial() {
        return (LocalizedTextPartial) this.presentedPartial$delegate.getValue();
    }

    /* JADX INFO: Access modifiers changed from: private */
    /* JADX WARN: Multi-variable type inference failed */
    public final c getWindowSize() {
        return (c) this.windowSize$delegate.getValue();
    }

    private final void setCountdownTime(CountdownTime countdownTime) {
        this.countdownTime$delegate.setValue(countdownTime);
    }

    private final void setWindowSize(c cVar) {
        this.windowSize$delegate.setValue(cVar);
    }

    public static /* synthetic */ void update$default(TextComponentState textComponentState, c cVar, CountdownTime countdownTime, int i6, Object obj) {
        if ((i6 & 1) != 0) {
            cVar = null;
        }
        if ((i6 & 2) != 0) {
            countdownTime = textComponentState.getCountdownTime();
        }
        textComponentState.update(cVar, countdownTime);
    }

    public final Package getApplicablePackage() {
        return (Package) this.applicablePackage$delegate.getValue();
    }

    public final /* synthetic */ ColorStyles getBackgroundColor() {
        return (ColorStyles) this.backgroundColor$delegate.getValue();
    }

    public final /* synthetic */ ColorStyles getColor() {
        return (ColorStyles) this.color$delegate.getValue();
    }

    public final /* synthetic */ CountdownComponent.CountFrom getCountFrom() {
        return this.style.getCountFrom();
    }

    /* JADX WARN: Multi-variable type inference failed */
    public final CountdownTime getCountdownTime() {
        return (CountdownTime) this.countdownTime$delegate.getValue();
    }

    public final /* synthetic */ AbstractC0808v getFontFamily() {
        return (AbstractC0808v) this.fontFamily$delegate.getValue();
    }

    public final /* synthetic */ int getFontSize() {
        return ((Number) this.fontSize$delegate.getValue()).intValue();
    }

    public final /* synthetic */ I getFontWeight() {
        return (I) this.fontWeight$delegate.getValue();
    }

    public final /* synthetic */ InterfaceC2240d getHorizontalAlignment() {
        return (InterfaceC2240d) this.horizontalAlignment$delegate.getValue();
    }

    public final /* synthetic */ NonEmptyMap getLocalizedVariableKeys() {
        return (NonEmptyMap) this.localizedVariableKeys$delegate.getValue();
    }

    public final /* synthetic */ H0 getMargin() {
        return (H0) this.margin$delegate.getValue();
    }

    public final /* synthetic */ H0 getPadding() {
        return (H0) this.padding$delegate.getValue();
    }

    public final /* synthetic */ Size getSize() {
        return (Size) this.size$delegate.getValue();
    }

    public final SubscriptionOption getSubscriptionOption() {
        return (SubscriptionOption) this.subscriptionOption$delegate.getValue();
    }

    public final /* synthetic */ String getText() {
        return (String) this.text$delegate.getValue();
    }

    /* JADX INFO: renamed from: getTextAlign-buA522U, reason: not valid java name */
    public final /* synthetic */ C2023k m807getTextAlignbuA522U() {
        return (C2023k) this.textAlign$delegate.getValue();
    }

    public final /* synthetic */ boolean getVisible() {
        return ((Boolean) this.visible$delegate.getValue()).booleanValue();
    }

    public final /* synthetic */ void update(c cVar, CountdownTime countdownTime) {
        if (cVar != null) {
            setWindowSize(cVar);
        }
        setCountdownTime(countdownTime);
    }

    public /* synthetic */ TextComponentState(c cVar, TextComponentStyle textComponentStyle, a aVar, a aVar2, a aVar3, a aVar4, a aVar5, int i6, h hVar) {
        this(cVar, textComponentStyle, aVar, aVar2, aVar3, aVar4, (i6 & 64) != 0 ? AnonymousClass1.INSTANCE : aVar5);
    }
}
