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

import J4.a;
import com.revenuecat.purchases.paywalls.components.PartialStackComponent;
import com.revenuecat.purchases.paywalls.components.properties.Size;
import com.revenuecat.purchases.ui.revenuecatui.components.PresentedStackPartial;
import kotlin.jvm.internal.p;

/* JADX INFO: loaded from: classes3.dex */
public final class StackComponentState$size$2 extends p implements a {
    final /* synthetic */ StackComponentState this$0;

    /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
    public StackComponentState$size$2(StackComponentState stackComponentState) {
        super(0);
        this.this$0 = stackComponentState;
    }

    @Override // J4.a
    public final Size invoke() {
        Size size;
        PartialStackComponent partial;
        StackComponentState stackComponentState = this.this$0;
        PresentedStackPartial presentedPartial = stackComponentState.getPresentedPartial();
        if (presentedPartial == null || (partial = presentedPartial.getPartial()) == null || (size = partial.getSize()) == null) {
            size = this.this$0.style.getSize();
        }
        return stackComponentState.adjustForMargin(size, this.this$0.getMargin(), this.this$0.getLayoutDirection());
    }
}
