package com.revenuecat.purchases.models;

import A0.a;
import E3.v;
import I2.C0336u;
import com.revenuecat.purchases.ExperimentalPreviewRevenueCatPurchasesAPI;
import com.revenuecat.purchases.ProductType;
import java.util.List;
import kotlin.jvm.internal.h;
import kotlin.jvm.internal.o;
import q.AbstractC2761L;

/* JADX INFO: loaded from: classes3.dex */
public abstract class GooglePurchasingData implements PurchasingData {

    public static final class InAppProduct extends GooglePurchasingData {
        private final C0336u productDetails;
        private final String productId;

        /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
        public InAppProduct(String productId, C0336u productDetails) {
            super(null);
            o.h(productId, "productId");
            o.h(productDetails, "productDetails");
            this.productId = productId;
            this.productDetails = productDetails;
        }

        public boolean equals(Object obj) {
            if (this == obj) {
                return true;
            }
            if (!(obj instanceof InAppProduct)) {
                return false;
            }
            InAppProduct inAppProduct = (InAppProduct) obj;
            return o.c(this.productId, inAppProduct.productId) && o.c(this.productDetails, inAppProduct.productDetails);
        }

        public final C0336u getProductDetails() {
            return this.productDetails;
        }

        @Override // com.revenuecat.purchases.models.PurchasingData
        public String getProductId() {
            return this.productId;
        }

        public int hashCode() {
            return this.productDetails.f2665a.hashCode() + (this.productId.hashCode() * 31);
        }

        public String toString() {
            return "InAppProduct(productId=" + this.productId + ", productDetails=" + this.productDetails + ')';
        }
    }

    public static final class Subscription extends GooglePurchasingData {
        private final List<GooglePurchasingData> addOnProducts;
        private final Period billingPeriod;
        private final String optionId;
        private final C0336u productDetails;
        private final String productId;
        private final String token;

        public /* synthetic */ Subscription(String str, String str2, C0336u c0336u, String str3, Period period, List list, int i6, h hVar) {
            this(str, str2, c0336u, str3, (i6 & 16) != 0 ? null : period, (i6 & 32) != 0 ? null : list);
        }

        @ExperimentalPreviewRevenueCatPurchasesAPI
        public static /* synthetic */ void getAddOnProducts$annotations() {
        }

        @ExperimentalPreviewRevenueCatPurchasesAPI
        public static /* synthetic */ void getBillingPeriod$annotations() {
        }

        public boolean equals(Object obj) {
            if (this == obj) {
                return true;
            }
            if (!(obj instanceof Subscription)) {
                return false;
            }
            Subscription subscription = (Subscription) obj;
            return o.c(this.productId, subscription.productId) && o.c(this.optionId, subscription.optionId) && o.c(this.productDetails, subscription.productDetails) && o.c(this.token, subscription.token) && o.c(this.billingPeriod, subscription.billingPeriod) && o.c(this.addOnProducts, subscription.addOnProducts);
        }

        public final /* synthetic */ List getAddOnProducts() {
            return this.addOnProducts;
        }

        public final /* synthetic */ Period getBillingPeriod() {
            return this.billingPeriod;
        }

        public final String getOptionId() {
            return this.optionId;
        }

        public final C0336u getProductDetails() {
            return this.productDetails;
        }

        @Override // com.revenuecat.purchases.models.PurchasingData
        public String getProductId() {
            return this.productId;
        }

        public final String getToken() {
            return this.token;
        }

        public int hashCode() {
            int iB = AbstractC2761L.b(AbstractC2761L.b(AbstractC2761L.b(this.productId.hashCode() * 31, 31, this.optionId), 31, this.productDetails.f2665a), 31, this.token);
            Period period = this.billingPeriod;
            int iHashCode = (iB + (period == null ? 0 : period.hashCode())) * 31;
            List<GooglePurchasingData> list = this.addOnProducts;
            return iHashCode + (list != null ? list.hashCode() : 0);
        }

        public String toString() {
            StringBuilder sb = new StringBuilder("Subscription(productId=");
            sb.append(this.productId);
            sb.append(", optionId=");
            sb.append(this.optionId);
            sb.append(", productDetails=");
            sb.append(this.productDetails);
            sb.append(", token=");
            sb.append(this.token);
            sb.append(", billingPeriod=");
            sb.append(this.billingPeriod);
            sb.append(", addOnProducts=");
            return a.o(sb, this.addOnProducts, ')');
        }

        /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
        /* JADX WARN: Multi-variable type inference failed */
        @ExperimentalPreviewRevenueCatPurchasesAPI
        public Subscription(String productId, String optionId, C0336u productDetails, String token, Period period, List<? extends GooglePurchasingData> list) {
            super(null);
            o.h(productId, "productId");
            o.h(optionId, "optionId");
            o.h(productDetails, "productDetails");
            o.h(token, "token");
            this.productId = productId;
            this.optionId = optionId;
            this.productDetails = productDetails;
            this.token = token;
            this.billingPeriod = period;
            this.addOnProducts = list;
        }

        /* JADX WARN: 'this' call moved to the top of the method (can break code semantics) */
        public Subscription(String productId, String optionId, C0336u productDetails, String token) {
            this(productId, optionId, productDetails, token, null, null);
            o.h(productId, "productId");
            o.h(optionId, "optionId");
            o.h(productDetails, "productDetails");
            o.h(token, "token");
        }
    }

    public /* synthetic */ GooglePurchasingData(h hVar) {
        this();
    }

    @Override // com.revenuecat.purchases.models.PurchasingData
    public ProductType getProductType() {
        if (this instanceof InAppProduct) {
            return ProductType.INAPP;
        }
        if (this instanceof Subscription) {
            return ProductType.SUBS;
        }
        throw new v();
    }

    private GooglePurchasingData() {
    }
}
