package com.android.billingclient.api; import com.google.android.gms.internal.play_billing.zzai; import java.util.HashSet; import java.util.Iterator; import java.util.List; /* loaded from: classes.dex */ public final class g { /* renamed from: a, reason: collision with root package name */ private final zzai f4018a; public static class a { /* renamed from: a, reason: collision with root package name */ private zzai f4019a; /* synthetic */ a(n1.g0 g0Var) { } public g a() { return new g(this, null); } public a b(List list) { if (list == null || list.isEmpty()) { throw new IllegalArgumentException("Product list cannot be empty."); } HashSet hashSet = new HashSet(); Iterator it = list.iterator(); while (it.hasNext()) { b bVar = (b) it.next(); if (!"play_pass_subs".equals(bVar.c())) { hashSet.add(bVar.c()); } } if (hashSet.size() > 1) { throw new IllegalArgumentException("All products should be of the same product type."); } this.f4019a = zzai.zzj(list); return this; } } public static class b { /* renamed from: a, reason: collision with root package name */ private final String f4020a; /* renamed from: b, reason: collision with root package name */ private final String f4021b; public static class a { /* renamed from: a, reason: collision with root package name */ private String f4022a; /* renamed from: b, reason: collision with root package name */ private String f4023b; /* synthetic */ a(n1.h0 h0Var) { } public b a() { if ("first_party".equals(this.f4023b)) { throw new IllegalArgumentException("Serialized doc id must be provided for first party products."); } if (this.f4022a == null) { throw new IllegalArgumentException("Product id must be provided."); } if (this.f4023b != null) { return new b(this, null); } throw new IllegalArgumentException("Product type must be provided."); } public a b(String str) { this.f4022a = str; return this; } public a c(String str) { this.f4023b = str; return this; } } /* synthetic */ b(a aVar, n1.i0 i0Var) { this.f4020a = aVar.f4022a; this.f4021b = aVar.f4023b; } public static a a() { return new a(null); } public final String b() { return this.f4020a; } public final String c() { return this.f4021b; } } /* synthetic */ g(a aVar, n1.j0 j0Var) { this.f4018a = aVar.f4019a; } public static a a() { return new a(null); } public final zzai b() { return this.f4018a; } public final String c() { return ((b) this.f4018a.get(0)).c(); } }