package defpackage;

import java.util.Date;
import java.util.HashMap;
import java.util.Map;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;

/* renamed from: ᵕˀ, reason: contains not printable characters */
/* loaded from: classes3.dex */
public final class C2275 {

    /* renamed from: ᵹᵝᵶ, reason: contains not printable characters */
    public static final Date f8890 = new Date(0);

    /* renamed from: ˇʼʤˎ, reason: contains not printable characters */
    public final JSONObject f8891;

    /* renamed from: ˎˏʜʾ, reason: contains not printable characters */
    public final JSONArray f8892;

    /* renamed from: ˏˋٴ, reason: contains not printable characters */
    public final long f8893;

    /* renamed from: ˏᵙ, reason: contains not printable characters */
    public final Date f8894;

    /* renamed from: ᵥᵯˎ, reason: contains not printable characters */
    public final JSONObject f8895;

    /* renamed from: ᵴᵳ, reason: contains not printable characters */
    public final JSONObject f8896;

    /* renamed from: ᵻᵢﹳᵰ, reason: contains not printable characters */
    public final JSONArray f8897;

    public C2275(JSONObject jSONObject, Date date, JSONArray jSONArray, JSONObject jSONObject2, long j, JSONArray jSONArray2) throws JSONException {
        JSONObject jSONObject3 = new JSONObject();
        jSONObject3.put("configs_key", jSONObject);
        jSONObject3.put("fetch_time_key", date.getTime());
        jSONObject3.put("abt_experiments_key", jSONArray);
        jSONObject3.put("personalization_metadata_key", jSONObject2);
        jSONObject3.put("template_version_number_key", j);
        jSONObject3.put("rollout_metadata_key", jSONArray2);
        this.f8896 = jSONObject;
        this.f8894 = date;
        this.f8897 = jSONArray;
        this.f8891 = jSONObject2;
        this.f8893 = j;
        this.f8892 = jSONArray2;
        this.f8895 = jSONObject3;
    }

    /* renamed from: ᵥᵯˎ, reason: contains not printable characters */
    public static C2275 m5946(JSONObject jSONObject) throws JSONException {
        JSONObject jSONObjectOptJSONObject = jSONObject.optJSONObject("personalization_metadata_key");
        if (jSONObjectOptJSONObject == null) {
            jSONObjectOptJSONObject = new JSONObject();
        }
        JSONObject jSONObject2 = jSONObjectOptJSONObject;
        JSONArray jSONArrayOptJSONArray = jSONObject.optJSONArray("rollout_metadata_key");
        if (jSONArrayOptJSONArray == null) {
            jSONArrayOptJSONArray = new JSONArray();
        }
        return new C2275(jSONObject.getJSONObject("configs_key"), new Date(jSONObject.getLong("fetch_time_key")), jSONObject.getJSONArray("abt_experiments_key"), jSONObject2, jSONObject.optLong("template_version_number_key"), jSONArrayOptJSONArray);
    }

    /* renamed from: ᵻᵢﹳᵰ, reason: contains not printable characters */
    public static C3356 m5947() {
        C3356 c3356 = new C3356();
        c3356.f12559 = new JSONObject();
        c3356.f12560 = f8890;
        c3356.f12558 = new JSONArray();
        c3356.f12561 = new JSONObject();
        c3356.f12556 = 0L;
        c3356.f12557 = new JSONArray();
        return c3356;
    }

    public final boolean equals(Object obj) {
        if (this == obj) {
            return true;
        }
        if (obj instanceof C2275) {
            return this.f8895.toString().equals(((C2275) obj).f8895.toString());
        }
        return false;
    }

    public final int hashCode() {
        return this.f8895.hashCode();
    }

    public final String toString() {
        return this.f8895.toString();
    }

    /* renamed from: ˏᵙ, reason: contains not printable characters */
    public final HashMap m5948() throws JSONException {
        HashMap map = new HashMap();
        int i = 0;
        while (true) {
            JSONArray jSONArray = this.f8892;
            if (i >= jSONArray.length()) {
                return map;
            }
            JSONObject jSONObject = jSONArray.getJSONObject(i);
            String string = jSONObject.getString("rolloutId");
            String string2 = jSONObject.getString("variantId");
            JSONArray jSONArray2 = jSONObject.getJSONArray("affectedParameterKeys");
            for (int i2 = 0; i2 < jSONArray2.length(); i2++) {
                String string3 = jSONArray2.getString(i2);
                if (!map.containsKey(string3)) {
                    map.put(string3, new HashMap());
                }
                Map map2 = (Map) map.get(string3);
                if (map2 != null) {
                    map2.put(string, string2);
                }
            }
            i++;
        }
    }

    /* renamed from: ᵴᵳ, reason: contains not printable characters */
    public final HashMap m5949() throws JSONException {
        HashMap map = new HashMap();
        int i = 0;
        while (true) {
            JSONArray jSONArray = this.f8897;
            if (i >= jSONArray.length()) {
                return map;
            }
            JSONObject jSONObject = jSONArray.getJSONObject(i);
            if (jSONObject.has("affectedParameterKeys") && !jSONObject.getString("experimentId").startsWith("rollout")) {
                JSONArray jSONArray2 = jSONObject.getJSONArray("affectedParameterKeys");
                for (int i2 = 0; i2 < jSONArray2.length(); i2++) {
                    map.put(jSONArray2.getString(i2), jSONObject);
                }
            }
            i++;
        }
    }
}
